From 3612c2049199ecbbce10d7b39a6882a63b53ae38 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@18797224-902f-48f8-a5cc-f745e15eee43> Date: Thu, 30 Apr 1998 08:18:44 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'OJI_19980430_BRANCH'. git-svn-id: svn://10.0.0.236/branches/OJI_19980430_BRANCH@905 18797224-902f-48f8-a5cc-f745e15eee43 --- CVSROOT/modules | 293 - README/mozilla/IDEMenuBar.gif | Bin 1575 -> 0 bytes README/mozilla/IDEPrefs.gif | Bin 12532 -> 0 bytes README/mozilla/macbuild.htm | 875 -- README/mozilla/unixbuild.htm | 82 - README/mozilla/winbuild.htm | 220 - README/mozilla/wininstall.htm | 53 - README/raptor/winbuild.html | 180 - buildtools/windows/bin/README | 26 - buildtools/windows/bin/alpha/gmake.exe | Bin 256512 -> 0 bytes buildtools/windows/bin/alpha/nsinstall.exe | Bin 77312 -> 0 bytes buildtools/windows/bin/alpha/shmsdos.exe | Bin 123904 -> 0 bytes buildtools/windows/bin/alpha/uname.exe | Bin 75264 -> 0 bytes buildtools/windows/bin/x86/gmake.exe | Bin 152064 -> 0 bytes buildtools/windows/bin/x86/nsinstall.exe | Bin 30208 -> 0 bytes buildtools/windows/bin/x86/shmsdos.exe | Bin 58368 -> 0 bytes buildtools/windows/bin/x86/uname.exe | Bin 28160 -> 0 bytes buildtools/windows/source/make/COPYING | 339 - buildtools/windows/source/make/ChangeLog | 3263 ------ buildtools/windows/source/make/INSTALL | 176 - buildtools/windows/source/make/Makefile | 62 - buildtools/windows/source/make/Makefile.in | 307 - buildtools/windows/source/make/NEWS | 557 -- buildtools/windows/source/make/NMakefile | 128 - buildtools/windows/source/make/README | 28 - buildtools/windows/source/make/README.MOZILLA | 16 - buildtools/windows/source/make/acconfig.h | 17 - buildtools/windows/source/make/alloca.c | 492 - buildtools/windows/source/make/ar.c | 317 - buildtools/windows/source/make/arscan.c | 561 -- buildtools/windows/source/make/build.sh.in | 69 - buildtools/windows/source/make/commands.c | 521 - buildtools/windows/source/make/commands.h | 42 - buildtools/windows/source/make/config.h | 275 - buildtools/windows/source/make/config.h.in | 270 - buildtools/windows/source/make/configh.dos | 136 - buildtools/windows/source/make/configure | 2991 ------ buildtools/windows/source/make/configure.bat | 88 - buildtools/windows/source/make/configure.in | 131 - buildtools/windows/source/make/default.c | 403 - buildtools/windows/source/make/dep.h | 66 - buildtools/windows/source/make/dir.c | 760 -- buildtools/windows/source/make/expand.c | 456 - buildtools/windows/source/make/file.c | 566 -- buildtools/windows/source/make/file.h | 111 - buildtools/windows/source/make/function.c | 1329 --- buildtools/windows/source/make/getloadavg.c | 938 -- buildtools/windows/source/make/getopt.c | 763 -- buildtools/windows/source/make/getopt.h | 129 - buildtools/windows/source/make/getopt1.c | 180 - buildtools/windows/source/make/glob.c | 705 -- .../windows/source/make/glob/COPYING.LIB | 481 - buildtools/windows/source/make/glob/Makefile | 28 - .../windows/source/make/glob/Makefile.in | 66 - buildtools/windows/source/make/glob/configure | 1547 --- .../windows/source/make/glob/configure.bat | 52 - .../windows/source/make/glob/configure.in | 19 - buildtools/windows/source/make/glob/fnmatch.c | 200 - buildtools/windows/source/make/glob/fnmatch.h | 67 - buildtools/windows/source/make/glob/glob.c | 705 -- buildtools/windows/source/make/glob/glob.h | 97 - buildtools/windows/source/make/implicit.c | 590 -- buildtools/windows/source/make/install-sh | 238 - buildtools/windows/source/make/job.c | 1888 ---- buildtools/windows/source/make/job.h | 67 - buildtools/windows/source/make/main.c | 2035 ---- buildtools/windows/source/make/make-stds.texi | 656 -- buildtools/windows/source/make/make.aux | 354 - buildtools/windows/source/make/make.cp | 701 -- buildtools/windows/source/make/make.cps | 652 -- buildtools/windows/source/make/make.fn | 149 - buildtools/windows/source/make/make.fns | 165 - buildtools/windows/source/make/make.h | 355 - buildtools/windows/source/make/make.info | 163 - buildtools/windows/source/make/make.info-1 | 1122 --- buildtools/windows/source/make/make.info-2 | 1195 --- buildtools/windows/source/make/make.info-3 | 1228 --- buildtools/windows/source/make/make.info-4 | 1296 --- buildtools/windows/source/make/make.info-5 | 1131 --- buildtools/windows/source/make/make.info-6 | 1215 --- buildtools/windows/source/make/make.info-7 | 727 -- buildtools/windows/source/make/make.info-8 | 896 -- buildtools/windows/source/make/make.man | 302 - buildtools/windows/source/make/make.texinfo | 8830 ----------------- buildtools/windows/source/make/make.toc | 118 - buildtools/windows/source/make/misc.c | 739 -- buildtools/windows/source/make/mkinstalldirs | 32 - buildtools/windows/source/make/read.c | 2067 ---- buildtools/windows/source/make/remake.c | 1086 -- buildtools/windows/source/make/remote-cstms.c | 270 - buildtools/windows/source/make/remote-stub.c | 92 - buildtools/windows/source/make/rule.c | 571 -- buildtools/windows/source/make/rule.h | 53 - buildtools/windows/source/make/signame.c | 304 - buildtools/windows/source/make/signame.h | 65 - buildtools/windows/source/make/texinfo.tex | 4421 --------- buildtools/windows/source/make/variable.c | 822 -- buildtools/windows/source/make/variable.h | 100 - buildtools/windows/source/make/version.c | 7 - buildtools/windows/source/make/vpath.c | 487 - buildtools/windows/source/make/windir.h | 21 - buildtools/windows/source/shmsdos/README | 27 - buildtools/windows/source/shmsdos/nsinstall.c | 697 -- .../windows/source/shmsdos/nsinstall.mak | 141 - buildtools/windows/source/shmsdos/shmsdos.c | 2573 ----- buildtools/windows/source/shmsdos/shmsdos.mak | 141 - buildtools/windows/source/uname/README | 9 - buildtools/windows/source/uname/uname.c | 155 - buildtools/windows/source/uname/uname.mak | 141 - .../client/windows/docs/installer/IS1.JPG | Bin 8087 -> 0 bytes .../windows/docs/installer/L10NTREE.JPG | Bin 4513 -> 0 bytes .../client/windows/docs/installer/SPLASH.JPG | Bin 20208 -> 0 bytes .../windows/docs/installer/branding.html | 40 - .../docs/installer/gettingStarted.html | 100 - .../windows/docs/installer/isocodes.htm | 203 - .../windows/docs/installer/kitOverview.html | 99 - .../windows/docs/installer/kitStruct.html | 63 - .../windows/docs/installer/localizeAim.html | 51 - .../windows/docs/installer/localizeCD.html | 65 - .../windows/docs/installer/localizeCosmo.html | 62 - .../docs/installer/localizeIsuser.html | 32 - .../docs/installer/localizeMmedia.html | 45 - .../windows/docs/installer/localizeMplay.html | 68 - .../windows/docs/installer/localizeNav40.html | 154 - .../docs/installer/localizeNetcast.html | 49 - .../docs/installer/localizeNsconf.html | 67 - .../docs/installer/localizeRsutil.html | 71 - .../windows/docs/installer/localizeSetup.html | 138 - .../windows/docs/installer/localizeURL.html | 55 - .../docs/installer/localize_these_files.html | 125 - .../windows/docs/installer/nomenclature.html | 109 - .../docs/installer/projectOverview.html | 57 - .../windows/docs/installer/reference.html | 54 - .../docs/installer/registrySettings.html | 612 -- .../windows/docs/installer/reportingBugs.html | 53 - .../windows/docs/installer/returnKit.html | 54 - .../client/windows/docs/installer/splash.html | 47 - .../windows/docs/installer/testKit.html | 150 - .../client/windows/docs/installer/toc.html | 106 - .../windows/docs/installer/usingKit.html | 323 - l10nkits/client/windows/docs/nav40/SPLASH.JPG | Bin 19447 -> 0 bytes l10nkits/client/windows/docs/nav40/allxpstr.h | 7878 --------------- .../client/windows/docs/nav40/branding.html | 40 - .../client/windows/docs/nav40/charsets.htm | 383 - .../windows/docs/nav40/gettingStarted.html | 100 - .../client/windows/docs/nav40/idBuild.jpg | Bin 57205 -> 0 bytes .../client/windows/docs/nav40/image5LE.JPG | Bin 1067 -> 0 bytes .../client/windows/docs/nav40/imageEJR.JPG | Bin 21513 -> 0 bytes .../client/windows/docs/nav40/imageGAN.JPG | Bin 871 -> 0 bytes .../client/windows/docs/nav40/imageGHT.JPG | Bin 1103 -> 0 bytes .../client/windows/docs/nav40/imageQC9.JPG | Bin 6256 -> 0 bytes .../client/windows/docs/nav40/isocodes.htm | 203 - .../client/windows/docs/nav40/isonames.htm | 1029 -- .../windows/docs/nav40/kitOverview.html | 44 - .../client/windows/docs/nav40/kitStruct.html | 75 - .../client/windows/docs/nav40/l10ntree.jpg | Bin 5947 -> 0 bytes .../windows/docs/nav40/localizeAboutplg.html | 81 - .../windows/docs/nav40/localizeAllPref.html | 154 - .../windows/docs/nav40/localizeBookmarks.html | 36 - .../docs/nav40/localizeConfigPref.html | 108 - .../windows/docs/nav40/localizeLicense.html | 67 - .../windows/docs/nav40/localizeNpnul.html | 42 - .../windows/docs/nav40/localizeURL.html | 55 - .../docs/nav40/localize_these_files.html | 141 - .../windows/docs/nav40/nomenclature.html | 108 - l10nkits/client/windows/docs/nav40/pixel.gif | Bin 41 -> 0 bytes .../windows/docs/nav40/projectOverview.html | 73 - .../client/windows/docs/nav40/reference.html | 77 - .../windows/docs/nav40/reportingBugs.html | 54 - l10nkits/client/windows/docs/nav40/resource.h | 3949 -------- .../client/windows/docs/nav40/returnKit.html | 58 - .../client/windows/docs/nav40/splash.html | 47 - .../client/windows/docs/nav40/testKit.html | 130 - l10nkits/client/windows/docs/nav40/toc.html | 132 - .../windows/docs/nav40/troubleshooting.html | 125 - .../client/windows/docs/nav40/usingKit.html | 432 - .../client/windows/docs/nav40/winfekit.jpg | Bin 4486 -> 0 bytes .../client/windows/docs/nav40/xpencui.htm | 215 - .../xp/docs/mozilla.org/kitDownload.html | 118 - .../xp/docs/mozilla.org/l10nLibrary.html | 58 - .../xp/docs/mozilla.org/l10nkitintro.html | 148 - .../client/xp/docs/mozilla.org/ulpFAQ.html | 375 - .../xp/docs/mozilla.org/ulpLicense.html | 330 - mozilla/base/Makefile | 24 - mozilla/base/makefile.win | 23 - mozilla/base/src/Makefile | 68 - mozilla/base/src/makefile.win | 77 - mozilla/base/src/nsArena.cpp | 80 - mozilla/base/src/nsAtomTable.cpp | 144 - mozilla/base/src/nsBTree.cpp | 403 - mozilla/base/src/nsBTree.h | 283 - mozilla/base/src/nsByteBuffer.cpp | 135 - mozilla/base/src/nsCRT.cpp | 290 - mozilla/base/src/nsCRT.h | 110 - mozilla/base/src/nsDeque.cpp | 414 - mozilla/base/src/nsDeque.h | 348 - mozilla/base/src/nsIArena.h | 51 - mozilla/base/src/nsIAtom.h | 71 - mozilla/base/src/nsIByteBuffer.h | 56 - mozilla/base/src/nsIInputStream.h | 74 - mozilla/base/src/nsITimer.h | 86 - mozilla/base/src/nsITimerCallback.h | 41 - mozilla/base/src/nsIURL.h | 90 - mozilla/base/src/nsIUnicharBuffer.h | 46 - mozilla/base/src/nsIUnicharInputStream.h | 98 - mozilla/base/src/nsInputStream.cpp | 192 - mozilla/base/src/nsRBTree.cpp | 423 - mozilla/base/src/nsRBTree.h | 223 - mozilla/base/src/nsString.cpp | 2056 ---- mozilla/base/src/nsString.h | 237 - mozilla/base/src/nsURL.cpp | 344 - mozilla/base/src/nsUnicharBuffer.cpp | 137 - mozilla/base/src/nsUnicharInputStream.cpp | 328 - mozilla/base/src/nsUnitConversion.h | 71 - mozilla/base/src/nsVoidArray.cpp | 172 - mozilla/base/src/nsVoidArray.h | 64 - mozilla/base/src/nscore.h | 100 - mozilla/base/src/windows/makefile.win | 40 - mozilla/base/src/windows/nsTimer.cpp | 364 - mozilla/base/tests/CvtURL.cpp | 104 - mozilla/base/tests/Makefile | 55 - mozilla/base/tests/TestAtoms.cpp | 108 - mozilla/base/tests/TestCRT.cpp | 89 - mozilla/base/tests/TimerTest.cpp | 202 - mozilla/base/tests/makefile.win | 75 - mozilla/base/tests/resources.h | 32 - mozilla/base/tests/timer.rc | 38 - mozilla/content/base/public/nsIContent.h | 116 - mozilla/content/base/public/nsIDocument.h | 160 - .../base/public/nsIDocumentContainer.h | 71 - .../content/base/public/nsIDocumentObserver.h | 160 - mozilla/content/base/public/nsIStyleRule.h | 43 - mozilla/content/base/public/nsIStyleSheet.h | 50 - mozilla/content/base/public/nsITextContent.h | 48 - mozilla/content/base/src/nsDocument.cpp | 630 -- mozilla/content/base/src/nsDocument.h | 188 - mozilla/content/base/src/nsHTMLValue.cpp | 257 - mozilla/content/base/src/nsHTMLValue.h | 138 - mozilla/content/base/src/nsSelection.cpp | 88 - mozilla/content/base/src/nsStyleContext.cpp | 545 - mozilla/content/base/src/nsStyleSet.cpp | 530 - .../html/content/public/nsIHTMLContent.h | 89 - .../content/html/content/src/nsHTMLAtoms.cpp | 370 - .../content/html/content/src/nsHTMLAtoms.h | 169 - .../html/document/src/nsHTMLContentSink.cpp | 1315 --- .../html/document/src/nsHTMLDocument.cpp | 225 - .../html/document/src/nsHTMLDocument.h | 67 - .../html/document/src/nsIHTMLDocument.h | 41 - .../content/html/style/public/nsICSSParser.h | 56 - .../html/style/src/nsCSSDeclaration.cpp | 1435 --- .../content/html/style/src/nsCSSKeywords.h | 40 - .../content/html/style/src/nsCSSLayout.cpp | 262 - .../content/html/style/src/nsCSSParser.cpp | 2209 ----- mozilla/content/html/style/src/nsCSSProps.h | 40 - .../content/html/style/src/nsCSSScanner.cpp | 585 -- mozilla/content/html/style/src/nsCSSScanner.h | 118 - .../content/html/style/src/nsCSSStruct.cpp | 1435 --- .../content/html/style/src/nsCSSStyleRule.cpp | 1047 -- .../html/style/src/nsCSSStyleSheet.cpp | 368 - .../html/style/src/nsHTMLAttributes.cpp | 672 -- .../html/style/src/nsHTMLStyleSheet.cpp | 214 - .../content/html/style/src/nsHTMLValue.cpp | 257 - mozilla/content/html/style/src/nsHTMLValue.h | 138 - .../html/style/src/nsICSSDeclaration.h | 318 - .../content/html/style/src/nsICSSStyleRule.h | 76 - .../html/style/src/nsIHTMLAttributes.h | 59 - mozilla/content/shared/public/nsCSSKeywords.h | 40 - mozilla/content/shared/public/nsCSSProps.h | 40 - mozilla/content/shared/public/nsHTMLAtoms.h | 169 - mozilla/content/shared/public/nsHTMLValue.h | 138 - mozilla/content/shared/public/nsStyleCoord.h | 100 - mozilla/content/shared/src/nsCSSKeywords.cpp | 399 - mozilla/content/shared/src/nsCSSProps.cpp | 360 - mozilla/content/shared/src/nsHTMLAtoms.cpp | 370 - mozilla/content/shared/src/nsHTMLValue.cpp | 257 - mozilla/dom/Makefile | 24 - mozilla/dom/makefile.win | 22 - mozilla/dom/public/Makefile | 34 - mozilla/dom/public/coreDom/Makefile | 38 - mozilla/dom/public/coreDom/makefile.win | 28 - mozilla/dom/public/coreDom/nsDOM.h | 59 - mozilla/dom/public/coreDom/nsIDOMAttribute.h | 164 - mozilla/dom/public/coreDom/nsIDOMComment.h | 38 - mozilla/dom/public/coreDom/nsIDOMDocument.h | 256 - mozilla/dom/public/coreDom/nsIDOMElement.h | 133 - mozilla/dom/public/coreDom/nsIDOMIterators.h | 145 - mozilla/dom/public/coreDom/nsIDOMNode.h | 146 - mozilla/dom/public/coreDom/nsIDOMPI.h | 37 - mozilla/dom/public/coreDom/nsIDOMText.h | 116 - mozilla/dom/public/makefile.win | 28 - mozilla/dom/public/nsIScriptContext.h | 95 - mozilla/dom/public/nsIScriptObject.h | 50 - mozilla/dom/public/nsIScriptObjectOwner.h | 97 - mozilla/dom/src/Makefile | 44 - mozilla/dom/src/makefile.win | 67 - mozilla/dom/src/nsJSAttribute.cpp | 291 - mozilla/dom/src/nsJSAttributeList.cpp | 371 - mozilla/dom/src/nsJSDocument.cpp | 353 - mozilla/dom/src/nsJSElement.cpp | 478 - mozilla/dom/src/nsJSEnvironment.cpp | 130 - mozilla/dom/src/nsJSEnvironment.h | 54 - mozilla/dom/src/nsJSNode.cpp | 538 - mozilla/dom/src/nsJSNodeIterator.cpp | 415 - mozilla/dom/src/nsJSText.cpp | 316 - mozilla/dom/src/nsJSWindow.cpp | 262 - mozilla/dom/tests/js/DumpHTML.js | Bin 2025 -> 0 bytes mozilla/dom/tests/js/DumpTree.js | 58 - mozilla/dom/tests/js/HTMLString.js | 80 - mozilla/dom/tests/js/simple.js | 56 - mozilla/gfx/Makefile | 24 - mozilla/gfx/makefile.win | 22 - mozilla/gfx/src/Makefile | 41 - mozilla/gfx/src/makefile.win | 77 - mozilla/gfx/src/nsColor.cpp | 111 - mozilla/gfx/src/nsColor.h | 52 - mozilla/gfx/src/nsColorNameIDs.h | 142 - mozilla/gfx/src/nsColorNames.cpp | 566 -- mozilla/gfx/src/nsColorNames.h | 44 - mozilla/gfx/src/nsColorNamesRGB.cpp | 144 - mozilla/gfx/src/nsCoord.h | 38 - mozilla/gfx/src/nsFont.cpp | 80 - mozilla/gfx/src/nsFont.h | 86 - mozilla/gfx/src/nsFontCache.cpp | 139 - mozilla/gfx/src/nsGfxCIID.h | 42 - mozilla/gfx/src/nsIDeviceContext.h | 79 - mozilla/gfx/src/nsIFontCache.h | 68 - mozilla/gfx/src/nsIFontMetrics.h | 87 - mozilla/gfx/src/nsIImage.h | 180 - mozilla/gfx/src/nsIImageGroup.h | 118 - mozilla/gfx/src/nsIImageManager.h | 83 - mozilla/gfx/src/nsIImageObserver.h | 167 - mozilla/gfx/src/nsIImageRequest.h | 73 - mozilla/gfx/src/nsIRenderingContext.h | 382 - mozilla/gfx/src/nsImage.h | 87 - mozilla/gfx/src/nsImageGroup.cpp | 293 - mozilla/gfx/src/nsImageManager.cpp | 136 - mozilla/gfx/src/nsImageNet.h | 31 - mozilla/gfx/src/nsImageNetContext.cpp | 350 - mozilla/gfx/src/nsImageRenderer.cpp | 269 - mozilla/gfx/src/nsImageRequest.cpp | 326 - mozilla/gfx/src/nsImageRequest.h | 74 - mozilla/gfx/src/nsImageSystemServices.cpp | 134 - mozilla/gfx/src/nsImageURL.cpp | 179 - mozilla/gfx/src/nsMargin.h | 71 - mozilla/gfx/src/nsPoint.h | 61 - mozilla/gfx/src/nsRect.cpp | 173 - mozilla/gfx/src/nsRect.h | 129 - mozilla/gfx/src/nsRegion.h | 160 - mozilla/gfx/src/nsSize.h | 61 - mozilla/gfx/src/nsTransform2D.cpp | 565 -- mozilla/gfx/src/nsTransform2D.h | 211 - mozilla/gfx/src/windows/makefile.win | 60 - .../gfx/src/windows/nsDeviceContextWin.cpp | 166 - mozilla/gfx/src/windows/nsDeviceContextWin.h | 75 - mozilla/gfx/src/windows/nsFontMetricsWin.cpp | 237 - mozilla/gfx/src/windows/nsFontMetricsWin.h | 77 - mozilla/gfx/src/windows/nsGfxFactoryWin.cpp | 171 - mozilla/gfx/src/windows/nsImageWin.cpp | 399 - mozilla/gfx/src/windows/nsImageWin.h | 128 - .../gfx/src/windows/nsRenderingContextWin.cpp | 785 -- .../gfx/src/windows/nsRenderingContextWin.h | 149 - mozilla/gfx/tests/DumpColors.cpp | 32 - mozilla/gfx/tests/Makefile | 63 - mozilla/gfx/tests/TestColorNames.cpp | 114 - mozilla/gfx/tests/TestRect.cpp | 431 - mozilla/gfx/tests/btest/BitTest.cpp | 841 -- mozilla/gfx/tests/btest/image.rc | 39 - mozilla/gfx/tests/btest/makefile.win | 62 - mozilla/gfx/tests/btest/resource.h | 31 - mozilla/gfx/tests/btest/resources.h | 32 - mozilla/gfx/tests/makefile.win | 70 - mozilla/htmlparser/Makefile | 27 - mozilla/htmlparser/makefile.win | 23 - mozilla/htmlparser/robot/Makefile | 54 - mozilla/htmlparser/robot/RobotMain.cpp | 111 - mozilla/htmlparser/robot/makefile.win | 62 - mozilla/htmlparser/robot/nsIRobotSink.h | 39 - .../htmlparser/robot/nsIRobotSinkObserver.h | 34 - mozilla/htmlparser/robot/nsRobotSink.cpp | 285 - mozilla/htmlparser/src/CNavDTD.cpp | 844 -- mozilla/htmlparser/src/CNavDTD.h | 174 - mozilla/htmlparser/src/CNavDelegate.cpp | 433 - mozilla/htmlparser/src/CNavDelegate.h | 84 - mozilla/htmlparser/src/COtherDTD.cpp | 721 -- mozilla/htmlparser/src/COtherDTD.h | 175 - mozilla/htmlparser/src/COtherDelegate.cpp | 433 - mozilla/htmlparser/src/COtherDelegate.h | 85 - mozilla/htmlparser/src/Makefile | 55 - mozilla/htmlparser/src/SelfTest.cpp | 190 - mozilla/htmlparser/src/makefile.win | 70 - .../htmlparser/src/nsDefaultTokenHandler.cpp | 639 -- .../htmlparser/src/nsDefaultTokenHandler.h | 163 - mozilla/htmlparser/src/nsHTMLContentSink.cpp | 430 - mozilla/htmlparser/src/nsHTMLContentSink.h | 133 - mozilla/htmlparser/src/nsHTMLParser.cpp | 1378 --- mozilla/htmlparser/src/nsHTMLParser.h | 166 - mozilla/htmlparser/src/nsHTMLTokens.cpp | 1338 --- mozilla/htmlparser/src/nsHTMLTokens.h | 348 - mozilla/htmlparser/src/nsIContentSink.h | 90 - mozilla/htmlparser/src/nsIDTD.h | 150 - mozilla/htmlparser/src/nsIHTMLContentSink.h | 223 - mozilla/htmlparser/src/nsIParser.h | 66 - mozilla/htmlparser/src/nsIParserNode.h | 75 - mozilla/htmlparser/src/nsITokenHandler.h | 44 - mozilla/htmlparser/src/nsITokenizerDelegate.h | 61 - mozilla/htmlparser/src/nsParserNode.cpp | 205 - mozilla/htmlparser/src/nsParserNode.h | 81 - mozilla/htmlparser/src/nsParserTypes.h | 75 - mozilla/htmlparser/src/nsScanner.cpp | 312 - mozilla/htmlparser/src/nsScanner.h | 77 - mozilla/htmlparser/src/nsToken.cpp | 158 - mozilla/htmlparser/src/nsToken.h | 77 - mozilla/htmlparser/src/nsTokenHandler.cpp | 639 -- mozilla/htmlparser/src/nsTokenHandler.h | 163 - mozilla/htmlparser/src/nsTokenizer.cpp | 212 - mozilla/htmlparser/src/nsTokenizer.h | 78 - mozilla/htmlparser/src/nshtmlpars.h | 37 - mozilla/htmlparser/tests/html/Table01.html | 11 - mozilla/htmlparser/tests/html/Table02.html | 14 - mozilla/htmlparser/tests/html/Table03.html | 11 - mozilla/htmlparser/tests/html/Table04.html | 53 - mozilla/htmlparser/tests/html/Table05.html | 12 - mozilla/htmlparser/tests/html/Table05e.html | 21 - mozilla/htmlparser/tests/html/Table05f.html | 16 - mozilla/htmlparser/tests/html/Table05g.html | 13 - mozilla/htmlparser/tests/html/Table05h.html | 12 - mozilla/htmlparser/tests/html/Table05i.html | 13 - mozilla/htmlparser/tests/html/Table05j.html | 11 - mozilla/htmlparser/tests/html/Table06.html | 13 - mozilla/htmlparser/tests/html/acronym1.html | 14 - mozilla/htmlparser/tests/html/aname01.html | 17 - mozilla/htmlparser/tests/html/atoi01.html | 13 - .../tests/html/attribute_quote_bug1.html | 13 - mozilla/htmlparser/tests/html/bdo001.html | 14 - mozilla/htmlparser/tests/html/br001.html | 11 - mozilla/htmlparser/tests/html/button001.html | 19 - mozilla/htmlparser/tests/html/button002.html | 34 - mozilla/htmlparser/tests/html/center001.html | 29 - mozilla/htmlparser/tests/html/center002.html | 36 - mozilla/htmlparser/tests/html/col001.html | 21 - mozilla/htmlparser/tests/html/col002.html | 24 - mozilla/htmlparser/tests/html/col003.html | 31 - mozilla/htmlparser/tests/html/col004.html | 26 - mozilla/htmlparser/tests/html/col005.html | 39 - mozilla/htmlparser/tests/html/col006.html | 261 - mozilla/htmlparser/tests/html/col007.html | 39 - mozilla/htmlparser/tests/html/col008.html | 35 - mozilla/htmlparser/tests/html/col009.html | 29 - mozilla/htmlparser/tests/html/col010.html | 22 - mozilla/htmlparser/tests/html/col011.html | 32 - mozilla/htmlparser/tests/html/col012.html | 27 - mozilla/htmlparser/tests/html/col013.html | 22 - mozilla/htmlparser/tests/html/col014.html | 22 - mozilla/htmlparser/tests/html/col015.html | 22 - mozilla/htmlparser/tests/html/col016.html | 31 - mozilla/htmlparser/tests/html/del001.html | 14 - mozilla/htmlparser/tests/html/del002.html | 17 - mozilla/htmlparser/tests/html/del003.html | 12 - mozilla/htmlparser/tests/html/del004.html | 13 - mozilla/htmlparser/tests/html/del005.html | 22 - mozilla/htmlparser/tests/html/del006.html | 21 - mozilla/htmlparser/tests/html/del007.html | 21 - mozilla/htmlparser/tests/html/del008.html | 22 - mozilla/htmlparser/tests/html/del009.html | 19 - mozilla/htmlparser/tests/html/del010.html | 16 - mozilla/htmlparser/tests/html/del011.html | 23 - mozilla/htmlparser/tests/html/doc001.html | 0 mozilla/htmlparser/tests/html/doc002.html | 10 - mozilla/htmlparser/tests/html/endswithcr.html | 1 - mozilla/htmlparser/tests/html/entity001.html | 12 - .../htmlparser/tests/html/fieldset001.html | 22 - .../htmlparser/tests/html/fieldset002.html | 56 - .../htmlparser/tests/html/fieldset003.html | 26 - mozilla/htmlparser/tests/html/form001.html | 13 - mozilla/htmlparser/tests/html/form002.html | 22 - mozilla/htmlparser/tests/html/head01.html | 9 - mozilla/htmlparser/tests/html/head02.html | 11 - mozilla/htmlparser/tests/html/head03.html | 9 - mozilla/htmlparser/tests/html/home01.html | 976 -- mozilla/htmlparser/tests/html/html001.html | 8 - mozilla/htmlparser/tests/html/imgmap001.html | 13 - mozilla/htmlparser/tests/html/ins001.html | 14 - mozilla/htmlparser/tests/html/ins002.html | 18 - mozilla/htmlparser/tests/html/ins003.html | 13 - mozilla/htmlparser/tests/html/insdel01.html | 16 - mozilla/htmlparser/tests/html/insdel02.html | 16 - mozilla/htmlparser/tests/html/layer001.html | 20 - mozilla/htmlparser/tests/html/layer002.html | 28 - mozilla/htmlparser/tests/html/layer003.html | 29 - mozilla/htmlparser/tests/html/layer01.html | 22 - mozilla/htmlparser/tests/html/list001.html | 33 - mozilla/htmlparser/tests/html/list002.html | 15 - mozilla/htmlparser/tests/html/list003.html | 19 - mozilla/htmlparser/tests/html/newlines.html | 3 - mozilla/htmlparser/tests/html/obj001.html | 12 - mozilla/htmlparser/tests/html/obj002.html | 9 - mozilla/htmlparser/tests/html/obj003.html | 17 - mozilla/htmlparser/tests/html/param001.html | 10 - mozilla/htmlparser/tests/html/param002.html | 14 - mozilla/htmlparser/tests/html/pre001.html | 9 - mozilla/htmlparser/tests/html/pre002.html | 11 - mozilla/htmlparser/tests/html/pre003.html | 8 - mozilla/htmlparser/tests/html/pre004.html | 18 - mozilla/htmlparser/tests/html/pre005.html | 53 - mozilla/htmlparser/tests/html/pre006.html | 28 - mozilla/htmlparser/tests/html/pre007.html | 12 - mozilla/htmlparser/tests/html/pre012.html | 22 - mozilla/htmlparser/tests/html/pre015.html | 18 - mozilla/htmlparser/tests/html/pre016.html | 17 - mozilla/htmlparser/tests/html/q001.html | 18 - mozilla/htmlparser/tests/html/quote001.html | 51 - mozilla/htmlparser/tests/html/quote002.html | 33 - mozilla/htmlparser/tests/html/quote003.html | 14 - mozilla/htmlparser/tests/html/span001.html | 30 - mozilla/htmlparser/tests/html/span002.html | 21 - mozilla/htmlparser/tests/html/span003.html | 17 - mozilla/htmlparser/tests/html/strike002.html | 17 - mozilla/htmlparser/tests/html/strike005.html | 22 - mozilla/htmlparser/tests/html/strike006.html | 18 - mozilla/htmlparser/tests/html/strike007.html | 20 - mozilla/htmlparser/tests/html/strike008.html | 26 - mozilla/htmlparser/tests/html/table05a.html | 14 - mozilla/htmlparser/tests/html/table05b.html | 14 - mozilla/htmlparser/tests/html/table05c.html | 14 - mozilla/htmlparser/tests/html/table05d.html | 13 - mozilla/htmlparser/tests/html/table05k.html | 19 - mozilla/htmlparser/tests/html/table05l.html | 14 - mozilla/htmlparser/tests/html/table05m.html | 5 - mozilla/htmlparser/tests/html/table05n.html | 11 - mozilla/htmlparser/tests/html/table05o.html | 6 - mozilla/htmlparser/tests/html/table07.html | 13 - mozilla/htmlparser/tests/html/table200.html | 21 - mozilla/htmlparser/tests/html/table201.html | 22 - mozilla/htmlparser/tests/html/table202.html | 23 - mozilla/htmlparser/tests/html/table203.html | 29 - mozilla/htmlparser/tests/html/table204.html | 23 - mozilla/htmlparser/tests/html/table205.html | 28 - mozilla/htmlparser/tests/html/tableall.html | 81 - mozilla/htmlparser/tests/html/tag001.html | 3 - mozilla/htmlparser/tests/html/tag002.html | 23 - mozilla/htmlparser/tests/html/tag003.html | 10 - mozilla/htmlparser/tests/html/tag004.html | 4 - mozilla/htmlparser/tests/html/tag005.html | 7 - mozilla/htmlparser/tests/html/tag006.html | 6 - mozilla/htmlparser/tests/html/tag007.html | 5 - mozilla/htmlparser/tests/html/tag008.html | 4 - mozilla/htmlparser/tests/html/target01.html | 7 - mozilla/htmlparser/tests/html/tbody001.html | 17 - mozilla/htmlparser/tests/html/text001.html | 8 - mozilla/htmlparser/tests/html/text002.html | 8 - mozilla/htmlparser/tests/html/text003.html | 12 - mozilla/htmlparser/tests/html/thead001.html | 25 - mozilla/htmlparser/tests/html/title01.html | 6 - mozilla/htmlparser/tests/html/usascii.html | 26 - mozilla/htmlparser/tests/html/utf8001.html | 9 - mozilla/htmlparser/tests/html/value001.html | 14 - mozilla/htmlparser/tests/html/xmp005.html | 48 - mozilla/htmlparser/tests/windows/Selftest.cpp | 148 - mozilla/layout/Makefile | 24 - mozilla/layout/base/Makefile | 24 - mozilla/layout/base/makefile.win | 23 - mozilla/layout/base/nsCSSRendering.cpp | 785 -- mozilla/layout/base/nsCSSRendering.h | 89 - mozilla/layout/base/nsIPresShell.h | 103 - mozilla/layout/base/nsPresContext.cpp | 471 - mozilla/layout/base/nsPresContext.h | 150 - mozilla/layout/base/public/Makefile | 44 - mozilla/layout/base/public/makefile.win | 44 - mozilla/layout/base/public/nsIContent.h | 116 - .../layout/base/public/nsIContentDelegate.h | 45 - mozilla/layout/base/public/nsIDocument.h | 160 - .../layout/base/public/nsIDocumentContainer.h | 71 - .../layout/base/public/nsIDocumentObserver.h | 160 - mozilla/layout/base/public/nsIFrame.h | 406 - mozilla/layout/base/public/nsIPresContext.h | 150 - mozilla/layout/base/public/nsIPresShell.h | 103 - mozilla/layout/base/public/nsIRunaround.h | 112 - mozilla/layout/base/public/nsISpaceManager.h | 160 - mozilla/layout/base/public/nsIStyleContext.h | 217 - mozilla/layout/base/public/nsIStyleRule.h | 43 - mozilla/layout/base/public/nsIStyleSet.h | 81 - mozilla/layout/base/public/nsIStyleSheet.h | 50 - mozilla/layout/base/public/nsITextContent.h | 48 - mozilla/layout/base/public/nsPresContext.h | 150 - mozilla/layout/base/public/nsStyleCoord.h | 100 - mozilla/layout/base/public/nslayout.h | 32 - mozilla/layout/base/src/Makefile | 51 - mozilla/layout/base/src/makefile.win | 52 - mozilla/layout/base/src/nsContainerFrame.cpp | 1449 --- mozilla/layout/base/src/nsContainerFrame.h | 410 - mozilla/layout/base/src/nsDocument.cpp | 630 -- mozilla/layout/base/src/nsDocument.h | 188 - mozilla/layout/base/src/nsFrame.cpp | 1260 --- mozilla/layout/base/src/nsFrame.h | 228 - mozilla/layout/base/src/nsGalleyContext.cpp | 88 - mozilla/layout/base/src/nsPresContext.cpp | 471 - mozilla/layout/base/src/nsPresContext.h | 77 - mozilla/layout/base/src/nsPresShell.cpp | 603 -- .../layout/base/src/nsPrintPreviewContext.cpp | 102 - mozilla/layout/base/src/nsReflowCommand.cpp | 241 - mozilla/layout/base/src/nsReflowCommand.h | 146 - mozilla/layout/base/src/nsSelection.cpp | 88 - mozilla/layout/base/src/nsSelection.h | 65 - mozilla/layout/base/src/nsSelectionPoint.cpp | 45 - mozilla/layout/base/src/nsSelectionPoint.h | 53 - mozilla/layout/base/src/nsSelectionRange.cpp | 88 - mozilla/layout/base/src/nsSelectionRange.h | 87 - mozilla/layout/base/src/nsSpaceManager.cpp | 670 -- mozilla/layout/base/src/nsSpaceManager.h | 96 - mozilla/layout/base/src/nsSplittableFrame.cpp | 184 - mozilla/layout/base/src/nsSplittableFrame.h | 70 - mozilla/layout/base/src/nsStyleConsts.h | 215 - mozilla/layout/base/src/nsStyleContext.cpp | 545 - mozilla/layout/base/src/nsStyleCoord.cpp | 150 - mozilla/layout/base/src/nsStyleSet.cpp | 530 - mozilla/layout/base/tests/Makefile | 22 - .../layout/base/tests/TestContainerFrame.cpp | 681 -- mozilla/layout/base/tests/makefile.win | 56 - mozilla/layout/build/Makefile | 40 - mozilla/layout/build/dlldeps.cpp | 35 - mozilla/layout/build/makefile.win | 82 - mozilla/layout/generic/nsBlockFrame.cpp | 2184 ---- mozilla/layout/generic/nsBlockFrame.h | 329 - mozilla/layout/generic/nsBlockReflowState.cpp | 2184 ---- mozilla/layout/generic/nsBlockReflowState.h | 2184 ---- .../layout/generic/nsHTMLContainerFrame.cpp | 347 - mozilla/layout/generic/nsHTMLContainerFrame.h | 90 - mozilla/layout/generic/nsHTMLParts.h | 134 - mozilla/layout/generic/nsIFrame.h | 406 - mozilla/layout/generic/nsImageMap.cpp | 710 -- mozilla/layout/generic/nsInlineFrame.cpp | 1113 --- mozilla/layout/generic/nsLeafFrame.cpp | 123 - mozilla/layout/generic/nsLeafFrame.h | 80 - mozilla/layout/generic/nsPageFrame.cpp | 185 - mozilla/layout/generic/nsPageFrame.h | 56 - mozilla/layout/generic/nsPlaceholderFrame.cpp | 102 - mozilla/layout/generic/nsPlaceholderFrame.h | 58 - mozilla/layout/generic/nsSelection.cpp | 88 - mozilla/layout/generic/nsSpaceManager.cpp | 670 -- mozilla/layout/generic/nsSpaceManager.h | 96 - mozilla/layout/html/Makefile | 26 - mozilla/layout/html/base/Makefile | 24 - mozilla/layout/html/base/makefile.win | 23 - mozilla/layout/html/base/src/Makefile | 66 - .../layout/html/base/src/deadnsInlineFrame.h | 88 - mozilla/layout/html/base/src/makefile.win | 104 - .../layout/html/base/src/nsAbsoluteFrame.cpp | 319 - .../layout/html/base/src/nsAbsoluteFrame.h | 65 - mozilla/layout/html/base/src/nsBRPart.cpp | 241 - mozilla/layout/html/base/src/nsBlockFrame.cpp | 2184 ---- mozilla/layout/html/base/src/nsBlockFrame.h | 329 - .../html/base/src/nsBlockReflowState.cpp | 2184 ---- .../layout/html/base/src/nsBlockReflowState.h | 2184 ---- mozilla/layout/html/base/src/nsBodyFrame.cpp | 418 - mozilla/layout/html/base/src/nsBodyFrame.h | 83 - mozilla/layout/html/base/src/nsBodyPart.cpp | 84 - .../layout/html/base/src/nsColumnFrame.cpp | 1352 --- mozilla/layout/html/base/src/nsColumnFrame.h | 92 - .../layout/html/base/src/nsDOMAttributes.cpp | 254 - .../layout/html/base/src/nsDOMAttributes.h | 77 - .../layout/html/base/src/nsDOMIterator.cpp | 175 - mozilla/layout/html/base/src/nsDOMIterator.h | 54 - .../html/base/src/nsGlobalVariables.cpp | 102 - .../layout/html/base/src/nsGlobalVariables.h | 133 - mozilla/layout/html/base/src/nsHRPart.cpp | 443 - mozilla/layout/html/base/src/nsHTMLAtoms.cpp | 370 - mozilla/layout/html/base/src/nsHTMLAtoms.h | 169 - .../layout/html/base/src/nsHTMLContainer.cpp | 851 -- .../layout/html/base/src/nsHTMLContainer.h | 75 - .../html/base/src/nsHTMLContainerFrame.cpp | 347 - .../html/base/src/nsHTMLContainerFrame.h | 90 - .../layout/html/base/src/nsHTMLContent.cpp | 510 - mozilla/layout/html/base/src/nsHTMLContent.h | 136 - mozilla/layout/html/base/src/nsHTMLIIDs.cpp | 23 - mozilla/layout/html/base/src/nsHTMLIIDs.h | 26 - mozilla/layout/html/base/src/nsHTMLImage.cpp | 595 -- mozilla/layout/html/base/src/nsHTMLParts.h | 134 - .../layout/html/base/src/nsHTMLTagContent.cpp | 669 -- .../layout/html/base/src/nsHTMLTagContent.h | 186 - mozilla/layout/html/base/src/nsHTMLTagIDs.h | 92 - mozilla/layout/html/base/src/nsHTMLTags.cpp | 377 - mozilla/layout/html/base/src/nsHTMLTags.h | 40 - .../layout/html/base/src/nsIAnchoredItems.h | 53 - .../html/base/src/nsIFloaterContainer.h | 63 - mozilla/layout/html/base/src/nsIHTMLContent.h | 89 - .../layout/html/base/src/nsIHTMLFrameType.h | 41 - mozilla/layout/html/base/src/nsIImageMap.h | 78 - mozilla/layout/html/base/src/nsImageMap.cpp | 710 -- .../layout/html/base/src/nsInlineFrame.cpp | 1113 --- mozilla/layout/html/base/src/nsLeafFrame.cpp | 123 - mozilla/layout/html/base/src/nsLeafFrame.h | 80 - .../layout/html/base/src/nsListItemFrame.cpp | 687 -- .../layout/html/base/src/nsListItemFrame.h | 73 - mozilla/layout/html/base/src/nsPageFrame.cpp | 185 - mozilla/layout/html/base/src/nsPageFrame.h | 56 - .../html/base/src/nsPlaceholderFrame.cpp | 102 - .../layout/html/base/src/nsPlaceholderFrame.h | 58 - mozilla/layout/html/base/src/nsRootPart.cpp | 507 - mozilla/layout/html/base/src/nsSpacerPart.cpp | 307 - .../layout/html/base/src/nsTextContent.cpp | 1540 --- mozilla/layout/html/base/src/nsWBRPart.cpp | 68 - mozilla/layout/html/document/Makefile | 24 - mozilla/layout/html/document/makefile.win | 23 - mozilla/layout/html/document/src/Makefile | 54 - mozilla/layout/html/document/src/makefile.win | 54 - .../html/document/src/nsHTMLContentSink.cpp | 1315 --- .../html/document/src/nsHTMLDocument.cpp | 225 - .../layout/html/document/src/nsHTMLDocument.h | 67 - .../html/document/src/nsIHTMLDocument.h | 41 - mozilla/layout/html/document/src/ua.css | 292 - mozilla/layout/html/forms/Makefile | 24 - mozilla/layout/html/forms/makefile.win | 23 - mozilla/layout/html/forms/public/Makefile | 29 - mozilla/layout/html/forms/public/makefile.win | 26 - .../layout/html/forms/public/nsIFormControl.h | 92 - .../layout/html/forms/public/nsIFormManager.h | 140 - mozilla/layout/html/forms/src/Makefile | 47 - mozilla/layout/html/forms/src/makefile.win | 53 - mozilla/layout/html/forms/src/nsForm.cpp | 542 - .../layout/html/forms/src/nsFormElement.cpp | 152 - mozilla/layout/html/forms/src/nsHTMLForms.h | 151 - mozilla/layout/html/forms/src/nsInput.cpp | 469 - mozilla/layout/html/forms/src/nsInput.h | 204 - .../layout/html/forms/src/nsInputButton.cpp | 379 - .../layout/html/forms/src/nsInputCheckbox.cpp | 252 - .../layout/html/forms/src/nsInputCheckbox.h | 55 - mozilla/layout/html/forms/src/nsInputFile.cpp | 106 - mozilla/layout/html/forms/src/nsInputFile.h | 49 - .../layout/html/forms/src/nsInputFrame.cpp | 575 -- mozilla/layout/html/forms/src/nsInputFrame.h | 213 - .../layout/html/forms/src/nsInputImage.cpp | 101 - mozilla/layout/html/forms/src/nsInputImage.h | 45 - .../layout/html/forms/src/nsInputRadio.cpp | 329 - mozilla/layout/html/forms/src/nsInputRadio.h | 87 - mozilla/layout/html/forms/src/nsInputText.cpp | 340 - mozilla/layout/html/forms/src/nsInputText.h | 75 - mozilla/layout/html/forms/src/nsSelect.cpp | 629 -- mozilla/layout/html/makefile.win | 23 - mozilla/layout/html/style/Makefile | 24 - mozilla/layout/html/style/makefile.win | 23 - mozilla/layout/html/style/public/Makefile | 28 - mozilla/layout/html/style/public/makefile.win | 25 - .../layout/html/style/public/nsICSSParser.h | 56 - mozilla/layout/html/style/src/Makefile | 49 - mozilla/layout/html/style/src/makefile.win | 54 - .../html/style/src/nsCSSDeclaration.cpp | 1435 --- .../layout/html/style/src/nsCSSKeywordIDs.h | 93 - .../layout/html/style/src/nsCSSKeywords.cpp | 399 - mozilla/layout/html/style/src/nsCSSKeywords.h | 40 - mozilla/layout/html/style/src/nsCSSLayout.cpp | 262 - mozilla/layout/html/style/src/nsCSSLayout.h | 62 - mozilla/layout/html/style/src/nsCSSParser.cpp | 2209 ----- mozilla/layout/html/style/src/nsCSSPropIDs.h | 81 - mozilla/layout/html/style/src/nsCSSProps.cpp | 360 - mozilla/layout/html/style/src/nsCSSProps.h | 40 - .../layout/html/style/src/nsCSSRendering.cpp | 785 -- .../layout/html/style/src/nsCSSRendering.h | 89 - .../layout/html/style/src/nsCSSScanner.cpp | 585 -- mozilla/layout/html/style/src/nsCSSScanner.h | 118 - .../layout/html/style/src/nsCSSStyleRule.cpp | 1047 -- .../layout/html/style/src/nsCSSStyleSheet.cpp | 368 - .../html/style/src/nsHTMLAttributes.cpp | 672 -- .../html/style/src/nsHTMLStyleSheet.cpp | 214 - mozilla/layout/html/style/src/nsHTMLValue.cpp | 257 - mozilla/layout/html/style/src/nsHTMLValue.h | 138 - .../layout/html/style/src/nsICSSDeclaration.h | 318 - .../layout/html/style/src/nsICSSStyleRule.h | 76 - .../layout/html/style/src/nsICSSStyleSheet.h | 45 - .../layout/html/style/src/nsIHTMLAttributes.h | 59 - .../layout/html/style/src/nsIHTMLStyleSheet.h | 36 - mozilla/layout/html/table/Makefile | 24 - mozilla/layout/html/table/makefile.win | 23 - mozilla/layout/html/table/src/Makefile | 54 - mozilla/layout/html/table/src/makefile.win | 60 - .../html/table/src/nsCellLayoutData.cpp | 620 -- .../layout/html/table/src/nsCellLayoutData.h | 155 - mozilla/layout/html/table/src/nsCellMap.cpp | 136 - mozilla/layout/html/table/src/nsCellMap.h | 79 - .../layout/html/table/src/nsColLayoutData.cpp | 154 - .../layout/html/table/src/nsColLayoutData.h | 74 - .../layout/html/table/src/nsITableContent.h | 86 - .../layout/html/table/src/nsTableCaption.cpp | 105 - .../layout/html/table/src/nsTableCaption.h | 71 - .../html/table/src/nsTableCaptionFrame.cpp | 356 - .../html/table/src/nsTableCaptionFrame.h | 98 - mozilla/layout/html/table/src/nsTableCell.cpp | 342 - mozilla/layout/html/table/src/nsTableCell.h | 136 - .../html/table/src/nsTableCellFrame.cpp | 365 - .../layout/html/table/src/nsTableCellFrame.h | 92 - mozilla/layout/html/table/src/nsTableCol.cpp | 353 - mozilla/layout/html/table/src/nsTableCol.h | 133 - .../layout/html/table/src/nsTableColGroup.cpp | 360 - .../layout/html/table/src/nsTableColGroup.h | 160 - .../html/table/src/nsTableColGroupFrame.cpp | 95 - .../html/table/src/nsTableColGroupFrame.h | 65 - .../layout/html/table/src/nsTableContent.cpp | 226 - .../layout/html/table/src/nsTableContent.h | 117 - .../layout/html/table/src/nsTableFrame.cpp | 2939 ------ mozilla/layout/html/table/src/nsTableFrame.h | 439 - .../html/table/src/nsTableOuterFrame.cpp | 1402 --- .../layout/html/table/src/nsTableOuterFrame.h | 259 - mozilla/layout/html/table/src/nsTablePart.cpp | 1158 --- mozilla/layout/html/table/src/nsTablePart.h | 234 - mozilla/layout/html/table/src/nsTableRow.cpp | 268 - mozilla/layout/html/table/src/nsTableRow.h | 133 - .../layout/html/table/src/nsTableRowFrame.cpp | 1061 -- .../layout/html/table/src/nsTableRowFrame.h | 175 - .../layout/html/table/src/nsTableRowGroup.cpp | 285 - .../layout/html/table/src/nsTableRowGroup.h | 118 - .../html/table/src/nsTableRowGroupFrame.cpp | 958 -- .../html/table/src/nsTableRowGroupFrame.h | 168 - .../html/tests/CellMapTest/CellMapTest.cpp | 122 - mozilla/layout/html/tests/Makefile | 64 - mozilla/layout/html/tests/TestAttributes.cpp | 276 - mozilla/layout/html/tests/TestCSSParser.cpp | 98 - .../html/tests/TestCSSPropertyLookup.cpp | 135 - mozilla/layout/html/tests/TestCSSScanner.cpp | 103 - .../layout/html/tests/TestHTMLTagLookup.cpp | 73 - mozilla/layout/html/tests/TestInlineFrame.cpp | 1652 --- mozilla/layout/html/tests/css/INVALID.css | 391 - mozilla/layout/html/tests/css/SELECTORS.css | 32 - .../html/tests/css/background-attachment.css | 28 - .../html/tests/css/background-color.css | 24 - .../html/tests/css/background-image.css | 23 - .../html/tests/css/background-position.css | 43 - .../html/tests/css/background-repeat.css | 25 - mozilla/layout/html/tests/css/background.css | 32 - .../html/tests/css/border-bottom-width.css | 23 - .../layout/html/tests/css/border-bottom.css | 24 - .../layout/html/tests/css/border-color.css | 20 - .../html/tests/css/border-left-width.css | 20 - mozilla/layout/html/tests/css/border-left.css | 24 - .../html/tests/css/border-right-width.css | 20 - .../layout/html/tests/css/border-right.css | 24 - .../layout/html/tests/css/border-style.css | 28 - .../html/tests/css/border-top-width.css | 20 - mozilla/layout/html/tests/css/border-top.css | 24 - .../layout/html/tests/css/border-width.css | 25 - mozilla/layout/html/tests/css/border.css | 24 - mozilla/layout/html/tests/css/bugs/bug01.css | 19 - mozilla/layout/html/tests/css/bugs/bug02.css | 20 - mozilla/layout/html/tests/css/clear.css | 20 - mozilla/layout/html/tests/css/clip.css | 53 - mozilla/layout/html/tests/css/color.css | 22 - mozilla/layout/html/tests/css/cursor.css | 23 - mozilla/layout/html/tests/css/direction.css | 22 - mozilla/layout/html/tests/css/display.css | 20 - mozilla/layout/html/tests/css/float.css | 20 - mozilla/layout/html/tests/css/font-family.css | 17 - mozilla/layout/html/tests/css/font-size.css | 29 - mozilla/layout/html/tests/css/font-style.css | 23 - .../layout/html/tests/css/font-variant.css | 22 - mozilla/layout/html/tests/css/font-weight.css | 31 - mozilla/layout/html/tests/css/font.css | 29 - mozilla/layout/html/tests/css/height.css | 18 - mozilla/layout/html/tests/css/left.css | 19 - .../layout/html/tests/css/letter-spacing.css | 18 - mozilla/layout/html/tests/css/line-height.css | 20 - .../html/tests/css/list-style-image.css | 18 - .../html/tests/css/list-style-position.css | 18 - .../layout/html/tests/css/list-style-type.css | 25 - mozilla/layout/html/tests/css/list-style.css | 26 - .../layout/html/tests/css/margin-bottom.css | 19 - mozilla/layout/html/tests/css/margin-left.css | 19 - .../layout/html/tests/css/margin-right.css | 19 - mozilla/layout/html/tests/css/margin-top.css | 19 - mozilla/layout/html/tests/css/margin.css | 38 - mozilla/layout/html/tests/css/overflow.css | 20 - .../layout/html/tests/css/padding-bottom.css | 18 - .../layout/html/tests/css/padding-left.css | 18 - .../layout/html/tests/css/padding-right.css | 18 - mozilla/layout/html/tests/css/padding-top.css | 18 - mozilla/layout/html/tests/css/padding.css | 30 - mozilla/layout/html/tests/css/position.css | 21 - mozilla/layout/html/tests/css/text-align.css | 20 - .../layout/html/tests/css/text-decoration.css | 26 - mozilla/layout/html/tests/css/text-indent.css | 18 - .../layout/html/tests/css/text-transform.css | 21 - mozilla/layout/html/tests/css/top.css | 19 - .../layout/html/tests/css/vertical-align.css | 25 - mozilla/layout/html/tests/css/visibility.css | 19 - mozilla/layout/html/tests/css/white-space.css | 19 - mozilla/layout/html/tests/css/width.css | 19 - .../layout/html/tests/css/word-spacing.css | 25 - mozilla/layout/html/tests/css/z-index.css | 20 - mozilla/layout/html/tests/makefile.win | 97 - .../TableContentTest/TableContentTest.cpp | 581 -- .../tests/table/testcases/nestedTables.html | 337 - .../html/tests/table/testcases/slashlogo.html | 3471 ------- .../testcases/wa_table_thtd_rowspan.html | 472 - .../table/testcases/wa_table_tr_align.html | 106 - .../tests/table/testcases/wf_table_index.html | 177 - mozilla/layout/makefile.win | 23 - mozilla/layout/style/nsCSSDeclaration.cpp | 1435 --- mozilla/layout/style/nsCSSKeywords.cpp | 399 - mozilla/layout/style/nsCSSKeywords.h | 40 - mozilla/layout/style/nsCSSParser.cpp | 2209 ----- mozilla/layout/style/nsCSSProps.cpp | 360 - mozilla/layout/style/nsCSSProps.h | 40 - mozilla/layout/style/nsCSSScanner.cpp | 585 -- mozilla/layout/style/nsCSSScanner.h | 118 - mozilla/layout/style/nsCSSStruct.cpp | 1435 --- mozilla/layout/style/nsCSSStyleRule.cpp | 1047 -- mozilla/layout/style/nsCSSStyleSheet.cpp | 368 - mozilla/layout/style/nsHTMLStyleSheet.cpp | 214 - mozilla/layout/style/nsICSSParser.h | 56 - mozilla/layout/style/nsICSSStyleRule.h | 76 - mozilla/layout/style/nsIStyleRule.h | 43 - mozilla/layout/style/nsIStyleSheet.h | 50 - mozilla/layout/style/nsStyleContext.cpp | 545 - mozilla/layout/style/nsStyleCoord.h | 100 - mozilla/layout/style/nsStyleSet.cpp | 530 - mozilla/layout/style/ua.css | 292 - mozilla/layout/tables/nsCellMap.cpp | 136 - mozilla/layout/tables/nsCellMap.h | 79 - mozilla/layout/tables/nsTableCellFrame.cpp | 365 - mozilla/layout/tables/nsTableCellFrame.h | 92 - .../layout/tables/nsTableColGroupFrame.cpp | 95 - mozilla/layout/tables/nsTableColGroupFrame.h | 65 - mozilla/layout/tables/nsTableFrame.cpp | 2939 ------ mozilla/layout/tables/nsTableFrame.h | 439 - mozilla/layout/tables/nsTableOuterFrame.cpp | 1402 --- mozilla/layout/tables/nsTableOuterFrame.h | 259 - mozilla/layout/tables/nsTableRowFrame.cpp | 1061 -- mozilla/layout/tables/nsTableRowFrame.h | 175 - .../layout/tables/nsTableRowGroupFrame.cpp | 958 -- mozilla/layout/tables/nsTableRowGroupFrame.h | 168 - mozilla/layout/tools/CSSKeywords.txt | 91 - mozilla/layout/tools/CSSProps.txt | 79 - mozilla/layout/tools/ColorNames.txt | 140 - mozilla/layout/tools/HTMLTags.txt | 90 - mozilla/layout/tools/Makefile | 53 - mozilla/layout/tools/genhash.inc | 119 - mozilla/layout/tools/genhash.pl | 102 - mozilla/parser/htmlparser/Makefile | 27 - mozilla/parser/htmlparser/makefile.win | 23 - mozilla/parser/htmlparser/robot/Makefile | 54 - mozilla/parser/htmlparser/robot/RobotMain.cpp | 111 - mozilla/parser/htmlparser/robot/makefile.win | 62 - .../parser/htmlparser/robot/nsIRobotSink.h | 39 - .../htmlparser/robot/nsIRobotSinkObserver.h | 34 - .../parser/htmlparser/robot/nsRobotSink.cpp | 285 - mozilla/parser/htmlparser/src/CNavDTD.cpp | 844 -- mozilla/parser/htmlparser/src/CNavDTD.h | 174 - .../parser/htmlparser/src/CNavDelegate.cpp | 433 - mozilla/parser/htmlparser/src/CNavDelegate.h | 84 - mozilla/parser/htmlparser/src/COtherDTD.cpp | 721 -- mozilla/parser/htmlparser/src/COtherDTD.h | 175 - .../parser/htmlparser/src/COtherDelegate.cpp | 433 - .../parser/htmlparser/src/COtherDelegate.h | 85 - mozilla/parser/htmlparser/src/Makefile | 55 - mozilla/parser/htmlparser/src/SelfTest.cpp | 190 - mozilla/parser/htmlparser/src/makefile.win | 70 - .../htmlparser/src/nsDefaultTokenHandler.cpp | 639 -- .../htmlparser/src/nsDefaultTokenHandler.h | 163 - .../htmlparser/src/nsHTMLContentSink.cpp | 430 - .../parser/htmlparser/src/nsHTMLContentSink.h | 133 - .../parser/htmlparser/src/nsHTMLParser.cpp | 1378 --- mozilla/parser/htmlparser/src/nsHTMLParser.h | 166 - .../parser/htmlparser/src/nsHTMLTokens.cpp | 1338 --- mozilla/parser/htmlparser/src/nsHTMLTokens.h | 348 - .../parser/htmlparser/src/nsIContentSink.h | 90 - mozilla/parser/htmlparser/src/nsIDTD.h | 150 - .../htmlparser/src/nsIHTMLContentSink.h | 223 - mozilla/parser/htmlparser/src/nsIParser.h | 66 - mozilla/parser/htmlparser/src/nsIParserNode.h | 75 - .../parser/htmlparser/src/nsITokenHandler.h | 44 - .../htmlparser/src/nsITokenizerDelegate.h | 61 - .../parser/htmlparser/src/nsParserNode.cpp | 205 - mozilla/parser/htmlparser/src/nsParserNode.h | 81 - mozilla/parser/htmlparser/src/nsParserTypes.h | 75 - mozilla/parser/htmlparser/src/nsScanner.cpp | 312 - mozilla/parser/htmlparser/src/nsScanner.h | 77 - mozilla/parser/htmlparser/src/nsToken.cpp | 158 - mozilla/parser/htmlparser/src/nsToken.h | 77 - .../parser/htmlparser/src/nsTokenHandler.cpp | 639 -- .../parser/htmlparser/src/nsTokenHandler.h | 163 - mozilla/parser/htmlparser/src/nsTokenizer.cpp | 212 - mozilla/parser/htmlparser/src/nsTokenizer.h | 78 - mozilla/parser/htmlparser/src/nshtmlpars.h | 37 - .../parser/htmlparser/tests/html/Table01.html | 11 - .../parser/htmlparser/tests/html/Table02.html | 14 - .../parser/htmlparser/tests/html/Table03.html | 11 - .../parser/htmlparser/tests/html/Table04.html | 53 - .../parser/htmlparser/tests/html/Table05.html | 12 - .../htmlparser/tests/html/Table05e.html | 21 - .../htmlparser/tests/html/Table05f.html | 16 - .../htmlparser/tests/html/Table05g.html | 13 - .../htmlparser/tests/html/Table05h.html | 12 - .../htmlparser/tests/html/Table05i.html | 13 - .../htmlparser/tests/html/Table05j.html | 11 - .../parser/htmlparser/tests/html/Table06.html | 13 - .../htmlparser/tests/html/acronym1.html | 14 - .../parser/htmlparser/tests/html/aname01.html | 17 - .../parser/htmlparser/tests/html/atoi01.html | 13 - .../tests/html/attribute_quote_bug1.html | 13 - .../parser/htmlparser/tests/html/bdo001.html | 14 - .../parser/htmlparser/tests/html/br001.html | 11 - .../htmlparser/tests/html/button001.html | 19 - .../htmlparser/tests/html/button002.html | 34 - .../htmlparser/tests/html/center001.html | 29 - .../htmlparser/tests/html/center002.html | 36 - .../parser/htmlparser/tests/html/col001.html | 21 - .../parser/htmlparser/tests/html/col002.html | 24 - .../parser/htmlparser/tests/html/col003.html | 31 - .../parser/htmlparser/tests/html/col004.html | 26 - .../parser/htmlparser/tests/html/col005.html | 39 - .../parser/htmlparser/tests/html/col006.html | 261 - .../parser/htmlparser/tests/html/col007.html | 39 - .../parser/htmlparser/tests/html/col008.html | 35 - .../parser/htmlparser/tests/html/col009.html | 29 - .../parser/htmlparser/tests/html/col010.html | 22 - .../parser/htmlparser/tests/html/col011.html | 32 - .../parser/htmlparser/tests/html/col012.html | 27 - .../parser/htmlparser/tests/html/col013.html | 22 - .../parser/htmlparser/tests/html/col014.html | 22 - .../parser/htmlparser/tests/html/col015.html | 22 - .../parser/htmlparser/tests/html/col016.html | 31 - .../parser/htmlparser/tests/html/del001.html | 14 - .../parser/htmlparser/tests/html/del002.html | 17 - .../parser/htmlparser/tests/html/del003.html | 12 - .../parser/htmlparser/tests/html/del004.html | 13 - .../parser/htmlparser/tests/html/del005.html | 22 - .../parser/htmlparser/tests/html/del006.html | 21 - .../parser/htmlparser/tests/html/del007.html | 21 - .../parser/htmlparser/tests/html/del008.html | 22 - .../parser/htmlparser/tests/html/del009.html | 19 - .../parser/htmlparser/tests/html/del010.html | 16 - .../parser/htmlparser/tests/html/del011.html | 23 - .../parser/htmlparser/tests/html/doc001.html | 0 .../parser/htmlparser/tests/html/doc002.html | 10 - .../htmlparser/tests/html/endswithcr.html | 1 - .../htmlparser/tests/html/entity001.html | 12 - .../htmlparser/tests/html/fieldset001.html | 22 - .../htmlparser/tests/html/fieldset002.html | 56 - .../htmlparser/tests/html/fieldset003.html | 26 - .../parser/htmlparser/tests/html/form001.html | 13 - .../parser/htmlparser/tests/html/form002.html | 22 - .../parser/htmlparser/tests/html/head01.html | 9 - .../parser/htmlparser/tests/html/head02.html | 11 - .../parser/htmlparser/tests/html/head03.html | 9 - .../parser/htmlparser/tests/html/home01.html | 976 -- .../parser/htmlparser/tests/html/html001.html | 8 - .../htmlparser/tests/html/imgmap001.html | 13 - .../parser/htmlparser/tests/html/ins001.html | 14 - .../parser/htmlparser/tests/html/ins002.html | 18 - .../parser/htmlparser/tests/html/ins003.html | 13 - .../htmlparser/tests/html/insdel01.html | 16 - .../htmlparser/tests/html/insdel02.html | 16 - .../htmlparser/tests/html/layer001.html | 20 - .../htmlparser/tests/html/layer002.html | 28 - .../htmlparser/tests/html/layer003.html | 29 - .../parser/htmlparser/tests/html/layer01.html | 22 - .../parser/htmlparser/tests/html/list001.html | 33 - .../parser/htmlparser/tests/html/list002.html | 15 - .../parser/htmlparser/tests/html/list003.html | 19 - .../htmlparser/tests/html/newlines.html | 3 - .../parser/htmlparser/tests/html/obj001.html | 12 - .../parser/htmlparser/tests/html/obj002.html | 9 - .../parser/htmlparser/tests/html/obj003.html | 17 - .../htmlparser/tests/html/param001.html | 10 - .../htmlparser/tests/html/param002.html | 14 - .../parser/htmlparser/tests/html/pre001.html | 9 - .../parser/htmlparser/tests/html/pre002.html | 11 - .../parser/htmlparser/tests/html/pre003.html | 8 - .../parser/htmlparser/tests/html/pre004.html | 18 - .../parser/htmlparser/tests/html/pre005.html | 53 - .../parser/htmlparser/tests/html/pre006.html | 28 - .../parser/htmlparser/tests/html/pre007.html | 12 - .../parser/htmlparser/tests/html/pre012.html | 22 - .../parser/htmlparser/tests/html/pre015.html | 18 - .../parser/htmlparser/tests/html/pre016.html | 17 - .../parser/htmlparser/tests/html/q001.html | 18 - .../htmlparser/tests/html/quote001.html | 51 - .../htmlparser/tests/html/quote002.html | 33 - .../htmlparser/tests/html/quote003.html | 14 - .../parser/htmlparser/tests/html/span001.html | 30 - .../parser/htmlparser/tests/html/span002.html | 21 - .../parser/htmlparser/tests/html/span003.html | 17 - .../htmlparser/tests/html/strike002.html | 17 - .../htmlparser/tests/html/strike005.html | 22 - .../htmlparser/tests/html/strike006.html | 18 - .../htmlparser/tests/html/strike007.html | 20 - .../htmlparser/tests/html/strike008.html | 26 - .../htmlparser/tests/html/table05a.html | 14 - .../htmlparser/tests/html/table05b.html | 14 - .../htmlparser/tests/html/table05c.html | 14 - .../htmlparser/tests/html/table05d.html | 13 - .../htmlparser/tests/html/table05k.html | 19 - .../htmlparser/tests/html/table05l.html | 14 - .../htmlparser/tests/html/table05m.html | 5 - .../htmlparser/tests/html/table05n.html | 11 - .../htmlparser/tests/html/table05o.html | 6 - .../parser/htmlparser/tests/html/table07.html | 13 - .../htmlparser/tests/html/table200.html | 21 - .../htmlparser/tests/html/table201.html | 22 - .../htmlparser/tests/html/table202.html | 23 - .../htmlparser/tests/html/table203.html | 29 - .../htmlparser/tests/html/table204.html | 23 - .../htmlparser/tests/html/table205.html | 28 - .../htmlparser/tests/html/tableall.html | 81 - .../parser/htmlparser/tests/html/tag001.html | 3 - .../parser/htmlparser/tests/html/tag002.html | 23 - .../parser/htmlparser/tests/html/tag003.html | 10 - .../parser/htmlparser/tests/html/tag004.html | 4 - .../parser/htmlparser/tests/html/tag005.html | 7 - .../parser/htmlparser/tests/html/tag006.html | 6 - .../parser/htmlparser/tests/html/tag007.html | 5 - .../parser/htmlparser/tests/html/tag008.html | 4 - .../htmlparser/tests/html/target01.html | 7 - .../htmlparser/tests/html/tbody001.html | 17 - .../parser/htmlparser/tests/html/text001.html | 8 - .../parser/htmlparser/tests/html/text002.html | 8 - .../parser/htmlparser/tests/html/text003.html | 12 - .../htmlparser/tests/html/thead001.html | 25 - .../parser/htmlparser/tests/html/title01.html | 6 - .../parser/htmlparser/tests/html/usascii.html | 26 - .../parser/htmlparser/tests/html/utf8001.html | 9 - .../htmlparser/tests/html/value001.html | 14 - .../parser/htmlparser/tests/html/xmp005.html | 48 - .../htmlparser/tests/windows/Selftest.cpp | 148 - mozilla/raptor.mak | 361 - mozilla/raptor.mk | 177 - mozilla/string/obsolete/nsString.cpp | 2056 ---- mozilla/string/obsolete/nsString.h | 237 - mozilla/view/Makefile | 24 - mozilla/view/makefile.win | 23 - mozilla/view/public/Makefile | 33 - mozilla/view/public/makefile.win | 26 - mozilla/view/public/nsIScrollableView.h | 64 - mozilla/view/public/nsIView.h | 378 - mozilla/view/public/nsIViewManager.h | 350 - mozilla/view/public/nsViewsCID.h | 38 - mozilla/view/src/Makefile | 41 - mozilla/view/src/makefile.win | 60 - mozilla/view/src/nsScrollingView.cpp | 425 - mozilla/view/src/nsScrollingView.h | 73 - mozilla/view/src/nsView.cpp | 860 -- mozilla/view/src/nsView.h | 124 - mozilla/view/src/nsViewFactory.cpp | 164 - mozilla/view/src/nsViewManager.cpp | 577 -- mozilla/view/src/nsViewManager.h | 186 - mozilla/webshell/Makefile | 24 - mozilla/webshell/makefile.win | 23 - mozilla/webshell/public/Makefile | 33 - mozilla/webshell/public/makefile.win | 34 - mozilla/webshell/public/nsIApplicationShell.h | 50 - mozilla/webshell/public/nsIDocumentWidget.h | 49 - mozilla/webshell/public/nsILinkHandler.h | 54 - mozilla/webshell/public/nsIShellInstance.h | 54 - mozilla/webshell/public/nsIWebWidget.h | 82 - mozilla/webshell/public/nsweb.h | 27 - mozilla/webshell/src/Makefile | 42 - mozilla/webshell/src/makefile.win | 76 - mozilla/webshell/src/nsApplicationManager.cpp | 160 - mozilla/webshell/src/nsApplicationManager.h | 56 - mozilla/webshell/src/nsLinkHandler.cpp | 175 - mozilla/webshell/src/nsShellInstance.cpp | 232 - mozilla/webshell/src/nsShellInstance.h | 60 - mozilla/webshell/src/nsWebWidget.cpp | 683 -- mozilla/webshell/src/windows/makefile.win | 63 - mozilla/webshell/src/windows/winmain.cpp | 90 - mozilla/webshell/tests/Makefile | 22 - mozilla/webshell/tests/imgtest/ImageTest.cpp | 403 - .../webshell/tests/imgtest/ImageTestImpl.cpp | 394 - .../webshell/tests/imgtest/ImageTestImpl.h | 23 - mozilla/webshell/tests/imgtest/image.rc | 28 - mozilla/webshell/tests/imgtest/makefile.win | 52 - .../webshell/tests/imgtest/nsImageTest.cpp | 110 - mozilla/webshell/tests/imgtest/nsImageTest.h | 69 - mozilla/webshell/tests/imgtest/resources.h | 25 - mozilla/webshell/tests/makefile.win | 23 - mozilla/webshell/tests/nettest/Makefile | 63 - mozilla/webshell/tests/nettest/makefile.win | 96 - mozilla/webshell/tests/nettest/nettest.cpp | 201 - mozilla/webshell/tests/viewer/JSConsole.cpp | 958 -- mozilla/webshell/tests/viewer/JSConsole.h | 106 - mozilla/webshell/tests/viewer/jsconsres.h | 67 - mozilla/webshell/tests/viewer/makefile.win | 90 - mozilla/webshell/tests/viewer/nsDocLoader.cpp | 256 - mozilla/webshell/tests/viewer/nsDocLoader.h | 94 - mozilla/webshell/tests/viewer/resources.h | 53 - .../webshell/tests/viewer/samples/Anieyes.gif | Bin 13539 -> 0 bytes mozilla/webshell/tests/viewer/samples/bg.jpg | Bin 9407 -> 0 bytes .../webshell/tests/viewer/samples/gear1.gif | Bin 9492 -> 0 bytes .../webshell/tests/viewer/samples/raptor.jpg | Bin 49629 -> 0 bytes .../tests/viewer/samples/rock_gra.gif | Bin 23780 -> 0 bytes .../webshell/tests/viewer/samples/test0.html | 69 - .../webshell/tests/viewer/samples/test1.html | 79 - .../webshell/tests/viewer/samples/test2.html | 41 - .../webshell/tests/viewer/samples/test3.html | 125 - .../webshell/tests/viewer/samples/test4.html | 42 - .../webshell/tests/viewer/samples/test5.html | 38 - .../webshell/tests/viewer/samples/test6.html | 71 - .../webshell/tests/viewer/samples/test7.html | 10 - .../webshell/tests/viewer/samples/test8.html | 34 - .../tests/viewer/samples/test_form.html | 34 - mozilla/webshell/tests/viewer/viewer.rc | 120 - mozilla/webshell/tests/viewer/winmain.cpp | 626 -- mozilla/widget/Makefile | 24 - mozilla/widget/build.bat | 21 - mozilla/widget/makefile.win | 23 - mozilla/widget/public/Makefile | 49 - mozilla/widget/public/makefile.win | 31 - mozilla/widget/public/nsGUIEvent.h | 280 - mozilla/widget/public/nsIButton.h | 56 - mozilla/widget/public/nsICheckButton.h | 54 - mozilla/widget/public/nsIComboBox.h | 39 - mozilla/widget/public/nsIEventListener.h | 43 - mozilla/widget/public/nsIFileWidget.h | 98 - mozilla/widget/public/nsIListBox.h | 69 - mozilla/widget/public/nsIListWidget.h | 125 - mozilla/widget/public/nsIMouseListener.h | 66 - mozilla/widget/public/nsIRadioButton.h | 82 - mozilla/widget/public/nsIRadioGroup.h | 79 - mozilla/widget/public/nsIScrollbar.h | 110 - mozilla/widget/public/nsITabWidget.h | 55 - mozilla/widget/public/nsITextAreaWidget.h | 42 - mozilla/widget/public/nsITextWidget.h | 147 - mozilla/widget/public/nsIToolkit.h | 54 - mozilla/widget/public/nsIWidget.h | 389 - mozilla/widget/public/nsWidgetsCID.h | 88 - mozilla/widget/public/nsui.h | 27 - mozilla/widget/src/Makefile | 26 - mozilla/widget/src/makefile.win | 23 - mozilla/widget/src/windows/Makefile | 23 - mozilla/widget/src/windows/makefile.win | 79 - mozilla/widget/src/windows/nsButton.cpp | 136 - mozilla/widget/src/windows/nsButton.h | 61 - mozilla/widget/src/windows/nsCList.h | 102 - mozilla/widget/src/windows/nsCheckButton.cpp | 170 - mozilla/widget/src/windows/nsCheckButton.h | 67 - mozilla/widget/src/windows/nsComboBox.cpp | 230 - mozilla/widget/src/windows/nsComboBox.h | 69 - mozilla/widget/src/windows/nsFileWidget.cpp | 187 - mozilla/widget/src/windows/nsFileWidget.h | 70 - mozilla/widget/src/windows/nsListBox.cpp | 305 - mozilla/widget/src/windows/nsListBox.h | 75 - mozilla/widget/src/windows/nsObject.cpp | 147 - mozilla/widget/src/windows/nsObject.h | 106 - mozilla/widget/src/windows/nsRadioButton.cpp | 209 - mozilla/widget/src/windows/nsRadioButton.h | 75 - mozilla/widget/src/windows/nsRadioGroup.cpp | 377 - mozilla/widget/src/windows/nsRadioGroup.h | 90 - mozilla/widget/src/windows/nsScrollbar.cpp | 452 - mozilla/widget/src/windows/nsScrollbar.h | 77 - mozilla/widget/src/windows/nsStringUtil.h | 79 - .../widget/src/windows/nsSwitchToUIThread.h | 58 - mozilla/widget/src/windows/nsTabWidget.cpp | 143 - mozilla/widget/src/windows/nsTabWidget.h | 61 - .../widget/src/windows/nsTextAreaWidget.cpp | 174 - mozilla/widget/src/windows/nsTextAreaWidget.h | 73 - mozilla/widget/src/windows/nsTextHelper.cpp | 182 - mozilla/widget/src/windows/nsTextHelper.h | 62 - mozilla/widget/src/windows/nsTextWidget.cpp | 113 - mozilla/widget/src/windows/nsTextWidget.h | 56 - mozilla/widget/src/windows/nsToolkit.cpp | 359 - mozilla/widget/src/windows/nsToolkit.h | 137 - .../widget/src/windows/nsWidgetFactory.cpp | 230 - mozilla/widget/src/windows/nsWindow.cpp | 1701 ---- mozilla/widget/src/windows/nsWindow.h | 387 - mozilla/widget/src/windows/nsdefs.h | 38 - mozilla/widget/src/windows/res/select.cur | Bin 326 -> 0 bytes mozilla/widget/src/windows/resource.h | 18 - mozilla/widget/src/windows/widget.rc | 20 - mozilla/widget/tests/Makefile | 22 - mozilla/widget/tests/Scribble.cpp | 547 - mozilla/widget/tests/Scribble.h | 54 - mozilla/widget/tests/main.cpp | 46 - mozilla/widget/tests/makefile.win | 52 - mozilla/widget/tests/windows/makefile.win | 49 - mozilla/widget/tests/windows/winmain.cpp | 1262 --- mozilla/xpcom/ds/nsArena.cpp | 80 - mozilla/xpcom/ds/nsAtomTable.cpp | 144 - mozilla/xpcom/ds/nsBTree.cpp | 403 - mozilla/xpcom/ds/nsBTree.h | 283 - mozilla/xpcom/ds/nsByteBuffer.cpp | 135 - mozilla/xpcom/ds/nsCRT.cpp | 290 - mozilla/xpcom/ds/nsCRT.h | 110 - mozilla/xpcom/ds/nsDeque.cpp | 414 - mozilla/xpcom/ds/nsDeque.h | 348 - mozilla/xpcom/ds/nsIArena.h | 51 - mozilla/xpcom/ds/nsIAtom.h | 71 - mozilla/xpcom/ds/nsIByteBuffer.h | 56 - mozilla/xpcom/ds/nsIUnicharBuffer.h | 46 - mozilla/xpcom/ds/nsRBTree.cpp | 423 - mozilla/xpcom/ds/nsRBTree.h | 223 - mozilla/xpcom/ds/nsString.cpp | 2056 ---- mozilla/xpcom/ds/nsString.h | 237 - mozilla/xpcom/ds/nsUnicharBuffer.cpp | 137 - mozilla/xpcom/ds/nsUnitConversion.h | 71 - mozilla/xpcom/ds/nsVoidArray.cpp | 172 - mozilla/xpcom/ds/nsVoidArray.h | 64 - mozilla/xpcom/glue/nsID.cpp | 66 - mozilla/xpcom/glue/nsVoidArray.cpp | 172 - mozilla/xpcom/glue/nsVoidArray.h | 64 - mozilla/xpcom/io/nsIInputStream.h | 74 - mozilla/xpcom/io/nsIUnicharInputStream.h | 98 - mozilla/xpcom/io/nsUnicharInputStream.cpp | 328 - mozilla/xpcom/string/obsolete/nsString.cpp | 2056 ---- mozilla/xpcom/string/obsolete/nsString.h | 237 - mozilla/xpcom/tests/CvtURL.cpp | 104 - mozilla/xpcom/tests/TestAtoms.cpp | 108 - mozilla/xpcom/tests/TestCRT.cpp | 89 - mozilla/xpcom/tests/resources.h | 32 - 1305 files changed, 293721 deletions(-) delete mode 100644 CVSROOT/modules delete mode 100644 README/mozilla/IDEMenuBar.gif delete mode 100644 README/mozilla/IDEPrefs.gif delete mode 100644 README/mozilla/macbuild.htm delete mode 100644 README/mozilla/unixbuild.htm delete mode 100644 README/mozilla/winbuild.htm delete mode 100644 README/mozilla/wininstall.htm delete mode 100644 README/raptor/winbuild.html delete mode 100644 buildtools/windows/bin/README delete mode 100755 buildtools/windows/bin/alpha/gmake.exe delete mode 100755 buildtools/windows/bin/alpha/nsinstall.exe delete mode 100755 buildtools/windows/bin/alpha/shmsdos.exe delete mode 100755 buildtools/windows/bin/alpha/uname.exe delete mode 100755 buildtools/windows/bin/x86/gmake.exe delete mode 100755 buildtools/windows/bin/x86/nsinstall.exe delete mode 100755 buildtools/windows/bin/x86/shmsdos.exe delete mode 100755 buildtools/windows/bin/x86/uname.exe delete mode 100644 buildtools/windows/source/make/COPYING delete mode 100644 buildtools/windows/source/make/ChangeLog delete mode 100644 buildtools/windows/source/make/INSTALL delete mode 100644 buildtools/windows/source/make/Makefile delete mode 100644 buildtools/windows/source/make/Makefile.in delete mode 100644 buildtools/windows/source/make/NEWS delete mode 100644 buildtools/windows/source/make/NMakefile delete mode 100644 buildtools/windows/source/make/README delete mode 100644 buildtools/windows/source/make/README.MOZILLA delete mode 100644 buildtools/windows/source/make/acconfig.h delete mode 100644 buildtools/windows/source/make/alloca.c delete mode 100644 buildtools/windows/source/make/ar.c delete mode 100644 buildtools/windows/source/make/arscan.c delete mode 100644 buildtools/windows/source/make/build.sh.in delete mode 100644 buildtools/windows/source/make/commands.c delete mode 100644 buildtools/windows/source/make/commands.h delete mode 100644 buildtools/windows/source/make/config.h delete mode 100644 buildtools/windows/source/make/config.h.in delete mode 100644 buildtools/windows/source/make/configh.dos delete mode 100644 buildtools/windows/source/make/configure delete mode 100755 buildtools/windows/source/make/configure.bat delete mode 100644 buildtools/windows/source/make/configure.in delete mode 100644 buildtools/windows/source/make/default.c delete mode 100644 buildtools/windows/source/make/dep.h delete mode 100644 buildtools/windows/source/make/dir.c delete mode 100644 buildtools/windows/source/make/expand.c delete mode 100644 buildtools/windows/source/make/file.c delete mode 100644 buildtools/windows/source/make/file.h delete mode 100644 buildtools/windows/source/make/function.c delete mode 100644 buildtools/windows/source/make/getloadavg.c delete mode 100644 buildtools/windows/source/make/getopt.c delete mode 100644 buildtools/windows/source/make/getopt.h delete mode 100644 buildtools/windows/source/make/getopt1.c delete mode 100644 buildtools/windows/source/make/glob.c delete mode 100644 buildtools/windows/source/make/glob/COPYING.LIB delete mode 100644 buildtools/windows/source/make/glob/Makefile delete mode 100644 buildtools/windows/source/make/glob/Makefile.in delete mode 100644 buildtools/windows/source/make/glob/configure delete mode 100755 buildtools/windows/source/make/glob/configure.bat delete mode 100644 buildtools/windows/source/make/glob/configure.in delete mode 100644 buildtools/windows/source/make/glob/fnmatch.c delete mode 100644 buildtools/windows/source/make/glob/fnmatch.h delete mode 100644 buildtools/windows/source/make/glob/glob.c delete mode 100644 buildtools/windows/source/make/glob/glob.h delete mode 100644 buildtools/windows/source/make/implicit.c delete mode 100644 buildtools/windows/source/make/install-sh delete mode 100644 buildtools/windows/source/make/job.c delete mode 100644 buildtools/windows/source/make/job.h delete mode 100644 buildtools/windows/source/make/main.c delete mode 100644 buildtools/windows/source/make/make-stds.texi delete mode 100644 buildtools/windows/source/make/make.aux delete mode 100644 buildtools/windows/source/make/make.cp delete mode 100644 buildtools/windows/source/make/make.cps delete mode 100644 buildtools/windows/source/make/make.fn delete mode 100644 buildtools/windows/source/make/make.fns delete mode 100644 buildtools/windows/source/make/make.h delete mode 100644 buildtools/windows/source/make/make.info delete mode 100644 buildtools/windows/source/make/make.info-1 delete mode 100644 buildtools/windows/source/make/make.info-2 delete mode 100644 buildtools/windows/source/make/make.info-3 delete mode 100644 buildtools/windows/source/make/make.info-4 delete mode 100644 buildtools/windows/source/make/make.info-5 delete mode 100644 buildtools/windows/source/make/make.info-6 delete mode 100644 buildtools/windows/source/make/make.info-7 delete mode 100644 buildtools/windows/source/make/make.info-8 delete mode 100644 buildtools/windows/source/make/make.man delete mode 100644 buildtools/windows/source/make/make.texinfo delete mode 100644 buildtools/windows/source/make/make.toc delete mode 100644 buildtools/windows/source/make/misc.c delete mode 100644 buildtools/windows/source/make/mkinstalldirs delete mode 100644 buildtools/windows/source/make/read.c delete mode 100644 buildtools/windows/source/make/remake.c delete mode 100644 buildtools/windows/source/make/remote-cstms.c delete mode 100644 buildtools/windows/source/make/remote-stub.c delete mode 100644 buildtools/windows/source/make/rule.c delete mode 100644 buildtools/windows/source/make/rule.h delete mode 100644 buildtools/windows/source/make/signame.c delete mode 100644 buildtools/windows/source/make/signame.h delete mode 100644 buildtools/windows/source/make/texinfo.tex delete mode 100644 buildtools/windows/source/make/variable.c delete mode 100644 buildtools/windows/source/make/variable.h delete mode 100644 buildtools/windows/source/make/version.c delete mode 100644 buildtools/windows/source/make/vpath.c delete mode 100644 buildtools/windows/source/make/windir.h delete mode 100644 buildtools/windows/source/shmsdos/README delete mode 100644 buildtools/windows/source/shmsdos/nsinstall.c delete mode 100644 buildtools/windows/source/shmsdos/nsinstall.mak delete mode 100644 buildtools/windows/source/shmsdos/shmsdos.c delete mode 100644 buildtools/windows/source/shmsdos/shmsdos.mak delete mode 100644 buildtools/windows/source/uname/README delete mode 100644 buildtools/windows/source/uname/uname.c delete mode 100644 buildtools/windows/source/uname/uname.mak delete mode 100644 l10nkits/client/windows/docs/installer/IS1.JPG delete mode 100644 l10nkits/client/windows/docs/installer/L10NTREE.JPG delete mode 100644 l10nkits/client/windows/docs/installer/SPLASH.JPG delete mode 100644 l10nkits/client/windows/docs/installer/branding.html delete mode 100644 l10nkits/client/windows/docs/installer/gettingStarted.html delete mode 100644 l10nkits/client/windows/docs/installer/isocodes.htm delete mode 100644 l10nkits/client/windows/docs/installer/kitOverview.html delete mode 100644 l10nkits/client/windows/docs/installer/kitStruct.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeAim.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeCD.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeCosmo.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeIsuser.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeMmedia.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeMplay.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeNav40.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeNetcast.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeNsconf.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeRsutil.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeSetup.html delete mode 100644 l10nkits/client/windows/docs/installer/localizeURL.html delete mode 100644 l10nkits/client/windows/docs/installer/localize_these_files.html delete mode 100644 l10nkits/client/windows/docs/installer/nomenclature.html delete mode 100644 l10nkits/client/windows/docs/installer/projectOverview.html delete mode 100644 l10nkits/client/windows/docs/installer/reference.html delete mode 100644 l10nkits/client/windows/docs/installer/registrySettings.html delete mode 100644 l10nkits/client/windows/docs/installer/reportingBugs.html delete mode 100644 l10nkits/client/windows/docs/installer/returnKit.html delete mode 100644 l10nkits/client/windows/docs/installer/splash.html delete mode 100644 l10nkits/client/windows/docs/installer/testKit.html delete mode 100644 l10nkits/client/windows/docs/installer/toc.html delete mode 100644 l10nkits/client/windows/docs/installer/usingKit.html delete mode 100644 l10nkits/client/windows/docs/nav40/SPLASH.JPG delete mode 100644 l10nkits/client/windows/docs/nav40/allxpstr.h delete mode 100644 l10nkits/client/windows/docs/nav40/branding.html delete mode 100644 l10nkits/client/windows/docs/nav40/charsets.htm delete mode 100644 l10nkits/client/windows/docs/nav40/gettingStarted.html delete mode 100644 l10nkits/client/windows/docs/nav40/idBuild.jpg delete mode 100644 l10nkits/client/windows/docs/nav40/image5LE.JPG delete mode 100644 l10nkits/client/windows/docs/nav40/imageEJR.JPG delete mode 100644 l10nkits/client/windows/docs/nav40/imageGAN.JPG delete mode 100644 l10nkits/client/windows/docs/nav40/imageGHT.JPG delete mode 100644 l10nkits/client/windows/docs/nav40/imageQC9.JPG delete mode 100644 l10nkits/client/windows/docs/nav40/isocodes.htm delete mode 100644 l10nkits/client/windows/docs/nav40/isonames.htm delete mode 100644 l10nkits/client/windows/docs/nav40/kitOverview.html delete mode 100644 l10nkits/client/windows/docs/nav40/kitStruct.html delete mode 100644 l10nkits/client/windows/docs/nav40/l10ntree.jpg delete mode 100644 l10nkits/client/windows/docs/nav40/localizeAboutplg.html delete mode 100644 l10nkits/client/windows/docs/nav40/localizeAllPref.html delete mode 100644 l10nkits/client/windows/docs/nav40/localizeBookmarks.html delete mode 100644 l10nkits/client/windows/docs/nav40/localizeConfigPref.html delete mode 100644 l10nkits/client/windows/docs/nav40/localizeLicense.html delete mode 100644 l10nkits/client/windows/docs/nav40/localizeNpnul.html delete mode 100644 l10nkits/client/windows/docs/nav40/localizeURL.html delete mode 100644 l10nkits/client/windows/docs/nav40/localize_these_files.html delete mode 100644 l10nkits/client/windows/docs/nav40/nomenclature.html delete mode 100644 l10nkits/client/windows/docs/nav40/pixel.gif delete mode 100644 l10nkits/client/windows/docs/nav40/projectOverview.html delete mode 100644 l10nkits/client/windows/docs/nav40/reference.html delete mode 100644 l10nkits/client/windows/docs/nav40/reportingBugs.html delete mode 100644 l10nkits/client/windows/docs/nav40/resource.h delete mode 100644 l10nkits/client/windows/docs/nav40/returnKit.html delete mode 100644 l10nkits/client/windows/docs/nav40/splash.html delete mode 100644 l10nkits/client/windows/docs/nav40/testKit.html delete mode 100644 l10nkits/client/windows/docs/nav40/toc.html delete mode 100644 l10nkits/client/windows/docs/nav40/troubleshooting.html delete mode 100644 l10nkits/client/windows/docs/nav40/usingKit.html delete mode 100644 l10nkits/client/windows/docs/nav40/winfekit.jpg delete mode 100644 l10nkits/client/windows/docs/nav40/xpencui.htm delete mode 100644 l10nkits/client/xp/docs/mozilla.org/kitDownload.html delete mode 100644 l10nkits/client/xp/docs/mozilla.org/l10nLibrary.html delete mode 100644 l10nkits/client/xp/docs/mozilla.org/l10nkitintro.html delete mode 100644 l10nkits/client/xp/docs/mozilla.org/ulpFAQ.html delete mode 100644 l10nkits/client/xp/docs/mozilla.org/ulpLicense.html delete mode 100644 mozilla/base/Makefile delete mode 100644 mozilla/base/makefile.win delete mode 100644 mozilla/base/src/Makefile delete mode 100644 mozilla/base/src/makefile.win delete mode 100644 mozilla/base/src/nsArena.cpp delete mode 100644 mozilla/base/src/nsAtomTable.cpp delete mode 100644 mozilla/base/src/nsBTree.cpp delete mode 100644 mozilla/base/src/nsBTree.h delete mode 100644 mozilla/base/src/nsByteBuffer.cpp delete mode 100644 mozilla/base/src/nsCRT.cpp delete mode 100644 mozilla/base/src/nsCRT.h delete mode 100644 mozilla/base/src/nsDeque.cpp delete mode 100644 mozilla/base/src/nsDeque.h delete mode 100644 mozilla/base/src/nsIArena.h delete mode 100644 mozilla/base/src/nsIAtom.h delete mode 100644 mozilla/base/src/nsIByteBuffer.h delete mode 100644 mozilla/base/src/nsIInputStream.h delete mode 100644 mozilla/base/src/nsITimer.h delete mode 100644 mozilla/base/src/nsITimerCallback.h delete mode 100644 mozilla/base/src/nsIURL.h delete mode 100644 mozilla/base/src/nsIUnicharBuffer.h delete mode 100644 mozilla/base/src/nsIUnicharInputStream.h delete mode 100644 mozilla/base/src/nsInputStream.cpp delete mode 100644 mozilla/base/src/nsRBTree.cpp delete mode 100644 mozilla/base/src/nsRBTree.h delete mode 100644 mozilla/base/src/nsString.cpp delete mode 100644 mozilla/base/src/nsString.h delete mode 100644 mozilla/base/src/nsURL.cpp delete mode 100644 mozilla/base/src/nsUnicharBuffer.cpp delete mode 100644 mozilla/base/src/nsUnicharInputStream.cpp delete mode 100644 mozilla/base/src/nsUnitConversion.h delete mode 100644 mozilla/base/src/nsVoidArray.cpp delete mode 100644 mozilla/base/src/nsVoidArray.h delete mode 100644 mozilla/base/src/nscore.h delete mode 100644 mozilla/base/src/windows/makefile.win delete mode 100644 mozilla/base/src/windows/nsTimer.cpp delete mode 100644 mozilla/base/tests/CvtURL.cpp delete mode 100644 mozilla/base/tests/Makefile delete mode 100644 mozilla/base/tests/TestAtoms.cpp delete mode 100644 mozilla/base/tests/TestCRT.cpp delete mode 100644 mozilla/base/tests/TimerTest.cpp delete mode 100644 mozilla/base/tests/makefile.win delete mode 100644 mozilla/base/tests/resources.h delete mode 100644 mozilla/base/tests/timer.rc delete mode 100644 mozilla/content/base/public/nsIContent.h delete mode 100644 mozilla/content/base/public/nsIDocument.h delete mode 100644 mozilla/content/base/public/nsIDocumentContainer.h delete mode 100644 mozilla/content/base/public/nsIDocumentObserver.h delete mode 100644 mozilla/content/base/public/nsIStyleRule.h delete mode 100644 mozilla/content/base/public/nsIStyleSheet.h delete mode 100644 mozilla/content/base/public/nsITextContent.h delete mode 100644 mozilla/content/base/src/nsDocument.cpp delete mode 100644 mozilla/content/base/src/nsDocument.h delete mode 100644 mozilla/content/base/src/nsHTMLValue.cpp delete mode 100644 mozilla/content/base/src/nsHTMLValue.h delete mode 100644 mozilla/content/base/src/nsSelection.cpp delete mode 100644 mozilla/content/base/src/nsStyleContext.cpp delete mode 100644 mozilla/content/base/src/nsStyleSet.cpp delete mode 100644 mozilla/content/html/content/public/nsIHTMLContent.h delete mode 100644 mozilla/content/html/content/src/nsHTMLAtoms.cpp delete mode 100644 mozilla/content/html/content/src/nsHTMLAtoms.h delete mode 100644 mozilla/content/html/document/src/nsHTMLContentSink.cpp delete mode 100644 mozilla/content/html/document/src/nsHTMLDocument.cpp delete mode 100644 mozilla/content/html/document/src/nsHTMLDocument.h delete mode 100644 mozilla/content/html/document/src/nsIHTMLDocument.h delete mode 100644 mozilla/content/html/style/public/nsICSSParser.h delete mode 100644 mozilla/content/html/style/src/nsCSSDeclaration.cpp delete mode 100644 mozilla/content/html/style/src/nsCSSKeywords.h delete mode 100644 mozilla/content/html/style/src/nsCSSLayout.cpp delete mode 100644 mozilla/content/html/style/src/nsCSSParser.cpp delete mode 100644 mozilla/content/html/style/src/nsCSSProps.h delete mode 100644 mozilla/content/html/style/src/nsCSSScanner.cpp delete mode 100644 mozilla/content/html/style/src/nsCSSScanner.h delete mode 100644 mozilla/content/html/style/src/nsCSSStruct.cpp delete mode 100644 mozilla/content/html/style/src/nsCSSStyleRule.cpp delete mode 100644 mozilla/content/html/style/src/nsCSSStyleSheet.cpp delete mode 100644 mozilla/content/html/style/src/nsHTMLAttributes.cpp delete mode 100644 mozilla/content/html/style/src/nsHTMLStyleSheet.cpp delete mode 100644 mozilla/content/html/style/src/nsHTMLValue.cpp delete mode 100644 mozilla/content/html/style/src/nsHTMLValue.h delete mode 100644 mozilla/content/html/style/src/nsICSSDeclaration.h delete mode 100644 mozilla/content/html/style/src/nsICSSStyleRule.h delete mode 100644 mozilla/content/html/style/src/nsIHTMLAttributes.h delete mode 100644 mozilla/content/shared/public/nsCSSKeywords.h delete mode 100644 mozilla/content/shared/public/nsCSSProps.h delete mode 100644 mozilla/content/shared/public/nsHTMLAtoms.h delete mode 100644 mozilla/content/shared/public/nsHTMLValue.h delete mode 100644 mozilla/content/shared/public/nsStyleCoord.h delete mode 100644 mozilla/content/shared/src/nsCSSKeywords.cpp delete mode 100644 mozilla/content/shared/src/nsCSSProps.cpp delete mode 100644 mozilla/content/shared/src/nsHTMLAtoms.cpp delete mode 100644 mozilla/content/shared/src/nsHTMLValue.cpp delete mode 100644 mozilla/dom/Makefile delete mode 100644 mozilla/dom/makefile.win delete mode 100644 mozilla/dom/public/Makefile delete mode 100644 mozilla/dom/public/coreDom/Makefile delete mode 100644 mozilla/dom/public/coreDom/makefile.win delete mode 100644 mozilla/dom/public/coreDom/nsDOM.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMAttribute.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMComment.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMDocument.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMElement.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMIterators.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMNode.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMPI.h delete mode 100644 mozilla/dom/public/coreDom/nsIDOMText.h delete mode 100644 mozilla/dom/public/makefile.win delete mode 100644 mozilla/dom/public/nsIScriptContext.h delete mode 100644 mozilla/dom/public/nsIScriptObject.h delete mode 100644 mozilla/dom/public/nsIScriptObjectOwner.h delete mode 100644 mozilla/dom/src/Makefile delete mode 100644 mozilla/dom/src/makefile.win delete mode 100644 mozilla/dom/src/nsJSAttribute.cpp delete mode 100644 mozilla/dom/src/nsJSAttributeList.cpp delete mode 100644 mozilla/dom/src/nsJSDocument.cpp delete mode 100644 mozilla/dom/src/nsJSElement.cpp delete mode 100644 mozilla/dom/src/nsJSEnvironment.cpp delete mode 100644 mozilla/dom/src/nsJSEnvironment.h delete mode 100644 mozilla/dom/src/nsJSNode.cpp delete mode 100644 mozilla/dom/src/nsJSNodeIterator.cpp delete mode 100644 mozilla/dom/src/nsJSText.cpp delete mode 100644 mozilla/dom/src/nsJSWindow.cpp delete mode 100644 mozilla/dom/tests/js/DumpHTML.js delete mode 100644 mozilla/dom/tests/js/DumpTree.js delete mode 100644 mozilla/dom/tests/js/HTMLString.js delete mode 100644 mozilla/dom/tests/js/simple.js delete mode 100644 mozilla/gfx/Makefile delete mode 100644 mozilla/gfx/makefile.win delete mode 100644 mozilla/gfx/src/Makefile delete mode 100644 mozilla/gfx/src/makefile.win delete mode 100644 mozilla/gfx/src/nsColor.cpp delete mode 100644 mozilla/gfx/src/nsColor.h delete mode 100644 mozilla/gfx/src/nsColorNameIDs.h delete mode 100644 mozilla/gfx/src/nsColorNames.cpp delete mode 100644 mozilla/gfx/src/nsColorNames.h delete mode 100644 mozilla/gfx/src/nsColorNamesRGB.cpp delete mode 100644 mozilla/gfx/src/nsCoord.h delete mode 100644 mozilla/gfx/src/nsFont.cpp delete mode 100644 mozilla/gfx/src/nsFont.h delete mode 100644 mozilla/gfx/src/nsFontCache.cpp delete mode 100644 mozilla/gfx/src/nsGfxCIID.h delete mode 100644 mozilla/gfx/src/nsIDeviceContext.h delete mode 100644 mozilla/gfx/src/nsIFontCache.h delete mode 100644 mozilla/gfx/src/nsIFontMetrics.h delete mode 100644 mozilla/gfx/src/nsIImage.h delete mode 100644 mozilla/gfx/src/nsIImageGroup.h delete mode 100644 mozilla/gfx/src/nsIImageManager.h delete mode 100644 mozilla/gfx/src/nsIImageObserver.h delete mode 100644 mozilla/gfx/src/nsIImageRequest.h delete mode 100644 mozilla/gfx/src/nsIRenderingContext.h delete mode 100644 mozilla/gfx/src/nsImage.h delete mode 100644 mozilla/gfx/src/nsImageGroup.cpp delete mode 100644 mozilla/gfx/src/nsImageManager.cpp delete mode 100644 mozilla/gfx/src/nsImageNet.h delete mode 100644 mozilla/gfx/src/nsImageNetContext.cpp delete mode 100644 mozilla/gfx/src/nsImageRenderer.cpp delete mode 100644 mozilla/gfx/src/nsImageRequest.cpp delete mode 100644 mozilla/gfx/src/nsImageRequest.h delete mode 100644 mozilla/gfx/src/nsImageSystemServices.cpp delete mode 100644 mozilla/gfx/src/nsImageURL.cpp delete mode 100644 mozilla/gfx/src/nsMargin.h delete mode 100644 mozilla/gfx/src/nsPoint.h delete mode 100644 mozilla/gfx/src/nsRect.cpp delete mode 100644 mozilla/gfx/src/nsRect.h delete mode 100644 mozilla/gfx/src/nsRegion.h delete mode 100644 mozilla/gfx/src/nsSize.h delete mode 100644 mozilla/gfx/src/nsTransform2D.cpp delete mode 100644 mozilla/gfx/src/nsTransform2D.h delete mode 100644 mozilla/gfx/src/windows/makefile.win delete mode 100644 mozilla/gfx/src/windows/nsDeviceContextWin.cpp delete mode 100644 mozilla/gfx/src/windows/nsDeviceContextWin.h delete mode 100644 mozilla/gfx/src/windows/nsFontMetricsWin.cpp delete mode 100644 mozilla/gfx/src/windows/nsFontMetricsWin.h delete mode 100644 mozilla/gfx/src/windows/nsGfxFactoryWin.cpp delete mode 100644 mozilla/gfx/src/windows/nsImageWin.cpp delete mode 100644 mozilla/gfx/src/windows/nsImageWin.h delete mode 100644 mozilla/gfx/src/windows/nsRenderingContextWin.cpp delete mode 100644 mozilla/gfx/src/windows/nsRenderingContextWin.h delete mode 100644 mozilla/gfx/tests/DumpColors.cpp delete mode 100644 mozilla/gfx/tests/Makefile delete mode 100644 mozilla/gfx/tests/TestColorNames.cpp delete mode 100644 mozilla/gfx/tests/TestRect.cpp delete mode 100644 mozilla/gfx/tests/btest/BitTest.cpp delete mode 100644 mozilla/gfx/tests/btest/image.rc delete mode 100644 mozilla/gfx/tests/btest/makefile.win delete mode 100644 mozilla/gfx/tests/btest/resource.h delete mode 100644 mozilla/gfx/tests/btest/resources.h delete mode 100644 mozilla/gfx/tests/makefile.win delete mode 100644 mozilla/htmlparser/Makefile delete mode 100644 mozilla/htmlparser/makefile.win delete mode 100644 mozilla/htmlparser/robot/Makefile delete mode 100644 mozilla/htmlparser/robot/RobotMain.cpp delete mode 100644 mozilla/htmlparser/robot/makefile.win delete mode 100644 mozilla/htmlparser/robot/nsIRobotSink.h delete mode 100644 mozilla/htmlparser/robot/nsIRobotSinkObserver.h delete mode 100644 mozilla/htmlparser/robot/nsRobotSink.cpp delete mode 100644 mozilla/htmlparser/src/CNavDTD.cpp delete mode 100644 mozilla/htmlparser/src/CNavDTD.h delete mode 100644 mozilla/htmlparser/src/CNavDelegate.cpp delete mode 100644 mozilla/htmlparser/src/CNavDelegate.h delete mode 100644 mozilla/htmlparser/src/COtherDTD.cpp delete mode 100644 mozilla/htmlparser/src/COtherDTD.h delete mode 100644 mozilla/htmlparser/src/COtherDelegate.cpp delete mode 100644 mozilla/htmlparser/src/COtherDelegate.h delete mode 100644 mozilla/htmlparser/src/Makefile delete mode 100644 mozilla/htmlparser/src/SelfTest.cpp delete mode 100644 mozilla/htmlparser/src/makefile.win delete mode 100644 mozilla/htmlparser/src/nsDefaultTokenHandler.cpp delete mode 100644 mozilla/htmlparser/src/nsDefaultTokenHandler.h delete mode 100644 mozilla/htmlparser/src/nsHTMLContentSink.cpp delete mode 100644 mozilla/htmlparser/src/nsHTMLContentSink.h delete mode 100644 mozilla/htmlparser/src/nsHTMLParser.cpp delete mode 100644 mozilla/htmlparser/src/nsHTMLParser.h delete mode 100644 mozilla/htmlparser/src/nsHTMLTokens.cpp delete mode 100644 mozilla/htmlparser/src/nsHTMLTokens.h delete mode 100644 mozilla/htmlparser/src/nsIContentSink.h delete mode 100644 mozilla/htmlparser/src/nsIDTD.h delete mode 100644 mozilla/htmlparser/src/nsIHTMLContentSink.h delete mode 100644 mozilla/htmlparser/src/nsIParser.h delete mode 100644 mozilla/htmlparser/src/nsIParserNode.h delete mode 100644 mozilla/htmlparser/src/nsITokenHandler.h delete mode 100644 mozilla/htmlparser/src/nsITokenizerDelegate.h delete mode 100644 mozilla/htmlparser/src/nsParserNode.cpp delete mode 100644 mozilla/htmlparser/src/nsParserNode.h delete mode 100644 mozilla/htmlparser/src/nsParserTypes.h delete mode 100644 mozilla/htmlparser/src/nsScanner.cpp delete mode 100644 mozilla/htmlparser/src/nsScanner.h delete mode 100644 mozilla/htmlparser/src/nsToken.cpp delete mode 100644 mozilla/htmlparser/src/nsToken.h delete mode 100644 mozilla/htmlparser/src/nsTokenHandler.cpp delete mode 100644 mozilla/htmlparser/src/nsTokenHandler.h delete mode 100644 mozilla/htmlparser/src/nsTokenizer.cpp delete mode 100644 mozilla/htmlparser/src/nsTokenizer.h delete mode 100644 mozilla/htmlparser/src/nshtmlpars.h delete mode 100644 mozilla/htmlparser/tests/html/Table01.html delete mode 100644 mozilla/htmlparser/tests/html/Table02.html delete mode 100644 mozilla/htmlparser/tests/html/Table03.html delete mode 100644 mozilla/htmlparser/tests/html/Table04.html delete mode 100644 mozilla/htmlparser/tests/html/Table05.html delete mode 100644 mozilla/htmlparser/tests/html/Table05e.html delete mode 100644 mozilla/htmlparser/tests/html/Table05f.html delete mode 100644 mozilla/htmlparser/tests/html/Table05g.html delete mode 100644 mozilla/htmlparser/tests/html/Table05h.html delete mode 100644 mozilla/htmlparser/tests/html/Table05i.html delete mode 100644 mozilla/htmlparser/tests/html/Table05j.html delete mode 100644 mozilla/htmlparser/tests/html/Table06.html delete mode 100644 mozilla/htmlparser/tests/html/acronym1.html delete mode 100644 mozilla/htmlparser/tests/html/aname01.html delete mode 100644 mozilla/htmlparser/tests/html/atoi01.html delete mode 100644 mozilla/htmlparser/tests/html/attribute_quote_bug1.html delete mode 100644 mozilla/htmlparser/tests/html/bdo001.html delete mode 100644 mozilla/htmlparser/tests/html/br001.html delete mode 100644 mozilla/htmlparser/tests/html/button001.html delete mode 100644 mozilla/htmlparser/tests/html/button002.html delete mode 100644 mozilla/htmlparser/tests/html/center001.html delete mode 100644 mozilla/htmlparser/tests/html/center002.html delete mode 100644 mozilla/htmlparser/tests/html/col001.html delete mode 100644 mozilla/htmlparser/tests/html/col002.html delete mode 100644 mozilla/htmlparser/tests/html/col003.html delete mode 100644 mozilla/htmlparser/tests/html/col004.html delete mode 100644 mozilla/htmlparser/tests/html/col005.html delete mode 100644 mozilla/htmlparser/tests/html/col006.html delete mode 100644 mozilla/htmlparser/tests/html/col007.html delete mode 100644 mozilla/htmlparser/tests/html/col008.html delete mode 100644 mozilla/htmlparser/tests/html/col009.html delete mode 100644 mozilla/htmlparser/tests/html/col010.html delete mode 100644 mozilla/htmlparser/tests/html/col011.html delete mode 100644 mozilla/htmlparser/tests/html/col012.html delete mode 100644 mozilla/htmlparser/tests/html/col013.html delete mode 100644 mozilla/htmlparser/tests/html/col014.html delete mode 100644 mozilla/htmlparser/tests/html/col015.html delete mode 100644 mozilla/htmlparser/tests/html/col016.html delete mode 100644 mozilla/htmlparser/tests/html/del001.html delete mode 100644 mozilla/htmlparser/tests/html/del002.html delete mode 100644 mozilla/htmlparser/tests/html/del003.html delete mode 100644 mozilla/htmlparser/tests/html/del004.html delete mode 100644 mozilla/htmlparser/tests/html/del005.html delete mode 100644 mozilla/htmlparser/tests/html/del006.html delete mode 100644 mozilla/htmlparser/tests/html/del007.html delete mode 100644 mozilla/htmlparser/tests/html/del008.html delete mode 100644 mozilla/htmlparser/tests/html/del009.html delete mode 100644 mozilla/htmlparser/tests/html/del010.html delete mode 100644 mozilla/htmlparser/tests/html/del011.html delete mode 100644 mozilla/htmlparser/tests/html/doc001.html delete mode 100644 mozilla/htmlparser/tests/html/doc002.html delete mode 100644 mozilla/htmlparser/tests/html/endswithcr.html delete mode 100644 mozilla/htmlparser/tests/html/entity001.html delete mode 100644 mozilla/htmlparser/tests/html/fieldset001.html delete mode 100644 mozilla/htmlparser/tests/html/fieldset002.html delete mode 100644 mozilla/htmlparser/tests/html/fieldset003.html delete mode 100644 mozilla/htmlparser/tests/html/form001.html delete mode 100644 mozilla/htmlparser/tests/html/form002.html delete mode 100644 mozilla/htmlparser/tests/html/head01.html delete mode 100644 mozilla/htmlparser/tests/html/head02.html delete mode 100644 mozilla/htmlparser/tests/html/head03.html delete mode 100644 mozilla/htmlparser/tests/html/home01.html delete mode 100644 mozilla/htmlparser/tests/html/html001.html delete mode 100644 mozilla/htmlparser/tests/html/imgmap001.html delete mode 100644 mozilla/htmlparser/tests/html/ins001.html delete mode 100644 mozilla/htmlparser/tests/html/ins002.html delete mode 100644 mozilla/htmlparser/tests/html/ins003.html delete mode 100644 mozilla/htmlparser/tests/html/insdel01.html delete mode 100644 mozilla/htmlparser/tests/html/insdel02.html delete mode 100644 mozilla/htmlparser/tests/html/layer001.html delete mode 100644 mozilla/htmlparser/tests/html/layer002.html delete mode 100644 mozilla/htmlparser/tests/html/layer003.html delete mode 100644 mozilla/htmlparser/tests/html/layer01.html delete mode 100644 mozilla/htmlparser/tests/html/list001.html delete mode 100644 mozilla/htmlparser/tests/html/list002.html delete mode 100644 mozilla/htmlparser/tests/html/list003.html delete mode 100644 mozilla/htmlparser/tests/html/newlines.html delete mode 100644 mozilla/htmlparser/tests/html/obj001.html delete mode 100644 mozilla/htmlparser/tests/html/obj002.html delete mode 100644 mozilla/htmlparser/tests/html/obj003.html delete mode 100644 mozilla/htmlparser/tests/html/param001.html delete mode 100644 mozilla/htmlparser/tests/html/param002.html delete mode 100644 mozilla/htmlparser/tests/html/pre001.html delete mode 100644 mozilla/htmlparser/tests/html/pre002.html delete mode 100644 mozilla/htmlparser/tests/html/pre003.html delete mode 100644 mozilla/htmlparser/tests/html/pre004.html delete mode 100644 mozilla/htmlparser/tests/html/pre005.html delete mode 100644 mozilla/htmlparser/tests/html/pre006.html delete mode 100644 mozilla/htmlparser/tests/html/pre007.html delete mode 100644 mozilla/htmlparser/tests/html/pre012.html delete mode 100644 mozilla/htmlparser/tests/html/pre015.html delete mode 100644 mozilla/htmlparser/tests/html/pre016.html delete mode 100644 mozilla/htmlparser/tests/html/q001.html delete mode 100644 mozilla/htmlparser/tests/html/quote001.html delete mode 100644 mozilla/htmlparser/tests/html/quote002.html delete mode 100644 mozilla/htmlparser/tests/html/quote003.html delete mode 100644 mozilla/htmlparser/tests/html/span001.html delete mode 100644 mozilla/htmlparser/tests/html/span002.html delete mode 100644 mozilla/htmlparser/tests/html/span003.html delete mode 100644 mozilla/htmlparser/tests/html/strike002.html delete mode 100644 mozilla/htmlparser/tests/html/strike005.html delete mode 100644 mozilla/htmlparser/tests/html/strike006.html delete mode 100644 mozilla/htmlparser/tests/html/strike007.html delete mode 100644 mozilla/htmlparser/tests/html/strike008.html delete mode 100644 mozilla/htmlparser/tests/html/table05a.html delete mode 100644 mozilla/htmlparser/tests/html/table05b.html delete mode 100644 mozilla/htmlparser/tests/html/table05c.html delete mode 100644 mozilla/htmlparser/tests/html/table05d.html delete mode 100644 mozilla/htmlparser/tests/html/table05k.html delete mode 100644 mozilla/htmlparser/tests/html/table05l.html delete mode 100644 mozilla/htmlparser/tests/html/table05m.html delete mode 100644 mozilla/htmlparser/tests/html/table05n.html delete mode 100644 mozilla/htmlparser/tests/html/table05o.html delete mode 100644 mozilla/htmlparser/tests/html/table07.html delete mode 100644 mozilla/htmlparser/tests/html/table200.html delete mode 100644 mozilla/htmlparser/tests/html/table201.html delete mode 100644 mozilla/htmlparser/tests/html/table202.html delete mode 100644 mozilla/htmlparser/tests/html/table203.html delete mode 100644 mozilla/htmlparser/tests/html/table204.html delete mode 100644 mozilla/htmlparser/tests/html/table205.html delete mode 100644 mozilla/htmlparser/tests/html/tableall.html delete mode 100644 mozilla/htmlparser/tests/html/tag001.html delete mode 100644 mozilla/htmlparser/tests/html/tag002.html delete mode 100644 mozilla/htmlparser/tests/html/tag003.html delete mode 100644 mozilla/htmlparser/tests/html/tag004.html delete mode 100644 mozilla/htmlparser/tests/html/tag005.html delete mode 100644 mozilla/htmlparser/tests/html/tag006.html delete mode 100644 mozilla/htmlparser/tests/html/tag007.html delete mode 100644 mozilla/htmlparser/tests/html/tag008.html delete mode 100644 mozilla/htmlparser/tests/html/target01.html delete mode 100644 mozilla/htmlparser/tests/html/tbody001.html delete mode 100644 mozilla/htmlparser/tests/html/text001.html delete mode 100644 mozilla/htmlparser/tests/html/text002.html delete mode 100644 mozilla/htmlparser/tests/html/text003.html delete mode 100644 mozilla/htmlparser/tests/html/thead001.html delete mode 100644 mozilla/htmlparser/tests/html/title01.html delete mode 100644 mozilla/htmlparser/tests/html/usascii.html delete mode 100644 mozilla/htmlparser/tests/html/utf8001.html delete mode 100644 mozilla/htmlparser/tests/html/value001.html delete mode 100644 mozilla/htmlparser/tests/html/xmp005.html delete mode 100644 mozilla/htmlparser/tests/windows/Selftest.cpp delete mode 100644 mozilla/layout/Makefile delete mode 100644 mozilla/layout/base/Makefile delete mode 100644 mozilla/layout/base/makefile.win delete mode 100644 mozilla/layout/base/nsCSSRendering.cpp delete mode 100644 mozilla/layout/base/nsCSSRendering.h delete mode 100644 mozilla/layout/base/nsIPresShell.h delete mode 100644 mozilla/layout/base/nsPresContext.cpp delete mode 100644 mozilla/layout/base/nsPresContext.h delete mode 100644 mozilla/layout/base/public/Makefile delete mode 100644 mozilla/layout/base/public/makefile.win delete mode 100644 mozilla/layout/base/public/nsIContent.h delete mode 100644 mozilla/layout/base/public/nsIContentDelegate.h delete mode 100644 mozilla/layout/base/public/nsIDocument.h delete mode 100644 mozilla/layout/base/public/nsIDocumentContainer.h delete mode 100644 mozilla/layout/base/public/nsIDocumentObserver.h delete mode 100644 mozilla/layout/base/public/nsIFrame.h delete mode 100644 mozilla/layout/base/public/nsIPresContext.h delete mode 100644 mozilla/layout/base/public/nsIPresShell.h delete mode 100644 mozilla/layout/base/public/nsIRunaround.h delete mode 100644 mozilla/layout/base/public/nsISpaceManager.h delete mode 100644 mozilla/layout/base/public/nsIStyleContext.h delete mode 100644 mozilla/layout/base/public/nsIStyleRule.h delete mode 100644 mozilla/layout/base/public/nsIStyleSet.h delete mode 100644 mozilla/layout/base/public/nsIStyleSheet.h delete mode 100644 mozilla/layout/base/public/nsITextContent.h delete mode 100644 mozilla/layout/base/public/nsPresContext.h delete mode 100644 mozilla/layout/base/public/nsStyleCoord.h delete mode 100644 mozilla/layout/base/public/nslayout.h delete mode 100644 mozilla/layout/base/src/Makefile delete mode 100644 mozilla/layout/base/src/makefile.win delete mode 100644 mozilla/layout/base/src/nsContainerFrame.cpp delete mode 100644 mozilla/layout/base/src/nsContainerFrame.h delete mode 100644 mozilla/layout/base/src/nsDocument.cpp delete mode 100644 mozilla/layout/base/src/nsDocument.h delete mode 100644 mozilla/layout/base/src/nsFrame.cpp delete mode 100644 mozilla/layout/base/src/nsFrame.h delete mode 100644 mozilla/layout/base/src/nsGalleyContext.cpp delete mode 100644 mozilla/layout/base/src/nsPresContext.cpp delete mode 100644 mozilla/layout/base/src/nsPresContext.h delete mode 100644 mozilla/layout/base/src/nsPresShell.cpp delete mode 100644 mozilla/layout/base/src/nsPrintPreviewContext.cpp delete mode 100644 mozilla/layout/base/src/nsReflowCommand.cpp delete mode 100644 mozilla/layout/base/src/nsReflowCommand.h delete mode 100644 mozilla/layout/base/src/nsSelection.cpp delete mode 100644 mozilla/layout/base/src/nsSelection.h delete mode 100644 mozilla/layout/base/src/nsSelectionPoint.cpp delete mode 100644 mozilla/layout/base/src/nsSelectionPoint.h delete mode 100644 mozilla/layout/base/src/nsSelectionRange.cpp delete mode 100644 mozilla/layout/base/src/nsSelectionRange.h delete mode 100644 mozilla/layout/base/src/nsSpaceManager.cpp delete mode 100644 mozilla/layout/base/src/nsSpaceManager.h delete mode 100644 mozilla/layout/base/src/nsSplittableFrame.cpp delete mode 100644 mozilla/layout/base/src/nsSplittableFrame.h delete mode 100644 mozilla/layout/base/src/nsStyleConsts.h delete mode 100644 mozilla/layout/base/src/nsStyleContext.cpp delete mode 100644 mozilla/layout/base/src/nsStyleCoord.cpp delete mode 100644 mozilla/layout/base/src/nsStyleSet.cpp delete mode 100644 mozilla/layout/base/tests/Makefile delete mode 100644 mozilla/layout/base/tests/TestContainerFrame.cpp delete mode 100644 mozilla/layout/base/tests/makefile.win delete mode 100644 mozilla/layout/build/Makefile delete mode 100644 mozilla/layout/build/dlldeps.cpp delete mode 100644 mozilla/layout/build/makefile.win delete mode 100644 mozilla/layout/generic/nsBlockFrame.cpp delete mode 100644 mozilla/layout/generic/nsBlockFrame.h delete mode 100644 mozilla/layout/generic/nsBlockReflowState.cpp delete mode 100644 mozilla/layout/generic/nsBlockReflowState.h delete mode 100644 mozilla/layout/generic/nsHTMLContainerFrame.cpp delete mode 100644 mozilla/layout/generic/nsHTMLContainerFrame.h delete mode 100644 mozilla/layout/generic/nsHTMLParts.h delete mode 100644 mozilla/layout/generic/nsIFrame.h delete mode 100644 mozilla/layout/generic/nsImageMap.cpp delete mode 100644 mozilla/layout/generic/nsInlineFrame.cpp delete mode 100644 mozilla/layout/generic/nsLeafFrame.cpp delete mode 100644 mozilla/layout/generic/nsLeafFrame.h delete mode 100644 mozilla/layout/generic/nsPageFrame.cpp delete mode 100644 mozilla/layout/generic/nsPageFrame.h delete mode 100644 mozilla/layout/generic/nsPlaceholderFrame.cpp delete mode 100644 mozilla/layout/generic/nsPlaceholderFrame.h delete mode 100644 mozilla/layout/generic/nsSelection.cpp delete mode 100644 mozilla/layout/generic/nsSpaceManager.cpp delete mode 100644 mozilla/layout/generic/nsSpaceManager.h delete mode 100644 mozilla/layout/html/Makefile delete mode 100644 mozilla/layout/html/base/Makefile delete mode 100644 mozilla/layout/html/base/makefile.win delete mode 100644 mozilla/layout/html/base/src/Makefile delete mode 100644 mozilla/layout/html/base/src/deadnsInlineFrame.h delete mode 100644 mozilla/layout/html/base/src/makefile.win delete mode 100644 mozilla/layout/html/base/src/nsAbsoluteFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsAbsoluteFrame.h delete mode 100644 mozilla/layout/html/base/src/nsBRPart.cpp delete mode 100644 mozilla/layout/html/base/src/nsBlockFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsBlockFrame.h delete mode 100644 mozilla/layout/html/base/src/nsBlockReflowState.cpp delete mode 100644 mozilla/layout/html/base/src/nsBlockReflowState.h delete mode 100644 mozilla/layout/html/base/src/nsBodyFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsBodyFrame.h delete mode 100644 mozilla/layout/html/base/src/nsBodyPart.cpp delete mode 100644 mozilla/layout/html/base/src/nsColumnFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsColumnFrame.h delete mode 100644 mozilla/layout/html/base/src/nsDOMAttributes.cpp delete mode 100644 mozilla/layout/html/base/src/nsDOMAttributes.h delete mode 100644 mozilla/layout/html/base/src/nsDOMIterator.cpp delete mode 100644 mozilla/layout/html/base/src/nsDOMIterator.h delete mode 100644 mozilla/layout/html/base/src/nsGlobalVariables.cpp delete mode 100644 mozilla/layout/html/base/src/nsGlobalVariables.h delete mode 100644 mozilla/layout/html/base/src/nsHRPart.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLAtoms.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLAtoms.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLContainer.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLContainer.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLContainerFrame.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLContent.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLContent.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLIIDs.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLIIDs.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLImage.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLParts.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLTagContent.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLTagContent.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLTagIDs.h delete mode 100644 mozilla/layout/html/base/src/nsHTMLTags.cpp delete mode 100644 mozilla/layout/html/base/src/nsHTMLTags.h delete mode 100644 mozilla/layout/html/base/src/nsIAnchoredItems.h delete mode 100644 mozilla/layout/html/base/src/nsIFloaterContainer.h delete mode 100644 mozilla/layout/html/base/src/nsIHTMLContent.h delete mode 100644 mozilla/layout/html/base/src/nsIHTMLFrameType.h delete mode 100644 mozilla/layout/html/base/src/nsIImageMap.h delete mode 100644 mozilla/layout/html/base/src/nsImageMap.cpp delete mode 100644 mozilla/layout/html/base/src/nsInlineFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsLeafFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsLeafFrame.h delete mode 100644 mozilla/layout/html/base/src/nsListItemFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsListItemFrame.h delete mode 100644 mozilla/layout/html/base/src/nsPageFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsPageFrame.h delete mode 100644 mozilla/layout/html/base/src/nsPlaceholderFrame.cpp delete mode 100644 mozilla/layout/html/base/src/nsPlaceholderFrame.h delete mode 100644 mozilla/layout/html/base/src/nsRootPart.cpp delete mode 100644 mozilla/layout/html/base/src/nsSpacerPart.cpp delete mode 100644 mozilla/layout/html/base/src/nsTextContent.cpp delete mode 100644 mozilla/layout/html/base/src/nsWBRPart.cpp delete mode 100644 mozilla/layout/html/document/Makefile delete mode 100644 mozilla/layout/html/document/makefile.win delete mode 100644 mozilla/layout/html/document/src/Makefile delete mode 100644 mozilla/layout/html/document/src/makefile.win delete mode 100644 mozilla/layout/html/document/src/nsHTMLContentSink.cpp delete mode 100644 mozilla/layout/html/document/src/nsHTMLDocument.cpp delete mode 100644 mozilla/layout/html/document/src/nsHTMLDocument.h delete mode 100644 mozilla/layout/html/document/src/nsIHTMLDocument.h delete mode 100644 mozilla/layout/html/document/src/ua.css delete mode 100644 mozilla/layout/html/forms/Makefile delete mode 100644 mozilla/layout/html/forms/makefile.win delete mode 100644 mozilla/layout/html/forms/public/Makefile delete mode 100644 mozilla/layout/html/forms/public/makefile.win delete mode 100644 mozilla/layout/html/forms/public/nsIFormControl.h delete mode 100644 mozilla/layout/html/forms/public/nsIFormManager.h delete mode 100644 mozilla/layout/html/forms/src/Makefile delete mode 100644 mozilla/layout/html/forms/src/makefile.win delete mode 100644 mozilla/layout/html/forms/src/nsForm.cpp delete mode 100644 mozilla/layout/html/forms/src/nsFormElement.cpp delete mode 100644 mozilla/layout/html/forms/src/nsHTMLForms.h delete mode 100644 mozilla/layout/html/forms/src/nsInput.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInput.h delete mode 100644 mozilla/layout/html/forms/src/nsInputButton.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputCheckbox.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputCheckbox.h delete mode 100644 mozilla/layout/html/forms/src/nsInputFile.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputFile.h delete mode 100644 mozilla/layout/html/forms/src/nsInputFrame.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputFrame.h delete mode 100644 mozilla/layout/html/forms/src/nsInputImage.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputImage.h delete mode 100644 mozilla/layout/html/forms/src/nsInputRadio.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputRadio.h delete mode 100644 mozilla/layout/html/forms/src/nsInputText.cpp delete mode 100644 mozilla/layout/html/forms/src/nsInputText.h delete mode 100644 mozilla/layout/html/forms/src/nsSelect.cpp delete mode 100644 mozilla/layout/html/makefile.win delete mode 100644 mozilla/layout/html/style/Makefile delete mode 100644 mozilla/layout/html/style/makefile.win delete mode 100644 mozilla/layout/html/style/public/Makefile delete mode 100644 mozilla/layout/html/style/public/makefile.win delete mode 100644 mozilla/layout/html/style/public/nsICSSParser.h delete mode 100644 mozilla/layout/html/style/src/Makefile delete mode 100644 mozilla/layout/html/style/src/makefile.win delete mode 100644 mozilla/layout/html/style/src/nsCSSDeclaration.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSKeywordIDs.h delete mode 100644 mozilla/layout/html/style/src/nsCSSKeywords.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSKeywords.h delete mode 100644 mozilla/layout/html/style/src/nsCSSLayout.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSLayout.h delete mode 100644 mozilla/layout/html/style/src/nsCSSParser.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSPropIDs.h delete mode 100644 mozilla/layout/html/style/src/nsCSSProps.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSProps.h delete mode 100644 mozilla/layout/html/style/src/nsCSSRendering.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSRendering.h delete mode 100644 mozilla/layout/html/style/src/nsCSSScanner.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSScanner.h delete mode 100644 mozilla/layout/html/style/src/nsCSSStyleRule.cpp delete mode 100644 mozilla/layout/html/style/src/nsCSSStyleSheet.cpp delete mode 100644 mozilla/layout/html/style/src/nsHTMLAttributes.cpp delete mode 100644 mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp delete mode 100644 mozilla/layout/html/style/src/nsHTMLValue.cpp delete mode 100644 mozilla/layout/html/style/src/nsHTMLValue.h delete mode 100644 mozilla/layout/html/style/src/nsICSSDeclaration.h delete mode 100644 mozilla/layout/html/style/src/nsICSSStyleRule.h delete mode 100644 mozilla/layout/html/style/src/nsICSSStyleSheet.h delete mode 100644 mozilla/layout/html/style/src/nsIHTMLAttributes.h delete mode 100644 mozilla/layout/html/style/src/nsIHTMLStyleSheet.h delete mode 100644 mozilla/layout/html/table/Makefile delete mode 100644 mozilla/layout/html/table/makefile.win delete mode 100644 mozilla/layout/html/table/src/Makefile delete mode 100644 mozilla/layout/html/table/src/makefile.win delete mode 100644 mozilla/layout/html/table/src/nsCellLayoutData.cpp delete mode 100644 mozilla/layout/html/table/src/nsCellLayoutData.h delete mode 100644 mozilla/layout/html/table/src/nsCellMap.cpp delete mode 100644 mozilla/layout/html/table/src/nsCellMap.h delete mode 100644 mozilla/layout/html/table/src/nsColLayoutData.cpp delete mode 100644 mozilla/layout/html/table/src/nsColLayoutData.h delete mode 100644 mozilla/layout/html/table/src/nsITableContent.h delete mode 100644 mozilla/layout/html/table/src/nsTableCaption.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableCaption.h delete mode 100644 mozilla/layout/html/table/src/nsTableCaptionFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableCaptionFrame.h delete mode 100644 mozilla/layout/html/table/src/nsTableCell.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableCell.h delete mode 100644 mozilla/layout/html/table/src/nsTableCellFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableCellFrame.h delete mode 100644 mozilla/layout/html/table/src/nsTableCol.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableCol.h delete mode 100644 mozilla/layout/html/table/src/nsTableColGroup.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableColGroup.h delete mode 100644 mozilla/layout/html/table/src/nsTableColGroupFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableColGroupFrame.h delete mode 100644 mozilla/layout/html/table/src/nsTableContent.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableContent.h delete mode 100644 mozilla/layout/html/table/src/nsTableFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableFrame.h delete mode 100644 mozilla/layout/html/table/src/nsTableOuterFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableOuterFrame.h delete mode 100644 mozilla/layout/html/table/src/nsTablePart.cpp delete mode 100644 mozilla/layout/html/table/src/nsTablePart.h delete mode 100644 mozilla/layout/html/table/src/nsTableRow.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableRow.h delete mode 100644 mozilla/layout/html/table/src/nsTableRowFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableRowFrame.h delete mode 100644 mozilla/layout/html/table/src/nsTableRowGroup.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableRowGroup.h delete mode 100644 mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp delete mode 100644 mozilla/layout/html/table/src/nsTableRowGroupFrame.h delete mode 100644 mozilla/layout/html/tests/CellMapTest/CellMapTest.cpp delete mode 100644 mozilla/layout/html/tests/Makefile delete mode 100644 mozilla/layout/html/tests/TestAttributes.cpp delete mode 100644 mozilla/layout/html/tests/TestCSSParser.cpp delete mode 100644 mozilla/layout/html/tests/TestCSSPropertyLookup.cpp delete mode 100644 mozilla/layout/html/tests/TestCSSScanner.cpp delete mode 100644 mozilla/layout/html/tests/TestHTMLTagLookup.cpp delete mode 100644 mozilla/layout/html/tests/TestInlineFrame.cpp delete mode 100644 mozilla/layout/html/tests/css/INVALID.css delete mode 100644 mozilla/layout/html/tests/css/SELECTORS.css delete mode 100644 mozilla/layout/html/tests/css/background-attachment.css delete mode 100644 mozilla/layout/html/tests/css/background-color.css delete mode 100644 mozilla/layout/html/tests/css/background-image.css delete mode 100644 mozilla/layout/html/tests/css/background-position.css delete mode 100644 mozilla/layout/html/tests/css/background-repeat.css delete mode 100644 mozilla/layout/html/tests/css/background.css delete mode 100644 mozilla/layout/html/tests/css/border-bottom-width.css delete mode 100644 mozilla/layout/html/tests/css/border-bottom.css delete mode 100644 mozilla/layout/html/tests/css/border-color.css delete mode 100644 mozilla/layout/html/tests/css/border-left-width.css delete mode 100644 mozilla/layout/html/tests/css/border-left.css delete mode 100644 mozilla/layout/html/tests/css/border-right-width.css delete mode 100644 mozilla/layout/html/tests/css/border-right.css delete mode 100644 mozilla/layout/html/tests/css/border-style.css delete mode 100644 mozilla/layout/html/tests/css/border-top-width.css delete mode 100644 mozilla/layout/html/tests/css/border-top.css delete mode 100644 mozilla/layout/html/tests/css/border-width.css delete mode 100644 mozilla/layout/html/tests/css/border.css delete mode 100644 mozilla/layout/html/tests/css/bugs/bug01.css delete mode 100644 mozilla/layout/html/tests/css/bugs/bug02.css delete mode 100644 mozilla/layout/html/tests/css/clear.css delete mode 100644 mozilla/layout/html/tests/css/clip.css delete mode 100644 mozilla/layout/html/tests/css/color.css delete mode 100644 mozilla/layout/html/tests/css/cursor.css delete mode 100644 mozilla/layout/html/tests/css/direction.css delete mode 100644 mozilla/layout/html/tests/css/display.css delete mode 100644 mozilla/layout/html/tests/css/float.css delete mode 100644 mozilla/layout/html/tests/css/font-family.css delete mode 100644 mozilla/layout/html/tests/css/font-size.css delete mode 100644 mozilla/layout/html/tests/css/font-style.css delete mode 100644 mozilla/layout/html/tests/css/font-variant.css delete mode 100644 mozilla/layout/html/tests/css/font-weight.css delete mode 100644 mozilla/layout/html/tests/css/font.css delete mode 100644 mozilla/layout/html/tests/css/height.css delete mode 100644 mozilla/layout/html/tests/css/left.css delete mode 100644 mozilla/layout/html/tests/css/letter-spacing.css delete mode 100644 mozilla/layout/html/tests/css/line-height.css delete mode 100644 mozilla/layout/html/tests/css/list-style-image.css delete mode 100644 mozilla/layout/html/tests/css/list-style-position.css delete mode 100644 mozilla/layout/html/tests/css/list-style-type.css delete mode 100644 mozilla/layout/html/tests/css/list-style.css delete mode 100644 mozilla/layout/html/tests/css/margin-bottom.css delete mode 100644 mozilla/layout/html/tests/css/margin-left.css delete mode 100644 mozilla/layout/html/tests/css/margin-right.css delete mode 100644 mozilla/layout/html/tests/css/margin-top.css delete mode 100644 mozilla/layout/html/tests/css/margin.css delete mode 100644 mozilla/layout/html/tests/css/overflow.css delete mode 100644 mozilla/layout/html/tests/css/padding-bottom.css delete mode 100644 mozilla/layout/html/tests/css/padding-left.css delete mode 100644 mozilla/layout/html/tests/css/padding-right.css delete mode 100644 mozilla/layout/html/tests/css/padding-top.css delete mode 100644 mozilla/layout/html/tests/css/padding.css delete mode 100644 mozilla/layout/html/tests/css/position.css delete mode 100644 mozilla/layout/html/tests/css/text-align.css delete mode 100644 mozilla/layout/html/tests/css/text-decoration.css delete mode 100644 mozilla/layout/html/tests/css/text-indent.css delete mode 100644 mozilla/layout/html/tests/css/text-transform.css delete mode 100644 mozilla/layout/html/tests/css/top.css delete mode 100644 mozilla/layout/html/tests/css/vertical-align.css delete mode 100644 mozilla/layout/html/tests/css/visibility.css delete mode 100644 mozilla/layout/html/tests/css/white-space.css delete mode 100644 mozilla/layout/html/tests/css/width.css delete mode 100644 mozilla/layout/html/tests/css/word-spacing.css delete mode 100644 mozilla/layout/html/tests/css/z-index.css delete mode 100644 mozilla/layout/html/tests/makefile.win delete mode 100644 mozilla/layout/html/tests/table/TableContentTest/TableContentTest.cpp delete mode 100644 mozilla/layout/html/tests/table/testcases/nestedTables.html delete mode 100644 mozilla/layout/html/tests/table/testcases/slashlogo.html delete mode 100644 mozilla/layout/html/tests/table/testcases/wa_table_thtd_rowspan.html delete mode 100644 mozilla/layout/html/tests/table/testcases/wa_table_tr_align.html delete mode 100644 mozilla/layout/html/tests/table/testcases/wf_table_index.html delete mode 100644 mozilla/layout/makefile.win delete mode 100644 mozilla/layout/style/nsCSSDeclaration.cpp delete mode 100644 mozilla/layout/style/nsCSSKeywords.cpp delete mode 100644 mozilla/layout/style/nsCSSKeywords.h delete mode 100644 mozilla/layout/style/nsCSSParser.cpp delete mode 100644 mozilla/layout/style/nsCSSProps.cpp delete mode 100644 mozilla/layout/style/nsCSSProps.h delete mode 100644 mozilla/layout/style/nsCSSScanner.cpp delete mode 100644 mozilla/layout/style/nsCSSScanner.h delete mode 100644 mozilla/layout/style/nsCSSStruct.cpp delete mode 100644 mozilla/layout/style/nsCSSStyleRule.cpp delete mode 100644 mozilla/layout/style/nsCSSStyleSheet.cpp delete mode 100644 mozilla/layout/style/nsHTMLStyleSheet.cpp delete mode 100644 mozilla/layout/style/nsICSSParser.h delete mode 100644 mozilla/layout/style/nsICSSStyleRule.h delete mode 100644 mozilla/layout/style/nsIStyleRule.h delete mode 100644 mozilla/layout/style/nsIStyleSheet.h delete mode 100644 mozilla/layout/style/nsStyleContext.cpp delete mode 100644 mozilla/layout/style/nsStyleCoord.h delete mode 100644 mozilla/layout/style/nsStyleSet.cpp delete mode 100644 mozilla/layout/style/ua.css delete mode 100644 mozilla/layout/tables/nsCellMap.cpp delete mode 100644 mozilla/layout/tables/nsCellMap.h delete mode 100644 mozilla/layout/tables/nsTableCellFrame.cpp delete mode 100644 mozilla/layout/tables/nsTableCellFrame.h delete mode 100644 mozilla/layout/tables/nsTableColGroupFrame.cpp delete mode 100644 mozilla/layout/tables/nsTableColGroupFrame.h delete mode 100644 mozilla/layout/tables/nsTableFrame.cpp delete mode 100644 mozilla/layout/tables/nsTableFrame.h delete mode 100644 mozilla/layout/tables/nsTableOuterFrame.cpp delete mode 100644 mozilla/layout/tables/nsTableOuterFrame.h delete mode 100644 mozilla/layout/tables/nsTableRowFrame.cpp delete mode 100644 mozilla/layout/tables/nsTableRowFrame.h delete mode 100644 mozilla/layout/tables/nsTableRowGroupFrame.cpp delete mode 100644 mozilla/layout/tables/nsTableRowGroupFrame.h delete mode 100644 mozilla/layout/tools/CSSKeywords.txt delete mode 100644 mozilla/layout/tools/CSSProps.txt delete mode 100644 mozilla/layout/tools/ColorNames.txt delete mode 100644 mozilla/layout/tools/HTMLTags.txt delete mode 100644 mozilla/layout/tools/Makefile delete mode 100644 mozilla/layout/tools/genhash.inc delete mode 100644 mozilla/layout/tools/genhash.pl delete mode 100644 mozilla/parser/htmlparser/Makefile delete mode 100644 mozilla/parser/htmlparser/makefile.win delete mode 100644 mozilla/parser/htmlparser/robot/Makefile delete mode 100644 mozilla/parser/htmlparser/robot/RobotMain.cpp delete mode 100644 mozilla/parser/htmlparser/robot/makefile.win delete mode 100644 mozilla/parser/htmlparser/robot/nsIRobotSink.h delete mode 100644 mozilla/parser/htmlparser/robot/nsIRobotSinkObserver.h delete mode 100644 mozilla/parser/htmlparser/robot/nsRobotSink.cpp delete mode 100644 mozilla/parser/htmlparser/src/CNavDTD.cpp delete mode 100644 mozilla/parser/htmlparser/src/CNavDTD.h delete mode 100644 mozilla/parser/htmlparser/src/CNavDelegate.cpp delete mode 100644 mozilla/parser/htmlparser/src/CNavDelegate.h delete mode 100644 mozilla/parser/htmlparser/src/COtherDTD.cpp delete mode 100644 mozilla/parser/htmlparser/src/COtherDTD.h delete mode 100644 mozilla/parser/htmlparser/src/COtherDelegate.cpp delete mode 100644 mozilla/parser/htmlparser/src/COtherDelegate.h delete mode 100644 mozilla/parser/htmlparser/src/Makefile delete mode 100644 mozilla/parser/htmlparser/src/SelfTest.cpp delete mode 100644 mozilla/parser/htmlparser/src/makefile.win delete mode 100644 mozilla/parser/htmlparser/src/nsDefaultTokenHandler.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsDefaultTokenHandler.h delete mode 100644 mozilla/parser/htmlparser/src/nsHTMLContentSink.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsHTMLContentSink.h delete mode 100644 mozilla/parser/htmlparser/src/nsHTMLParser.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsHTMLParser.h delete mode 100644 mozilla/parser/htmlparser/src/nsHTMLTokens.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsHTMLTokens.h delete mode 100644 mozilla/parser/htmlparser/src/nsIContentSink.h delete mode 100644 mozilla/parser/htmlparser/src/nsIDTD.h delete mode 100644 mozilla/parser/htmlparser/src/nsIHTMLContentSink.h delete mode 100644 mozilla/parser/htmlparser/src/nsIParser.h delete mode 100644 mozilla/parser/htmlparser/src/nsIParserNode.h delete mode 100644 mozilla/parser/htmlparser/src/nsITokenHandler.h delete mode 100644 mozilla/parser/htmlparser/src/nsITokenizerDelegate.h delete mode 100644 mozilla/parser/htmlparser/src/nsParserNode.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsParserNode.h delete mode 100644 mozilla/parser/htmlparser/src/nsParserTypes.h delete mode 100644 mozilla/parser/htmlparser/src/nsScanner.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsScanner.h delete mode 100644 mozilla/parser/htmlparser/src/nsToken.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsToken.h delete mode 100644 mozilla/parser/htmlparser/src/nsTokenHandler.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsTokenHandler.h delete mode 100644 mozilla/parser/htmlparser/src/nsTokenizer.cpp delete mode 100644 mozilla/parser/htmlparser/src/nsTokenizer.h delete mode 100644 mozilla/parser/htmlparser/src/nshtmlpars.h delete mode 100644 mozilla/parser/htmlparser/tests/html/Table01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table02.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table03.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table04.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05e.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05f.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05g.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05h.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05i.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table05j.html delete mode 100644 mozilla/parser/htmlparser/tests/html/Table06.html delete mode 100644 mozilla/parser/htmlparser/tests/html/acronym1.html delete mode 100644 mozilla/parser/htmlparser/tests/html/aname01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/atoi01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/attribute_quote_bug1.html delete mode 100644 mozilla/parser/htmlparser/tests/html/bdo001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/br001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/button001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/button002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/center001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/center002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col004.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col005.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col006.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col007.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col008.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col009.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col010.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col011.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col012.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col013.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col014.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col015.html delete mode 100644 mozilla/parser/htmlparser/tests/html/col016.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del004.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del005.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del006.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del007.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del008.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del009.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del010.html delete mode 100644 mozilla/parser/htmlparser/tests/html/del011.html delete mode 100644 mozilla/parser/htmlparser/tests/html/doc001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/doc002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/endswithcr.html delete mode 100644 mozilla/parser/htmlparser/tests/html/entity001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/fieldset001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/fieldset002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/fieldset003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/form001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/form002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/head01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/head02.html delete mode 100644 mozilla/parser/htmlparser/tests/html/head03.html delete mode 100644 mozilla/parser/htmlparser/tests/html/home01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/html001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/imgmap001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/ins001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/ins002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/ins003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/insdel01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/insdel02.html delete mode 100644 mozilla/parser/htmlparser/tests/html/layer001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/layer002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/layer003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/layer01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/list001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/list002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/list003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/newlines.html delete mode 100644 mozilla/parser/htmlparser/tests/html/obj001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/obj002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/obj003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/param001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/param002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre004.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre005.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre006.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre007.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre012.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre015.html delete mode 100644 mozilla/parser/htmlparser/tests/html/pre016.html delete mode 100644 mozilla/parser/htmlparser/tests/html/q001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/quote001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/quote002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/quote003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/span001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/span002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/span003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/strike002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/strike005.html delete mode 100644 mozilla/parser/htmlparser/tests/html/strike006.html delete mode 100644 mozilla/parser/htmlparser/tests/html/strike007.html delete mode 100644 mozilla/parser/htmlparser/tests/html/strike008.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05a.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05b.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05c.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05d.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05k.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05l.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05m.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05n.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table05o.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table07.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table200.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table201.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table202.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table203.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table204.html delete mode 100644 mozilla/parser/htmlparser/tests/html/table205.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tableall.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag004.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag005.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag006.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag007.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tag008.html delete mode 100644 mozilla/parser/htmlparser/tests/html/target01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/tbody001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/text001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/text002.html delete mode 100644 mozilla/parser/htmlparser/tests/html/text003.html delete mode 100644 mozilla/parser/htmlparser/tests/html/thead001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/title01.html delete mode 100644 mozilla/parser/htmlparser/tests/html/usascii.html delete mode 100644 mozilla/parser/htmlparser/tests/html/utf8001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/value001.html delete mode 100644 mozilla/parser/htmlparser/tests/html/xmp005.html delete mode 100644 mozilla/parser/htmlparser/tests/windows/Selftest.cpp delete mode 100644 mozilla/raptor.mak delete mode 100644 mozilla/raptor.mk delete mode 100644 mozilla/string/obsolete/nsString.cpp delete mode 100644 mozilla/string/obsolete/nsString.h delete mode 100644 mozilla/view/Makefile delete mode 100644 mozilla/view/makefile.win delete mode 100644 mozilla/view/public/Makefile delete mode 100644 mozilla/view/public/makefile.win delete mode 100644 mozilla/view/public/nsIScrollableView.h delete mode 100644 mozilla/view/public/nsIView.h delete mode 100644 mozilla/view/public/nsIViewManager.h delete mode 100644 mozilla/view/public/nsViewsCID.h delete mode 100644 mozilla/view/src/Makefile delete mode 100644 mozilla/view/src/makefile.win delete mode 100644 mozilla/view/src/nsScrollingView.cpp delete mode 100644 mozilla/view/src/nsScrollingView.h delete mode 100644 mozilla/view/src/nsView.cpp delete mode 100644 mozilla/view/src/nsView.h delete mode 100644 mozilla/view/src/nsViewFactory.cpp delete mode 100644 mozilla/view/src/nsViewManager.cpp delete mode 100644 mozilla/view/src/nsViewManager.h delete mode 100644 mozilla/webshell/Makefile delete mode 100644 mozilla/webshell/makefile.win delete mode 100644 mozilla/webshell/public/Makefile delete mode 100644 mozilla/webshell/public/makefile.win delete mode 100644 mozilla/webshell/public/nsIApplicationShell.h delete mode 100644 mozilla/webshell/public/nsIDocumentWidget.h delete mode 100644 mozilla/webshell/public/nsILinkHandler.h delete mode 100644 mozilla/webshell/public/nsIShellInstance.h delete mode 100644 mozilla/webshell/public/nsIWebWidget.h delete mode 100644 mozilla/webshell/public/nsweb.h delete mode 100644 mozilla/webshell/src/Makefile delete mode 100644 mozilla/webshell/src/makefile.win delete mode 100644 mozilla/webshell/src/nsApplicationManager.cpp delete mode 100644 mozilla/webshell/src/nsApplicationManager.h delete mode 100644 mozilla/webshell/src/nsLinkHandler.cpp delete mode 100644 mozilla/webshell/src/nsShellInstance.cpp delete mode 100644 mozilla/webshell/src/nsShellInstance.h delete mode 100644 mozilla/webshell/src/nsWebWidget.cpp delete mode 100644 mozilla/webshell/src/windows/makefile.win delete mode 100644 mozilla/webshell/src/windows/winmain.cpp delete mode 100644 mozilla/webshell/tests/Makefile delete mode 100644 mozilla/webshell/tests/imgtest/ImageTest.cpp delete mode 100644 mozilla/webshell/tests/imgtest/ImageTestImpl.cpp delete mode 100644 mozilla/webshell/tests/imgtest/ImageTestImpl.h delete mode 100644 mozilla/webshell/tests/imgtest/image.rc delete mode 100644 mozilla/webshell/tests/imgtest/makefile.win delete mode 100644 mozilla/webshell/tests/imgtest/nsImageTest.cpp delete mode 100644 mozilla/webshell/tests/imgtest/nsImageTest.h delete mode 100644 mozilla/webshell/tests/imgtest/resources.h delete mode 100644 mozilla/webshell/tests/makefile.win delete mode 100644 mozilla/webshell/tests/nettest/Makefile delete mode 100644 mozilla/webshell/tests/nettest/makefile.win delete mode 100644 mozilla/webshell/tests/nettest/nettest.cpp delete mode 100644 mozilla/webshell/tests/viewer/JSConsole.cpp delete mode 100644 mozilla/webshell/tests/viewer/JSConsole.h delete mode 100644 mozilla/webshell/tests/viewer/jsconsres.h delete mode 100644 mozilla/webshell/tests/viewer/makefile.win delete mode 100644 mozilla/webshell/tests/viewer/nsDocLoader.cpp delete mode 100644 mozilla/webshell/tests/viewer/nsDocLoader.h delete mode 100644 mozilla/webshell/tests/viewer/resources.h delete mode 100644 mozilla/webshell/tests/viewer/samples/Anieyes.gif delete mode 100644 mozilla/webshell/tests/viewer/samples/bg.jpg delete mode 100644 mozilla/webshell/tests/viewer/samples/gear1.gif delete mode 100644 mozilla/webshell/tests/viewer/samples/raptor.jpg delete mode 100644 mozilla/webshell/tests/viewer/samples/rock_gra.gif delete mode 100644 mozilla/webshell/tests/viewer/samples/test0.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test1.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test2.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test3.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test4.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test5.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test6.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test7.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test8.html delete mode 100644 mozilla/webshell/tests/viewer/samples/test_form.html delete mode 100644 mozilla/webshell/tests/viewer/viewer.rc delete mode 100644 mozilla/webshell/tests/viewer/winmain.cpp delete mode 100644 mozilla/widget/Makefile delete mode 100755 mozilla/widget/build.bat delete mode 100644 mozilla/widget/makefile.win delete mode 100644 mozilla/widget/public/Makefile delete mode 100644 mozilla/widget/public/makefile.win delete mode 100644 mozilla/widget/public/nsGUIEvent.h delete mode 100644 mozilla/widget/public/nsIButton.h delete mode 100644 mozilla/widget/public/nsICheckButton.h delete mode 100644 mozilla/widget/public/nsIComboBox.h delete mode 100644 mozilla/widget/public/nsIEventListener.h delete mode 100644 mozilla/widget/public/nsIFileWidget.h delete mode 100644 mozilla/widget/public/nsIListBox.h delete mode 100644 mozilla/widget/public/nsIListWidget.h delete mode 100644 mozilla/widget/public/nsIMouseListener.h delete mode 100644 mozilla/widget/public/nsIRadioButton.h delete mode 100644 mozilla/widget/public/nsIRadioGroup.h delete mode 100644 mozilla/widget/public/nsIScrollbar.h delete mode 100644 mozilla/widget/public/nsITabWidget.h delete mode 100644 mozilla/widget/public/nsITextAreaWidget.h delete mode 100644 mozilla/widget/public/nsITextWidget.h delete mode 100644 mozilla/widget/public/nsIToolkit.h delete mode 100644 mozilla/widget/public/nsIWidget.h delete mode 100644 mozilla/widget/public/nsWidgetsCID.h delete mode 100644 mozilla/widget/public/nsui.h delete mode 100644 mozilla/widget/src/Makefile delete mode 100644 mozilla/widget/src/makefile.win delete mode 100644 mozilla/widget/src/windows/Makefile delete mode 100644 mozilla/widget/src/windows/makefile.win delete mode 100644 mozilla/widget/src/windows/nsButton.cpp delete mode 100644 mozilla/widget/src/windows/nsButton.h delete mode 100644 mozilla/widget/src/windows/nsCList.h delete mode 100644 mozilla/widget/src/windows/nsCheckButton.cpp delete mode 100644 mozilla/widget/src/windows/nsCheckButton.h delete mode 100644 mozilla/widget/src/windows/nsComboBox.cpp delete mode 100644 mozilla/widget/src/windows/nsComboBox.h delete mode 100644 mozilla/widget/src/windows/nsFileWidget.cpp delete mode 100644 mozilla/widget/src/windows/nsFileWidget.h delete mode 100644 mozilla/widget/src/windows/nsListBox.cpp delete mode 100644 mozilla/widget/src/windows/nsListBox.h delete mode 100644 mozilla/widget/src/windows/nsObject.cpp delete mode 100644 mozilla/widget/src/windows/nsObject.h delete mode 100644 mozilla/widget/src/windows/nsRadioButton.cpp delete mode 100644 mozilla/widget/src/windows/nsRadioButton.h delete mode 100644 mozilla/widget/src/windows/nsRadioGroup.cpp delete mode 100644 mozilla/widget/src/windows/nsRadioGroup.h delete mode 100644 mozilla/widget/src/windows/nsScrollbar.cpp delete mode 100644 mozilla/widget/src/windows/nsScrollbar.h delete mode 100644 mozilla/widget/src/windows/nsStringUtil.h delete mode 100644 mozilla/widget/src/windows/nsSwitchToUIThread.h delete mode 100644 mozilla/widget/src/windows/nsTabWidget.cpp delete mode 100644 mozilla/widget/src/windows/nsTabWidget.h delete mode 100644 mozilla/widget/src/windows/nsTextAreaWidget.cpp delete mode 100644 mozilla/widget/src/windows/nsTextAreaWidget.h delete mode 100644 mozilla/widget/src/windows/nsTextHelper.cpp delete mode 100644 mozilla/widget/src/windows/nsTextHelper.h delete mode 100644 mozilla/widget/src/windows/nsTextWidget.cpp delete mode 100644 mozilla/widget/src/windows/nsTextWidget.h delete mode 100644 mozilla/widget/src/windows/nsToolkit.cpp delete mode 100644 mozilla/widget/src/windows/nsToolkit.h delete mode 100644 mozilla/widget/src/windows/nsWidgetFactory.cpp delete mode 100644 mozilla/widget/src/windows/nsWindow.cpp delete mode 100644 mozilla/widget/src/windows/nsWindow.h delete mode 100644 mozilla/widget/src/windows/nsdefs.h delete mode 100644 mozilla/widget/src/windows/res/select.cur delete mode 100644 mozilla/widget/src/windows/resource.h delete mode 100644 mozilla/widget/src/windows/widget.rc delete mode 100644 mozilla/widget/tests/Makefile delete mode 100644 mozilla/widget/tests/Scribble.cpp delete mode 100644 mozilla/widget/tests/Scribble.h delete mode 100644 mozilla/widget/tests/main.cpp delete mode 100644 mozilla/widget/tests/makefile.win delete mode 100644 mozilla/widget/tests/windows/makefile.win delete mode 100644 mozilla/widget/tests/windows/winmain.cpp delete mode 100644 mozilla/xpcom/ds/nsArena.cpp delete mode 100644 mozilla/xpcom/ds/nsAtomTable.cpp delete mode 100644 mozilla/xpcom/ds/nsBTree.cpp delete mode 100644 mozilla/xpcom/ds/nsBTree.h delete mode 100644 mozilla/xpcom/ds/nsByteBuffer.cpp delete mode 100644 mozilla/xpcom/ds/nsCRT.cpp delete mode 100644 mozilla/xpcom/ds/nsCRT.h delete mode 100644 mozilla/xpcom/ds/nsDeque.cpp delete mode 100644 mozilla/xpcom/ds/nsDeque.h delete mode 100644 mozilla/xpcom/ds/nsIArena.h delete mode 100644 mozilla/xpcom/ds/nsIAtom.h delete mode 100644 mozilla/xpcom/ds/nsIByteBuffer.h delete mode 100644 mozilla/xpcom/ds/nsIUnicharBuffer.h delete mode 100644 mozilla/xpcom/ds/nsRBTree.cpp delete mode 100644 mozilla/xpcom/ds/nsRBTree.h delete mode 100644 mozilla/xpcom/ds/nsString.cpp delete mode 100644 mozilla/xpcom/ds/nsString.h delete mode 100644 mozilla/xpcom/ds/nsUnicharBuffer.cpp delete mode 100644 mozilla/xpcom/ds/nsUnitConversion.h delete mode 100644 mozilla/xpcom/ds/nsVoidArray.cpp delete mode 100644 mozilla/xpcom/ds/nsVoidArray.h delete mode 100644 mozilla/xpcom/glue/nsID.cpp delete mode 100644 mozilla/xpcom/glue/nsVoidArray.cpp delete mode 100644 mozilla/xpcom/glue/nsVoidArray.h delete mode 100644 mozilla/xpcom/io/nsIInputStream.h delete mode 100644 mozilla/xpcom/io/nsIUnicharInputStream.h delete mode 100644 mozilla/xpcom/io/nsUnicharInputStream.cpp delete mode 100644 mozilla/xpcom/string/obsolete/nsString.cpp delete mode 100644 mozilla/xpcom/string/obsolete/nsString.h delete mode 100644 mozilla/xpcom/tests/CvtURL.cpp delete mode 100644 mozilla/xpcom/tests/TestAtoms.cpp delete mode 100644 mozilla/xpcom/tests/TestCRT.cpp delete mode 100644 mozilla/xpcom/tests/resources.h diff --git a/CVSROOT/modules b/CVSROOT/modules deleted file mode 100644 index 042a0971b19..00000000000 --- a/CVSROOT/modules +++ /dev/null @@ -1,293 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository. - -MozillaSource -a \ - MozillaSourceWin \ - MozillaSourceMac \ - MozillaSourceUnix \ - -MozillaSourceWin -a MozillaSourceCommon MozillaSourceWinOnly - -MozillaSourceMac -a MozillaSourceCommon MozillaSourceMacOnly - -MozillaSourceUnix -a MozillaSourceCommon MozillaSourceUnixOnly - -MozillaSourceCommon -a \ - mozilla/LEGAL \ - mozilla/LICENSE \ - mozilla/CHANGES.html \ - mozilla/build \ - mozilla/include \ - mozilla/jpeg \ - mozilla/js \ - mozilla/lib/htmldlgs \ - mozilla/lib/layout \ - mozilla/lib/libcnv \ - mozilla/lib/libi18n \ - mozilla/lib/liblayer \ - mozilla/lib/libmisc \ - mozilla/lib/libmime \ - mozilla/lib/libmocha \ - mozilla/lib/libnet \ - mozilla/lib/libparse \ - mozilla/lib/libpics \ - mozilla/lib/libpwcac \ - mozilla/lib/libstyle \ - mozilla/lib/plugin \ - mozilla/lib/xlate \ - mozilla/lib/xp \ - mozilla/modules/edtplug/classes \ - mozilla/modules/edtplug/src \ - mozilla/modules/edtplug/include \ - mozilla/modules/libfont/classes \ - mozilla/modules/libfont/public \ - mozilla/modules/libfont/src \ - mozilla/modules/libhook \ - mozilla/modules/libimg \ - mozilla/modules/libpref \ - mozilla/modules/libreg \ - mozilla/modules/libutil \ - mozilla/modules/progress/src \ - mozilla/modules/rdf \ - mozilla/modules/schedulr \ - mozilla/modules/security/freenav \ - mozilla/modules/softupdt/classes \ - mozilla/modules/softupdt/include \ - mozilla/modules/softupdt/src \ - mozilla/modules/xml \ - mozilla/modules/zlib/src \ - mozilla/nav-java/stubs \ - mozilla/nsprpub \ - mozilla/xpcom \ - mozilla/l10n \ - mozilla/nsprpub \ - mozilla/dbm \ - mozilla/modules/schedulr \ - README - -MozillaSourceWinOnly -a \ - mozilla/client.mak \ - mozilla/cmd/makefile.win \ - mozilla/cmd/dialup \ - mozilla/cmd/wincom \ - mozilla/cmd/winfe \ - mozilla/config \ - mozilla/lib/makefile.win \ - mozilla/modules/coreincl \ - mozilla/modules/edtplug/makefile.win \ - mozilla/makefile.win \ - mozilla/modules/libfont/jmcgen \ - mozilla/modules/libfont/makefile.win \ - mozilla/modules/libfont/producers/makefile.win \ - mozilla/modules/libfont/producers/win \ - mozilla/modules/libfont/producers/win/classes \ - mozilla/modules/libfont/producers/win/classes/netscape \ - mozilla/modules/libfont/producers/win/classes/netscape/fonts \ - mozilla/modules/libfont/producers/win/src \ - mozilla/modules/makefile.win \ - mozilla/modules/progress/makefile.win \ - mozilla/modules/progress/public \ - mozilla/modules/security/makefile.win \ - mozilla/modules/softupdt/makefile.win \ - mozilla/modules/zlib/makefile.win \ - mozilla/nav-java/makefile.win \ - JavaStubWin - - -MozillaSourceUnixOnly -a \ - mozilla/cmd/Makefile \ - mozilla/cmd/stubfe \ - mozilla/cmd/xfe \ - mozilla/config/.cvsignore \ - mozilla/config/AIX.mk \ - mozilla/config/BSD_OS.mk \ - mozilla/config/bsdecho.c \ - mozilla/config/bsdecho.c \ - mozilla/config/clobber_miss.pl \ - mozilla/config/clobber_miss.pl \ - mozilla/config/common.mk \ - mozilla/config/common.mk \ - mozilla/config/config.guess \ - mozilla/config/config.mk \ - mozilla/config/coreconf.mk \ - mozilla/config/coreconf.mk \ - mozilla/config/cvsco.pl \ - mozilla/config/cvsco.pl \ - mozilla/config/fastcwd.pl \ - mozilla/config/fastcwd.pl \ - mozilla/config/FreeBSD.mk \ - mozilla/config/gtscc.c \ - mozilla/config/HP-UX.mk \ - mozilla/config/IRIX.mk \ - mozilla/config/Linux.mk \ - mozilla/config/makecopy.c \ - mozilla/config/makecopy.c \ - mozilla/config/Makefile \ - mozilla/config/Makefile \ - mozilla/config/mangle.c \ - mozilla/config/mangle.c \ - mozilla/config/mantomak.c \ - mozilla/config/mantomak.c \ - mozilla/config/mkdepend \ - mozilla/config/NCR.mk \ - mozilla/config/NEC.mk \ - mozilla/config/NEWS-OS.mk \ - mozilla/config/NEXTSTEP.mk \ - mozilla/config/nfspwd.pl \ - mozilla/config/nfspwd.pl \ - mozilla/config/nodl.pl \ - mozilla/config/nodl.pl \ - mozilla/config/nsinstall.c \ - mozilla/config/nsinstall.c \ - mozilla/config/OSF1.mk \ - mozilla/config/outofdate.pl \ - mozilla/config/outofdate.pl \ - mozilla/config/pathsub.c \ - mozilla/config/pathsub.c \ - mozilla/config/pathsub.h \ - mozilla/config/pathsub.h \ - mozilla/config/pkg2dpth.pl \ - mozilla/config/pkg2dpth.pl \ - mozilla/config/ports \ - mozilla/config/revdepth.pl \ - mozilla/config/revdepth.pl \ - mozilla/config/Rhapsody.mk \ - mozilla/config/rules.mk \ - mozilla/config/SCOOS.mk \ - mozilla/config/SINIX.mk \ - mozilla/config/sj.pl \ - mozilla/config/sj.pl \ - mozilla/config/SunOS.mk \ - mozilla/config/SunOS4.mk \ - mozilla/config/SunOS5.mk \ - mozilla/config/UNIXWARE.mk \ - mozilla/config/xmversion.sh \ - mozilla/lib/Makefile \ - mozilla/Makefile \ - mozilla/modules/edtplug/Makefile \ - mozilla/modules/libfont/jmcgen \ - mozilla/modules/libfont/Makefile \ - mozilla/modules/libfont/producers/Makefile \ - mozilla/modules/Makefile \ - mozilla/modules/progress/Makefile \ - mozilla/modules/progress/public \ - mozilla/modules/security/Makefile \ - mozilla/modules/softupdt/Makefile \ - mozilla/modules/zlib/Makefile \ - mozilla/nav-java/Makefile \ - mozilla/lib/mariner \ - JavaStubUnix - - -MozillaSourceMacOnly -a \ - mozilla/cmd/dialup \ - mozilla/cmd/macfe \ - mozilla/lib/mac/AutoAdmin \ - mozilla/lib/mac/Includes \ - mozilla/lib/mac/MacMemoryAllocator \ - mozilla/lib/mac/Misc \ - mozilla/lib/mac/MoreFiles \ - mozilla/lib/mac/NSRuntime \ - mozilla/lib/mac/NSStdLib \ - mozilla/lib/mac/patches \ - mozilla/lib/mac/PowerPlant \ - mozilla/lib/mac/UserInterface \ - mozilla/modules/coreincl \ - mozilla/modules/edtplug/macbuild \ - mozilla/modules/libfont/jmcgen/include \ - mozilla/modules/libfont/jmcgen/src \ - mozilla/modules/libfont/macbuild \ - mozilla/modules/progress/macbuild \ - mozilla/modules/progress/public \ - mozilla/modules/softupdt/macbuild \ - mozilla/modules/zlib/macbuild \ - mozilla/lib/mariner \ - JavaStubMac - -JavaStubAll -a \ - JavaStubWin \ - JavaStubMac \ - JavaStubUnix - -JavaStubCore -a \ - mozilla/sun-java/stubs/include \ - mozilla/sun-java/stubs/src - -JavaStubMac -a \ - JavaStubCore \ - mozilla/sun-java/stubs/macbuild \ - mozilla/sun-java/stubs/macjri - -JavaStubUnix -a \ - JavaStubCore \ - mozilla/sun-java/Makefile \ - mozilla/sun-java/stubs/jri \ - mozilla/sun-java/stubs/Makefile - -JavaStubWin -a \ - JavaStubCore \ - mozilla/sun-java/makefile.win \ - mozilla/sun-java/stubs/jri \ - mozilla/sun-java/stubs/makefile.win - -###################################################################### - -# -# Modules for the raptor layout effort. Note that raptor dist is temporary -# until raptor is integrated into the mainline build. -# - -RaptorDist -a \ - mozilla/nsprpub \ - mozilla/include \ - mozilla/jpeg \ - mozilla/modules/libreg \ - mozilla/xpcom \ - mozilla/modules/zlib \ - mozilla/modules/libutil \ - mozilla/sun-java \ - mozilla/nav-java \ - mozilla/js \ - mozilla/modules/security/freenav \ - mozilla/modules/libpref \ - mozilla/modules/libimg \ - mozilla/lib/xp \ - mozilla/lib/libnet \ - mozilla/base - -Raptor -a \ - mozilla/htmlparser \ - mozilla/dom \ - mozilla/gfx \ - mozilla/view \ - mozilla/widget \ - mozilla/layout \ - mozilla/webshell - -RaptorAll -a \ - RaptorDist \ - Raptor diff --git a/README/mozilla/IDEMenuBar.gif b/README/mozilla/IDEMenuBar.gif deleted file mode 100644 index d5444da8c5faa5c3eccea8c1f3ef9b4d6beb32cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1575 zcmZwGdrZ?u0KoBML1;yUh+%e_SmZG*k5G$UDT)hoJQc#ji4_q16)6OmfI~JAL5L+( zVWVpc@+;a_D99>8MUafmZ91UnPZ357@@P;&h=oNcRbl>y|IzEd`TTR2OD=c03knHj z_$H;8Z3PAZ@c$3Pamdb%dR1`oQhXDjA0L*kJV4BB=sSkev5Z2x|aWy5)+6EBp zC~>_vC4X{lokG#zR_T4-Hd@+PZ>y}Ql59rssQ!W5$9Idq9@p1a-!Jk;RA`8@;bAQ! zXKt)dDUWb4x0#5s(8&j6!F)=*DrV-cJfe2a$7QIYEhCE^GOlWGR<|6)eMw{!FMPCZkJSM(l3ZJgOUc33nil3&QfN;mqn+!d!pJ9riBUeFeYe5`g})ifa0 zRWzAkwMsc~jvm0X7c&~Bg>@;f1w?D2%WnrHM+Ygi_K>GOS+uVUNI46#u6VD_7@wgU z?C`{wiQg~1oR)}M4*172AN=i2Bd0$me`&GB`CTtA)va_U^+dWaUU*QQ{Z=m;?AX7* zK&hYW&@BjCYI0%>e@M6qh34;icI4~#v=gg$WOGSJ__<@>8pL_eyMwfa zGfi?Wm*{VQyzG}lv63Xa`ID@&Qh}ROxm#eYrrddoaH7Jm&@HYcdBdzZ$EqThd}-;9 zhHr1#sJ*t4#c@o?B~dFBg%2l7M8gD9e*68m zTT`#lnJ3cH-h=t$0X-l z>GYb`9#<=hG}vJ^+OJc)JA&czh*p>2(UC6e&(0d1z31D_8{A9jKfkE*HoQ{y`sceS zb9|n$Y2kYpKV5oq@bmGX&@cQv^+Pd7GTNiguoe2@xHCGvI+5$StYM2XmPa^p#qwx+ ohi>`lsh)rL44qbI7{>Ev6o!cc!zP_!vdGfwjkeUr!4~-a2YX!l-v9sr diff --git a/README/mozilla/IDEPrefs.gif b/README/mozilla/IDEPrefs.gif deleted file mode 100644 index 2a0bbb0fd8310d47c6f14603f4556a05104932a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12532 zcmc&&^Lt#6(@j5Z+PIAxqp{OuW81cE+qSKZZ9CbZQKOCRrm=18yZ!zX@BB8;%$zyr z%-wzNbHydaI5-Wx{tN!_00RU07n2Z3HUwe}fiOWJFc2^V0tQ3CKnU0j0tP_9Fc2UF z0t7>VKnTzb0t7&SFc32c#0(5E147KqAZ7rF84LsffdIe|01yH&g8%>!01Olf0t1G? z03k4D5EuXi2AV*zq0mq)=rFV!=HH%w0R)51z+eCv4D)X-Gy?*`Kr=8900zSRV*xFi z0l{WwU^4*N4CWsxXfFT=2AF{X05AXs$`LvWh5>?M%)l@JFbs4nlrgGm;qq`Kp3bzs2@<8&}pb0Q2kI6P=!#|P%tQIC`)K7lm~P%6x$LC1fBfn+`lq( z6*K^5W-$MZgzAH?g=PSN82|?AD^xC&1+-`e12BVu`UrIzY5j?RR4vp>s2@<8 z&}pb0P)<<6P=!#|P%tQI=p>XDlm~P%6dMW+^Y29ex}jxg4ho1q0#VNTsqR8VZM^u>n@= zBMn8v@x;PW_>zsqqsdgtl{%x1CFAKojmNSjn@T6LIGm5yN1F}?`~`v$2&9_JXNn|} zX>`Y$E9S}+illO+S}GT+G@7h7##*YD>I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ub9aG@>*T6I#F<#;_) zmuDg%7#GHdYSL6z5Nauu*K{IS7Tc)72Y41usu9(89Cy;zbw5AT*7qH26&DTRdfPNq z(tu7Y`?+4K6Ko}EjB3DI-t?_2R-m((mexqsmh~uZhK{{VZ#$*ABrJx`v(6WWuB*=# z43?*3-i$p@$Dj-I+aPV~-Vca8Kl}cAaaVQ2(sunEKxX%JNQLL-VH(2J=D``9|IdeM zn85p$N#k9QoN0tS%g3n?r)~wrG)514y#~=Nfk>NK*L(nzoF`p?Dc+Y?z_cJDFUyQ5 zo-fO+Xrzs*M-$f@%e#|`qFWZV~mT&7~qnHf|*cSA5 z-(ILHNxkm6=G#{36wRR^GV=V!{wENTk7GL&&yVA8ByA7JPAvC(`}U8d1HIW)Z9mR^ zpmh)DL5}x3=OKrBr1oJ+mLJz~MO6>iNsV*}u=XOS#pZ9J-oZuS__x}NK - - - - MacFE Build Instructions - - - - -

-MacFE Build Instructions

-This is a general document on how to build, what works, what doesn't, and -things to watch out for when working on the Mac client. Please read -the entire document before you start tinkering...heck, you may just -learn something! - -

Abbreviations you will probably see in this document: -

    -
  • -MacFE - the Macintosh front end, including all the things you see -and some you don't.
  • - -
  • -XP - cross platform back end code, mostly written in C. You will -see this used like, "This is an XP problem" which means it's broken everywhere.
  • - -
  • -MW - Metrowerks Corporation. They make our build tools (CodeWarrior) -and PowerPlant
  • - -
  • -PP - PowerPlant, the GUI framework on which our app is built
  • - -
  • -CWProX - CodeWarrior Pro version X. You'll probably see CWPro1, -CWPro2, and CWPro3. We may also just refer to this as CW.
  • - -
  • -IDE - Integrated Development Environment. CodeWarrior is an IDE.
  • - -
- -

-Building

- -

-Pitfalls

- -

-History and Future

- -

- -
Building

- -

-What are the minimum machine requirements?

-To build Navigator, you need a fast PPC Mac. The faster the better. You -can't build with a 68K machine because we have too many resources, and -the build process will crash when trying to generate resources out of our -cross-platform strings. See the discussion below for a way around this. - -

You will need about 96 MB of physical RAM to "fast link" the app. You -can still fast link if you give your machine 96 MB of virtual memory, but -then the VM hit is large enough to counteract any improvement. One of our -beta testers had a machine with only 64MB of physical RAM (VM was off) -and it ran out of memory trying to link. Turning VM on got it to link, -but build time increased greatly. - -

The moral of the story: get lots of physical RAM and don't use VM. -

-How big of a partition do I need for the source?

-You should be ok with a 400MB disk partition, even when fully built. This -does not include tools like the IDE, just source. -

-Why do I need CWPro2 or better?

-We use CodeWarrior as our development environment at Netscape for the MacFE. -All of the projects and tools are geared towards the CodeWarrior IDE. In -addition, we make heavy use of PowerPlant and MSL which you can only get -from Metrowerks. - -

While we say you need at least CWPro2, you may be able to get by with -Pro1, but probably not for very long. We haven't tested it, so we don't -recommend it. Get the upgrade. CodeWarrior kicks serious butt! -

-How do I setup my development environment?

-Here's a list of 3rd party software that we compile into the application -and where to get it: - -Here's a list of other build tools that you need to install in order -to build and where to get them: -
    -
  • -MacPerl -5 MPW Tool
  • - -
  • -MakeStub - MPW (installed with CodeWarrior Heaven option). If you choose -not to install MPW, it is located on the MacOS Tools CD in "CW Pro 2 Tools:CodeWarrior -MPW:MPW:Tools"
  • - -
  • -RunTSScript - in Mozilla source distribution (ns:build:mac:RunTSScript), -needs to be installed by hand
  • - -
  • -ToolServer -- or in the CW distribution (CW Pro 2 Tools:Apple Development Tools:ToolServer -3.4.1.sit). We recommend pulling it off the CD because it comes -with configuration files for CodeWarrior which you would have to create -manually were you to pull it off the net.
  • - -
  • -ToolFrontEnd
  • - -
  • -patch -2.1
  • -
-Once you have all the pieces, here are the steps required to put everything -together: -
    -
  1. -Install CodeWarrior from the CD. While it is large, installing the "CodeWarrior -Heaven" option will guarantee that you have everything you need. This will -give you PowerPlant, MSL, and MPW. If you choose to install less, proceed -at your own risk.
  2. - -
  3. -In the Finder, increase the memory partition of the IDE to 15MB (you can -get by with 12, if need be).
  4. - -
  5. -Download ToolFrontEnd. After expanding it, in "ToolFrontEnd Folder:Drop-Ins" -there are three items:
  6. - -
      -
    • -#include
    • - -
    • -ToolFrontEnd
    • - -
    • -ToolFrontEnd Panel
    • -
    -Create a folder named "Include Scanners". Place the file "#include" into -the Include Scanners folder. Move the Include Scanners folder to the CodeWarrior -Plugins folder. Create a folder named "ToolFrontEnd". Place the files "ToolFrontEnd" -and "ToolFrontEnd Panel" into the ToolFrontEnd folder. Place this folder -in the CodeWarrior Plugins folder. - -

    Open "ToolFrontEnd Panel" with ResEdit. Change the file type from 'Panl' -to 'PanL'. Save. -

  7. -Uncompress the StuffIt Archive for ToolServer. Place the ToolServer folder -in the same folder as your CodeWarrior environment (its actual placement -is not important). Create an alias from the Tools folder that lives in -the CodeWarrior MPW distribution and place it in the ToolServer folder. -Now ToolServer and MPW will share the same tool set and you only have to -maintain one tool repository.
  8. - -
  9. -After installing the MacPerl distribution (run the InstallerVISE application), -in the "MacPerl €" folder, there will be an MPW tool named "perl". Install -this in the same location as the rest of the MPW tools for ToolServer.
  10. - -
  11. -Install the "patch" and "MakeStub" MPW Tools in the same location. Note -that "MakeStub" is automatically installed by the "CodeWarrior Heaven" -install option.
  12. - -
  13. -Install RunTSScript (found in the Mozilla source distribution) in the compilers -folder in your build environment
  14. - -
  15. -Next, after downloading all the 3rd party software components, drag WASTE, -CWASTE, Menu Sharing, Mercutio, Internet Config, and the AEGizmo folders -(just as they are) into the "MacOS Support" folder in your build environment.
  16. - -
  17. -Start ToolServer from within CodeWarrior (or use MPW if you are brave enough). -We're about to patch some files. Make sure the ToolServer menu is in the -CodeWarrior menu bar by turning on the preference -under the "Extras" panel in the IDE Preferences (not the project preferences!). -The menu bar should look like this:
  18. - - -

    - -

    Choose "Start ToolServer" from the ToolServer menu (this is the icon -menu between "Window" and "Help" in the menubar above). You will now see -a window with no close box. This is your ToolServer Worksheet where you -will type (or cut & paste) the commands for the following steps. - -

    In case you have never used MPW/ToolServer before, the following is -very important. Pressing "return" does not execute commands like -you might think. It just inserts a newline into the worksheet like a normal -text editor. To actually get ToolServer to execute the command, you -must press "Enter" (lower right of numeric keypad). This executes the -line that the cursor is on, and only that line. If you want to execute -multiple lines at once, select them all and hit Enter. -

  19. -Set the shell variables {IDE} and {Source} to the correct paths for your -build environment. {IDE} is where your CodeWarrior IDE is located. {Source} -is the folder containing the toplevel "ns" folder of the Mozilla source. -Mine look like this (don't forget to keep the quotes if your path includes -spaces), yours will almost certainly be different:
  20. - -
    Set IDE "Develop:Source331 Build Environment:CW Pro 2:Metrowerks CodeWarrior:"
    -Set Source "Source:FreeSource:"
    - -
  21. -If you are using CWPro2, execute the following lines to patch LDropFlag -to draw correcly over non-white backgrounds. You do not have to do this -if you are using Pro3 because it has been fixed.
  22. - -
    directory "{IDE}MacOS Support:PowerPlant:_In Progress:_Table Classes:"
    -patch LDropFlag.cp "{Source}ns:lib:mac:patches:LDropFlag.patch"
    -duplicate -y "{Source}ns:lib:mac:patches:DropFlag Icons.rsrc" "{IDE}MacOS Support:PowerPlant:PowerPlant Resources:"
    - -
  23. -Execute the following lines to patch menusharing.c to allow it to compile -with the new Universal Headers. It references an obsolete header file (GestaltEqu.h).
  24. - -
    directory "{IDE}MacOS Support:Menu Sharing Toolkit 4.1:"
    -patch menusharing.c "{Source}ns:lib:mac:patches:menusharing.patch"
    - -
  25. -If you are using CWPro2 straight off the CD, you need to patch AppleEvents.r -to fix a problem with the Universal Headers (the definition of the 'aedt' -resource was omitted). You do not have to do this if you have applied -the netborne patch to Pro2 or are using Pro3 because it has been fixed.
  26. - -
    directory "{IDE}MacOS Support:Headers:Rez Headers:"
    -patch AppleEvents.r "{Source}ns:lib:mac:patches:AppleEvents.r.patch"
    - -
  27. -You need to patch stat.mac.h to fix a problem in MSL where lines were omitted -(both CWPro2 and Pro3 share this problem)
  28. - -
    directory "{IDE}Metrowerks Standard Library:MSL C:MSL Mac:Public Includes"
    -patch stat.mac.h "{Source}ns:lib:mac:patches:stat.mac.h.patch"
    - -
  29. -If you are using CWPro3, you have to unstuff and copy the old Grayscale -Appearance classes into the PowerPlant hierarchy. As of Pro3, they are -now obsolete and are located with the rest of the obsolete PowerPlant files. -We'll fix this shortly.
  30. -
- -

-Ok, so how do I build?

-There is an AppleScript called BuildList located in ns:cmd:macfe:projects. -This droplet takes, as input, a text file which lists the projects in the -order which they are to be built. This allows us to build different versions -of the product just by dropping a different "script" on BuildList (such -as Debug, Optimized, Navigator stand-alone, or navigator + composer). - -

These scripts are located in ns:cmd:macfe:projects:client and have names -like BuildMozPPCDebugList.txt. This script will build a debug version -of Mozilla (navigator + composer) for PPC. Get it? Good. All you have to -do is drag this script to the BuildList droplet and watch it crunch away. -Now go out to dinner. By the time you get back, you should have an executable -in ns:cmd:macfe:projects:client called, for this particular script, MozillaPPCDebug. -You will see the following build lists in the client folder, but as of -3/31, only BuildMozPPCList.txt and BuildMozPPCDebugList.txt are guaranteed -to work: -

    -
  • -BuildMozPPCList.txt
  • - -
  • -BuildMozPPCDebugList.txt
  • - -
  • -BuildNavPPCDebugList.txt [ might work ]
  • - -
  • -BuildNavPPCList.txt [ might work ]
  • -
-If there were any errors in any of the projects along the way, the script -will stop at that point and the IDE will tell you the errors. You can fix -them and make sure they current project builds, but to continue the automation, -you have to start from the beginning by dropping the script onto BuildList. -This isn't quite as bad as it sounds because the previous projects are -already built (unless you changed some major header file). - -

Don't worry too much about the numerous warnings generated during the -build. We try our best to get the XP teams to use real compilers, but alas, -they continue to write warning-laden code. There is also some generated -code (Java is one example) that has a lot of warnings that we can't help -either. If you write any new code, please help us in our quest to get zero -warnings. -

-How long does it take to build?

-On a G3 with the source and IDE on a RAM disk, it takes about 25 minutes. -On a PowerTowerPro 225 and everything on the hard drive, it takes about -45mins to an hour. On a 9500/132 it takes over 2 1/2 hours. - -

The moral of the story: Don't try this on your 6100/66. -

-What's special about running the debug build?

-Running the optimized (non-debug) version is easy, just double-click it -and it will work. This is because all the shared libraries are compiled -directly into the application. We don't do this with the debug version -to facilitate changing bits in projects other than the main one. This way, -you don't have to relink the entire app (which can take a while) to see -the changes, just the project that was modified. - -

As a result, you have to find a way to get all the shared libraries -from where they are built (scattered throughout the tree) into the same -folder as the app so CFM can find them. Luckily, the BuildList script will -create all these aliases for you and put them in the right places! - -

Another nicety about the debug build is that there is a special "trace" -function which can be used to display messages about the state of the application -as it runs through certain blocks of code. To see these messages (since -the Mac doesn't have stdout or stderr) you need to run an application called -TraceMonitor. << where do we distribute this???!?>> -

-How do I build a 68K version?

-For now, you can't. The projects have not been kept up to date and aren't -even in the tree anymore. If you would like to create them and get all -the exports right with CFM-68K, go right ahead. We will be so happy! -

-Why use IDE_Options.h when all that is in the project file?

-It was originally intended to make sure that all 300 of us at Netscape -are using the same environment and compilation flags. If something gets -turned on/off by accident in the project prefs, it can introduce a subtle -bug that can take days to track down for naught. Having a file that specifies -exactly what flags should be used guarantees that this can't happen. - -

Now that we move to net development, I'm sure you will agree that this -is even more important. -

- -
New 5.0 Features

-We can't present this section until after 3/31/98. Please check back here -after that.  -

- -
Unfinished "Features"

-We can't present this section until after 3/31/98. Please check back here -after that.  -

- -
Pitfalls

-There are a couple of pitfalls that we have to keep straight when it comes -to editing resources. -

-Why do I keep getting messages about unknown custom types in Constructor?

-For starters, make sure you have an alias to the following two files in -your Constructor folder: -
    -
  • -ns:cmd:macfe:rsrc:CrossProduct:Mozilla_Custom_CPPbs
  • - -
  • -ns:cmd:macfe:rsrc:Communicator:MailNewsCppbs.cnst
  • -
-You may have to explicitly open these files up while running Constructor -to be able to see the new types, especially for the ones in MailNewsCppbs.cnst. -Not sure why yet. - -

For editing other kinds of resources, we have a TMPL file for ResEdit/Resourcerer. -Place these in the appropriate location for your resource editor -

    -
  • -ns:cmd:macfe:rsrc:CrossProduct:Mozilla_Custom_TMPLs
  • - -
  • -ns:cmd:macfe:rsrc:CrossProduct:Other_Comm_TMPLS.rsrc
  • -
- -

-Why don't my toolbar buttons work anymore in the browser window?

-Because of the way we have the toolbars as CIncludeViews (which work in -a similar way to #include in C/C++), the RidL will be messed up if you -edit the main browser window PPob. Constructor regenerates this list based -on all the controls that are in the view when you save, but because we -use CIncludeView, the toolbar buttons aren't actually in the view so the -RidL is empty. They will still show up when you build, but they won't do -anything because they are not registered with the browser window. Until -we fix this, just use Resourcer to replace the incorrectly generated one -with an old version. The old version is about 58 bytes long and the new -one is about 10 so you should be able to easily tell which is which. -

-Why are there so many damn resources?

-As you may have noticed, we've got too many damn resources. Most of them -are 'STR ' resources which are generated at build time and contain all -of our cross-platfrom strings. We would like to generate these resources -more intelligently (into 1/10 the number of 'STR#' resources maybe) but -ran out of time before the source had to go out. Before you rush out and -change it for us, stop! There are some constraints on the final -solution, mostly to do with i18n and l10n being able to leverage existing -work on older product to do new products. If you want to help us out with -this, please send us some email and we can have out i18n team talk with -you to make sure it gets done correctly! -

-Why doesn't it work better with Internet Config?

-For starters, the main reason why we never drank the IC kool-aid was that -there was no support for multiple profiles. Being one of the main features -which our competition did not have, we thought this was pretty important. -There are rumblings in the IC world that IC 2.0 will support multiple profiles. -Great! That still leaves us with the second reason: there are many, many, -many preferences that we use that are not reflected in IC. As a result, -we already have to maintain prefs for those that are not covered by IC -so we can't be totally IC dependent. - -

Of course, now that the source is free, maybe we can drive the direction -of IC to include all of our wacky networking prefs. -

-Where are all my old 4.0X bookmarks and prefs?

-In the process of getting the source ready for distribution, we removed -all mentions of "Netscape" from the product. As you may know, the 4.0X -preferences are stored in a folder called "Netscape Users." Well, that -folder is now called "Navigator Users" and the preference file is now called -"Navigator Preferences" instead of "Netscape Preferences." - -

It's probably best not to use any of your old prefs at this point since -some of them rely on security calls that are no longer in the free source -product. After you create a new profile (and you will have to when you -start the free source), copy your bookmarks.html file from your old profile -into the new user profile folder and replace the empty one that's already -there (if there is one). - -

For your old bookmarks to be seen, you must throw away the "NavCntr" -folder created in your new profile folder. After you do that bookmarks -will be imported into Aurora automagically. Note that changes that you -make to your bookmarks in 5.0 will not (as of today) be written back to -the Bookmarks.html file, but instead are stored in a database within the -"NavCntr" folder. If anything gets corrupted in the NavCenter, you can -always throw this folder into the trash and your original bookmarks will -be reimported. - -

Also note that these new bookmarks and preferences are totally separate -from your 4.0X prefs. -

- -
History and Future

- -

-History

-Excuse me while I ramble... -
    -
  • -Built using Metrowerks PowerPlant, the client has been PPC native from -day one. 68K support was dropped in 5.0 due to the high cost of maintenance. -Any takers?
  • - -
  • -Mail/News was added in 2.0 and Composer was added in 3.0 (called Navigator -Gold). Both were dramatically improved with 4.0.
  • - -
  • -Java came to the Mac in 3.0, even though Windoze and unix had it in 2.0.
  • - -
  • -Multi-byte language support for inline edit fields added in 4.0
  • - -
  • -The preferences used to be STR# resources. Now they are done in javascript.
  • - -
  • -Because of the sheer number of resources (and the "theoretical limit" on -the number of resources in a file imposed by the Resource manager -- which -we still exceed on a daily basis), a number of strings and icons were moved -out of the main application and into a file called "Netscape Resources" -in 4.0
  • - -
  • -For plain-text email/form composition, we used VText up through 4.0. For -5.0, we switched to WASTE because of its minimal impact on the PowerPlant -hierarchy. VText caused us fits every time we wanted to upgrade to a newer -version of PowerPlant because it wrapped its tentacles around every limb -of PowerPlant.
  • - -
  • -4.0 included a new memory management scheme which drastically reduced the -amount of memory used by the client. This is why the memory partition of -4.0 is about half of 3.0.
  • - -
  • -A version of Navigator sans Mail/News/Composer debuted with 4.03, and again -two days later with 4.03.1.
  • -
- -

-Future

-There is certainly a lot to do. In order to not duplicate too much work -(since we are still working on this full time here at Netscape), I've put -together a list of what we plan on doing and what we want to do but probably -won't get around to because of time constraints. - -

Things that we are going to focus on: -

    -
  • -More NavCenter work
  • - -
  • -Solve the issues with too many 'STR ' resources (see note on issues -page)
  • - -
  • -Modularization (HTML display isolated from networking, etc)
  • - -
  • -use new Appearance Manager classes in PowerPlant
  • - -
  • -Navigation Services (new open/save dialogs in Allegro) support. We have -an ancient SDK and have integrated it in a few places, but the current -implemenation that we have doesn't work very well. It's cool, though.
  • - -
  • -More drag and drop in composer.
  • - -
  • -More support for Internet Config (see note on issues -page).
  • - -
  • -external Java VM support (MRJ, etc)
  • -
-Things we would like some help on: -
    -
  • -printing support
  • - -
  • -68K version
  • - -
  • -Context Menu Manager support
  • - -
  • -bug fixes of any kind
  • - -
  • -performance tuning of any kind
  • - -
  • -getting around the limitation of 255 hierarchical menus imposed by the -OS. This would let us do a "real" personal toolbar with folders that have -popup menus.
  • - -
  • -Fixing the build system so it uses makefiles without having to give up -the CW IDE for source browsing/editing.
  • - -
  • -better publishing in Composer
  • - -
  • -add NavCenter to Composer window
  • - -
  • -better table editing in Composer
  • -
- -
- -
Mike Pinkerton (pinkerton@netscape.com)
- -
-
-
Copyright © 1998 Netscape -Communications Corporation
- - - diff --git a/README/mozilla/unixbuild.htm b/README/mozilla/unixbuild.htm deleted file mode 100644 index 68089d5471c..00000000000 --- a/README/mozilla/unixbuild.htm +++ /dev/null @@ -1,82 +0,0 @@ - - -Unix Build Instructions - - - -

-Unix Build Instructions

-This document explains how to build Mozilla for Unix. -
-
-
Requirements:
-
-  Memory:
-    32MB of RAM, 128MB of swap, recommended 64MB of RAM.
-
-  Tools:
-    GNU C/C++ compiler 2.7.2 or better
-    GNU make 3.74 or better
-    Motif 1.2 (Lesstif has been used with limited success)
-
-  Tools that will be helpful later:
-    Perl 5.0
-    CVS 1.8.1
-    RCS
-    gdb 4.16
-
-  NOTE:
-    * gcc version 2.8 has been used successfully.
-      Your mileage may vary.
-
-Build:
-
-  Untar the tar.gz file with the following (or your favorite variant thereof):
-
-    gzip -dc tarball.tar.gz | tar -xvf -
-
-  Set the following environment variables:
-    csh/tcsh: 
-      setenv NO_SECURITY 1
-      setenv MOZ_MEDIUM 1
-      setenv MOZILLA_CLIENT 1
-      setenv NO_MDUPDATE 1
-
-    sh/bash/ksh:
-      NO_SECURITY=1
-      MOZ_MEDIUM=1
-      MOZILLA_CLIENT=1
-      NO_MDUPDATE=1
-      export NO_SECURITY MOZ_MEDIUM MOZILLA_CLIENT NO_MDUPDATE
-
-  Debug build is default; optimized build:
-      setenv BUILD_OPT 1
-      (BUILD_OPT=1; export BUILD_OPT)
-
-  On AIX, append /usr/lpp/xlC/bin to your PATH.
-  On Solaris, SINIX, and UnixWare, prepend /usr/ccs/bin to your PATH.
-
-  Build it.  Default target is "export libs install":
-    cd ns
-    gmake -k
-
-NOTE:
-
-If you haven't got perl:
-
-setenv PERL /bin/echo
-
-gmake -ek
-
-Run the app:
-  Executable lives in ns/cmd/xfe/{ARCHITECTURE}.{DBG|OPT}.OBJ
-    (e.g. ns/cmd/xfe/Linux2.0.31_x86_DBG.OBJ/mozilla-export)
-  Statically-linked app is "mozilla-export"
-  dynamically-linked app is "moz-export"
- -
-
Copyright © 1998 Netscape -Communications Corporation
- - - diff --git a/README/mozilla/winbuild.htm b/README/mozilla/winbuild.htm deleted file mode 100644 index ee00b99331e..00000000000 --- a/README/mozilla/winbuild.htm +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - WinFE Build Instructions - - - -

-WinFE Build Instructions

-This document explains how to build Mozilla for the Windows platform. WinFE -is the Windows front end module.  -
Required Tools: -
    -
  • -Microsoft Visual C++ version 4.2 or later
  • - -
  • -GNU Tools for Windows:You can find these all over the web. Specifically, -you'll need:
  • - -
                    cp.exe
    -
    -                rm.exe
    - - -Netscape has internally modified version of gmake, shmsdos and win32gnu -that we use to get around some problems we were having keeping in sync -with the Unix version of gmake. This version of gmake and it's source is -included in the Mozilla source distribution. The specific files pertaining -to this are: -
                    gmake.exe
    -
    -                shmsdos.exe
    -
    -                uname.exe
    -These are located in the \tools\bin directory of the source package. All -of these tools need to be put in your path. -
  • -Additionally, there are Netscape-developed tools that need to be built -prior to your first compile. These are covered in the build section.
  • -
-Setting up: -
    -
  • -You need a Pentium with at least a 133 MHz processor and at least 250 megs -(NTFS partition) or 500 megs (FAT partition) of hard drive space. You need -to have a minimum of 64 megs of memory in order to build this tree. Having -at least 128 megs of memory will make your debugging experience noticeably -less agonizing
  • - -
  • -The preferred platform is NT 4.0. NT 3.51 will also work, and Win95 might -work if you're lucky. Maybe.
  • - -
  • -Install MSVC. If you don't choose to have the MSVC install modify your -environment variables for PATH, INCLUDE, and LIB information, be sure to -run VCVARS32.BAT out of the MSVC bin directory prior to attempting to build.
  • - -
  • -Download and install GNU tools. Put them in your path.
  • - -
  • -Install Mozilla source.
  • - -
  • -There are several environment variables you will need to set, either manually -or via a script within a command session, or by setting them in your system -environment located through the Control Panel | System icon. Those variables -are:
  • - -
      -
    • -set MOZ_BITS=32
    • - -
    • -set MOZ_DEBUG=1 (don't set this if you want to build an optimized release -build)
    • - -
    • -set MOZ_GOLD=1
    • - -
    • -set MOZ_MEDIUM=1
    • - -
    • -set MOZ_NT=351 (if running NT 3.51, don't set otherwise)
    • - -
    • -set MOZ_OUT=(location of resulting executable and totally optional, see -Notes for more details)
    • - -
    • -set MOZ_SRC=(top of your tree, drive letter and path, i.e. set MOZ_SRC=d:\mozilla_src. -The topmost directory under this should be ns)
    • - -
    • -set MOZ_TOOLS=(location of the bin directory containing your GNU tools. -The build looks for MOZ_TOOLS\bin\gmake.exe, so make sure your MOZ_TOOLS -is figured appropriately)
    • - -
    • -set NO_SECURITY=1
    • - -
    • -set NSPR20=1
    • - -
    • -if you are running VC++ 5.0 or higher: set _MSC_VER=1100
    • -
    -
-Building: -
    -
  • -You need to be running a vanilla command prompt. Other shells may work, -but you might have to tweak makefiles.
  • - -
  • -Build the tools: This generates several tools that handle things -like dependency generation
  • - -
      -
    • -cd ns\config
    • - -
    • -nmake /f makefile.win
    • -
    - -
  • -Build the whole lizard: This will do a complete build of the source -tree. You will end up with a mozilla.exe at the end.
  • - -
      -
    • -cd ns
    • - -
    • -nmake /f client.mak
    • -
    -
-  -
    -
  • -If you want to build communicator a piece at a time, these are the steps -that client.mak steps through. If you successfully ran the client.mak step -above, you don't need to do this.
  • - -
  • -Build the back end: This builds cross platform components like NSPR -and the shared library modules. All of the interesting output from this -part of the build will end up in ns\dist, under public\ if it's a library -header, and under WIN32_D.OBJ\ (or WIN32_O.OBJ\ for an optimized build) -if it's a dynamic or static library. The exception is the NSPR public headers, -which live in WIN32_D.OBJ\include.
  • - -
      -
    • -cd ns
    • - -
    • -nmake /f makefile.win
    • -
    - -
  • -Build the front end: This builds and links into the final executable, -mozilla.exe.
  • - -
      -
    • -cd ns\cmd\winfe\mkfiles32
    • - -
    • -nmake /f mozilla.mak DEPEND=1
    • - -
    • -nmake /f mozilla.mak
    • -
    -
-Notes: -
    -
  • -MOZ_OUT: If you don't set this, mozilla.exe will be generated into ns\cmd\winfe\mkfiles32\x86dbg -(or x86rel for optimized builds)
  • - -
  • -This build process does not use Visual C++ generated project files for -several reasons having to do with (among other things) size, maintainability, -and the long term desire to start using more of tools like gmake, or plug -and play developer tools. This does not preclude you from using the Visual -C++ IDE, or it's debugger (somebody fill this out with more detail).
  • - -
  • -All of the DLLs that you need to run mozilla.exe get copied automagically -into your output directory as the last part of build, so all you need to -do is cd into x86dbg and run mozilla.exe to get a runnable browser.
  • - -
  • -On a Pentium II 266 MHz machine with 128 megs of memory, it takes approximately -30 minutes to build. Your mileage may vary.
  • -
- -
-
Copyright © 1998 Netscape -Communications Corporation
-  - - diff --git a/README/mozilla/wininstall.htm b/README/mozilla/wininstall.htm deleted file mode 100644 index ad0da276972..00000000000 --- a/README/mozilla/wininstall.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Running Mozilla... - - - -

-Running Mozilla Without Trashing Netscape -Installation

-This document explains how to run mozilla.exe separately from -netscape.exe without trashing your regular installation of Netscape -Communicator. This is necessary if, for example, you want to use Communicator's -mail client while you work on Mozilla development. -
-
-
    -
  1. -Before running mozilla.exe, create a new user profile either from -a Netscape 4.0x installation using the "User Profile Manager" shortcut -in the Utilities folder (on Windows) or by using  the -new_account -option on the command line of either netscape.exe or mozilla.exe.  -We suggest calling the profile "mozilla."
  2. - -
  3. -Always use that new account when running mozilla.exe, and never -run netscape.exe using that same account profile.
  4. -
-To make things easier, you can start the application with the user account -on the command line, for example: -
    mozilla.exe -P"mozilla"
-This assures that prefs and the cache will not interfere between the two -versions. This will be especially -
important as new prefs are added to the Mozilla product. Note that -you must use quotes around the name and there can be no space between the -"P" and the profile name. Otherwise, the application won't catch the profile -switch, and it will try to load the profile name as the initial URL. - -

-


-
You can copy your bookmark.htm file from an existing profile -to your new profile directory if you want to share bookmarks. - -

After the initial 3/31 release, we will add some code to Mozilla to -prevent running with a profile that is already being used by netscape.exe. -
  -


-
Copyright © 1998 Netscape -Communications Corporation - - diff --git a/README/raptor/winbuild.html b/README/raptor/winbuild.html deleted file mode 100644 index c64fa002a71..00000000000 --- a/README/raptor/winbuild.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - Raptor Windows Build Instructions - - - -

-Raptor Windows Build Instructions

-This document explains how to build Raptor for the Windows platform. -
Required Tools: -
    -
  • -Microsoft Visual C++ version 4.2 or later
  • - -
  • -The same set of tools for building Mozilla
  • -
-Setting up: -
    -
  • -You need a Pentium with at least a 133 MHz processor and at least 250 megs -(NTFS partition) or 500 megs (FAT partition) of hard drive space. You need -to have a minimum of 64 megs of memory in order to build this tree. These -numbers are approximations.
  • - -
  • -The preferred platform is NT 4.0. NT 3.51 will also work, and Win95 might -work if you're lucky. Maybe.
  • - -
  • -Install MSVC. If you don't choose to have the MSVC install modify your -environment variables for PATH, INCLUDE, and LIB information, be sure to -run VCVARS32.BAT out of the MSVC bin directory prior to attempting to build.
  • - -
  • -Download and install GNU tools. Put them in your path.
  • - -
  • -Install Raptor source.
  • - -
      -
    • -cd <your-source-area>
    • - -
    • -unzip -o -q win-19980415.zip
    • -
    - -
  • -There are several environment variables you will need to set, either manually -or via a script within a command session, or by setting them in your system -environment located through the Control Panel | System icon.

    -Note: There is an additional variable for building Raptor! -Use this list carefully!

    -The variables are:

  • - -
      -
    • -set MOZ_BITS=32
    • - -
    • -set MOZ_DEBUG=1 (don't set this if you want to build an optimized release -build)
    • - -
    • -set MOZ_GOLD=1
    • - -
    • -set MOZ_MEDIUM=1
    • - -
    • -set MOZ_NT=351 (if running NT 3.51, don't set otherwise)
    • - -
    • -set MOZ_OUT=(location of resulting executable and totally optional, see -Notes for more details)
    • - -
    • -set MOZ_SRC=(top of your tree, drive letter and path, i.e. set MOZ_SRC=d:\mozilla_src. -The topmost directory under this should be ns)
    • - -
    • -set MOZ_TOOLS=(location of the bin directory containing your GNU tools. -The build looks for MOZ_TOOLS\bin\gmake.exe, so make sure your MOZ_TOOLS -is figured appropriately)
    • - -
    • -set NO_SECURITY=1
    • - -
    • -set NSPR20=1
    • - -
    • -if you are running VC++ 5.0 or higher: set _MSC_VER=1100; if you are running -VC++ 4.2 then set MOZ_VCVER=42
    • - -
    • -set STANDALONE_IMAGE_LIB=1
    • - -
    -
-Building: -
    -
  • -You need to be running a vanilla command prompt. Other shells may work, -but you might have to tweak makefiles.
  • - -
  • -Build the tools: This generates several tools that handle things -like dependency generation
  • - -
      -
    • -cd ns\config
    • - -
    • -nmake /f makefile.win
    • -
    - -
  • -Build the Raptor: This will do a complete build of the source tree. -You will end up with a viewer.exe at the end. The viewer.exe will be in -your dist\win32_[OD].obj\bin directory (O will be used when you don't set -MOZ_DEBUG; D will be used when you set MOZ_DEBUG).
  • - -
      -
    • -cd ns
    • - -
    • -nmake /f raptor.mak
    • -
    -
-Running: -
    -
  • -Once you have built the system, do this to run the viewer program (the -viewer program is a simple test program that uses the nsIWebWidget API -to embed a web widget object). The viewer program has a few basic menu -items, include "Samples" which load sample tests.
  • - -
      -
    • -cd ns\dist\win32_[OD].obj\bin
    • - -
    • -.\viewer.exe
    • -
    -
-Notes: -
    -
  • -This build process does not use Visual C++ generated project files for -several reasons having to do with (among other things) size, maintainability, -and the long term desire to start using more of tools like gmake, or plug -and play developer tools. This does not preclude you from using the Visual -C++ IDE, or it's debugger. Once you have built a viewer.exe do this to -run it under the debugger:
  • -
- -
    -
      -
    • -cd ns\dist\win32_[OD].obj\bin
    • - -
    • -msdev viewer.exe
    • -
    -
- -
-
Copyright © 1998 Netscape -Communications Corporation
-  - - diff --git a/buildtools/windows/bin/README b/buildtools/windows/bin/README deleted file mode 100644 index 3e8ebd4c215..00000000000 --- a/buildtools/windows/bin/README +++ /dev/null @@ -1,26 +0,0 @@ -Building NSPR on Windows NT Using Netscape's gmake and Other Tools - -This directory contains the following tools: -- gmake.exe: GNU make 3.74, modified to use shmsdos.exe as the shell -- shmsdos.exe: a lightweight shell developed by Netscape programmers. - It has most of the file manipulation operations (such as cp, - rm, mkdir as well as Netscape's own nsinstall) as built-in - commands, so even if you have these - file utilities installed on your NT machine, they won't be invoked - by gmake and shmsdos. Also, since shmsdos is not a full-blown - shell and its built-in file commands are not fully compatible - with the true Unix file utilities, our makefiles have had to - avoid some features of sh and work around the incompatibilities - on Windows NT. -- uname.exe: this uname.exe returns the OS as "WINNT", which is what - our makefiles assume. Do not use a uname.exe that returns other - strings, such as "Windows_NT". - -Binaries for the x86 processors can be found in the 'x86' subdirectory. -Binaries for the alpha processors can be found in the 'alpha' -subdirectory. - -INSTALLATION: - -Install gmake.exe, shmsdos.exe, and uname.exe in any directory. -Add that directory to your Path environment variable. \ No newline at end of file diff --git a/buildtools/windows/bin/alpha/gmake.exe b/buildtools/windows/bin/alpha/gmake.exe deleted file mode 100755 index 732c20d440ddb40bb0c59103ef9f8438459f8075..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 256512 zcmeFaeSB2qnfQI3%p{q-PeLTovT$Zd!dnOlMWwBpGn1LjB%lOKE4BV0qHIx6g4&ku zb|tf3J2e$_W`$u&2c9XBlh+6`A;XI^#X_17=I$y~J9yy5HDo7Y@#hUR?Hyl(l`i|dMt z@~hHaw}nM+H*#cWW%%68X#G-b6d3Muc`-}ma>KcOY#&!sKPt3V>NAfOZvB_Jip{6= z7i}rxb^befO@DQs>Hpj^@x*67^t+_(>=8Fiw=6q<#P`4Pqh+|IG6nh>->AE3@yeTc zvi^A{Ve&!edSVi(SGe6?cf-|J-gG5&Dbah(i0Q~Hv>ox!0wHy&W>UY62PWMa2CaOwE7cD;2sEMB(!Dv`r0cn+@Q z2CggrtX+`1|Np=L3o+1}{Ox#=i?(@W!8Whlysc7xvdxtL*fvpqyRBZ1Z<{F#p3HL} zj{Hnyw^!P1@4DYb@*nSyY!hp!$eoO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@2bN_*A4o4wlJ{a$15VXwRQwAb4k?v3`I_a=MOz1g1HOL|wm zTJO4-^0Hpe>+%X-(JOhA-jw&moAF+Fv)(Ij-h1sWdQ0B2_r_cE-g+C}hXs%JynXKo zTsrnny|V?MuI_90*TJduKDX~$@T#;g@29}6>HUlS?1Epf_m%w;IJUB1+rQnf??3Ff z_B;E_JiW}(%ly2|&6JP!F+P`%_j!GiPxd8zCqCRI@5}lweL3H?Pw^FeWnaZt_1*gF zzI$KG*YS0Iec!-0^o@NlzKQSEM;xdRGzV)3+AkS?ncd}s#6j{PeQ83!S530=BUg(P1LQ^dD#8OKvb%eCg5KH}#U1*0ns};WJhNWg`E%ZWvp%umpo$$KQ2upoH zFSG%_&;?6Pu+#%fEih-b;uj6D%>T>Wzs&o~oKGzB{n{eeGYeJfg(4Lftd?4^+Qov^ z@(WfgEm*C#V6}$@tMwMF_Pk)V+4h{(Ru`;BEm+O9U^QvMY9|X;%Pv^$dckVt1*_dI zSgo~Swf=(D#tT+^Mb2N{)ht+zUa%U!U^RKcYUu^5T`pKnS+H7V!D{s{d48GWm-&5} z+n0HLnbVi~e3{GtcOJjwa|>20ELg3&V72=Nt92KwHe9gUWS)`T>IJK57p%rESWN({ z0ncxL-YoEDfj0}hS>VkAZx(p7z?%i$EbwN5Hw(O3;LQSW7I?G3n+4u1@MeKG3%pt2 z%>r*0c(cHp1>P+1W`Q>gyjkGQ0&f<0v%s4L-YoEDfj0}hS>VkAZx(p7z?%i$EbwN5 sHw(O3;LQSW7I?G3n+4u1@MeKG3%pt2%>r*0c(cHp1>P+1|FFRS0`0yo^#A|> diff --git a/buildtools/windows/bin/alpha/nsinstall.exe b/buildtools/windows/bin/alpha/nsinstall.exe deleted file mode 100755 index 77145fd1e29f5edc7d84e2a4ca2846c2c6a09694..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77312 zcmeFadwf*owKu-@o;@==H`qxg7l;S;OfG=NkU&%vOZMC+6WUG?O^#49+*Ar}6G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+EEb!!`uaH7mQu7b-~mHOBW1Xuyeu81uGYfT(B`VXX1i|3kJ^ES9R1K$Bu@h>1a95 z9397nqwBbIj2vUf)N$=V=oMN?t7w!aXp*LBhGuDj4%1OOPABLjouRXIj^3w>bcwFe zRa&Hv=>~m5x9BsvO<&Mmx<`-bF)h>AG~!%#DxE5)+DSM`r^U%QStsWVJEP7$XTq6u zrkq)4&Y5=>oJD8JS$0;PqO;~~I8U6C^UT?Ho;$nFp0n>9J7wnt__pj)xKzM74Y1DQ zqJViEa4!nnivjmiz`h)?uK?^T1OG(eUmf@-0R!8vb64la;}+hw@U(@OS=^MHc5`mt zEx7mGF?ZaZa;M!Hcivra@4L(H19!z;bJyL+Zpqzrx7_FMj{CyhcVD_k?umQqzIH2^ z6-LQu7?dFxilG_ihU*KSFF3y7_k!CCUN1Pk;PWLjV#dsrxdu+Jc$6NM2lWsh(nEU~ z59<*;VNcW(_arJ**)n^;R@fRl^YfXHx7c&G!(Om`_L3d36L!j8vx>Vbca?WFbKjr&|Lwn91a1+y wMc@{JTLf+qxJBR=fm;M_5x7O*7J*v?ZV|Xe;1+>f1a1+yMc@{J|1ARl1%k(THvj+t diff --git a/buildtools/windows/bin/alpha/uname.exe b/buildtools/windows/bin/alpha/uname.exe deleted file mode 100755 index 6511a154c9c848b6e47a02ed014a4937a900929b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 75264 zcmeFadwf*Yxj+2unLU}E5Xeq4xj?AdGr0g7Ljs8ev9M=nGBcT2I{{SAfdhk}g3>kt zq_$d_Al_QrhKrZ}Jg@9b!o}12{w4_!diiNk6zt`Eu-M{colj0FD%i-@yPYJNW51>6?isQT^2trD~}anmd@G z*K_}UvBF`%zn$cm598U2@od%P_ll(O7k6GneT7N#ps$p)exyZ+D$4d!gU_T*GpGK@o{|=wwRp00d=(MGQ&A6`P=@FORvS)-Lz%G0vfMV-+#6fox9Ub zg{3v5x>gE$^!cu%z85)7N7{6JF9hDXziaRvJk-W{A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qe)1P~}un1u9Z?)lf~fs@BxH+E5?WrrK6*wWIdcfjU$t iD$S>#*AIao0zU+P2>cNEA@D=shrkbk9|HgP1pW)zynitO diff --git a/buildtools/windows/bin/x86/gmake.exe b/buildtools/windows/bin/x86/gmake.exe deleted file mode 100755 index bd1f70bcb3df5fddd561c49ad8c7c6eb68f0f1b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 152064 zcmeFadw5jU)jxhFbCOJw2{XWe0|bqj+GxVffF>l-3CScN1SZ5xyb!!p>@@X)cn*d_ zFmN);$#$%5ZEO4WZB5a>d|TVszOQ{7Tg5;y0i_iwwNbF5()OeSZ7dX`M(6igYoE!* zOK;EbpWpNR@;sS2voC9}z4qE`uf5jV`_x|hpyE^%Ma6$2p(tJWroRAx{{4?OWKTHn z=M$8tGJbh}mt*-a&%Y}2g}ZXst-s^*>uiYzI_u_lZUjPJ|Ba0~~?nlNT z@~_7C;g6N;p7RA+@TPR+qwk6f--Y-d^A}K*?m6q%-g?L96y<0RGC%|6TzoJ1Sh>Yx zs{Q|u{~x4)al&06ZY(-dvN|uP!PEX0I7VERms@hJ*Ax8>e)Lu4c~jA^W}o$wZ*X3o zS(WD(>s=;l7<<*?b3N@pM1g00_z)j9XEs{fGaZVt*CmFc32jd4*}F>H?n$iH7j_Xh z##Vk<`p(@G+e%jJZez$XqkHMu{?d0g{3Y70`D)_3#fMKP@K@0N*B_sKIktIzLZJN; zG^kHEo_C4mc|HRPDGha2J+J{LK*1&Y3VMwmH53+Sty>An<#{=Ys=QoenN`z<+pbVF zXY6iA+vSQUdM%(QVQMq+rAXTonGKBdC<+YTmL8&0RKIbCm@&wX8t@tY=rZF;t*s z8$+|T3C2)B^919EjTark_^*r?)nI&|@nT9azUNGjLoXK}*u-c~Cvrr}1}l`<#zbR- z)r;1Rz20cIKBYN5vHn(K_c z?w$h&4q))bX7sVfE!Md}A#KSoXqZZ7y5}ucws<|e(wbc%YeNQ)Xnc}q*90*|nX_0a z>b^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%Ko@EEOvlkDDjnD?TK?04d`q@M}xDS{jdU` zixu)y(C7XJN$VqdpL_^<#_#f(khS|_jRi5yL+W9TxYz#$><)d6A;v$U zt#k;S6SzDuJWv+6F>qVp0Z8DR0%gIsf^E%Ia|rQ@B{AG0+{%RMLRax(aS*t}1hHIv z1ikZ}*cLQrl++DYoQE;H-;&!ws~8Py%sNP7CzOjoLyEv3mOrw@cd%?zA5( z@etPHQSF#^T;udMdV4)i@1%FtyFs2AtruV>m+Iw^VbHdY#Sq}PRjLt?cXu_WuKN=SW z5&|ZAs}PjzC0IL#g7?=3ZwM|7J{$R z24hrJgRue@nsfXWu*%MW)P2~0mGLHI*{_Z74HLGbYXTDkGeK(?1r`UEpq}l5ozQcG zgX@B?fQB6mwt-wCLi2pq+-&~E>TEq`aob~uzW~8ta69JKhe!`LN}p@fB-x)_G9e}g2L=HDMC7WK3m8U@}Vt{7OI6>p+T4; zG(l&MmKmwF>p>?r3tNP(!Zx&fCtAK+*n`#|5DtNI92Nd6nM43J(aP?iEn z&!t#1)#$7Lt_8KZACJR2-Uin3u2MIt2j+KcuAeRqL?7o!`O*ldr%R=B^mZ+z^C{@_ zndtR7(meG1B3Rd#p#N841lGWQvL3W~v$O?cu??fKQ`&_Q*(2?5CBu_-g+{0=#;6DO zAmU-MOOgeQmWJ_4!EVGrXx=$;K1Oad#;#Z{#rRcYccKBK*o1MMEziMNE|3?&HnBur zjxk*=ufe#sH@X_Ukz{B_x{(7;Tx!%BO~xE!k+IxZV{9Qs`V!EZ&H8rO$B-!xUkBW5D_;uc%_^nTU+Zu1cMWo88F! z{7+iFUfuv%%%0QR<(-(d~-DH5!I0M8_X$YlQ|QXOfDss{boIleS2RVIBHiPs{QBnXAk_@1OJU4 F_&+CNkgfm# diff --git a/buildtools/windows/bin/x86/nsinstall.exe b/buildtools/windows/bin/x86/nsinstall.exe deleted file mode 100755 index 11a32d128152c07172a70f213e0c1878cb533a0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV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7-q*{E2qrX13jIf7t$Q`@h+D+kb6;&VI=Ls{NGxL;Gp_Mf){7m@&~$Tq2lm zF{P#Dr*(p#H`1O?Kbbz1KGi(K+-crvei1(j@FBh$bJ-l9adXCP8I}x3MnlHd41dPE z8LKRtEFQ~F%bS+`%;lL?nJ;C&p84m@zh(w9&u3oERA(h-8MCso?#Wt})s*GU`cBpl zvwoiS+pH5=?`ECLx}24mU6NgseKh->?D07XIXCCro^yB3_MC6!1aju&CRi<2zxCVJ zJ=R}ZpR*pbPS0DIw1;JMw>=|Fism&p(|1xBO_k&OX&{w9i5BF13HvzS-Vl_t@L)9rnHUU)lfDe!$*q z57_a=E;wni20;{U(wbCh`m{UJ7N%9D)unBPWWJrYKdnD)Qo13%Dt%}A%jtvZ=h9W? zapt?s#pab}ulf7t=gddUr_ATfYb`FzOO`)c{Ls}WGmmHfDf5HOTe7~AH8abUm6>JF znwPaCYk5{$YrT_RMTcc6s&+$l`(Q_U!H1JG1v?pU%FRy*j5gXK&5~=u2*{ z+B(5{w{?-V+1hUXqctP%$NA5pr{Bvzo&QDtn~c!!t^ES<>{-^*QYn6H>ZC+-IM;U z^j+!Cr2oa7o3S|K@r*9?bRc7aWw~XGrF z*$0r;lw>-aHk{Uyu_I$=#@UQdGlny+WN;SVqOoW#dP{;O$&zd_Sd5kw%S?;Ol3~fV z^6|$$CqZMSv}6fu^-tIxO2QJD_n-Saw<7$$1~+>r;#^ z9^)zjW6GF26XPlmW2z)~S?fEMWVPt&K*xH@9HxC4Q6q=vOK>Ewi|5pk8Uv>7| AF8}}l diff --git a/buildtools/windows/bin/x86/shmsdos.exe b/buildtools/windows/bin/x86/shmsdos.exe deleted file mode 100755 index a44667648cc9c043806021b651385733554f922e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58368 zcmeFaeS8zgwKu+!R`%M+NPr9iOb|q*4mQMzAhD561lYzTKx7=-G#E%*N)?y9)a(Ln z49HnIvAod@ZF75jpXRwwT+&|d?OS@A+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FejlC$oCH_t9WbSS@n@5=^nx~?bh0XQmh2~$F|73pGe8N1~ z@_Y1DvejiRvX)qXY29YsVcl)rW8G`@*zUC556Qn_J8rwee!cx>`wV-?KHvVH{R_K8 z8Y?BFd!?09N4c9k2zGm;d{90vCmaoqC5~l|#~qs;Z=s*v=eWvQ=v17Oook)-%ImO- zm%E0culj(?s)H)2W7OLqtp)1C>J#c1XxBk^U(YZP4Gd@vX0-5@@Qz>-2Z>HGDn2i+ zvfyH~zCL0VWP$C_=auq=0-?N}or$BB%@-Gni^QekGI2RHY^AtbTm!kR6W5Cy#Z6)} z+Td375!pp-CaGE4 zB5jqnNjs$7(jIBAv|lR diff --git a/buildtools/windows/bin/x86/uname.exe b/buildtools/windows/bin/x86/uname.exe deleted file mode 100755 index 5788c84b195b21e3c9b8622dd5225f5030790806..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28160 zcmeHweOz3{x&JJCfDKu)n*@shZB zKv|A^jjet6*DJ=}Mr&JtSKG$72-yUpjhd*nG1}W`tsc6GNg560b${Py&Mqu!{q^3@ zy?@-#b>p0w^UO2PJoC&mGtWFT2N&PIgXtM#0zxpz*lxu1bMfa_KRn2ubk%c{*fSGe zy?VE7Qre@J{N1dfrYO-u-vJ~H1Y1!CZTQ@g8KF%5< z?Ji-gOc%|*b>EE4aBaufB;7=vkibd-$m{UZ`Ch zk;+kF9*;%@Wb6^fQh4I;Je~r7qs0FX&X<7SdW5kjzXToz%@ymmh#;gh9+>AKl=Yl}yYG`cPb;xKzNI+PE5b<*{);D*9hS*4TJ%SK} za0f!f&qa8xb&bvI7;{G>12W)v^$|!&x)_@`9`g0u|1=3G#a2Vdand}wPpI~lS%q@9 zI*3-t`wX6TtH7kVfnuxBhDS8(LCPmuqdWUdojZV&zgF7Z(54>Y=t8}%#l_U;F(~DI zLPL|<9|?Xe1a4KIhy?pW;7#gxBEg$N;Eif~BzScQ+!D~aOI3^ts;Q?m2!6U+g2AA@ zZ&k-WYK#A1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%K5zWRp+0bC!IemxKxl?_^rab3&FTcDH)ih3{C>_)avsb1RnD(-Ud$QDc`fJ7 zoOg4M<@_z@VopMCI{5ylyzk^an)hVhuk-rz-pf0acgS(UF&+K3DF2E4XY&7)Ka}6? z{6Efv&X1fU&g%=(3g#Ci75=DjXW^;BbHqQ^Dl~z`+2+}{+YD(*X}M{4q_wBroA$l5 z$J3q%zaOWa0Jrh!Gt#e2&rElv-=5x-{@e8abe(;o{n1ReMzd*Y43L2ha?EH;Li>-{ zj@edVq;_WApY;$Qb5CYHll4N@zN~{;Z)Lrg^ - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/buildtools/windows/source/make/ChangeLog b/buildtools/windows/source/make/ChangeLog deleted file mode 100644 index 3532eb6dcd1..00000000000 --- a/buildtools/windows/source/make/ChangeLog +++ /dev/null @@ -1,3263 +0,0 @@ -Fri May 19 16:36:32 1995 Roland McGrath - - * Version 3.74 released. - -Wed May 10 17:43:34 1995 Roland McGrath - - * Version 3.73.3. - -Tue May 9 17:15:23 1995 Roland McGrath - - * compatMakefile ($(infodir)/make.info): Make sure $$dir is set in - install-info cmd. - -Wed May 3 15:56:06 1995 Roland McGrath - - * file.c (print_file): Grok update_status of 1 for -q. - -Thu Apr 27 12:39:35 1995 Roland McGrath - - * Version 3.73.2. - -Wed Apr 26 17:15:57 1995 Roland McGrath - - * file.c (remove_intermediates): Fix inverted test to bail under - -n for signal case. Bail under -q or -t. - Skip files with update_status==-1. - - * job.c (job_next_command): Skip empty lines. - (new_job): Don't test the return of job_next_command. - Just let start_waiting_job handle the case of empty commands. - -Wed Apr 19 03:25:54 1995 Roland McGrath - - * function.c [__MSDOS__]: Include . From DJ Delorie. - - * Version 3.73.1. - -Sat Apr 8 14:53:24 1995 Roland McGrath - - * remake.c (notice_finished_file): Set FILE->update_status to zero - if it's -1. - -Wed Apr 5 00:20:24 1995 Roland McGrath - - * Version 3.73 released. - -Tue Mar 28 13:25:46 1995 Roland McGrath - - * main.c (main): Fixed braino in assert. - - * Version 3.72.13. - -Mon Mar 27 05:29:12 1995 Roland McGrath - - * main.c: Avoid string in assert expression. Some systems are broken. - -Fri Mar 24 00:32:32 1995 Roland McGrath - - * main.c (main): Handle 1 and 2 returns from update_goal_chain - makefile run properly. - - * Version 3.72.12. - - * main.c (handle_non_switch_argument): New function, broken out of - decode_switches. - (decode_switches): Set optind to 0 to reinitialize getopt, not to 1. - When getopt_long returns EOF, break the loop and handle remaining args - with a simple second loop. - - * remake.c (remake_file): Set update_status to 2 instead of 1 for - no rule to make. Mention parent (dependent) in error message. - (update_file_1): Handle FILE->update_status == 2 in -d printout. - * job.c (start_job_command, reap_children): Set update_status to 2 - instead of 1 for failed commands. - -Tue Mar 21 16:23:38 1995 Roland McGrath - - * job.c (search_path): Function removed (was already #if 0'd out). - * configure.in: Remove AC_TYPE_GETGROUPS; nothing needs it any more. - -Fri Mar 17 15:57:40 1995 Roland McGrath - - * configure.bat: Write @CPPFLAGS@ translation. - -Mon Mar 13 00:45:59 1995 Roland McGrath - - * read.c (parse_file_seq): Rearranged `l(a b)' -> `l(a) l(b)' loop - to not skip the elt immediately preceding `l(...'. - -Fri Mar 10 13:56:49 1995 Roland McGrath - - * Version 3.72.11. - - * read.c (find_char_unquote): Make second arg a string of stop - chars instead of a single stop char. Stop when any char in the - string is hit. All callers changed. - (find_semicolon): Pass stop chars "#;" to one find_char_unquote call, - instead of using two calls. If the match is not a ; but a #, - return zero. - * misc.c: Changed find_char_unquote callers here too. - - * Version 3.72.10. - - * read.c (read_makefile, parse_file_seq): Fix typo __MS_DOS__ -> - __MSDOS__. - - * GNUmakefile (globfiles): Add glob/configure.bat. - (distfiles): Add configh.dos, configure.bat. - -Wed Mar 8 13:10:57 1995 Roland McGrath - - Fixes for MS-DOS from DJ Delorie. - * read.c (read_makefile, parse_file_seq) [__MS_DOS__]: Don't see : - as separator in "C:\...". - * configh.dos (STDC_HEADERS): Define only if undefined. - (HAVE_SYS_PARAM_H): Don't define this. - (HAVE_STRERROR): Define this. - * job.c (construct_command_argv_internal) [__MSDOS__]: Fix typos. - - * Version 3.72.9. - - * main.c (decode_switches): Reset optind to 1 instead of 0. - -Tue Mar 7 17:31:06 1995 Roland McGrath - - * main.c (decode_switches): If non-option arg is "-", ignore it. - -Mon Mar 6 23:57:38 1995 Roland McGrath - - * Version 3.72.8. - -Wed Feb 22 21:26:36 1995 Roland McGrath - - * Version 3.72.7. - -Tue Feb 21 22:10:43 1995 Roland McGrath - - * main.c (main): Pass missing arg to tmpnam. - - * configure.in: Check for strsignal. - * job.c (child_error): Use strsignal. - * main.c (main): Don't call signame_init #ifdef HAVE_STRSIGNAL. - - * misc.c (strerror): Fix swapped args in sprintf. - -Mon Feb 13 11:50:08 1995 Roland McGrath - - * configure.in (CFLAGS, LDFLAGS): Don't set these variables. - -Fri Feb 10 18:44:12 1995 Roland McGrath - - * main.c (print_version): Add 95 to copyright years. - - * Version 3.72.6. - - * job.c (start_job_command): Remember to call notice_finished_file - under -n when not recursing. To do this, consolidate that code - under the empty command case and goto there for the -n case. - -Tue Feb 7 13:36:03 1995 Roland McGrath - - * make.h [! STDC_HEADERS]: Don't declare qsort. Sun headers - declare it int. - -Mon Feb 6 17:37:01 1995 Roland McGrath - - * read.c (read_makefile): For bogus line starting with tab, ignore - it if blank after removing comments. - - * main.c: Cast results of `alloca' to `char *'. - * expand.c: Likewise. - -Sun Feb 5 18:35:46 1995 Roland McGrath - - * Version 3.72.5. - - * configure.in: Check for mktemp. - * main.c (main) [! HAVE_MKTEMP]: Use tmpnam instead of mktemp. - - * configure.in (make_cv_sysconf_open_max): New check for `sysconf - (_SC_OPEN_MAX)'. - * acconfig.h: Added #undef HAVE_SYSCONF_OPEN_MAX. - * job.c [HAVE_SYSCONF_OPEN_MAX] (getdtablesize): Define as macro - using sysconf. - -Fri Jan 27 04:42:09 1995 Roland McGrath - - * remake.c (update_file_1): When !MUST_MAKE, don't set - FILE->update_status to zero before calling notice_finished_file. - (notice_finished_file): Touch only when FILE->update_status is zero. - (remake_file): Set FILE->update_status to zero after not calling - execute_file_command and deciding to touch instead. - -Thu Jan 26 01:29:32 1995 Roland McGrath - - * main.c (debug_signal_handler): New function; toggles debug_flag. - (main): Handle SIGUSR1 with that. - -Mon Jan 16 15:46:56 1995 Roland McGrath - - * compatMakefile (realclean): Remove Info files. - -Sun Jan 15 08:23:09 1995 Roland McGrath - - * Version 3.72.4. - - * job.c (start_job_command): Save and restore environ around vfork - call. - (search_path): Function #if 0'd out. - (exec_command): Use execvp instead of search_path. - - * expand.c (variable_expand): Rewrote computed variable name and - substitution reference handling to be simpler. First expand the - entire text between the parens if it contains any $s, then examine - the result of that for subtitution references and do no further - expansion while parsing them. - - * job.c (construct_command_argv_internal): Handle " quoting too, - when no backslash, $ or ` characters appear inside the quotes. - - * configure.in (union wait check): If WEXITSTATUS and WTERMSIG are - defined, just use int. - -Tue Jan 10 06:27:27 1995 Roland McGrath - - * default.c (default_variables) [__hpux]: Remove special - definition of ARFLAGS. Existence of the `f' flag is not - consistent across HPUX versions; and one might be using GNU ar - anyway. - - * compatMakefile (clean): Don't remove Info files. - - * compatMakefile (check): Remove gratuitous target declaration. - -Sat Jan 7 11:38:23 1995 Roland McGrath - - * compatMakefile (ETAGS, CTAGS): Don't use -t. - - * arscan.c (ar_name_equal) [cray]: Subtract 1 like [__hpux]. - - * main.c (decode_switches): For --help, print usage to stdout. - -Mon Dec 5 12:42:18 1994 Roland McGrath - - * Version 3.72.3. - - * remake.c (update_file_1): Do set_command_state (FILE, - cs_not_started) only if old state was deps_running. - -Mon Nov 28 14:24:03 1994 Roland McGrath - - * job.c (start_waiting_job): Use set_command_state. - - * build.template (CPPFLAGS): New variable. - (prefix, exec_prefix): Set from @...@. - (compilation loop): Pass $CPPFLAGS to compiler. - - * GNUmakefile (build.sh.in): Make it executable. - - * GNUmakefile (globfiles): Add configure.in, configure. - - * Version 3.72.2. - - * configure.in (AC_OUTPUT): Don't write glob/Makefile. - - * configure.in (AC_CHECK_SYMBOL): Use AC_DEFINE_UNQUOTED. - - * configure.in: Don't check for ranlib. - -Tue Nov 22 22:42:40 1994 Roland McGrath - - * remake.c (notice_finished_file): Only mark also_make's as - updated if really ran cmds. - -Tue Nov 15 06:32:46 1994 Roland McGrath - - * configure.in: Put dnls before random whitespace. - -Sun Nov 13 05:02:25 1994 Roland McGrath - - * compatMakefile (CPPFLAGS): New variable, set from @CPPFLAGS@. - (RANLIB): Variable removed. - (prefix, exec_prefix): Set these from @...@. - (.c.o): Use $(CPPFLAGS). - (glob/libglob.a): Don't pass down variables to sub-make. - glob/Makefile should be configured properly by configure. - (distclean): Remove config.log and config.cache (autoconf stuff). - -Mon Nov 7 13:58:06 1994 Roland McGrath - - * acconfig.h: Add #undef HAVE_UNION_WAIT. - * configure.in: Converted to Autoconf v2. - * dir.c: Test HAVE_DIRENT_H, HAVE_SYS_DIR_H, HAVE_NDIR_H instead - of DIRENT, SYSDIR, NDIR. - * build.sh.in (prefix, exec_prefix): Set these from @...@. - (CPPFLAGS): New variable, set from @CPPFLAGS@. - (compiling loop): Pass $CPPFLAGS before $CFLAGS. - * install.sh: File renamed to install-sh. - - * main.c (define_makeflags): When no flags, set WORDS to zero. - -Sun Nov 6 18:34:01 1994 Roland McGrath - - * Version 3.72.1. - - * main.c (define_makeflags): Terminate properly when FLAGSTRING is - empty. - -Fri Nov 4 16:02:51 1994 Roland McGrath - - * Version 3.72. - -Tue Nov 1 01:18:10 1994 Roland McGrath - - * Version 3.71.5. - - * job.c (start_job_command): When ARGV is nil, only set - update_state and call notice_finished_file if job_next_command - returns zero. - - * job.c (start_job_command): Call notice_finished_file for empty - command line. - -Thu Oct 27 02:02:45 1994 Roland McGrath - - * file.c (snap_deps): Set COMMANDS_SILENT for .SILENT, not - COMMANDS_NOERROR. - -Wed Oct 26 02:14:10 1994 Roland McGrath - - * Version 3.71.4. - -Tue Oct 25 22:49:24 1994 Roland McGrath - - * file.c (snap_deps): Set command_flags bits in all :: entries. - -Mon Oct 24 18:47:50 1994 Roland McGrath - - * make.h (posix_pedantic): Declare it. - * main.c (main): Move checks .IGNORE, .SILENT, .POSIX to - snap_deps. - * file.c (snap_deps): Check .IGNORE, .SILENT, .POSIX here instead - of in main. If .IGNORE has deps, OR COMMANDS_NOERROR into their - command_flags and don't set -i. Likewise .SILENT. - * job.c (start_job_command): In FLAGS initialization, OR in - CHILD->file->command_flags. - * file.h (struct file): New member `command_flags'. - -Sun Oct 16 01:01:51 1994 Roland McGrath - - * main.c (switches): Bump flag values for --no-print-directory and - --warn-undefined-variables, so neither is 1 (which indicates a - nonoption argument). - -Sat Oct 15 23:39:48 1994 Roland McGrath - - * main.c (main): Add missing code in .IGNORE test. - -Mon Oct 10 04:09:03 1994 Roland McGrath - - * variable.c (define_automatic_variables): Define +D and +F. - -Sat Oct 1 04:07:48 1994 Roland McGrath - - * main.c (main): Define hidden automatic variable with command - vars, and MAKEOVERRIDES to a reference to that. - (define_makeflags): If posix_pedantic, write a reference to that - instead. - -Thu Sep 29 00:14:26 1994 Roland McGrath - - * main.c (posix_pedantic): New variable. - (main): Set posix_pedantic if .POSIX is a target. - Fix .IGNORE and .SILENT checks to require is_target. - - * commands.c (set_file_variables): Define new automatic variable - $+, like $^ but before calling uniquize_deps. - - * job.c (reap_children): Call delete_child_targets for non-signal - error if .DELETE_ON_ERROR is a target. - -Tue Sep 27 01:57:14 1994 Roland McGrath - - * Version 3.71.3. - -Mon Sep 26 18:16:55 1994 Roland McGrath - - * job.c (reap_children): Don't change C->file->command_state when - dying. Test it only after calling start_job_command for a new - command line. When no more cmds, just set C->file->update_status. - (start_job_command): When the last line is empty or under -n, set - C->file->update_status. - (start_waiting_job): Grok cs_not_started after start_job_command - as success. - (new_job): Set C->file->update_status when there are no cmds. - (job_next_command): When out of lines, don't set - CHILD->file->update_status or CHILD->file->command_state. - - * main.c (quote_as_word): Renamed from shell_quote. Take new arg; - if nonzero, also double $s. - (main): Define MAKEOVERRIDES from command_variables here. - (define_makeflags): Don't use command_variables here; instead write a - reference $(MAKEOVERRIDES) in MAKEFLAGS. Make vars recursive. - - * dir.c [__MSDOS__]: Fixed typo. - - * vpath.c (selective_vpath_search): Reset EXISTS when stat fails. - -Sat Sep 10 03:01:35 1994 Roland McGrath - - * remake.c: Include and use assert instead of printfs - and abort. - - * main.c (decode_switches): Loop until optind hits ARGC, not just - until getopt_long returns EOF. Initialize C to zero before loop; - in loop if C is EOF, set optarg from ARGV[optind++], else call - getopt_long. - (decode_env_switches): Use variable_expand instead of - allocated_variable_expand. Allocate a fresh buffer to copy split - words into; scan characters by hand to break words and - debackslashify. - (shell_quote): New function. - (define_makeflags): Allocate doubled space for switch args, and command - variable names and values; use shell_quote to quote those things. - -Fri Sep 9 01:37:47 1994 Roland McGrath - - * Version 3.71.2. - - * acconfig.h: Add HAVE_SYS_SIGLIST and HAVE__SYS_SIGLIST. - - * main.c (decode_switches): The non-option return from getopt is - 1, not 0. - (command_variables): New type and variable. - (decode_switches, decode_env_switches): After making a variable - definition, record the struct variable pointer in the - command_variables chain. - (define_makeflags): If ALL, write variable definitions for - command_variables. - - * main.c (other_args): Variable removed. - (goals, lastgoal): New static variables (moved from auto in main). - (main): Don't process OTHER_ARGS at all. - Don't set variable MAKEOVERRIDES at all; define MAKE to just - $(MAKE_COMMAND). - (init_switches): Prepend a - {return in order} instead of a + - {require order}. - (decode_switches): Don't set OTHER_ARGS at all. - Grok '\0' return from getopt_long as non-option argument; try - variable definition and (if !ENV) enter goal targets here. - (decode_env_switches): Use allocated_variable_expand to store value. - Use find_next_token to simplify word-splitting loop. Don't - prepend a dash to uninterpreted value. Instead, if split into - only one word, try variable definition and failing that prepend a - dash to the word and pass it to decode_switches as a single arg. - -Wed Sep 7 03:02:46 1994 Roland McGrath - - * remake.c (notice_finished_file): Only recheck modtimes if - FILE->command_state was cs_running on entry (meaning the commands - actually just ran). - (update_file_1): Whenever we set FILE->update_status, call - notice_finished_file instead of just set_command_state. - * job.c (start_job_command): Whenever we set - CHILD->file->update_status, call notice_finished_file instead of - just set_command_state. - -Tue Sep 6 19:13:54 1994 Roland McGrath - - * default.c: Add missing ". - - * job.c: Changed all assignments of command_state members to calls - to set_command_state. - * remake.c: Likewise. - * file.c (set_command_state): New function. - * file.h: Declare set_command_state. - - * main.c (init_switches): Put a + first in options. - -Mon Jul 25 18:07:46 1994 Roland McGrath - - Merge MSDOS/GO32 port from DJ Delorie . - * vpath.c: Changed all uses of ':' to PATH_SEPARATOR_CHAR. - * main.c (directory_before_chdir): New variable, moved out of main - (was local). - (main) [__MSDOS__]: Look for \ or : to delimit last component of - PROGRAM. Don't frob ARGV[0] before setting MAKE_COMMAND variable. - (die): Change back to `directory_before_chdir' before dying. - * make.h (PATH_SEPARATOR_CHAR): New macro; differing defns for - [__MSDOS__] and not. - * job.c [__MSDOS__]: Include . - [__MSDOS__] (dos_pid, dos_status, dos_bname, dos_bename, - dos_batch_file): New variables. - (reap_children) [__MSDOS__]: Don't call wait; just examine those vars. - (unblock_sigs) [__MSDOS__]: Do nothing. - (start_job_command) [__MSDOS__]: Use spawnvpe instead of vfork & exec. - (load_too_high) [__MSDOS__]: Always return true. - (search_path) [__MSDOS__]: Check for : or / in FILE to punt. - Use PATH_SEPARATOR_CHAR instead of ':'. - (construct_command_argv_internal) [__MSDOS__]: Wholly different - values for sh_chars and sh_cmds. Wholly new code to handle shell - scripts. - * function.c (expand_function: `shell') [__MSDOS__]: Wholly new - implementation. - * dir.c [__MSDOS__] (dosify): New function. - (dir_contents_file_exists_p) [__MSDOS__]: Call it on FILENAME and - process the result instead of FILENAME itself. - (file_impossible_p) [__MSDOS__]: Likewise. - * default.c [__MSDOS__]: Define GCC_IS_NATIVE. - (default_suffix_rules) [__MSDOS__]: Use `y_tab.c' instead of `y.tab.c'. - (default_variables) [GCC_IS_NATIVE]: Set CC and CXX to `gcc', YACC to - `bison -y', and LEX to `flex'. - * configure.bat, configh.dos: New files. - * commands.c (fatal_error_signal) [__MSDOS__]: Just remove - intermediates and exit. - - * commands.c (set_file_variables): Add parens in length - computation in .SUFFIXES dep loop to quiet compiler warning. From - Jim Meyering. - - * read.c (read_makefile): Free FILENAME if we allocated it. From - Jim Meyering. - -Mon Jul 4 17:47:08 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * misc.c (safe_stat): New function, EINTR-safe wrapper around stat. - * vpath.c (selective_vpath_search): Use safe_stat in place of stat. - * read.c (construct_include_path): Use safe_stat in place of stat. - * job.c (search_path): Use safe_stat in place of stat. - * dir.c (find_directory): Use safe_stat in place of stat. - * commands.c (delete_target): Use safe_stat in place of stat. - * arscan.c (ar_member_touch) [EINTR]: Do EINTR looping around fstat. - * remake.c (name_mtime): Use safe_stat in place of stat. - (touch_file) [EINTR]: Do EINTR looping around fstat. - -Fri Jun 24 05:40:24 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Check for a shell command first, and - then strip leading tabs before further checking if it's not a - shell command line. - - * make.h [__arm]: Undefine POSIX. - [!__GNU_LIBRARY__ && !POSIX && !_POSIX_VERSION]: Don't declare system - functions that return int. - - * job.c (construct_command_argv_internal): After swallowing a - backslash-newline combination, if INSTRING is set goto string_char - (new label) for normal INSTRING handling code. - -Sat Jun 4 01:11:20 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * configure.in: Don't check for sys_siglist and _sys_siglist with - AC_HAVE_FUNCS. Instead use two AC_COMPILE_CHECKs. - -Mon May 23 18:20:38 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.71.1 released. - - * make.h [!__GNU_LIBRARY__ && !POSIX]: Also test #ifndef - _POSIX_VERSION for these declarations. - - * misc.c [GETLOADAVG_PRIVILEGED] [POSIX]: Remove bogus #ifndefs - around #undefs of HAVE_SETREUID and HAVE_SETREGID. - -Sat May 21 16:26:38 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.71 released. - - * misc.c [GETLOADAVG_PRIVILEGED] [POSIX]: Don't test [HAVE_SETUID] - and [HAVE_SETGID]. Every system has those, and configure doesn't - check for them. - - * make.h [_POSIX_VERSION]: Don't #define POSIX #ifdef ultrix. - - * compatMakefile (loadavg): Depend on and use loadavg.c instead of - getloadavg.c. - (loadavg.c): Link or copy it from getloadavg.c. - (distclean): Remove loadavg.c. - -Mon May 16 22:59:04 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.70.4. - - * misc.c [GETLOADAVG_PRIVILEGED] [! POSIX]: Undefine HAVE_SETEUID - and HAVE_SETEGID. - - * default.c (default_terminal_rules): In SCCS rules, put - $(SCCS_OUTPUT_OPTION) before $<. On some systems -G is grokked - only before the file name. - * configure.in (SCCS_GET_MINUS_G check): Put -G flag before file name. - -Tue May 10 16:27:38 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Swallow - backslash-newline combinations inside '' strings too. - -Thu May 5 04:15:10 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (do_define): Call collapse_continuations on each line - before all else. - -Mon Apr 25 19:32:02 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Notice newline inside - '' string when RESTP is non-null. - -Fri Apr 22 17:33:30 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.70.3. - - * remake.c (update_goal_chain): Reset FILE to G->file after the - double-colon loop so it is never null for following code. - - * read.c (read_makefile): Fix `override define' parsing to skip - whitespace after `define' properly. - - * compatMakefile (srcdir): Define as @srcdir@; don't reference - $(VPATH). - (glob/Makefile): New target. - -Thu Apr 21 16:16:55 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.70.2. - - * misc.c (remove_comments): Use find_char_unquote. - * make.h (find_char_unquote): Declare it. - * read.c (find_char_unquote): New function, generalized from - find_percent. - (find_percent, find_semicolon, parse_file_seq): Use that. - -Wed Apr 20 18:42:39 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * implicit.c (pattern_search): Always allocate new storage for - FILE->stem. It is not safe to store STEM's address because it - might be auto storage. - - * configure.in: Check for seteuid and setegid. - * misc.c [HAVE_SETEUID]: Declare seteuid. - [HAVE_SETEGID]: Declare setegid. - (make_access, user_access) [HAVE_SETEUID]: Use seteuid. - [HAVE_SETEGID]: Use setegid. - - * remake.c (update_goal_chain): Set STATUS to FILE->update_status, - to preserve whether it's 2 for error or 1 for -q trigger. When - STATUS gets nonzero and -q is set, always stop immediately. - * main.c (main, decode_switches): Die with 2 for errors. - (main): Accept 2 return from update_goal_chain and die with that. - * misc.c (fatal, makefile_fatal): Die with 2; 1 is reserved for -q - answer. - * job.c (reap_children): Die with 2 for error. - (start_job_command): Set update_status to 2 for error. Set it to - 1 when we would run a command and question_flag is set. - - * read.c (read_makefile): Don't mark makefiles as precious. Just - like other targets, they can be left inconsistent and in need of - remaking by aborted commands. - - * read.c (read_makefile): Write no error msg for -include file. - -Tue Apr 5 05:22:19 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * commands.c (fatal_error_signal): Don't unblock signals. - - * file.h (struct file): Change member `double_colon' from flag to - `struct file *'. - * read.c (record_files): Set double_colon pointer instead of flag. - * main.c (main): When disqualifying makefiles for updating, use - double_colon pointer to find all entries for a file. - * file.c (enter_file): If there is already a double-colon entry - for the file, set NEW->double_colon to that pointer. - (file_hash_enter): Use FILE->double_colon to find all entries to - set name. - * remake.c (update_goal_chain): Do inner loop on double-colon entries. - (update_file): Use FILE->double_colon pointer to find all entries. - (f_mtime): Likewise. - (notice_finished_file): Propagate mtime change to all entries. - - * variable.c (try_variable_definition): Return after abort. - -Fri Apr 1 18:44:15 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Remove unused variable. - (parse_file_seq): When removing an elt that is just `)', properly - fix up the previous elt's next pointer. - -Mon Mar 28 18:31:49 1994 Roland McGrath (roland@mole.gnu.ai.mit.edu) - - * configure.in: Do AC_SET_MAKE. - * GNUmakefile (Makefile.in): Edit MAKE assignment into @SET_MAKE@. - -Fri Mar 4 00:02:32 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * function.c (subst_expand): If BY_WORD or SUFFIX_ONLY is set and - the search string is the empty string, find a match at the end of - each word (using end_of_token in place of sindex). - - * misc.c (end_of_token): Don't treat backslashes specially; you - can no longer escape blanks with backslashes in export, unexport, - and vpath. This was never documented anyway. - -Thu Mar 3 23:53:46 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Variable name for `define' is not just - first token; use whole rest of line and strip trailing blanks. - -Wed Feb 16 16:03:45 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.70.1. - - * read.c (read_makefile): Add -d msg stating args. - - * read.c (read_makefile): Use isspace to skip over leading - whitespace, and explicitly avoid skipping over tabs. Don't want - to skip just spaces though; formfeeds et al should be skipped. - - * default.c (default_variables) [__hpux]: Add f in ARFLAGS. - - * arscan.c (ar_name_equal) [__hpux]: Subtract 2 instead of 1 from - sizeof ar_name for max length to compare. - - * misc.c [GETLOADAVG_PRIVILEGED] [POSIX]: Undefine HAVE_SETREUID - #ifdef HAVE_SETUID; likewise HAVE_SETREGID and HAVE_SETGID. - - * main.c (main): Call user_access after setting `program', in case - it needs to use it in an error message. - - * read.c (read_makefile): Ignore an empty line starting with a tab. - -Thu Feb 10 21:45:31 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in (AC_SYS_SIGLIST_DECLARED): Use this instead of - AC_COMPILE_CHECK that is now its contents. - -Fri Feb 4 16:28:54 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.h: #undef strerror after #include . - [! ANSI_STRING]: Declare strerror. - -Thu Feb 3 02:21:22 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * misc.c (strerror): #undef any macro before function definition. - -Mon Jan 31 19:07:23 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * variable.c (try_variable_definition): Calculate BEG before loop - to strip blanks by decrementing END. Don't decr END to before BEG. - - * read.c (read_makefile): Skip over leading space characters, but - not tabs, after removing continuations and comments (it used to - use isspace). - -Tue Jan 25 16:45:05 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * variable.c (define_automatic_variables): In $(@D) et al, use - patsubst to remove trailing slash. - - * commands.c (delete_target): New function, broken out of - delete_child_targets. Check for archive members and give special msg. - (delete_child_targets): Use delete_target. - -Mon Jan 17 17:03:22 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * default.c (default_suffix_rules): Use $(TEXI2DVI_FLAGS) in - texi2dvi rules. Use $(MAKEINFO_FLAGS) in makeinfo rules. - -Tue Jan 11 19:29:55 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * GNUmakefile (tarfiles): Omit make-doc. - (make-$(version).tar): Include make.info*. - -Fri Jan 7 16:27:00 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (configure, config.h.in): Comment out rules. - -Thu Jan 6 18:08:08 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (binprefix, manprefix): New variables. - (instname): Variable removed. - (install): Use $({bin,man}prefix)make in place of $(instname). - File targets likewised renamed. - -Mon Jan 3 17:50:25 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.70 released. - -Thu Dec 23 14:46:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.69.3. - - * read.c (parse_file_seq): Inside multi-word archive ref - translation loop, check NEW1==0 at end and break out of the loop. - - * GNUmakefile (make-$(version).tar): Distribute install.sh. - * install.sh: New file. - - * configure.in (SCCS_GET_MINUS_G check): Put redirection for admin - cmds outside subshell parens, to avoid "command not found" msgs - from the shell. - -Wed Dec 22 17:00:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in (SCCS_GET_MINUS_G check): Put -G flag last in get cmd. - Redirect output & error from get to /dev/null. - Fix reversed sense of test. - -Fri Dec 17 15:31:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in (SCCS_GET_MINUS_G check): Use parens instead of - braces inside if condition command; some shells lose. - -Thu Dec 16 15:10:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.69.2. - - * arscan.c [M_UNIX]: Move #undef M_XENIX for PORTAR stuff. - (PORTAR) [M_XENIX]: Define to 0 instead of 1. - - * main.c (define_makeflags): Only export MAKEFLAGS if !ALL. - -Wed Dec 15 17:47:48 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (main): Cast result of pointer arith to unsigned int - before passing to define_variable for envars. Matters when - sizeof(unsigned)!=sizeof(ptrdiff_t). - -Tue Dec 14 14:21:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in: Add new check for SCCS_GET_MINUS_G. - * config.h.in: Add #undef SCCS_GET_MINUS_G. - * default.c (default_terminal_rules): Use `$(SCCS_OUTPUT_OPTION)' in - place of `-G $@' in SCCS commands. - (default_variables) [SCCS_GET_MINUS_G]: Define SCCS_OUTPUT_OPTION - to "-G$@". - - * configure.in (AC_OUTPUT): Put touch stamp-config in second arg - (so it goes in config.status), rather than afterward. - - * ar.c (ar_member_date): Don't call enter_file on the archive file - if it doesn't exist (by file_exists_p). - - * compatMakefile ($(infodir)/make.info): Replace `$$d/foo.info' - with `$$dir/make.info' in install-info invocation (oops). - - * vpath.c (construct_vpath_list): Only set LASTPATH set PATH when - we do not unlink and free PATH. - - * file.c (print_file_data_base): Fix inverted calculation for - average files per hash bucket. - - * read.c (readline): When we see a NUL, give only a warning and - synthesize a newline to terminate the building line (used to - fatal). Move fgets call into the loop condition, and after the - loop test ferror (used to test !feof in the loop). - -Fri Dec 3 16:40:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in: Check for strerror in AC_HAVE_FUNCS. - -Thu Dec 2 15:37:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - Differentiate different flavors of missing makefile error msgs, - removing gratuitous `fopen: ' and giving caller for included makefiles. - * misc.c [! HAVE_STRERROR]: Define our own strerror here. - (perror_with_name, pfatal_with_name): Use strerror instead of - replicating its functionality. - * read.c (read_makefile): Return int instead of void. - (read_all_makefiles, read_makefile): Change callers to notice zero - return and give error msg. - -Thu Nov 11 11:47:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.69.1. - - * default.c: Put `-G $@' before $< in SCCS cmds. - -Wed Nov 10 06:06:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): After trying a variable defn, notice if - the line begins with a tab, and diagnose an error. - -Sun Nov 7 08:07:37 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.69. - -Wed Nov 3 06:54:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.10. - - * implicit.c (try_implicit_rule): Look for a normal rule before an - archive rule. - -Fri Oct 29 16:45:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * function.c (expand_function: `sort'): Double NWORDS when it - overflows, instead of adding five. - - * compatMakefile (clean): Remove loadavg. - -Wed Oct 27 17:58:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.9. - - * file.h (NEW_MTIME): Define new macro. - * main.c (main): Set time of NEW_FILES to NEW_MTIME, not to - current time returned from system. Removed variable NOW. - * remake.c (notice_finished_file): Use NEW_MTIME in place of - current time here too. - -Tue Oct 26 19:45:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.8. - - * remake.c (update_file_1): Don't clear MUST_MAKE when FILE has no - cmds and !DEPS_CHANGED unless also !NOEXIST. - -Mon Oct 25 15:25:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (parse_file_seq): When converting multi-word archive - refs, ignore a word beginning with a '('. - -Fri Oct 22 02:53:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in: Check for sys/timeb.h. - * make.h [HAVE_SYS_TIMEB_H]: Test this before including it. - -Thu Oct 21 16:48:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.7. - - * rule.c (convert_suffix_rule): New local TARGPERCENT. Set it to - TARGNAME+1 for "(%.o)", to TARGNAME for "%.?". Use it in place of - TARGNAME to initialize PERCENTS[0]. - -Mon Oct 18 06:49:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in: Use AC_HAVE_HEADERS(unistd.h) instead of AC_UNISTD_H. - Remove AC_USG; it is no longer used. - - * file.c (print_file): New function, broken out of - print_file_data_base. - (print_file_data_base): Call it. - * rule.c (print_rule): New function, broken out of - print_rule_data_base. - (print_rule_data_base): Call it. - -Thu Oct 14 14:54:03 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * default.c (install_default_suffix_rules): New function, broken - out of install_default_implicit_rules. - (install_default_implicit_rules): Move suffix rule code there. - * make.h: Declare install_default_suffix_rules. - * main.c (main): Call install_default_suffix_rules before reading - makefiles. Move convert_to_pattern call before - install_default_implicit_rules. - - * job.h (struct child): Make `pid' member type `pid_t' instead of - `int'. - - * compatMakefile (RANLIB): New variable, set by configure. - (glob/libglob.a): Pass RANLIB value down to submake. - - Fixes for SCO 3.2 "devsys 4.2" from pss@tfn.com (Peter Salvitti). - * make.h: Include before for SCO lossage. - * job.c [! getdtablesize] [! HAVE_GETDTABLESIZE]: If NOFILE is not - defined but NOFILES_MAX is, define it to be that. - -Mon Oct 11 19:47:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * GNUmakefile (make-$(version).tar): Depend on acconfig.h, so it - is distributed. - -Sun Oct 3 15:15:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * default.c (default_terminal_rules): Add `-G $@' to SCCS get cmds. - -Tue Sep 28 14:18:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Add ^ to SH_CHARS; it - is another symbol for | in some shells. - * main.c (main): Add it to CMD_DEFS quoting list as well. - -Mon Sep 20 18:05:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Remove '=' from - SH_CHARS. Only punt on '=' if it is unquoted in a word before the - first word without an unquoted '='. - - * main.c (define_makeflags): Set v_export for MAKEFLAGS. - -Fri Sep 17 00:37:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * remake.c (update_file_1): Use .DEFAULT cmds for phony targets. - - * make.h [_AIX && _POSIX_SOURCE]: Define POSIX. - - * commands.c (delete_child_targets): Don't delete phony files. - - * job.c (start_job_command): Set COMMANDS_RECURSE in FLAGS if we - see a `+' at the beginning of the command line. - -Thu Sep 9 17:57:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.6. - -Wed Sep 8 20:14:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (define_makeflags): Define MAKEFLAGS with o_file, not o_env. - -Mon Aug 30 12:31:58 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * expand.c (variable_expand): Fatal on an unterminated reference. - -Thu Aug 19 16:27:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.5. - - * variable.c (define_automatic_variables): Define new o_default - variable `MAKE_VERSION' from version_string and remote_description. - - * make.h (version_string, remote_description): Declare these here. - * main.c: Don't declare version_string. - (print_version): Don't declare remote_description. - -Wed Aug 18 15:01:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Free space pointed to by CONDITIONALS - before restoring the old pointer. - -Mon Aug 16 17:33:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile ($(objs)): Depend on config.h. - - * GNUmakefile (build.sh.in): Depend on compatMakefile. - - * configure.in: Touch stamp-config after AC_OUTPUT. - -Fri Aug 13 16:04:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.4. - -Thu Aug 12 17:18:57 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.h: Include instead of "config.h". - -Wed Aug 11 02:35:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (main): Make all variables interned from ENVP be v_export. - * variable.c (try_variable_definition): In v_default case, don't - check for an o_file variable that `getenv' finds. - - * job.c (reap_children): New local variable ANY_LOCAL; set it - while setting ANY_REMOTE. If !ANY_LOCAL, don't wait for local kids. - - * main.c (main): Don't call decode_env_switches on MFLAGS. DOC THIS. - - * function.c (expand_function): #if 0 out freeing of ENVP since it - is environ. - -Mon Aug 9 17:37:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.3. - - * remote-stub.c (remote_status): Set errno to ECHILD before return. - * job.c (reap_children): Scan the chain for remote children and - never call remote_status if there are none. - - * function.c (expand_function: `shell'): #if 0 out calling - target_environment; just set ENVP to environ instead. - - * job.c (reap_children): Check for negative return from - remote_status and fatal for it. - When blocking local child wait returns 0, then try a blocking call - to remote_status. - -Tue Aug 3 00:19:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (clean): Delete make.info* and make.dvi here. - (distclean): Not here. - - * dep.h (RM_*): Use #defines instead of enum to avoid lossage from - compilers that don't like enum values used as ints. - -Mon Aug 2 16:46:34 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (loadavg): Add $(LOADLIBES). - -Sun Aug 1 16:01:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.2. - - * compatMakefile (loadavg, check-loadavg): New targets. - (check): Depend on check-loadavg. - - * compatMakefile (glob/libglob.a): Depend on config.h. - - * misc.c (log_access): Write to stderr instead of stdout. - -Fri Jul 30 00:07:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68.1. - -Thu Jul 29 23:26:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in (SYS_SIGLIST_DECLARED): In test program include - #ifdef HAVE_UNISTD_H. - - * compatMakefile (.PHONY): Put after `all' et al. - - * configure.in: Add AC_IRIX_SUN. - -Wed Jul 28 17:41:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.68. - -Mon Jul 26 14:36:49 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.8. - -Sun Jul 25 22:09:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.7. - - * compatMakefile ($(infodir)/make.info): Don't use $(instname). - Run install-info script if present. - -Fri Jul 23 16:03:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.h [STAT_MACROS_BROKEN]: Test this instead of [uts]. - - * configure.in: Add AC_STAT_MACROS_BROKEN. - -Wed Jul 14 18:48:11 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.6. - - * read.c (read_makefile): Recognize directive `-include', like - `include' but sets RM_DONTCARE flag. - - * variable.c (target_environment): If FILE is nil, use - current_variable_set_list in place of FILE->variables. - * function.c (expand_function: `shell'): Get an environment for - the child from target_environment instead of using environ. - - * dep.h: Declare read_all_makefiles here. - (RM_*): Define new enum constants. - * read.c (read_makefile): Second arg is FLAGS instead of TYPE. - Treat it as a bit mask containing RM_*. - (read_all_makefiles): For default makefiles, set D->changed to - RM_DONTCARE instead of 1. - * main.c: Don't declare read_all_makefiles here. - (main): Check `changed' member of read_makefiles elts for RM_* - flags instead of specific integer values. - -Mon Jul 12 22:42:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.h [sequent && i386]: #undef POSIX. From trost@cse.ogi.edu. - -Thu Jul 8 19:51:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * vpath.c (construct_vpath_list): If ELEM is zero 0, free PATTERN - as well as VPATH. - (build_vpath_lists): Empty `vpaths' around construct_vpath_list - call for $(VPATH). Expand $(strip $(VPATH)), not just $(VPATH). - - * rule.c (convert_suffix_rule): Use alloca instead of xmalloc for - PERCENTS, whose storage is not consumed by create_pattern_rule. - - * make.h [__mips && _SYSTYPE_SVR3]: #undef POSIX. - -Wed Jun 30 18:11:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.5. - - * rule.c (max_pattern_targets): New variable. - (count_implicit_rule_limits): Compute its value. - * rule.h: Declare it. - * implicit.c (pattern_search): Make TRYRULES max_target_patterns - times bigger. Move adding new TRYRULES elt inside the inner - targets loop, so each matching target gets its own elt in MATCHES - and CHECKED_LASTSLASH. - - * file.c (remove_intermediates): If SIG!=0 say `intermediate file' - instead of just `file' in error msg. - -Fri Jun 25 14:55:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv): Turn off - --warn-undefined-variables around expansion of SHELL and IFS. - * read.c (tilde_expand): Likewise for HOME. - (read_all_makefiles): Likewise for MAKEFILES. - * vpath.c (build_vpath_lists): Likewise for VPATH. - - * main.c (warn_undefined_variables_flag): New flag variable. - (switches): Add --warn-undefined-variables. - * make.h (warn_undefined_variables_flag): Declare it. - * expand.c (warn_undefined): New function. - (reference_variable): Call it if the variable is undefined. - (variable_expand): In substitution ref, call warn_undefined if the - variable is undefined. - - * default.c (default_pattern_rules): Add `%.c: %.w %.ch' and - `%.tex: %.w %.ch' rules. - (default_suffix_rules: .w.c, .w.tex): Pass three args: $< - $@. - (default_suffixes): Add `.ch'. - -Mon Jun 21 17:55:39 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * default.c (default_suffixes): Replace `.cweb' with `.w'. - (default_suffix_rules): Rename `.cweb.c' and `.cweb.tex' to `.w.c' - and `.w.tex'. - -Fri Jun 11 14:42:09 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile ($(bindir)/$(instname)): Add missing backslash. - -Thu Jun 10 18:14:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.4. - - * read.c (multi_glob): Don't free OLD and OLD->name in the - FOUND!=0 fork. Use new block-local variable F instead of - clobbering OLD. - - * ar.c (glob_pattern_p): New function, snarfed from glob/glob.c. - (ar_glob): Call it; return nil immediately if MEMBER_PATTERN - contains no metacharacters. - -Wed Jun 9 16:25:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * ar.c (ar_glob{_match,_alphacompare}): New function. - - * dep.h [! NO_ARCHIVES]: Declare it. - * read.c (multi_glob) [! NO_ARCHIVES]: Use it on archive member elts. - - * read.c (read_makefile): Pass flag (1) to parse_file_seq, not to - multi_glob (which doesn't take a 3rd arg). - * rule.c (install_pattern_rule): Likewise. - * default.c (set_default_suffixes): Here too. - * function.c (string_glob): Don't pass gratuitous arg to multi_glob. - - * read.c (parse_file_seq) [! NO_ARCHIVES]: Add post-processing - loop to translate archive refs "lib(a b)" into "lib(a) lib(b)". - -Mon Jun 7 19:26:51 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (installdirs): Actually pass directory names. - ($(bindir)/$(instname)): Test chgrp&&chmod exit status with `if'; - if it fails, echo a warning msg, but don't make the rule fail. - - * read.c (tilde_expand): New function, broken out of tilde_expand. - (multi_glob): Call it. - (construct_include_path): Expand ~ in directory names. - * dep.h: Declare tilde_expand. - * main.c (enter_command_line_file): Expand ~ at the start of NAME. - (main): Expand ~ in -C args. - * read.c (read_makefile): Expand ~ in FILENAME unless TYPE==2. - -Fri Jun 4 13:34:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (decode_env_switches): Use xmalloc instead of alloca for ARGS. - - * main.c (main): Put result of alloca in temporary variable with - simple assignment, to make SGI compiler happy. - -Thu Jun 3 20:15:46 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.3. - - * main.c (main): Before re-execing, remove intermediate files, and - print the data base under -p. Sexier debugging message. - - * implicit.c (pattern_search): Allocate an extra copy of the name - of a winning intermediate file when putting it in FOUND_FILES. - -Wed Jun 2 16:38:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Pass flag (1) to parse_file_seq, not to - multi_glob (which doesn't take a 3rd arg). - - * dir.c (dir_contents_file_exists_p): When reading dirents, ignore - chars within D_NAMLEN that are NULs. - - * main.c (decode_switches): Don't savestring ARGV[0] to put it - into `other_args'. - For string switch, don't savestring `optarg'. - (main): Don't free elts of makefiles->list that are "-". - Use alloca'd rather than savestring'd storage for elts of - makefiles->list that are temporary file names. - * read.c (read_all_makefiles): Don't free *MAKEFILES. - * file.c (enter_file): Don't strip `./'s. - * main.c (enter_command_line_file): New function. - (main): Use it in place of enter_file for command-line goals from - other_files, and for old_files and new_files. - -Mon May 31 18:41:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.2. - - * compatMakefile (.SUFFIXES): Add .info. - ($(infodir)/$(instname).info): Find make.info* in cwd if there, - else in $srcdir. Use basename to remove dir name from installed name. - -Thu May 27 17:35:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * implicit.c (pattern_search): When interning FOUND_FILES, try - lookup_file first; if found, free the storage for our copy of the name. - -Wed May 26 14:31:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67.1. - - * main.c (decode_switches): In usage msg, write `--switch=ARG' or - `--switch[=OPTARG]' rather than `--switch ARG' or `--switch [ARG]'. - -Mon May 24 16:17:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * rule.c (convert_suffix_rule): New function. - (convert_to_pattern): Use it instead of doing all the work here - several times. - For target suffix `.a', generate both the archive magic rule and - the normal rule. - - * compatMakefile (distclean): Remove stamp-config. - -Sat May 22 16:15:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.67. - - * file.c (remove_intermediates): Don't write extra space after `rm'. - - * main.c (struct command_switch.type): Remove `usage_and_exit'. - (print_usage_flag): New variable. - (switches: --help): Make type `flag', to set print_usage_flag. - (init_switches): Remove `usage_and_exit' case. - (decode_switches): Likewise. - (decode_switches): Print usage if print_usage_flag is set. - When printing usage, die with status of BAD. - (main): Die with 0 if print_version_flag. - -Fri May 21 16:09:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.66. - -Wed May 19 21:30:44 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (installdirs): New target. - (install): Depend on it. - -Sun May 16 20:15:07 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.65.2. - -Fri May 14 16:40:09 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * vpath.c (construct_vpath_list): In removal loop for DIRPATH==0, - set LASTPATH to PATH, not NEXT. - - * dir.c (read_dirstream): Break out of loop after incrementing - DS->buckets such that it reaches DIRFILE_BUCKETS; avoid trying to - dereference DS->contents->files[DIRFILE_BUCKETS]. - - * read.c (read_makefile): Clear no_targets after reading a - targetful rule line. - - * main.c (main): If print_version_flag is set, exit after printing - the version. - (switches): Change --version docstring to say it exits. - - * make.h [butterfly]: #undef POSIX. - -Wed May 12 15:20:21 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.65.1. - - * arscan.c (ar_scan) [! AIAMAG]: Don't declare LONG_NAME. - [AIAMAG]: Pass TRUNCATE flag arg to (*FUNCTION), always zero. - - * function.c (handle_function): Use fatal instead of - makefile_fatal when reading_filename is nil. - - * configure.in: Add AC_GETGROUPS_T. - * job.c (search_path): Use GETGROUPS_T in place of gid_t. - -Sun May 9 15:41:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.65. - -Fri May 7 18:34:56 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * function.c (handle_function): Fatal for unmatched paren. - -Thu May 6 16:13:41 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.64.3. - - * commands.c (handling_fatal_signal): New variable. - (fatal_error_signal): Set it. - * job.c (reap_children): Avoid nonreentrant operations if that is set. - * make.h: Declare handling_fatal_signal. - - * expand.c (reference_variable): New function, snippet of code - broken out of simple-reference case of variable_expand. - (variable_expand): Use it for simple refs. - (variable_expand): When checking for a computed variable name, - notice a colon that comes before the final CLOSEPAREN. Expand - only up to the colon, and then replace the pending text with a - copy containing the expanded name and fall through to subst ref - handling. - (variable_expand): Don't bother expanding the name if a colon - appears before the first $. - (expand_argument): Use alloca instead of savestring. - (variable_expand): For subst ref, expand both sides of = before - passing to [pat]subst_expand. Use find_percent instead of lindex - to check the lhs for a %. - -Wed May 5 14:45:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.64.2. - -Mon May 3 17:00:32 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * arscan.c (ar_name_equal) [AIAMAG]: Abort if TRUNCATED is nonzero. - - * read.c (read_makefile): Pass extra arg of 1 to parse_file_seq, - not to multi_glob. - -Thu Apr 29 19:47:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.64.1. - - * arscan.c (ar_scan): New local flag var LONG_NAME. Set it when - we read the member name in any of the fashions that allow it to be - arbitrarily long. Pass its negation to FUNCTION. - (describe_member): Take TRUNCATED from ar_scan and print it. - (ar_name_equal): Take new arg TRUNCATED; if nonzero, compare only - the first sizeof (struct ar_hdr.ar_name) chars. - (ar_member_pos): Take TRUNCATED from ar_scan, pass to ar_name_equal. - * ar.c (ar_member_date_1): Likewise. - -Wed Apr 28 21:18:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (reap_children): Before calling start_job_command to start - the next command line, reset C->remote by calling start_remote_job_p. - -Mon Apr 26 15:56:15 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * arscan.c (ar_scan): New local var NAMEMAP. - In loop, rename NAME to NAMEBUF; new var NAME is a pointer; new - flag IS_NAMEMAP. When extracting the member name, always put a - null at its end first. If the name is "//" or "/ARFILENAMES", set - IS_NAMEMAP. If we have already read in NAMEMAP, and NAME looks - like " /N", get full name from NAMEMAP+N. - Else if NAME looks like "#1/N", read N chars from the - elt data to be the full name. At end of loop, if IS_NAMEMAP, read - the elt's data into alloca'd NAMEMAP. - (ar_name_equal): #if 0 truncating code. - - * make.h: Don't declare vfork at all. It returns int anyway, - unless declared it; and we conflicted with some systems. - - * main.c (define_makeflags): If FLAGSTRING[1] is '-', define - MAKEFLAGS to all of FLAGSTRING, not &FLAGSTRING[1]. Don't want to - define it to something like "-no-print-directory". - Use %g format instead of %f for floating-valued things. - -Thu Apr 22 18:40:58 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * GNUmakefile (Makefile.in): Use a substitution ref on nolib-deps - to change remote-%.dep to remote-stub.dep. - -Wed Apr 21 15:17:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.64. - -Fri Apr 16 14:22:22 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (install): Remove - prefix from chgrp+chmod. - - * Version 3.63.8. - -Thu Apr 15 18:24:07 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * acconfig.h: New file; contains "#undef SCCS_GET" for autoheader. - * configure.in: If /usr/sccs/get exists, define SCCS_GET to that, - else to "get". - * default.c (default_variables): Set GET to macro SCCS_GET. - - * read.c (parse_file_seq): Take extra arg STRIP; strip `./' only - if nonzero. I hope this is the last time this argument is added - or removed. - (read_makefile): Pass it 1 when parsing include file names. - Pass it 1 when parsing target file names. - Pass it 1 when parsing static pattern target pattern names. - * rule.c (install_pattern_rule): Pass it 1 when parsing rule deps. - * default.c (set_default_suffixes): Pass it 1 when parsing - default_suffixes. - * function.c (string_glob): Pass it 0 here. - -Wed Apr 14 11:32:05 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * misc.c (log_access): New function. - ({init,user,make,child}_access): Call it. - (child_access): Abort if !access_inited. - - * main.c (switches: --no-print-directory): Use 1 instead of -1 for - single-letter option. - (init_switches, decode_switches, define_makeflags): An option with - no single-letter version is no longer indicated by a value of -1; - instead a value that is !isalnum. - (init_switches): Don't put such switches into the string, only - into the long_option table. - - * make.h [!NSIG] [!_NSIG]: #define NSIG 32. - - * job.c [HAVE_WAITPID]: Remove #undef HAVE_UNION_WAIT. AIX's - bsdcc defined WIF* to use union wait. - - * main.c (struct command_switch): Change member `c' to type int. - (switches): Make const. - (decode_switches): Use `const struct command_switch *'. - (define_makeflags): Likewise. - - * default.c (default_suffix_rules): Add `-o $@' to makeinfo rules. - -Mon Apr 12 12:30:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.63.7. - - * configure.in (AC_HAVE_HEADERS): Check for string.h and memory.h. - Removed AC_MEMORY_H. - * make.h [USG, NeXT]: Don't test these. - [HAVE_STRING_H]: Test this to include string.h and define ANSI_STRING. - [HAVE_MEMORY_H]: Test this instead of NEED_MEMORY_H. - [! ANSI_STRING]: Put decls of bcopy et al here. - [sparc]: Don't test this for alloca.h; HAVE_ALLOCA_H is sufficient. - [HAVE_SIGSETMASK]: Test this rather than USG. - [__GNU_LIBRARY__ || POSIX]: Don't #include again. - * main.c (main): Handle SIGCHLD if defined, and SIGCLD if defined. - It doesn't hurt to do both if they are both defined, and testing - USG is useless. - * dir.c: Rationalize directory header conditionals. - * arscan.c [HAVE_FCNTL_H]: Test this rather than USG || POSIX. - - * default.c (default_suffixes): Add `.txinfo'. - (default_suffix_rules): Add `.txinfo.info' and `.txinfo.dvi' rules. - - * variable.c (try_variable_definition): Replace RECURSIVE flag - with enum FLAVOR, which can be simple, recursive, or append. - Recognize += as append flavor. Set new variable VALUE in a switch - on FLAVOR. For append flavor, prepend the variable's old value. - If the variable was previously defined recursive, set FLAVOR to - recursive; if it was defined simple, expand the new value before - appending it to the old value. Pass RECURSIVE flag to - define_variable iff FLAVOR == recursive. - - * variable.c (try_variable_definition): Use alloca and bcopy for - NAME, instead of savestring. Might as well use stack storage - since we free it immediately anyway. - -Thu Apr 8 18:04:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (start_waiting_jobs): Move decl of JOB outside of loop. - - * main.c (define_makeflags): Rename `struct flag' member `switch' - to `cs', which is not a reserved word. - -Wed Apr 7 15:30:51 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (new_job): Call start_waiting_jobs first thing. - (start_waiting_job): Changed return type from void to int. - Return 0 when putting the child on the waiting_jobs chain. - (start_waiting_jobs): Don't check load and job_slots here. - Always take a job off the chain and call start_waiting_job on it; - give up and return when start_waiting_job returns zero. - - * main.c (define_makeflags: struct flag): Change member `char c' to - `struct command_switch *switch'. - (ADD_FLAG): Set that to CS instead of CS->c. - If CS->c is -1, increment FLAGSLEN for the long name. - When writing out FLAGS, handle FLAGS->switch->c == -1 and write - the long name instead. - - * compatMakefile (stamp-config): New target of old config.h rule. - Touch stamp-config after running config.status. - (config.h): Just depend on stamp-config, and have empty commands. - -Mon Apr 5 20:14:02 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c [HAVE_WAITPID]: #undef HAVE_UNION_WAIT. - - * configure.in (AC_HAVE_FUNCS): Check for psignal. - -Fri Apr 2 17:15:46 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (long_option_aliases): Remove "new"; it is already an - unambiguous prefix of "new-file". - -Sun Mar 28 16:57:17 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.63.6. - -Wed Mar 24 14:26:19 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * vpath.c (selective_vpath_search): When adding the - name-within-directory at the end of NAME, and we don't add a - slash, don't copy FILENAME in one char too far into NAME. - - * variable.c (define_automatic_variables): Find default_shell's - length with strlen, not numerology. - -Wed Mar 17 20:02:27 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (define_makeflags): Add the elts of a string option in - reverse order, so they come out right when reversed again. - -Fri Mar 12 15:38:45 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (make.info): Use `-o make.info'. - -Thu Mar 11 14:13:00 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (REMOTE): Set to @REMOTE@; change comments to - reflect new use. - (objs): Replace remote.o with remote-$(REMOTE).o. - (srcs): Replace remote.c with remote-$(REMOTE).c. - (remote.o): Rule removed. - - * configure.in (REMOTE): Subst this in Makefile et al; default "stub". - Use AC_WITH to grok --with-customs arg to set REMOTE=cstms. - * GNUmakefile (build.sh.in): Filter out remote-% from objs list. - * build.template (REMOTE): New var; set to @REMOTE@. - (objs): Add remote-${REMOTE}.o. - -Wed Mar 10 15:12:24 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.63.5. - - * implicit.c (pattern_search): Fix "dependent"->"dependency" in - "Rejecting impossible" -d msg. - - * file.c (file_hash_enter): New local vars {OLD,NEW}BUCKET. Store - mod'd values there; never mod {OLD,NEW}HASH. - -Mon Mar 8 13:32:48 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * remake.c [eta10]: Include instead of . - - * compatMakefile (VPATH): Set this to @srcdir@. - (srcdir): Set this to $(VPATH). - - * main.c (main): New local var DIRECTORY_BEFORE_CHDIR. Save in it - a copy of CURRENT_DIRECTORY after the first getcwd. Use it - instead of CURRENT_DIRECTORY when chdir'ing back before re-execing. - - * remake.c (notice_finished_file): Pass missing SEARCH arg to f_mtime. - - * read.c (read_makefile): Remove extraneous arg to parse_file_seq. - -Mon Feb 22 14:19:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile ($(infodir)/$(instname).info): Use , instead of / - as the sed delimiter char. - -Sun Feb 21 14:11:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.63.4. - - * rule.h (struct rule): Removed `subdir' member. - * rule.c (new_pattern_rule): No need to clear it. - (count_implicit_rule_limits): Set the `changed' flag in each dep - that refers to a nonexistent directory. No longer set rule-global - `subdir' flag with that information. - (print_rule_data_base): Don't record info on `subdir' flags. - - * implicit.c (pattern_search): Check the DEP->changed flag rather - than the (now gone) RULE->subdir flag. Also test CHECK_LASTSLASH; - if it is set, the file might exist even though the DEP->changed - flag is set. - - * rule.c (count_implicit_rule_limits): Pass "", not ".", as file - name arg to dir_file_exists_p to check for existence of directory. - - * implicit.c (pattern_search): Inside dep-finding loop, set - CHECK_LASTSLASH from the value recorded in CHECKED_LASTSLASH[I], - rather than computing it anew. - - * commands.c (set_file_variables): Must alloca space for PERCENT - and copy it, to avoid leaving the trailing `)' in the value. - - * misc.c (remove_comments): Fixed backslash-checking loop - condition to allow it to look at the first char on the line. - P2 >= LINE, not P2 > LINE. - - * compatMakefile ($(bindir)/$(instname)): Before moving $@.new to - $@, rm $@.old and mv $@ to $@.old. - - * variable.c (try_variable_definition): Take new args FILENAME and - LINENO. Fatal if the variable name is empty. - * read.c (read_makefile): Change callers. - * main.c (main): Likewise. - - * compatMakefile (group): Define to @KMEM_GROUP@, autoconf magic - that configure will replace with the group owning /dev/kmem. - -Mon Feb 8 14:26:43 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * vpath.c (vpath_search): Take second arg MTIME_PTR, pass thru to - selective_vpath_search. - (selective_vpath_search): Take second arg MTIME_PTR. - If the dir cache thinks a file exists, stat it to make sure, and - put the modtime in *MTIME_PTR. - * remake.c (library_search): Take second arg MTIME_PTR. - When we find a match, record its mtime there. - Pass MTIME_PTR through to vpath_search to do same. - (f_mtime): Pass &MTIME as new 2nd arg to {vpath,library}_search; - store it in FILE->last_mtime if set nonzero. - * implicit.c (pattern_search): Pass nil 2nd arg to vpath_search. - - * compatMakefile (remote.o): Prepend `$(srcdir)/' to `remote-*.c', - so globbing looks somewhere it will find things. - - * compatMakefile ($(infodir)/$(instname).info): Install `make.info*' - not `$(srcdir)/make.info*'; no need to use basename. - -Fri Feb 5 12:52:43 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.63.3. - - * compatMakefile (install): Add missing ;\s. - - Make -, @, and + prefixes on a pre-expanded command line affect - all lines in the expansion, not just the first. - * commands.h (struct commands): Replace `lines_recurse' member - with `lines_flags'. - (COMMANDS_{RECURSE,SILENT,NOERROR}): New macros, bits to set in - that flag byte. - * commands.c (chop_commands): Set `lines_flags' instead of - `lines_recurse'. Record not only + but also @ and - prefixes. - * remake.c (notice_finished_file): Check the COMMANDS_RECURSE bit - in FILE->cmds->lines_flags, rather than FILE->cmds->lines_recurse. - * job.c (start_job_command): Replaced RECURSIVE and NOPRINT local - var with FLAGS; initialize it to the appropriate `lines_flags' byte. - Set CHILD->noerror if the COMMANDS_NOERROR bit is set in FLAGS. - Set the COMMANDS_SILENT bit in FLAGS for a @ prefix. - - * remake.c (update_goal_chain): Set G->file to its prev after - checking for G being finished, since that check needs to examine - G->file. - - * configure.in (union wait check) [HAVE_WAITPID]: Try using - waitpid with a `union wait' STATUS arg. If waitpid and union wait - don't work together, we should not use union wait. - - * Version 3.63.2. - - * remake.c (update_goal_chain): When G->file->updated, move - G->file to its prev. We aren't finished until G->file is nil. - -Thu Feb 4 12:53:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (starting_directory): New global variable. - (main): Set it to cwd after doing -Cs. - (log_working_directory): Use it, rather than computing each time. - * make.h: Declare it. - - * compatMakefile (SHELL): Define to /bin/sh for losing Unix makes. - - * main.c (decode_env_switches): Allocate (1 + LEN + 1) words for - ARGV, rather than LEN words plus one byte. - -Wed Feb 3 18:13:52 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile ($(bindir)/$(instname)): Put - before - install_setgid command line, so its failure won't be an error. - (infodir): New variable. - (install): Depend on $(infodir)/$(instname).info. - ($(infodir)/$(instname).info): New target. - - * read.c (read_makefile): If FILENAMES is nil when we see a line - starting with a tab, don't treat it as a command. Just fall - through, rather than giving an error. - - * read.c (read_makefile): If the NO_TARGETS flag is set when we see a - command line, don't clear it before continuing. We want - subsequent command lines to be ignored as well. - - * job.c (new_job): Before expanding each command line, collapse - backslash-newline combinations that are inside var or fn references. - -Mon Feb 1 16:00:13 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (exec_prefix): Default to $(prefix), not /usr/local. - - * compatMakefile (make.info): Pass -I$(srcdir) to makeinfo. - - * job.c [POSIX] (unblock_sigs): Made global. - [!POSIX] (unblock_sigs): Move defns to job.h. - * job.h [POSIX] (unblock_sigs): Declare. - -Sun Jan 31 19:11:05 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * read.c (read_makefile): In vpath parsing, after finding the - pattern token, take entire rest of line as the search path, not - just the next token. - - * compatMakefile (remote.o): Depend on remote-*.c. - -Thu Jan 28 16:40:29 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * commands.c (set_file_variables): Don't define any F or D versions. - * variable.c (define_automatic_variables): Define them here as - recursively-expanded variables that use the dir and notdir funcs. - - * variable.c (target_environment): In v_default case, don't export - o_default or o_automatic variables. - - * configure.in (union wait check): Remove ` and ' inside C code; - they confuse the shell script. - -Mon Jan 25 13:10:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.63.1. - - * vpath.c (construct_vpath_list): When skipping further processing - of an elt that is ".", don't also skip the code that pushes P past - the next separator. - - * compatMakefile (distclean): Don't remove make-*. - - * configure.in (HAVE_UNION_WAIT): Try to use WEXITSTATUS if it's - defined. If one cannot use WEXITSTATUS with a `union wait' - argument, we don't want to believe the system has `union wait' at all. - - * remake.c (update_file): Do nothing to print "up to date" msgs. - (update_goal_chain): Do it here instead. - Use the `changed' flag of each goal's `struct dep' to keep track - of whether files_remade (now commands_started) changed around a - call to update_file for that goal. - When a goal is finished, and its file's update_status is zero (i.e., - success or nothing done), test the `changed' flag and give an "up - to date" msg iff it is clear. - * make.h (files_remade): Renamed to commands_started. - * remake.c: Changed defn. - (update_goal_chain): Changed uses. - * job.c (start_job_command): Increment commands_started here. - (reap_children): Not here. - - * remake.c (update_goal_chain): Don't do anything with files' - `prev' members. update_file now completely handles this. - - * variable.c (target_environment): Don't expand recursive - variables if they came from the environment. - - * main.c (define_makeflags): For flags with omitted optional args, - store {"", 0} with ADD_FLAG. When constructing FLAGSTRING, a flag - so stored cannot have more flags appended to the same word. - -Fri Jan 22 14:46:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * variable.c (print_variable_set): In vars/bucket calculation, - don't spuriously multiply by 100. - - * Version 3.63. - - * job.c [!HAVE_UNION_WAIT] (WTERMSIG, WCOREDUMP, WEXITSTATUS): - Don't define if already defined. - - * remake.c (update_file): Don't keep track of the command_state before - calling update_file_1. Remove local variable COMMANDS_FINISHED, - and don't test it to decide to print the "is up to date" msg. - Testing for files_remade having changed should always be sufficient. - The old method lost when we are called in the goal chain run on a - makefile, because the makefile's command_state is already - `cs_finished' from the makefile chain run. - - * misc.c [HAVE_SETRE[GU]ID]: Test these to decl setre[gu]id. - - * configure.in: Rewrote wait checking. - Use AC_HAVE_HEADERS to check for . - Use AC_HAVE_FUNCS to check for waitpid and wait3. - Use a compile check to test just for `union wait'. - * job.c: Rewrote conditionals accordingly. - [HAVE_WAITPID]: Test this only to define WAIT_NOHANG. - [HAVE_WAIT3]: Likewise. - [HAVE_UNION_WAIT]: Test this to define WAIT_T and W*. - - * configure.in: Set CFLAGS and LDFLAGS before all checks. - - * dir.c: Add static forward decls of {open,read}_dirstream. - -Thu Jan 21 17:18:00 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.31. - - * job.c [NGROUPS_MAX && NGROUPS_MAX==0]: #undef NGROUPS_MAX. - - * compatMakefile (CFLAGS, LDFLAGS): Set to @CFLAGS@/@LDFLAGS@. - * build.template (CFLAGS, LDFLAGS): Same here. - * configure.in: AC_SUBST(CFLAGS) and LDFLAGS. - Set them to -g if not defined in the environment. - - * remake.c (library_search): Use LIBNAME consistently, setting it - only once, to be the passed name sans `-l'. - Pass new var FILE to be modified by vpath_search. - -Mon Jan 18 14:53:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.30. - - * job.c (start_waiting_jobs): Return when job_slots_used is equal to - job_slots. - - * configure.in: Add AC_CONST for the sake of getopt. - - * read.c (read_makefile): Continue after parsing `override' - directive, rather than falling through to lossage. - Check for EOL or blank after "override define". - - * compatMakefile (.c.o, remote.o): Put $(CFLAGS) after other switches. - -Fri Jan 15 12:52:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.29. - - * main.c (define_makeflags): After writing everything into - FLAGSTRING, only back up two chars if [-1] is a dash, meaning we - just wrote " -". Always terminate the string at *P. - - * remake.c (library_search): When constructing names in std dirs, - use &(*LIB)[2] for the stem, not LIBNAME (which points at the - buffer we are writing into!). - -Thu Jan 14 13:50:06 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Set IN_IGNORED_DEFINE for "override - define" when IGNORING is true. - - * compatMakefile (distclean): Remove config.status and build.sh. - -Wed Jan 13 16:01:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.28. - - * misc.c (xmalloc, xrealloc): Cast result of malloc/realloc to - (char *). - - * arscan.c (ar_scan) [AIAMAG]: Cast read arg to (char *). - - * variable.c (define_automatic_variables): Override SHELL value for - origin o_env_override as well as o_env. - - * GNUmakefile (build.sh.in): Don't replace %globobjs%. Instead, - add the names of the glob objects (w/subdir) to %objs%. - * build.template (globobjs): Removed. - Take basename of $objs before linking. - -Tue Jan 12 12:31:06 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.27. - - * configure.in (AC_OUTPUT): Also edit build.sh. - * build.template: New file. - * GNUmakefile (build.sh.in): New rule to create it from build.template. - (make-$(version).tar.Z): Depend on build.sh.in. - - * main.c (die): Call print_data_base if -p. - (main): Don't call it here. - - * compatMakefile (defines): Add @DEFS@. configure should turn this - into -DHAVE_CONFIG_H. - -Mon Jan 11 14:39:23 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.26. - - * misc.c (init_access): Surround with #ifdef GETLOADAVG_PRIVILEGED. - ({make,user,child}_access) [! GETLOADAVG_PRIVILEGED]: Make no-op. - * compatMakefile (install_setgid): New var, set by configure. - (install): Install setgid $(group) only if $(install_setgid) is true. - -Fri Jan 8 15:31:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (load_too_high): If getloadavg fails with errno==0, give a - message saying that load limits are not supported. - - * vpath.c (construct_vpath_list): Rewrote path deletion code to - not try to use PATH's next link after freeing PATH. - - * main.c (define_makeflags): Rewritten; now handles string-valued - option, and has no arbitrary limits. - (switches): Set `toenv' flag for -I and -v. - - * main.c (decode_env_switches): Cast return value of alloca to char *. - - * misc.c (child_access) [HAVE_SETREUID, HAVE_SETREGID]: Use - setre[gu]id in place of set[gu]id. - -Wed Jan 6 15:06:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (main): Define MAKEOVERRIDES, MAKE, and MAKE_COMMAND with - origin o_default. - - * make.h [POSIX]: Don't test this to use ANSI_STRING. - Testing STDC_HEADERS should be sufficient. - - * job.h: Declare start_waiting_jobs. - - * read.c (read_makefile): Add missing parens in if stmt that find - conditional directives. - - * main.c (main): Declare init_dir. - * implicit.c (pattern_search): Always use two % specs in a - DEBUGP2, and always pass two non-nil args. - Cast field width args to int. - Add missing parens in !RULE->subdir if stmt. - * function.c (expand_function, patsubst_expand): Add parens around - assignments inside `while' stmts. - * commands.c (print_commands): Cast field width args to int. - - * read.c (do_define): Cast return value of alloca to (char *). - - * main.c (init_switches): New function, broken out of decode_switches. - (decode_switches): Take new arg ENV. If set, ignore non-option - args; print no error msgs; ignore options with clear `env' flags. - (decode_env_switches): Rewritten to chop envar value into words - and pass them to decode_switches. - (switches): Set `env' flag for -I and -v. - - * dir.c (init_dir): Cast free to __glob_closedir_hook's type. - -Tue Jan 5 14:52:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.25. - - * job.c [HAVE_SYS_WAIT || !USG]: Don't #include and - . interacts badly with , and - we don't need these anyway. - - * configure.in (AC_HAVE_FUNCS): Check for setre[gu]id. - * misc.c ({user,make}_access): Test #ifndef HAVE_SETRE[GU]ID, not - #ifdef POSIX || USG. SunOS 4.1 is supposedly POSIX.1 compliant, - but its set[gu]id functions aren't; its setre[gu]id functions work. - - * misc.c ({user,make,child}_access): Give name of caller in error msgs. - - * job.c (load_too_high): Say "cannot enforce load limit" in error msg. - - * configure.in: Call AC_PROG_CC. - * compatMakefile (CC): Define to @CC@ (autoconf magic). - - * compatMakefile: Add .NOEXPORT magic target. - -Mon Jan 4 17:00:03 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (print_version): Updated copyright to include 93. - -Thu Dec 31 12:26:15 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * make.h [_AIX]: Don't declare alloca. - -Tue Dec 29 13:45:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.24. - - * compatMakefile (objs): Add signame.o. - (srcs): Add signame.[ch]. - - * compatMakefile (srcs): Add config.h.in. - (remote.o): Add -I. before -I$(srcdir). - -Mon Dec 28 15:51:26 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.23. - - * read.c (readline): Fatal when LEN==0, indicating a line starting - with a NUL. - (readline): Take new arg LINENO, for use in error msg. - (read_makefile, do_define): Pass it. - - * compatMakefile (glob/libglob.a): Pass -DHAVE_CONFIG_H in CPPFLAGS. - (.c.o): Add -I. before -I$(srcdir). - -Wed Dec 23 12:12:04 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Accept and ignore a rule with no targets. - - * compatMakefile (ALLOCA_SRC): New variable. - (srcs): Include its value. - - * read.c (struct conditional): Renamed member `max_ignoring' to - `allocated'; added new member `seen_else'. - (conditional_line): Initialize seen_else flag when starting an `if...'; - set it when we see an `else'; fatal if set when we see `else'. - (read_makefile): Fatal "missing `endif'" if there are any pending - conditionals, not just if we are still ignoring. - -Tue Dec 22 15:36:28 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (manext): Set to 1, not l. - ($(mandir)/$(instname).$(manext)): Use $(srcdir) for make.man in cmds. - - * file.c (file_hash_enter): Don't call uniquize_deps here. - * read.c (record_files): Likewise. - * implicit.c (pattern_search): Likewise. - * commands.c (set_file_variables): Call it only here. - - * default.c (default_variables) [__convex__]: FC=fc. - - * variable.c (target_environment): Expand the values of recursively - expanded variables when putting them into the environment. - * expand.c (recursively_expand): Made global. - * make.h (recursively_expand): Declare it. - - * remake.c (check_dep): Set FILE->command_state to cs_deps_running - when a dep's command_state is cs_running or cs_deps_running. - - * read.c (read_makefile): Changed error msg for spurious cmds to - not say "first target". - -Sun Dec 20 17:56:09 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * configure.in: Do AC_CONFIG_HEADER right after AC_INIT. - * make.h (HAVE_CONFIG_H): #include "config.h", then #define this. - * compatMakefile (config.h, configure, config.h.in): New rules. - (defines): Removed @DEFS@. - -Thu Dec 17 16:11:40 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (realclean): Just depend on distclean; no cmds. - (distclean): Do what realclean did before; also remove Makefile and - config.h; don't remove configure. - (info, dvi): New targets; depend on make.{info,dvi}. - (doc): Removed target. - (MAKEINFO, TEXI2DVI): New vars. - (make.info, make.dvi): Use them instead of explicit cmds. - -Wed Dec 16 16:25:24 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * configure.in: Added fcntl.h to AC_HAVE_HEADERS. getloadavg cares. - -Wed Dec 9 15:21:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (long_option_aliases): Add --new-file alias for -W. - - * default.c (default_variables): Change all C++ to CXX and C++FLAGS - to CXXFLAGS. - - * read.c (do_define): Expand the variable name before using it. - - * main.c (main): Define variable "MAKE_COMMAND" to argv[0]; - define "MAKE=$(MAKE_COMMAND) $(MAKEOVERRIDES)" always. - - * remake.c (library_search): Search for libNAME.a in cwd; look in - vpath before looking in standard dirs, not after. - Changed order of std dirs to: /lib, /usr/lib, ${prefix}/lib. - -Mon Nov 23 14:57:34 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * default.c (default_pattern_rules, default_terminal_rules): Added - brackets around initializers. - - * variable.c (try_variable_definition): Don't check for LINE[0]=='\t'. - (try_variable_definition): Expand the name before defining the var. - - * job.c (init_siglist): Removed function. - Removed decl of `sys_siglist'. - * make.h [! HAVE_SYS_SIGLIST]: #include "signame.h". - [HAVE_SYS_SIGLIST && !SYS_SIGLIST_DECLARED]: Declare sys_siglist - only under these conditions. - * main.c (main): Don't declare init_siglist. - (main) [! HAVE_SYS_SIGLIST]: Call signame_init instead of init_siglist. - -Wed Nov 18 14:52:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (record_files): Don't try to append to FIRSTDEPS if it's - nil; instead just set it to MOREDEPS. - -Mon Nov 16 17:49:17 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * vpath.c (construct_vpath_list): Initialize P to DIRPATH before - loop that sets MAXELEM. - -Fri Nov 13 18:23:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.22. - -Thu Nov 12 15:45:31 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (start_job_command): Under -n, increment files_remade after - processing (i.e., printing) all command lines. - -Tue Nov 10 15:33:53 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * read.c (record_files): Append new deps if this rule has no - commands; prepend them to existing deps if this rule has no commands. - - * dir.c (open_dirstream): Return nil if DIR->contents->files is nil. - - * read.c (parse_file_seq): Removed last arg STRIP. Always strip `./'s. - (read_makefile): Changed callers. - * function.c (string_glob): Likewise. - * rule.c (install_pattern_rule): Likewise. - -Mon Nov 9 17:50:16 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * remake.c (files_remade): Made global. - (notice_finished_file): Don't increment files_remade here; this - function gets called in many situations where no remaking was in - fact done. - * job.c (reap_children): Do it here instead, when we know that - actual commands have been run for the file. - * make.h (files_remade): Declare it. - -Thu Nov 5 18:26:10 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * vpath.c (construct_vpath_list): Allow blanks as well as colons to - separate elts in the search path. - - * read.c (read_makefile): Don't fatal on extra tokens in `vpath'. - The search path can contain spaces now. - -Tue Nov 3 20:44:32 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (check): New target; no-op. - - * file.c (file_hash_enter): Mod OLDHASH by FILE_BUCKETS after - testing for OLDHASH==0 but before using the value. - (rename_file): Don't mod OLDHASH by FILE_BUCKETS before passing it - to file_hash_enter. - - * file.c (rename_file): Notice when OLDFILE->cmds came from - default.c, and don't try to print ->filename in that case. - -Sun Oct 25 01:48:23 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * remake.c (update_file): Don't process F->also_make here. - (notice_finished_file): Don't process FILE->also_make if no attempt - to update FILE was actually made. - Fixed to call f_mtime directly to refresh their modtimes. - -Sat Oct 24 22:08:59 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (find_percent): Don't increment P again after skipping - an escaped %. - - * expand.c (variable_expand): In call to patsubst_expand, don't - find `%'s ourselves; let that function do it. - - * read.c (read_makefile: record_waiting_files): Don't call - record_files if FILENAMES is nil. - (read_makefile): All alternatives in the parsing, except for rule - lines, fall through to the end of the loop. At the end of the - loop, do record_waiting_files so we notice later spurious cmds. - -Fri Oct 23 15:57:37 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * variable.c (define_automatic_variables): Free old value of SHELL - before replacing it. - -Thu Oct 15 18:57:56 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (.c.o): Add -I$(srcdir)/glob to flags. - - * dir.c (open_dirstream): Cast return value to __ptr_t. - - * default.c (default_variables: "GET") [_IBMR2]: Use USG defn. - - * make.h (MAXPATHLEN): Moved out of #ifndef POSIX. - (GET_PATH_MAX): Moved from #ifdef POSIX to #ifdef PATH_MAX #else. - Define as (get_path_max ()). - [! PATH_MAX] (NEED_GET_PATH_MAX): Define. - [! PATH_MAX] (get_path_max): Declare fn. - * misc.c [NEED_GET_PATH_MAX] (get_path_max): New function. - -Mon Oct 12 13:34:45 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.21. - - * job.c (sys_siglist): Only declare #ifndef SYS_SIGLIST_DECLARED. - * make.h [! HAVE_SYS_SIGLIST && HAVE__SYS_SIGLIST]: #define - SYS_SIGLIST_DECLARED. - - * dir.c (file_impossible): When initializing DIR->contents, set - DIR->contents->dirstream to nil. - - * compatMakefile (GLOB): Define new variable. - (objs): Use it, rather than glob/libglob.a explicitly. - - * read.c (parse_file_seq): When stripping "./", handle cases like - ".///foo" and "./////". - * file.c (lookup_file, enter_file): Likewise. - -Sun Oct 11 17:00:35 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * dir.c (struct dirstream, {open,read}_dirstream): New - data type and functions to read a directory sequentially. - (init_dir): New function to hook it into glob. - * main.c (main): Call init_dir. - - * compatMakefile (objs): Added glob/libglob.a. - * configure.in: Remove code to test for glob. - -Fri Oct 9 12:08:30 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (record_files): Generalized test for NAME pointing - somewhere into F->name. - - * variable.c (define_variable_in_set): Free old value when replacing. - - * read.c (do_define): Free the linebuffer before returning. - (record_files): When clearing .SUFFIXES deps, free their data. - (multi_glob): Free OLD and its data when replacing it with results - of glob run. - - * commands.c (set_file_variables): Use alloca in place of xmalloc - for temp space for $^, $?, et al. - - * dir.c (struct directory): New member `contents' replaces `files' - and `dirstream'. - (struct directory_contents): New type. - (directories_contents): New hash table. - (dir_struct_file_exists_p): Take a struct directory_contents. - (dir_file_exists_p): Pass it the `contents' member of the dir found. - (dir_struct_file_exists_p): Renamed to dir_contents_file_exists_p; - made static. Return 0 if DIR is nil (meaning it couldn't be stat'd). - (dir_file_exists_p, find_directory): Change all callers. - (file_impossible): Use DIR->contents, initializing it if nil. - (print_dir_data_base): Use DIR->contents, and print out device and - inode numbers with each directory. - - * Changes for performance win from John Gilmore : - * dir.c (DIRECTORY_BUCKETS): Increase to 199. - (DIRFILE_BUCKETS): Decrease to 107. - (find_directory): Allocate and zero a multiple of - sizeof (struct dirfile *), not of sizeof (struct dirfile). - (dir_struct_file_exists_p): New function, nearly all code from - dir_file_exists_p. - (dir_file_exists_p): Just call find_directory+dir_struct_file_exists_p. - * vpath.c (selective_vpath_search): Remove redundant - dir_file_exists_p call. - - * configure.in: Comment out glob check; always use our code. - -Fri Oct 2 19:41:20 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * make.h [! HAVE_SYS_SIGLIST && HAVE__SYS_SIGLIST]: #define - HAVE_SYS_SIGLIST; after doing #define sys_siglist _sys_siglist, we - do have it. - -Wed Sep 30 19:21:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (main): Don't do -w automatically if -s. - -Tue Sep 29 21:07:55 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (printed_version): Move variable inside print_version. - (print_version): Return immediately if printed_version is set. - (die): Don't test printed_version here. - (decode_switches): Under -v, do print_version before giving usage. - (DESCRIPTION_COLUMN): New macro. - (decode_switches): Use it when printing the usage message. - Leave at least two spaces between options and their descriptions. - -Fri Sep 25 13:12:42 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.20. - -Wed Sep 16 16:15:22 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * read.c (read_makefile): Save errno value from trying to open - FILENAME, and restore it before erring; otherwise we get the errno - value from the last elt of the search path. - -Tue Sep 15 15:12:47 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (long_option_aliases): Add --stop for -S. - - * read.c (word1eq): Do strncmp before dereferencing someplace that - may be out in space. - -Wed Sep 9 15:50:41 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * remake.c (notice_finished_file): If all the command lines were - recursive, don't do the touching. - - * job.c (start_job_command): Don't check for + here. - * commands.c (chop_commands): Do it here instead. - - * default.c (default_terminal_rules): Prepend + to cmds for RCS. - -Wed Sep 2 17:53:08 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (objs): Include $(ALLOCA). - - * make.h [CRAY]: Move #define signal bsdsignal to before #includes. - -Thu Aug 27 17:45:43 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * read.c (default_include_directories): Add INCLUDEDIR first. - * compatMakefile (includedir): Define. - (defines): Add -D for INCLUDEDIR="$(includedir)". - - * read.c (read_makefile): Grok multiple files in `include'; - globbing too. - - * remake.c (library_search): New function. - (library_file_mtime): Remove function. - (f_mtime): Use library_search instead of library_file_mtime. - * compatMakefile (libdir): Define. - (defines): Add -D for LIBDIR="$(libdir)". - * make.texinfo (Libraries/Search): Document change. - - * file.c (rename_file): Fix file_hash_enter call with missing arg. - -Wed Aug 26 17:10:46 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.19. - - * main.c (main): Set command_state to cs_finished for temp files - made for stdin makefiles. - - * main.c (decode_switches): Don't tell getopt to return non-option - args in order. - Ignore an argument of `-'. - -Thu Aug 20 13:36:04 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * job.c (start_job_command): If (touch_flag && !RECURSIVE), ignore - the command line and go to the next. - (notice_finished_file): Under -t, touch FILE. - * remake.c (remake_file): Don't touch it here. - -Wed Aug 19 16:06:09 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * function.c (pattern_matches): Use temporary for strlen (WORD) - instead of two function calls. - - * compatMakefile (LOAD_AVG): Remove variable and comments. - -Tue Aug 18 14:58:58 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * make.texinfo (Running): Node renamed to `make Invocation'. - -Fri Aug 14 12:27:10 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * arscan.c (ar_name_equal): Don't compare [MAX-3..MAX] if - NAMELEN != MEMLEN. - -Thu Aug 13 17:50:09 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.18. - - * main.c: Don't #include ; make.h already does. - -Mon Aug 10 17:03:01 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * implicit.c (pattern_search): Fixed copying of suffix when building - also_make elts. - - * function.c (expand_function: `shell'): Make sure BUFFER is - null-terminated before replacing newlines. - - * compatMakefile (mandir): Use man$(manext), not always manl. - -Sun Aug 2 01:42:50 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * rule.c (new_pattern_rule): Not static. - * rule.h: Declare it. - - * file.c (file_hash_enter): New function, most code from rename_file. - (rename_file): Call it. - * file.h (file_hash_enter): Declare it. - - * dep.h: Doc fix. - -Thu Jul 30 15:40:48 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (decode_switches): Handle usage_and_exit when building - long options vector. - - * default.c (default_terminal_rules): Make RCS rules use $(CHECKOUT,v). - (default_variables): Define CHECKOUT,v (hairy). - - * make.h [!HAVE_SYS_SIGLIST && HAVE__SYS_SIGLIST]: #define - sys_siglist to _sys_siglist. - -Sun Jul 26 16:56:32 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * NEWS: Add header and tail copyright info like Emacs NEWS. - - * make.h [ANSI_STRING]: Don't #define index, rindex, bcmp, bzero, - bcopy if already #define'd. - [STDC_HEADERS] (qsort, abort, exit): Declare here. - [! __GNU_LIBRARY__ && !POSIX]: Not here. - - * make.h [_AIX]: #pragma alloca first thing. - - * job.c (start_waiting_job): Set the command_state to cs_running - when we queue a job on waiting_jobs. - -Fri Jul 24 02:16:28 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * variable.c (define_automatic_variables): Use "" instead of nil - for empty value. - -Thu Jul 23 22:31:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.17. - - * main.c (struct command_switch.type): Add alternative usage_and_exit. - (command_switches): Add -h/--help. - -Thu Jul 16 14:27:50 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * GNUmakefile (make-$(version).tar.Z): Include NEWS, not CHANGES. - * README.template: Mention NEWS. - * CHANGES: Renamed to NEWS. - - * main.c [! STDC_HEADERS] [sun]: Don't declare exit. - -Tue Jul 14 18:48:41 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (main): Set -o files' command_states to cs_finished. - - * rule.c (count_implicit_rule_limits): Decrement num_pattern_rules - when tossing a rule. - - * main.c (main): Use alloca only in simple local var assignment, - for braindead SGI compiler. - - * rule.c (print_rule_data_base): Barf if num_pattern_rules is - inconsistent with the number computed when listing them. - -Mon Jul 13 17:51:53 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * commands.c (set_file_variables): For $? and $^ elts that are archive - member refs, use member name only. - -Fri Jul 10 00:05:04 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * variable.h (struct variable.export): Add new alternative v_ifset. - * variable.c (target_environment): Check for it. - (define_automatic_variables): Set it for MAKEFILES. - -Thu Jul 9 21:24:28 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (objs): Remove getloadavg.o; $(extras) gets it. - (remote.o): Use $(srcdir)/remote.c, not $remote.c<. - (distclean, mostlyclean): New targets. - -Tue Jul 7 19:12:49 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.16. - - * compatMakefile (config.status): Remove rule. - - * job.c (start_waiting_job): Free C after using C->file, not before. - -Sat Jul 4 20:51:49 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * commands.c, job.c, main.c, make.h, remote-cstms.c: Use #ifdef - HAVE_* instead of #ifndef *_MISSING. - * configure.in: Use AC_HAVE_FUNCS instead of AC_MISSING_FUNCS (gone). - -Thu Jul 2 18:47:52 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * main.c (main): makelevel>0 or -C implies -w. - -Tue Jun 30 20:50:17 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * file.c, job.c, function.c: Don't #include . - make.h: Do it here instead. - * arscan.c (ar_member_touch): Don't declare errno. - -Thu Jun 25 17:06:55 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * GNUmakefile (make-$(version).tar.Z): Depend on INSTALL, configure.in. - - * remake.c (update_file): If commands or deps are running after - update_file_1 returns, break out of the :: rule (->prev) loop and - just return. - - * job.c (job_next_command): New function; code from start_job. - (start_job_command): Renamed from start_job. Call job_next_command - and recurse for empty command lines and -n. - (start_waiting_job): Call start_job_command, not start_job. - (new_job): Call job_next_command to prime the child structure, and - then call start_waiting_job. - (reap_children): Use job_next_command and start_job_command. - (start_waiting_job): Call start_remote_job_p here, and store its - result in C->remote. If zero, check the load average and - maybe put C on waiting_jobs. - (start_job_command): Test CHILD->remote rather than calling - start_remote_job_p. Don't do load avg checking at all here. - - * main.c (main): Don't handle SIGILL, SIGIOT, SIGEMT, SIGBUS, - SIGSEGV, SIGFPE or SIGTRAP. - - * compatMakefile (glob/libglob.a): Don't pass srcdir to sub-make. - configure will set it in glob/Makefile. - -Wed Jun 24 19:40:34 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * dir.c [DIRENT] (direct): Don't define to dirent. - [! DIRENT] (direct): Define to dirent. - (dir_file_exists_p): Use struct dirent instead of struct direct. - - * make.h (getcwd): No space between macro and ( for args! - - * job.c (start_job): Don't put the job on waiting_jobs if - job_slots_used==0. - - * make.texinfo (Missing): Shortened title. - -Tue Jun 23 18:42:21 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * file.c (remove_intermediates): Print "rm" commands under -n. - -Mon Jun 22 16:20:02 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.15. - -Fri Jun 19 16:20:26 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * arscan.c [M_UNIX]: #undef M_XENIX. - -Wed Jun 17 17:59:28 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * default.c (default_terminal_rules): Put @ prefix on RCS cmds. - -Tue Jun 16 19:24:17 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile (getloadavg.o): Removed special rule. - (CFLAGS): Don't include $(defines). - (.c.o): Define suffix rule. - (glob/libglob.a): Pass CPPFLAGS=$(defines) to submake. - (GETOPT_SRC, srcs, tagsrcs): Prefix files with $(srcdir)/. - - * arscan.c (ar_name_equal): Moved local vars inside #if'd block. - - * make.h (max): Removed. - * expand.c (variable_buffer_output): Don't use it. - - * compatMakefile (INSTALL): Define. - (Makefile): New rule to make from Makefile.in. - (srcdir): Define. - (VPATH): Define. - (getloadavg.o, remote.o): Use autoconf $foo< hack. - - * commands.c (fatal_error_signal): Removed return. - -Mon Jun 15 17:42:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.14. - - * make.texinfo (Summary): New node. - (Special Targets): Mention .EXPORT_ALL_VARIABLES here. - - * variable.c (max): Moved to make.h. - - * compatMakefile (objs, srcs): Added ar & arscan. - - * job.c (start_waiting_job): New function, 2nd half of new_job. - (new_job): Call it. - (start_waiting_jobs): New function. - * remake.c (update_goal_chain): Call start_waiting_jobs at the top - of the main loop. - * compatMakefile (objs, srcs): Removed load, added getloadavg. - -Fri Jun 12 19:33:16 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * job.c (load_too_high): New function. Uses getloadavg. - (waiting_jobs): New variable. - (start_job): Don't call wait_to_start_job. Instead, if - load_too_high returns nonzero, add the child to the - `waiting_jobs' chain and return without starting the job. - -Thu Jun 11 00:05:28 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * expand.c (variable_buffer_output): Made global again. - * variable.h: And declare it. - - * arscan.c (PORTAR): Define for all systems if PORT5AR is not defined. - (AR_NAMELEN, AR_TRAILING_SLASH): Removed. - (ar_scan): Don't use it. Don't #ifdef AR_TRAILING_SLASH; just look - for a slash in the archive at run time. - (ar_name_equal): Rewrote .o hacking to not use AR_NAMELEN, and to - cope with trailing-slash and non-trailing-slash archives. - - * main.c (main) [! SETVBUF_REVERSED]: Test this instead of USGr3 et al. - [SETVBUF_REVERSED]: Always allocate a buffer ourselves. - - * load.c (load_average) [sgi]: Use sysmp call. - - * compatMakefile (INSTALL_DATA, INSTALL_PROGRAM): Define. - ($(bindir)/$(instname), $(mandir)/make.$(manext)): Use them. - - * make.h [HAVE_VFORK_H]: #include . - (vfork, VFORK_NAME): Don't define. - * job.c (start_job): Use "vfork" in place of VFORK_NAME. - - * make.h [HAVE_LIMITS_H, HAVE_SYS_PARAM_H]: If #define'd, #include - the each file. Rearranged PATH_MAX hacking. - * job.c: Rearranged NGROUPS_MAX hacking. - - * remake.c (fstat, time): Don't declare. - - * compatMakefile (defines): Value is @DEFS@. - (LOADLIBES): Value is @LIBS@. - (extras): Value is @LIBOBJS@. - (ARCHIVES, ARCHIVES_SRC, ALLOCASRC): Removed. - * arscan.c, ar.c: Surround body with #ifndef NO_ARCHIVES. - - * misc.c [! HAVE_UNISTD_H]: Test instead of !POSIX to decl get*id. - - * make.h [GETCWD_MISSING]: Test instead of !USG && !POSIX et al. - (getcwd): Just declare if present. If not, declare as a macro - using getwd, and declare getwd. - [PATH_MAX] (GET_PATH_MAX): #define to PATH_MAX. - * main.c (main, log_working_directory): Use getcwd instead of getwd. - - * main.c (main) [SETLINEBUF_MISSING]: Test this instead of USG. - - * make.h (SIGHANDLER, SIGNAL): Removed. - (RETSIGTYPE): Define if not #define'd. - * main.c (main): Use signal in place of SIGNAL. - - * main.c [SYS_SIGLIST_MISSING]: Test instead of USG. - - * job.c (search_path) [GETGROUPS_MISSING]: Test instead of USG. - [HAVE_UNISTD_H]: Test instead of POSIX to not decl getgroups. - - * main.c [! HAVE_UNISTD_H]: Test instead of !POSIX to decl chdir. - [! STDC_HEADERS]: Test instead of !POSIX to decl exit & atof. - - * job.c (child_handler), commands.c (fatal_error_signal): Return - RETSIGTYPE instead of int. - * main.c (main): Declare fatal_error_signal and child_handler here - to return RETSIGTYPE; removed top-level decl of former. - - * commands.c (fatal_error_signal), job.c (unblock_sigs, start_job), - main.c [SIGSETMASK_MISSING]: Test this instead of USG. - -Wed Jun 10 22:06:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * job.c [HAVE_WAITPID]: Test this instead of USG. - [! HAVE_UNISTD_H]: Test this instead of !POSIX to declare misc fns. - (GID_T): Don't #define. - (search_path): Use gid_t instead of GID_T. - [GETDTABLESIZE_MISSING, SYS_SIGLIST_MISSING, DUP2_MISSING]: Test - these individually instead of USG for all. - * make.h (ctime): Don't declare. #include time.h instead. - [HAVE_UNISTD_H]: #include and #define POSIX #ifdef - _POSIX_VERSION. - * dir.c [__GNU_LIBRARY__] (D_NAMLEN): Define to use d_namlen member. - * make.h [NEED_MEMORY_H]: Only include memory.h #ifdef this. - - * arscan.c: Removed #ifdef mess about string.h et al. - Just #include make.h instead. - * make.h (fstat, atol): Declare. - - * commands.c (fatal_error_signal): Don't use sigmask to check for - propagated signals; use ||s instead. - (PROPAGATED_SIGNAL_MASK): Removed. - (fatal_error_signal) [POSIX]: Use sigprocmask in place of sigsetmask. - - * variable.c (variable_buffer, variable_buffer_length, - initialize_variable_output, variable_output): Moved to expand.c; - made all static. - (struct output_state, save_variable_output, - restore_variable_output): Removed. - * expand.c (initialize_variable_output): Put a NUL at the beginning - of the new buffer after allocating it. - (allocated_variable_expand_for_file): Don't use - {save,restore}_variable_output. Do it by hand instead, keeping - state on the stack instead of malloc'ing it. - (allocated_variable_expand): Removed. - * variable.h (allocated_variable_expand): Define here as macro. - (variable_buffer_output, initialize_variable_output, - save_variable_output, restore_variable_output): Removed decls. - - * read.c (conditional_line): For an if cmd, if any elt of the - conditionals stack is ignoring, just push a new level that ignores - and return 1; don't evaluate the condition. - -Thu Jun 4 21:01:20 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (main): Put #ifdef's around frobbing SIGSYS and SIGBUS. - - * job.c (getdtablesize): Don't declare or #define if already #define'd. - -Wed Jun 3 23:42:36 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * file.c (snap_deps): If `.EXPORT_ALL_VARIABLES' is a target, set - export_all_variables. - * make.texinfo (Variables/Recursion): Document .EXPORT_ALL_VARIABLES. - -Tue Jun 2 21:08:35 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.13. - - * commands.c (set_file_variables): Calculate length for ^D and ?D - individually, making sure to give them at least enough space for "./". - - * make.h [CRAY]: #define signal to bsdsignal. - - * default.c (default_variables) [CRAY]: Define PC, SEGLDR, - CF77PPFLAGS, CF77PP, CFT, CF, and FC. - - * arscan.c (AR_HDR_SIZE): Define to sizeof (struct ar_hdr), if it - wasn't defined by . - -Thu May 28 00:56:53 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.12. - -Tue May 26 01:26:30 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * rule.c (new_pattern_rule): Initialize LASTRULE to nil, not - pattern_rules. - -Mon May 25 19:02:15 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (decode_switches): Initialize all the long_option elt members. - -Thu May 21 16:34:24 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * make.texinfo (Text Functions): Correct filter-out description. - -Tue May 19 20:50:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * compatMakefile (realclean): Don't remove backup files. - - * main.c (decode_switches): Allocate ARGC+1 elts in `other_args'. - -Sun May 17 16:38:48 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * Version 3.62.11. - -Thu May 14 16:42:33 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * job.c (reap_children): Don't die if wait returns EINTR. - -Wed May 13 18:28:25 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * job.c (reap_children): Always run the next command for a - successful target. If we are going to die, we don't want to leave - the target partially made. - -Tue May 12 00:39:19 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): After loop, if we only - have one word, check it for being a shell command. - - * main.c (decode_switches): Allocate ARGC slots in other_args to - begin with, so we never need to worry about growing it. - If we get a non-option arg and POSIXLY_CORRECT is in the - environment, break out of the loop. After the loop, add all remaining - args to other_args list. - - * main.c (decode_switches): For positive_int and floating switches - when optarg is nil, use next arg if it looks right (start with a - digit, or maybe decimal point for floating). - - * variable.c (define_automatic_variables): Always set SHELL to - default if it comes from the environment. Set its export bit. - * make.texinfo (Environment): Document change. - -Mon May 11 00:32:46 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * Version 3.62.10. - - * compatMakefile (tags, TAGS): Use vars for cmds. - (ETAGS, CTAGS): Define. - - * main.c (decode_switches): If a switches elt has a nil long_name, - make the long option name elt be "". - Fixed loop to not ignore all the options. - - * make.texinfo (Option Summary): Added long options. - - * main.c (switches): Changed -m's description to "-b". - (decode_switches): When printing the usage message, don't print - switches whose descriptions start with -. - When constructing the list of names for switch -C, search the - switches vector for switches whose descriptions are "-C". - - * main.c (switches): Call -S --no-keep-going, not --dont-keep-going. - Call -I --include-dir, not --include-path. - (long_option_aliases): Added --new == -W, --assume-new == -W, - --assume-old == -o, --max-load == -l, --dry-run == -n, --recon == -n, - --makefile == -f. - - * main.c (switches): Removed bogus "silent" elt. - (long_option_aliases): Define new var. - (decode_switches): Add long_option_aliases onto the end of the long - options vector created for getopt_long. - Look through long_option_aliases for extra names to list - in usage message. - -Sat May 9 00:21:05 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (log_working_directory): Fixed to properly not print the - leaving message when we haven't printed the entering message. - -Fri May 8 21:55:35 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * main.c (struct command_switch): Added elts `long_name', - `description', and `argdesc'. - (switches): Added initializers for new members. - (decode_switches): Rewritten to use getopt_long. - * compatMakefile (GETOPT, GETOPT_SRC): Define. - (objs, srcs): Include them. - - * job.c (child_died): Renamed to dead_children; made static. - (child_handler): Increment dead_children instead of setting child_died. - (reap_children): Decrement dead_children instead of clearing - child_died. The point of all this is to avoid printing "waiting - for unfinished jobs" when we don't actually need to block. - This happened when multiple SIGCHLDs before reap_children was called. - - * job.c (reap_children): If ERR is set, so we don't call start_job - on the child being reaped, instead set its command_state to - cs_finished. - (reap_children, child_handler, new_job): I added several - debugging printf's while fixing this. I left them in if (debug_flag) - because they may be useful for debugging this stuff again. - -Wed May 6 22:02:37 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * read.c (read_makefile): v_export is not 1. - -Mon May 4 17:27:37 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.9. - - * variable.c (export_all_variables): New variable. - (target_environment): Export variables whose `export' member is - v_default if export_all_variables is set and their names are benign. - * variable.h: Declare export_all_variables. - * read.c (read_makefile): If export or unexport is given with no - args, set or clear export_all_variables, respectively. - - * variable.c (target_environment): Exclude MAKELEVEL in the loop, - so it isn't duplicated when we add it at the end. - -Sun May 3 17:44:48 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.8. - - * variable.h (struct variable): Added new member `export'. - * variable.c (define_variable_in_set): Initialize it to v_default. - (target_environment): Don't check for .NOEXPORT. - Export variables whose `export' member is v_default and that would - have been exported under .NOEXPORT, and variables whose `export' - member is v_export. - (try_variable_definition): Return the variable defined. - * variable.h (try_variable_definition): Changed decl. - * read.c (read_makefile): Recognize `export' and `unexport' directives. - -Fri May 1 11:39:38 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * main.c (main) [POSIX]: Reversed args to sigaddset. - -Thu Apr 30 17:33:32 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * job.c [POSIX || !USG] (unblock_sigs): New fn. - (start_job): Block signals before forking. - (new_job): Unblock signals after putting the new child on the chain. - * main.c (main) [POSIX]: Use sigset_t fatal_signal_set instead of - int fatal_signal_mask. - - * load.c [sgi] (LDAV_CVT): Define. - -Wed Apr 29 17:15:59 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * Version 3.62.7. - - * load.c (load_average) [sgi]: Clear the high bit of the address - from the symbol table before looking it up in kmem. - - * misc.c (fatal, makefile_fatal): Put *** in fatal error messages. - (remake_file): No longer needed in message here. - - * main.c (die): Call reap_children with BLOCK==1. - -Tue Apr 28 20:44:35 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * rule.c (freerule): Don't set LASTRULE->next if LASTRULE is nil. - -Sun Apr 26 15:09:51 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * rule.c (count_implicit_rule_limits): Initialize LASTRULE to nil, - not to head of chain. Extract next ptr before we might do - freerule, and use that for next iteration. - (freerule): Still do next ptr frobbing if LASTRULE is nil. - -Tue Apr 21 03:16:29 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * job.c (child_error): Removed extra %s from error msg format. - - * Version 3.62.6. - - * job.c (reap_children): Don't start later commands in a sequence - if ERR is nonzero. - - * job.c (new_job): Always call reap_children with BLOCK==0 first thing. - - * job.c (reap_children): New function; work that used to be done in - child_handler. - (child_died): New global var. - (child_handler): Now just sets child_died. - (wait_for_children): Removed. - (unknown_children_possible, block_signals, unblock_signals, - push_signals_blocked_p, pop_signals_blocked_p): Removed. - (child_execute_job): Removed call to unblock_signals. - (new_job): Removed calls to push_signals_blocked_p and - pop_signals_blocked_p. - * job.h: Declare reap_children, not wait_for_children. - * commands.c (fatal_error_signal), job.c (new_job), - load.c [LDAV_BASED] (wait_to_start_job), main.c (die), - remake.c (update_goal_chain), function.c (expand_function: `shell'): - Changed wait_for_children calls to reap_children. - Some needed to be loops to wait for all children to die. - * commands.c (fatal_error_signal), main.c (main, - log_working_directory), function.c (expand_function): Removed calls - to push_signals_blocked_p and pop_signals_blocked_p. - * job.h: Removed decls. - - * job.h: Added copyright notice. - -Wed Apr 15 02:02:40 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (child_error): No *** for ignored error. - -Tue Apr 14 18:31:21 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * implicit.c (DEBUGP2): Use do ... while (0) instead of if ... else to - avoid compiler warnings. - - * read.c (parse_file_seq): Don't remove ./ when it is followed by a - blank. - -Mon Apr 13 21:56:15 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.h (DEBUGPR): Use do ... while (0) instead of if ... else to - avoid compiler warnings. - - * remake.c (notice_finished_file): Run file_mtime on the also_make - files, so vpath_search can happen. - - * GNUmakefile (tests): Use perl test suite from csa@sw.stratus.com. - (alpha-files): Include test suite tar file. - -Fri Apr 3 00:50:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * Version 3.62.5. - -Wed Apr 1 05:31:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * remake.c (update_file, update_file_1): Do check_renamed on elts - of dep chains when traversing them. Something unrelated might have - renamed one of the files the dep chain points to. - - * file.c (rename_file): If FILE has been renamed, follow its - `renamed' ptr, so we get to the final real FILE. Using the renamed - ones loses because they are not in the hash table, so the removal - code loops infinitely. - - * read.c (read_all_makefiles): Clobber null terminator into - MAKEFILES expansion, so string passed to read_makefile is properly - terminated. - -Mon Mar 30 20:18:02 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * commands.c (set_file_variables): $* for archive member with - explicit cmds is stem of member, not of whole `lib(member)'. - -Thu Mar 26 15:24:38 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * Version 3.62.4. - -Tue Mar 24 05:20:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * rule.c (new_pattern_rule): Rules are identical only if all their - targets match (regardless of order). - -Wed Mar 11 13:49:54 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - - * remake.c (remake_file): Changed error "no way to make" to "no - rule to make". Fiat Hugh. - - * make.texinfo (Last Resort): Describe %:: rules and new .DEFAULT - behavior. - - * remake.c (update_file_1): Only use .DEFAULT cmds if FILE is not a - target. - -Tue Mar 10 18:13:13 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * remote-stub.c, remote-cstms.c (start_remote_job): Take new arg, - environment to pass to child. - * job.c (start_job): Pass it. - -Mon Mar 9 19:00:11 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * file.c (enter_file): Also strip ./s here, to get command-line - target names. - - * remote-cstms.c: Add comment telling people to leave me alone. - - * compatMakefile (manpage install): Remove target before copying. - -Tue Mar 3 18:43:21 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.texinfo (Missing): Renamed to "Incompatibilities and ...". - Added paragraph describing $? incompatibility with Unix and POSIX.2. - -Sun Mar 1 15:50:54 1992 Roland McGrath (roland@nutrimat.gnu.ai.mit.edu) - - * function.c (expand_function: `shell'): Don't declare fork or pipe. - Use vfork instead of fork. - -Tue Feb 25 22:05:32 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * make.texinfo (Chained Rules): Clarify .PRECIOUS to save - intermediate files. - - * load.c [sun] (LDAV_CVT): Define to divide by FSCALE. - -Sun Feb 16 02:05:16 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * Version 3.62.3. - -Sat Feb 15 17:12:20 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * compatMakefile (makeinfo): Use emacs batch-texinfo-format fn. - -Fri Feb 14 00:11:55 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * read.c (read_makefile): Correctly handle define & endef in ifdefs. - - * read.c (record_files): Pass arg for %s in error msg. - - * main.c (main) [__IBMR2, POSIX]: Use correct (a la USGr3) setvbuf - call. - -Wed Feb 12 12:07:39 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * make.texinfo (Libraries/Search): Say it does /usr/local/lib too. - -Sun Feb 9 23:06:24 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * read.c (read_makefile): Check for extraneous `endef' when ignoring. - -Thu Feb 6 16:15:48 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * Version 3.62.2. - -Tue Feb 4 20:04:46 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Correctly ignore - whitespace after backslash-NL. - -Fri Jan 31 18:30:05 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * compatMakefile: Ignore errors from chgrp and chmod when installing. - -Wed Jan 29 18:13:30 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * main.c (main): When setting MAKELEVEL in the env to re-exec, - allocate space so as not to clobber past the end of the old string. - - * make.h [HAVE_ALLOCA_H]: Include - * compatMakefile (defines): Document HAVE_ALLOCA_H. - -Mon Jan 20 13:40:05 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * make.h [VFORK_MISSING]: Use fork instead. - * compatMakefile (defines): Document same. - - * job.c (construct_command_argv_internal): Don't create an empty - arg if backslash-NL is at beginning of word. - -Sun Jan 19 16:26:53 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * main.c [DGUX]: Call setvbuf as for USGr3. - - * job.c (construct_command_argv_internal): Notice correctly that - backslash-NL is the end of the arg (because it is replaced with a - space). - -Thu Jan 16 18:42:38 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): If SHELL is nil, set it - to default_shell before proceeding. - - * make.h [sgi]: No alloca.h, after all. - -Wed Jan 15 12:30:04 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * read.c (multi_glob): Cons up the chain of the results of glob - from back to front, so it comes out in forward order. - - * job.c (construct_command_argv_internal): Don't eat char following - backslash-NL. - -Mon Jan 13 19:16:56 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * Version 3.62.1. - - * default.c (default_variables) [ultrix]: GET=get, like USG. - - * job.c (construct_command_argv_internal): Remove tabs following - backslash-NL combos in the input line, so they don't show up when - that line is printed. - - * read.c (read_makefile): Don't collapse_continuations the line on - input; do it on the copy we do remove_comments on. - For rule lines, collapse_continuations the line after chopping - ";cmds" off the end, so we don't eat conts in the cmds. - Give error for ";cmds" with no rule. - * job.c (construct_command_argv_internal): Eat backslash-NL combos - when constructing the line to recurse on for slow, too. - -Sat Jan 11 02:20:27 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - - * file.c (enter_file): Don't strip leading `./'s. - * read.c (parse_file_seq): Take new arg STRIP; if nonzero, do it here. - * default.c (set_default_suffixes), function.c (string_glob), - read.c (read_makefile), rule.c (install_pattern_rule): Change callers. - - * default.c (default_variables) [_IBMR2]: FC=xlf - - * job.c (construct_command_argv_internal): Turn backslash-NL and - following whitespace into a single space, rather than just eating - the backslash. - - * make.texinfo (Copying): @include gpl.texinfo, rather than - duplicating its contents. - -Fri Nov 8 20:06:03 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Make sure not to bother - processing an empty line. - - * Version 3.62.0. - - * job.c (construct_command_argv_internal): Always recurse for slow; - simple case didn't handle finding newlines. - -Tue Nov 5 18:51:10 1991 Roland McGrath (roland@wookumz.gnu.ai.mit.edu) - - * job.c (construct_command_argv_internal): Set RESTP properly when - slow; don't \ify past a newline. - -Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * make.h [sgi]: #include . - - - -See ChangeLog.1 for earlier changes. diff --git a/buildtools/windows/source/make/INSTALL b/buildtools/windows/source/make/INSTALL deleted file mode 100644 index 95d84c820fb..00000000000 --- a/buildtools/windows/source/make/INSTALL +++ /dev/null @@ -1,176 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. - diff --git a/buildtools/windows/source/make/Makefile b/buildtools/windows/source/make/Makefile deleted file mode 100644 index 9c049840c46..00000000000 --- a/buildtools/windows/source/make/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# -# GNU Makefile for building gmake.exe on WIN32 -# This is the top-level makefile. It only does the optimized build. -# - -CSRCS = ar.c \ - arscan.c \ - commands.c \ - default.c \ - dir.c \ - expand.c \ - file.c \ - function.c \ - getloadavg.c \ - getopt.c \ - getopt1.c \ - implicit.c \ - job.c \ - main.c \ - misc.c \ - read.c \ - remake.c \ - remote-stub.c \ - rule.c \ - signame.c \ - variable.c \ - version.c \ - vpath.c - -OBJS = $(CSRCS:.c=.obj) glob/fnmatch.obj glob/glob.obj - -CC = cl - -CFLAGS = $(CC_SWITCHES) $(INCLUDES) $(DEFINES) $(CC_OUTPUTS) - -CC_SWITCHES = -nologo -ML -W3 -O2 - -INCLUDES = -I. -Iglob - -DEFINES = -DWIN32 -DNDEBUG -D_CONSOLE -DNETSCAPE -DHAVE_CONFIG_H - -CC_OUTPUTS = -Fpgmake.pch -YX -c - -LINK = link - -LINK_FLAGS = -nologo -subsystem:console \ - -incremental:no -machine:I386 -out:$@ - -all: gmake.exe - -build_glob: - cd glob; $(MAKE) - -gmake.exe: build_glob $(OBJS) - $(LINK) $(LINK_FLAGS) $(OBJS) - -%.obj: %.c - $(CC) $(CFLAGS) $< - -clean: - cd glob; $(MAKE) $@ - rm -rf $(OBJS) gmake.pch gmake.exe diff --git a/buildtools/windows/source/make/Makefile.in b/buildtools/windows/source/make/Makefile.in deleted file mode 100644 index b77794f744c..00000000000 --- a/buildtools/windows/source/make/Makefile.in +++ /dev/null @@ -1,307 +0,0 @@ -# NOTE: If you have no `make' program at all to process this makefile, run -# `build.sh' instead. -# -# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -# This file is part of GNU Make. -# -# GNU Make is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Make is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Make; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# -# Makefile for GNU Make -# - -# Ultrix 2.2 make doesn't expand the value of VPATH. -VPATH = @srcdir@ -# This must repeat the value, because configure will remove `VPATH = .'. -srcdir = @srcdir@ - -CC = @CC@ - -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ - -# Define these for your system as follows: -# -DNO_ARCHIVES To disable `ar' archive support. -# -DNO_FLOAT To avoid using floating-point numbers. -# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2. -# Some compilers apparently accept this -# without complaint but produce losing code, -# so beware. -# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline. -# See also `config.h'. -defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" - -# Which flavor of remote job execution support to use. -# The code is found in `remote-$(REMOTE).c'. -REMOTE = @REMOTE@ - -# If you are using the GNU C library, or have the GNU getopt functions in -# your C library, you can comment these out. -GETOPT = getopt.o getopt1.o -GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h - -# If you are using the GNU C library, or have the GNU glob functions in -# your C library, you can comment this out. GNU make uses special hooks -# into the glob functions to be more efficient (by using make's directory -# cache for globbing), so you must use the GNU functions even if your -# system's C library has the 1003.2 glob functions already. Also, the glob -# functions in the AIX and HPUX C libraries are said to be buggy. -GLOB = glob/libglob.a - -# If your system doesn't have alloca, or the one provided is bad, define this. -ALLOCA = @ALLOCA@ -ALLOCA_SRC = $(srcdir)/alloca.c - -# If your system needs extra libraries loaded in, define them here. -# System V probably need -lPW for alloca. HP-UX 7.0's alloca in -# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use -# alloca.c instead on those machines. -LOADLIBES = @LIBS@ - -# Any extra object files your system needs. -extras = @LIBOBJS@ - -# Common prefix for machine-independent installed files. -prefix = @prefix@ -# Common prefix for machine-dependent installed files. -exec_prefix = @exec_prefix@ - -# Directory to install `make' in. -bindir = $(exec_prefix)/bin -# Directory to find libraries in for `-lXXX'. -libdir = $(exec_prefix)/lib -# Directory to search by default for included makefiles. -includedir = $(prefix)/include -# Directory to install the Info files in. -infodir = $(prefix)/info -# Directory to install the man page in. -mandir = $(prefix)/man/man$(manext) -# Number to put on the man page filename. -manext = 1 -# Prefix to put on installed `make' binary file name. -binprefix = -# Prefix to put on installed `make' man page file name. -manprefix = $(binprefix) - -# Whether or not make needs to be installed setgid. -# The value should be either `true' or `false'. -# On many systems, the getloadavg function (used to implement the `-l' -# switch) will not work unless make is installed setgid kmem. -install_setgid = @NEED_SETGID@ -# Install make setgid to this group so it can read /dev/kmem. -group = @KMEM_GROUP@ - -# Program to install `make'. -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -# Program to install the man page. -INSTALL_DATA = @INSTALL_DATA@ -# Generic install program. -INSTALL = @INSTALL@ - -# Program to format Texinfo source into Info files. -MAKEINFO = makeinfo -# Program to format Texinfo source into DVI files. -TEXI2DVI = texi2dvi - -# Programs to make tags files. -ETAGS = etags -w -CTAGS = ctags -w - -objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \ - rule.o implicit.o default.o variable.o expand.o function.o \ - vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \ - $(GLOB) $(GETOPT) $(ALLOCA) $(extras) -srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \ - $(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \ - $(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \ - $(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \ - $(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \ - $(srcdir)/vpath.c $(srcdir)/version.c \ - $(srcdir)/remote-$(REMOTE).c \ - $(srcdir)/ar.c $(srcdir)/arscan.c \ - $(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \ - $(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \ - $(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \ - $(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in - - -.SUFFIXES: -.SUFFIXES: .o .c .h .ps .dvi .info .texinfo - -all: make -info: make.info -dvi: make.dvi -# Some makes apparently use .PHONY as the default goal if it is before `all'. -.PHONY: all check info dvi - -make.info: make.texinfo - $(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info - -make.dvi: make.texinfo - $(TEXI2DVI) $(srcdir)/make.texinfo - -make.ps: make.dvi - dvi2ps make.dvi > make.ps - -make: $(objs) - $(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new - mv -f make.new make - -# -I. is needed to find config.h in the build directory. -.c.o: - $(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \ - $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION) - -# For some losing Unix makes. -SHELL = /bin/sh -@SET_MAKE@ - -glob/libglob.a: FORCE config.h - cd glob; $(MAKE) libglob.a -FORCE: - -tagsrcs = $(srcs) $(srcdir)/remote-*.c -TAGS: $(tagsrcs) - $(ETAGS) $(tagsrcs) -tags: $(tagsrcs) - $(CTAGS) $(tagsrcs) - -.PHONY: install installdirs -install: installdirs \ - $(bindir)/$(binprefix)make $(infodir)/make.info \ - $(mandir)/$(manprefix)make.$(manext) - -installdirs: - $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir) - -$(bindir)/$(binprefix)make: make - $(INSTALL_PROGRAM) make $@.new - @if $(install_setgid); then \ - if chgrp $(group) $@.new && chmod g+s $@.new; then \ - echo "chgrp $(group) $@.new && chmod g+s $@.new"; \ - else \ - echo "$@ needs to be owned by group $(group) and setgid;"; \ - echo "otherwise the \`-l' option will probably not work."; \ - echo "You may need special privileges to install $@."; \ - fi; \ - else true; fi -# Some systems can't deal with renaming onto a running binary. - -rm -f $@.old - -mv $@ $@.old - mv $@.new $@ - -$(infodir)/make.info: make.info - if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \ - for file in $${dir}/make.info*; do \ - name="`basename $$file`"; \ - $(INSTALL_DATA) $$file \ - `echo $@ | sed "s,make.info\$$,$$name,"`; \ - done -# Run install-info only if it exists. -# Use `if' instead of just prepending `-' to the -# line so we notice real errors from install-info. -# We use `$(SHELL) -c' because some shells do not -# fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \ - install-info --infodir=$(infodir) $$dir/make.info; \ - else true; fi - -$(mandir)/$(manprefix)make.$(manext): make.man - $(INSTALL_DATA) $(srcdir)/make.man $@ - - -loadavg: loadavg.c config.h - $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \ - loadavg.c $(LOADLIBES) -o $@ -# We copy getloadavg.c into a different file rather than compiling it -# directly because some compilers clobber getloadavg.o in the process. -loadavg.c: getloadavg.c - ln $(srcdir)/getloadavg.c loadavg.c || \ - cp $(srcdir)/getloadavg.c loadavg.c -check-loadavg: loadavg - @echo The system uptime program believes the load average to be: - -uptime - @echo The GNU load average checking code believes: - ./loadavg -check: check-loadavg - - -.PHONY: clean realclean distclean mostlyclean -clean: glob-clean - -rm -f make loadavg *.o core make.dvi -distclean: clean glob-realclean - -rm -f Makefile config.h config.status build.sh stamp-config - -rm -f config.log config.cache - -rm -f TAGS tags - -rm -f make.?? make.??s make.log make.toc make.*aux - -rm -f loadavg.c -realclean: distclean - -rm -f make.info* -mostlyclean: clean - -.PHONY: glob-clean glob-realclean -glob-clean glob-realclean: - cd glob; $(MAKE) $@ - -Makefile: config.status $(srcdir)/Makefile.in - $(SHELL) config.status -glob/Makefile: config.status $(srcdir)/glob/Makefile.in - $(SHELL) config.status -config.h: stamp-config ; -stamp-config: config.status $(srcdir)/config.h.in - $(SHELL) config.status - touch stamp-config - -#configure: configure.in aclocal.m4 -# cd $(srcdir) && autoconf $(ACFLAGS) -#config.h.in: configure.in aclocal.m4 -# cd $(srcdir) && autoheader $(ACFLAGS) - -# This tells versions [3.59,3.63) of GNU make not to export all variables. -.NOEXPORT: - -# The automatically generated dependencies below may omit config.h -# because it is included with ``#include '' rather than -# ``#include "config.h"''. So we add the explicit dependency to make sure. -$(objs): config.h - -# Automatically generated dependencies will be put at the end of the file. - -# Automatically generated dependencies. -commands.o : commands.c make.h dep.h commands.h file.h variable.h job.h -job.o: job.c make.h commands.h job.h file.h variable.h -dir.o: dir.c make.h -file.o: file.c make.h commands.h dep.h file.h variable.h -misc.o: misc.c make.h dep.h -main.o: main.c make.h commands.h dep.h file.h variable.h job.h getopt.h -read.o: read.c make.h commands.h dep.h file.h variable.h glob/glob.h -remake.o: remake.c make.h commands.h job.h dep.h file.h -rule.o : rule.c make.h config.h commands.h dep.h file.h variable.h rule.h -implicit.o : implicit.c make.h rule.h dep.h file.h -default.o: default.c make.h rule.h dep.h file.h commands.h variable.h -variable.o : variable.c make.h commands.h variable.h dep.h file.h -expand.o: expand.c make.h commands.h file.h variable.h -function.o: function.c make.h variable.h dep.h commands.h job.h -vpath.o : vpath.c make.h file.h variable.h -version.o: version.c -ar.o : ar.c make.h file.h dep.h -arscan.o: arscan.c make.h -signame.o: signame.c signame.h -remote-stub.o : remote-stub.c make.h commands.h -getopt.o: getopt.c getopt.h -getopt1.o : getopt1.c getopt.h -getloadavg.o: getloadavg.c diff --git a/buildtools/windows/source/make/NEWS b/buildtools/windows/source/make/NEWS deleted file mode 100644 index 6c97107a97b..00000000000 --- a/buildtools/windows/source/make/NEWS +++ /dev/null @@ -1,557 +0,0 @@ -GNU make NEWS -- history of user-visible changes. 26 January 1995 - -Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. -See the end for copying conditions. - -Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu. - -Version 3.73 - -* Converted to use Autoconf version 2, so `configure' has some new options. - See INSTALL for details. - -* You can now send a SIGUSR1 signal to Make to toggle printing of debugging - output enable by -d, at any time during the run. - -Version 3.72 - -* DJ Delorie has ported Make to MS-DOS using the GO32 extender. - He is maintaining the DOS port, not the GNU Make maintainer; - please direct bugs and questions for DOS to . - MS-DOS binaries are available for FTP from oak.oakland.edu:pub/msdos/djgpp. - -* The `MAKEFLAGS' variable (in the environment or in a makefile) can now - contain variable definitions itself; these are treated just like - command-line variable definitions. Make will automatically insert any - variable definitions from the environment value of `MAKEFLAGS' or from - the command line, into the `MAKEFLAGS' value exported to children. The - `MAKEOVERRIDES' variable previously included in the value of `$(MAKE)' - for sub-makes is now included in `MAKEFLAGS' instead. As before, you can - reset `MAKEOVERRIDES' in your makefile to avoid putting all the variables - in the environment when its size is limited. - -* If `.DELETE_ON_ERROR' appears as a target, Make will delete the target of - a rule if it has changed when its commands exit with a nonzero status, - just as when the commands get a signal. - -* The automatic variable `$+' is new. It lists all the dependencies like - `$^', but preserves duplicates listed in the makefile. This is useful - for linking rules, where library files sometimes need to be listed twice - in the link order. - -* You can now specify the `.IGNORE' and `.SILENT' special targets with - dependencies to limit their effects to those files. If a file appears as - a dependency of `.IGNORE', then errors will be ignored while running the - commands to update that file. Likewise if a file appears as a dependency - of `.SILENT', then the commands to update that file will not be printed - before they are run. (This change was made to conform to POSIX.2.) - -Version 3.71 - -* The automatic variables `$(@D)', `$(%D)', `$(*D)', `$( renames program database file -# /Fo creates an object file -# /Fp specifies a precompiled header file name -# /O2 creates fast code -# /Od disables optimization -# /W sets warning levels -# /YX Automates precompiled header -# /Zi Generates complete debugging information - -CFLAGS_any = /nologo /W3 /YX /I . /I glob /D NETSCAPE /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H -CFLAGS_debug = $(CFLAGS_any) /MLd /Zi /Od /D _DEBUG /FpWinDebug/make.pch /FoWinDebug/ /FdWinDebug/make.pdb -CFLAGS_release = $(CFLAGS_any) /ML /O2 /D NDEBUG /FpWinRel/make.pch /FoWinRel/ - -LDFLAGS_debug = /NOLOGO /SUBSYSTEM:console\ - /INCREMENTAL:no /PDB:WinDebug/make.pdb \ - /OUT:WinDebug/make.exe /DEBUG -LDFLAGS_release = /NOLOGO /SUBSYSTEM:console\ - /INCREMENTAL:no /OUT:WinRel/make.exe - -all: Release Debug - -Release: - nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe -Debug: - nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe - -clean: - rmdir /s /q WinDebug WinRel - -$(OUTDIR): - if not exist .\$@\nul mkdir .\$@ - -#LIBS = kernel32.lib user32.lib advapi32.lib -#LIBS = kernel32.lib - -OBJS = \ - $(OUTDIR)/ar.obj \ - $(OUTDIR)/arscan.obj \ - $(OUTDIR)/commands.obj \ - $(OUTDIR)/default.obj \ - $(OUTDIR)/dir.obj \ - $(OUTDIR)/expand.obj \ - $(OUTDIR)/file.obj \ - $(OUTDIR)/function.obj \ - $(OUTDIR)/getloadavg.obj \ - $(OUTDIR)/getopt.obj \ - $(OUTDIR)/getopt1.obj \ - $(OUTDIR)/implicit.obj \ - $(OUTDIR)/job.obj \ - $(OUTDIR)/main.obj \ - $(OUTDIR)/misc.obj \ - $(OUTDIR)/read.obj \ - $(OUTDIR)/remake.obj \ - $(OUTDIR)/remote-stub.obj \ - $(OUTDIR)/rule.obj \ - $(OUTDIR)/signame.obj \ - $(OUTDIR)/variable.obj \ - $(OUTDIR)/version.obj \ - $(OUTDIR)/vpath.obj \ - $(OUTDIR)/glob.obj \ - $(OUTDIR)/fnmatch.obj - -$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS) - $(LINK) @<< - $(LDFLAGS) $(LIBS) $(OBJS) -<< - -.c{$(OUTDIR)}.obj: - $(CC) $(CFLAGS) /c $< - -$(OUTDIR)/ar.obj : ar.c make.h file.h dep.h -$(OUTDIR)/arscan.obj : arscan.c make.h -$(OUTDIR)/commands.obj : commands.c -$(OUTDIR)/default.obj : default.c make.h rule.h dep.h file.h job.h commands.h variable.h -$(OUTDIR)/dir.obj : dir.c make.h -$(OUTDIR)/expand.obj : expand.c make.h file.h job.h commands.h variable.h -$(OUTDIR)/file.obj : file.c make.h dep.h file.h job.h commands.h variable.h -$(OUTDIR)/function.obj : function.c make.h file.h variable.h dep.h job.h commands.h -$(OUTDIR)/getloadavg.obj : getloadavg.c -$(OUTDIR)/getopt.obj : getopt.c -$(OUTDIR)/getopt1.obj : getopt1.c getopt.h -$(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h file.h -$(OUTDIR)/job.obj : job.c make.h job.h file.h commands.h variable.h -$(OUTDIR)/main.obj : main.c make.h dep.h file.h variable.h job.h commands.h getopt.h -$(OUTDIR)/misc.obj : misc.c make.h dep.h -$(OUTDIR)/read.obj : read.c make.h dep.h file.h job.h commands.h variable.h glob/glob.h -$(OUTDIR)/remake.obj : remake.c make.h file.h job.h commands.h dep.h -$(OUTDIR)/remote-stub.obj : remote-stub.c make.h file.h job.h commands.h -$(OUTDIR)/rule.obj : rule.c make.h dep.h file.h job.h commands.h variable.h rule.h -$(OUTDIR)/signame.obj : signame.c signame.h -$(OUTDIR)/variable.obj : variable.c make.h dep.h file.h job.h commands.h variable.h -$(OUTDIR)/version.obj : version.c -$(OUTDIR)/vpath.obj : vpath.c make.h file.h variable.h -$(OUTDIR)/glob.obj : glob/glob.c - $(CC) $(CFLAGS) /c glob/glob.c -$(OUTDIR)/fnmatch.obj : glob/fnmatch.c - $(CC) $(CFLAGS) /c glob/fnmatch.c diff --git a/buildtools/windows/source/make/README b/buildtools/windows/source/make/README deleted file mode 100644 index 43003a33861..00000000000 --- a/buildtools/windows/source/make/README +++ /dev/null @@ -1,28 +0,0 @@ -This directory contains the 3.74 test release of GNU Make. -All bugs reported for previous test releases have been fixed. -Some bugs surely remain. - -For general building and installation instructions, see the file INSTALL. -If you need to build GNU Make and have no other `make' program to use, -you can use the shell script `build.sh' instead. To do this, first run -`configure' as described in INSTALL. Then, instead of typing `make' to -build the program, type `sh build.sh'. This should compile the program -in the current directory. Then you will have a Make program that you can -use for `make install', or whatever else. - -It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such -that if you compile make with `cc -O' on AIX 3.2, it will not work correctly. -It is said that using `cc' without `-O' does work. - -One area that is often a problem in configuration and porting is the code -to check the system's current load average. To make it easier to test and -debug this code, you can do `make check-loadavg' to see if it works -properly on your system. (You must run `configure' beforehand, but you -need not build Make itself to run this test.) - -See the file NEWS for what has changed since previous releases. - -GNU Make is fully documented in make.texinfo. See the section entitled -`Problems and Bugs' for information on submitting bug reports. - -GNU Make is free software. See the file COPYING for copying conditions. diff --git a/buildtools/windows/source/make/README.MOZILLA b/buildtools/windows/source/make/README.MOZILLA deleted file mode 100644 index 3a751d64405..00000000000 --- a/buildtools/windows/source/make/README.MOZILLA +++ /dev/null @@ -1,16 +0,0 @@ -This directory contains the source files for the GNU make -that is used to build some components (e.g., NSPR) on Win32. - -This GNU make is based on version 3.74 and was ported to -Win32 by Netscape engineers. Its default shell is shmsdos.exe, -a lightweight shell written by Netscape engineers. - -To build it, you need Microsoft Visual C++ and nmake. If -you want to change the build number, which is displayed by -the '-v' command line option, you can edit the value of the -macro BUILD_NUMBER in main.c. Then, issue the command: - nmake /f NMakefile -The outputs are WinDebug\make.exe and WinRel\make.exe. -Assuming you want to use the optmized executable file, -copy WinRel\make.exe to a directory on your Path and -rename it gmake.exe. diff --git a/buildtools/windows/source/make/acconfig.h b/buildtools/windows/source/make/acconfig.h deleted file mode 100644 index 192dc0f828a..00000000000 --- a/buildtools/windows/source/make/acconfig.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Define to the name of the SCCS `get' command. */ -#undef SCCS_GET - -/* Define this if the SCCS `get' command understands the `-G' option. */ -#undef SCCS_GET_MINUS_G - -/* Define this if the C library defines the variable `sys_siglist'. */ -#undef HAVE_SYS_SIGLIST - -/* Define this if the C library defines the variable `_sys_siglist'. */ -#undef HAVE__SYS_SIGLIST - -/* Define this if you have the `union wait' type in . */ -#undef HAVE_UNION_WAIT - -/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */ -#undef HAVE_SYSCONF_OPEN_MAX diff --git a/buildtools/windows/source/make/alloca.c b/buildtools/windows/source/make/alloca.c deleted file mode 100644 index 7020f32c882..00000000000 --- a/buildtools/windows/source/make/alloca.c +++ /dev/null @@ -1,492 +0,0 @@ -/* alloca.c -- allocate automatically reclaimed memory - (Mostly) portable public-domain implementation -- D A Gwyn - - This implementation of the PWB library alloca function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - J.Otto Tennant contributed the Cray support. - - There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef emacs -#include "blockinput.h" -#endif - -/* If compiling with GCC 2, this file's not needed. */ -#if !defined (__GNUC__) || __GNUC__ < 2 - -/* If someone has defined alloca as a macro, - there must be some other way alloca is supposed to work. */ -#ifndef alloca - -#ifdef emacs -#ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -#ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -#endif /* STACK_DIRECTION undefined */ -#endif /* static */ -#endif /* emacs */ - -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -#else -#define ADDRESS_FUNCTION(arg) &(arg) -#endif - -#if __STDC__ -typedef void *pointer; -#else -typedef char *pointer; -#endif - -#define NULL 0 - -/* Different portions of Emacs need to call different versions of - malloc. The Emacs executable needs alloca to call xmalloc, because - ordinary malloc isn't protected from input signals. On the other - hand, the utilities in lib-src need alloca to call malloc; some of - them are very simple, and don't have an xmalloc routine. - - Non-Emacs programs expect this to call use xmalloc. - - Callers below should use malloc. */ - -#ifndef emacs -#define malloc xmalloc -#endif -extern pointer malloc (); - -/* Define STACK_DIRECTION if you know the direction of stack - growth for your system; otherwise it will be automatically - deduced at run-time. - - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ - -#ifndef STACK_DIRECTION -#define STACK_DIRECTION 0 /* Direction unknown. */ -#endif - -#if STACK_DIRECTION != 0 - -#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ - -#else /* STACK_DIRECTION == 0; need run-time code. */ - -static int stack_dir; /* 1 or -1 once known. */ -#define STACK_DIR stack_dir - -static void -find_stack_direction () -{ - static char *addr = NULL; /* Address of first `dummy', once known. */ - auto char dummy; /* To get stack address. */ - - if (addr == NULL) - { /* Initial entry. */ - addr = ADDRESS_FUNCTION (dummy); - - find_stack_direction (); /* Recurse once. */ - } - else - { - /* Second entry. */ - if (ADDRESS_FUNCTION (dummy) > addr) - stack_dir = 1; /* Stack grew upward. */ - else - stack_dir = -1; /* Stack grew downward. */ - } -} - -#endif /* STACK_DIRECTION == 0 */ - -/* An "alloca header" is used to: - (a) chain together all alloca'ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc - alignment chunk size. The following default should work okay. */ - -#ifndef ALIGN_SIZE -#define ALIGN_SIZE sizeof(double) -#endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* To force sizeof(header). */ - struct - { - union hdr *next; /* For chaining headers. */ - char *deep; /* For stack depth measure. */ - } h; -} header; - -static header *last_alloca_header = NULL; /* -> last alloca header. */ - -/* Return a pointer to at least SIZE bytes of storage, - which will be automatically reclaimed upon exit from - the procedure that called alloca. Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. */ - -pointer -alloca (size) - unsigned size; -{ - auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); - -#if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* Unknown growth direction. */ - find_stack_direction (); -#endif - - /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* Traverses linked list. */ - -#ifdef emacs - BLOCK_INPUT; -#endif - - for (hp = last_alloca_header; hp != NULL;) - if ((STACK_DIR > 0 && hp->h.deep > depth) - || (STACK_DIR < 0 && hp->h.deep < depth)) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* Collect garbage. */ - - hp = np; /* -> next header. */ - } - else - break; /* Rest are not deeper. */ - - last_alloca_header = hp; /* -> last valid storage. */ - -#ifdef emacs - UNBLOCK_INPUT; -#endif - } - - if (size == 0) - return NULL; /* No allocation required. */ - - /* Allocate combined header + user data storage. */ - - { - register pointer new = malloc (sizeof (header) + size); - /* Address of header. */ - - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; - - last_alloca_header = (header *) new; - - /* User storage begins just after header. */ - - return (pointer) ((char *) new + sizeof (header)); - } -} - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) - -#ifdef DEBUG_I00AFUNC -#include -#endif - -#ifndef CRAY_STACK -#define CRAY_STACK -#ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -#else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -#endif /* CRAY2 */ -#endif /* not CRAY_STACK */ - -#ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == 0) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != 0) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == 0 || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == 0) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != 0); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -#else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -#endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -#endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -#endif /* not CRAY2 */ -#endif /* CRAY */ - -#endif /* no alloca */ -#endif /* not GCC version 2 */ diff --git a/buildtools/windows/source/make/ar.c b/buildtools/windows/source/make/ar.c deleted file mode 100644 index 63fcd34f6f0..00000000000 --- a/buildtools/windows/source/make/ar.c +++ /dev/null @@ -1,317 +0,0 @@ -/* Interface to `ar' archives for GNU Make. -Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" - -#ifndef NO_ARCHIVES - -#include "file.h" -#include "dep.h" -#include - -/* Defined in arscan.c. */ -extern long int ar_scan (); -extern int ar_member_touch (); -extern int ar_name_equal (); - - -/* Return nonzero if NAME is an archive-member reference, zero if not. - An archive-member reference is a name like `lib(member)'. - If a name like `lib((entry))' is used, a fatal error is signaled at - the attempt to use this unsupported feature. */ - -int -ar_name (name) - char *name; -{ - char *p = index (name, '('), *end = name + strlen (name) - 1; - - if (p == 0 || p == name || *end != ')') - return 0; - - if (p[1] == '(' && end[-1] == ')') - fatal ("attempt to use unsupported feature: `%s'", name); - - return 1; -} - - -/* Parse the archive-member reference NAME into the archive and member names. - Put the malloc'd archive name in *ARNAME_P if ARNAME_P is non-nil; - put the malloc'd member name in *MEMNAME_P if MEMNAME_P is non-nil. */ - -void -ar_parse_name (name, arname_p, memname_p) - char *name, **arname_p, **memname_p; -{ - char *p = index (name, '('), *end = name + strlen (name) - 1; - - if (arname_p != 0) - *arname_p = savestring (name, p - name); - - if (memname_p != 0) - *memname_p = savestring (p + 1, end - (p + 1)); -} - -static long int ar_member_date_1 (); - -/* Return the modtime of NAME. */ - -time_t -ar_member_date (name) - char *name; -{ - char *arname; - int arname_used = 0; - char *memname; - long int val; - - ar_parse_name (name, &arname, &memname); - - /* Make sure we know the modtime of the archive itself because we are - likely to be called just before commands to remake a member are run, - and they will change the archive itself. - - But we must be careful not to enter_file the archive itself if it does - not exist, because pattern_search assumes that files found in the data - base exist or can be made. */ - { - struct file *arfile; - arfile = lookup_file (arname); - if (arfile == 0 && file_exists_p (arname)) - { - arfile = enter_file (arname); - arname_used = 1; - } - - if (arfile != 0) - (void) f_mtime (arfile, 0); - } - - val = ar_scan (arname, ar_member_date_1, (long int) memname); - - if (!arname_used) - free (arname); - free (memname); - - return (val <= 0 ? (time_t) -1 : (time_t) val); -} - -/* This function is called by `ar_scan' to find which member to look at. */ - -/* ARGSUSED */ -static long int -ar_member_date_1 (desc, mem, truncated, - hdrpos, datapos, size, date, uid, gid, mode, name) - int desc; - char *mem; - int truncated; - long int hdrpos, datapos, size, date; - int uid, gid, mode; - char *name; -{ - return ar_name_equal (name, mem, truncated) ? date : 0; -} - -/* Set the archive-member NAME's modtime to now. */ - -int -ar_touch (name) - char *name; -{ - char *arname, *memname; - int arname_used = 0; - register int val; - - ar_parse_name (name, &arname, &memname); - - /* Make sure we know the modtime of the archive itself before we - touch the member, since this will change the archive itself. */ - { - struct file *arfile; - arfile = lookup_file (arname); - if (arfile == 0) - { - arfile = enter_file (arname); - arname_used = 1; - } - - (void) f_mtime (arfile, 0); - } - - val = 1; - switch (ar_member_touch (arname, memname)) - { - case -1: - error ("touch: Archive `%s' does not exist", arname); - break; - case -2: - error ("touch: `%s' is not a valid archive", arname); - break; - case -3: - perror_with_name ("touch: ", arname); - break; - case 1: - error ("touch: Member `%s' does not exist in `%s'", memname, arname); - break; - case 0: - val = 0; - break; - default: - error ("touch: Bad return code from ar_member_touch on `%s'", name); - } - - if (!arname_used) - free (arname); - free (memname); - - return val; -} - -/* State of an `ar_glob' run, passed to `ar_glob_match'. */ - -struct ar_glob_state - { - char *arname; - char *pattern; - unsigned int size; - struct nameseq *chain; - unsigned int n; - }; - -/* This function is called by `ar_scan' to match one archive - element against the pattern in STATE. */ - -static long int -ar_glob_match (desc, mem, truncated, - hdrpos, datapos, size, date, uid, gid, mode, - state) - int desc; - char *mem; - int truncated; - long int hdrpos, datapos, size, date; - int uid, gid, mode; - struct ar_glob_state *state; -{ - if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0) - { - /* We have a match. Add it to the chain. */ - struct nameseq *new = (struct nameseq *) xmalloc (state->size); - new->name = concat (state->arname, mem, ")"); - new->next = state->chain; - state->chain = new; - ++state->n; - } - - return 0L; -} - -/* Alphabetic sorting function for `qsort'. */ - -static int -ar_glob_alphacompare (a, b) - char **a, **b; -{ - return strcmp (*a, *b); -} - -/* Return nonzero if PATTERN contains any metacharacters. - Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ -static int -glob_pattern_p (pattern, quote) - const char *pattern; - const int quote; -{ - register const char *p; - int open = 0; - - for (p = pattern; *p != '\0'; ++p) - switch (*p) - { - case '?': - case '*': - return 1; - - case '\\': - if (quote) - ++p; - break; - - case '[': - open = 1; - break; - - case ']': - if (open) - return 1; - break; - } - - return 0; -} - -/* Glob for MEMBER_PATTERN in archive ARNAME. - Return a malloc'd chain of matching elements (or nil if none). */ - -struct nameseq * -ar_glob (arname, member_pattern, size) - char *arname, *member_pattern; - unsigned int size; -{ - struct ar_glob_state state; - char **names; - struct nameseq *n; - unsigned int i; - - if (! glob_pattern_p (member_pattern, 1)) - return 0; - - /* Scan the archive for matches. - ar_glob_match will accumulate them in STATE.chain. */ - i = strlen (arname); - state.arname = (char *) alloca (i + 2); - bcopy (arname, state.arname, i); - state.arname[i] = '('; - state.arname[i + 1] = '\0'; - state.pattern = member_pattern; - state.size = size; - state.chain = 0; - state.n = 0; - (void) ar_scan (arname, ar_glob_match, (long int) &state); - - if (state.chain == 0) - return 0; - - /* Now put the names into a vector for sorting. */ - names = (char **) alloca (state.n * sizeof (char *)); - i = 0; - for (n = state.chain; n != 0; n = n->next) - names[i++] = n->name; - - /* Sort them alphabetically. */ - qsort ((char *) names, i, sizeof (*names), ar_glob_alphacompare); - - /* Put them back into the chain in the sorted order. */ - i = 0; - for (n = state.chain; n != 0; n = n->next) - n->name = names[i++]; - - return state.chain; -} - -#endif /* Not NO_ARCHIVES. */ diff --git a/buildtools/windows/source/make/arscan.c b/buildtools/windows/source/make/arscan.c deleted file mode 100644 index a3dce83c329..00000000000 --- a/buildtools/windows/source/make/arscan.c +++ /dev/null @@ -1,561 +0,0 @@ -/* Library function for scanning an archive file. - Copyright (C) 1987, 89, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" - -#ifdef HAVE_FCNTL_H -#include -#else -#include -#endif - -#ifndef NO_ARCHIVES - -/* SCO Unix's compiler defines both of these. */ -#ifdef M_UNIX -#undef M_XENIX -#endif - -/* On the sun386i and in System V rel 3, ar.h defines two different archive - formats depending upon whether you have defined PORTAR (normal) or PORT5AR - (System V Release 1). There is no default, one or the other must be defined - to have a nonzero value. */ - -#if (!defined (PORTAR) || PORTAR == 0) && (!defined (PORT5AR) || PORT5AR == 0) -#undef PORTAR -#ifdef M_XENIX -/* According to Jim Sievert , for SCO XENIX defining - PORTAR to 1 gets the wrong archive format, and defining it to 0 gets the - right one. */ -#define PORTAR 0 -#else -#define PORTAR 1 -#endif -#endif - -#include - -/* Cray's apparently defines this. */ -#ifndef AR_HDR_SIZE -#define AR_HDR_SIZE (sizeof (struct ar_hdr)) -#endif - -/* Takes three arguments ARCHIVE, FUNCTION and ARG. - - Open the archive named ARCHIVE, find its members one by one, - and for each one call FUNCTION with the following arguments: - archive file descriptor for reading the data, - member name, - member name might be truncated flag, - member header position in file, - member data position in file, - member data size, - member date, - member uid, - member gid, - member protection mode, - ARG. - - The descriptor is poised to read the data of the member - when FUNCTION is called. It does not matter how much - data FUNCTION reads. - - If FUNCTION returns nonzero, we immediately return - what FUNCTION returned. - - Returns -1 if archive does not exist, - Returns -2 if archive has invalid format. - Returns 0 if have scanned successfully. */ - -long int -ar_scan (archive, function, arg) - char *archive; - long int (*function) (); - long int arg; -{ -#ifdef AIAMAG - FL_HDR fl_header; -#else - int long_name = 0; -#endif - char *namemap = 0; - register int desc = open (archive, O_RDONLY, 0); - if (desc < 0) - return -1; -#ifdef SARMAG - { - char buf[SARMAG]; - register int nread = read (desc, buf, SARMAG); - if (nread != SARMAG || bcmp (buf, ARMAG, SARMAG)) - { - (void) close (desc); - return -2; - } - } -#else -#ifdef AIAMAG - { - register int nread = read (desc, (char *) &fl_header, FL_HSZ); - if (nread != FL_HSZ || bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG)) - { - (void) close (desc); - return -2; - } - } -#else - { -#ifndef M_XENIX - int buf; -#else - unsigned short int buf; -#endif - register int nread = read(desc, &buf, sizeof (buf)); - if (nread != sizeof (buf) || buf != ARMAG) - { - (void) close (desc); - return -2; - } - } -#endif -#endif - - /* Now find the members one by one. */ - { -#ifdef SARMAG - register long int member_offset = SARMAG; -#else -#ifdef AIAMAG - long int member_offset; - long int last_member_offset; - - sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset); - sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset); -#else -#ifndef M_XENIX - register long int member_offset = sizeof (int); -#else /* Xenix. */ - register long int member_offset = sizeof (unsigned short int); -#endif /* Not Xenix. */ -#endif -#endif - - while (1) - { - register int nread; - struct ar_hdr member_header; -#ifdef AIAMAG - char name[256]; - int name_len; - long int dateval; - int uidval, gidval; - long int data_offset; -#else - char namebuf[sizeof member_header.ar_name + 1]; - char *name; - int is_namemap; /* Nonzero if this entry maps long names. */ -#endif - long int eltsize; - int eltmode; - long int fnval; - - if (lseek (desc, member_offset, 0) < 0) - { - (void) close (desc); - return -2; - } - -#ifdef AIAMAG -#define AR_MEMHDR (AR_HDR_SIZE - sizeof (member_header._ar_name)) - nread = read (desc, (char *) &member_header, AR_MEMHDR); - - if (nread != AR_MEMHDR) - { - (void) close (desc); - return -2; - } - - sscanf (member_header.ar_namlen, "%4d", &name_len); - nread = read (desc, name, name_len); - - if (nread != name_len) - { - (void) close (desc); - return -2; - } - - name[name_len] = 0; - - sscanf (member_header.ar_date, "%12ld", &dateval); - sscanf (member_header.ar_uid, "%12d", &uidval); - sscanf (member_header.ar_gid, "%12d", &gidval); - sscanf (member_header.ar_mode, "%12o", &eltmode); - sscanf (member_header.ar_size, "%12ld", &eltsize); - - if ((data_offset = member_offset + AR_MEMHDR + name_len + 2) % 2) - ++data_offset; - - fnval = - (*function) (desc, name, 0, - member_offset, data_offset, eltsize, - dateval, uidval, gidval, - eltmode, arg); - -#else /* Not AIAMAG. */ - nread = read (desc, (char *) &member_header, AR_HDR_SIZE); - if (nread == 0) - /* No data left means end of file; that is OK. */ - break; - - if (nread != AR_HDR_SIZE -#ifdef ARFMAG - || bcmp (member_header.ar_fmag, ARFMAG, 2) -#endif - ) - { - (void) close (desc); - return -2; - } - - name = namebuf; - bcopy (member_header.ar_name, name, sizeof member_header.ar_name); - { - register char *p = name + sizeof member_header.ar_name; - do - *p = '\0'; - while (p > name && *--p == ' '); - -#ifndef AIAMAG - /* If the member name is "//" or "ARFILENAMES/" this may be - a list of file name mappings. The maximum file name - length supported by the standard archive format is 14 - characters. This member will actually always be the - first or second entry in the archive, but we don't check - that. */ - is_namemap = (!strcmp (name, "//") - || !strcmp (name, "ARFILENAMES/")); -#endif /* Not AIAMAG. */ - /* On some systems, there is a slash after each member name. */ - if (*p == '/') - *p = '\0'; - -#ifndef AIAMAG - /* If the member name starts with a space or a slash, this - is an index into the file name mappings (used by GNU ar). - Otherwise if the member name looks like #1/NUMBER the - real member name appears in the element data (used by - 4.4BSD). */ - if (! is_namemap - && (name[0] == ' ' || name[0] == '/') - && namemap != 0) - { - name = namemap + atoi (name + 1); - long_name = 1; - } - else if (name[0] == '#' - && name[1] == '1' - && name[2] == '/') - { - int namesize = atoi (name + 3); - - name = (char *) alloca (namesize + 1); - nread = read (desc, name, namesize); - if (nread != namesize) - { - close (desc); - return -2; - } - name[namesize] = '\0'; - - long_name = 1; - } -#endif /* Not AIAMAG. */ - } - -#ifndef M_XENIX - sscanf (member_header.ar_mode, "%o", &eltmode); - eltsize = atol (member_header.ar_size); -#else /* Xenix. */ - eltmode = (unsigned short int) member_header.ar_mode; - eltsize = member_header.ar_size; -#endif /* Not Xenix. */ - - fnval = - (*function) (desc, name, ! long_name, member_offset, - member_offset + AR_HDR_SIZE, eltsize, -#ifndef M_XENIX - atol (member_header.ar_date), - atoi (member_header.ar_uid), - atoi (member_header.ar_gid), -#else /* Xenix. */ - member_header.ar_date, - member_header.ar_uid, - member_header.ar_gid, -#endif /* Not Xenix. */ - eltmode, arg); - -#endif /* AIAMAG. */ - - if (fnval) - { - (void) close (desc); - return fnval; - } - -#ifdef AIAMAG - if (member_offset == last_member_offset) - /* End of the chain. */ - break; - - sscanf (member_header.ar_nxtmem, "%12ld", &member_offset); - - if (lseek (desc, member_offset, 0) != member_offset) - { - (void) close (desc); - return -2; - } -#else - - /* If this member maps archive names, we must read it in. The - name map will always precede any members whose names must - be mapped. */ - if (is_namemap) - { - char *clear; - char *limit; - - namemap = (char *) alloca (eltsize); - nread = read (desc, namemap, eltsize); - if (nread != eltsize) - { - (void) close (desc); - return -2; - } - - /* The names are separated by newlines. Some formats have - a trailing slash. Null terminate the strings for - convenience. */ - limit = namemap + eltsize; - for (clear = namemap; clear < limit; clear++) - { - if (*clear == '\n') - { - *clear = '\0'; - if (clear[-1] == '/') - clear[-1] = '\0'; - } - } - - is_namemap = 0; - } - - member_offset += AR_HDR_SIZE + eltsize; - if (member_offset % 2 != 0) - member_offset++; -#endif - } - } - - close (desc); - return 0; -} - -/* Return nonzero iff NAME matches MEM. - If TRUNCATED is nonzero, MEM may be truncated to - sizeof (struct ar_hdr.ar_name) - 1. */ - -int -ar_name_equal (name, mem, truncated) - char *name, *mem; - int truncated; -{ - char *p; - - p = rindex (name, '/'); - if (p != 0) - name = p + 1; - - /* We no longer use this kludge, since we - now support long archive member names. */ - -#if 0 && !defined (AIAMAG) && !defined (APOLLO) - - { - /* `reallylongname.o' matches `reallylongnam.o'. - If member names have a trailing slash, that's `reallylongna.o'. */ - - struct ar_hdr h; - unsigned int max = sizeof (h.ar_name); - unsigned int namelen, memlen; - - if (strncmp (name, mem, max - 3)) - return 0; - - namelen = strlen (name); - memlen = strlen (mem); - - if (namelen > memlen && memlen >= max - 1 - && name[namelen - 2] == '.' && name[namelen - 1] == 'o' - && mem[memlen - 2] == '.' && mem[memlen - 1] == 'o') - return 1; - - if (namelen != memlen) - return 0; - - return (namelen < max - 3 || !strcmp (name + max - 3, mem + max - 3)); - } - -#else /* AIX or APOLLO. */ - - if (truncated) - { -#ifdef AIAMAG - /* TRUNCATED should never be set on this system. */ - abort (); -#else - struct ar_hdr hdr; - return !strncmp (name, mem, - sizeof (hdr.ar_name) - -#if !defined (__hpux) && !defined (cray) - 1 -#else - 2 -#endif /* !__hpux && !cray */ - ); -#endif - } - - return !strcmp (name, mem); - -#endif -} - -/* ARGSUSED */ -static long int -ar_member_pos (desc, mem, truncated, - hdrpos, datapos, size, date, uid, gid, mode, name) - int desc; - char *mem; - int truncated; - long int hdrpos, datapos, size, date; - int uid, gid, mode; - char *name; -{ - if (!ar_name_equal (name, mem, truncated)) - return 0; - return hdrpos; -} - -/* Set date of member MEMNAME in archive ARNAME to current time. - Returns 0 if successful, - -1 if file ARNAME does not exist, - -2 if not a valid archive, - -3 if other random system call error (including file read-only), - 1 if valid but member MEMNAME does not exist. */ - -int -ar_member_touch (arname, memname) - char *arname, *memname; -{ - register long int pos = ar_scan (arname, ar_member_pos, (long int) memname); - register int fd; - struct ar_hdr ar_hdr; - register int i; - struct stat statbuf; - - if (pos < 0) - return (int) pos; - if (!pos) - return 1; - - fd = open (arname, O_RDWR, 0666); - if (fd < 0) - return -3; - /* Read in this member's header */ - if (lseek (fd, pos, 0) < 0) - goto lose; - if (AR_HDR_SIZE != read (fd, (char *) &ar_hdr, AR_HDR_SIZE)) - goto lose; - /* Write back the header, thus touching the archive file. */ - if (lseek (fd, pos, 0) < 0) - goto lose; - if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE)) - goto lose; - /* The file's mtime is the time we we want. */ -#ifdef EINTR - while (fstat (fd, &statbuf) < 0 && errno == EINTR); -#else - fstat (fd, &statbuf); -#endif -#if defined(ARFMAG) || defined(AIAMAG) - /* Advance member's time to that time */ - for (i = 0; i < sizeof ar_hdr.ar_date; i++) - ar_hdr.ar_date[i] = ' '; - sprintf (ar_hdr.ar_date, "%ld", (long int) statbuf.st_mtime); -#ifdef AIAMAG - ar_hdr.ar_date[strlen(ar_hdr.ar_date)] = ' '; -#endif -#else - ar_hdr.ar_date = statbuf.st_mtime; -#endif - /* Write back this member's header */ - if (lseek (fd, pos, 0) < 0) - goto lose; - if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE)) - goto lose; - close (fd); - return 0; - - lose: - i = errno; - close (fd); - errno = i; - return -3; -} - -#ifdef TEST - -long int -describe_member (desc, name, truncated, - hdrpos, datapos, size, date, uid, gid, mode) - int desc; - char *name; - int truncated; - long int hdrpos, datapos, size, date; - int uid, gid, mode; -{ - extern char *ctime (); - - printf ("Member `%s'%s: %ld bytes at %ld (%ld).\n", - name, truncated ? " (name might be truncated)" : "", - size, hdrpos, datapos); - printf (" Date %s", ctime (&date)); - printf (" uid = %d, gid = %d, mode = 0%o.\n", uid, gid, mode); - - return 0; -} - -main (argc, argv) - int argc; - char **argv; -{ - ar_scan (argv[1], describe_member); - return 0; -} - -#endif /* TEST. */ - -#endif /* NO_ARCHIVES. */ diff --git a/buildtools/windows/source/make/build.sh.in b/buildtools/windows/source/make/build.sh.in deleted file mode 100644 index 1667f0e15ac..00000000000 --- a/buildtools/windows/source/make/build.sh.in +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# Shell script to build GNU Make in the absence of any `make' program. -# @configure_input@ - -# Copyright (C) 1993, 1994 Free Software Foundation, Inc. -# This file is part of GNU Make. -# -# GNU Make is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Make is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Make; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -# See Makefile.in for comments describing these variables. - -srcdir='@srcdir@' -CC='@CC@' -CFLAGS='@CFLAGS@' -CPPFLAGS='@CPPFLAGS@' -LDFLAGS='@LDFLAGS@' -defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"' -ALLOCA='@ALLOCA@' -LOADLIBES='@LIBS@' -extras='@LIBOBJS@' -REMOTE='@REMOTE@' - -# Common prefix for machine-independent installed files. -prefix='@prefix@' -# Common prefix for machine-dependent installed files. -exec_prefix='@exec_prefix@' -# Directory to find libraries in for `-lXXX'. -libdir=${exec_prefix}/lib -# Directory to search by default for included makefiles. -includedir=${prefix}/include - -# Exit as soon as any command fails. -set -e - -# These are all the objects we need to link together. -objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}" - -# Compile the source files into those objects. -for file in `echo ${objs} | sed 's/\.o/.c/g'`; do - echo compiling ${file}... - $CC $defines $CPPFLAGS $CFLAGS \ - -c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file -done - -# The object files were actually all put in the current directory. -# Remove the source directory names from the list. -srcobjs="$objs" -objs= -for obj in $srcobjs; do - objs="$objs `basename $obj`" -done - -# Link all the objects together. -echo linking make... -$CC $LDFLAGS $objs $LOADLIBES -o make.new -echo done -mv -f make.new make diff --git a/buildtools/windows/source/make/commands.c b/buildtools/windows/source/make/commands.c deleted file mode 100644 index 7c5614f0f4a..00000000000 --- a/buildtools/windows/source/make/commands.c +++ /dev/null @@ -1,521 +0,0 @@ -/* Command processing for GNU Make. -Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "dep.h" -#include "commands.h" -#include "file.h" -#include "variable.h" -#include "job.h" - -extern int remote_kill (); - -#ifndef HAVE_UNISTD_H -extern int getpid (); -#endif - -/* Set FILE's automatic variables up. */ - -static void -set_file_variables (file) - register struct file *file; -{ -// register char *p; - char *at, *percent, *star, *less; - -#ifndef NO_ARCHIVES - /* If the target is an archive member `lib(member)', - then $@ is `lib' and $% is `member'. */ - - if (ar_name (file->name)) - { - unsigned int len; - p = index (file->name, '('); - at = (char *) alloca (p - file->name + 1); - bcopy (file->name, at, p - file->name); - at[p - file->name] = '\0'; - len = strlen (p + 1); - percent = (char *) alloca (len); - bcopy (p + 1, percent, len - 1); - percent[len - 1] = '\0'; - } - else -#endif /* NO_ARCHIVES. */ - { - at = file->name; - percent = ""; - } - - /* $* is the stem from an implicit or static pattern rule. */ - if (file->stem == 0) - { - /* In Unix make, $* is set to the target name with - any suffix in the .SUFFIXES list stripped off for - explicit rules. We store this in the `stem' member. */ - register struct dep *d; - char *name; - unsigned int len; - -#ifndef NO_ARCHIVES - if (ar_name (file->name)) - { - name = index (file->name, '(') + 1; - len = strlen (name) - 1; - } - else -#endif - { - name = file->name; - len = strlen (name); - } - - for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next) - { - unsigned int slen = strlen (dep_name (d)); - if (len > slen && !strncmp (dep_name (d), name + (len - slen), slen)) - { - file->stem = savestring (name, len - slen); - break; - } - } - if (d == 0) - file->stem = ""; - } - star = file->stem; - - /* $< is the first dependency. */ - less = file->deps != 0 ? dep_name (file->deps) : ""; - - if (file->cmds == default_file->cmds) - /* This file got its commands from .DEFAULT. - In this case $< is the same as $@. */ - less = at; - -#define DEFINE_VARIABLE(name, len, value) \ - (void) define_variable_for_file (name, len, value, o_automatic, 0, file) - - /* Define the variables. */ - - DEFINE_VARIABLE ("<", 1, less); - DEFINE_VARIABLE ("*", 1, star); - DEFINE_VARIABLE ("@", 1, at); - DEFINE_VARIABLE ("%", 1, percent); - - /* Compute the values for $^, $+, and $?. */ - - { - register unsigned int qmark_len, plus_len; - char *caret_value, *plus_value; - register char *cp; - char *qmark_value; - register char *qp; - register struct dep *d; - unsigned int len; - - /* Compute first the value for $+, which is supposed to contain - duplicate dependencies as they were listed in the makefile. */ - - plus_len = 0; - for (d = file->deps; d != 0; d = d->next) - plus_len += strlen (dep_name (d)) + 1; - - len = plus_len == 0 ? 1 : plus_len; - cp = plus_value = (char *) alloca (len); - - qmark_len = plus_len; /* Will be this or less. */ - for (d = file->deps; d != 0; d = d->next) - { - char *c = dep_name (d); - -#ifndef NO_ARCHIVES - if (ar_name (c)) - { - c = index (c, '(') + 1; - len = strlen (c) - 1; - } - else -#endif - len = strlen (c); - - bcopy (c, cp, len); - cp += len; - *cp++ = ' '; - - if (! d->changed) - qmark_len -= len + 1; /* Don't space in $? for this one. */ - } - - /* Kill the last space and define the variable. */ - - cp[cp > plus_value ? -1 : 0] = '\0'; - DEFINE_VARIABLE ("+", 1, plus_value); - - /* Make sure that no dependencies are repeated. This does not - really matter for the purpose of updating targets, but it - might make some names be listed twice for $^ and $?. */ - - uniquize_deps (file->deps); - - /* Compute the values for $^ and $?. */ - - cp = caret_value = plus_value; /* Reuse the buffer; it's big enough. */ - len = qmark_len == 0 ? 1 : qmark_len; - qp = qmark_value = (char *) alloca (len); - - for (d = file->deps; d != 0; d = d->next) - { - char *c = dep_name (d); - -#ifndef NO_ARCHIVES - if (ar_name (c)) - { - c = index (c, '(') + 1; - len = strlen (c) - 1; - } - else -#endif - len = strlen (c); - - bcopy (c, cp, len); - cp += len; - *cp++ = ' '; - - if (d->changed) - { - bcopy (c, qp, len); - qp += len; - *qp++ = ' '; - } - } - - /* Kill the last spaces and define the variables. */ - - cp[cp > caret_value ? -1 : 0] = '\0'; - DEFINE_VARIABLE ("^", 1, caret_value); - - qp[qp > qmark_value ? -1 : 0] = '\0'; - DEFINE_VARIABLE ("?", 1, qmark_value); - } - -#undef DEFINE_VARIABLE -} - -/* Chop CMDS up into individual command lines if necessary. - Also set the `lines_flag' and `any_recurse' members. */ - -void -chop_commands (cmds) - register struct commands *cmds; -{ - if (cmds != 0 && cmds->command_lines == 0) - { - /* Chop CMDS->commands up into lines in CMDS->command_lines. - Also set the corresponding CMDS->lines_flags elements, - and the CMDS->any_recurse flag. */ - register char *p; - unsigned int nlines, idx; - char **lines; - - nlines = 5; - lines = (char **) xmalloc (5 * sizeof (char *)); - idx = 0; - p = cmds->commands; - while (*p != '\0') - { - char *end = p; - find_end:; - end = index (end, '\n'); - if (end == 0) - end = p + strlen (p); - else if (end > p && end[-1] == '\\') - { - int backslash = 1; - register char *b; - for (b = end - 2; b >= p && *b == '\\'; --b) - backslash = !backslash; - if (backslash) - { - ++end; - goto find_end; - } - } - - if (idx == nlines) - { - nlines += 2; - lines = (char **) xrealloc ((char *) lines, - nlines * sizeof (char *)); - } - lines[idx++] = savestring (p, end - p); - p = end; - if (*p != '\0') - ++p; - } - - if (idx != nlines) - { - nlines = idx; - lines = (char **) xrealloc ((char *) lines, - nlines * sizeof (char *)); - } - - cmds->ncommand_lines = nlines; - cmds->command_lines = lines; - - cmds->any_recurse = 0; - cmds->lines_flags = (char *) xmalloc (nlines); - for (idx = 0; idx < nlines; ++idx) - { - int flags = 0; - - for (p = lines[idx]; - isblank (*p) || *p == '-' || *p == '@' || *p == '+'; - ++p) - switch (*p) - { - case '+': - flags |= COMMANDS_RECURSE; - break; - case '@': - flags |= COMMANDS_SILENT; - break; - case '-': - flags |= COMMANDS_NOERROR; - break; - } - if (!(flags & COMMANDS_RECURSE)) - { - unsigned int len = strlen (p); - if (sindex (p, len, "$(MAKE)", 7) != 0 - || sindex (p, len, "${MAKE}", 7) != 0) - flags |= COMMANDS_RECURSE; - } - - cmds->lines_flags[idx] = flags; - cmds->any_recurse |= flags & COMMANDS_RECURSE; - } - } -} - -/* Execute the commands to remake FILE. If they are currently executing, - return or have already finished executing, just return. Otherwise, - fork off a child process to run the first command line in the sequence. */ - -void -execute_file_commands (file) - struct file *file; -{ - register char *p; - - /* Don't go through all the preparations if - the commands are nothing but whitespace. */ - - for (p = file->cmds->commands; *p != '\0'; ++p) - if (!isspace (*p) && *p != '-' && *p != '@') - break; - if (*p == '\0') - { - /* We are all out of commands. - If we have gotten this far, all the previous commands - have run successfully, so we have winning update status. */ - file->update_status = 0; - notice_finished_file (file); - return; - } - - /* First set the automatic variables according to this file. */ - - initialize_file_variables (file); - - set_file_variables (file); - - /* Start the commands running. */ - new_job (file); -} - -/* This is set while we are inside fatal_error_signal, - so things can avoid nonreentrant operations. */ - -int handling_fatal_signal = 0; - -/* Handle fatal signals. */ - -RETSIGTYPE -fatal_error_signal (sig) - int sig; -{ -#if defined(__MSDOS__) || defined(NETSCAPE) - remove_intermediates (1); - exit (1); -#else /* Not MSDOS. */ - handling_fatal_signal = 1; - - /* Set the handling for this signal to the default. - It is blocked now while we run this handler. */ - signal (sig, SIG_DFL); - - /* A termination signal won't be sent to the entire - process group, but it means we want to kill the children. */ - - if (sig == SIGTERM) - { - register struct child *c; - for (c = children; c != 0; c = c->next) - if (!c->remote) - (void) kill (c->pid, SIGTERM); - } - - /* If we got a signal that means the user - wanted to kill make, remove pending targets. */ - - if (sig == SIGTERM || sig == SIGINT || sig == SIGHUP || sig == SIGQUIT) - { - register struct child *c; - - /* Remote children won't automatically get signals sent - to the process group, so we must send them. */ - for (c = children; c != 0; c = c->next) - if (c->remote) - (void) remote_kill (c->pid, sig); - - for (c = children; c != 0; c = c->next) - delete_child_targets (c); - - /* Clean up the children. We don't just use the call below because - we don't want to print the "Waiting for children" message. */ - while (job_slots_used > 0) - reap_children (1, 0); - } - else - /* Wait for our children to die. */ - while (job_slots_used > 0) - reap_children (1, 1); - - /* Delete any non-precious intermediate files that were made. */ - - remove_intermediates (1); - - if (sig == SIGQUIT) - /* We don't want to send ourselves SIGQUIT, because it will - cause a core dump. Just exit instead. */ - exit (1); - - /* Signal the same code; this time it will really be fatal. The signal - will be unblocked when we return and arrive then to kill us. */ - if (kill (getpid (), sig) < 0) - pfatal_with_name ("kill"); -#endif /* MSDOS. */ -} - -/* Delete FILE unless it's precious or not actually a file (phony), - and it has changed on disk since we last stat'd it. */ - -static void -delete_target (file, on_behalf_of) - struct file *file; - char *on_behalf_of; -{ - struct stat st; - - if (file->precious || file->phony) - return; - -#ifndef NO_ARCHIVES - if (ar_name (file->name)) - { - if (ar_member_date (file->name) != file->last_mtime) - { - if (on_behalf_of) - error ("*** [%s] Archive member `%s' may be bogus; not deleted", - on_behalf_of, file->name); - else - error ("*** Archive member `%s' may be bogus; not deleted", - file->name); - } - return; - } -#endif - - if (safe_stat (file->name, &st) == 0 - && S_ISREG (st.st_mode) - && (time_t) st.st_mtime != file->last_mtime) - { - if (on_behalf_of) - error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name); - else - error ("*** Deleting file `%s'", file->name); - if (unlink (file->name) < 0) - perror_with_name ("unlink: ", file->name); - } -} - - -/* Delete all non-precious targets of CHILD unless they were already deleted. - Set the flag in CHILD to say they've been deleted. */ - -void -delete_child_targets (child) - struct child *child; -{ - struct dep *d; - - if (child->deleted) - return; - - /* Delete the target file if it changed. */ - delete_target (child->file, (char *) 0); - - /* Also remove any non-precious targets listed in the `also_make' member. */ - for (d = child->file->also_make; d != 0; d = d->next) - delete_target (d->file, child->file->name); - - child->deleted = 1; -} - -/* Print out the commands in CMDS. */ - -void -print_commands (cmds) - register struct commands *cmds; -{ - register char *s; - - fputs ("# commands to execute", stdout); - - if (cmds->filename == 0) - puts (" (built-in):"); - else - printf (" (from `%s', line %u):\n", cmds->filename, cmds->lineno); - - s = cmds->commands; - while (*s != '\0') - { - char *end; - - while (isspace (*s)) - ++s; - - end = index (s, '\n'); - if (end == 0) - end = s + strlen (s); - - printf ("\t%.*s\n", (int) (end - s), s); - - s = end; - } -} diff --git a/buildtools/windows/source/make/commands.h b/buildtools/windows/source/make/commands.h deleted file mode 100644 index 31de16ae79e..00000000000 --- a/buildtools/windows/source/make/commands.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Definition of data structures describing shell commands for GNU Make. -Copyright (C) 1988, 1989, 1991, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Structure that gives the commands to make a file - and information about where these commands came from. */ - -struct commands - { - char *filename; /* File that contains commands. */ - unsigned int lineno; /* Line number in file. */ - char *commands; /* Commands text. */ - unsigned int ncommand_lines;/* Number of command lines. */ - char **command_lines; /* Commands chopped up into lines. */ - char *lines_flags; /* One set of flag bits for each line. */ - int any_recurse; /* Nonzero if any `lines_recurse' elt has */ - /* the COMMANDS_RECURSE bit set. */ - }; - -/* Bits in `lines_flags'. */ -#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */ -#define COMMANDS_SILENT 2 /* Silent: @. */ -#define COMMANDS_NOERROR 4 /* No errors: -. */ - -extern void execute_file_commands (); -extern void print_commands (); -extern void delete_child_targets (); -extern void chop_commands (); diff --git a/buildtools/windows/source/make/config.h b/buildtools/windows/source/make/config.h deleted file mode 100644 index 8c12f31d0c2..00000000000 --- a/buildtools/windows/source/make/config.h +++ /dev/null @@ -1,275 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -#undef _ALL_SOURCE -#endif - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define for DGUX with . */ -#undef DGUX - -/* Define if the `getloadavg' function needs to be run setuid or setgid. */ -#undef GETLOADAVG_PRIVILEGED - -/* Define to `int' if doesn't define. */ -#define gid_t - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define if you don't have vprintf but do have _doprnt. */ -#undef HAVE_DOPRNT - -/* Define if your system has its own `getloadavg' function. */ -#undef HAVE_GETLOADAVG - -/* Define if you have the getmntent function. */ -#undef HAVE_GETMNTENT - -/* Define if the `long double' type works. */ -#undef HAVE_LONG_DOUBLE - -/* Define if you support file names longer than 14 characters. */ -#define HAVE_LONG_FILE_NAMES - -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define if system calls automatically restart after interruption - by a signal. */ -#undef HAVE_RESTARTABLE_SYSCALLS - -/* Define if your struct stat has st_blksize. */ -#undef HAVE_ST_BLKSIZE - -/* Define if your struct stat has st_blocks. */ -#undef HAVE_ST_BLOCKS - -/* Define if you have the strcoll function and it is properly defined. */ -#undef HAVE_STRCOLL - -/* Define if your struct stat has st_rdev. */ -#undef HAVE_ST_RDEV - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME - -/* Define if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define if your struct tm has tm_zone. */ -#undef HAVE_TM_ZONE - -/* Define if you don't have tm_zone but do have the external array - tzname. */ -#define HAVE_TZNAME - -/* Define if you have . */ -#undef HAVE_UNISTD_H - -/* Define if utime(file, NULL) sets file's timestamp to the present. */ -#define HAVE_UTIME_NULL - -/* Define if you have . */ -#undef HAVE_VFORK_H - -/* Define if you have the vprintf function. */ -#undef HAVE_VPRINTF - -/* Define if you have the wait3 system call. */ -#undef HAVE_WAIT3 - -/* Define if on MINIX. */ -#undef _MINIX - -/* Define if your struct nlist has an n_un member. */ -#undef NLIST_NAME_UNION - -/* Define if you have . */ -#undef NLIST_STRUCT - -/* Define if your C compiler doesn't accept -c and -o together. */ -#define NO_MINUS_C_MINUS_O - -/* Define to `int' if doesn't define. */ -#define pid_t int - -/* Define if the system does not provide POSIX.1 features except - with this defined. */ -#undef _POSIX_1_SOURCE - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE - -/* Define if the setvbuf function takes the buffering type as its second - argument and the buffer pointer as the third, as on System V - before release 3. */ -#undef SETVBUF_REVERSED - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Define if the `S_IS*' macros in do not work properly. */ -#define STAT_MACROS_BROKEN - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS - -/* Define on System V Release 4. */ -#undef SVR4 - -/* Define if `sys_siglist' is declared by . */ -#undef SYS_SIGLIST_DECLARED - -/* Define to `int' if doesn't define. */ -#define uid_t int - -/* Define for Encore UMAX. */ -#undef UMAX - -/* Define for Encore UMAX 4.3 that has - instead of . */ -#undef UMAX4_3 - -/* Define vfork as fork if vfork does not work. */ -#undef vfork - -/* Define to the name of the SCCS `get' command. */ -#define SCCS_GET "get" - -/* Define this if the SCCS `get' command understands the `-G' option. */ -#undef SCCS_GET_MINUS_G - -/* Define this if the C library defines the variable `sys_siglist'. */ -#undef HAVE_SYS_SIGLIST - -/* Define this if the C library defines the variable `_sys_siglist'. */ -#undef HAVE__SYS_SIGLIST - -/* Define this if you have the `union wait' type in . */ -#undef HAVE_UNION_WAIT - -/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */ -#undef HAVE_SYSCONF_OPEN_MAX - -/* Define if you have the dup2 function. */ -#undef HAVE_DUP2 - -/* Define if you have the getcwd function. */ -#define HAVE_GETCWD - -/* Define if you have the getdtablesize function. */ -#undef HAVE_GETDTABLESIZE - -/* Define if you have the getgroups function. */ -#undef HAVE_GETGROUPS - -/* Define if you have the mktemp function. */ -#undef HAVE_MKTEMP - -/* Define if you have the psignal function. */ -#undef HAVE_PSIGNAL - -/* Define if you have the setegid function. */ -#undef HAVE_SETEGID - -/* Define if you have the seteuid function. */ -#undef HAVE_SETEUID - -/* Define if you have the setlinebuf function. */ -#undef HAVE_SETLINEBUF - -/* Define if you have the setregid function. */ -#undef HAVE_SETREGID - -/* Define if you have the setreuid function. */ -#undef HAVE_SETREUID - -/* Define if you have the sigsetmask function. */ -#undef HAVE_SIGSETMASK - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR - -/* Define if you have the strsignal function. */ -#undef HAVE_STRSIGNAL - -/* Define if you have the wait3 function. */ -#undef HAVE_WAIT3 - -/* Define if you have the waitpid function. */ -#undef HAVE_WAITPID - -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_MACH_MACH_H - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H - -/* Define if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the header file. */ -#define HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the dgc library (-ldgc). */ -#undef HAVE_LIBDGC - -/* Define if you have the sun library (-lsun). */ -#undef HAVE_LIBSUN - -/* NETSCAPE: Under win32, define default libdir */ -#define LIBDIR "\\msvc20\\lib" -#define NO_ARCHIVES -#define HAVE_GLOB_H diff --git a/buildtools/windows/source/make/config.h.in b/buildtools/windows/source/make/config.h.in deleted file mode 100644 index 56af1f3a4ac..00000000000 --- a/buildtools/windows/source/make/config.h.in +++ /dev/null @@ -1,270 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -#undef _ALL_SOURCE -#endif - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define for DGUX with . */ -#undef DGUX - -/* Define if the `getloadavg' function needs to be run setuid or setgid. */ -#undef GETLOADAVG_PRIVILEGED - -/* Define to `int' if doesn't define. */ -#undef gid_t - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define if you don't have vprintf but do have _doprnt. */ -#undef HAVE_DOPRNT - -/* Define if your system has its own `getloadavg' function. */ -#undef HAVE_GETLOADAVG - -/* Define if you have the getmntent function. */ -#undef HAVE_GETMNTENT - -/* Define if the `long double' type works. */ -#undef HAVE_LONG_DOUBLE - -/* Define if you support file names longer than 14 characters. */ -#undef HAVE_LONG_FILE_NAMES - -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define if system calls automatically restart after interruption - by a signal. */ -#undef HAVE_RESTARTABLE_SYSCALLS - -/* Define if your struct stat has st_blksize. */ -#undef HAVE_ST_BLKSIZE - -/* Define if your struct stat has st_blocks. */ -#undef HAVE_ST_BLOCKS - -/* Define if you have the strcoll function and it is properly defined. */ -#undef HAVE_STRCOLL - -/* Define if your struct stat has st_rdev. */ -#undef HAVE_ST_RDEV - -/* Define if you have the strftime function. */ -#undef HAVE_STRFTIME - -/* Define if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define if your struct tm has tm_zone. */ -#undef HAVE_TM_ZONE - -/* Define if you don't have tm_zone but do have the external array - tzname. */ -#undef HAVE_TZNAME - -/* Define if you have . */ -#undef HAVE_UNISTD_H - -/* Define if utime(file, NULL) sets file's timestamp to the present. */ -#undef HAVE_UTIME_NULL - -/* Define if you have . */ -#undef HAVE_VFORK_H - -/* Define if you have the vprintf function. */ -#undef HAVE_VPRINTF - -/* Define if you have the wait3 system call. */ -#undef HAVE_WAIT3 - -/* Define if on MINIX. */ -#undef _MINIX - -/* Define if your struct nlist has an n_un member. */ -#undef NLIST_NAME_UNION - -/* Define if you have . */ -#undef NLIST_STRUCT - -/* Define if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - -/* Define to `int' if doesn't define. */ -#undef pid_t - -/* Define if the system does not provide POSIX.1 features except - with this defined. */ -#undef _POSIX_1_SOURCE - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE - -/* Define if the setvbuf function takes the buffering type as its second - argument and the buffer pointer as the third, as on System V - before release 3. */ -#undef SETVBUF_REVERSED - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Define if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define on System V Release 4. */ -#undef SVR4 - -/* Define if `sys_siglist' is declared by . */ -#undef SYS_SIGLIST_DECLARED - -/* Define to `int' if doesn't define. */ -#undef uid_t - -/* Define for Encore UMAX. */ -#undef UMAX - -/* Define for Encore UMAX 4.3 that has - instead of . */ -#undef UMAX4_3 - -/* Define vfork as fork if vfork does not work. */ -#undef vfork - -/* Define to the name of the SCCS `get' command. */ -#undef SCCS_GET - -/* Define this if the SCCS `get' command understands the `-G' option. */ -#undef SCCS_GET_MINUS_G - -/* Define this if the C library defines the variable `sys_siglist'. */ -#undef HAVE_SYS_SIGLIST - -/* Define this if the C library defines the variable `_sys_siglist'. */ -#undef HAVE__SYS_SIGLIST - -/* Define this if you have the `union wait' type in . */ -#undef HAVE_UNION_WAIT - -/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */ -#undef HAVE_SYSCONF_OPEN_MAX - -/* Define if you have the dup2 function. */ -#undef HAVE_DUP2 - -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD - -/* Define if you have the getdtablesize function. */ -#undef HAVE_GETDTABLESIZE - -/* Define if you have the getgroups function. */ -#undef HAVE_GETGROUPS - -/* Define if you have the mktemp function. */ -#undef HAVE_MKTEMP - -/* Define if you have the psignal function. */ -#undef HAVE_PSIGNAL - -/* Define if you have the setegid function. */ -#undef HAVE_SETEGID - -/* Define if you have the seteuid function. */ -#undef HAVE_SETEUID - -/* Define if you have the setlinebuf function. */ -#undef HAVE_SETLINEBUF - -/* Define if you have the setregid function. */ -#undef HAVE_SETREGID - -/* Define if you have the setreuid function. */ -#undef HAVE_SETREUID - -/* Define if you have the sigsetmask function. */ -#undef HAVE_SIGSETMASK - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR - -/* Define if you have the strsignal function. */ -#undef HAVE_STRSIGNAL - -/* Define if you have the wait3 function. */ -#undef HAVE_WAIT3 - -/* Define if you have the waitpid function. */ -#undef HAVE_WAITPID - -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_MACH_MACH_H - -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the dgc library (-ldgc). */ -#undef HAVE_LIBDGC - -/* Define if you have the sun library (-lsun). */ -#undef HAVE_LIBSUN diff --git a/buildtools/windows/source/make/configh.dos b/buildtools/windows/source/make/configh.dos deleted file mode 100644 index da5681bc93d..00000000000 --- a/buildtools/windows/source/make/configh.dos +++ /dev/null @@ -1,136 +0,0 @@ -/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */ - - - -#define INCLUDEDIR "c:/djgpp/include" - -#define LIBDIR "c:/djgpp/lib" - - - -/* Define if you have dirent.h. */ - -#define DIRENT - - - -/* Define if you have the strcoll function and it is properly defined. */ - -#define HAVE_STRCOLL - - - -/* Define if you have unistd.h. */ - -#define HAVE_UNISTD_H - - - -/* Define as the return type of signal handlers (int or void). */ - -#define RETSIGTYPE void - - - -/* Define if you have the ANSI C header files. */ - -#ifndef STDC_HEADERS - -#define STDC_HEADERS - -#endif - - - -/* Define if `sys_siglist' is declared by . */ - -#define SYS_SIGLIST_DECLARED - - - -/* Define if you have getdtablesize. */ - -#define HAVE_GETDTABLESIZE - - - -/* Define if you have dup2. */ - -#define HAVE_DUP2 - - - -/* Define if you have sys_siglist. */ - -#undef HAVE_SYS_SIGLIST - - - -/* Define if you have _sys_siglist. */ - -#undef HAVE__SYS_SIGLIST - - - -/* Define if you have psignal. */ - -#define HAVE_PSIGNAL - - - -/* Define if you have getcwd. */ - -#define HAVE_GETCWD - - - -/* Define if you have sigsetmask. */ - -#define HAVE_SIGSETMASK - - - -/* Define if you have setlinebuf. */ - -#define HAVE_SETLINEBUF - - - -/* Define if you have the header file. */ - -#define HAVE_LIMITS_H - - - -/* Define if you have the header file. */ - -#undef HAVE_SYS_PARAM_H - - - -/* Define if you have the header file. */ - -#define HAVE_FCNTL_H - - - -/* Define if you have the header file. */ - -#define HAVE_STRING_H - - - -/* Define if you have the header file. */ - -#define HAVE_MEMORY_H - - - -/* Define if you have the `strerror' function. */ - -#define HAVE_STRERROR - - - -#define SCCS_GET "get" - diff --git a/buildtools/windows/source/make/configure b/buildtools/windows/source/make/configure deleted file mode 100644 index ec939c3e779..00000000000 --- a/buildtools/windows/source/make/configure +++ /dev/null @@ -1,2991 +0,0 @@ -#! /bin/sh - -# From configure.in Id: configure.in,v 1.48 1995/03/21 21:23:26 roland Exp -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.3 -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help -export jobs with the Customs daemon (NOT SUPPORTED)" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE - -# Initialize some other variables. -subdirs= - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -build | --build | --buil | --bui | --bu | --b) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=PREFIX install architecture-dependent files in PREFIX - [same as prefix] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR ---enable and --with options recognized:$ac_help -EOF - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.3" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=vpath.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -subdirs="glob" - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -set dummy ${MAKE-make}; ac_make=$2 -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -if test $ac_cv_prog_gcc = yes; then - GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes -else - ac_cv_prog_gcc_g=no -fi -rm -f conftest* - -fi - echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_ifs" - # As a last resort, use the slow shell script. - test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" -fi - INSTALL="$ac_cv_path_install" -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi -fi -CPP="$ac_cv_prog_CPP" -echo "$ac_t""$CPP" 1>&6 - echo $ac_n "checking for AIX""... $ac_c" 1>&6 -cat > conftest.$ac_ext <&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF -#define _ALL_SOURCE 1 -EOF - -else - rm -rf conftest* - echo "$ac_t""no" 1>&6 -fi -rm -f conftest* - - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - -ac_safe=`echo "minix/config.h" | tr './\055' '___'` -echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - MINIX=yes -else - echo "$ac_t""no" 1>&6 -MINIX= -fi - -if test "$MINIX" = yes; then - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define _POSIX_1_SOURCE 2 -EOF - - cat >> confdefs.h <<\EOF -#define _MINIX 1 -EOF - -fi - -# If we cannot run a trivial program, we must be cross compiling. -echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext </dev/null; then - ac_cv_c_cross=no -else - ac_cv_c_cross=yes -fi -fi -rm -fr conftest* -fi -cross_compiling=$ac_cv_c_cross -echo "$ac_t""$ac_cv_c_cross" 1>&6 - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - ac_cv_header_stdc=no -else -cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - : -else - ac_cv_header_stdc=no -fi -fi -rm -fr conftest* -fi -fi -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include <$ac_hdr> -int main() { return 0; } -int t() { -DIR *dirp = 0; -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` - cat >> confdefs.h <&6 -fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for -ldir""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_dir'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 -fi - -else -echo $ac_n "checking for -lx""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_x'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "uid_t" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_uid_t=yes -else - rm -rf conftest* - ac_cv_type_uid_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_uid_t" 1>&6 -if test $ac_cv_type_uid_t = no; then - cat >> confdefs.h <<\EOF -#define uid_t int -EOF - - cat >> confdefs.h <<\EOF -#define gid_t int -EOF - -fi - echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pid_t" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_pid_t=yes -else - rm -rf conftest* - ac_cv_type_pid_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_pid_t" 1>&6 -if test $ac_cv_type_pid_t = no; then - cat >> confdefs.h <<\EOF -#define pid_t int -EOF - -fi - -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#ifdef signal -#undef signal -#endif -#ifdef __cplusplus -extern "C" -#endif -void (*signal ()) (); -int main() { return 0; } -int t() { -int i; -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - ac_cv_type_signal=void -else - rm -rf conftest* - ac_cv_type_signal=int -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_signal" 1>&6 -cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` - cat >> confdefs.h <&6 -fi -done - -if test "x$CC" != xcc; then - echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -else - echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -fi -set dummy $CC; ac_cc="`echo $2 | - sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" -if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -echo 'foo(){}' > conftest.c -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -if ${CC-cc} -c conftest.c -o conftest.o 1>&5 2>&5 && - test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&5 2>&5 -then - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if cc -c conftest.c 1>&5 2>&5 - then - if cc -c conftest.c -o conftest2.o 1>&5 2>&5 && - test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&5 2>&5 - then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - fi - fi - fi -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 - cat >> confdefs.h <<\EOF -#define NO_MINUS_C_MINUS_O 1 -EOF - -fi - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - ac_cv_c_const=yes -else - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include - -#if defined(S_ISBLK) && defined(S_IFDIR) -# if S_ISBLK (S_IFDIR) -You lose. -# endif -#endif - -#if defined(S_ISBLK) && defined(S_IFCHR) -# if S_ISBLK (S_IFCHR) -You lose. -# endif -#endif - -#if defined(S_ISLNK) && defined(S_IFREG) -# if S_ISLNK (S_IFREG) -You lose. -# endif -#endif - -#if defined(S_ISSOCK) && defined(S_IFREG) -# if S_ISSOCK (S_IFREG) -You lose. -# endif -#endif - -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "You lose" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_header_stat_broken=yes -else - rm -rf conftest* - ac_cv_header_stat_broken=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_header_stat_broken" 1>&6 -if test $ac_cv_header_stat_broken = yes; then - cat >> confdefs.h <<\EOF -#define STAT_MACROS_BROKEN 1 -EOF - -fi - - - - - -for ac_func in getdtablesize psignal mktemp \ - dup2 getcwd sigsetmask getgroups setlinebuf \ - seteuid setegid setreuid setregid strerror strsignal -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for sys_siglist""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_check_symbol_sys_siglist'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <> confdefs.h <&6 -echo $ac_n "checking for _sys_siglist""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_check_symbol__sys_siglist'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <> confdefs.h <&6 -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { return 0; } -int t() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA_H 1 -EOF - -fi - -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -int main() { return 0; } -int t() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - ac_cv_func_alloca=yes -else - rm -rf conftest* - ac_cv_func_alloca=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_func_alloca" 1>&6 -if test $ac_cv_func_alloca = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF - -fi - -if test $ac_cv_func_alloca = no; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - - -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_os_cray=yes -else - rm -rf conftest* - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_os_cray" 1>&6 -if test $ac_cv_os_cray = yes; then -for ac_func in _getb67 GETB67 getb67; do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <&6 -fi - -done -fi - -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else -cat > conftest.$ac_ext < addr) ? 1 : -1; -} -main () -{ - exit (find_stack_direction() < 0); -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_stack_direction=1 -else - ac_cv_c_stack_direction=-1 -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_VFORK_H 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_vfork=no -else -cat > conftest.$ac_ext < -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_VFORK_H -#include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. - The compiler is told about this with #include , - but some compilers (e.g. gcc -O) don't grok . - Test for this by using a static variable whose address - is put into a register that is clobbered by the vfork. */ -static -#ifdef __cplusplus -sparc_address_test (int arg) -#else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) - perror ("vfork"); - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} -main() { - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. - This test uses lots of local variables, at least - as many local variables as main has allocated so far - including compiler temporaries. 4 locals are enough for - gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. - A buggy compiler should reuse the register of parent - for one of the local variables, since it will think that - parent can't possibly be used any more in this routine. - Assigning to the local variable will thus munge parent - in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), - vfork doesn't separate parent from child file descriptors. - If the child closes a descriptor before it execs or exits, - this munges the parent's descriptor as well. - Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - exit( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_vfork=yes -else - ac_cv_func_vfork=no -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_func_vfork" 1>&6 -if test $ac_cv_func_vfork = no; then - cat >> confdefs.h <<\EOF -#define vfork fork -EOF - -fi - -echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else -cat > conftest.$ac_ext < -/* If setvbuf has the reversed format, exit 0. */ -main () { - /* This call has the arguments reversed. - A reversed system may check and see that the address of main - is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ - if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0) - exit(1); - putc('\r', stdout); - exit(0); /* Non-reversed systems segv here. */ -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_setvbuf_reversed=yes -else - ac_cv_func_setvbuf_reversed=no -fi -fi -rm -fr conftest* -rm -f core core.* *.core -fi -echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6 -if test $ac_cv_func_setvbuf_reversed = yes; then - cat >> confdefs.h <<\EOF -#define SETVBUF_REVERSED 1 -EOF - -fi - -ac_have_func=no # yes means we've found a way to get the load average. - -# Some systems with -lutil have (and need) -lkvm as well, some do not. -# On Solaris, -lkvm requires nlist from -lelf, so check that first -# to get the right answer into the cache. -echo $ac_n "checking for -lelf""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_elf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lelf $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="-lelf $LIBS" -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for -lkvm""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_kvm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lkvm $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="-lkvm $LIBS" -else - echo "$ac_t""no" 1>&6 -fi - -# Check for the 4.4BSD definition of getloadavg. -echo $ac_n "checking for -lutil""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_util'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lutil $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes -else - echo "$ac_t""no" 1>&6 -fi - - -if test $ac_have_func = no; then - # There is a commonly available library for RS/6000 AIX. - # Since it is not a standard part of AIX, it might be installed locally. - ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS" - echo $ac_n "checking for -lgetloadavg""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_getloadavg'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lgetloadavg $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="-lgetloadavg $LIBS" -else - echo "$ac_t""no" 1>&6 -LIBS="$ac_save_LIBS" -fi - -fi - -# Make sure it is really in the library, if we think we found it. -for ac_func in getloadavg -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -LIBOBJS="$LIBOBJS ${ac_func}.o" -fi - -done - - -if test $ac_cv_func_getloadavg = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_GETLOADAVG 1 -EOF - - ac_have_func=yes -else - # Figure out what our getloadavg.c needs. - ac_have_func=no - ac_safe=`echo "sys/dg_sys_info.h" | tr './\055' '___'` -echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_have_func=yes; cat >> confdefs.h <<\EOF -#define DGUX 1 -EOF - - echo $ac_n "checking for -ldgc""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_dgc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldgc $LIBS" -cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo dgc | tr '[a-z]' '[A-Z]'` - cat >> confdefs.h <&6 -fi - -else - echo "$ac_t""no" 1>&6 -fi - - - # We cannot check for , because Solaris 2 does not use dwarf (it - # uses stabs), but it is still SVR4. We cannot check for because - # Irix 4.0.5F has the header but not the library. - if test $ac_have_func = no && test $ac_cv_lib_elf = yes; then - ac_have_func=yes; cat >> confdefs.h <<\EOF -#define SVR4 1 -EOF - - fi - - if test $ac_have_func = no; then - ac_safe=`echo "inq_stats/cpustats.h" | tr './\055' '___'` -echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_have_func=yes; cat >> confdefs.h <<\EOF -#define UMAX 1 -EOF - - cat >> confdefs.h <<\EOF -#define UMAX4_3 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - - fi - - if test $ac_have_func = no; then - ac_safe=`echo "sys/cpustats.h" | tr './\055' '___'` -echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_have_func=yes; cat >> confdefs.h <<\EOF -#define UMAX 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - - fi - - if test $ac_have_func = no; then - for ac_hdr in mach/mach.h -do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` - cat >> confdefs.h <&6 -fi -done - - fi - - ac_safe=`echo "nlist.h" | tr './\055' '___'` -echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define NLIST_STRUCT 1 -EOF - - echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6 - if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { return 0; } -int t() { -struct nlist n; n.n_un.n_name = 0; -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - ac_cv_struct_nlist_n_un=yes -else - rm -rf conftest* - ac_cv_struct_nlist_n_un=no -fi -rm -f conftest* - -fi - echo "$ac_t""$ac_cv_struct_nlist_n_un" 1>&6 - if test $ac_cv_struct_nlist_n_un = yes; then - cat >> confdefs.h <<\EOF -#define NLIST_NAME_UNION 1 -EOF - - fi - -else - echo "$ac_t""no" 1>&6 -fi -fi # Do not have getloadavg in system libraries. - -# Some definitions of getloadavg require that the program be installed setgid. -echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 | - egrep "Yowza Am I SETGID yet" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_func_getloadavg_setgid=yes -else - rm -rf conftest* - ac_cv_func_getloadavg_setgid=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_func_getloadavg_setgid" 1>&6 -if test $ac_cv_func_getloadavg_setgid = yes; then - NEED_SETGID=true; cat >> confdefs.h <<\EOF -#define GETLOADAVG_PRIVILEGED 1 -EOF - -else - NEED_SETGID=false -fi - -if test $ac_cv_func_getloadavg_setgid = yes; then - echo $ac_n "checking group of /dev/kmem""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # On Solaris, /dev/kmem is a symlink. Get info on the real file. - ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` - # If we got an error (system does not support symlinks), try without -L. - test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` - ac_cv_group_kmem=`echo $ac_ls_output \ - | sed -ne 's/[ ][ ]*/ /g; - s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; - / /s/.* //;p;'` - -fi - KMEM_GROUP=$ac_cv_group_kmem - echo "$ac_t""$KMEM_GROUP" 1>&6 -fi - -echo $ac_n "checking for strcoll""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_strcoll'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_strcoll=no -else -cat > conftest.$ac_ext < -main () -{ - exit (strcoll ("abc", "def") >= 0 || - strcoll ("ABC", "DEF") >= 0 || - strcoll ("123", "456") >= 0); -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_strcoll=yes -else - ac_cv_func_strcoll=no -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_func_strcoll" 1>&6 -if test $ac_cv_func_strcoll = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_STRCOLL 1 -EOF - -fi - - -if test $ac_cv_func_getdtablesize = no; then - echo $ac_n "checking for sysconf (_SC_OPEN_MAX)""... $ac_c" 1>&6 - if eval "test \"`echo '$''{'make_cv_sysconf_open_max'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { return 0; } -int t() { -int max = sysconf (_SC_OPEN_MAX); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - make_cv_sysconf_open_max=yes -else - rm -rf conftest* - make_cv_sysconf_open_max=no -fi -rm -f conftest* - -fi - - if test $make_cv_sysconf_open_max = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_SYSCONF_OPEN_MAX 1 -EOF - - fi - echo "$ac_t""$make_cv_sysconf_open_max" 1>&6 -fi - -# Check out the wait reality. -for ac_hdr in sys/wait.h -do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` - cat >> confdefs.h <&6 -fi -done - for ac_func in waitpid wait3 -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for union wait""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'make_cv_union_wait'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -int main() { return 0; } -int t() { -union wait status; int pid; pid = wait (&status); -#ifdef WEXITSTATUS -/* Some POSIXoid systems have both the new-style macros and the old - union wait type, and they do not work together. If union wait - conflicts with WEXITSTATUS et al, we don't want to use it at all. */ -if (WEXITSTATUS (status) != 0) pid = -1; -#ifdef WTERMSIG -/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */ --- blow chunks here -- -#endif -#endif -#ifdef HAVE_WAITPID -/* Make sure union wait works with waitpid. */ -pid = waitpid (-1, &status, 0); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - make_cv_union_wait=yes -else - rm -rf conftest* - make_cv_union_wait=no -fi -rm -f conftest* - -fi - -if test "$make_cv_union_wait" = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_UNION_WAIT 1 -EOF - -fi -echo "$ac_t""$make_cv_union_wait" 1>&6 - -echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -/* NetBSD declares sys_siglist in unistd.h. */ -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { return 0; } -int t() { -char *msg = *(sys_siglist + 1); -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - ac_cv_decl_sys_siglist=yes -else - rm -rf conftest* - ac_cv_decl_sys_siglist=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6 -if test $ac_cv_decl_sys_siglist = yes; then - cat >> confdefs.h <<\EOF -#define SYS_SIGLIST_DECLARED 1 -EOF - -fi - - -# The presence of the following is not meant to imply -# that make necessarily works on those systems. -echo $ac_n "checking for -lsun""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_sun'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsun $LIBS" -cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo sun | tr '[a-z]' '[A-Z]'` - cat >> confdefs.h <&6 -fi - - - REMOTE=stub -# Check whether --with-customs or --without-customs was given. -withval="$with_customs" -if test -n "$withval"; then - REMOTE=cstms LIBS="$LIBS libcustoms.a" -fi - - -echo checking for location of SCCS get command -if test -f /usr/sccs/get; then - SCCS_GET=/usr/sccs/get - cat >> confdefs.h <<\EOF -#define SCCS_GET "/usr/sccs/get" -EOF - -else - SCCS_GET=get - cat >> confdefs.h <<\EOF -#define SCCS_GET "get" -EOF - -fi -ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. -if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && - test -f s.conftest; then - # We successfully created an SCCS file. - echo checking if SCCS get command understands -G - if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 && - test -f conftoast; then - cat >> confdefs.h <<\EOF -#define SCCS_GET_MINUS_G 1 -EOF - - fi -fi -rm -f s.conftest conftoast - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.3" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile build.sh config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF -$ac_vpsub -$extrasub -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@subdirs@%$subdirs%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@CPP@%$CPP%g -s%@LIBOBJS@%$LIBOBJS%g -s%@ALLOCA@%$ALLOCA%g -s%@NEED_SETGID@%$NEED_SETGID%g -s%@KMEM_GROUP@%$KMEM_GROUP%g -s%@REMOTE@%$REMOTE%g - -CEOF -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust relative srcdir, etc. for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file -fi; done -rm -f conftest.subs - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - cp $ac_given_srcdir/$ac_file_in conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. -# Maximum number of lines to put in a single here document. -ac_max_here_lines=12 - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - - - -# Makefile uses this timestamp file to know when to remake Makefile, -# build.sh, and glob/Makefile. -touch stamp-config -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - for ac_arg in $ac_configure_args; do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case "$ac_arg" in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; - esac - done - - for ac_config_dir in glob; do - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - if test ! -d $srcdir/$ac_config_dir; then - continue - fi - - echo configuring in $ac_config_dir - - case "$srcdir" in - .) ;; - *) - if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; - else - { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } - fi - ;; - esac - - ac_popdir=`pwd` - cd $ac_config_dir - - case "$srcdir" in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - /*) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_config_dir ;; - *) # Relative path. - ac_sub_srcdir=../$srcdir/$ac_config_dir ;; - esac - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure; then - ac_sub_configure=$ac_sub_srcdir/configure - elif test -f $ac_sub_srcdir/configure.in; then - ac_sub_configure=$ac_configure - else - echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - - # Make the cache file name correct relative to the subdirectory. - # A "../" for each directory in /$ac_config_dir. - ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` - case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; - esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" - # The eval makes quoting arguments work. - if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir - then : - else - { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } - fi - fi - - cd $ac_popdir - done -fi - - diff --git a/buildtools/windows/source/make/configure.bat b/buildtools/windows/source/make/configure.bat deleted file mode 100755 index 9c3693dcc39..00000000000 --- a/buildtools/windows/source/make/configure.bat +++ /dev/null @@ -1,88 +0,0 @@ -@echo off - -echo Configuring MAKE for go32 - -rem This batch file assumes a unix-type "sed" program - - - -update configh.dos config.h - - - -echo # Makefile generated by "configure.bat"> Makefile - - - -if exist config.sed del config.sed - - - -echo ": try_sl ">> config.sed - -echo "/\\$/ { ">> config.sed - -echo " N ">> config.sed - -echo " s/[ ]*\\\n[ ]*/ / ">> config.sed - -echo " b try_sl ">> config.sed - -echo "} ">> config.sed - - - -echo "s/@srcdir@/./ ">> config.sed - -echo "s/@CC@/gcc/ ">> config.sed - -echo "s/@CFLAGS@/-O2 -g/ ">> config.sed - -echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed - -echo "s/@LDFLAGS@// ">> config.sed - -echo "s/@RANLIB@/ranlib/ ">> config.sed - -echo "s/@DEFS@// ">> config.sed - -echo "s/@REMOTE@/stub/ ">> config.sed - -echo "s/@ALLOCA@// ">> config.sed - -echo "s/@LIBS@// ">> config.sed - -echo "s/@LIBOBJS@// ">> config.sed - -echo "s/@SET_MAKE@// ">> config.sed - -echo "s/^Makefile *:/_Makefile:/ ">> config.sed - -echo "s/^config.h *:/_config.h:/ ">> config.sed - -echo "s/^defines *=.*$/defines =/ ">> config.sed - -echo "/mv -f make.new make/d ">> config.sed - - - -echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed - - - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed - -sed -f config2.sed Makefile.in >> Makefile - -del config.sed - -del config2.sed - - - -cd glob - -call configure - -cd .. - diff --git a/buildtools/windows/source/make/configure.in b/buildtools/windows/source/make/configure.in deleted file mode 100644 index 2b533e7a7c5..00000000000 --- a/buildtools/windows/source/make/configure.in +++ /dev/null @@ -1,131 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_REVISION([$Id: configure.in,v 1.1 1998-04-13 22:35:14 cyeh Exp $]) -AC_PREREQ(2.1)dnl dnl Minimum Autoconf version required. -AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir. -AC_CONFIG_HEADER(config.h) -AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory. - -AC_PROG_MAKE_SET -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_CPP dnl Later checks need this. -AC_AIX -AC_ISC_POSIX -AC_MINIX -AC_HEADER_STDC -AC_HEADER_DIRENT -AC_TYPE_UID_T dnl Also does gid_t. -AC_TYPE_PID_T -AC_TYPE_SIGNAL -AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \ - sys/timeb.h) -AC_PROG_CC_C_O -AC_C_CONST dnl getopt needs this. -AC_HEADER_STAT - -AC_SUBST(LIBOBJS) - -AC_DEFUN(AC_CHECK_SYMBOL, [dnl -AC_MSG_CHECKING(for $1) -AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl -AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);], - ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)]) -if test "$ac_cv_check_symbol_$1" = yes; then -changequote(,)dnl - ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'` -changequote([,])dnl - AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol}) -fi -AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl - -AC_CHECK_FUNCS(getdtablesize psignal mktemp \ - dup2 getcwd sigsetmask getgroups setlinebuf \ - seteuid setegid setreuid setregid strerror strsignal) -AC_CHECK_SYMBOL(sys_siglist) -AC_CHECK_SYMBOL(_sys_siglist) -AC_FUNC_ALLOCA -AC_FUNC_VFORK -AC_FUNC_SETVBUF_REVERSED -AC_FUNC_GETLOADAVG -AC_FUNC_STRCOLL - -if test $ac_cv_func_getdtablesize = no; then - AC_MSG_CHECKING(for sysconf (_SC_OPEN_MAX)) - AC_CACHE_VAL(make_cv_sysconf_open_max, [dnl - AC_TRY_LINK([#include ], [int max = sysconf (_SC_OPEN_MAX);], - [make_cv_sysconf_open_max=yes], [make_cv_sysconf_open_max=no])]) - if test $make_cv_sysconf_open_max = yes; then - AC_DEFINE(HAVE_SYSCONF_OPEN_MAX) - fi - AC_MSG_RESULT($make_cv_sysconf_open_max) -fi - -# Check out the wait reality. -AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3) -AC_MSG_CHECKING(for union wait) -AC_CACHE_VAL(make_cv_union_wait, [dnl -AC_TRY_LINK([#include -#include ], - [union wait status; int pid; pid = wait (&status); -#ifdef WEXITSTATUS -/* Some POSIXoid systems have both the new-style macros and the old - union wait type, and they do not work together. If union wait - conflicts with WEXITSTATUS et al, we don't want to use it at all. */ -if (WEXITSTATUS (status) != 0) pid = -1; -#ifdef WTERMSIG -/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */ --- blow chunks here -- -#endif -#endif -#ifdef HAVE_WAITPID -/* Make sure union wait works with waitpid. */ -pid = waitpid (-1, &status, 0); -#endif -], - [make_cv_union_wait=yes], [make_cv_union_wait=no])]) -if test "$make_cv_union_wait" = yes; then - AC_DEFINE(HAVE_UNION_WAIT) -fi -AC_MSG_RESULT($make_cv_union_wait) - -AC_DECL_SYS_SIGLIST - -# The presence of the following is not meant to imply -# that make necessarily works on those systems. -AC_CHECK_LIB(sun, getpwnam) - -AC_SUBST(REMOTE) REMOTE=stub -AC_ARG_WITH(customs, [export jobs with the Customs daemon (NOT SUPPORTED)], -[REMOTE=cstms LIBS="$LIBS libcustoms.a"]) - -echo checking for location of SCCS get command -if test -f /usr/sccs/get; then - SCCS_GET=/usr/sccs/get - AC_DEFINE(SCCS_GET, "/usr/sccs/get") -else - SCCS_GET=get - AC_DEFINE(SCCS_GET, "get") -fi -ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. -if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && - test -f s.conftest; then - # We successfully created an SCCS file. - echo checking if SCCS get command understands -G - if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 && - test -f conftoast; then - AC_DEFINE(SCCS_GET_MINUS_G) - fi -fi -rm -f s.conftest conftoast - -AC_OUTPUT(Makefile build.sh, [ -# Makefile uses this timestamp file to know when to remake Makefile, -# build.sh, and glob/Makefile. -touch stamp-config]) - -dnl Local Variables: -dnl comment-start: "dnl " -dnl comment-end: "" -dnl comment-start-skip: "\\bdnl\\b\\s *" -dnl compile-command: "make configure config.h.in" -dnl End: diff --git a/buildtools/windows/source/make/default.c b/buildtools/windows/source/make/default.c deleted file mode 100644 index 5cdca48c094..00000000000 --- a/buildtools/windows/source/make/default.c +++ /dev/null @@ -1,403 +0,0 @@ -/* Data base of default implicit rules for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "rule.h" -#include "dep.h" -#include "file.h" -#include "commands.h" -#include "variable.h" - -/* Define GCC_IS_NATIVE if gcc is the native development environment on - your system (gcc/bison/flex vs cc/yacc/lex). */ -#ifdef __MSDOS__ -#define GCC_IS_NATIVE -#endif - - -/* This is the default list of suffixes for suffix rules. - `.s' must come last, so that a `.o' file will be made from - a `.c' or `.p' or ... file rather than from a .s file. */ - -static char default_suffixes[] - = ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \ -.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \ -.w .ch .web .sh .elc .el"; - -static struct pspec default_pattern_rules[] = - { - { "(%)", "%", - "$(AR) $(ARFLAGS) $@ $<" }, - - /* The X.out rules are only in BSD's default set because - BSD Make has no null-suffix rules, so `foo.out' and - `foo' are the same thing. */ - { "%.out", "%", - "@rm -f $@ \n cp $< $@" }, - - /* Syntax is "ctangle foo.w foo.ch foo.c". */ - { "%.c", "%.w %.ch", - "$(CTANGLE) $^ $@" }, - { "%.tex", "%.w %.ch", - "$(CWEAVE) $^ $@" }, - - { 0, 0, 0 } - }; - -static struct pspec default_terminal_rules[] = - { - /* RCS. */ - { "%", "%,v", - "+$(CHECKOUT,v)" }, - { "%", "RCS/%,v", - "+$(CHECKOUT,v)" }, - - /* SCCS. */ - { "%", "s.%", - "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" }, - { "%", "SCCS/s.%", - "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" }, - - { 0, 0, 0 } - }; - -static char *default_suffix_rules[] = - { - ".o", - "$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".s", - "$(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".S", - "$(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".c", - "$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".cc", - "$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".C", - "$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".f", - "$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".p", - "$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".F", - "$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".r", - "$(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@", - ".mod", - "$(COMPILE.mod) -o $@ -e $@ $^", - - ".def.sym", - "$(COMPILE.def) -o $@ $<", - - ".sh", - "cat $< >$@ \n chmod a+x $@", - - ".s.o", -#if !defined(M_XENIX) || defined(__GNUC__) - "$(COMPILE.s) -o $@ $<", -#else /* Xenix. */ - "$(COMPILE.s) -o$@ $<", -#endif /* Not Xenix. */ - ".S.o", -#if !defined(M_XENIX) || defined(__GNUC__) - "$(COMPILE.S) -o $@ $<", -#else /* Xenix. */ - "$(COMPILE.S) -o$@ $<", -#endif /* Not Xenix. */ - ".c.o", - "$(COMPILE.c) $< $(OUTPUT_OPTION)", - ".cc.o", - "$(COMPILE.cc) $< $(OUTPUT_OPTION)", - ".C.o", - "$(COMPILE.C) $< $(OUTPUT_OPTION)", - ".f.o", - "$(COMPILE.f) $< $(OUTPUT_OPTION)", - ".p.o", - "$(COMPILE.p) $< $(OUTPUT_OPTION)", - ".F.o", - "$(COMPILE.F) $< $(OUTPUT_OPTION)", - ".r.o", - "$(COMPILE.r) $< $(OUTPUT_OPTION)", - ".mod.o", - "$(COMPILE.mod) -o $@ $<", - - ".c.ln", - "$(LINT.c) -C$* $<", - ".y.ln", -#ifndef __MSDOS__ - "$(YACC.y) $< \n $(LINT.c) -C$* y.tab.c \n $(RM) y.tab.c", -#else - "$(YACC.y) $< \n $(LINT.c) -C$* y_tab.c \n $(RM) y_tab.c", -#endif - ".l.ln", - "@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c", - - ".y.c", -#ifndef __MSDOS__ - "$(YACC.y) $< \n mv -f y.tab.c $@", -#else - "$(YACC.y) $< \n mv -f y_tab.c $@", -#endif - ".l.c", - "@$(RM) $@ \n $(LEX.l) $< > $@", - - ".F.f", - "$(PREPROCESS.F) $< $(OUTPUT_OPTION)", - ".r.f", - "$(PREPROCESS.r) $< $(OUTPUT_OPTION)", - - /* This might actually make lex.yy.c if there's no %R% - directive in $*.l, but in that case why were you - trying to make $*.r anyway? */ - ".l.r", - "$(LEX.l) $< > $@ \n mv -f lex.yy.r $@", - - ".S.s", - "$(PREPROCESS.S) $< > $@", - - ".texinfo.info", - "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@", - - ".texi.info", - "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@", - - ".txinfo.info", - "$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@", - - ".tex.dvi", - "$(TEX) $<", - - ".texinfo.dvi", - "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<", - - ".texi.dvi", - "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<", - - ".txinfo.dvi", - "$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<", - - ".w.c", - "$(CTANGLE) $< - $@", /* The `-' says there is no `.ch' file. */ - - ".web.p", - "$(TANGLE) $<", - - ".w.tex", - "$(CWEAVE) $< - $@", /* The `-' says there is no `.ch' file. */ - - ".web.tex", - "$(WEAVE) $<", - - 0, 0, - }; - -static char *default_variables[] = - { - "AR", "ar", - "ARFLAGS", "rv", - "AS", "as", -#ifdef GCC_IS_NATIVE - "CC", "gcc", - "CXX", "gcc", -#else - "CC", "cc", - "CXX", "g++", -#endif - - /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist, - and to the empty string if $@ does exist. */ - "CHECKOUT,v", - "$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\ - $(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))", - - "CO", "co", - "CPP", "$(CC) -E", -#ifdef CRAY - "CF77PPFLAGS", "-P", - "CF77PP", "/lib/cpp", - "CFT", "cft77", - "CF", "cf77", - "FC", "$(CF)", -#else /* Not CRAY. */ -#ifdef _IBMR2 - "FC", "xlf", -#else -#ifdef __convex__ - "FC", "fc", -#else - "FC", "f77", -#endif /* __convex__ */ -#endif /* _IBMR2 */ - /* System V uses these, so explicit rules using them should work. - However, there is no way to make implicit rules use them and FC. */ - "F77", "$(FC)", - "F77FLAGS", "$(FFLAGS)", -#endif /* Cray. */ - "GET", SCCS_GET, - "LD", "ld", -#ifdef GCC_IS_NATIVE - "LEX", "flex", -#else - "LEX", "lex", -#endif - "LINT", "lint", - "M2C", "m2c", -#ifdef pyr - "PC", "pascal", -#else -#ifdef CRAY - "PC", "PASCAL", - "SEGLDR", "segldr", -#else - "PC", "pc", -#endif /* CRAY. */ -#endif /* pyr. */ -#ifdef GCC_IS_NATIVE - "YACC", "bison -y", -#else - "YACC", "yacc", /* Or "bison -y" */ -#endif - "MAKEINFO", "makeinfo", - "TEX", "tex", - "TEXI2DVI", "texi2dvi", - "WEAVE", "weave", - "CWEAVE", "cweave", - "TANGLE", "tangle", - "CTANGLE", "ctangle", - - "RM", "rm -f", - - "LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)", - "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", - "LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", - "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", - "COMPILE.C", "$(COMPILE.cc)", - "LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", - "LINK.C", "$(LINK.cc)", - "YACC.y", "$(YACC) $(YFLAGS)", - "LEX.l", "$(LEX) $(LFLAGS) -t", - "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c", - "LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)", - "COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", - "LINK.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", - "COMPILE.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c", - "LINK.r", "$(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)", - "COMPILE.def", "$(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)", - "COMPILE.mod", "$(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)", - "COMPILE.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", - "LINK.p", "$(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", - "LINK.s", "$(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH)", - "COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)", - "LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)", - "COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c", -#if !defined(M_XENIX) || defined(__GNUC__) - "PREPROCESS.S", "$(CC) -E $(CPPFLAGS)", -#else /* Xenix. */ - "PREPROCESS.S", "$(CC) -EP $(CPPFLAGS)", -#endif /* Not Xenix. */ - "PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F", - "PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F", - "LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)", - -#ifndef NO_MINUS_C_MINUS_O -#if !defined(M_XENIX) || defined(__GNUC__) - "OUTPUT_OPTION", "-o $@", -#else /* Xenix. */ - "OUTPUT_OPTION", "-Fo$@", -#endif /* Not Xenix. */ -#endif - -#ifdef SCCS_GET_MINUS_G - "SCCS_OUTPUT_OPTION", "-G$@", -#endif - - 0, 0 - }; - -/* Set up the default .SUFFIXES list. */ - -void -set_default_suffixes () -{ - suffix_file = enter_file (".SUFFIXES"); - - if (no_builtin_rules_flag) - (void) define_variable ("SUFFIXES", 8, "", o_default, 0); - else - { - char *p = default_suffixes; - suffix_file->deps = (struct dep *) - multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1), - sizeof (struct dep)); - (void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0); - } -} - -/* Enter the default suffix rules as file rules. This used to be done in - install_default_implicit_rules, but that loses because we want the - suffix rules installed before reading makefiles, and thee pattern rules - installed after. */ - -void -install_default_suffix_rules () -{ - register char **s; - - if (no_builtin_rules_flag) - return; - - for (s = default_suffix_rules; *s != 0; s += 2) - { - register struct file *f = enter_file (s[0]); - /* Don't clobber cmds given in a makefile if there were any. */ - if (f->cmds == 0) - { - f->cmds = (struct commands *) xmalloc (sizeof (struct commands)); - f->cmds->filename = 0; - f->cmds->commands = s[1]; - f->cmds->command_lines = 0; - } - } -} - - -/* Install the default pattern rules. */ - -void -install_default_implicit_rules () -{ - register struct pspec *p; - - if (no_builtin_rules_flag) - return; - - for (p = default_pattern_rules; p->target != 0; ++p) - install_pattern_rule (p, 0); - - for (p = default_terminal_rules; p->target != 0; ++p) - install_pattern_rule (p, 1); -} - -void -define_default_variables () -{ - register char **s; - - for (s = default_variables; *s != 0; s += 2) - (void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1); -} diff --git a/buildtools/windows/source/make/dep.h b/buildtools/windows/source/make/dep.h deleted file mode 100644 index 244cde243f4..00000000000 --- a/buildtools/windows/source/make/dep.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Definitions of dependency data structures for GNU Make. -Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Structure representing one dependency of a file. - Each struct file's `deps' points to a chain of these, - chained through the `next'. - - Note that the first two words of this match a struct nameseq. */ - -struct dep - { - struct dep *next; - char *name; - struct file *file; - int changed; - }; - - -/* Structure used in chains of names, for parsing and globbing. */ - -struct nameseq - { - struct nameseq *next; - char *name; - }; - - -extern struct nameseq *multi_glob (), *parse_file_seq (); -extern char *tilde_expand (); - -#ifndef NO_ARCHIVES -extern struct nameseq *ar_glob (); -#endif - -#ifndef iAPX286 -#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name) -#else -/* Buggy compiler can't hack this. */ -extern char *dep_name (); -#endif - -extern struct dep *read_all_makefiles (); - -/* Flag bits for the second argument to `read_makefile'. - These flags are saved in the `changed' field of each - `struct dep' in the chain returned by `read_all_makefiles'. */ -#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */ -#define RM_INCLUDED (1 << 1) /* Search makefile search path. */ -#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */ -#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */ -#define RM_NOFLAG 0 diff --git a/buildtools/windows/source/make/dir.c b/buildtools/windows/source/make/dir.c deleted file mode 100644 index eac29fd2f87..00000000000 --- a/buildtools/windows/source/make/dir.c +++ /dev/null @@ -1,760 +0,0 @@ -/* Directory hashing for GNU Make. -Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" - -#ifdef NETSCAPE -#include "windir.h" - -DIR *opendir(char *pathp) -{ - DIR *ret = (DIR *) malloc(sizeof(DIR)); - char path[_MAX_PATH]; - int l; - - sprintf(path, "%s", pathp); - l = strlen(path) - 1; - path[strlen(pathp)] = '\0'; - if(path[strlen(path) - 1] != '\\') - strcpy (path + strlen(path), "\\*.*"); - else - strcat(path, "*.*"); - - ret->de.d_name = NULL; - if( (ret->dp = FindFirstFile(path, &ret->fdata)) != INVALID_HANDLE_VALUE) - return ret; - free(ret); - return NULL; -} - -struct dirent *readdir(DIR *ds) -{ - if(FindNextFile(ds->dp, &ds->fdata) == FALSE) - return NULL; - if(ds->de.d_name) - free(ds->de.d_name); - ds->de.d_name = strdup(ds->fdata.cFileName); - - return &ds->de; -} - -void closedir(DIR *ds) -{ - FindClose(ds->dp); - if(ds->de.d_name) - free(ds->de.d_name); - free(ds); -} - - -#endif - - -#if !defined(NETSCAPE) && defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__) -#include -#ifndef __GNU_LIBRARY__ -#define D_NAMLEN(d) strlen((d)->d_name) -#else /* GNU C library. */ -#define D_NAMLEN(d) ((d)->d_namlen) -#endif /* Not GNU C library. */ -#else /* Not POSIX or HAVE_DIRENT_H. */ -#define direct dirent -#define D_NAMLEN(d) (strlen(d->d_name)) -#ifdef HAVE_SYS_NDIR_H -#include -#endif /* HAVE_SYS_NDIR_H */ -#ifdef HAVE_SYS_DIR_H -#include -#endif /* HAVE_SYS_DIR_H */ -#ifdef HAVE_NDIR_H -#include -#endif /* HAVE_NDIR_H */ -#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */ - -#if defined (POSIX) && !defined (__GNU_LIBRARY__) || defined(NETSCAPE) -/* Posix does not require that the d_ino field be present, and some - systems do not provide it. */ -#define REAL_DIR_ENTRY(dp) 1 -#else -#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) -#endif /* POSIX */ - -#ifdef __MSDOS__ -#include - -static char * -dosify (filename) - char *filename; -{ - static char dos_filename[14]; - char *df; - int i; - - if (filename == 0) - return 0; - - if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0) - return filename; - - df = dos_filename; - - /* First, transform the name part. */ - for (i = 0; *filename != '\0' && i < 8 && *filename != '.'; ++i) - *df++ = tolower (*filename++); - - /* Now skip to the next dot. */ - while (*filename != '\0' && *filename != '.') - ++filename; - if (*filename != '\0') - { - *df++ = *filename++; - for (i = 0; *filename != '\0' && i < 3 && *filename != '.'; ++i) - *df++ = tolower (*filename++); - } - - /* Look for more dots. */ - while (*filename != '\0' && *filename != '.') - ++filename; - if (*filename == '.') - return filename; - *df = 0; - return dos_filename; -} -#endif - -/* Hash table of directories. */ - -#ifndef DIRECTORY_BUCKETS -#define DIRECTORY_BUCKETS 199 -#endif - -struct directory_contents - { - struct directory_contents *next; - -#ifdef NETSCAPE - int dev; /* Device number of this dir. */ - /* - * Inode means nothing on WIN32. Even file key information is - * unreliable because it is random per file open and undefined - * for remote filesystems. The most unique attribute I can - * come up with is the fully qualified name of the directory. Beware - * though, this is also unreliable. I'm open to suggestion on a better - * way to emulate inode. - */ - char *path_key; - int mtime; /* controls check for stale directory cache */ -#else - int dev, ino; /* Device and inode numbers of this dir. */ -#endif - - struct dirfile **files; /* Files in this directory. */ - DIR *dirstream; /* Stream reading this directory. */ - }; - -/* Table of directory contents hashed by device and inode number. */ -static struct directory_contents *directories_contents[DIRECTORY_BUCKETS]; - -struct directory - { - struct directory *next; - - char *name; /* Name of the directory. */ - - /* The directory's contents. This data may be shared by several - entries in the hash table, which refer to the same directory - (identified uniquely by `dev' and `ino') under different names. */ - struct directory_contents *contents; - }; - -/* Table of directories hashed by name. */ -static struct directory *directories[DIRECTORY_BUCKETS]; - - -/* Never have more than this many directories open at once. */ - -#define MAX_OPEN_DIRECTORIES 10 - -static unsigned int open_directories = 0; - - -/* Hash table of files in each directory. */ - -struct dirfile - { - struct dirfile *next; - char *name; /* Name of the file. */ - char impossible; /* This file is impossible. */ - }; - -#ifndef DIRFILE_BUCKETS -#define DIRFILE_BUCKETS 107 -#endif - -static int dir_contents_file_exists_p (); - -/* Find the directory named NAME and return its `struct directory'. */ - -static struct directory * -find_directory (name) - register char *name; -{ - register unsigned int hash = 0; - register char *p; - register struct directory *dir; -#ifdef NETSCAPE - char w32_path[_MAX_PATH]; -#endif - - for (p = name; *p != '\0'; ++p) - HASH (hash, *p); - hash %= DIRECTORY_BUCKETS; - - for (dir = directories[hash]; dir != 0; dir = dir->next) - if (streq (dir->name, name)) - break; - - if (dir == 0) - { - struct stat st; - - /* The directory was not found. Create a new entry for it. */ - - dir = (struct directory *) xmalloc (sizeof (struct directory)); - dir->next = directories[hash]; - directories[hash] = dir; - dir->name = savestring (name, p - name); - - /* The directory is not in the name hash table. - Find its device and inode numbers, and look it up by them. */ - - if (safe_stat (name, &st) < 0) - /* Couldn't stat the directory. Mark this by - setting the `contents' member to a nil pointer. */ - dir->contents = 0; - else - { - /* Search the contents hash table; device and inode are the key. */ - - struct directory_contents *dc; - -#ifdef NETSCAPE - _fullpath (w32_path, name, sizeof (w32_path)); - hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime; -#else - hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ino; -#endif - hash %= DIRECTORY_BUCKETS; - - for (dc = directories_contents[hash]; dc != 0; dc = dc->next) -#ifdef NETSCAPE - if (!strcmp(dc->path_key, w32_path)) -#else - if (dc->dev == (int)st.st_dev && dc->ino == (int)st.st_ino) -#endif - break; - - if (dc == 0) - { - /* Nope; this really is a directory we haven't seen before. */ - - dc = (struct directory_contents *) - xmalloc (sizeof (struct directory_contents)); - - /* Enter it in the contents hash table. */ - dc->dev = st.st_dev; -#ifdef NETSCAPE - dc->path_key = strdup(w32_path); - dc->mtime = st.st_mtime; -#else - dc->ino = st.st_ino; -#endif - dc->next = directories_contents[hash]; - directories_contents[hash] = dc; - - dc->dirstream = opendir (name); - if (dc->dirstream == 0) - /* Couldn't open the directory. Mark this by - setting the `files' member to a nil pointer. */ - dc->files = 0; - else - { - /* Allocate an array of buckets for files and zero it. */ - dc->files = (struct dirfile **) - xmalloc (sizeof (struct dirfile *) * DIRFILE_BUCKETS); - bzero ((char *) dc->files, - sizeof (struct dirfile *) * DIRFILE_BUCKETS); - - /* Keep track of how many directories are open. */ - ++open_directories; - if (open_directories == MAX_OPEN_DIRECTORIES) - /* We have too many directories open already. - Read the entire directory and then close it. */ - (void) dir_contents_file_exists_p (dc, (char *) 0); - } - } - - /* Point the name-hashed entry for DIR at its contents data. */ - dir->contents = dc; - } - } - - return dir; -} - -/* Return 1 if the name FILENAME is entered in DIR's hash table. - FILENAME must contain no slashes. */ - -static int -dir_contents_file_exists_p (dir, filename) - register struct directory_contents *dir; - register char *filename; -{ - register unsigned int hash; - register char *p; - register struct dirfile *df; - register struct dirent *d; -#ifdef NETSCAPE - struct stat st; - int rehash = 0; -#endif - - if (dir == 0 || dir->files == 0) - /* The directory could not be stat'd or opened. */ - return 0; - -#ifdef __MSDOS__ - filename = dosify (filename); -#endif - - hash = 0; - if (filename != 0) - { - if (*filename == '\0') - /* Checking if the directory exists. */ - return 1; - - for (p = filename; *p != '\0'; ++p) - HASH (hash, *p); - hash %= DIRFILE_BUCKETS; - - /* Search the list of hashed files. */ - - for (df = dir->files[hash]; df != 0; df = df->next) - if (streq (df->name, filename)) - return !df->impossible; - } - - /* The file was not found in the hashed list. - Try to read the directory further. */ - -#ifdef NETSCAPE - if (dir->dirstream == 0) - { - /* Check to see if directory has changed since last read */ - if (dir->path_key && - stat(dir->path_key, &st) == 0 && - st.st_mtime > dir->mtime) { - - /* reset date stamp to show most recent re-process */ - dir->mtime = st.st_mtime; - - /* make sure directory can still be opened */ - dir->dirstream = opendir(dir->path_key); - - if (dir->dirstream) - rehash = 1; - else - return 0; /* couldn't re-read - fail */ - } else - /* The directory has been all read in. */ - return 0; - } -#else - if (dir->dirstream == 0) - /* The directory has been all read in. */ - return 0; -#endif - - while ((d = readdir (dir->dirstream)) != 0) - { - /* Enter the file in the hash table. */ - register unsigned int newhash = 0; - unsigned int len; - register unsigned int i; - - if (!REAL_DIR_ENTRY (d)) - continue; - - len = D_NAMLEN (d); - while (d->d_name[len - 1] == '\0') - --len; - - for (i = 0; i < len; ++i) - HASH (newhash, d->d_name[i]); - newhash %= DIRFILE_BUCKETS; - -#ifdef NETSCAPE - /* - * If re-reading a directory, check that this file isn't already - * in the cache. - */ - if (rehash) { - for (df = dir->files[newhash]; df != 0; df = df->next) - if (streq(df->name, d->d_name)) - break; - } else - df = 0; - - /* - * If re-reading a directory, don't cache files that have - * already been discovered. - */ - if (!df) { -#endif - df = (struct dirfile *) xmalloc (sizeof (struct dirfile)); - df->next = dir->files[newhash]; - dir->files[newhash] = df; - df->name = savestring (d->d_name, len); - df->impossible = 0; -#ifdef NETSCAPE - } -#endif - - /* Check if the name matches the one we're searching for. */ - if (filename != 0 - && newhash == hash && streq (d->d_name, filename)) - return 1; - } - - /* If the directory has been completely read in, - close the stream and reset the pointer to nil. */ - if (d == 0) - { - --open_directories; - closedir (dir->dirstream); - dir->dirstream = 0; - } - - return 0; -} - -/* Return 1 if the name FILENAME in directory DIRNAME - is entered in the dir hash table. - FILENAME must contain no slashes. */ - -int -dir_file_exists_p (dirname, filename) - register char *dirname; - register char *filename; -{ - return dir_contents_file_exists_p (find_directory (dirname)->contents, - filename); -} - -/* Return 1 if the file named NAME exists. */ - -int -file_exists_p (name) - register char *name; -{ - char *dirend; - char *dirname; - -#ifndef NO_ARCHIVES - if (ar_name (name)) - return ar_member_date (name) != (time_t) -1; -#endif - - dirend = rindex (name, '/'); - if (dirend == 0) - return dir_file_exists_p (".", name); - - dirname = (char *) alloca (dirend - name + 1); - bcopy (name, dirname, dirend - name); - dirname[dirend - name] = '\0'; - return dir_file_exists_p (dirname, dirend + 1); -} - -/* Mark FILENAME as `impossible' for `file_impossible_p'. - This means an attempt has been made to search for FILENAME - as an intermediate file, and it has failed. */ - -void -file_impossible (filename) - register char *filename; -{ - char *dirend; - register char *p = filename; - register unsigned int hash; - register struct directory *dir; - register struct dirfile *new; - - dirend = rindex (p, '/'); - if (dirend == 0) - dir = find_directory ("."); - else - { - char *dirname = (char *) alloca (dirend - p + 1); - bcopy (p, dirname, dirend - p); - dirname[dirend - p] = '\0'; - dir = find_directory (dirname); - filename = p = dirend + 1; - } - - for (hash = 0; *p != '\0'; ++p) - HASH (hash, *p); - hash %= DIRFILE_BUCKETS; - - if (dir->contents == 0) - { - /* The directory could not be stat'd. We allocate a contents - structure for it, but leave it out of the contents hash table. */ - dir->contents = (struct directory_contents *) - xmalloc (sizeof (struct directory_contents)); -#ifdef NETSCAPE - dir->contents->dev = 0; - dir->contents->path_key = NULL; - dir->contents->mtime = 0; -#else - dir->contents->dev = dir->contents->ino = 0; -#endif - dir->contents->files = 0; - dir->contents->dirstream = 0; - } - - if (dir->contents->files == 0) - { - /* The directory was not opened; we must allocate the hash buckets. */ - dir->contents->files = (struct dirfile **) - xmalloc (sizeof (struct dirfile) * DIRFILE_BUCKETS); - bzero ((char *) dir->contents->files, - sizeof (struct dirfile) * DIRFILE_BUCKETS); - } - - /* Make a new entry and put it in the table. */ - - new = (struct dirfile *) xmalloc (sizeof (struct dirfile)); - new->next = dir->contents->files[hash]; - dir->contents->files[hash] = new; - new->name = savestring (filename, strlen (filename)); - new->impossible = 1; -} - -/* Return nonzero if FILENAME has been marked impossible. */ - -int -file_impossible_p (filename) - char *filename; -{ - char *dirend; - register char *p = filename; - register unsigned int hash; - register struct directory_contents *dir; - register struct dirfile *next; - - dirend = rindex (filename, '/'); - if (dirend == 0) - dir = find_directory (".")->contents; - else - { - char *dirname = (char *) alloca (dirend - filename + 1); - bcopy (p, dirname, dirend - p); - dirname[dirend - p] = '\0'; - dir = find_directory (dirname)->contents; - p = dirend + 1; - } - - if (dir == 0 || dir->files == 0) - /* There are no files entered for this directory. */ - return 0; - -#ifdef __MSDOS__ - p = filename = dosify (p); -#endif - - for (hash = 0; *p != '\0'; ++p) - HASH (hash, *p); - hash %= DIRFILE_BUCKETS; - - for (next = dir->files[hash]; next != 0; next = next->next) - if (streq (filename, next->name)) - return next->impossible; - - return 0; -} - -/* Return the already allocated name in the - directory hash table that matches DIR. */ - -char * -dir_name (dir) - char *dir; -{ - return find_directory (dir)->name; -} - -/* Print the data base of directories. */ - -void -print_dir_data_base () -{ - register unsigned int i, dirs, files, impossible; - register struct directory *dir; - - puts ("\n# Directories\n"); - - dirs = files = impossible = 0; - for (i = 0; i < DIRECTORY_BUCKETS; ++i) - for (dir = directories[i]; dir != 0; dir = dir->next) - { - ++dirs; - if (dir->contents == 0) - printf ("# %s: could not be stat'd.\n", dir->name); - else if (dir->contents->files == 0) -#ifdef NETSCAPE - printf ("# %s (path_key %s, mtime %d): could not be opened.\n", - dir->name, dir->contents->path_key, dir->contents->mtime); -#else - printf ("# %s (device %d, inode %d): could not be opened.\n", - dir->name, dir->contents->dev, dir->contents->ino); -#endif - else - { - register unsigned int f = 0, im = 0; - register unsigned int j; - register struct dirfile *df; - for (j = 0; j < DIRFILE_BUCKETS; ++j) - for (df = dir->contents->files[j]; df != 0; df = df->next) - if (df->impossible) - ++im; - else - ++f; -#ifdef NETSCAPE - printf ("# %s (device %d, path_key %s, mtime %d): ", - dir->name, dir->contents->dev, - dir->contents->path_key, dir->contents->mtime); -#else - printf ("# %s (device %d, inode %d): ", - dir->name, dir->contents->dev, dir->contents->ino); -#endif - if (f == 0) - fputs ("No", stdout); - else - printf ("%u", f); - fputs (" files, ", stdout); - if (im == 0) - fputs ("no", stdout); - else - printf ("%u", im); - fputs (" impossibilities", stdout); - if (dir->contents->dirstream == 0) - puts ("."); - else - puts (" so far."); - files += f; - impossible += im; - } - } - - fputs ("\n# ", stdout); - if (files == 0) - fputs ("No", stdout); - else - printf ("%u", files); - fputs (" files, ", stdout); - if (impossible == 0) - fputs ("no", stdout); - else - printf ("%u", impossible); - printf (" impossibilities in %u directories.\n", dirs); -} - -/* Hooks for globbing. */ - -#include - -/* Structure describing state of iterating through a directory hash table. */ - -struct dirstream - { - struct directory_contents *contents; /* The directory being read. */ - - unsigned int bucket; /* Current hash bucket. */ - struct dirfile *elt; /* Current elt in bucket. */ - }; - -/* Forward declarations. */ -static __ptr_t open_dirstream __P ((const char *)); -static const char *read_dirstream __P ((__ptr_t)); - -static __ptr_t -open_dirstream (directory) - const char *directory; -{ - struct dirstream *new; - struct directory *dir = find_directory (directory); - - if (dir->contents == 0 || dir->contents->files == 0) - /* DIR->contents is nil if the directory could not be stat'd. - DIR->contents->files is nil if it could not be opened. */ - return 0; - - /* Read all the contents of the directory now. There is no benefit - in being lazy, since glob will want to see every file anyway. */ - - (void) dir_contents_file_exists_p (dir->contents, (char *) 0); - - new = (struct dirstream *) xmalloc (sizeof (struct dirstream)); - new->contents = dir->contents; - new->bucket = 0; - new->elt = new->contents->files[0]; - - return (__ptr_t) new; -} - -static const char * -read_dirstream (stream) - __ptr_t stream; -{ - struct dirstream *const ds = (struct dirstream *) stream; - register struct dirfile *df; - - while (ds->bucket < DIRFILE_BUCKETS) - { - while ((df = ds->elt) != 0) - { - ds->elt = df->next; - if (!df->impossible) - return df->name; - } - if (++ds->bucket == DIRFILE_BUCKETS) - break; - ds->elt = ds->contents->files[ds->bucket]; - } - - return 0; -} - -void -init_dir () -{ - __glob_opendir_hook = open_dirstream; - __glob_readdir_hook = read_dirstream; - __glob_closedir_hook = (void (*) __P ((__ptr_t stream))) free; -} diff --git a/buildtools/windows/source/make/expand.c b/buildtools/windows/source/make/expand.c deleted file mode 100644 index 7348fb26176..00000000000 --- a/buildtools/windows/source/make/expand.c +++ /dev/null @@ -1,456 +0,0 @@ -/* Variable expansion functions for GNU Make. -Copyright (C) 1988, 89, 91, 92, 93, 95 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "file.h" -#include "variable.h" - -/* The next two describe the variable output buffer. - This buffer is used to hold the variable-expansion of a line of the - makefile. It is made bigger with realloc whenever it is too small. - variable_buffer_length is the size currently allocated. - variable_buffer is the address of the buffer. */ - -static unsigned int variable_buffer_length; -static char *variable_buffer; - -/* Subroutine of variable_expand and friends: - The text to add is LENGTH chars starting at STRING to the variable_buffer. - The text is added to the buffer at PTR, and the updated pointer into - the buffer is returned as the value. Thus, the value returned by - each call to variable_buffer_output should be the first argument to - the following call. */ - -char * -variable_buffer_output (ptr, string, length) - char *ptr, *string; - unsigned int length; -{ - register unsigned int newlen = length + (ptr - variable_buffer); - - if (newlen > variable_buffer_length) - { - unsigned int offset = ptr - variable_buffer; - variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length - ? newlen + 100 - : 2 * variable_buffer_length); - variable_buffer = (char *) xrealloc (variable_buffer, - variable_buffer_length); - ptr = variable_buffer + offset; - } - - bcopy (string, ptr, length); - return ptr + length; -} - -/* Return a pointer to the beginning of the variable buffer. */ - -static char * -initialize_variable_output () -{ - /* If we don't have a variable output buffer yet, get one. */ - - if (variable_buffer == 0) - { - variable_buffer_length = 200; - variable_buffer = (char *) xmalloc (variable_buffer_length); - variable_buffer[0] = '\0'; - } - - return variable_buffer; -} - -/* Recursively expand V. The returned string is malloc'd. */ - -char * -recursively_expand (v) - register struct variable *v; -{ - char *value; - - if (v->expanding) - { - /* Expanding V causes infinite recursion. Lose. */ - if (reading_filename == 0) - fatal ("Recursive variable `%s' references itself (eventually)", - v->name); - else - makefile_fatal - (reading_filename, *reading_lineno_ptr, - "Recursive variable `%s' references itself (eventually)", - v->name); - } - - v->expanding = 1; - value = allocated_variable_expand (v->value); - v->expanding = 0; - - return value; -} - -/* Warn that NAME is an undefined variable. */ - -#ifdef __GNUC__ -__inline -#endif -static void -warn_undefined (name, length) - char *name; - unsigned int length; -{ - if (warn_undefined_variables_flag) - { - static const char warnmsg[] = "warning: undefined variable `%.*s'"; - if (reading_filename != 0) - makefile_error (reading_filename, *reading_lineno_ptr, - warnmsg, length, name); - else - error (warnmsg, length, name); - } -} - -/* Expand a simple reference to variable NAME, which is LENGTH chars long. */ - -#ifdef __GNUC__ -__inline -#endif -static char * -reference_variable (o, name, length) - char *o; - char *name; - unsigned int length; -{ - register struct variable *v = lookup_variable (name, length); - - if (v == 0) - warn_undefined (name, length); - - if (v != 0 && *v->value != '\0') - { - char *value = (v->recursive ? recursively_expand (v) : v->value); - o = variable_buffer_output (o, value, strlen (value)); - if (v->recursive) - free (value); - } - - return o; -} - -/* Scan LINE for variable references and expansion-function calls. - Build in `variable_buffer' the result of expanding the references and calls. - Return the address of the resulting string, which is null-terminated - and is valid only until the next time this function is called. */ - -char * -variable_expand (line) - register char *line; -{ - register struct variable *v; - register char *p, *o, *p1; - - p = line; - o = initialize_variable_output (); - - while (1) - { - /* Copy all following uninteresting chars all at once to the - variable output buffer, and skip them. Uninteresting chars end - at the next $ or the end of the input. */ - - p1 = index (p, '$'); - - o = variable_buffer_output (o, p, p1 != 0 ? p1 - p : strlen (p) + 1); - - if (p1 == 0) - break; - p = p1 + 1; - - /* Dispatch on the char that follows the $. */ - - switch (*p) - { - case '$': - /* $$ seen means output one $ to the variable output buffer. */ - o = variable_buffer_output (o, p, 1); - break; - - case '(': - case '{': - /* $(...) or ${...} is the general case of substitution. */ - { - char openparen = *p; - char closeparen = (openparen == '(') ? ')' : '}'; - register char *beg = p + 1; - int free_beg = 0; - char *op, *begp; - char *end, *colon; - - op = o; - begp = p; - if (handle_function (&op, &begp)) - { - o = op; - p = begp; - break; - } - - /* Is there a variable reference inside the parens or braces? - If so, expand it before expanding the entire reference. */ - - end = index (beg, closeparen); - if (end == 0) - { - /* Unterminated variable reference. */ - if (reading_filename != 0) - makefile_fatal (reading_filename, *reading_lineno_ptr, - "unterminated variable reference"); - else - fatal ("unterminated variable reference"); - } - p1 = lindex (beg, end, '$'); - if (p1 != 0) - { - /* BEG now points past the opening paren or brace. - Count parens or braces until it is matched. */ - int count = 0; - for (p = beg; *p != '\0'; ++p) - { - if (*p == openparen) - ++count; - else if (*p == closeparen && --count < 0) - break; - } - /* If COUNT is >= 0, there were unmatched opening parens - or braces, so we go to the simple case of a variable name - such as `$($(a)'. */ - if (count < 0) - { - beg = expand_argument (beg, p); /* Expand the name. */ - free_beg = 1; /* Remember to free BEG when finished. */ - end = index (beg, '\0'); - } - } - else - /* Advance P to the end of this reference. After we are - finished expanding this one, P will be incremented to - continue the scan. */ - p = end; - - /* This is not a reference to a built-in function and - any variable references inside are now expanded. - Is the resultant text a substitution reference? */ - - colon = lindex (beg, end, ':'); - if (colon != 0) - { - /* This looks like a substitution reference: $(FOO:A=B). */ - char *subst_beg, *subst_end, *replace_beg, *replace_end; - - subst_beg = colon + 1; - subst_end = index (subst_beg, '='); - if (subst_end == 0) - /* There is no = in sight. Punt on the substitution - reference and treat this as a variable name containing - a colon, in the code below. */ - colon = 0; - else - { - replace_beg = subst_end + 1; - replace_end = end; - - /* Extract the variable name before the colon - and look up that variable. */ - v = lookup_variable (beg, colon - beg); - if (v == 0) - warn_undefined (beg, colon - beg); - - if (v != 0 && *v->value != '\0') - { - char *value = (v->recursive ? recursively_expand (v) - : v->value); - char *pattern, *percent; - if (free_beg) - { - *subst_end = '\0'; - pattern = subst_beg; - } - else - { - pattern = (char *) alloca (subst_end - subst_beg - + 1); - bcopy (subst_beg, pattern, subst_end - subst_beg); - pattern[subst_end - subst_beg] = '\0'; - } - percent = find_percent (pattern); - if (percent != 0) - { - char *replace; - if (free_beg) - { - *replace_end = '\0'; - replace = replace_beg; - } - else - { - replace = (char *) alloca (replace_end - - replace_beg - + 1); - bcopy (replace_beg, replace, - replace_end - replace_beg); - replace[replace_end - replace_beg] = '\0'; - } - - o = patsubst_expand (o, value, pattern, replace, - percent, (char *) 0); - } - else - o = subst_expand (o, value, - pattern, replace_beg, - strlen (pattern), - end - replace_beg, - 0, 1); - if (v->recursive) - free (value); - } - } - } - - if (colon == 0) - /* This is an ordinary variable reference. - Look up the value of the variable. */ - o = reference_variable (o, beg, end - beg); - - if (free_beg) - free (beg); - } - break; - - case '\0': - break; - - default: - if (isblank (p[-1])) - break; - - /* A $ followed by a random char is a variable reference: - $a is equivalent to $(a). */ - { - /* We could do the expanding here, but this way - avoids code repetition at a small performance cost. */ - char name[5]; - name[0] = '$'; - name[1] = '('; - name[2] = *p; - name[3] = ')'; - name[4] = '\0'; - p1 = allocated_variable_expand (name); - o = variable_buffer_output (o, p1, strlen (p1)); - free (p1); - } - - break; - } - - if (*p == '\0') - break; - else - ++p; - } - - (void) variable_buffer_output (o, "", 1); - return initialize_variable_output (); -} - -/* Expand an argument for an expansion function. - The text starting at STR and ending at END is variable-expanded - into a null-terminated string that is returned as the value. - This is done without clobbering `variable_buffer' or the current - variable-expansion that is in progress. */ - -char * -expand_argument (str, end) - char *str, *end; -{ - char *tmp; - - if (*end == '\0') - tmp = str; - else - { - tmp = (char *) alloca (end - str + 1); - bcopy (str, tmp, end - str); - tmp[end - str] = '\0'; - } - - return allocated_variable_expand (tmp); -} - -/* Expand LINE for FILE. Error messages refer to the file and line where - FILE's commands were found. Expansion uses FILE's variable set list. */ - -char * -variable_expand_for_file (line, file) - char *line; - register struct file *file; -{ - char *result; - struct variable_set_list *save; - - if (file == 0) - return variable_expand (line); - - save = current_variable_set_list; - current_variable_set_list = file->variables; - reading_filename = file->cmds->filename; - reading_lineno_ptr = &file->cmds->lineno; - result = variable_expand (line); - current_variable_set_list = save; - reading_filename = 0; - reading_lineno_ptr = 0; - - return result; -} - -/* Like variable_expand_for_file, but the returned string is malloc'd. - This function is called a lot. It wants to be efficient. */ - -char * -allocated_variable_expand_for_file (line, file) - char *line; - struct file *file; -{ - char *value; - - char *obuf = variable_buffer; - unsigned int olen = variable_buffer_length; - - variable_buffer = 0; - - value = variable_expand_for_file (line, file); - -#if 0 - /* Waste a little memory and save time. */ - value = xrealloc (value, strlen (value)) -#endif - - variable_buffer = obuf; - variable_buffer_length = olen; - - return value; -} diff --git a/buildtools/windows/source/make/file.c b/buildtools/windows/source/make/file.c deleted file mode 100644 index 82e7442cd66..00000000000 --- a/buildtools/windows/source/make/file.c +++ /dev/null @@ -1,566 +0,0 @@ -/* Target file hash table management for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "dep.h" -#include "file.h" -#include "variable.h" -#include - - -/* Hash table of files the makefile knows how to make. */ - -#ifndef FILE_BUCKETS -#define FILE_BUCKETS 1007 -#endif -static struct file *files[FILE_BUCKETS]; - -/* Number of files with the `intermediate' flag set. */ - -unsigned int num_intermediates = 0; - - -/* Access the hash table of all file records. - lookup_file given a name, return the struct file * for that name, - or nil if there is none. - enter_file similar, but create one if there is none. */ - -struct file * -lookup_file (name) - char *name; -{ - register struct file *f; - register char *n; - register unsigned int hashval; - - if (*name == '\0') - abort (); - - /* This is also done in parse_file_seq, so this is redundant - for names read from makefiles. It is here for names passed - on the command line. */ - while (name[0] == '.' && name[1] == '/' && name[2] != '\0') - { - name += 2; - while (*name == '/') - /* Skip following slashes: ".//foo" is "foo", not "/foo". */ - ++name; - } - - if (*name == '\0') - /* It was all slashes after a dot. */ - name = "./"; - - hashval = 0; - for (n = name; *n != '\0'; ++n) - HASH (hashval, *n); - hashval %= FILE_BUCKETS; - - for (f = files[hashval]; f != 0; f = f->next) - if (streq (f->name, name)) - return f; - return 0; -} - -struct file * -enter_file (name) - char *name; -{ - register struct file *f, *new; - register char *n; - register unsigned int hashval; - - if (*name == '\0') - abort (); - - hashval = 0; - for (n = name; *n != '\0'; ++n) - HASH (hashval, *n); - hashval %= FILE_BUCKETS; - - for (f = files[hashval]; f != 0; f = f->next) - if (streq (f->name, name)) - break; - - if (f != 0 && !f->double_colon) - return f; - - new = (struct file *) xmalloc (sizeof (struct file)); - bzero ((char *) new, sizeof (struct file)); - new->name = name; - new->update_status = -1; - - if (f == 0) - { - /* This is a completely new file. */ - new->next = files[hashval]; - files[hashval] = new; - } - else - { - /* There is already a double-colon entry for this file. */ - new->double_colon = f; - while (f->prev != 0) - f = f->prev; - f->prev = new; - } - - return new; -} - -/* Rename FILE to NAME. This is not as simple as resetting - the `name' member, since it must be put in a new hash bucket, - and possibly merged with an existing file called NAME. */ - -void -rename_file (file, name) - register struct file *file; - char *name; -{ - char *oldname = file->name; - register unsigned int oldhash; - register char *n; - - while (file->renamed != 0) - file = file->renamed; - - /* Find the hash values of the old and new names. */ - - oldhash = 0; - for (n = oldname; *n != '\0'; ++n) - HASH (oldhash, *n); - - file_hash_enter (file, name, oldhash, file->name); -} - -void -file_hash_enter (file, name, oldhash, oldname) - register struct file *file; - char *name; - unsigned int oldhash; - char *oldname; -{ - unsigned int oldbucket = oldhash % FILE_BUCKETS; - register unsigned int newhash, newbucket; - struct file *oldfile; - register char *n; - register struct file *f; - - newhash = 0; - for (n = name; *n != '\0'; ++n) - HASH (newhash, *n); - newbucket = newhash % FILE_BUCKETS; - - /* Look for an existing file under the new name. */ - - for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next) - if (streq (oldfile->name, name)) - break; - - if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0)) - { - /* Remove FILE from its hash bucket. */ - - struct file *lastf = 0; - - for (f = files[oldbucket]; f != file; f = f->next) - lastf = f; - - if (lastf == 0) - files[oldbucket] = f->next; - else - lastf->next = f->next; - } - - /* Give FILE its new name. */ - - file->name = name; - for (f = file->double_colon; f != 0; f = f->prev) - f->name = name; - - if (oldfile == 0) - { - /* There is no existing file with the new name. */ - - if (newbucket != oldbucket) - { - /* Put FILE in its new hash bucket. */ - file->next = files[newbucket]; - files[newbucket] = file; - } - } - else - { - /* There is an existing file with the new name. - We must merge FILE into the existing file. */ - - register struct dep *d; - - if (file->cmds != 0) - { - if (oldfile->cmds == 0) - oldfile->cmds = file->cmds; - else if (file->cmds != oldfile->cmds) - { - /* We have two sets of commands. We will go with the - one given in the rule explicitly mentioning this name, - but give a message to let the user know what's going on. */ - if (oldfile->cmds->filename != 0) - makefile_error (file->cmds->filename, file->cmds->lineno, - "Commands were specified for \ -file `%s' at %s:%u,", - oldname, oldfile->cmds->filename, - oldfile->cmds->lineno); - else - makefile_error (file->cmds->filename, file->cmds->lineno, - "Commands for file `%s' were found by \ -implicit rule search,", - oldname); - makefile_error (file->cmds->filename, file->cmds->lineno, - "but `%s' is now considered the same file \ -as `%s'.", - oldname, name); - makefile_error (file->cmds->filename, file->cmds->lineno, - "Commands for `%s' will be ignored \ -in favor of those for `%s'.", - name, oldname); - } - } - - /* Merge the dependencies of the two files. */ - - d = oldfile->deps; - if (d == 0) - oldfile->deps = file->deps; - else - { - while (d->next != 0) - d = d->next; - d->next = file->deps; - } - - merge_variable_set_lists (&oldfile->variables, file->variables); - - if (oldfile->double_colon && !file->double_colon) - fatal ("can't rename single-colon `%s' to double-colon `%s'", - oldname, name); - if (!oldfile->double_colon && file->double_colon) - fatal ("can't rename double-colon `%s' to single-colon `%s'", - oldname, name); - - if (file->last_mtime > oldfile->last_mtime) - /* %%% Kludge so -W wins on a file that gets vpathized. */ - oldfile->last_mtime = file->last_mtime; - -#define MERGE(field) oldfile->field |= file->field - MERGE (precious); - MERGE (tried_implicit); - MERGE (updating); - MERGE (updated); - MERGE (is_target); - MERGE (cmd_target); - MERGE (phony); -#undef MERGE - - file->renamed = oldfile; - } -} - -/* Remove all nonprecious intermediate files. - If SIG is nonzero, this was caused by a fatal signal, - meaning that a different message will be printed, and - the message will go to stderr rather than stdout. */ - -void -remove_intermediates (sig) - int sig; -{ - register int i; - register struct file *f; - char doneany; - - if (question_flag || touch_flag) - return; - if (sig && just_print_flag) - return; - - doneany = 0; - for (i = 0; i < FILE_BUCKETS; ++i) - for (f = files[i]; f != 0; f = f->next) - if (f->intermediate && (f->dontcare || !f->precious)) - { - int status; - if (f->update_status == -1) - /* If nothing would have created this file yet, - don't print an "rm" command for it. */ - continue; - else if (just_print_flag) - status = 0; - else - { - status = unlink (f->name); - if (status < 0 && errno == ENOENT) - continue; - } - if (!f->dontcare) - { - if (sig) - error ("*** Deleting intermediate file `%s'", f->name); - else if (!silent_flag) - { - if (! doneany) - { - fputs ("rm ", stdout); - doneany = 1; - } - else - putchar (' '); - fputs (f->name, stdout); - fflush (stdout); - } - if (status < 0) - perror_with_name ("unlink: ", f->name); - } - } - - if (doneany && !sig) - { - putchar ('\n'); - fflush (stdout); - } -} - -/* For each dependency of each file, make the `struct dep' point - at the appropriate `struct file' (which may have to be created). - - Also mark the files depended on by .PRECIOUS and .PHONY. */ - -void -snap_deps () -{ - register struct file *f, *f2; - register struct dep *d; - register int i; - - /* Enter each dependency name as a file. */ - for (i = 0; i < FILE_BUCKETS; ++i) - for (f = files[i]; f != 0; f = f->next) - for (f2 = f; f2 != 0; f2 = f2->prev) - for (d = f2->deps; d != 0; d = d->next) - if (d->name != 0) - { - d->file = lookup_file (d->name); - if (d->file == 0) - d->file = enter_file (d->name); - else - free (d->name); - d->name = 0; - } - - for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev) - for (d = f->deps; d != 0; d = d->next) - for (f2 = d->file; f2 != 0; f2 = f2->prev) - f2->precious = 1; - - for (f = lookup_file (".PHONY"); f != 0; f = f->prev) - for (d = f->deps; d != 0; d = d->next) - for (f2 = d->file; f2 != 0; f2 = f2->prev) - { - /* Mark this file as phony and nonexistent. */ - f2->phony = 1; - f2->last_mtime = (time_t) -1; - } - - f = lookup_file (".EXPORT_ALL_VARIABLES"); - if (f != 0 && f->is_target) - export_all_variables = 1; - - f = lookup_file (".IGNORE"); - if (f != 0 && f->is_target) - { - if (f->deps == 0) - ignore_errors_flag = 1; - else - for (d = f->deps; d != 0; d = d->next) - for (f2 = d->file; f2 != 0; f2 = f2->prev) - f2->command_flags |= COMMANDS_NOERROR; - } - - f = lookup_file (".SILENT"); - if (f != 0 && f->is_target) - { - if (f->deps == 0) - silent_flag = 1; - else - for (d = f->deps; d != 0; d = d->next) - for (f2 = d->file; f2 != 0; f2 = f2->prev) - f2->command_flags |= COMMANDS_SILENT; - } - - f = lookup_file (".POSIX"); - if (f != 0 && f->is_target) - posix_pedantic = 1; -} - -/* Set the `command_state' member of FILE and all its `also_make's. */ - -void -set_command_state (file, state) - struct file *file; - int state; -{ - struct dep *d; - - file->command_state = state; - - for (d = file->also_make; d != 0; d = d->next) - d->file->command_state = state; -} - -/* Print the data base of files. */ - -static void -print_file (f) - struct file *f; -{ - register struct dep *d; - - putchar ('\n'); - if (!f->is_target) - puts ("# Not a target:"); - printf ("%s:%s", f->name, f->double_colon ? ":" : ""); - - for (d = f->deps; d != 0; d = d->next) - printf (" %s", dep_name (d)); - putchar ('\n'); - - if (f->precious) - puts ("# Precious file (dependency of .PRECIOUS)."); - if (f->phony) - puts ("# Phony target (dependency of .PHONY)."); - if (f->cmd_target) - puts ("# Command-line target."); - if (f->dontcare) - puts ("# A default or MAKEFILES makefile."); - printf ("# Implicit rule search has%s been done.\n", - f->tried_implicit ? "" : " not"); - if (f->stem != 0) - printf ("# Implicit/static pattern stem: `%s'\n", f->stem); - if (f->intermediate) - puts ("# File is an intermediate dependency."); - if (f->also_make != 0) - { - fputs ("# Also makes:", stdout); - for (d = f->also_make; d != 0; d = d->next) - printf (" %s", dep_name (d)); - putchar ('\n'); - } - if (f->last_mtime == (time_t) 0) - puts ("# Modification time never checked."); - else if (f->last_mtime == (time_t) -1) - puts ("# File does not exist."); - else - printf ("# Last modified %.24s (%ld)\n", - ctime (&f->last_mtime), (long int) f->last_mtime); - printf ("# File has%s been updated.\n", - f->updated ? "" : " not"); - switch (f->command_state) - { - case cs_running: - puts ("# Commands currently running (THIS IS A BUG)."); - break; - case cs_deps_running: - puts ("# Dependencies commands running (THIS IS A BUG)."); - break; - case cs_not_started: - case cs_finished: - switch (f->update_status) - { - case -1: - break; - case 0: - puts ("# Successfully updated."); - break; - case 1: - assert (question_flag); - puts ("# Needs to be updated (-q is set)."); - break; - case 2: - puts ("# Failed to be updated."); - break; - default: - puts ("# Invalid value in `update_status' member!"); - fflush (stdout); - fflush (stderr); - abort (); - } - break; - default: - puts ("# Invalid value in `command_state' member!"); - fflush (stdout); - fflush (stderr); - abort (); - } - - if (f->variables != 0) - print_file_variables (f); - - if (f->cmds != 0) - print_commands (f->cmds); -} - -void -print_file_data_base () -{ - register unsigned int i, nfiles, per_bucket; - register struct file *file; - - puts ("\n# Files"); - - per_bucket = nfiles = 0; - for (i = 0; i < FILE_BUCKETS; ++i) - { - register unsigned int this_bucket = 0; - - for (file = files[i]; file != 0; file = file->next) - { - register struct file *f; - - ++this_bucket; - - for (f = file; f != 0; f = f->prev) - print_file (f); - } - - nfiles += this_bucket; - if (this_bucket > per_bucket) - per_bucket = this_bucket; - } - - if (nfiles == 0) - puts ("\n# No files."); - else - { - printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS); -#ifndef NO_FLOAT - printf ("# average %.1f files per bucket, max %u files in one bucket.\n", - ((double) nfiles) / ((double) FILE_BUCKETS) * 100.0, per_bucket); -#endif - } -} diff --git a/buildtools/windows/source/make/file.h b/buildtools/windows/source/make/file.h deleted file mode 100644 index 5889474a550..00000000000 --- a/buildtools/windows/source/make/file.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Definition of target file data structures for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Structure that represents the info on one file - that the makefile says how to make. - All of these are chained together through `next'. */ - -struct file - { - struct file *next; - char *name; - struct dep *deps; - struct commands *cmds; /* Commands to execute for this target. */ - int command_flags; /* Flags OR'd in for cmds; see commands.h. */ - char *stem; /* Implicit stem, if an implicit - rule has been used */ - struct dep *also_make; /* Targets that are made by making this. */ - time_t last_mtime; /* File's modtime, if already known. */ - struct file *prev; /* Previous entry for same file name; - used when there are multiple double-colon - entries for the same file. */ - - /* File that this file was renamed to. After any time that a - file could be renamed, call `check_renamed' (below). */ - struct file *renamed; - - /* List of variable sets used for this file. */ - struct variable_set_list *variables; - - /* Immediate dependent that caused this target to be remade, - or nil if there isn't one. */ - struct file *parent; - - /* For a double-colon entry, this is the first double-colon entry for - the same file. Otherwise this is null. */ - struct file *double_colon; - - short int update_status; /* Status of the last attempt to update, - or -1 if none has been made. */ - - enum /* State of the commands. */ - { /* Note: It is important that cs_not_started be zero. */ - cs_not_started, /* Not yet started. */ - cs_deps_running, /* Dep commands running. */ - cs_running, /* Commands running. */ - cs_finished /* Commands finished. */ - } command_state ENUM_BITFIELD (2); - - unsigned int precious:1; /* Non-0 means don't delete file on quit */ - unsigned int tried_implicit:1; /* Nonzero if have searched - for implicit rule for making - this file; don't search again. */ - unsigned int updating:1; /* Nonzero while updating deps of this file */ - unsigned int updated:1; /* Nonzero if this file has been remade. */ - unsigned int is_target:1; /* Nonzero if file is described as target. */ - unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */ - unsigned int phony:1; /* Nonzero if this is a phony file - i.e., a dependency of .PHONY. */ - unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */ - unsigned int dontcare:1; /* Nonzero if no complaint is to be made if - this target cannot be remade. */ - }; - -/* Number of intermediate files entered. */ - -extern unsigned int num_intermediates; - -extern struct file *default_goal_file, *suffix_file, *default_file; - - -extern struct file *lookup_file (), *enter_file (); -extern void remove_intermediates (), snap_deps (); -extern void rename_file (), file_hash_enter (); -extern void set_command_state (); - - -extern time_t f_mtime (); -#define file_mtime_1(f, v) \ - ((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v)) -#define file_mtime(f) file_mtime_1 ((f), 1) -#define file_mtime_no_search(f) file_mtime_1 ((f), 0) - -/* Modtime value to use for `infinitely new'. We used to get the current time - from the system and use that whenever we wanted `new'. But that causes - trouble when the machine running make and the machine holding a file have - different ideas about what time it is; and can also lose for `force' - targets, which need to be considered newer than anything that depends on - them, even if said dependents' modtimes are in the future. - - NOTE: This assumes 32-bit `time_t's, but I cannot think of a portable way - to produce the largest representable integer of a given signed type. */ -#define NEW_MTIME ((time_t) 0x7fffffff) - - -#define check_renamed(file) \ - while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */ diff --git a/buildtools/windows/source/make/function.c b/buildtools/windows/source/make/function.c deleted file mode 100644 index 428d447008c..00000000000 --- a/buildtools/windows/source/make/function.c +++ /dev/null @@ -1,1329 +0,0 @@ -/* Variable function expansion for GNU Make. -Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "variable.h" -#include "dep.h" -#include "commands.h" -#include "job.h" - -#if defined(__MSDOS__) || defined(NETSCAPE) -#include -#include -#include -#include -#endif - -static char *string_glob (); - -/* Store into VARIABLE_BUFFER at O the result of scanning TEXT and replacing - each occurrence of SUBST with REPLACE. TEXT is null-terminated. SLEN is - the length of SUBST and RLEN is the length of REPLACE. If BY_WORD is - nonzero, substitutions are done only on matches which are complete - whitespace-delimited words. If SUFFIX_ONLY is nonzero, substitutions are - done only at the ends of whitespace-delimited words. */ - -char * -subst_expand (o, text, subst, replace, slen, rlen, by_word, suffix_only) - char *o; - char *text; - char *subst, *replace; - unsigned int slen, rlen; - int by_word, suffix_only; -{ - register char *t = text; - register char *p; - - if (slen == 0 && !by_word && !suffix_only) - { - /* The first occurrence of "" in any string is its end. */ - o = variable_buffer_output (o, t, strlen (t)); - if (rlen > 0) - o = variable_buffer_output (o, replace, rlen); - return o; - } - - do - { - if ((by_word | suffix_only) && slen == 0) - /* When matching by words, the empty string should match - the end of each word, rather than the end of the whole text. */ - p = end_of_token (next_token (t)); - else - { - p = sindex (t, 0, subst, slen); - if (p == 0) - { - /* No more matches. Output everything left on the end. */ - o = variable_buffer_output (o, t, strlen (t)); - return o; - } - } - - /* Output everything before this occurrence of the string to replace. */ - if (p > t) - o = variable_buffer_output (o, t, p - t); - - /* If we're substituting only by fully matched words, - or only at the ends of words, check that this case qualifies. */ - if ((by_word - && ((p > t && !isblank (p[-1])) - || (p[slen] != '\0' && !isblank (p[slen])))) - || (suffix_only - && (p[slen] != '\0' && !isblank (p[slen])))) - /* Struck out. Output the rest of the string that is - no longer to be replaced. */ - o = variable_buffer_output (o, subst, slen); - else if (rlen > 0) - /* Output the replacement string. */ - o = variable_buffer_output (o, replace, rlen); - - /* Advance T past the string to be replaced. */ - t = p + slen; - } while (*t != '\0'); - - return o; -} - - -/* Store into VARIABLE_BUFFER at O the result of scanning TEXT - and replacing strings matching PATTERN with REPLACE. - If PATTERN_PERCENT is not nil, PATTERN has already been - run through find_percent, and PATTERN_PERCENT is the result. - If REPLACE_PERCENT is not nil, REPLACE has already been - run through find_percent, and REPLACE_PERCENT is the result. */ - -char * -patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent) - char *o; - char *text; - register char *pattern, *replace; - register char *pattern_percent, *replace_percent; -{ - register int pattern_prepercent_len, pattern_postpercent_len; - register int replace_prepercent_len, replace_postpercent_len; - register char *t; - unsigned int len; - int doneany = 0; - - /* We call find_percent on REPLACE before checking PATTERN so that REPLACE - will be collapsed before we call subst_expand if PATTERN has no %. */ - if (replace_percent == 0) - replace_percent = find_percent (replace); - if (replace_percent != 0) - { - /* Record the length of REPLACE before and after the % so - we don't have to compute these lengths more than once. */ - replace_prepercent_len = replace_percent - replace; - replace_postpercent_len = strlen (replace_percent + 1); - } - else - /* We store the length of the replacement - so we only need to compute it once. */ - replace_prepercent_len = strlen (replace); - - if (pattern_percent == 0) - pattern_percent = find_percent (pattern); - if (pattern_percent == 0) - /* With no % in the pattern, this is just a simple substitution. */ - return subst_expand (o, text, pattern, replace, - strlen (pattern), strlen (replace), 1, 0); - - /* Record the length of PATTERN before and after the % - so we don't have to compute it more than once. */ - pattern_prepercent_len = pattern_percent - pattern; - pattern_postpercent_len = strlen (pattern_percent + 1); - - while ((t = find_next_token (&text, &len)) != 0) - { - int fail = 0; - - /* Is it big enough to match? */ - if ((int)len < pattern_prepercent_len + pattern_postpercent_len) - fail = 1; - - /* Does the prefix match? */ - if (!fail && pattern_prepercent_len > 0 - && (*t != *pattern - || t[pattern_prepercent_len - 1] != pattern_percent[-1] - || strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1))) - fail = 1; - - /* Does the suffix match? */ - if (!fail && pattern_postpercent_len > 0 - && (t[len - 1] != pattern_percent[pattern_postpercent_len] - || t[len - pattern_postpercent_len] != pattern_percent[1] - || strncmp (&t[len - pattern_postpercent_len], - &pattern_percent[1], pattern_postpercent_len - 1))) - fail = 1; - - if (fail) - /* It didn't match. Output the string. */ - o = variable_buffer_output (o, t, len); - else - { - /* It matched. Output the replacement. */ - - /* Output the part of the replacement before the %. */ - o = variable_buffer_output (o, replace, replace_prepercent_len); - - if (replace_percent != 0) - { - /* Output the part of the matched string that - matched the % in the pattern. */ - o = variable_buffer_output (o, t + pattern_prepercent_len, - len - (pattern_prepercent_len - + pattern_postpercent_len)); - /* Output the part of the replacement after the %. */ - o = variable_buffer_output (o, replace_percent + 1, - replace_postpercent_len); - } - } - - /* Output a space, but not if the replacement is "". */ - if (fail || replace_prepercent_len > 0 - || (replace_percent != 0 && len + replace_postpercent_len > 0)) - { - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - } - if (doneany) - /* Kill the last space. */ - --o; - - return o; -} - -/* Handle variable-expansion-time functions such as $(dir foo/bar) ==> foo/ */ - -/* These enumeration constants distinguish the - various expansion-time built-in functions. */ - -enum function - { - function_subst, - function_addsuffix, - function_addprefix, - function_dir, - function_notdir, - function_suffix, - function_basename, - function_wildcard, - function_firstword, - function_word, - function_words, - function_findstring, - function_strip, - function_join, - function_patsubst, - function_filter, - function_filter_out, - function_foreach, - function_sort, - function_origin, - function_shell, - function_invalid - }; - -/* Greater than the length of any function name. */ -#define MAXFUNCTIONLEN 11 - -/* The function names and lengths of names, for looking them up. */ - -static struct - { - char *name; - unsigned int len; - enum function function; - } function_table[] = - { - { "subst", 5, function_subst }, - { "addsuffix", 9, function_addsuffix }, - { "addprefix", 9, function_addprefix }, - { "dir", 3, function_dir }, - { "notdir", 6, function_notdir }, - { "suffix", 6, function_suffix }, - { "basename", 8, function_basename }, - { "wildcard", 8, function_wildcard }, - { "firstword", 9, function_firstword }, - { "word", 4, function_word }, - { "words", 5, function_words }, - { "findstring", 10, function_findstring }, - { "strip", 5, function_strip }, - { "join", 4, function_join }, - { "patsubst", 8, function_patsubst }, - { "filter", 6, function_filter }, - { "filter-out", 10, function_filter_out }, - { "foreach", 7, function_foreach }, - { "sort", 4, function_sort }, - { "origin", 6, function_origin }, - { "shell", 5, function_shell }, - { 0, 0, function_invalid } - }; - -/* Return 1 if PATTERN matches WORD, 0 if not. */ - -int -pattern_matches (pattern, percent, word) - register char *pattern, *percent, *word; -{ - unsigned int sfxlen, wordlen; - - if (percent == 0) - { - unsigned int len = strlen (pattern) + 1; - char *new = (char *) alloca (len); - bcopy (pattern, new, len); - pattern = new; - percent = find_percent (pattern); - if (percent == 0) - return streq (pattern, word); - } - - sfxlen = strlen (percent + 1); - wordlen = strlen (word); - - if (wordlen < (percent - pattern) + sfxlen - || strncmp (pattern, word, percent - pattern)) - return 0; - - return !strcmp (percent + 1, word + (wordlen - sfxlen)); -} - -int shell_function_pid = 0, shell_function_completed; - -/* Perform the function specified by FUNCTION on the text at TEXT. - END is points to the end of the argument text (exclusive). - The output is written into VARIABLE_BUFFER starting at O. */ - -/* Note this absorbs a semicolon and is safe to use in conditionals. */ -#define BADARGS(func) \ - if (reading_filename != 0) \ - makefile_fatal (reading_filename, *reading_lineno_ptr, \ - "insufficient arguments to function `%s'", \ - func); \ - else \ - fatal ("insufficient arguments to function `%s'", func) - -static char * -expand_function (o, function, text, end) - char *o; - enum function function; - char *text; - char *end; -{ - char *p, *p2, *p3; - unsigned int i, len; - int doneany = 0; - int count; - char endparen = *end, startparen = *end == ')' ? '(' : '{'; - - switch (function) - { - default: - abort (); - break; - - case function_shell: - { - char **argv, **envp; - char *error_prefix; -// int pipedes[2]; -// int pid; - - /* Expand the command line. */ - text = expand_argument (text, end); - - /* Construct the argument list. */ - argv = construct_command_argv (text, (char *) NULL, (struct file *) 0); - if (argv == 0) - break; - - /* Using a target environment for `shell' loses in cases like: - export var = $(shell echo foobie) - because target_environment hits a loop trying to expand $(var) - to put it in the environment. This is even more confusing when - var was not explicitly exported, but just appeared in the - calling environment. */ -#if 1 - envp = environ; -#else - /* Construct the environment. */ - envp = target_environment ((struct file *) 0); -#endif - - /* For error messages. */ - if (reading_filename != 0) - { - error_prefix = (char *) alloca (strlen (reading_filename) + 100); - sprintf (error_prefix, - "%s:%u: ", reading_filename, *reading_lineno_ptr); - } - else - error_prefix = ""; - -#if !defined(__MSDOS__) && !defined(NETSCAPE) - if (pipe (pipedes) < 0) - { - perror_with_name (error_prefix, "pipe"); - break; - } - - pid = vfork (); - if (pid < 0) - perror_with_name (error_prefix, "fork"); - else if (pid == 0) - child_execute_job (0, pipedes[1], argv, envp); - else - { - /* We are the parent. */ - - char *buffer; - unsigned int maxlen; - int cc; - - /* Free the storage only the child needed. */ - free (argv[0]); - free ((char *) argv); -#if 0 - for (i = 0; envp[i] != 0; ++i) - free (envp[i]); - free ((char *) envp); -#endif - - /* Record the PID for reap_children. */ - shell_function_pid = pid; - shell_function_completed = 0; - - - /* Set up and read from the pipe. */ - - maxlen = 200; - buffer = (char *) xmalloc (maxlen + 1); - - /* Close the write side of the pipe. */ - (void) close (pipedes[1]); - - /* Read from the pipe until it gets EOF. */ - i = 0; - do - { - if (i == maxlen) - { - maxlen += 512; - buffer = (char *) xrealloc (buffer, maxlen + 1); - } - - errno = 0; - cc = read (pipedes[0], &buffer[i], maxlen - i); - if (cc > 0) - i += cc; - } -#ifdef EINTR - while (cc > 0 || errno == EINTR); -#else - while (cc > 0); -#endif - - /* Close the read side of the pipe. */ - (void) close (pipedes[0]); - - /* Loop until child_handler sets shell_function_completed - to the status of our child shell. */ - while (shell_function_completed == 0) - reap_children (1, 0); - - shell_function_pid = 0; - - /* The child_handler function will set shell_function_completed - to 1 when the child dies normally, or to -1 if it - dies with status 127, which is most likely an exec fail. */ - - if (shell_function_completed == -1) - { - /* This most likely means that the execvp failed, - so we should just write out the error message - that came in over the pipe from the child. */ - fputs (buffer, stderr); - fflush (stderr); - } - else - { - /* The child finished normally. Replace all - newlines in its output with spaces, and put - that in the variable output buffer. */ - if (i > 0) - { - if (buffer[i - 1] == '\n') - buffer[--i] = '\0'; - else - buffer[i] = '\0'; - p = buffer; - while ((p = index (p, '\n')) != 0) - *p++ = ' '; - o = variable_buffer_output (o, buffer, i); - } - } - - free (buffer); - } -#else /* MSDOS. */ - { - /* MS-DOS can't do fork, but it can do spawn. However, this - means that we don't have an opportunity to reopen stdout to - trap it. Thus, we save our own stdout onto a new descriptor - and dup a temp file's descriptor onto our stdout temporarily. - After we spawn the shell program, we dup our own stdout back - to the stdout descriptor. The buffer reading is the same as - above, except that we're now reading from a file. */ - - int save_stdout; - int child_stdout; - char tmp_output[FILENAME_MAX]; -// FILE *child_stream; - unsigned int maxlen = 200; - int cc; - char *buffer; - - strcpy (tmp_output, "shXXXXXX"); - mktemp (tmp_output); - child_stdout = open (tmp_output, - O_WRONLY|O_CREAT|O_TRUNC|O_TEXT, 0644); - save_stdout = dup (1); - dup2 (child_stdout, 1); -#ifdef NETSCAPE - if (ns_spawn (argv, NULL, NULL) == -1) - { - char errMsg[128]; - FormatMessage ( - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError (), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - errMsg, - sizeof (errMsg), - NULL - ); - error ("%s%s: %s", error_prefix, argv[0], errMsg); - } -#else - spawnvp (P_WAIT, argv[0], argv); -#endif - dup2 (save_stdout, 1); - close (child_stdout); - close (save_stdout); - - child_stdout = open (tmp_output, O_RDONLY|O_TEXT, 0644); - - buffer = xmalloc (maxlen); - i = 0; - do - { - if (i == maxlen) - { - maxlen += 512; - buffer = (char *) xrealloc (buffer, maxlen + 1); - } - - cc = read (child_stdout, &buffer[i], maxlen - i); - if (cc > 0) - i += cc; - } while (cc > 0); - - close (child_stdout); - unlink (tmp_output); - - if (i > 0) - { - if (buffer[i - 1] == '\n') - buffer[--i] = '\0'; - else - buffer[i] = '\0'; - p = buffer; - while ((p = index (p, '\n')) != 0) - *p++ = ' '; - o = variable_buffer_output (o, buffer, i); - } - free (buffer); - } -#endif /* Not MSDOS. */ - - free (text); - break; - } - - case function_origin: - /* Expand the argument. */ - text = expand_argument (text, end); - - { - register struct variable *v = lookup_variable (text, strlen (text)); - if (v == 0) - o = variable_buffer_output (o, "undefined", 9); - else - switch (v->origin) - { - default: - case o_invalid: - abort (); - break; - case o_default: - o = variable_buffer_output (o, "default", 7); - break; - case o_env: - o = variable_buffer_output (o, "environment", 11); - break; - case o_file: - o = variable_buffer_output (o, "file", 4); - break; - case o_env_override: - o = variable_buffer_output (o, "environment override", 20); - break; - case o_command: - o = variable_buffer_output (o, "command line", 12); - break; - case o_override: - o = variable_buffer_output (o, "override", 8); - break; - case o_automatic: - o = variable_buffer_output (o, "automatic", 9); - break; - } - } - - free (text); - break; - - case function_sort: - /* Expand the argument. */ - text = expand_argument (text, end); - - { - char **words = (char **) xmalloc (10 * sizeof (char *)); - unsigned int nwords = 10; - register unsigned int wordi = 0; - char *t; - - /* Chop TEXT into words and put them in WORDS. */ - t = text; - while ((p = find_next_token (&t, &len)) != 0) - { - if (wordi >= nwords - 1) - { - nwords *= 2; - words = (char **) xrealloc ((char *) words, - nwords * sizeof (char *)); - } - words[wordi++] = savestring (p, len); - } - - if (wordi > 0) - { - /* Now sort the list of words. */ - qsort ((char *) words, wordi, sizeof (char *), alpha_compare); - - /* Now write the sorted list. */ - for (i = 0; i < wordi; ++i) - { - len = strlen (words[i]); - if (i == wordi - 1 || strlen (words[i + 1]) != len - || strcmp (words[i], words[i + 1])) - { - o = variable_buffer_output (o, words[i], len); - o = variable_buffer_output (o, " ", 1); - } - free (words[i]); - } - /* Kill the last space. */ - --o; - } - - free ((char *) words); - } - - free (text); - break; - - case function_foreach: - { - /* Get three comma-separated arguments but - expand only the first two. */ - char *var, *list; - register struct variable *v; - - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("foreach"); - var = expand_argument (text, p); - - p2 = p + 1; - count = 0; - for (p = p2; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("foreach"); - list = expand_argument (p2, p); - - ++p; - text = savestring (p, end - p); - - push_new_variable_scope (); - v = define_variable (var, strlen (var), "", o_automatic, 0); - p3 = list; - while ((p = find_next_token (&p3, &len)) != 0) - { - char *result; - char save = p[len]; - p[len] = '\0'; - v->value = p; - result = allocated_variable_expand (text); - p[len] = save; - - o = variable_buffer_output (o, result, strlen (result)); - o = variable_buffer_output (o, " ", 1); - doneany = 1; - free (result); - } - if (doneany) - /* Kill the last space. */ - --o; - - pop_variable_scope (); - - free (var); - free (list); - free (text); - } - break; - - case function_filter: - case function_filter_out: - { - struct word - { - struct word *next; - char *word; - int matched; - } *words, *wordtail, *wp; - - /* Get two comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS (function == function_filter ? "filter" : "filter-out"); - p2 = expand_argument (text, p); - - text = expand_argument (p + 1, end); - - /* Chop TEXT up into words and then run each pattern through. */ - words = wordtail = 0; - p3 = text; - while ((p = find_next_token (&p3, &len)) != 0) - { - struct word *w = (struct word *) alloca (sizeof (struct word)); - if (words == 0) - words = w; - else - wordtail->next = w; - wordtail = w; - - if (*p3 != '\0') - ++p3; - p[len] = '\0'; - w->word = p; - w->matched = 0; - } - - if (words != 0) - { - wordtail->next = 0; - - /* Run each pattern through the words, killing words. */ - p3 = p2; - while ((p = find_next_token (&p3, &len)) != 0) - { - char *percent; - char save = p[len]; - p[len] = '\0'; - - percent = find_percent (p); - for (wp = words; wp != 0; wp = wp->next) - wp->matched |= (percent == 0 ? streq (p, wp->word) - : pattern_matches (p, percent, wp->word)); - - p[len] = save; - } - - /* Output the words that matched (or didn't, for filter-out). */ - for (wp = words; wp != 0; wp = wp->next) - if (function == function_filter ? wp->matched : !wp->matched) - { - o = variable_buffer_output (o, wp->word, strlen (wp->word)); - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - if (doneany) - /* Kill the last space. */ - --o; - } - - free (p2); - free (text); - } - break; - - case function_patsubst: - /* Get three comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("patsubst"); - - p2 = p; - count = 0; - for (++p; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("patsubst"); - - text = expand_argument (text, p2); - p3 = expand_argument (p2 + 1, p); - p2 = expand_argument (p + 1, end); - - o = patsubst_expand (o, p2, text, p3, (char *) 0, (char *) 0); - - free (text); - free (p3); - free (p2); - break; - - case function_join: - /* Get two comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("join"); - text = expand_argument (text, p); - - p = expand_argument (p + 1, end); - - { - /* Write each word of the first argument directly followed - by the corresponding word of the second argument. - If the two arguments have a different number of words, - the excess words are just output separated by blanks. */ - register char *tp, *pp; - p2 = text; - p3 = p; - do - { - unsigned int tlen, plen; - - tp = find_next_token (&p2, &tlen); - if (tp != 0) - o = variable_buffer_output (o, tp, tlen); - - pp = find_next_token (&p3, &plen); - if (pp != 0) - o = variable_buffer_output (o, pp, plen); - - if (tp != 0 || pp != 0) - { - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - } - while (tp != 0 || pp != 0); - if (doneany) - /* Kill the last blank. */ - --o; - } - - free (text); - free (p); - break; - - case function_strip: - /* Expand the argument. */ - text = expand_argument (text, end); - - p2 = text; - while ((p = find_next_token (&p2, &i)) != 0) - { - o = variable_buffer_output (o, p, i); - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - if (doneany) - /* Kill the last space. */ - --o; - - free (text); - break; - - case function_wildcard: - text = expand_argument (text, end); - - p = string_glob (text); - o = variable_buffer_output (o, p, strlen (p)); - - free (text); - break; - - case function_subst: - /* Get three comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("subst"); - - p2 = p; - count = 0; - for (++p; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("subst"); - - text = expand_argument (text, p2); - p3 = expand_argument (p2 + 1, p); - p2 = expand_argument (p + 1, end); - - o = subst_expand (o, p2, text, p3, strlen (text), strlen (p3), 0, 0); - - free (text); - free (p3); - free (p2); - break; - - case function_firstword: - /* Expand the argument. */ - text = expand_argument (text, end); - - /* Find the first word in TEXT. */ - p2 = text; - p = find_next_token (&p2, &i); - if (p != 0) - o = variable_buffer_output (o, p, i); - - free (text); - break; - - case function_word: - /* Get two comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("word"); - text = expand_argument (text, p); - - p3 = expand_argument (p + 1, end); - - /* Check the first argument. */ - for (p2 = text; *p2 != '\0'; ++p2) - if (*p2 < '0' || *p2 > '9') - { - if (reading_filename != 0) - makefile_fatal (reading_filename, *reading_lineno_ptr, - "non-numeric first argument to `word' function"); - else - fatal ("non-numeric first argument to `word' function"); - } - - i = (unsigned int) atoi (text); - if (i == 0) - { - if (reading_filename != 0) - makefile_fatal (reading_filename, *reading_lineno_ptr, - "the `word' function takes a one-origin \ -index argument"); - else - fatal ("the `word' function takes a one-origin index argument"); - } - - p2 = p3; - while ((p = find_next_token (&p2, &len)) != 0) - if (--i == 0) - break; - if (i == 0) - o = variable_buffer_output (o, p, len); - - free (text); - free (p3); - break; - - case function_words: - /* Expand the argument. */ - text = expand_argument (text, end); - - i = 0; - p2 = text; - while (find_next_token (&p2, (unsigned int *) 0) != 0) - ++i; - - { - char buf[20]; - sprintf (buf, "%d", i); - o = variable_buffer_output (o, buf, strlen (buf)); - } - - free (text); - break; - - case function_findstring: - /* Get two comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS ("findstring"); - text = expand_argument (text, p); - - p = expand_argument (p + 1, end); - - /* Find the first occurrence of the first string in the second. */ - i = strlen (text); - if (sindex (p, 0, text, i) != 0) - o = variable_buffer_output (o, text, i); - - free (p); - free (text); - break; - - case function_addsuffix: - case function_addprefix: - /* Get two comma-separated arguments and expand each one. */ - count = 0; - for (p = text; p < end; ++p) - { - if (*p == startparen) - ++count; - else if (*p == endparen) - --count; - else if (*p == ',' && count <= 0) - break; - } - if (p == end) - BADARGS (function == function_addsuffix ? "addsuffix" : "addprefix"); - text = expand_argument (text, p); - i = strlen (text); - - p2 = expand_argument (p + 1, end); - - p3 = p2; - while ((p = find_next_token (&p3, &len)) != 0) - { - if (function == function_addprefix) - o = variable_buffer_output (o, text, i); - o = variable_buffer_output (o, p, len); - if (function == function_addsuffix) - o = variable_buffer_output (o, text, i); - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - if (doneany) - /* Kill last space. */ - --o; - - free (p2); - free (text); - break; - - case function_dir: - case function_basename: - /* Expand the argument. */ - text = expand_argument (text, end); - - p3 = text; - while ((p2 = find_next_token (&p3, &len)) != 0) - { - p = p2 + len; - while (p >= p2 && *p != (function == function_dir ? '/' : '.')) - --p; - if (p >= p2) - { - if (function == function_dir) - ++p; - o = variable_buffer_output (o, p2, p - p2); - } - else if (function == function_dir) - o = variable_buffer_output (o, "./", 2); - else - /* The entire name is the basename. */ - o = variable_buffer_output (o, p2, len); - - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - if (doneany) - /* Kill last space. */ - --o; - - free (text); - break; - - case function_notdir: - case function_suffix: - /* Expand the argument. */ - text = expand_argument (text, end); - - p3 = text; - while ((p2 = find_next_token (&p3, &len)) != 0) - { - p = p2 + len; - while (p >= p2 && *p != (function == function_notdir ? '/' : '.')) - --p; - if (p >= p2) - { - if (function == function_notdir) - ++p; - o = variable_buffer_output (o, p, len - (p - p2)); - } - else if (function == function_notdir) - o = variable_buffer_output (o, p2, len); - - if (function == function_notdir || p >= p2) - { - o = variable_buffer_output (o, " ", 1); - doneany = 1; - } - } - if (doneany) - /* Kill last space. */ - --o; - - free (text); - break; - } - - return o; -} - -/* Check for a function invocation in *STRINGP. *STRINGP points at the - opening ( or { and is not null-terminated. If a function invocation - is found, expand it into the buffer at *OP, updating *OP, incrementing - *STRINGP past the reference and returning nonzero. If not, return zero. */ - -int -handle_function (op, stringp) - char **op; - char **stringp; - -{ - register unsigned int code; - unsigned int maxlen; - char *beg = *stringp + 1; - char *endref; - - endref = lindex (beg, beg + MAXFUNCTIONLEN, '\0'); - maxlen = endref != 0 ? endref - beg : MAXFUNCTIONLEN; - - for (code = 0; function_table[code].name != 0; ++code) - { - if (maxlen < function_table[code].len) - continue; - endref = beg + function_table[code].len; - if (isblank (*endref) - && !strncmp (function_table[code].name, beg, - function_table[code].len)) - break; - } - if (function_table[code].name != 0) - { - /* We have found a call to an expansion-time function. - Find the end of the arguments, and do the function. */ - - char openparen = beg[-1], closeparen = openparen == '(' ? ')' : '}'; - int count = 0; - char *argbeg; - register char *p; - - /* Space after function name isn't part of the args. */ - p = next_token (endref); - argbeg = p; - - /* Count nested use of whichever kind of parens we use, - so that nested calls and variable refs work. */ - - for (; *p != '\0'; ++p) - { - if (*p == openparen) - ++count; - else if (*p == closeparen && --count < 0) - break; - } - - if (count >= 0) - { - static const char errmsg[] - = "unterminated call to function `%s': missing `%c'"; - if (reading_filename == 0) - fatal (errmsg, function_table[code].name, closeparen); - else - makefile_fatal (reading_filename, *reading_lineno_ptr, errmsg, - function_table[code].name, closeparen); - } - - /* We found the end; expand the function call. */ - - *op = expand_function (*op, function_table[code].function, argbeg, p); - *stringp = p; - return 1; - } - - return 0; -} - -/* Glob-expand LINE. The returned pointer is - only good until the next call to string_glob. */ - -static char * -string_glob (line) - char *line; -{ - static char *result = 0; - static unsigned int length; - register struct nameseq *chain; - register unsigned int idx; - - chain = multi_glob (parse_file_seq - (&line, '\0', sizeof (struct nameseq), - /* We do not want parse_file_seq to strip `./'s. - That would break examples like: - $(patsubst ./%.c,obj/%.o,$(wildcard ./*.c)). */ - 0), - sizeof (struct nameseq)); - - if (result == 0) - { - length = 100; - result = (char *) xmalloc (100); - } - - idx = 0; - while (chain != 0) - { - register char *name = chain->name; - unsigned int len = strlen (name); - - struct nameseq *next = chain->next; - free ((char *) chain); - chain = next; - - /* multi_glob will pass names without globbing metacharacters - through as is, but we want only files that actually exist. */ - if (file_exists_p (name)) - { - if (idx + len + 1 > length) - { - length += (len + 1) * 2; - result = (char *) xrealloc (result, length); - } - bcopy (name, &result[idx], len); - idx += len; - result[idx++] = ' '; - } - - free (name); - } - - /* Kill the last space and terminate the string. */ - if (idx == 0) - result[0] = '\0'; - else - result[idx - 1] = '\0'; - - return result; -} diff --git a/buildtools/windows/source/make/getloadavg.c b/buildtools/windows/source/make/getloadavg.c deleted file mode 100644 index 3d805ab52f0..00000000000 --- a/buildtools/windows/source/make/getloadavg.c +++ /dev/null @@ -1,938 +0,0 @@ -/* Get the system load averages. - Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Compile-time symbols that this file uses: - - FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist. - KERNEL_FILE Pathname of the kernel to nlist. - LDAV_CVT() Scale the load average from the kernel. - Returns a double. - LDAV_SYMBOL Name of kernel symbol giving load average. - LOAD_AVE_TYPE Type of the load average array in the kernel. - Must be defined unless one of - apollo, DGUX, NeXT, or UMAX is defined; - otherwise, no load average is available. - NLIST_STRUCT Include nlist.h, not a.out.h, and - the nlist n_name element is a pointer, - not an array. - NLIST_NAME_UNION struct nlist has an n_un member, not n_name. - LINUX_LDAV_FILE [__linux__]: File containing load averages. - - Specific system predefines this file uses, aside from setting - default values if not emacs: - - apollo - BSD Real BSD, not just BSD-like. - DGUX - eunice UNIX emulator under VMS. - hpux - NeXT - sgi - sequent Sequent Dynix 3.x.x (BSD) - _SEQUENT_ Sequent DYNIX/ptx 1.x.x (SYSV) - sony_news NEWS-OS (works at least for 4.1C) - UMAX - UMAX4_3 - VMS - __linux__ Linux: assumes /proc filesystem mounted. - Support from Michael K. Johnson. - __NetBSD__ NetBSD: assumes /kern filesystem mounted. - - In addition, to avoid nesting many #ifdefs, we internally set - LDAV_DONE to indicate that the load average has been computed. - - We also #define LDAV_PRIVILEGED if a program will require - special installation to be able to call getloadavg. */ - -/* This should always be first. */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -/* Both the Emacs and non-Emacs sections want this. Some - configuration files' definitions for the LOAD_AVE_CVT macro (like - sparc.h's) use macros like FSCALE, defined here. */ -#ifdef unix -#include -#endif - - -/* Exclude all the code except the test program at the end - if the system has its own `getloadavg' function. - - The declaration of `errno' is needed by the test program - as well as the function itself, so it comes first. */ - -#include - -#ifndef errno -extern int errno; -#endif - -#ifndef HAVE_GETLOADAVG - - -/* The existing Emacs configuration files define a macro called - LOAD_AVE_CVT, which accepts a value of type LOAD_AVE_TYPE, and - returns the load average multiplied by 100. What we actually want - is a macro called LDAV_CVT, which returns the load average as an - unmultiplied double. - - For backwards compatibility, we'll define LDAV_CVT in terms of - LOAD_AVE_CVT, but future machine config files should just define - LDAV_CVT directly. */ - -#if !defined(LDAV_CVT) && defined(LOAD_AVE_CVT) -#define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) -#endif - -#if !defined (BSD) && defined (ultrix) -/* Ultrix behaves like BSD on Vaxen. */ -#define BSD -#endif - -#ifdef NeXT -/* NeXT in the 2.{0,1,2} releases defines BSD in , which - conflicts with the definition understood in this file, that this - really is BSD. */ -#undef BSD - -/* NeXT defines FSCALE in . However, we take FSCALE being - defined to mean that the nlist method should be used, which is not true. */ -#undef FSCALE -#endif - -/* Set values that are different from the defaults, which are - set a little farther down with #ifndef. */ - - -/* Some shorthands. */ - -#if defined (HPUX) && !defined (hpux) -#define hpux -#endif - -#if defined(hp300) && !defined(hpux) -#define MORE_BSD -#endif - -#if defined(ultrix) && defined(mips) -#define decstation -#endif - -#if defined(sun) && defined(SVR4) -#define SUNOS_5 -#endif - -#if defined (__osf__) && (defined (__alpha) || defined (__alpha__)) -#define OSF_ALPHA -#include -#endif - -#if defined (__osf__) && (defined (mips) || defined (__mips__)) -#define OSF_MIPS -#include -#endif - -/* UTek's /bin/cc on the 4300 has no architecture specific cpp define by - default, but _MACH_IND_SYS_TYPES is defined in . Combine - that with a couple of other things and we'll have a unique match. */ -#if !defined (tek4300) && defined (unix) && defined (m68k) && defined (mc68000) && defined (mc68020) && defined (_MACH_IND_SYS_TYPES) -#define tek4300 /* Define by emacs, but not by other users. */ -#endif - - -/* VAX C can't handle multi-line #ifs, or lines longer than 256 chars. */ -#ifndef LOAD_AVE_TYPE - -#ifdef MORE_BSD -#define LOAD_AVE_TYPE long -#endif - -#ifdef sun -#define LOAD_AVE_TYPE long -#endif - -#ifdef decstation -#define LOAD_AVE_TYPE long -#endif - -#ifdef _SEQUENT_ -#define LOAD_AVE_TYPE long -#endif - -#ifdef sgi -#define LOAD_AVE_TYPE long -#endif - -#ifdef SVR4 -#define LOAD_AVE_TYPE long -#endif - -#ifdef sony_news -#define LOAD_AVE_TYPE long -#endif - -#ifdef sequent -#define LOAD_AVE_TYPE long -#endif - -#ifdef OSF_ALPHA -#define LOAD_AVE_TYPE long -#endif - -#if defined (ardent) && defined (titan) -#define LOAD_AVE_TYPE long -#endif - -#ifdef tek4300 -#define LOAD_AVE_TYPE long -#endif - -#if defined(alliant) && defined(i860) /* Alliant FX/2800 */ -#define LOAD_AVE_TYPE long -#endif - -#ifdef _AIX -#define LOAD_AVE_TYPE long -#endif - -#endif /* No LOAD_AVE_TYPE. */ - -#ifdef OSF_ALPHA -/* defines an incorrect value for FSCALE on Alpha OSF/1, - according to ghazi@noc.rutgers.edu. */ -#undef FSCALE -#define FSCALE 1024.0 -#endif - -#if defined(alliant) && defined(i860) /* Alliant FX/2800 */ -/* defines an incorrect value for FSCALE on an - Alliant FX/2800 Concentrix 2.2, according to ghazi@noc.rutgers.edu. */ -#undef FSCALE -#define FSCALE 100.0 -#endif - - -#ifndef FSCALE - -/* SunOS and some others define FSCALE in sys/param.h. */ - -#ifdef MORE_BSD -#define FSCALE 2048.0 -#endif - -#if defined(MIPS) || defined(SVR4) || defined(decstation) -#define FSCALE 256 -#endif - -#if defined (sgi) || defined (sequent) -/* Sometimes both MIPS and sgi are defined, so FSCALE was just defined - above under #ifdef MIPS. But we want the sgi value. */ -#undef FSCALE -#define FSCALE 1000.0 -#endif - -#if defined (ardent) && defined (titan) -#define FSCALE 65536.0 -#endif - -#ifdef tek4300 -#define FSCALE 100.0 -#endif - -#ifdef _AIX -#define FSCALE 65536.0 -#endif - -#endif /* Not FSCALE. */ - -#if !defined (LDAV_CVT) && defined (FSCALE) -#define LDAV_CVT(n) (((double) (n)) / FSCALE) -#endif - -/* VAX C can't handle multi-line #ifs, or lines longer that 256 characters. */ -#ifndef NLIST_STRUCT - -#ifdef MORE_BSD -#define NLIST_STRUCT -#endif - -#ifdef sun -#define NLIST_STRUCT -#endif - -#ifdef decstation -#define NLIST_STRUCT -#endif - -#ifdef hpux -#define NLIST_STRUCT -#endif - -#if defined (_SEQUENT_) || defined (sequent) -#define NLIST_STRUCT -#endif - -#ifdef sgi -#define NLIST_STRUCT -#endif - -#ifdef SVR4 -#define NLIST_STRUCT -#endif - -#ifdef sony_news -#define NLIST_STRUCT -#endif - -#ifdef OSF_ALPHA -#define NLIST_STRUCT -#endif - -#if defined (ardent) && defined (titan) -#define NLIST_STRUCT -#endif - -#ifdef tek4300 -#define NLIST_STRUCT -#endif - -#ifdef butterfly -#define NLIST_STRUCT -#endif - -#if defined(alliant) && defined(i860) /* Alliant FX/2800 */ -#define NLIST_STRUCT -#endif - -#ifdef _AIX -#define NLIST_STRUCT -#endif - -#endif /* defined (NLIST_STRUCT) */ - - -#if defined(sgi) || (defined(mips) && !defined(BSD)) -#define FIXUP_KERNEL_SYMBOL_ADDR(nl) ((nl)[0].n_value &= ~(1 << 31)) -#endif - - -#if !defined (KERNEL_FILE) && defined (sequent) -#define KERNEL_FILE "/dynix" -#endif - -#if !defined (KERNEL_FILE) && defined (hpux) -#define KERNEL_FILE "/hp-ux" -#endif - -#if !defined(KERNEL_FILE) && (defined(_SEQUENT_) || defined(MIPS) || defined(SVR4) || defined(ISC) || defined (sgi) || defined(SVR4) || (defined (ardent) && defined (titan))) -#define KERNEL_FILE "/unix" -#endif - - -#if !defined (LDAV_SYMBOL) && defined (alliant) -#define LDAV_SYMBOL "_Loadavg" -#endif - -#if !defined(LDAV_SYMBOL) && ((defined(hpux) && !defined(hp9000s300)) || defined(_SEQUENT_) || defined(SVR4) || defined(ISC) || defined(sgi) || (defined (ardent) && defined (titan)) || defined (_AIX)) -#define LDAV_SYMBOL "avenrun" -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#include - -/* LOAD_AVE_TYPE should only get defined if we're going to use the - nlist method. */ -#if !defined(LOAD_AVE_TYPE) && (defined(BSD) || defined(LDAV_CVT) || defined(KERNEL_FILE) || defined(LDAV_SYMBOL)) -#define LOAD_AVE_TYPE double -#endif - -#ifdef LOAD_AVE_TYPE - -#ifndef VMS -#ifndef NLIST_STRUCT -#include -#else /* NLIST_STRUCT */ -#include -#endif /* NLIST_STRUCT */ - -#ifdef SUNOS_5 -#include -#include -#endif - -#ifndef KERNEL_FILE -#define KERNEL_FILE "/vmunix" -#endif /* KERNEL_FILE */ - -#ifndef LDAV_SYMBOL -#define LDAV_SYMBOL "_avenrun" -#endif /* LDAV_SYMBOL */ - -#else /* VMS */ - -#ifndef eunice -#include -#include -#else /* eunice */ -#include -#endif /* eunice */ -#endif /* VMS */ - -#ifndef LDAV_CVT -#define LDAV_CVT(n) ((double) (n)) -#endif /* !LDAV_CVT */ - -#endif /* LOAD_AVE_TYPE */ - -#ifdef NeXT -#ifdef HAVE_MACH_MACH_H -#include -#else -#include -#endif -#endif /* NeXT */ - -#ifdef sgi -#include -#endif /* sgi */ - -#ifdef UMAX -#include -#include -#include -#include -#include - -#ifdef UMAX_43 -#include -#include -#include -#include -#include -#else /* Not UMAX_43. */ -#include -#include -#include -#include -#include -#include -#endif /* Not UMAX_43. */ -#endif /* UMAX */ - -#ifdef DGUX -#include -#endif - -#if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION) -#include -#else -#include -#endif - -/* Avoid static vars inside a function since in HPUX they dump as pure. */ - -#ifdef NeXT -static processor_set_t default_set; -static int getloadavg_initialized; -#endif /* NeXT */ - -#ifdef UMAX -static unsigned int cpus = 0; -static unsigned int samples; -#endif /* UMAX */ - -#ifdef DGUX -static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */ -#endif /* DGUX */ - -#ifdef LOAD_AVE_TYPE -/* File descriptor open to /dev/kmem or VMS load ave driver. */ -static int channel; -/* Nonzero iff channel is valid. */ -static int getloadavg_initialized; -/* Offset in kmem to seek to read load average, or 0 means invalid. */ -static long offset; - -#if !defined(VMS) && !defined(sgi) -static struct nlist nl[2]; -#endif /* Not VMS or sgi */ - -#ifdef SUNOS_5 -static kvm_t *kd; -#endif /* SUNOS_5 */ - -#endif /* LOAD_AVE_TYPE */ - -/* Put the 1 minute, 5 minute and 15 minute load averages - into the first NELEM elements of LOADAVG. - Return the number written (never more than 3, but may be less than NELEM), - or -1 if an error occurred. */ - -int -getloadavg (loadavg, nelem) - double loadavg[]; - int nelem; -{ - int elem = 0; /* Return value. */ - -#ifdef NO_GET_LOAD_AVG -#define LDAV_DONE - /* Set errno to zero to indicate that there was no particular error; - this function just can't work at all on this system. */ - errno = 0; - elem = -1; -#endif - -#if !defined (LDAV_DONE) && defined (__linux__) -#define LDAV_DONE -#undef LOAD_AVE_TYPE - -#ifndef LINUX_LDAV_FILE -#define LINUX_LDAV_FILE "/proc/loadavg" -#endif - - char ldavgbuf[40]; - double load_ave[3]; - int fd, count; - - fd = open (LINUX_LDAV_FILE, O_RDONLY); - if (fd == -1) - return -1; - count = read (fd, ldavgbuf, 40); - (void) close (fd); - if (count <= 0) - return -1; - - count = sscanf (ldavgbuf, "%lf %lf %lf", - &load_ave[0], &load_ave[1], &load_ave[2]); - if (count < 1) - return -1; - - for (elem = 0; elem < nelem && elem < count; elem++) - loadavg[elem] = load_ave[elem]; - - return elem; - -#endif /* __linux__ */ - -#if !defined (LDAV_DONE) && defined (__NetBSD__) -#define LDAV_DONE -#undef LOAD_AVE_TYPE - -#ifndef NETBSD_LDAV_FILE -#define NETBSD_LDAV_FILE "/kern/loadavg" -#endif - - unsigned long int load_ave[3], scale; - int count; - FILE *fp; - - fp = fopen (NETBSD_LDAV_FILE, "r"); - if (fp == NULL) - return -1; - count = fscanf (fp, "%lu %lu %lu %lu\n", - &load_ave[0], &load_ave[1], &load_ave[2], - &scale); - (void) fclose (fp); - if (count != 4) - return -1; - - for (elem = 0; elem < nelem; elem++) - loadavg[elem] = (double) load_ave[elem] / (double) scale; - - return elem; - -#endif /* __NetBSD__ */ - -#if !defined (LDAV_DONE) && defined (NeXT) -#define LDAV_DONE - /* The NeXT code was adapted from iscreen 3.2. */ - - host_t host; - struct processor_set_basic_info info; - unsigned info_count; - - /* We only know how to get the 1-minute average for this system, - so even if the caller asks for more than 1, we only return 1. */ - - if (!getloadavg_initialized) - { - if (processor_set_default (host_self (), &default_set) == KERN_SUCCESS) - getloadavg_initialized = 1; - } - - if (getloadavg_initialized) - { - info_count = PROCESSOR_SET_BASIC_INFO_COUNT; - if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO, &host, - (processor_set_info_t) &info, &info_count) - != KERN_SUCCESS) - getloadavg_initialized = 0; - else - { - if (nelem > 0) - loadavg[elem++] = (double) info.load_average / LOAD_SCALE; - } - } - - if (!getloadavg_initialized) - return -1; -#endif /* NeXT */ - -#if !defined (LDAV_DONE) && defined (UMAX) -#define LDAV_DONE -/* UMAX 4.2, which runs on the Encore Multimax multiprocessor, does not - have a /dev/kmem. Information about the workings of the running kernel - can be gathered with inq_stats system calls. - We only know how to get the 1-minute average for this system. */ - - struct proc_summary proc_sum_data; - struct stat_descr proc_info; - double load; - register unsigned int i, j; - - if (cpus == 0) - { - register unsigned int c, i; - struct cpu_config conf; - struct stat_descr desc; - - desc.sd_next = 0; - desc.sd_subsys = SUBSYS_CPU; - desc.sd_type = CPUTYPE_CONFIG; - desc.sd_addr = (char *) &conf; - desc.sd_size = sizeof conf; - - if (inq_stats (1, &desc)) - return -1; - - c = 0; - for (i = 0; i < conf.config_maxclass; ++i) - { - struct class_stats stats; - bzero ((char *) &stats, sizeof stats); - - desc.sd_type = CPUTYPE_CLASS; - desc.sd_objid = i; - desc.sd_addr = (char *) &stats; - desc.sd_size = sizeof stats; - - if (inq_stats (1, &desc)) - return -1; - - c += stats.class_numcpus; - } - cpus = c; - samples = cpus < 2 ? 3 : (2 * cpus / 3); - } - - proc_info.sd_next = 0; - proc_info.sd_subsys = SUBSYS_PROC; - proc_info.sd_type = PROCTYPE_SUMMARY; - proc_info.sd_addr = (char *) &proc_sum_data; - proc_info.sd_size = sizeof (struct proc_summary); - proc_info.sd_sizeused = 0; - - if (inq_stats (1, &proc_info) != 0) - return -1; - - load = proc_sum_data.ps_nrunnable; - j = 0; - for (i = samples - 1; i > 0; --i) - { - load += proc_sum_data.ps_nrun[j]; - if (j++ == PS_NRUNSIZE) - j = 0; - } - - if (nelem > 0) - loadavg[elem++] = load / samples / cpus; -#endif /* UMAX */ - -#if !defined (LDAV_DONE) && defined (DGUX) -#define LDAV_DONE - /* This call can return -1 for an error, but with good args - it's not supposed to fail. The first argument is for no - apparent reason of type `long int *'. */ - dg_sys_info ((long int *) &load_info, - DG_SYS_INFO_LOAD_INFO_TYPE, - DG_SYS_INFO_LOAD_VERSION_0); - - if (nelem > 0) - loadavg[elem++] = load_info.one_minute; - if (nelem > 1) - loadavg[elem++] = load_info.five_minute; - if (nelem > 2) - loadavg[elem++] = load_info.fifteen_minute; -#endif /* DGUX */ - -#if !defined (LDAV_DONE) && defined (apollo) -#define LDAV_DONE -/* Apollo code from lisch@mentorg.com (Ray Lischner). - - This system call is not documented. The load average is obtained as - three long integers, for the load average over the past minute, - five minutes, and fifteen minutes. Each value is a scaled integer, - with 16 bits of integer part and 16 bits of fraction part. - - I'm not sure which operating system first supported this system call, - but I know that SR10.2 supports it. */ - - extern void proc1_$get_loadav (); - unsigned long load_ave[3]; - - proc1_$get_loadav (load_ave); - - if (nelem > 0) - loadavg[elem++] = load_ave[0] / 65536.0; - if (nelem > 1) - loadavg[elem++] = load_ave[1] / 65536.0; - if (nelem > 2) - loadavg[elem++] = load_ave[2] / 65536.0; -#endif /* apollo */ - -#if !defined (LDAV_DONE) && defined (OSF_MIPS) -#define LDAV_DONE - - struct tbl_loadavg load_ave; - table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave)); - loadavg[elem++] - = (load_ave.tl_lscale == 0 - ? load_ave.tl_avenrun.d[0] - : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); -#endif /* OSF_MIPS */ - -#if !defined (LDAV_DONE) && defined (OSF_ALPHA) -#define LDAV_DONE - - struct tbl_loadavg load_ave; - table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave)); - for (elem = 0; elem < nelem; elem++) - loadavg[elem] - = (load_ave.tl_lscale == 0 - ? load_ave.tl_avenrun.d[elem] - : (load_ave.tl_avenrun.l[elem] / (double) load_ave.tl_lscale)); -#endif /* OSF_ALPHA */ - -#if !defined (LDAV_DONE) && defined (VMS) - /* VMS specific code -- read from the Load Ave driver. */ - - LOAD_AVE_TYPE load_ave[3]; - static int getloadavg_initialized = 0; -#ifdef eunice - struct - { - int dsc$w_length; - char *dsc$a_pointer; - } descriptor; -#endif - - /* Ensure that there is a channel open to the load ave device. */ - if (!getloadavg_initialized) - { - /* Attempt to open the channel. */ -#ifdef eunice - descriptor.dsc$w_length = 18; - descriptor.dsc$a_pointer = "$$VMS_LOAD_AVERAGE"; -#else - $DESCRIPTOR (descriptor, "LAV0:"); -#endif - if (sys$assign (&descriptor, &channel, 0, 0) & 1) - getloadavg_initialized = 1; - } - - /* Read the load average vector. */ - if (getloadavg_initialized - && !(sys$qiow (0, channel, IO$_READVBLK, 0, 0, 0, - load_ave, 12, 0, 0, 0, 0) & 1)) - { - sys$dassgn (channel); - getloadavg_initialized = 0; - } - - if (!getloadavg_initialized) - return -1; -#endif /* VMS */ - -#if !defined (LDAV_DONE) && defined(LOAD_AVE_TYPE) && !defined(VMS) - - /* UNIX-specific code -- read the average from /dev/kmem. */ - -#define LDAV_PRIVILEGED /* This code requires special installation. */ - - LOAD_AVE_TYPE load_ave[3]; - - /* Get the address of LDAV_SYMBOL. */ - if (offset == 0) - { -#ifndef sgi -#ifndef NLIST_STRUCT - strcpy (nl[0].n_name, LDAV_SYMBOL); - strcpy (nl[1].n_name, ""); -#else /* NLIST_STRUCT */ -#ifdef NLIST_NAME_UNION - nl[0].n_un.n_name = LDAV_SYMBOL; - nl[1].n_un.n_name = 0; -#else /* not NLIST_NAME_UNION */ - nl[0].n_name = LDAV_SYMBOL; - nl[1].n_name = 0; -#endif /* not NLIST_NAME_UNION */ -#endif /* NLIST_STRUCT */ - -#ifndef SUNOS_5 - if ( -#ifndef _AIX - nlist (KERNEL_FILE, nl) -#else /* _AIX */ - knlist (nl, 1, sizeof (nl[0])) -#endif - >= 0) - /* Omit "&& nl[0].n_type != 0 " -- it breaks on Sun386i. */ - { -#ifdef FIXUP_KERNEL_SYMBOL_ADDR - FIXUP_KERNEL_SYMBOL_ADDR (nl); -#endif - offset = nl[0].n_value; - } -#endif /* !SUNOS_5 */ -#else /* sgi */ - int ldav_off; - - ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN); - if (ldav_off != -1) - offset = (long) ldav_off & 0x7fffffff; -#endif /* sgi */ - } - - /* Make sure we have /dev/kmem open. */ - if (!getloadavg_initialized) - { -#ifndef SUNOS_5 - channel = open ("/dev/kmem", 0); - if (channel >= 0) - getloadavg_initialized = 1; -#else /* SUNOS_5 */ - /* We pass 0 for the kernel, corefile, and swapfile names - to use the currently running kernel. */ - kd = kvm_open (0, 0, 0, O_RDONLY, 0); - if (kd != 0) - { - /* nlist the currently running kernel. */ - kvm_nlist (kd, nl); - offset = nl[0].n_value; - getloadavg_initialized = 1; - } -#endif /* SUNOS_5 */ - } - - /* If we can, get the load average values. */ - if (offset && getloadavg_initialized) - { - /* Try to read the load. */ -#ifndef SUNOS_5 - if (lseek (channel, offset, 0) == -1L - || read (channel, (char *) load_ave, sizeof (load_ave)) - != sizeof (load_ave)) - { - close (channel); - getloadavg_initialized = 0; - } -#else /* SUNOS_5 */ - if (kvm_read (kd, offset, (char *) load_ave, sizeof (load_ave)) - != sizeof (load_ave)) - { - kvm_close (kd); - getloadavg_initialized = 0; - } -#endif /* SUNOS_5 */ - } - - if (offset == 0 || !getloadavg_initialized) - return -1; -#endif /* LOAD_AVE_TYPE and not VMS */ - -#if !defined (LDAV_DONE) && defined (LOAD_AVE_TYPE) /* Including VMS. */ - if (nelem > 0) - loadavg[elem++] = LDAV_CVT (load_ave[0]); - if (nelem > 1) - loadavg[elem++] = LDAV_CVT (load_ave[1]); - if (nelem > 2) - loadavg[elem++] = LDAV_CVT (load_ave[2]); - -#define LDAV_DONE -#endif /* !LDAV_DONE && LOAD_AVE_TYPE */ - -#ifdef LDAV_DONE - return elem; -#else - /* Set errno to zero to indicate that there was no particular error; - this function just can't work at all on this system. */ - errno = 0; - return -1; -#endif -} - -#endif /* ! HAVE_GETLOADAVG */ - -#ifdef TEST -void -main (argc, argv) - int argc; - char **argv; -{ - int naptime = 0; - - if (argc > 1) - naptime = atoi (argv[1]); - - while (1) - { - double avg[3]; - int loads; - - errno = 0; /* Don't be misled if it doesn't set errno. */ - loads = getloadavg (avg, 3); - if (loads == -1) - { - perror ("Error getting load average"); - exit (1); - } - if (loads > 0) - printf ("1-minute: %f ", avg[0]); - if (loads > 1) - printf ("5-minute: %f ", avg[1]); - if (loads > 2) - printf ("15-minute: %f ", avg[2]); - if (loads > 0) - putchar ('\n'); - - if (naptime == 0) - break; - sleep (naptime); - } - - exit (0); -} -#endif /* TEST */ diff --git a/buildtools/windows/source/make/getopt.c b/buildtools/windows/source/make/getopt.c deleted file mode 100644 index 077b02c8464..00000000000 --- a/buildtools/windows/source/make/getopt.c +++ /dev/null @@ -1,763 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#endif /* GNU C library. */ - -/* This is for other GNU distributions with internationalized messages. - The GNU C Library itself does not yet support such messages. */ -#if HAVE_LIBINTL_H -# include -#else -# define gettext(msgid) (msgid) -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -static const char * -_getopt_initialize (optstring) - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0) - { - optstring = _getopt_initialize (optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - } - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc - && (argv[optind][0] != '-' || argv[optind][1] == '\0')) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if ((argv[optind][0] != '-' || argv[optind][1] == '\0')) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((size_t)(nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - gettext ("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - gettext ("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - gettext ("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, gettext ("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, gettext ("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - gettext ("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/buildtools/windows/source/make/getopt.h b/buildtools/windows/source/make/getopt.h deleted file mode 100644 index 4ac33b71824..00000000000 --- a/buildtools/windows/source/make/getopt.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ diff --git a/buildtools/windows/source/make/getopt1.c b/buildtools/windows/source/make/getopt1.c deleted file mode 100644 index 4580211cfac..00000000000 --- a/buildtools/windows/source/make/getopt1.c +++ /dev/null @@ -1,180 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "getopt.h" - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#else -char *getenv (); -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* _LIBC or not __GNU_LIBRARY__. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == EOF) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/buildtools/windows/source/make/glob.c b/buildtools/windows/source/make/glob.c deleted file mode 100644 index c90a40672b9..00000000000 --- a/buildtools/windows/source/make/glob.c +++ /dev/null @@ -1,705 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* AIX requires this to be the first thing in the file. */ -#if defined (_AIX) && !defined (__GNUC__) - #pragma alloca -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef NETSCAPE -#include "windir.h" -#endif - -#include -#include -#include - - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -#ifdef STDC_HEADERS -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#ifndef POSIX -#ifdef _POSIX_VERSION -#define POSIX -#endif -#endif -#endif - -#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) -extern int errno; -#endif - -#ifndef NULL -#define NULL 0 -#endif - - -#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__) -#include -#ifndef __GNU_LIBRARY__ -#define D_NAMLEN(d) strlen((d)->d_name) -#else /* GNU C library. */ -#define D_NAMLEN(d) ((d)->d_namlen) -#endif /* Not GNU C library. */ -#else /* Not POSIX or HAVE_DIRENT_H. */ -#define direct dirent -#define D_NAMLEN(d) ((d)->d_namlen) -#ifdef HAVE_SYS_NDIR_H -#include -#endif /* HAVE_SYS_NDIR_H */ -#ifdef HAVE_SYS_DIR_H -#include -#endif /* HAVE_SYS_DIR_H */ -#ifdef HAVE_NDIR_H -#include -#endif /* HAVE_NDIR_H */ -#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */ - -#if defined(NETSCAPE) || defined (POSIX) && !defined (__GNU_LIBRARY__) -/* Posix does not require that the d_ino field be present, and some - systems do not provide it. */ -#define REAL_DIR_ENTRY(dp) 1 -#else -#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) -#endif /* POSIX */ - -#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) -#include -#include -#define ANSI_STRING -#else /* No standard headers. */ - -#ifdef HAVE_STRING_H -#include -#define ANSI_STRING -#else -#include -#endif -#ifdef HAVE_MEMORY_H -#include -#endif - -extern char *malloc (), *realloc (); -extern void free (); - -extern void qsort (); -extern void abort (), exit (); - -#endif /* Standard headers. */ - -#ifndef ANSI_STRING - -#ifndef bzero -extern void bzero (); -#endif -#ifndef bcopy -extern void bcopy (); -#endif - -#define memcpy(d, s, n) bcopy ((s), (d), (n)) -#define strrchr rindex -/* memset is only used for zero here, but let's be paranoid. */ -#define memset(s, better_be_zero, n) \ - ((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0))) -#endif /* Not ANSI_STRING. */ - -#ifndef HAVE_STRCOLL -#define strcoll strcmp -#endif - - -#if !defined(__GNU_LIBRARY__) && !defined(NETSCAPE) -#ifdef __GNUC__ -__inline -#endif -static char * -my_realloc (p, n) - char *p; - unsigned int n; -{ - /* These casts are the for sake of the broken Ultrix compiler, - which warns of illegal pointer combinations otherwise. */ - if (p == NULL) - return (char *) malloc (n); - return (char *) realloc (p, n); -} -#define realloc my_realloc -#endif - - -#if !defined(__alloca) && !defined(__GNU_LIBRARY__) - -#ifdef __GNUC__ -#undef alloca -#define alloca(n) __builtin_alloca (n) -#else /* Not GCC. */ -#if defined (sparc) || defined (HAVE_ALLOCA_H) -#include -#elif defined(NETSCAPE) -#include -#else /* Not sparc or HAVE_ALLOCA_H. */ -#ifndef _AIX -extern char *alloca (); -#endif /* Not _AIX. */ -#endif /* sparc or HAVE_ALLOCA_H. */ -#endif /* GCC. */ - -#define __alloca alloca - -#endif - -#ifndef __GNU_LIBRARY__ -#define __lstat lstat -#ifndef HAVE_LSTAT -#define lstat stat -#endif -#ifdef STAT_MACROS_BROKEN -#undef S_ISDIR -#endif -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif -#endif - -#ifndef STDC_HEADERS -#undef size_t -#define size_t unsigned int -#endif - -/* Some system header files erroneously define these. - We want our own definitions from to take precedence. */ -#undef FNM_PATHNAME -#undef FNM_NOESCAPE -#undef FNM_PERIOD -#include - -/* Some system header files erroneously define these. - We want our own definitions from to take precedence. */ -#undef GLOB_ERR -#undef GLOB_MARK -#undef GLOB_NOSORT -#undef GLOB_DOOFFS -#undef GLOB_NOCHECK -#undef GLOB_APPEND -#undef GLOB_NOESCAPE -#undef GLOB_PERIOD -#include - -__ptr_t (*__glob_opendir_hook) __P ((const char *directory)); -const char *(*__glob_readdir_hook) __P ((__ptr_t stream)); -void (*__glob_closedir_hook) __P ((__ptr_t stream)); - -static int glob_pattern_p __P ((const char *pattern, int quote)); -static int glob_in_dir __P ((const char *pattern, const char *directory, - int flags, - int (*errfunc) __P ((const char *, int)), - glob_t *pglob)); -static int prefix_array __P ((const char *prefix, char **array, size_t n)); -int collated_compare __P ((const void *elem1, const void *elem2)); - -/* Do glob searching for PATTERN, placing results in PGLOB. - The bits defined above may be set in FLAGS. - If a directory cannot be opened or read and ERRFUNC is not nil, - it is called with the pathname that caused the error, and the - `errno' value from the failing call; if it returns non-zero - `glob' returns GLOB_ABEND; if it returns zero, the error is ignored. - If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. - Otherwise, `glob' returns zero. */ -int -glob (pattern, flags, errfunc, pglob) - const char *pattern; - int flags; - int (*errfunc) __P ((const char *, int)); - glob_t *pglob; -{ - const char *filename; - char *dirname; - size_t dirlen; - int status; - int oldcount; - - if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) - { - errno = EINVAL; - return -1; - } - - /* Find the filename. */ - filename = strrchr (pattern, '/'); - if (filename == NULL) - { - filename = pattern; - dirname = (char *) "."; - dirlen = 0; - } - else if (filename == pattern) - { - /* "/pattern". */ - dirname = (char *) "/"; - dirlen = 1; - ++filename; - } - else - { - dirlen = filename - pattern; - dirname = (char *) __alloca (dirlen + 1); - memcpy (dirname, pattern, dirlen); - dirname[dirlen] = '\0'; - ++filename; - } - - if (filename[0] == '\0' && dirlen > 1) - /* "pattern/". Expand "pattern", appending slashes. */ - { - int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob); - if (val == 0) - pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK); - return val; - } - - if (!(flags & GLOB_APPEND)) - { - pglob->gl_pathc = 0; - pglob->gl_pathv = NULL; - } - - oldcount = pglob->gl_pathc; - - if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) - { - /* The directory name contains metacharacters, so we - have to glob for the directory, and then glob for - the pattern in each directory found. */ - glob_t dirs; - register int i; - - status = glob (dirname, - ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) | - GLOB_NOSORT), - errfunc, &dirs); - if (status != 0) - return status; - - /* We have successfully globbed the preceding directory name. - For each name we found, call glob_in_dir on it and FILENAME, - appending the results to PGLOB. */ - for (i = 0; i < dirs.gl_pathc; ++i) - { - int oldcount; - -#ifdef SHELL - { - /* Make globbing interruptible in the bash shell. */ - extern int interrupt_state; - - if (interrupt_state) - { - globfree (&dirs); - globfree (&files); - return GLOB_ABEND; - } - } -#endif /* SHELL. */ - - oldcount = pglob->gl_pathc; - status = glob_in_dir (filename, dirs.gl_pathv[i], - (flags | GLOB_APPEND) & ~GLOB_NOCHECK, - errfunc, pglob); - if (status == GLOB_NOMATCH) - /* No matches in this directory. Try the next. */ - continue; - - if (status != 0) - { - globfree (&dirs); - globfree (pglob); - return status; - } - - /* Stick the directory on the front of each name. */ - if (prefix_array (dirs.gl_pathv[i], - &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount)) - { - globfree (&dirs); - globfree (pglob); - return GLOB_NOSPACE; - } - } - - flags |= GLOB_MAGCHAR; - - if (pglob->gl_pathc == oldcount) - /* No matches. */ - if (flags & GLOB_NOCHECK) - { - size_t len = strlen (pattern) + 1; - char *patcopy = (char *) malloc (len); - if (patcopy == NULL) - return GLOB_NOSPACE; - memcpy (patcopy, pattern, len); - - pglob->gl_pathv - = (char **) realloc (pglob->gl_pathv, - (pglob->gl_pathc + - ((flags & GLOB_DOOFFS) ? - pglob->gl_offs : 0) + - 1 + 1) * - sizeof (char *)); - if (pglob->gl_pathv == NULL) - { - free (patcopy); - return GLOB_NOSPACE; - } - - if (flags & GLOB_DOOFFS) - while (pglob->gl_pathc < pglob->gl_offs) - pglob->gl_pathv[pglob->gl_pathc++] = NULL; - - pglob->gl_pathv[pglob->gl_pathc++] = patcopy; - pglob->gl_pathv[pglob->gl_pathc] = NULL; - pglob->gl_flags = flags; - } - else - return GLOB_NOMATCH; - } - else - { - status = glob_in_dir (filename, dirname, flags, errfunc, pglob); - if (status != 0) - return status; - - if (dirlen > 0) - { - /* Stick the directory on the front of each name. */ - if (prefix_array (dirname, - &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount)) - { - globfree (pglob); - return GLOB_NOSPACE; - } - } - } - - if (flags & GLOB_MARK) - { - /* Append slashes to directory names. glob_in_dir has already - allocated the extra character for us. */ - int i; - struct stat st; - for (i = oldcount; i < pglob->gl_pathc; ++i) - if (__lstat (pglob->gl_pathv[i], &st) == 0 && - S_ISDIR (st.st_mode)) - strcat (pglob->gl_pathv[i], "/"); - } - - if (!(flags & GLOB_NOSORT)) - /* Sort the vector. */ -#if 0 - qsort ((__ptr_t) &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount, - sizeof (char *), collated_compare); -#else - qsort ( &pglob->gl_pathv[oldcount], - (size_t)(pglob->gl_pathc - oldcount), - sizeof (char *), collated_compare); -#endif - - return 0; -} - - -/* Free storage allocated in PGLOB by a previous `glob' call. */ -void -globfree (pglob) - register glob_t *pglob; -{ - if (pglob->gl_pathv != NULL) - { - register int i; - for (i = 0; i < pglob->gl_pathc; ++i) - if (pglob->gl_pathv[i] != NULL) - free ((__ptr_t) pglob->gl_pathv[i]); - free ((__ptr_t) pglob->gl_pathv); - } -} - - -/* Do a collated comparison of A and B. */ -int -collated_compare (const void *elem1, const void *elem2) -{ - const __ptr_t a = (const __ptr_t)elem1; - const __ptr_t b = (const __ptr_t)elem1; - const char *const s1 = *(const char *const * const) a; - const char *const s2 = *(const char *const * const) b; - - if (s1 == s2) - return 0; - if (s1 == NULL) - return 1; - if (s2 == NULL) - return -1; - return strcoll (s1, s2); -} - - -/* Prepend DIRNAME to each of N members of ARRAY, replacing ARRAY's - elements in place. Return nonzero if out of memory, zero if successful. - A slash is inserted between DIRNAME and each elt of ARRAY, - unless DIRNAME is just "/". Each old element of ARRAY is freed. */ -static int -prefix_array (dirname, array, n) - const char *dirname; - char **array; - size_t n; -{ - register size_t i; - size_t dirlen = strlen (dirname); - - if (dirlen == 1 && dirname[0] == '/') - /* DIRNAME is just "/", so normal prepending would get us "//foo". - We want "/foo" instead, so don't prepend any chars from DIRNAME. */ - dirlen = 0; - - for (i = 0; i < n; ++i) - { - size_t eltlen = strlen (array[i]) + 1; - char *new = (char *) malloc (dirlen + 1 + eltlen); - if (new == NULL) - { - while (i > 0) - free ((__ptr_t) array[--i]); - return 1; - } - - memcpy (new, dirname, dirlen); - new[dirlen] = '/'; - memcpy (&new[dirlen + 1], array[i], eltlen); - free ((__ptr_t) array[i]); - array[i] = new; - } - - return 0; -} - - -/* Return nonzero if PATTERN contains any metacharacters. - Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ -static int -glob_pattern_p (pattern, quote) - const char *pattern; - int quote; -{ - register const char *p; - int open = 0; - - for (p = pattern; *p != '\0'; ++p) - switch (*p) - { - case '?': - case '*': - return 1; - - case '\\': - if (quote) - ++p; - break; - - case '[': - open = 1; - break; - - case ']': - if (open) - return 1; - break; - } - - return 0; -} - - -/* Like `glob', but PATTERN is a final pathname component, - and matches are searched for in DIRECTORY. - The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done. - The GLOB_APPEND flag is assumed to be set (always appends). */ -static int -glob_in_dir (pattern, directory, flags, errfunc, pglob) - const char *pattern; - const char *directory; - int flags; - int (*errfunc) __P ((const char *, int)); - glob_t *pglob; -{ - __ptr_t stream; - - struct globlink - { - struct globlink *next; - char *name; - }; - struct globlink *names = NULL; - size_t nfound = 0; - - if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) - { - stream = NULL; - flags |= GLOB_NOCHECK; - } - else - { - flags |= GLOB_MAGCHAR; - - stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory) - : (__ptr_t) opendir (directory)); - if (stream == NULL) - { - if ((errfunc != NULL && (*errfunc) (directory, errno)) || - (flags & GLOB_ERR)) - return GLOB_ABEND; - } - else - while (1) - { - const char *name; - size_t len; - - if (__glob_readdir_hook) - { - name = (*__glob_readdir_hook) (stream); - if (name == NULL) - break; - len = 0; - } - else - { - struct dirent *d = readdir ((DIR *) stream); - if (d == NULL) - break; - if (! REAL_DIR_ENTRY (d)) - continue; - name = d->d_name; -#ifdef HAVE_D_NAMLEN - len = d->d_namlen; -#else - len = 0; -#endif - } - - if (fnmatch (pattern, name, - (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) | - ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0) - { - struct globlink *new - = (struct globlink *) __alloca (sizeof (struct globlink)); - if (len == 0) - len = strlen (name); - new->name - = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1); - if (new->name == NULL) - goto memory_error; - memcpy ((__ptr_t) new->name, name, len); - new->name[len] = '\0'; - new->next = names; - names = new; - ++nfound; - } - } - } - - if (nfound == 0 && (flags & GLOB_NOCHECK)) - { - size_t len = strlen (pattern); - nfound = 1; - names = (struct globlink *) __alloca (sizeof (struct globlink)); - names->next = NULL; - names->name = (char *) malloc (len + 1); - if (names->name == NULL) - goto memory_error; - memcpy (names->name, pattern, len); - names->name[len] = '\0'; - } - - pglob->gl_pathv - = (char **) realloc (pglob->gl_pathv, - (pglob->gl_pathc + - ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) + - nfound + 1) * - sizeof (char *)); - if (pglob->gl_pathv == NULL) - goto memory_error; - - if (flags & GLOB_DOOFFS) - while (pglob->gl_pathc < pglob->gl_offs) - pglob->gl_pathv[pglob->gl_pathc++] = NULL; - - for (; names != NULL; names = names->next) - pglob->gl_pathv[pglob->gl_pathc++] = names->name; - pglob->gl_pathv[pglob->gl_pathc] = NULL; - - pglob->gl_flags = flags; - - if (stream != NULL) - { - int save = errno; - if (__glob_closedir_hook) - (*__glob_closedir_hook) (stream); - else - (void) closedir ((DIR *) stream); - errno = save; - } - return nfound == 0 ? GLOB_NOMATCH : 0; - - memory_error: - { - int save = errno; - if (__glob_closedir_hook) - (*__glob_closedir_hook) (stream); - else - (void) closedir ((DIR *) stream); - errno = save; - } - while (names != NULL) - { - if (names->name != NULL) - free ((__ptr_t) names->name); - names = names->next; - } - return GLOB_NOSPACE; -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/buildtools/windows/source/make/glob/COPYING.LIB b/buildtools/windows/source/make/glob/COPYING.LIB deleted file mode 100644 index eb685a5ec98..00000000000 --- a/buildtools/windows/source/make/glob/COPYING.LIB +++ /dev/null @@ -1,481 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/buildtools/windows/source/make/glob/Makefile b/buildtools/windows/source/make/glob/Makefile deleted file mode 100644 index eb8ac56dd96..00000000000 --- a/buildtools/windows/source/make/glob/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# GNU Makefile for building gmake.exe on WIN32 -# This makefile compiles the files in the glob subdirectory. -# - -CSRCS = fnmatch.c glob.c - -OBJS = $(CSRCS:.c=.obj) - -CC = cl - -CFLAGS = $(CC_SWITCHES) $(INCLUDES) $(DEFINES) $(CC_OUTPUTS) - -CC_SWITCHES = -nologo -ML -W3 -O2 - -INCLUDES = -I. -I.. - -DEFINES = -DWIN32 -DNDEBUG -D_CONSOLE -DNETSCAPE -DHAVE_CONFIG_H - -CC_OUTPUTS = -Fpglob.pch -YX -c - -all: $(OBJS) - -%.obj: %.c - $(CC) $(CFLAGS) $< - -clean: - rm -rf $(OBJS) glob.pch diff --git a/buildtools/windows/source/make/glob/Makefile.in b/buildtools/windows/source/make/glob/Makefile.in deleted file mode 100644 index 8c091b33ac9..00000000000 --- a/buildtools/windows/source/make/glob/Makefile.in +++ /dev/null @@ -1,66 +0,0 @@ -# Makefile for standalone distribution of libglob.a (fnmatch, glob). - -# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public License -# as published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. - -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. - -# You should have received a copy of the GNU Library General Public -# License along with this library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. - -# Ultrix 2.2 make doesn't expand the value of VPATH. -VPATH = @srcdir@ -# This must repeat the value, because configure will remove `VPATH = .'. -srcdir = @srcdir@ - -CC = @CC@ -CPPFLAGS = @CPPFLAGS@ -CFLAGS = @CFLAGS@ - -# Information determined by configure. -DEFS = @DEFS@ - -# How to invoke ar. -AR = @AR@ -ARFLAGS = rv - -# How to invoke ranlib. -RANLIB = @RANLIB@ - -.PHONY: all -all: libglob.a - -libglob.a: glob.o fnmatch.o - $(AR) $(ARFLAGS) $@ glob.o fnmatch.o - $(RANLIB) $@ - -# For some reason, Unix make wants the dependencies on the source files. -# Otherwise it refuses to use an implicit rule! -# And, get this: it doesn't work to use $(srcdir)/foo.c!! -glob.o: $(srcdir)/glob.h $(srcdir)/fnmatch.h glob.c -fnmatch.o: $(srcdir)/fnmatch.h fnmatch.c - -.c.o: - $(CC) -I. -I$(srcdir) -c \ - $(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION) - -.PHONY: clean realclean glob-clean glob-realclean distclean -clean glob-clean: - -rm -f libglob.a *.o core -distclean glob-realclean: clean - -rm -f TAGS tags Makefile config.status config.h config.log -realcean: distclean - -# For inside the C library. -glob.tar glob.tar.Z: - $(MAKE) -C .. $@ diff --git a/buildtools/windows/source/make/glob/configure b/buildtools/windows/source/make/glob/configure deleted file mode 100644 index d82e6dd9096..00000000000 --- a/buildtools/windows/source/make/glob/configure +++ /dev/null @@ -1,1547 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.1.2 -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE - -# Initialize some other variables. -subdirs= - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -build | --build | --buil | --bui | --bu | --b) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=PREFIX install architecture-dependent files in PREFIX - [same as prefix] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR ---enable and --with options recognized:$ac_help -EOF - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.1.2" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=fnmatch.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} conftest.$ac_ext $CFLAGS $CPPFLAGS -c 1>&5 2>&5' -ac_link='${CC-cc} conftest.$ac_ext $CFLAGS $CPPFLAGS $LDFLAGS -o conftest $LIBS 1>&5 2>&5' - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -if test $ac_cv_prog_gcc = yes; then - GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes -else - ac_cv_prog_gcc_g=no -fi -rm -f conftest* - -fi - echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - -# Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="ar" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" -fi -fi -AR="$ac_cv_prog_AR" -if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi -fi -CPP="$ac_cv_prog_CPP" -echo "$ac_t""$CPP" 1>&6 - echo $ac_n "checking for AIX""... $ac_c" 1>&6 -cat > conftest.$ac_ext <&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF -#define _ALL_SOURCE 1 -EOF - -else - rm -rf conftest* - echo "$ac_t""no" 1>&6 -fi -rm -f conftest* - - -ac_safe=`echo "minix/config.h" | tr './\055' '___'` -echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - MINIX=yes -else - echo "$ac_t""no" 1>&6 -MINIX= -fi - -if test "$MINIX" = yes; then - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define _POSIX_1_SOURCE 2 -EOF - - cat >> confdefs.h <<\EOF -#define _MINIX 1 -EOF - -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - ac_cv_c_const=yes -else - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -# If we cannot run a trivial program, we must be cross compiling. -echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext </dev/null; then - ac_cv_c_cross=no -else - ac_cv_c_cross=yes -fi -fi -rm -fr conftest* -fi -cross_compiling=$ac_cv_c_cross -echo "$ac_t""$ac_cv_c_cross" 1>&6 - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - ac_cv_header_stdc=no -else -cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - : -else - ac_cv_header_stdc=no -fi -fi -rm -fr conftest* -fi -fi -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -for ac_hdr in memory.h unistd.h string.h -do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` - cat >> confdefs.h <&6 -fi -done - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include <$ac_hdr> -int main() { return 0; } -int t() { -DIR *dirp = 0; -; return 0; } -EOF -if eval $ac_compile; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` - cat >> confdefs.h <&6 -fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for -ldir""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_dir'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 -fi - -else -echo $ac_n "checking for -lx""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_x'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else -cat > conftest.$ac_ext < -#include <$ac_header_dirent> -int closedir(); main() { exit(closedir(opendir(".")) != 0); } -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_closedir_void=no -else - ac_cv_func_closedir_void=yes -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_func_closedir_void" 1>&6 -if test $ac_cv_func_closedir_void = yes; then - cat >> confdefs.h <<\EOF -#define CLOSEDIR_VOID 1 -EOF - -fi - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { return 0; } -int t() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA_H 1 -EOF - -fi - -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -int main() { return 0; } -int t() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - ac_cv_func_alloca=yes -else - rm -rf conftest* - ac_cv_func_alloca=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_func_alloca" 1>&6 -if test $ac_cv_func_alloca = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF - -fi - -if test $ac_cv_func_alloca = no; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - - -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_os_cray=yes -else - rm -rf conftest* - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_os_cray" 1>&6 -if test $ac_cv_os_cray = yes; then -echo $ac_n "checking for _getb67""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func__getb67'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ -/* Override any gcc2 internal prototype to avoid an error. */ -char _getb67(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__getb67) || defined (__stub____getb67) -choke me -#else -_getb67(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func__getb67=yes" -else - rm -rf conftest* - eval "ac_cv_func__getb67=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'_getb67`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define CRAY_STACKSEG_END _getb67 -EOF - -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for GETB67""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_GETB67'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ -/* Override any gcc2 internal prototype to avoid an error. */ -char GETB67(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_GETB67) || defined (__stub___GETB67) -choke me -#else -GETB67(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_GETB67=yes" -else - rm -rf conftest* - eval "ac_cv_func_GETB67=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'GETB67`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define CRAY_STACKSEG_END GETB67 -EOF - -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for getb67""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_getb67'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < /* Arbitrary system header to define __stub macros. */ -/* Override any gcc2 internal prototype to avoid an error. */ -char getb67(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_getb67) || defined (__stub___getb67) -choke me -#else -getb67(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_getb67=yes" -else - rm -rf conftest* - eval "ac_cv_func_getb67=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'getb67`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define CRAY_STACKSEG_END getb67 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -fi - -fi - -fi - -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else -cat > conftest.$ac_ext < addr) ? 1 : -1; -} -main () -{ - exit (find_stack_direction() < 0); -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_stack_direction=1 -else - ac_cv_c_stack_direction=-1 -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_func_strcoll'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_strcoll=no -else -cat > conftest.$ac_ext < -main () -{ - exit (strcoll ("abc", "def") >= 0 || - strcoll ("ABC", "DEF") >= 0 || - strcoll ("123", "456") >= 0); -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_strcoll=yes -else - ac_cv_func_strcoll=no -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_func_strcoll" 1>&6 -if test $ac_cv_func_strcoll = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_STRCOLL 1 -EOF - -fi - -trap '' 1 2 15 -if test -w $cache_file; then -echo "updating cache $cache_file" -cat > $cache_file <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> $cache_file -else -echo "not updating unwritable cache $cache_file" -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.1.2" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir - -trap 'rm -f Makefile; exit 1' 1 2 15 - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF -$ac_vpsub -$extrasub -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@CC@%$CC%g -s%@AR@%$AR%g -s%@RANLIB@%$RANLIB%g -s%@CPP@%$CPP%g -s%@ALLOCA@%$ALLOCA%g - -CEOF -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust relative srcdir, etc. for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file -fi; done -rm -f conftest.subs - - - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/buildtools/windows/source/make/glob/configure.bat b/buildtools/windows/source/make/glob/configure.bat deleted file mode 100755 index 45fcd63f71f..00000000000 --- a/buildtools/windows/source/make/glob/configure.bat +++ /dev/null @@ -1,52 +0,0 @@ -@echo off - -echo Configuring glob for GO32 - -rem This batch file assumes a unix-type "sed" program - - - -echo # Makefile generated by "configure.bat"> Makefile - - - -if exist config.sed del config.sed - - - -echo "s/@srcdir@/./ ">> config.sed - -echo "s/@CC@/gcc/ ">> config.sed - -echo "s/@CFLAGS@/-O2 -g/ ">> config.sed - -echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -I../ ">> config.sed - -echo "s/@AR@/ar/ ">> config.sed - -echo "s/@RANLIB@/ranlib/ ">> config.sed - -echo "s/@LDFLAGS@// ">> config.sed - -echo "s/@DEFS@// ">> config.sed - -echo "s/@ALLOCA@// ">> config.sed - -echo "s/@LIBS@// ">> config.sed - -echo "s/@LIBOBJS@// ">> config.sed - -echo "s/^Makefile *:/_Makefile:/ ">> config.sed - -echo "s/^config.h *:/_config.h:/ ">> config.sed - - - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed - -sed -f config2.sed Makefile.in >> Makefile - -del config.sed - -del config2.sed - diff --git a/buildtools/windows/source/make/glob/configure.in b/buildtools/windows/source/make/glob/configure.in deleted file mode 100644 index 8dc68e42483..00000000000 --- a/buildtools/windows/source/make/glob/configure.in +++ /dev/null @@ -1,19 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir. -AC_PREREQ(2.1) dnl Minimum Autoconf version required. -AC_PROG_CC -AC_CHECK_PROG(AR, ar, ar, ar) -AC_PROG_RANLIB -AC_PROG_CPP dnl Later checks need this. -dnl These two want to come early. -AC_AIX -AC_MINIX -AC_ISC_POSIX -AC_CONST -AC_HEADER_STDC -AC_CHECK_HEADERS(memory.h unistd.h string.h) -AC_HEADER_DIRENT -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_ALLOCA -AC_FUNC_STRCOLL -AC_OUTPUT(Makefile) diff --git a/buildtools/windows/source/make/glob/fnmatch.c b/buildtools/windows/source/make/glob/fnmatch.c deleted file mode 100644 index 1ef5599e234..00000000000 --- a/buildtools/windows/source/make/glob/fnmatch.c +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -#ifndef errno -extern int errno; -#endif - -/* Match STRING against the filename pattern PATTERN, returning zero if - it matches, nonzero if not. */ -int -fnmatch (pattern, string, flags) - const char *pattern; - const char *string; - int flags; -{ - register const char *p = pattern, *n = string; - register char c; - -/* Note that this evalutes C many times. */ -#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) - - while ((c = *p++) != '\0') - { - c = FOLD (c); - - switch (c) - { - case '?': - if (*n == '\0') - return FNM_NOMATCH; - else if ((flags & FNM_FILE_NAME) && *n == '/') - return FNM_NOMATCH; - else if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; - break; - - case '\\': - if (!(flags & FNM_NOESCAPE)) - { - c = *p++; - c = FOLD (c); - } - if (FOLD (*n) != c) - return FNM_NOMATCH; - break; - - case '*': - if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; - - for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) - if (((flags & FNM_FILE_NAME) && *n == '/') || - (c == '?' && *n == '\0')) - return FNM_NOMATCH; - - if (c == '\0') - return 0; - - { - char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; - c1 = FOLD (c1); - for (--p; *n != '\0'; ++n) - if ((c == '[' || FOLD (*n) == c1) && - fnmatch (p, n, flags & ~FNM_PERIOD) == 0) - return 0; - return FNM_NOMATCH; - } - - case '[': - { - /* Nonzero if the sense of the character class is inverted. */ - register int not; - - if (*n == '\0') - return FNM_NOMATCH; - - if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; - - not = (*p == '!' || *p == '^'); - if (not) - ++p; - - c = *p++; - for (;;) - { - register char cstart = c, cend = c; - - if (!(flags & FNM_NOESCAPE) && c == '\\') - cstart = cend = *p++; - - cstart = cend = FOLD (cstart); - - if (c == '\0') - /* [ (unterminated) loses. */ - return FNM_NOMATCH; - - c = *p++; - c = FOLD (c); - - if ((flags & FNM_FILE_NAME) && c == '/') - /* [/] can never match. */ - return FNM_NOMATCH; - - if (c == '-' && *p != ']') - { - cend = *p++; - if (!(flags & FNM_NOESCAPE) && cend == '\\') - cend = *p++; - if (cend == '\0') - return FNM_NOMATCH; - cend = FOLD (cend); - - c = *p++; - } - - if (FOLD (*n) >= cstart && FOLD (*n) <= cend) - goto matched; - - if (c == ']') - break; - } - if (!not) - return FNM_NOMATCH; - break; - - matched:; - /* Skip the rest of the [...] that already matched. */ - while (c != ']') - { - if (c == '\0') - /* [... (unterminated) loses. */ - return FNM_NOMATCH; - - c = *p++; - if (!(flags & FNM_NOESCAPE) && c == '\\') - /* XXX 1003.2d11 is unclear if this is right. */ - ++p; - } - if (not) - return FNM_NOMATCH; - } - break; - - default: - if (c != FOLD (*n)) - return FNM_NOMATCH; - } - - ++n; - } - - if (*n == '\0') - return 0; - - if ((flags & FNM_LEADING_DIR) && *n == '/') - /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ - return 0; - - return FNM_NOMATCH; -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/buildtools/windows/source/make/glob/fnmatch.h b/buildtools/windows/source/make/glob/fnmatch.h deleted file mode 100644 index d9d73b3d86c..00000000000 --- a/buildtools/windows/source/make/glob/fnmatch.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifndef _FNMATCH_H - -#define _FNMATCH_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -#undef __P -#define __P(protos) protos -#else /* Not C++ or ANSI C. */ -#undef __P -#define __P(protos) () -/* We can get away without defining `const' here only because in this file - it is used only inside the prototype for `fnmatch', which is elided in - non-ANSI C where `const' is problematical. */ -#endif /* C++ or ANSI C. */ - - -/* We #undef these before defining them because some losing systems - (HP-UX A.08.07 for example) define these in . */ -#undef FNM_PATHNAME -#undef FNM_NOESCAPE -#undef FNM_PERIOD - -/* Bits set in the FLAGS argument to `fnmatch'. */ -#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ -#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ -#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ - -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) -#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ -#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ -#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ -#endif - -/* Value returned by `fnmatch' if STRING does not match PATTERN. */ -#define FNM_NOMATCH 1 - -/* Match STRING against the filename pattern PATTERN, - returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch __P ((const char *__pattern, const char *__string, - int __flags)); - -#ifdef __cplusplus -} -#endif - -#endif /* fnmatch.h */ diff --git a/buildtools/windows/source/make/glob/glob.c b/buildtools/windows/source/make/glob/glob.c deleted file mode 100644 index c90a40672b9..00000000000 --- a/buildtools/windows/source/make/glob/glob.c +++ /dev/null @@ -1,705 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* AIX requires this to be the first thing in the file. */ -#if defined (_AIX) && !defined (__GNUC__) - #pragma alloca -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef NETSCAPE -#include "windir.h" -#endif - -#include -#include -#include - - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -#ifdef STDC_HEADERS -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#ifndef POSIX -#ifdef _POSIX_VERSION -#define POSIX -#endif -#endif -#endif - -#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) -extern int errno; -#endif - -#ifndef NULL -#define NULL 0 -#endif - - -#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__) -#include -#ifndef __GNU_LIBRARY__ -#define D_NAMLEN(d) strlen((d)->d_name) -#else /* GNU C library. */ -#define D_NAMLEN(d) ((d)->d_namlen) -#endif /* Not GNU C library. */ -#else /* Not POSIX or HAVE_DIRENT_H. */ -#define direct dirent -#define D_NAMLEN(d) ((d)->d_namlen) -#ifdef HAVE_SYS_NDIR_H -#include -#endif /* HAVE_SYS_NDIR_H */ -#ifdef HAVE_SYS_DIR_H -#include -#endif /* HAVE_SYS_DIR_H */ -#ifdef HAVE_NDIR_H -#include -#endif /* HAVE_NDIR_H */ -#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */ - -#if defined(NETSCAPE) || defined (POSIX) && !defined (__GNU_LIBRARY__) -/* Posix does not require that the d_ino field be present, and some - systems do not provide it. */ -#define REAL_DIR_ENTRY(dp) 1 -#else -#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) -#endif /* POSIX */ - -#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) -#include -#include -#define ANSI_STRING -#else /* No standard headers. */ - -#ifdef HAVE_STRING_H -#include -#define ANSI_STRING -#else -#include -#endif -#ifdef HAVE_MEMORY_H -#include -#endif - -extern char *malloc (), *realloc (); -extern void free (); - -extern void qsort (); -extern void abort (), exit (); - -#endif /* Standard headers. */ - -#ifndef ANSI_STRING - -#ifndef bzero -extern void bzero (); -#endif -#ifndef bcopy -extern void bcopy (); -#endif - -#define memcpy(d, s, n) bcopy ((s), (d), (n)) -#define strrchr rindex -/* memset is only used for zero here, but let's be paranoid. */ -#define memset(s, better_be_zero, n) \ - ((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0))) -#endif /* Not ANSI_STRING. */ - -#ifndef HAVE_STRCOLL -#define strcoll strcmp -#endif - - -#if !defined(__GNU_LIBRARY__) && !defined(NETSCAPE) -#ifdef __GNUC__ -__inline -#endif -static char * -my_realloc (p, n) - char *p; - unsigned int n; -{ - /* These casts are the for sake of the broken Ultrix compiler, - which warns of illegal pointer combinations otherwise. */ - if (p == NULL) - return (char *) malloc (n); - return (char *) realloc (p, n); -} -#define realloc my_realloc -#endif - - -#if !defined(__alloca) && !defined(__GNU_LIBRARY__) - -#ifdef __GNUC__ -#undef alloca -#define alloca(n) __builtin_alloca (n) -#else /* Not GCC. */ -#if defined (sparc) || defined (HAVE_ALLOCA_H) -#include -#elif defined(NETSCAPE) -#include -#else /* Not sparc or HAVE_ALLOCA_H. */ -#ifndef _AIX -extern char *alloca (); -#endif /* Not _AIX. */ -#endif /* sparc or HAVE_ALLOCA_H. */ -#endif /* GCC. */ - -#define __alloca alloca - -#endif - -#ifndef __GNU_LIBRARY__ -#define __lstat lstat -#ifndef HAVE_LSTAT -#define lstat stat -#endif -#ifdef STAT_MACROS_BROKEN -#undef S_ISDIR -#endif -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif -#endif - -#ifndef STDC_HEADERS -#undef size_t -#define size_t unsigned int -#endif - -/* Some system header files erroneously define these. - We want our own definitions from to take precedence. */ -#undef FNM_PATHNAME -#undef FNM_NOESCAPE -#undef FNM_PERIOD -#include - -/* Some system header files erroneously define these. - We want our own definitions from to take precedence. */ -#undef GLOB_ERR -#undef GLOB_MARK -#undef GLOB_NOSORT -#undef GLOB_DOOFFS -#undef GLOB_NOCHECK -#undef GLOB_APPEND -#undef GLOB_NOESCAPE -#undef GLOB_PERIOD -#include - -__ptr_t (*__glob_opendir_hook) __P ((const char *directory)); -const char *(*__glob_readdir_hook) __P ((__ptr_t stream)); -void (*__glob_closedir_hook) __P ((__ptr_t stream)); - -static int glob_pattern_p __P ((const char *pattern, int quote)); -static int glob_in_dir __P ((const char *pattern, const char *directory, - int flags, - int (*errfunc) __P ((const char *, int)), - glob_t *pglob)); -static int prefix_array __P ((const char *prefix, char **array, size_t n)); -int collated_compare __P ((const void *elem1, const void *elem2)); - -/* Do glob searching for PATTERN, placing results in PGLOB. - The bits defined above may be set in FLAGS. - If a directory cannot be opened or read and ERRFUNC is not nil, - it is called with the pathname that caused the error, and the - `errno' value from the failing call; if it returns non-zero - `glob' returns GLOB_ABEND; if it returns zero, the error is ignored. - If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. - Otherwise, `glob' returns zero. */ -int -glob (pattern, flags, errfunc, pglob) - const char *pattern; - int flags; - int (*errfunc) __P ((const char *, int)); - glob_t *pglob; -{ - const char *filename; - char *dirname; - size_t dirlen; - int status; - int oldcount; - - if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) - { - errno = EINVAL; - return -1; - } - - /* Find the filename. */ - filename = strrchr (pattern, '/'); - if (filename == NULL) - { - filename = pattern; - dirname = (char *) "."; - dirlen = 0; - } - else if (filename == pattern) - { - /* "/pattern". */ - dirname = (char *) "/"; - dirlen = 1; - ++filename; - } - else - { - dirlen = filename - pattern; - dirname = (char *) __alloca (dirlen + 1); - memcpy (dirname, pattern, dirlen); - dirname[dirlen] = '\0'; - ++filename; - } - - if (filename[0] == '\0' && dirlen > 1) - /* "pattern/". Expand "pattern", appending slashes. */ - { - int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob); - if (val == 0) - pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK); - return val; - } - - if (!(flags & GLOB_APPEND)) - { - pglob->gl_pathc = 0; - pglob->gl_pathv = NULL; - } - - oldcount = pglob->gl_pathc; - - if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) - { - /* The directory name contains metacharacters, so we - have to glob for the directory, and then glob for - the pattern in each directory found. */ - glob_t dirs; - register int i; - - status = glob (dirname, - ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) | - GLOB_NOSORT), - errfunc, &dirs); - if (status != 0) - return status; - - /* We have successfully globbed the preceding directory name. - For each name we found, call glob_in_dir on it and FILENAME, - appending the results to PGLOB. */ - for (i = 0; i < dirs.gl_pathc; ++i) - { - int oldcount; - -#ifdef SHELL - { - /* Make globbing interruptible in the bash shell. */ - extern int interrupt_state; - - if (interrupt_state) - { - globfree (&dirs); - globfree (&files); - return GLOB_ABEND; - } - } -#endif /* SHELL. */ - - oldcount = pglob->gl_pathc; - status = glob_in_dir (filename, dirs.gl_pathv[i], - (flags | GLOB_APPEND) & ~GLOB_NOCHECK, - errfunc, pglob); - if (status == GLOB_NOMATCH) - /* No matches in this directory. Try the next. */ - continue; - - if (status != 0) - { - globfree (&dirs); - globfree (pglob); - return status; - } - - /* Stick the directory on the front of each name. */ - if (prefix_array (dirs.gl_pathv[i], - &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount)) - { - globfree (&dirs); - globfree (pglob); - return GLOB_NOSPACE; - } - } - - flags |= GLOB_MAGCHAR; - - if (pglob->gl_pathc == oldcount) - /* No matches. */ - if (flags & GLOB_NOCHECK) - { - size_t len = strlen (pattern) + 1; - char *patcopy = (char *) malloc (len); - if (patcopy == NULL) - return GLOB_NOSPACE; - memcpy (patcopy, pattern, len); - - pglob->gl_pathv - = (char **) realloc (pglob->gl_pathv, - (pglob->gl_pathc + - ((flags & GLOB_DOOFFS) ? - pglob->gl_offs : 0) + - 1 + 1) * - sizeof (char *)); - if (pglob->gl_pathv == NULL) - { - free (patcopy); - return GLOB_NOSPACE; - } - - if (flags & GLOB_DOOFFS) - while (pglob->gl_pathc < pglob->gl_offs) - pglob->gl_pathv[pglob->gl_pathc++] = NULL; - - pglob->gl_pathv[pglob->gl_pathc++] = patcopy; - pglob->gl_pathv[pglob->gl_pathc] = NULL; - pglob->gl_flags = flags; - } - else - return GLOB_NOMATCH; - } - else - { - status = glob_in_dir (filename, dirname, flags, errfunc, pglob); - if (status != 0) - return status; - - if (dirlen > 0) - { - /* Stick the directory on the front of each name. */ - if (prefix_array (dirname, - &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount)) - { - globfree (pglob); - return GLOB_NOSPACE; - } - } - } - - if (flags & GLOB_MARK) - { - /* Append slashes to directory names. glob_in_dir has already - allocated the extra character for us. */ - int i; - struct stat st; - for (i = oldcount; i < pglob->gl_pathc; ++i) - if (__lstat (pglob->gl_pathv[i], &st) == 0 && - S_ISDIR (st.st_mode)) - strcat (pglob->gl_pathv[i], "/"); - } - - if (!(flags & GLOB_NOSORT)) - /* Sort the vector. */ -#if 0 - qsort ((__ptr_t) &pglob->gl_pathv[oldcount], - pglob->gl_pathc - oldcount, - sizeof (char *), collated_compare); -#else - qsort ( &pglob->gl_pathv[oldcount], - (size_t)(pglob->gl_pathc - oldcount), - sizeof (char *), collated_compare); -#endif - - return 0; -} - - -/* Free storage allocated in PGLOB by a previous `glob' call. */ -void -globfree (pglob) - register glob_t *pglob; -{ - if (pglob->gl_pathv != NULL) - { - register int i; - for (i = 0; i < pglob->gl_pathc; ++i) - if (pglob->gl_pathv[i] != NULL) - free ((__ptr_t) pglob->gl_pathv[i]); - free ((__ptr_t) pglob->gl_pathv); - } -} - - -/* Do a collated comparison of A and B. */ -int -collated_compare (const void *elem1, const void *elem2) -{ - const __ptr_t a = (const __ptr_t)elem1; - const __ptr_t b = (const __ptr_t)elem1; - const char *const s1 = *(const char *const * const) a; - const char *const s2 = *(const char *const * const) b; - - if (s1 == s2) - return 0; - if (s1 == NULL) - return 1; - if (s2 == NULL) - return -1; - return strcoll (s1, s2); -} - - -/* Prepend DIRNAME to each of N members of ARRAY, replacing ARRAY's - elements in place. Return nonzero if out of memory, zero if successful. - A slash is inserted between DIRNAME and each elt of ARRAY, - unless DIRNAME is just "/". Each old element of ARRAY is freed. */ -static int -prefix_array (dirname, array, n) - const char *dirname; - char **array; - size_t n; -{ - register size_t i; - size_t dirlen = strlen (dirname); - - if (dirlen == 1 && dirname[0] == '/') - /* DIRNAME is just "/", so normal prepending would get us "//foo". - We want "/foo" instead, so don't prepend any chars from DIRNAME. */ - dirlen = 0; - - for (i = 0; i < n; ++i) - { - size_t eltlen = strlen (array[i]) + 1; - char *new = (char *) malloc (dirlen + 1 + eltlen); - if (new == NULL) - { - while (i > 0) - free ((__ptr_t) array[--i]); - return 1; - } - - memcpy (new, dirname, dirlen); - new[dirlen] = '/'; - memcpy (&new[dirlen + 1], array[i], eltlen); - free ((__ptr_t) array[i]); - array[i] = new; - } - - return 0; -} - - -/* Return nonzero if PATTERN contains any metacharacters. - Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ -static int -glob_pattern_p (pattern, quote) - const char *pattern; - int quote; -{ - register const char *p; - int open = 0; - - for (p = pattern; *p != '\0'; ++p) - switch (*p) - { - case '?': - case '*': - return 1; - - case '\\': - if (quote) - ++p; - break; - - case '[': - open = 1; - break; - - case ']': - if (open) - return 1; - break; - } - - return 0; -} - - -/* Like `glob', but PATTERN is a final pathname component, - and matches are searched for in DIRECTORY. - The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done. - The GLOB_APPEND flag is assumed to be set (always appends). */ -static int -glob_in_dir (pattern, directory, flags, errfunc, pglob) - const char *pattern; - const char *directory; - int flags; - int (*errfunc) __P ((const char *, int)); - glob_t *pglob; -{ - __ptr_t stream; - - struct globlink - { - struct globlink *next; - char *name; - }; - struct globlink *names = NULL; - size_t nfound = 0; - - if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) - { - stream = NULL; - flags |= GLOB_NOCHECK; - } - else - { - flags |= GLOB_MAGCHAR; - - stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory) - : (__ptr_t) opendir (directory)); - if (stream == NULL) - { - if ((errfunc != NULL && (*errfunc) (directory, errno)) || - (flags & GLOB_ERR)) - return GLOB_ABEND; - } - else - while (1) - { - const char *name; - size_t len; - - if (__glob_readdir_hook) - { - name = (*__glob_readdir_hook) (stream); - if (name == NULL) - break; - len = 0; - } - else - { - struct dirent *d = readdir ((DIR *) stream); - if (d == NULL) - break; - if (! REAL_DIR_ENTRY (d)) - continue; - name = d->d_name; -#ifdef HAVE_D_NAMLEN - len = d->d_namlen; -#else - len = 0; -#endif - } - - if (fnmatch (pattern, name, - (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) | - ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0) - { - struct globlink *new - = (struct globlink *) __alloca (sizeof (struct globlink)); - if (len == 0) - len = strlen (name); - new->name - = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1); - if (new->name == NULL) - goto memory_error; - memcpy ((__ptr_t) new->name, name, len); - new->name[len] = '\0'; - new->next = names; - names = new; - ++nfound; - } - } - } - - if (nfound == 0 && (flags & GLOB_NOCHECK)) - { - size_t len = strlen (pattern); - nfound = 1; - names = (struct globlink *) __alloca (sizeof (struct globlink)); - names->next = NULL; - names->name = (char *) malloc (len + 1); - if (names->name == NULL) - goto memory_error; - memcpy (names->name, pattern, len); - names->name[len] = '\0'; - } - - pglob->gl_pathv - = (char **) realloc (pglob->gl_pathv, - (pglob->gl_pathc + - ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) + - nfound + 1) * - sizeof (char *)); - if (pglob->gl_pathv == NULL) - goto memory_error; - - if (flags & GLOB_DOOFFS) - while (pglob->gl_pathc < pglob->gl_offs) - pglob->gl_pathv[pglob->gl_pathc++] = NULL; - - for (; names != NULL; names = names->next) - pglob->gl_pathv[pglob->gl_pathc++] = names->name; - pglob->gl_pathv[pglob->gl_pathc] = NULL; - - pglob->gl_flags = flags; - - if (stream != NULL) - { - int save = errno; - if (__glob_closedir_hook) - (*__glob_closedir_hook) (stream); - else - (void) closedir ((DIR *) stream); - errno = save; - } - return nfound == 0 ? GLOB_NOMATCH : 0; - - memory_error: - { - int save = errno; - if (__glob_closedir_hook) - (*__glob_closedir_hook) (stream); - else - (void) closedir ((DIR *) stream); - errno = save; - } - while (names != NULL) - { - if (names->name != NULL) - free ((__ptr_t) names->name); - names = names->next; - } - return GLOB_NOSPACE; -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/buildtools/windows/source/make/glob/glob.h b/buildtools/windows/source/make/glob/glob.h deleted file mode 100644 index 05ad47f05d9..00000000000 --- a/buildtools/windows/source/make/glob/glob.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#ifndef _GLOB_H - -#define _GLOB_H 1 - -#ifdef __cplusplus -extern "C" -{ -#endif - -#undef __ptr_t -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -#undef __P -#define __P(protos) protos -#define __ptr_t void * -#else /* Not C++ or ANSI C. */ -#undef __P -#define __P(protos) () -#undef const -#define const -#define __ptr_t char * -#endif /* C++ or ANSI C. */ - -/* Bits set in the FLAGS argument to `glob'. */ -#define GLOB_ERR (1 << 0)/* Return on read errors. */ -#define GLOB_MARK (1 << 1)/* Append a slash to each name. */ -#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */ -#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */ -#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */ -#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */ -#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */ -#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */ -#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ - GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|GLOB_PERIOD) - -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE) -#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */ -#endif - -/* Error returns from `glob'. */ -#define GLOB_NOSPACE 1 /* Ran out of memory. */ -#define GLOB_ABEND 2 /* Read error. */ -#define GLOB_NOMATCH 3 /* No matches found. */ - -/* Structure describing a globbing run. */ -typedef struct - { - int gl_pathc; /* Count of paths matched by the pattern. */ - char **gl_pathv; /* List of matched pathnames. */ - int gl_offs; /* Slots to reserve in `gl_pathv'. */ - int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */ - } glob_t; - -/* Do glob searching for PATTERN, placing results in PGLOB. - The bits defined above may be set in FLAGS. - If a directory cannot be opened or read and ERRFUNC is not nil, - it is called with the pathname that caused the error, and the - `errno' value from the failing call; if it returns non-zero - `glob' returns GLOB_ABEND; if it returns zero, the error is ignored. - If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. - Otherwise, `glob' returns zero. */ -extern int glob __P ((const char *__pattern, int __flags, - int (*__errfunc) __P ((const char *, int)), - glob_t *__pglob)); - -/* Free storage allocated in PGLOB by a previous `glob' call. */ -extern void globfree __P ((glob_t *__pglob)); - - -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) -/* If they are not NULL, `glob' uses these functions to read directories. */ -extern __ptr_t (*__glob_opendir_hook) __P ((const char *__directory)); -extern const char *(*__glob_readdir_hook) __P ((__ptr_t __stream)); -extern void (*__glob_closedir_hook) __P ((__ptr_t __stream)); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* glob.h */ diff --git a/buildtools/windows/source/make/implicit.c b/buildtools/windows/source/make/implicit.c deleted file mode 100644 index 1fef4f5909b..00000000000 --- a/buildtools/windows/source/make/implicit.c +++ /dev/null @@ -1,590 +0,0 @@ -/* Implicit rule searching for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "rule.h" -#include "dep.h" -#include "file.h" - -static int pattern_search (); - -/* For a FILE which has no commands specified, try to figure out some - from the implicit pattern rules. - Returns 1 if a suitable implicit rule was found, - after modifying FILE to contain the appropriate commands and deps, - or returns 0 if no implicit rule was found. */ - -int -try_implicit_rule (file, depth) - struct file *file; - unsigned int depth; -{ - DEBUGPR ("Looking for an implicit rule for `%s'.\n"); - - /* The order of these searches was previously reversed. My logic now is - that since the non-archive search uses more information in the target - (the archive search omits the archive name), it is more specific and - should come first. */ - - if (pattern_search (file, 0, depth, 0)) - return 1; - -#ifndef NO_ARCHIVES - /* If this is an archive member reference, use just the - archive member name to search for implicit rules. */ - if (ar_name (file->name)) - { - DEBUGPR ("Looking for archive-member implicit rule for `%s'.\n"); - if (pattern_search (file, 1, depth, 0)) - return 1; - } -#endif - - return 0; -} - -#define DEBUGP2(msg, a1, a2) \ - do { \ - if (debug_flag) \ - { print_spaces (depth); printf (msg, a1, a2); fflush (stdout); } \ - } while (0) - -/* Search the pattern rules for a rule with an existing dependency to make - FILE. If a rule is found, the appropriate commands and deps are put in FILE - and 1 is returned. If not, 0 is returned. - - If ARCHIVE is nonzero, FILE->name is of the form "LIB(MEMBER)". A rule for - "(MEMBER)" will be searched for, and "(MEMBER)" will not be chopped up into - directory and filename parts. - - If an intermediate file is found by pattern search, the intermediate file - is set up as a target by the recursive call and is also made a dependency - of FILE. - - DEPTH is used for debugging messages. */ - -static int -pattern_search (file, archive, depth, recursions) - struct file *file; - int archive; - unsigned int depth; - unsigned int recursions; -{ - /* Filename we are searching for a rule for. */ - char *filename = archive ? index (file->name, '(') : file->name; - - /* Length of FILENAME. */ - unsigned int namelen = strlen (filename); - - /* The last slash in FILENAME (or nil if there is none). */ - char *lastslash; - - /* This is a file-object used as an argument in - recursive calls. It never contains any data - except during a recursive call. */ - struct file *intermediate_file = 0; - - /* List of dependencies found recursively. */ - struct file **intermediate_files - = (struct file **) alloca (max_pattern_deps * sizeof (struct file *)); - - /* List of the patterns used to find intermediate files. */ - char **intermediate_patterns - = (char **) alloca (max_pattern_deps * sizeof (char *)); - - /* This buffer records all the dependencies actually found for a rule. */ - char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *)); - /* Number of dep names now in FOUND_FILES. */ - unsigned int deps_found; - - /* Names of possible dependencies are constructed in this buffer. */ - register char *depname = (char *) alloca (namelen + max_pattern_dep_length); - - /* The start and length of the stem of FILENAME for the current rule. */ - register char *stem; - register unsigned int stemlen; - - /* Buffer in which we store all the rules that are possibly applicable. */ - struct rule **tryrules - = (struct rule **) alloca (num_pattern_rules * max_pattern_targets - * sizeof (struct rule *)); - - /* Number of valid elements in TRYRULES. */ - unsigned int nrules; - - /* The numbers of the rule targets of each rule - in TRYRULES that matched the target file. */ - unsigned int *matches - = (unsigned int *) alloca (num_pattern_rules * sizeof (unsigned int)); - - /* Each element is nonzero if LASTSLASH was used in - matching the corresponding element of TRYRULES. */ - char *checked_lastslash - = (char *) alloca (num_pattern_rules * sizeof (char)); - - /* The index in TRYRULES of the rule we found. */ - unsigned int foundrule; - - /* Nonzero if should consider intermediate files as dependencies. */ - int intermed_ok; - - /* Nonzero if we have matched a pattern-rule target - that is not just `%'. */ - int specific_rule_matched = 0; - - register unsigned int i; - register struct rule *rule; - register struct dep *dep; - - char *p; - -#ifndef NO_ARCHIVES - if (archive || ar_name (filename)) - lastslash = 0; - else -#endif - { - /* Set LASTSLASH to point at the last slash in FILENAME - but not counting any slash at the end. (foo/bar/ counts as - bar/ in directory foo/, not empty in directory foo/bar/.) */ - lastslash = rindex (filename, '/'); - if (lastslash != 0 && lastslash[1] == '\0') - lastslash = 0; - } - - /* First see which pattern rules match this target - and may be considered. Put them in TRYRULES. */ - - nrules = 0; - for (rule = pattern_rules; rule != 0; rule = rule->next) - { - /* If the pattern rule has deps but no commands, ignore it. - Users cancel built-in rules by redefining them without commands. */ - if (rule->deps != 0 && rule->cmds == 0) - continue; - - /* If this rule is in use by a parent pattern_search, - don't use it here. */ - if (rule->in_use) - { - DEBUGP2 ("Avoiding implicit rule recursion.%s%s\n", "", ""); - continue; - } - - for (i = 0; rule->targets[i] != 0; ++i) - { - char *target = rule->targets[i]; - char *suffix = rule->suffixes[i]; - int check_lastslash; - - /* Rules that can match any filename and are not terminal - are ignored if we're recursing, so that they cannot be - intermediate files. */ - if (recursions > 0 && target[1] == '\0' && !rule->terminal) - continue; - - if (rule->lens[i] > namelen) - /* It can't possibly match. */ - continue; - - /* From the lengths of the filename and the pattern parts, - find the stem: the part of the filename that matches the %. */ - stem = filename + (suffix - target - 1); - stemlen = namelen - rule->lens[i] + 1; - - /* Set CHECK_LASTSLASH if FILENAME contains a directory - prefix and the target pattern does not contain a slash. */ - - check_lastslash = lastslash != 0 && index (target, '/') == 0; - if (check_lastslash) - { - /* In that case, don't include the - directory prefix in STEM here. */ - unsigned int difference = lastslash - filename + 1; - if (difference > stemlen) - continue; - stemlen -= difference; - stem += difference; - } - - /* Check that the rule pattern matches the text before the stem. */ - if (check_lastslash) - { - if (stem > (lastslash + 1) - && strncmp (target, lastslash + 1, stem - lastslash - 1)) - continue; - } - else if (stem > filename - && strncmp (target, filename, stem - filename)) - continue; - - /* Check that the rule pattern matches the text after the stem. - We could test simply use streq, but this way we compare the - first two characters immediately. This saves time in the very - common case where the first character matches because it is a - period. */ - if (*suffix != stem[stemlen] - || (*suffix != '\0' && !streq (&suffix[1], &stem[(int)stemlen + 1]))) - continue; - - /* Record if we match a rule that not all filenames will match. */ - if (target[1] != '\0') - specific_rule_matched = 1; - - /* A rule with no dependencies and no commands exists solely to set - specific_rule_matched when it matches. Don't try to use it. */ - if (rule->deps == 0 && rule->cmds == 0) - continue; - - /* Record this rule in TRYRULES and the index of the matching - target in MATCHES. If several targets of the same rule match, - that rule will be in TRYRULES more than once. */ - tryrules[nrules] = rule; - matches[nrules] = i; - checked_lastslash[nrules] = check_lastslash; - ++nrules; - } - } - - /* If we have found a matching rule that won't match all filenames, - retroactively reject any non-"terminal" rules that do always match. */ - if (specific_rule_matched) - for (i = 0; i < nrules; ++i) - if (!tryrules[i]->terminal) - { - register unsigned int j; - for (j = 0; tryrules[i]->targets[j] != 0; ++j) - if (tryrules[i]->targets[j][1] == '\0') - break; - if (tryrules[i]->targets[j] != 0) - tryrules[i] = 0; - } - - /* Try each rule once without intermediate files, then once with them. */ - for (intermed_ok = 0; intermed_ok == !!intermed_ok; ++intermed_ok) - { - /* Try each pattern rule till we find one that applies. - If it does, copy the names of its dependencies (as substituted) - and store them in FOUND_FILES. DEPS_FOUND is the number of them. */ - - for (i = 0; i < nrules; i++) - { - int check_lastslash; - - rule = tryrules[i]; - - /* RULE is nil when we discover that a rule, - already placed in TRYRULES, should not be applied. */ - if (rule == 0) - continue; - - /* Reject any terminal rules if we're - looking to make intermediate files. */ - if (intermed_ok && rule->terminal) - continue; - - /* Mark this rule as in use so a recursive - pattern_search won't try to use it. */ - rule->in_use = 1; - - /* From the lengths of the filename and the matching pattern parts, - find the stem: the part of the filename that matches the %. */ - stem = filename - + (rule->suffixes[matches[i]] - rule->targets[matches[i]]) - 1; - stemlen = namelen - rule->lens[matches[i]] + 1; - check_lastslash = checked_lastslash[i]; - if (check_lastslash) - { - stem += lastslash - filename + 1; - stemlen -= (lastslash - filename) + 1; - } - - DEBUGP2 ("Trying pattern rule with stem `%.*s'.\n", - (int) stemlen, stem); - - /* Try each dependency; see if it "exists". */ - - deps_found = 0; - for (dep = rule->deps; dep != 0; dep = dep->next) - { - /* If the dependency name has a %, substitute the stem. */ - p = index (dep_name (dep), '%'); - if (p != 0) - { - register unsigned int i; - if (check_lastslash) - { - /* Copy directory name from the original FILENAME. */ - i = lastslash - filename + 1; - bcopy (filename, depname, i); - } - else - i = 0; - bcopy (dep_name (dep), depname + i, p - dep_name (dep)); - i += p - dep_name (dep); - bcopy (stem, depname + i, stemlen); - i += stemlen; - strcpy (depname + i, p + 1); - p = depname; - } - else - p = dep_name (dep); - - /* P is now the actual dependency name as substituted. */ - - if (file_impossible_p (p)) - { - /* If this dependency has already been ruled - "impossible", then the rule fails and don't - bother trying it on the second pass either - since we know that will fail too. */ - DEBUGP2 ("Rejecting impossible %s dependency `%s'.\n", - p == depname ? "implicit" : "rule", p); - tryrules[i] = 0; - break; - } - - intermediate_files[deps_found] = 0; - - DEBUGP2 ("Trying %s dependency `%s'.\n", - p == depname ? "implicit" : "rule", p); - - /* The DEP->changed flag says that this dependency resides in a - nonexistent directory. So we normally can skip looking for - the file. However, if CHECK_LASTSLASH is set, then the - dependency file we are actually looking for is in a different - directory (the one gotten by prepending FILENAME's directory), - so it might actually exist. */ - - if ((!dep->changed || check_lastslash) - && (lookup_file (p) != 0 || file_exists_p (p))) - { - found_files[deps_found++] = savestring (p, strlen (p)); - continue; - } - /* This code, given FILENAME = "lib/foo.o", dependency name - "lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */ - if (vpath_search (&p, (time_t *) 0)) - { - DEBUGP2 ("Found dependency as `%s'.%s\n", p, ""); - found_files[deps_found++] = p; - continue; - } - - /* We could not find the file in any place we should look. - Try to make this dependency as an intermediate file, - but only on the second pass. */ - - if (intermed_ok) - { - if (intermediate_file == 0) - intermediate_file - = (struct file *) alloca (sizeof (struct file)); - - DEBUGP2 ("Looking for a rule with %s file `%s'.\n", - "intermediate", p); - - bzero ((char *) intermediate_file, sizeof (struct file)); - intermediate_file->name = p; - if (pattern_search (intermediate_file, 0, depth + 1, - recursions + 1)) - { - p = savestring (p, strlen (p)); - intermediate_patterns[deps_found] - = intermediate_file->name; - intermediate_file->name = p; - intermediate_files[deps_found] = intermediate_file; - intermediate_file = 0; - /* Allocate an extra copy to go in FOUND_FILES, - because every elt of FOUND_FILES is consumed - or freed later. */ - found_files[deps_found] = savestring (p, strlen (p)); - ++deps_found; - continue; - } - - /* If we have tried to find P as an intermediate - file and failed, mark that name as impossible - so we won't go through the search again later. */ - file_impossible (p); - } - - /* A dependency of this rule does not exist. - Therefore, this rule fails. */ - break; - } - - /* This rule is no longer `in use' for recursive searches. */ - rule->in_use = 0; - - if (dep != 0) - { - /* This pattern rule does not apply. - If some of its dependencies succeeded, - free the data structure describing them. */ - while (deps_found-- > 0) - { - register struct file *f = intermediate_files[deps_found]; - free (found_files[deps_found]); - if (f != 0 - && (f->stem < f->name - || f->stem > f->name + strlen (f->name))) - free (f->stem); - } - } - else - /* This pattern rule does apply. Stop looking for one. */ - break; - } - - /* If we found an applicable rule without - intermediate files, don't try with them. */ - if (i < nrules) - break; - - rule = 0; - } - - /* RULE is nil if the loop went all the way - through the list and everything failed. */ - if (rule == 0) - return 0; - - foundrule = i; - - /* If we are recursing, store the pattern that matched - FILENAME in FILE->name for use in upper levels. */ - - if (recursions > 0) - /* Kludge-o-matic */ - file->name = rule->targets[matches[foundrule]]; - - /* FOUND_FILES lists the dependencies for the rule we found. - This includes the intermediate files, if any. - Convert them into entries on the deps-chain of FILE. */ - - while (deps_found-- > 0) - { - register char *s; - - if (intermediate_files[deps_found] != 0) - { - /* If we need to use an intermediate file, - make sure it is entered as a target, with the info that was - found for it in the recursive pattern_search call. - We know that the intermediate file did not already exist as - a target; therefore we can assume that the deps and cmds - of F below are null before we change them. */ - - struct file *imf = intermediate_files[deps_found]; - register struct file *f = enter_file (imf->name); - f->deps = imf->deps; - f->cmds = imf->cmds; - f->stem = imf->stem; - imf = lookup_file (intermediate_patterns[deps_found]); - if (imf != 0 && imf->precious) - f->precious = 1; - f->intermediate = 1; - f->tried_implicit = 1; - for (dep = f->deps; dep != 0; dep = dep->next) - { - dep->file = enter_file (dep->name); - dep->name = 0; - dep->file->tried_implicit |= dep->changed; - } - num_intermediates++; - } - - dep = (struct dep *) xmalloc (sizeof (struct dep)); - s = found_files[deps_found]; - if (recursions == 0) - { - dep->name = 0; - dep->file = lookup_file (s); - if (dep->file == 0) - /* enter_file consumes S's storage. */ - dep->file = enter_file (s); - else - /* A copy of S is already allocated in DEP->file->name. - So we can free S. */ - free (s); - } - else - { - dep->name = s; - dep->file = 0; - dep->changed = 0; - } - if (intermediate_files[deps_found] == 0 && tryrules[foundrule]->terminal) - { - /* If the file actually existed (was not an intermediate file), - and the rule that found it was a terminal one, then we want - to mark the found file so that it will not have implicit rule - search done for it. If we are not entering a `struct file' for - it now, we indicate this with the `changed' flag. */ - if (dep->file == 0) - dep->changed = 1; - else - dep->file->tried_implicit = 1; - } - dep->next = file->deps; - file->deps = dep; - } - - if (!checked_lastslash[foundrule]) - /* Always allocate new storage, since STEM might be - on the stack for an intermediate file. */ - file->stem = savestring (stem, stemlen); - else - { - /* We want to prepend the directory from - the original FILENAME onto the stem. */ - file->stem = (char *) xmalloc (((lastslash + 1) - filename) - + stemlen + 1); - bcopy (filename, file->stem, (lastslash + 1) - filename); - bcopy (stem, file->stem + ((lastslash + 1) - filename), stemlen); - file->stem[((lastslash + 1) - filename) + stemlen] = '\0'; - } - - file->cmds = rule->cmds; - - /* Put the targets other than the one that - matched into FILE's `also_make' member. */ - - /* If there was only one target, there is nothing to do. */ - if (rule->targets[1] != 0) - for (i = 0; rule->targets[i] != 0; ++i) - if (i != matches[foundrule]) - { - struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); - new->name = p = (char *) xmalloc (rule->lens[i] + stemlen + 1); - bcopy (rule->targets[i], p, - rule->suffixes[i] - rule->targets[i] - 1); - p += rule->suffixes[i] - rule->targets[i] - 1; - bcopy (stem, p, stemlen); - p += stemlen; - bcopy (rule->suffixes[i], p, - rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1); - new->file = enter_file (new->name); - new->next = file->also_make; - file->also_make = new; - } - - - return 1; -} diff --git a/buildtools/windows/source/make/install-sh b/buildtools/windows/source/make/install-sh deleted file mode 100644 index 89fc9b098b8..00000000000 --- a/buildtools/windows/source/make/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#! /bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/buildtools/windows/source/make/job.c b/buildtools/windows/source/make/job.c deleted file mode 100644 index 961df615f93..00000000000 --- a/buildtools/windows/source/make/job.c +++ /dev/null @@ -1,1888 +0,0 @@ -/* Job execution and handling for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "job.h" -#include "file.h" -#include "variable.h" -#include -#if defined(NETSCAPE) -#include "direct.h" -#include -#endif - - -/* Default shell to use. */ -#if defined(NETSCAPE) -char default_shell[] = "shmsdos"; -#else -char default_shell[] = "/bin/sh"; -#endif - -#if defined(__MSDOS__) || defined(NETSCAPE) -#include -#include -static int dos_pid = 123; -static int dos_status; -static char *dos_bname; -static char *dos_bename; -static int dos_batch_file; -#endif /* MSDOS. */ - - -/* If NGROUPS_MAX == 0 then try other methods for finding a real value. */ -#if defined (NGROUPS_MAX) && NGROUPS_MAX == 0 -#undef NGROUPS_MAX -#endif /* NGROUPS_MAX == 0 */ - -#ifndef NGROUPS_MAX -#ifdef POSIX -#define GET_NGROUPS_MAX sysconf (_SC_NGROUPS_MAX) -#else /* Not POSIX. */ -#define NGROUPS_MAX NGROUPS -#endif /* POSIX. */ -#endif - -#ifdef HAVE_SYS_WAIT_H -#include -#endif - -#ifdef HAVE_WAITPID -#define WAIT_NOHANG(status) waitpid (-1, (status), WNOHANG) -#else /* Don't have waitpid. */ -#ifdef HAVE_WAIT3 -#ifndef wait3 -extern int wait3 (); -#endif -#define WAIT_NOHANG(status) wait3 ((status), WNOHANG, (struct rusage *) 0) -#endif /* Have wait3. */ -#endif /* Have waitpid. */ - -#if !defined (wait) && !defined (POSIX) -extern int wait (); -#endif - -#ifndef HAVE_UNION_WAIT - -#define WAIT_T int - -#ifndef WTERMSIG -#define WTERMSIG(x) ((x) & 0x7f) -#endif -#ifndef WCOREDUMP -#define WCOREDUMP(x) ((x) & 0x80) -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(x) (((x) >> 8) & 0xff) -#endif -#ifndef WIFSIGNALED -#define WIFSIGNALED(x) (WTERMSIG (x) != 0) -#endif -#ifndef WIFEXITED -#define WIFEXITED(x) (WTERMSIG (x) == 0) -#endif - -#else /* Have `union wait'. */ - -#define WAIT_T union wait -#ifndef WTERMSIG -#define WTERMSIG(x) ((x).w_termsig) -#endif -#ifndef WCOREDUMP -#define WCOREDUMP(x) ((x).w_coredump) -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(x) ((x).w_retcode) -#endif -#ifndef WIFSIGNALED -#define WIFSIGNALED(x) (WTERMSIG(x) != 0) -#endif -#ifndef WIFEXITED -#define WIFEXITED(x) (WTERMSIG(x) == 0) -#endif - -#endif /* Don't have `union wait'. */ - - -#ifndef HAVE_UNISTD_H -extern int dup2 (); -extern int execve (); -extern void _exit (); -extern int geteuid (), getegid (); -extern int setgid (), getgid (); -#endif - -#define getdtablesize() 256 - -#ifndef getdtablesize -#ifdef HAVE_GETDTABLESIZE -extern int getdtablesize (); -#else -#ifdef HAVE_SYSCONF_OPEN_MAX -#define getdtablesize() ((int) sysconf (_SC_OPEN_MAX)) -#else -#include -#define getdtablesize() NOFILE -#if !defined (NOFILE) && defined (NOFILES_MAX) -/* SCO 3.2 "devsys 4.2" defines NOFILES_{MIN,MAX} in lieu of NOFILE. */ -#define NOFILE NOFILES_MAX -#endif -#endif -#endif -#endif - -extern int getloadavg (); -extern int start_remote_job_p (); -extern int start_remote_job (), remote_status (); - -RETSIGTYPE child_handler (); -static void free_child (), start_job_command (); -static int load_too_high (), job_next_command (); - -/* Chain of all live (or recently deceased) children. */ - -struct child *children = 0; - -/* Number of children currently running. */ - -unsigned int job_slots_used = 0; - -/* Nonzero if the `good' standard input is in use. */ - -static int good_stdin_used = 0; - -/* Chain of children waiting to run until the load average goes down. */ - -static struct child *waiting_jobs = 0; - -/* Write an error message describing the exit status given in - EXIT_CODE, EXIT_SIG, and COREDUMP, for the target TARGET_NAME. - Append "(ignored)" if IGNORED is nonzero. */ - -static void -child_error (target_name, exit_code, exit_sig, coredump, ignored) - char *target_name; - int exit_code, exit_sig, coredump; - int ignored; -{ - if (exit_sig == 0) - error (ignored ? "[%s] Error %d (ignored)" : - "*** [%s] Error %d", - target_name, exit_code); - else - error ("*** [%s] %s%s", - target_name, strsignal (exit_sig), - coredump ? " (core dumped)" : ""); -} - -static unsigned int dead_children = 0; - -/* Notice that a child died. - reap_children should be called when convenient. */ -RETSIGTYPE -child_handler (sig) - int sig; -{ - ++dead_children; - - if (debug_flag) - printf ("Got a SIGCHLD; %d unreaped children.\n", dead_children); -} - -extern int shell_function_pid, shell_function_completed; - -/* Reap dead children, storing the returned status and the new command - state (`cs_finished') in the `file' member of the `struct child' for the - dead child, and removing the child from the chain. If BLOCK nonzero, - reap at least one child, waiting for it to die if necessary. If ERR is - nonzero, print an error message first. */ - -void -reap_children (block, err) - int block, err; -{ - WAIT_T status; - - while ((children != 0 || shell_function_pid != 0) && - (block || dead_children > 0)) - { - int remote = 0; - register int pid; - int exit_code, exit_sig, coredump; - register struct child *lastc, *c; - int child_failed; - int any_remote, any_local; - - if (err && dead_children == 0) - { - /* We might block for a while, so let the user know why. */ - fflush (stdout); - error ("*** Waiting for unfinished jobs...."); - } - - /* We have one less dead child to reap. - The test and decrement are not atomic; if it is compiled into: - register = dead_children - 1; - dead_children = register; - a SIGCHLD could come between the two instructions. - child_handler increments dead_children. - The second instruction here would lose that increment. But the - only effect of dead_children being wrong is that we might wait - longer than necessary to reap a child, and lose some parallelism; - and we might print the "Waiting for unfinished jobs" message above - when not necessary. */ - - if (dead_children != 0) - --dead_children; - - any_remote = 0; - any_local = shell_function_pid != -1; - for (c = children; c != 0; c = c->next) - { - any_remote |= c->remote; - any_local |= ! c->remote; - if (debug_flag) - printf ("Live child 0x%08lx PID %d%s\n", - (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); - } - - /* First, check for remote children. */ - if (any_remote) - pid = remote_status (&exit_code, &exit_sig, &coredump, 0); - else - pid = 0; - if (pid < 0) - { -#if !defined(__MSDOS__) && !defined(NETSCAPE) - remote_status_lose: -#endif -#ifdef EINTR - if (errno == EINTR) - continue; -#endif - pfatal_with_name ("remote_status"); - } - else if (pid == 0) - { -#if !defined(__MSDOS__) && !defined(NETSCAPE) - /* No remote children. Check for local children. */ - - if (any_local) - { -#ifdef WAIT_NOHANG - if (!block) - pid = WAIT_NOHANG (&status); - else -#endif - pid = wait (&status); - } - else - pid = 0; - - if (pid < 0) - { -#ifdef EINTR - if (errno == EINTR) - continue; -#endif - pfatal_with_name ("wait"); - } - else if (pid == 0) - { - /* No local children. */ - if (block && any_remote) - { - /* Now try a blocking wait for a remote child. */ - pid = remote_status (&exit_code, &exit_sig, &coredump, 1); - if (pid < 0) - goto remote_status_lose; - else if (pid == 0) - /* No remote children either. Finally give up. */ - break; - else - /* We got a remote child. */ - remote = 1; - } - else - break; - } - else - { - /* Chop the status word up. */ - exit_code = WEXITSTATUS (status); - exit_sig = WIFSIGNALED (status) ? WTERMSIG (status) : 0; - coredump = WCOREDUMP (status); - } -#else /* MSDOS. */ - /* Life is very different on MSDOS. */ - pid = dos_pid - 1; - status = dos_status; - exit_code = dos_status; - exit_sig = 0; - coredump = 0; -#endif /* Not MSDOS. */ - } - else - /* We got a remote child. */ - remote = 1; - - /* Check if this is the child of the `shell' function. */ - if (!remote && pid == shell_function_pid) - { - /* It is. Leave an indicator for the `shell' function. */ - if (exit_sig == 0 && exit_code == 127) - shell_function_completed = -1; - else - shell_function_completed = 1; - break; - } - - child_failed = exit_sig != 0 || exit_code != 0; - - /* Search for a child matching the deceased one. */ - lastc = 0; - for (c = children; c != 0; lastc = c, c = c->next) - if ((int)c->remote == remote && (int)c->pid == pid) - break; - - if (c == 0) - { - /* An unknown child died. */ - char buf[100]; - sprintf (buf, "Unknown%s job %d", remote ? " remote" : "", pid); - if (child_failed) - child_error (buf, exit_code, exit_sig, coredump, - ignore_errors_flag); - else - error ("%s finished.", buf); - } - else - { - if (debug_flag) - printf ("Reaping %s child 0x%08lx PID %d%s\n", - child_failed ? "losing" : "winning", - (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); - - /* If this child had the good stdin, say it is now free. */ - if (c->good_stdin) - good_stdin_used = 0; - - if (child_failed && !c->noerror && !ignore_errors_flag) - { - /* The commands failed. Write an error message, - delete non-precious targets, and abort. */ - static int delete_on_error = -1; - child_error (c->file->name, exit_code, exit_sig, coredump, 0); - c->file->update_status = 2; - if (delete_on_error == -1) - { - struct file *f = lookup_file (".DELETE_ON_ERROR"); - delete_on_error = f != 0 && f->is_target; - } - if (exit_sig != 0 || delete_on_error) - delete_child_targets (c); - } - else - { - if (child_failed) - { - /* The commands failed, but we don't care. */ - child_error (c->file->name, - exit_code, exit_sig, coredump, 1); - child_failed = 0; - } - - /* If there are more commands to run, try to start them. */ - if (job_next_command (c)) - { - if (handling_fatal_signal) - { - /* Never start new commands while we are dying. - Since there are more commands that wanted to be run, - the target was not completely remade. So we treat - this as if a command had failed. */ - c->file->update_status = 2; - } - else - { - /* Check again whether to start remotely. - Whether or not we want to changes over time. - Also, start_remote_job may need state set up - by start_remote_job_p. */ - c->remote = start_remote_job_p (); - start_job_command (c); - if (c->file->command_state == cs_running) - /* We successfully started the new command. - Loop to reap more children. */ - continue; - } - - if (c->file->update_status != 0) - /* We failed to start the commands. */ - delete_child_targets (c); - } - else - /* There are no more commands. We got through them all - without an unignored error. Now the target has been - successfully updated. */ - c->file->update_status = 0; - } - - /* When we get here, all the commands for C->file are finished - (or aborted) and C->file->update_status contains 0 or 2. But - C->file->command_state is still cs_running if all the commands - ran; notice_finish_file looks for cs_running to tell it that - it's interesting to check the file's modtime again now. */ - - if (! handling_fatal_signal) - /* Notice if the target of the commands has been changed. - This also propagates its values for command_state and - update_status to its also_make files. */ - notice_finished_file (c->file); - - if (debug_flag) - printf ("Removing child 0x%08lx PID %d%s from chain.\n", - (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); - - /* Remove the child from the chain and free it. */ - if (lastc == 0) - children = c->next; - else - lastc->next = c->next; - if (! handling_fatal_signal) /* Avoid nonreentrancy. */ - free_child (c); - - /* There is now another slot open. */ - --job_slots_used; - - /* If the job failed, and the -k flag was not given, die, - unless we are already in the process of dying. */ - if (!err && child_failed && !keep_going_flag) - die (2); - } - - /* Only block for one child. */ - block = 0; - } -} - -/* Free the storage allocated for CHILD. */ - -static void -free_child (child) - register struct child *child; -{ - if (child->command_lines != 0) - { - register unsigned int i; - for (i = 0; i < child->file->cmds->ncommand_lines; ++i) - free (child->command_lines[i]); - free ((char *) child->command_lines); - } - - if (child->environment != 0) - { - register char **ep = child->environment; - while (*ep != 0) - free (*ep++); - free ((char *) child->environment); - } - - free ((char *) child); -} - -#if defined(POSIX) -#if defined(__MSDOS__) -void -unblock_sigs (void) -{ - return; -} -#else -extern sigset_t fatal_signal_set; - -void -unblock_sigs () -{ - sigset_t empty; - sigemptyset (&empty); - sigprocmask (SIG_SETMASK, &empty, (sigset_t *) 0); -} -#endif -#endif - -#ifdef NETSCAPE -/* - * The various spawn functions in Microsoft's runtime library - * may fail if the Path environment variable contains nonexistent - * directories. The spawn functions expect to get ENOENT in - * this situation, but on some Compaq PCs I've seen EACCES - * ("Permission denied") being returned. So I wrote our own - * process-spawning function ns_spawn(). My code is inspired - * by Microsoft's implementation of spawnvpe(). - */ - -/* - * Assemble the command line by concatenating the argv array. - * On success, this function returns 0 and the resulting command - * line is returned in *cmdLine. On failure, it returns -1. - */ -static int assembleCmdLine(char **argv, char **cmdLine) -{ - char **arg; - char *p, *q; - int cmdLineSize; - int numBackslashes; - int i; - int argNeedQuotes; - - /* - * Find out how large the command line buffer should be. - */ - cmdLineSize = 0; - for (arg = argv; *arg; arg++) { - /* - * \ and " need to be escaped by a \. In the worst case, - * every character is a \ or ", so the string of length - * may double. If we quote an argument, that needs two ". - * Finally, we need a space between arguments, and - * a null byte at the end of command line. - */ - cmdLineSize += 2 * strlen(*arg) /* \ and " need to be escaped */ - + 2 /* we quote every argument */ - + 1; /* space in between, or final null */ - } - p = *cmdLine = malloc(cmdLineSize); - if (p == NULL) { - return -1; - } - - for (arg = argv; *arg; arg++) { - /* Add a space to separates the arguments */ - if (arg != argv) { - *p++ = ' '; - } - q = *arg; - numBackslashes = 0; - argNeedQuotes = 0; - - /* If the argument contains white space, it needs to be quoted. */ - if (strpbrk(*arg, " \f\n\r\t\v")) { - argNeedQuotes = 1; - } - - if (argNeedQuotes) { - *p++ = '"'; - } - while (*q) { - if (*q == '\\') { - numBackslashes++; - q++; - } else if (*q == '"') { - if (numBackslashes) { - /* - * Double the backslashes since they are followed - * by a quote - */ - for (i = 0; i < 2 * numBackslashes; i++) { - *p++ = '\\'; - } - numBackslashes = 0; - } - /* To escape the quote */ - *p++ = '\\'; - *p++ = *q++; - } else { - if (numBackslashes) { - /* - * Backslashes are not followed by a quote, so - * don't need to double the backslashes. - */ - for (i = 0; i < numBackslashes; i++) { - *p++ = '\\'; - } - numBackslashes = 0; - } - *p++ = *q++; - } - } - - /* Now we are at the end of this argument */ - if (numBackslashes) { - /* - * Double the backslashes if we have a quote string - * delimiter at the end. - */ - if (argNeedQuotes) { - numBackslashes *= 2; - } - for (i = 0; i < numBackslashes; i++) { - *p++ = '\\'; - } - } - if (argNeedQuotes) { - *p++ = '"'; - } - } - - *p = '\0'; - return 0; -} - -/* - * Assemble the environment block by concatenating the envp array - * (preserving the terminating null byte in each array element) - * and adding a null byte at the end. - * - * Returns 0 on success. The resulting environment block is returned - * in *envBlock. Note that if envp is NULL, a NULL pointer is returned - * in *envBlock. Returns -1 on failure. - */ -static int assembleEnvBlock(char **envp, char **envBlock) -{ - char *p; - char *q; - char **env; - char *curEnv; - char *cwdStart, *cwdEnd; - int envBlockSize; - - if (envp == NULL) { - *envBlock = NULL; - return 0; - } - - curEnv = GetEnvironmentStrings(); - - cwdStart = curEnv; - while (*cwdStart) { - if (cwdStart[0] == '=' && cwdStart[1] != '\0' - && cwdStart[2] == ':' && cwdStart[3] == '=') { - break; - } - cwdStart += strlen(cwdStart) + 1; - } - cwdEnd = cwdStart; - if (*cwdEnd) { - cwdEnd += strlen(cwdEnd) + 1; - while (*cwdEnd) { - if (cwdEnd[0] != '=' || cwdEnd[1] == '\0' - || cwdEnd[2] != ':' || cwdEnd[3] != '=') { - break; - } - cwdEnd += strlen(cwdEnd) + 1; - } - } - envBlockSize = cwdEnd - cwdStart; - - for (env = envp; *env; env++) { - envBlockSize += strlen(*env) + 1; - } - envBlockSize++; - - p = *envBlock = malloc(envBlockSize); - if (p == NULL) { - FreeEnvironmentStrings(curEnv); - return -1; - } - - q = cwdStart; - while (q < cwdEnd) { - *p++ = *q++; - } - FreeEnvironmentStrings(curEnv); - - for (env = envp; *env; env++) { - q = *env; - while (*q) { - *p++ = *q++; - } - *p++ = '\0'; - } - *p = '\0'; - return 0; -} - -/* - * For qsort. We sort (case-insensitive) the environment strings - * before generating the environment block. - */ -static int compare(const void *arg1, const void *arg2) -{ - return _stricmp(* (char**)arg1, * (char**)arg2); -} - -/* - * Spawn a new process with arguments argv and environment envp, - * wait until it terminates, and return its exit code in *exitCode. - * Return 0 on success. Return -1 on error. Call GetLastError() - * (note: not errno) to get the error code. - */ -int ns_spawn(char **argv, char **envp, int *exitCode) -{ - char *p; - char *cmdLine; - char *envBlock; - char **newEnvp; - BOOL rv; - STARTUPINFO si; - PROCESS_INFORMATION pi; - - /* - * Before invoking the command, change forward slashes - * in argv[0] to backslashes. - */ - for (p = argv[0]; *p; p++) { - if (*p == '/') { - *p = '\\'; - } - } - - if (assembleCmdLine(argv, &cmdLine) == -1) { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return -1; - } - - if (envp == NULL) { - newEnvp = NULL; - } else { - int i; - int numEnv = 0; - while (envp[numEnv]) { - numEnv++; - } - newEnvp = (char **) malloc((numEnv+1) * sizeof(char *)); - for (i = 0; i <= numEnv; i++) { - newEnvp[i] = envp[i]; - } - qsort((void *) newEnvp, (size_t) numEnv, sizeof(char *), compare); - } - if (assembleEnvBlock(newEnvp, &envBlock) == -1) { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - free(cmdLine); - return -1; - } - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - - rv = CreateProcess( - NULL, - cmdLine, - NULL, - NULL, - TRUE, - 0, - envBlock, - NULL, - &si, - &pi); - free(cmdLine); - free(envBlock); - if (!rv) { - return -1; - } - CloseHandle(pi.hThread); - WaitForSingleObject(pi.hProcess, INFINITE); - if (exitCode) { - GetExitCodeProcess(pi.hProcess, exitCode); - } - CloseHandle(pi.hProcess); - return 0; -} -#endif /* NETSCAPE */ - -/* Start a job to run the commands specified in CHILD. - CHILD is updated to reflect the commands and ID of the child process. */ - -static void -start_job_command (child) - register struct child *child; -{ -#ifndef NETSCAPE - static int bad_stdin = -1; -#endif - register char *p; - int flags; - char **argv; - - /* Combine the flags parsed for the line itself with - the flags specified globally for this target. */ - flags = (child->file->command_flags - | child->file->cmds->lines_flags[child->command_line - 1]); - - p = child->command_ptr; - child->noerror = flags & COMMANDS_NOERROR; - while (*p != '\0') - { - if (*p == '@') - flags |= COMMANDS_SILENT; - else if (*p == '+') - flags |= COMMANDS_RECURSE; - else if (*p == '-') - child->noerror = 1; - else if (!isblank (*p) && *p != '+') - break; - ++p; - } - - /* If -q was given, just say that updating `failed'. The exit status of - 1 tells the user that -q is saying `something to do'; the exit status - for a random error is 2. */ - if (question_flag && !(flags & COMMANDS_RECURSE)) - { - child->file->update_status = 1; - notice_finished_file (child->file); - return; - } - - /* There may be some preceding whitespace left if there - was nothing but a backslash on the first line. */ - p = next_token (p); - - /* Figure out an argument list from this command line. */ - - { - char *end; - argv = construct_command_argv (p, &end, child->file); - if (end == NULL) - child->command_ptr = NULL; - else - { - *end++ = '\0'; - child->command_ptr = end; - } - } - - if (touch_flag && !(flags & COMMANDS_RECURSE)) - { - /* Go on to the next command. It might be the recursive one. - We construct ARGV only to find the end of the command line. */ - free (argv[0]); - free ((char *) argv); - argv = 0; - } - - if (argv == 0) - { - next_command: - /* This line has no commands. Go to the next. */ - if (job_next_command (child)) - start_job_command (child); - else - { - /* No more commands. All done. */ - child->file->update_status = 0; - notice_finished_file (child->file); - } - return; - } - - /* Print out the command. */ - - if (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag)) - puts (p); - - /* Tell update_goal_chain that a command has been started on behalf of - this target. It is important that this happens here and not in - reap_children (where we used to do it), because reap_children might be - reaping children from a different target. We want this increment to - guaranteedly indicate that a command was started for the dependency - chain (i.e., update_file recursion chain) we are processing. */ - - ++commands_started; - - /* If -n was given, recurse to get the next line in the sequence. */ - - if (just_print_flag && !(flags & COMMANDS_RECURSE)) - { - free (argv[0]); - free ((char *) argv); - goto next_command; - } - - /* Flush the output streams so they won't have things written twice. */ - - fflush (stdout); - fflush (stderr); - -#ifndef NETSCAPE - /* Set up a bad standard input that reads from a broken pipe. */ - - if (bad_stdin == -1) - { - /* Make a file descriptor that is the read end of a broken pipe. - This will be used for some children's standard inputs. */ - int pd[2]; - if (pipe (pd) == 0) - { - /* Close the write side. */ - (void) close (pd[1]); - /* Save the read side. */ - bad_stdin = pd[0]; - } - } -#endif - - /* Decide whether to give this child the `good' standard input - (one that points to the terminal or whatever), or the `bad' one - that points to the read side of a broken pipe. */ - - child->good_stdin = !good_stdin_used; - if (child->good_stdin) - good_stdin_used = 1; - - child->deleted = 0; - - /* Set up the environment for the child. */ - if (child->environment == 0) - child->environment = target_environment (child->file); - -#if !defined(__MSDOS__) && !defined(NETSCAPE) - - /* start_waiting_job has set CHILD->remote if we can start a remote job. */ - if (child->remote) - { - int is_remote, id, used_stdin; - if (start_remote_job (argv, child->environment, - child->good_stdin ? 0 : bad_stdin, - &is_remote, &id, &used_stdin)) - goto error; - else - { - if (child->good_stdin && !used_stdin) - { - child->good_stdin = 0; - good_stdin_used = 0; - } - child->remote = is_remote; - child->pid = id; - } - } - else - { - /* Fork the child process. */ - - char **parent_environ; - -#ifdef POSIX - (void) sigprocmask (SIG_BLOCK, &fatal_signal_set, (sigset_t *) 0); -#else -#ifdef HAVE_SIGSETMASK - (void) sigblock (fatal_signal_mask); -#endif -#endif - - child->remote = 0; - parent_environ = environ; - child->pid = vfork (); - environ = parent_environ; /* Restore value child may have clobbered. */ - if (child->pid == 0) - { - /* We are the child side. */ - unblock_sigs (); - child_execute_job (child->good_stdin ? 0 : bad_stdin, 1, - argv, child->environment); - } - else if (child->pid < 0) - { - /* Fork failed! */ - unblock_sigs (); - perror_with_name ("vfork", ""); - goto error; - } - } - -#else /* MSDOS. */ -#ifdef NETSCAPE - if (ns_spawn (argv, child->environment, &dos_status) == -1) - { - char errMsg[128]; - FormatMessage ( - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError (), - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), /* default language */ - errMsg, - sizeof (errMsg), - NULL - ); - error ("%s: %s", argv[0], errMsg); - dos_status = -1; - } -#else - dos_status = spawnvpe (P_WAIT, argv[0], argv, child->environment); -#endif - ++dead_children; - child->pid = dos_pid++; - if (dos_batch_file) - { - dos_batch_file = 0; - remove (dos_bname); /* Ignore errors. */ - if (access (dos_bename, 0)) - dos_status = 1; - else - dos_status = 0; - remove (dos_bename); - } -#endif /* Not MSDOS. */ - - /* We are the parent side. Set the state to - say the commands are running and return. */ - - set_command_state (child->file, cs_running); - - /* Free the storage used by the child's argument list. */ - - free (argv[0]); - free ((char *) argv); - - return; - -#if !defined(__MSDOS__) && !defined(NETSCAPE) - error: - child->file->update_status = 2; - notice_finished_file (child->file); -#endif -} - -/* Try to start a child running. - Returns nonzero if the child was started (and maybe finished), or zero if - the load was too high and the child was put on the `waiting_jobs' chain. */ - -static int -start_waiting_job (c) - struct child *c; -{ - /* If we can start a job remotely, we always want to, and don't care about - the local load average. We record that the job should be started - remotely in C->remote for start_job_command to test. */ - - c->remote = start_remote_job_p (); - - /* If this job is to be started locally, and we are already running - some jobs, make this one wait if the load average is too high. */ - if (!c->remote && job_slots_used > 0 && load_too_high ()) - { - /* Put this child on the chain of children waiting - for the load average to go down. */ - set_command_state (c->file, cs_running); - c->next = waiting_jobs; - waiting_jobs = c; - return 0; - } - - /* Start the first command; reap_children will run later command lines. */ - start_job_command (c); - - switch (c->file->command_state) - { - case cs_running: - c->next = children; - if (debug_flag) - printf ("Putting child 0x%08lx PID %05d%s on the chain.\n", - (unsigned long int) c, - c->pid, c->remote ? " (remote)" : ""); - children = c; - /* One more job slot is in use. */ - ++job_slots_used; - unblock_sigs (); - break; - - case cs_not_started: - /* All the command lines turned out to be empty. */ - c->file->update_status = 0; - /* FALLTHROUGH */ - - case cs_finished: - notice_finished_file (c->file); - free_child (c); - break; - - default: - assert (c->file->command_state == cs_finished); - break; - } - - return 1; -} - -/* Create a `struct child' for FILE and start its commands running. */ - -void -new_job (file) - register struct file *file; -{ - register struct commands *cmds = file->cmds; - register struct child *c; - char **lines; - register unsigned int i; - - /* Let any previously decided-upon jobs that are waiting - for the load to go down start before this new one. */ - start_waiting_jobs (); - - /* Reap any children that might have finished recently. */ - reap_children (0, 0); - - /* Chop the commands up into lines if they aren't already. */ - chop_commands (cmds); - - if (job_slots != 0) - /* Wait for a job slot to be freed up. */ - while (job_slots_used == job_slots) - reap_children (1, 0); - - /* Expand the command lines and store the results in LINES. */ - lines = (char **) xmalloc (cmds->ncommand_lines * sizeof (char *)); - for (i = 0; i < cmds->ncommand_lines; ++i) - { - /* Collapse backslash-newline combinations that are inside variable - or function references. These are left alone by the parser so - that they will appear in the echoing of commands (where they look - nice); and collapsed by construct_command_argv when it tokenizes. - But letting them survive inside function invocations loses because - we don't want the functions to see them as part of the text. */ - - char *in, *out, *ref; - - /* IN points to where in the line we are scanning. - OUT points to where in the line we are writing. - When we collapse a backslash-newline combination, - IN gets ahead out OUT. */ - - in = out = cmds->command_lines[i]; - while ((ref = index (in, '$')) != 0) - { - ++ref; /* Move past the $. */ - - if (out != in) - /* Copy the text between the end of the last chunk - we processed (where IN points) and the new chunk - we are about to process (where REF points). */ - bcopy (in, out, ref - in); - - /* Move both pointers past the boring stuff. */ - out += ref - in; - in = ref; - - if (*ref == '(' || *ref == '{') - { - char openparen = *ref; - char closeparen = openparen == '(' ? ')' : '}'; - int count; - char *p; - - *out++ = *in++; /* Copy OPENPAREN. */ - /* IN now points past the opening paren or brace. - Count parens or braces until it is matched. */ - count = 0; - while (*in != '\0') - { - if (*in == closeparen && --count < 0) - break; - else if (*in == '\\' && in[1] == '\n') - { - /* We have found a backslash-newline inside a - variable or function reference. Eat it and - any following whitespace. */ - - int quoted = 0; - for (p = in - 1; p > ref && *p == '\\'; --p) - quoted = !quoted; - - if (quoted) - /* There were two or more backslashes, so this is - not really a continuation line. We don't collapse - the quoting backslashes here as is done in - collapse_continuations, because the line will - be collapsed again after expansion. */ - *out++ = *in++; - else - { - /* Skip the backslash, newline and - any following whitespace. */ - in = next_token (in + 2); - - /* Discard any preceding whitespace that has - already been written to the output. */ - while (out > ref && isblank (out[-1])) - --out; - - /* Replace it all with a single space. */ - *out++ = ' '; - } - } - else - { - if (*in == openparen) - ++count; - - *out++ = *in++; - } - } - } - } - - /* There are no more references in this line to worry about. - Copy the remaining uninteresting text to the output. */ - if (out != in) - strcpy (out, in); - - /* Finally, expand the line. */ - lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i], - file); - } - - /* Start the command sequence, record it in a new - `struct child', and add that to the chain. */ - - c = (struct child *) xmalloc (sizeof (struct child)); - c->file = file; - c->command_lines = lines; - c->command_line = 0; - c->command_ptr = 0; - c->environment = 0; - - /* Fetch the first command line to be run. */ - job_next_command (c); - - /* The job is now primed. Start it running. - (This will notice if there are in fact no commands.) */ - start_waiting_job (c); - - if (job_slots == 1) - /* Since there is only one job slot, make things run linearly. - Wait for the child to die, setting the state to `cs_finished'. */ - while (file->command_state == cs_running) - reap_children (1, 0); -} - -/* Move CHILD's pointers to the next command for it to execute. - Returns nonzero if there is another command. */ - -static int -job_next_command (child) - struct child *child; -{ - while (child->command_ptr == 0 || *child->command_ptr == '\0') - { - /* There are no more lines in the expansion of this line. */ - if (child->command_line == child->file->cmds->ncommand_lines) - { - /* There are no more lines to be expanded. */ - child->command_ptr = 0; - return 0; - } - else - /* Get the next line to run. */ - child->command_ptr = child->command_lines[child->command_line++]; - } - return 1; -} - -static int -load_too_high () -{ -#ifdef __MSDOS__ - return 1; -#else - extern int getloadavg (); - double load; - - if (max_load_average < 0) - return 0; - - make_access (); - if (getloadavg (&load, 1) != 1) - { - static int lossage = -1; - /* Complain only once for the same error. */ - if (lossage == -1 || errno != lossage) - { - if (errno == 0) - /* An errno value of zero means getloadavg is just unsupported. */ - error ("cannot enforce load limits on this operating system"); - else - perror_with_name ("cannot enforce load limit: ", "getloadavg"); - } - lossage = errno; - load = 0; - } - user_access (); - - return load >= max_load_average; -#endif -} - -/* Start jobs that are waiting for the load to be lower. */ - -void -start_waiting_jobs () -{ - struct child *job; - - if (waiting_jobs == 0) - return; - - do - { - /* Check for recently deceased descendants. */ - reap_children (0, 0); - - /* Take a job off the waiting list. */ - job = waiting_jobs; - waiting_jobs = job->next; - - /* Try to start that job. We break out of the loop as soon - as start_waiting_job puts one back on the waiting list. */ - } while (start_waiting_job (job) && waiting_jobs != 0); -} - -/* Replace the current process with one executing the command in ARGV. - STDIN_FD and STDOUT_FD are used as the process's stdin and stdout; ENVP is - the environment of the new program. This function does not return. */ - -void -child_execute_job (stdin_fd, stdout_fd, argv, envp) - int stdin_fd, stdout_fd; - char **argv, **envp; -{ - if (stdin_fd != 0) - (void) dup2 (stdin_fd, 0); - if (stdout_fd != 1) - (void) dup2 (stdout_fd, 1); - - /* Free up file descriptors. */ - { - register int d; - int max = getdtablesize (); - for (d = 3; d < max; ++d) - (void) close (d); - } - - /* Run the command. */ - exec_command (argv, envp); -} - -/* Replace the current process with one running the command in ARGV, - with environment ENVP. This function does not return. */ - -void -exec_command (argv, envp) - char **argv, **envp; -{ - /* Be the user, permanently. */ - child_access (); - - /* Run the program. */ - environ = envp; - execvp (argv[0], argv); - - switch (errno) - { - case ENOENT: - error ("%s: Command not found", argv[0]); - break; - case ENOEXEC: - { - /* The file is not executable. Try it as a shell script. */ - extern char *getenv (); - char *shell; - char **new_argv; - int argc; - - shell = getenv ("SHELL"); - if (shell == 0) - shell = default_shell; - - argc = 1; - while (argv[argc] != 0) - ++argc; - - new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *)); - new_argv[0] = shell; - new_argv[1] = program; - while (argc > 0) - { - new_argv[1 + argc] = argv[argc]; - --argc; - } - - execvp (shell, new_argv); - if (errno == ENOENT) - error ("%s: Shell program not found", shell); - else - perror_with_name ("execvp: ", shell); - break; - } - - default: - perror_with_name ("execvp: ", argv[0]); - break; - } - - _exit (127); -} - -/* Figure out the argument list necessary to run LINE as a command. Try to - avoid using a shell. This routine handles only ' quoting, and " quoting - when no backslash, $ or ` characters are seen in the quotes. Starting - quotes may be escaped with a backslash. If any of the characters in - sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[] - is the first word of a line, the shell is used. - - If RESTP is not NULL, *RESTP is set to point to the first newline in LINE. - If *RESTP is NULL, newlines will be ignored. - - SHELL is the shell to use, or nil to use the default shell. - IFS is the value of $IFS, or nil (meaning the default). */ - -#ifdef __MSDOS__ - static char sh_chars[] = "\"|<>"; - static char *sh_cmds[] = { "break", "call", "cd", "chcp", "chdir", "cls", - "copy", "ctty", "date", "del", "dir", "echo", - "erase", "exit", "for", "goto", "if", "if", "md", - "mkdir", "path", "pause", "prompt", "rem", "ren", - "rename", "set", "shift", "time", "type", - "ver", "verify", "vol", ":", 0 }; -#elif defined(NETSCAPE) - #define SH_CMD_CD 0 - #define SH_CMD_EVAL 1 - #define SH_CMD_EXEC 2 - #define SH_CMD_EXIT 3 - #define SH_CMD_LOGIN 4 - #define SH_CMD_LOGOUT 5 - #define SH_CMD_SET 6 - #define SH_CMD_UMASK 7 - #define SH_CMD_WAIT 8 - #define SH_CMD_WHILE 9 - #define SH_CMD_FOR 10 - #define SH_CMD_CASE 11 - #define SH_CMD_IF 12 - #define SH_CMD_COLON 13 - #define SH_CMD_PERIOD 14 - #define SH_CMD_BREAK 15 - #define SH_CMD_CONTINUE 16 - #define SH_CMD_EXPORT 17 - #define SH_CMD_READ 18 - #define SH_CMD_READONLY 19 - #define SH_CMD_SHIFT 20 - #define SH_CMD_TIMES 21 - #define SH_CMD_TRAP 22 - #define SH_CMD_SWITCH 23 - #define SH_CMD_MKDIR 24 - #define SH_CMD_ECHO 25 - #define SH_CMD_CP 26 - #define SH_CMD_RM 27 - #define SH_CMD_TOUCH 28 - #define SH_CMD_NSINSTALL 29 - #define SH_CMD_TEST 30 - #define SH_CMD_MV 31 - - static char sh_chars[] = "#;\"*?[]&|<>(){}$`^"; -// static char sh_chars[] = "#;*?[]&|<>(){}$`^"; -// static char sh_chars[] = ""; - //static char *sh_cmds[] = { "cd", "mkdir", "echo", "cp", "uname", "touch", 0 }; - static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login", - "logout", "set", "umask", "wait", "while", "for", - "case", "if", ":", ".", "break", "continue", - "export", "read", "readonly", "shift", "times", - "trap", "switch", "mkdir", "echo", "cp", "rm", - "touch", "nsinstall", "test", "mv", 0 }; -#else - static char sh_chars[] = "#;\"*?[]&|<>(){}$`^"; - static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login", - "logout", "set", "umask", "wait", "while", "for", - "case", "if", ":", ".", "break", "continue", - "export", "read", "readonly", "shift", "times", - "trap", "switch", 0 }; -#endif - -static char ** -construct_command_argv_internal (line, restp, shell, ifs) - char *line, **restp; - char *shell, *ifs; -{ - register int i; - register char *p; - register char *ap; - char *end; - int instring, word_has_equals, seen_nonequals; - char **new_argv = 0; - - if (restp != NULL) - *restp = NULL; - - /* Make sure not to bother processing an empty line. */ - while (isblank (*line)) - ++line; - if (*line == '\0') - return 0; - - /* See if it is safe to parse commands internally. */ - if (shell == 0) - shell = default_shell; - else if (strcmp (shell, default_shell)) - goto slow; - - if (ifs != 0) - for (ap = ifs; *ap != '\0'; ++ap) - if (*ap != ' ' && *ap != '\t' && *ap != '\n') - goto slow; - - i = strlen (line) + 1; - - /* More than 1 arg per character is impossible. */ - new_argv = (char **) xmalloc (i * sizeof (char *)); - - /* All the args can fit in a buffer as big as LINE is. */ - ap = new_argv[0] = (char *) xmalloc (i); - end = ap + i; - - /* I is how many complete arguments have been found. */ - i = 0; - instring = word_has_equals = seen_nonequals = 0; - for (p = line; *p != '\0'; ++p) - { - if (ap > end) - abort (); - - if (instring) - { - string_char: - /* Inside a string, just copy any char except a closing quote - or a backslash-newline combination. */ - if (*p == instring) - instring = 0; - else if (*p == '\\' && p[1] == '\n') - goto swallow_escaped_newline; - else if (*p == '\n' && restp != NULL) - { - /* End of the command line. */ - *restp = p; - goto end_of_line; - } - /* Backslash, $, and ` are special inside double quotes. - If we see any of those, punt. */ - else if (instring == '"' && index ("\\$`", *p) != 0) - goto slow; - else - *ap++ = *p; - } - else if (index (sh_chars, *p) != 0) - /* Not inside a string, but it's a special char. */ - goto slow; - else - /* Not a special char. */ - switch (*p) - { - case '=': - /* Equals is a special character in leading words before the - first word with no equals sign in it. This is not the case - with sh -k, but we never get here when using nonstandard - shell flags. */ - if (! seen_nonequals) - goto slow; - word_has_equals = 1; - *ap++ = '='; - break; - - case '\\': - /* Backslash-newline combinations are eaten. */ - if (p[1] == '\n') - { - swallow_escaped_newline: - - /* Eat the backslash, the newline, and following whitespace, - replacing it all with a single space. */ - p += 2; - - /* If there is a tab after a backslash-newline, - remove it from the source line which will be echoed, - since it was most likely used to line - up the continued line with the previous one. */ - if (*p == '\t') - strcpy (p, p + 1); - - if (instring) - goto string_char; - else - { - if (ap != new_argv[i]) - /* Treat this as a space, ending the arg. - But if it's at the beginning of the arg, it should - just get eaten, rather than becoming an empty arg. */ - goto end_of_arg; - else - p = next_token (p) - 1; - } - } - else if (p[1] != '\0') - /* Copy and skip the following char. */ - *ap++ = *++p; - break; - - case '\'': - case '"': - instring = *p; - break; - - case '\n': - if (restp != NULL) - { - /* End of the command line. */ - *restp = p; - goto end_of_line; - } - else - /* Newlines are not special. */ - *ap++ = '\n'; - break; - - case ' ': - case '\t': - end_of_arg: - /* We have the end of an argument. - Terminate the text of the argument. */ - *ap++ = '\0'; - new_argv[++i] = ap; - - /* Update SEEN_NONEQUALS, which tells us if every word - heretofore has contained an `='. */ - seen_nonequals |= ! word_has_equals; - if (word_has_equals && ! seen_nonequals) - /* An `=' in a word before the first - word without one is magical. */ - goto slow; - word_has_equals = 0; /* Prepare for the next word. */ - - /* If this argument is the command name, - see if it is a built-in shell command. - If so, have the shell handle it. */ - if (i == 1) - { - register int j; - for (j = 0; sh_cmds[j] != 0; ++j) - if (streq (sh_cmds[j], new_argv[0])) - goto slow; - } - - /* Ignore multiple whitespace chars. */ - p = next_token (p); - /* Next iteration should examine the first nonwhite char. */ - --p; - break; - - default: - *ap++ = *p; - break; - } - } - end_of_line: - - if (instring) - /* Let the shell deal with an unterminated quote. */ - goto slow; - - /* Terminate the last argument and the argument list. */ - - *ap = '\0'; - if (new_argv[i][0] != '\0') - ++i; - new_argv[i] = 0; - - if (i == 1) - { - register int j; - for (j = 0; sh_cmds[j] != 0; ++j) - if (streq (sh_cmds[j], new_argv[0])) - goto slow; - } - - if (new_argv[0] == 0) - /* Line was empty. */ - return 0; - else - return new_argv; - - slow:; -// return new_argv; - - /* We must use the shell. */ - - if (new_argv != 0) - { - /* Free the old argument list we were working on. */ - free (new_argv[0]); - free (new_argv); - } - -#if defined(__MSDOS__) - { - FILE *batch; - dos_batch_file = 1; - if (dos_bname == 0) - { - dos_bname = tempnam (".", "mk"); - for (i = 0; dos_bname[i] != '\0'; ++i) - if (dos_bname[i] == '/') - dos_bname[i] = '\\'; - dos_bename = (char *) xmalloc (strlen (dos_bname) + 5); - strcpy (dos_bename, dos_bname); - strcat (dos_bname, ".bat"); - strcat (dos_bename, ".err"); - } - batch = fopen (dos_bename, "w"); /* Create a file. */ - if (batch != NULL) - fclose (batch); - batch = fopen (dos_bname, "w"); - fputs ("@echo off\n", batch); - fputs (line, batch); - fprintf (batch, "\nif errorlevel 1 del %s\n", dos_bename); - fclose (batch); - new_argv = (char **) xmalloc(2 * sizeof(char *)); - new_argv[0] = strdup (dos_bname); - new_argv[1] = 0; - } -#else /* Not MSDOS. */ - { - /* SHELL may be a multi-word command. Construct a command line - "SHELL -c LINE", with all special chars in LINE escaped. - Then recurse, expanding this command line to get the final - argument list. */ - - unsigned int shell_len = strlen (shell); - static char minus_c[] = " -c "; - unsigned int line_len = strlen (line); - - char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1) - + (line_len * 2) + 1); - - ap = new_line; - bcopy (shell, ap, shell_len); - ap += shell_len; - bcopy (minus_c, ap, sizeof (minus_c) - 1); - ap += sizeof (minus_c) - 1; - for (p = line; *p != '\0'; ++p) - { - if (restp != NULL && *p == '\n') - { - *restp = p; - break; - } - else if (*p == '\\' && p[1] == '\n') - { - /* Eat the backslash, the newline, and following whitespace, - replacing it all with a single space (which is escaped - from the shell). */ - p += 2; - - /* If there is a tab after a backslash-newline, - remove it from the source line which will be echoed, - since it was most likely used to line - up the continued line with the previous one. */ - if (*p == '\t') - strcpy (p, p + 1); - - p = next_token (p); - --p; - *ap++ = '\\'; - *ap++ = ' '; - continue; - } - - if (*p == '\\' || *p == '\'' || *p == '"' - || isspace (*p) - || index (sh_chars, *p) != 0) - *ap++ = '\\'; - *ap++ = *p; - } - *ap = '\0'; - - new_argv = construct_command_argv_internal (new_line, (char **) NULL, - (char *) 0, (char *) 0); - } -#endif /* MSDOS. */ - - return new_argv; -} - -/* Figure out the argument list necessary to run LINE as a command. Try to - avoid using a shell. This routine handles only ' quoting, and " quoting - when no backslash, $ or ` characters are seen in the quotes. Starting - quotes may be escaped with a backslash. If any of the characters in - sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[] - is the first word of a line, the shell is used. - - If RESTP is not NULL, *RESTP is set to point to the first newline in LINE. - If *RESTP is NULL, newlines will be ignored. - - FILE is the target whose commands these are. It is used for - variable expansion for $(SHELL) and $(IFS). */ - -char ** -construct_command_argv (line, restp, file) - char *line, **restp; - struct file *file; -{ - char *shell, *ifs; - char **argv; - - { - /* Turn off --warn-undefined-variables while we expand SHELL and IFS. */ - int save = warn_undefined_variables_flag; - warn_undefined_variables_flag = 0; - - shell = allocated_variable_expand_for_file ("$(SHELL)", file); - ifs = allocated_variable_expand_for_file ("$(IFS)", file); - - warn_undefined_variables_flag = save; - } - - argv = construct_command_argv_internal (line, restp, shell, ifs); - - free (shell); - free (ifs); - - return argv; -} - -#ifndef HAVE_DUP2 -int -dup2 (old, new) - int old, new; -{ - int fd; - - (void) close (new); - fd = dup (old); - if (fd != new) - { - (void) close (fd); - errno = EMFILE; - return -1; - } - - return fd; -} -#endif diff --git a/buildtools/windows/source/make/job.h b/buildtools/windows/source/make/job.h deleted file mode 100644 index 79832212b1b..00000000000 --- a/buildtools/windows/source/make/job.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Definitions for managing subprocesses in GNU Make. -Copyright (C) 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Structure describing a running or dead child process. */ - -struct child - { - struct child *next; /* Link in the chain. */ - - struct file *file; /* File being remade. */ - - char **environment; /* Environment for commands. */ - - char **command_lines; /* Array of variable-expanded cmd lines. */ - unsigned int command_line; /* Index into above. */ - char *command_ptr; /* Ptr into command_lines[command_line]. */ - - pid_t pid; /* Child process's ID number. */ - unsigned int remote:1; /* Nonzero if executing remotely. */ - - unsigned int noerror:1; /* Nonzero if commands contained a `-'. */ - - unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */ - unsigned int deleted:1; /* Nonzero if targets have been deleted. */ - }; - -extern struct child *children; - -extern void new_job (); -extern void reap_children (); -extern void start_waiting_jobs (); - -extern char **construct_command_argv (); -extern void child_execute_job (); -extern void exec_command (); - -extern unsigned int job_slots_used; - -#ifdef POSIX -extern void unblock_sigs (); -#else -#ifdef HAVE_SIGSETMASK -extern int fatal_signal_mask; -#define unblock_sigs() sigsetmask (0) -#else -#define unblock_sigs() -#endif -#endif - -#ifdef NETSCAPE -extern int ns_spawn (char **argv, char **envp, int *exitCode); -#endif diff --git a/buildtools/windows/source/make/main.c b/buildtools/windows/source/make/main.c deleted file mode 100644 index 3e3ab5943a7..00000000000 --- a/buildtools/windows/source/make/main.c +++ /dev/null @@ -1,2035 +0,0 @@ -/* Argument parsing and main program of GNU Make. -Copyright (C) 1988, 89, 90, 91, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "dep.h" -#include "file.h" -#include "variable.h" -#include "job.h" -#include "getopt.h" -#include - - -extern void print_variable_data_base (); -extern void print_dir_data_base (); -extern void print_rule_data_base (); -extern void print_file_data_base (); -extern void print_vpath_data_base (); - -#ifndef HAVE_UNISTD_H -extern int chdir (); -#endif -#ifndef STDC_HEADERS -#ifndef sun /* Sun has an incorrect decl in a header. */ -extern void exit (); -#endif -extern double atof (); -#endif -extern char *mktemp (); - -static void log_working_directory (); -static void print_data_base (), print_version (); -static void decode_switches (), decode_env_switches (); -static void define_makeflags (); -static char *quote_as_word (); - -/* The structure that describes an accepted command switch. */ - -struct command_switch - { - char c; /* The switch character. */ - - enum /* Type of the value. */ - { - flag, /* Turn int flag on. */ - flag_off, /* Turn int flag off. */ - string, /* One string per switch. */ - positive_int, /* A positive integer. */ - floating, /* A floating-point number (double). */ - ignore /* Ignored. */ - } type; - - char *value_ptr; /* Pointer to the value-holding variable. */ - - unsigned int env:1; /* Can come from MAKEFLAGS. */ - unsigned int toenv:1; /* Should be put in MAKEFLAGS. */ - unsigned int no_makefile:1; /* Don't propagate when remaking makefiles. */ - - char *noarg_value; /* Pointer to value used if no argument is given. */ - char *default_value;/* Pointer to default value. */ - - char *long_name; /* Long option name. */ - char *argdesc; /* Descriptive word for argument. */ - char *description; /* Description for usage message. */ - }; - - -/* The structure used to hold the list of strings given - in command switches of a type that takes string arguments. */ - -struct stringlist - { - char **list; /* Nil-terminated list of strings. */ - unsigned int idx; /* Index into above. */ - unsigned int max; /* Number of pointers allocated. */ - }; - - -/* The recognized command switches. */ - -/* Nonzero means do not print commands to be executed (-s). */ - -int silent_flag; - -/* Nonzero means just touch the files - that would appear to need remaking (-t) */ - -int touch_flag; - -/* Nonzero means just print what commands would need to be executed, - don't actually execute them (-n). */ - -int just_print_flag; - -/* Print debugging trace info (-d). */ - -int debug_flag = 0; - -/* Environment variables override makefile definitions. */ - -int env_overrides = 0; - -/* Nonzero means ignore status codes returned by commands - executed to remake files. Just treat them all as successful (-i). */ - -int ignore_errors_flag = 0; - -/* Nonzero means don't remake anything, just print the data base - that results from reading the makefile (-p). */ - -int print_data_base_flag = 0; - -/* Nonzero means don't remake anything; just return a nonzero status - if the specified targets are not up to date (-q). */ - -int question_flag = 0; - -/* Nonzero means do not use any of the builtin rules (-r). */ - -int no_builtin_rules_flag = 0; - -/* Nonzero means keep going even if remaking some file fails (-k). */ - -int keep_going_flag; -int default_keep_going_flag = 0; - -/* Nonzero means print directory before starting and when done (-w). */ - -int print_directory_flag = 0; - -/* Nonzero means ignore print_directory_flag and never print the directory. - This is necessary because print_directory_flag is set implicitly. */ - -int inhibit_print_directory_flag = 0; - -/* Nonzero means print version information. */ - -int print_version_flag = 0; - -/* List of makefiles given with -f switches. */ - -static struct stringlist *makefiles = 0; - - -/* Number of job slots (commands that can be run at once). */ - -unsigned int job_slots = 1; -unsigned int default_job_slots = 1; - -/* Value of job_slots that means no limit. */ - -static unsigned int inf_jobs = 0; - -/* Maximum load average at which multiple jobs will be run. - Negative values mean unlimited, while zero means limit to - zero load (which could be useful to start infinite jobs remotely - but one at a time locally). */ - -double max_load_average = -1.0; -double default_load_average = -1.0; - -/* List of directories given with -C switches. */ - -static struct stringlist *directories = 0; - -/* List of include directories given with -I switches. */ - -static struct stringlist *include_directories = 0; - -/* List of files given with -o switches. */ - -static struct stringlist *old_files = 0; - -/* List of files given with -W switches. */ - -static struct stringlist *new_files = 0; - -/* If nonzero, we should just print usage and exit. */ - -static int print_usage_flag = 0; - -/* If nonzero, we should print a warning message - for each reference to an undefined variable. */ - -int warn_undefined_variables_flag; - -/* The table of command switches. */ - -static const struct command_switch switches[] = - { - { 'b', ignore, 0, 0, 0, 0, 0, 0, - 0, 0, - "Ignored for compatibility" }, - { 'C', string, (char *) &directories, 0, 0, 0, 0, 0, - "directory", "DIRECTORY", - "Change to DIRECTORY before doing anything" }, - { 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0, - "debug", 0, - "Print lots of debugging information" }, - { 'e', flag, (char *) &env_overrides, 1, 1, 0, 0, 0, - "environment-overrides", 0, - "Environment variables override makefiles" }, - { 'f', string, (char *) &makefiles, 0, 0, 0, 0, 0, - "file", "FILE", - "Read FILE as a makefile" }, - { 'h', flag, (char *) &print_usage_flag, 0, 0, 0, 0, 0, - "help", 0, - "Print this message and exit" }, - { 'i', flag, (char *) &ignore_errors_flag, 1, 1, 0, 0, 0, - "ignore-errors", 0, - "Ignore errors from commands" }, - { 'I', string, (char *) &include_directories, 1, 1, 0, 0, 0, - "include-dir", "DIRECTORY", - "Search DIRECTORY for included makefiles" }, - { 'j', positive_int, (char *) &job_slots, 1, 1, 0, - (char *) &inf_jobs, (char *) &default_job_slots, - "jobs", "N", - "Allow N jobs at once; infinite jobs with no arg" }, - { 'k', flag, (char *) &keep_going_flag, 1, 1, 0, - 0, (char *) &default_keep_going_flag, - "keep-going", 0, - "Keep going when some targets can't be made" }, - { 'l', floating, (char *) &max_load_average, 1, 1, 0, - (char *) &default_load_average, (char *) &default_load_average, - "load-average", "N", - "Don't start multiple jobs unless load is below N" }, - { 'm', ignore, 0, 0, 0, 0, 0, 0, - 0, 0, - "-b" }, - { 'n', flag, (char *) &just_print_flag, 1, 1, 1, 0, 0, - "just-print", 0, - "Don't actually run any commands; just print them" }, - { 'o', string, (char *) &old_files, 0, 0, 0, 0, 0, - "old-file", "FILE", - "Consider FILE to be very old and don't remake it" }, - { 'p', flag, (char *) &print_data_base_flag, 1, 1, 0, 0, 0, - "print-data-base", 0, - "Print make's internal database" }, - { 'q', flag, (char *) &question_flag, 1, 1, 1, 0, 0, - "question", 0, - "Run no commands; exit status says if up to date" }, - { 'r', flag, (char *) &no_builtin_rules_flag, 1, 1, 0, 0, 0, - "no-builtin-rules", 0, - "Disable the built-in implicit rules" }, - { 's', flag, (char *) &silent_flag, 1, 1, 0, 0, 0, - "silent", 0, - "Don't echo commands" }, - { 'S', flag_off, (char *) &keep_going_flag, 1, 1, 0, - 0, (char *) &default_keep_going_flag, - "no-keep-going", 0, - "Turns off -k" }, - { 't', flag, (char *) &touch_flag, 1, 1, 1, 0, 0, - "touch", 0, - "Touch targets instead of remaking them" }, - { 'v', flag, (char *) &print_version_flag, 1, 1, 0, 0, 0, - "version", 0, - "Print the version number of make and exit" }, - { 'w', flag, (char *) &print_directory_flag, 1, 1, 0, 0, 0, - "print-directory", 0, - "Print the current directory" }, - { 2, flag, (char *) &inhibit_print_directory_flag, 1, 1, 0, 0, 0, - "no-print-directory", 0, - "Turn off -w, even if it was turned on implicitly" }, - { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0, - "what-if", "FILE", - "Consider FILE to be infinitely new" }, - { 3, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0, - "warn-undefined-variables", 0, - "Warn when an undefined variable is referenced" }, - { '\0', } - }; - -/* Secondary long names for options. */ - -static struct option long_option_aliases[] = - { - { "quiet", no_argument, 0, 's' }, - { "stop", no_argument, 0, 'S' }, - { "new-file", required_argument, 0, 'W' }, - { "assume-new", required_argument, 0, 'W' }, - { "assume-old", required_argument, 0, 'o' }, - { "max-load", optional_argument, 0, 'l' }, - { "dry-run", no_argument, 0, 'n' }, - { "recon", no_argument, 0, 'n' }, - { "makefile", required_argument, 0, 'f' }, - }; - -/* The usage message prints the descriptions of options starting in - this column. Make sure it leaves enough room for the longest - description to fit in less than 80 characters. */ - -#define DESCRIPTION_COLUMN 30 - -/* List of goal targets. */ - -static struct dep *goals, *lastgoal; - -/* List of variables which were defined on the command line - (or, equivalently, in MAKEFLAGS). */ - -struct command_variable - { - struct command_variable *next; - struct variable *variable; - }; -static struct command_variable *command_variables; - -/* The name we were invoked with. */ - -char *program; - -/* Our current directory before processing any -C options. */ - -char *directory_before_chdir; - -/* Our current directory after processing all -C options. */ - -char *starting_directory; - -/* Value of the MAKELEVEL variable at startup (or 0). */ - -unsigned int makelevel; - -/* First file defined in the makefile whose name does not - start with `.'. This is the default to remake if the - command line does not specify. */ - -struct file *default_goal_file; - -/* Pointer to structure for the file .DEFAULT - whose commands are used for any file that has none of its own. - This is zero if the makefiles do not define .DEFAULT. */ - -struct file *default_file; - -/* Nonzero if we have seen the magic `.POSIX' target. - This turns on pedantic compliance with POSIX.2. */ - -int posix_pedantic; - -/* Mask of signals that are being caught with fatal_error_signal. */ - -#ifdef POSIX -sigset_t fatal_signal_set; -#else -#ifdef HAVE_SIGSETMASK -int fatal_signal_mask; -#endif -#endif - -static struct file * -enter_command_line_file (name) - char *name; -{ - if (name[0] == '~') - { - char *expanded = tilde_expand (name); - if (expanded != 0) - name = expanded; /* Memory leak; I don't care. */ - } - - /* This is also done in parse_file_seq, so this is redundant - for names read from makefiles. It is here for names passed - on the command line. */ - while (name[0] == '.' && name[1] == '/' && name[2] != '\0') - { - name += 2; - while (*name == '/') - /* Skip following slashes: ".//foo" is "foo", not "/foo". */ - ++name; - } - - if (*name == '\0') - { - /* It was all slashes! Move back to the dot and truncate - it after the first slash, so it becomes just "./". */ - do - --name; - while (name[0] != '.'); - name[2] = '\0'; - } - - return enter_file (savestring (name, strlen (name))); -} - -/* Toggle -d on receipt of SIGUSR1. */ - -static RETSIGTYPE -debug_signal_handler (sig) - int sig; -{ - debug_flag = ! debug_flag; -} - -int -main (argc, argv, envp) - int argc; - char **argv; - char **envp; -{ - extern void init_dir (); - extern RETSIGTYPE fatal_error_signal (), child_handler (); - register struct file *f; - register unsigned int i; - char **p; - struct dep *read_makefiles; - PATH_VAR (current_directory); - - default_goal_file = 0; - reading_filename = 0; - reading_lineno_ptr = 0; - -#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST) - signame_init (); -#endif - -#ifdef POSIX - sigemptyset (&fatal_signal_set); -#define ADD_SIG(sig) sigaddset (&fatal_signal_set, sig) -#else -#ifdef HAVE_SIGSETMASK - fatal_signal_mask = 0; -#define ADD_SIG(sig) fatal_signal_mask |= sigmask (sig) -#else -#define ADD_SIG(sig) -#endif -#endif - -#define FATAL_SIG(sig) \ - if (signal ((sig), fatal_error_signal) == SIG_IGN) \ - (void) signal ((sig), SIG_IGN); \ - else \ - ADD_SIG (sig); -#ifndef NETSCAPE - FATAL_SIG (SIGHUP); - FATAL_SIG (SIGQUIT); - FATAL_SIG (SIGINT); - FATAL_SIG (SIGTERM); -#endif -#ifdef SIGDANGER - FATAL_SIG (SIGDANGER); -#endif -#ifdef SIGXCPU - FATAL_SIG (SIGXCPU); -#endif -#ifdef SIGXFSZ - FATAL_SIG (SIGXFSZ); -#endif - -#undef FATAL_SIG - - /* Make sure stdout is line-buffered. */ - -#ifdef HAVE_SETLINEBUF - setlinebuf (stdout); -#else -#ifndef SETVBUF_REVERSED - setvbuf (stdout, (char *) 0, _IOLBF, BUFSIZ); -#else /* setvbuf not reversed. */ - /* Some buggy systems lose if we pass 0 instead of allocating ourselves. */ - setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ); -#endif /* setvbuf reversed. */ -#endif /* setlinebuf missing. */ - - /* Initialize the directory hashing code. */ - init_dir (); - - /* Figure out where this program lives. */ - - if (argv[0] == 0) - argv[0] = ""; - if (argv[0][0] == '\0') - program = "make"; - else - { - program = rindex (argv[0], '/'); -#if defined(__MSDOS__) || defined(NETSCAPE) - if (program == 0) - program = rindex (argv[0], '\\'); - if (program == 0) - program = rindex (argv[0], ':'); -#endif - if (program == 0) - program = argv[0]; - else - ++program; - } - - /* Set up to access user data (files). */ - user_access (); - - /* Figure out where we are. */ - - if (getcwd (current_directory, GET_PATH_MAX) == 0) - { -#ifdef HAVE_GETCWD - perror_with_name ("getcwd: ", ""); -#else - error ("getwd: %s", current_directory); -#endif - current_directory[0] = '\0'; - directory_before_chdir = 0; - } - else - directory_before_chdir = savestring (current_directory, - strlen (current_directory)); - - /* Read in variables from the environment. It is important that this be - done before $(MAKE) is are figured out so its definitions will not be - one from the environment. */ - - for (i = 0; envp[i] != 0; ++i) - { - register char *ep = envp[i]; - while (*ep != '=') - ++ep; - /* The result of pointer arithmetic is cast to unsigned int for - machines where ptrdiff_t is a different size that doesn't widen - the same. */ - define_variable (envp[i], (unsigned int) (ep - envp[i]), - ep + 1, o_env, 1) - /* Force exportation of every variable culled from the environment. - We used to rely on target_environment's v_default code to do this. - But that does not work for the case where an environment variable - is redefined in a makefile with `override'; it should then still - be exported, because it was originally in the environment. */ - ->export = v_export; - } - - /* Decode the switches. */ - - decode_env_switches ("MAKEFLAGS", 9); -#if 0 - /* People write things like: - MFLAGS="CC=gcc -pipe" "CFLAGS=-g" - and we set the -p, -i and -e switches. Doesn't seem quite right. */ - decode_env_switches ("MFLAGS", 6); -#endif - decode_switches (argc, argv, 0); - - /* Print version information. */ - - if (print_version_flag || print_data_base_flag || debug_flag) - print_version (); - - /* `make --version' is supposed to just print the version and exit. */ - if (print_version_flag) - die (0); - -#if !defined(__MSDOS__) - /* Set the "MAKE_COMMAND" variable to the name we were invoked with. - (If it is a relative pathname with a slash, prepend our directory name - so the result will run the same program regardless of the current dir. - If it is a name with no slash, we can only hope that PATH did not - find it in the current directory.) */ - -#if !defined(NETSCAPE) - - if (current_directory[0] != '\0' - && argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0) - argv[0] = concat (current_directory, "/", argv[0]); - -#else /* NETSCAPE */ - - /* - * All the comments above apply, plus the following. - * - * Windows NT seems to allow both '/' and '\' as directory separator. - * Moreover, an absolute pathname on Windows does not always start with - * a slash or backslash. It may start with a drive letter and a colon, - * followed by a slash or a backslash. We use the rule that - * if the pathname contains a colon, then it is an absolute path. - */ - - if (current_directory[0] != '\0' - && argv[0] != 0 && argv[0][0] != '/' && argv[0][0] != '\\' - && index (argv[0], '/') != 0 && index (argv[0], '\\') != 0 - && index (argv[0], ':') == 0) - argv[0] = concat (current_directory, "/", argv[0]); - -#endif /* NETSCAPE */ -#endif - -#if defined(NETSCAPE) - /* - * Before setting the "MAKE" variable, change backslashes (directory - * separators on Windows) to forward slashes, otherwise GNU Make will - * interpret backslashes as escape characters. - */ - - { - char *p; - - for (p = argv[0]; *p; p++) { - if (*p == '\\') { - *p = '/'; - } - } - } -#endif /* NETSCAPE */ - - /* The extra indirection through $(MAKE_COMMAND) is done - for hysterical raisins. */ - (void) define_variable ("MAKE_COMMAND", 12, argv[0], o_default, 0); - (void) define_variable ("MAKE", 4, "$(MAKE_COMMAND)", o_default, 1); - - if (command_variables != 0) - { - struct command_variable *cv; - struct variable *v; - unsigned int len = 0; - char *value, *p; - - /* Figure out how much space will be taken up by the command-line - variable definitions. */ - for (cv = command_variables; cv != 0; cv = cv->next) - { - v = cv->variable; - len += 2 * strlen (v->name); - if (! v->recursive) - ++len; - ++len; - len += 2 * strlen (v->value); - } - - /* Now allocate a buffer big enough and fill it. */ - p = value = (char *) alloca (len); - for (cv = command_variables; cv != 0; cv = cv->next) - { - v = cv->variable; - p = quote_as_word (p, v->name, 0); - if (! v->recursive) - *p++ = ':'; - *p++ = '='; - p = quote_as_word (p, v->value, 0); - *p++ = ' '; - } - p[-1] = '\0'; /* Kill the final space and terminate. */ - - /* Define an unchangeable variable with a name that no POSIX.2 - makefile could validly use for its own variable. */ - (void) define_variable ("-*-command-variables-*-", 23, - value, o_automatic, 0); - - /* Define the variable; this will not override any user definition. - Normally a reference to this variable is written into the value of - MAKEFLAGS, allowing the user to override this value to affect the - exported value of MAKEFLAGS. In POSIX-pedantic mode, we cannot - allow the user's setting of MAKEOVERRIDES to affect MAKEFLAGS, so - a reference to this hidden variable is written instead. */ - (void) define_variable ("MAKEOVERRIDES", 13, - "${-*-command-variables-*-}", o_env, 1); - } - - /* If there were -C flags, move ourselves about. */ - if (directories != 0) - for (i = 0; directories->list[i] != 0; ++i) - { - char *dir = directories->list[i]; - if (dir[0] == '~') - { - char *expanded = tilde_expand (dir); - if (expanded != 0) - dir = expanded; - } - if (chdir (dir) < 0) - pfatal_with_name (dir); - if (dir != directories->list[i]) - free (dir); - } - - /* Figure out the level of recursion. */ - { - struct variable *v = lookup_variable ("MAKELEVEL", 9); - if (v != 0 && *v->value != '\0' && *v->value != '-') - makelevel = (unsigned int) atoi (v->value); - else - makelevel = 0; - } - - /* Except under -s, always do -w in sub-makes and under -C. */ - if (!silent_flag && (directories != 0 || makelevel > 0)) - print_directory_flag = 1; - - /* Let the user disable that with --no-print-directory. */ - if (inhibit_print_directory_flag) - print_directory_flag = 0; - - /* Construct the list of include directories to search. */ - - construct_include_path (include_directories == 0 ? (char **) 0 - : include_directories->list); - - /* Figure out where we are now, after chdir'ing. */ - if (directories == 0) - /* We didn't move, so we're still in the same place. */ - starting_directory = current_directory; - else - { - if (getcwd (current_directory, GET_PATH_MAX) == 0) - { -#ifdef HAVE_GETCWD - perror_with_name ("getcwd: ", ""); -#else - error ("getwd: %s", current_directory); -#endif - starting_directory = 0; - } - else - starting_directory = current_directory; - } - - /* Tell the user where he is. */ - - if (print_directory_flag) - log_working_directory (1); - - /* Read any stdin makefiles into temporary files. */ - - if (makefiles != 0) - { - register unsigned int i; - for (i = 0; i < makefiles->idx; ++i) - if (makefiles->list[i][0] == '-' && makefiles->list[i][1] == '\0') - { - /* This makefile is standard input. Since we may re-exec - and thus re-read the makefiles, we read standard input - into a temporary file and read from that. */ - FILE *outfile; - - /* Make a unique filename. */ -#ifdef HAVE_MKTEMP - static char name[] = "/tmp/GmXXXXXX"; - (void) mktemp (name); -#else - static char name[L_tmpnam]; - (void) tmpnam (name); -#endif - - outfile = fopen (name, "w"); - if (outfile == 0) - pfatal_with_name ("fopen (temporary file)"); - while (!feof (stdin)) - { - char buf[2048]; - int n = fread (buf, 1, sizeof(buf), stdin); - if (n > 0 && fwrite (buf, 1, n, outfile) != (size_t)n) - pfatal_with_name ("fwrite (temporary file)"); - } - /* Try to make sure we won't remake the temporary - file when we are re-exec'd. Kludge-o-matic! */ - fprintf (outfile, "%s:;\n", name); - (void) fclose (outfile); - - /* Replace the name that read_all_makefiles will - see with the name of the temporary file. */ - { - char *temp; - /* SGI compiler requires alloca's result be assigned simply. */ - temp = (char *) alloca (sizeof (name)); - bcopy (name, temp, sizeof (name)); - makefiles->list[i] = temp; - } - - /* Make sure the temporary file will not be remade. */ - f = enter_file (savestring (name, sizeof name - 1)); - f->updated = 1; - f->update_status = 0; - f->command_state = cs_finished; - /* Let it be removed when we're done. */ - f->intermediate = 1; - /* But don't mention it. */ - f->dontcare = 1; - } - } - - /* Set up to handle children dying. This must be done before - reading in the makefiles so that `shell' function calls will work. */ - -#ifdef SIGCHLD - (void) signal (SIGCHLD, child_handler); -#endif -#ifdef SIGCLD - (void) signal (SIGCLD, child_handler); -#endif - - /* Let the user send us SIGUSR1 to toggle the -d flag during the run. */ -#ifdef SIGUSR1 - (void) signal (SIGUSR1, debug_signal_handler); -#endif - - /* Define the initial list of suffixes for old-style rules. */ - - set_default_suffixes (); - - /* Define the file rules for the built-in suffix rules. These will later - be converted into pattern rules. We used to do this in - install_default_implicit_rules, but since that happens after reading - makefiles, it results in the built-in pattern rules taking precedence - over makefile-specified suffix rules, which is wrong. */ - - install_default_suffix_rules (); - - /* Define some internal and special variables. */ - - define_automatic_variables (); - - /* Set up the MAKEFLAGS and MFLAGS variables - so makefiles can look at them. */ - - define_makeflags (0, 0); - - /* Define the default variables. */ - define_default_variables (); - - /* Read all the makefiles. */ - - default_file = enter_file (".DEFAULT"); - - read_makefiles - = read_all_makefiles (makefiles == 0 ? (char **) 0 : makefiles->list); - - /* Decode switches again, in case the variables were set by the makefile. */ - decode_env_switches ("MAKEFLAGS", 9); -#if 0 - decode_env_switches ("MFLAGS", 6); -#endif - - /* Set up MAKEFLAGS and MFLAGS again, so they will be right. */ - - define_makeflags (1, 0); - - /* Make each `struct dep' point at the `struct file' for the file - depended on. Also do magic for special targets. */ - - snap_deps (); - - /* Convert old-style suffix rules to pattern rules. It is important to - do this before installing the built-in pattern rules below, so that - makefile-specified suffix rules take precedence over built-in pattern - rules. */ - - convert_to_pattern (); - - /* Install the default implicit pattern rules. - This used to be done before reading the makefiles. - But in that case, built-in pattern rules were in the chain - before user-defined ones, so they matched first. */ - - install_default_implicit_rules (); - - /* Compute implicit rule limits. */ - - count_implicit_rule_limits (); - - /* Construct the listings of directories in VPATH lists. */ - - build_vpath_lists (); - - /* Mark files given with -o flags as very old (00:00:01.00 Jan 1, 1970) - and as having been updated already, and files given with -W flags as - brand new (time-stamp as far as possible into the future). */ - - if (old_files != 0) - for (p = old_files->list; *p != 0; ++p) - { - f = enter_command_line_file (*p); - f->last_mtime = (time_t) 1; - f->updated = 1; - f->update_status = 0; - f->command_state = cs_finished; - } - - if (new_files != 0) - { - for (p = new_files->list; *p != 0; ++p) - { - f = enter_command_line_file (*p); - f->last_mtime = NEW_MTIME; - } - } - - if (read_makefiles != 0) - { - /* Update any makefiles if necessary. */ - - time_t *makefile_mtimes = 0; - unsigned int mm_idx = 0; - - if (debug_flag) - puts ("Updating makefiles...."); - - /* Remove any makefiles we don't want to try to update. - Also record the current modtimes so we can compare them later. */ - { - register struct dep *d, *last; - last = 0; - d = read_makefiles; - while (d != 0) - { - register struct file *f = d->file; - if (f->double_colon) - for (f = f->double_colon; f != NULL; f = f->prev) - { - if (f->deps == 0 && f->cmds != 0) - { - /* This makefile is a :: target with commands, but - no dependencies. So, it will always be remade. - This might well cause an infinite loop, so don't - try to remake it. (This will only happen if - your makefiles are written exceptionally - stupidly; but if you work for Athena, that's how - you write your makefiles.) */ - - if (debug_flag) - printf ("Makefile `%s' might loop; not remaking it.\n", - f->name); - - if (last == 0) - read_makefiles = d->next; - else - last->next = d->next; - - /* Free the storage. */ - free ((char *) d); - - d = last == 0 ? 0 : last->next; - - break; - } - } - if (f == NULL || !f->double_colon) - { - if (makefile_mtimes == 0) - makefile_mtimes = (time_t *) xmalloc (sizeof (time_t)); - else - makefile_mtimes = (time_t *) - xrealloc ((char *) makefile_mtimes, - (mm_idx + 1) * sizeof (time_t)); - makefile_mtimes[mm_idx++] = file_mtime_no_search (d->file); - last = d; - d = d->next; - } - } - } - - /* Set up `MAKEFLAGS' specially while remaking makefiles. */ - define_makeflags (1, 1); - - switch (update_goal_chain (read_makefiles, 1)) - { - case 1: - default: -#define BOGUS_UPDATE_STATUS 0 - assert (BOGUS_UPDATE_STATUS); - break; - - case -1: - /* Did nothing. */ - break; - - case 2: - /* Failed to update. Figure out if we care. */ - { - /* Nonzero if any makefile was successfully remade. */ - int any_remade = 0; - /* Nonzero if any makefile we care about failed - in updating or could not be found at all. */ - int any_failed = 0; - register unsigned int i; - - for (i = 0; read_makefiles != 0; ++i) - { - struct dep *d = read_makefiles; - read_makefiles = d->next; - if (d->file->updated) - { - /* This makefile was updated. */ - if (d->file->update_status == 0) - { - /* It was successfully updated. */ - any_remade |= (file_mtime_no_search (d->file) - != makefile_mtimes[i]); - } - else if (! (d->changed & RM_DONTCARE)) - { - time_t mtime; - /* The update failed and this makefile was not - from the MAKEFILES variable, so we care. */ - error ("Failed to remake makefile `%s'.", - d->file->name); - mtime = file_mtime_no_search (d->file); - any_remade |= (mtime != (time_t) -1 - && mtime != makefile_mtimes[i]); - } - } - else - /* This makefile was not found at all. */ - if (! (d->changed & RM_DONTCARE)) - { - /* This is a makefile we care about. See how much. */ - if (d->changed & RM_INCLUDED) - /* An included makefile. We don't need - to die, but we do want to complain. */ - error ("Included makefile `%s' was not found.", - dep_name (d)); - else - { - /* A normal makefile. We must die later. */ - error ("Makefile `%s' was not found", dep_name (d)); - any_failed = 1; - } - } - - free ((char *) d); - } - - if (any_remade) - goto re_exec; - else if (any_failed) - die (2); - else - break; - } - - case 0: - re_exec: - /* Updated successfully. Re-exec ourselves. */ - - remove_intermediates (0); - - if (print_data_base_flag) - print_data_base (); - - if (print_directory_flag) - log_working_directory (0); - - if (makefiles != 0) - { - /* These names might have changed. */ - register unsigned int i, j = 0; - for (i = 1; i < (unsigned int)argc; ++i) - if (!strcmp (argv[i], "-f")) /* XXX */ - { - char *p = &argv[i][2]; - if (*p == '\0') - argv[++i] = makefiles->list[j]; - else - argv[i] = concat ("-f", makefiles->list[j], ""); - ++j; - } - } - - if (directories != 0 && directories->idx > 0) - { - char bad; - if (directory_before_chdir != 0) - { - if (chdir (directory_before_chdir) < 0) - { - perror_with_name ("chdir", ""); - bad = 1; - } - else - bad = 0; - } - else - bad = 1; - if (bad) - fatal ("Couldn't change back to original directory."); - } - - for (p = environ; *p != 0; ++p) - if (!strncmp (*p, "MAKELEVEL=", 10)) - { - /* The SGI compiler apparently can't understand - the concept of storing the result of a function - in something other than a local variable. */ - char *sgi_loses; - sgi_loses = (char *) alloca (40); - *p = sgi_loses; - sprintf (*p, "MAKELEVEL=%u", makelevel); - break; - } - - if (debug_flag) - { - char **p; - fputs ("Re-executing:", stdout); - for (p = argv; *p != 0; ++p) - printf (" %s", *p); - puts (""); - } - - fflush (stdout); - fflush (stderr); - - exec_command (argv, environ); - /* NOTREACHED */ - } - } - - /* Set up `MAKEFLAGS' again for the normal targets. */ - define_makeflags (1, 0); - - { - int status; - - /* If there were no command-line goals, use the default. */ - if (goals == 0) - { - if (default_goal_file != 0) - { - goals = (struct dep *) xmalloc (sizeof (struct dep)); - goals->next = 0; - goals->name = 0; - goals->file = default_goal_file; - } - } - else - lastgoal->next = 0; - - if (goals != 0) - { - /* Update the goals. */ - - if (debug_flag) - puts ("Updating goal targets...."); - - switch (update_goal_chain (goals, 0)) - { - case -1: - /* Nothing happened. */ - case 0: - /* Updated successfully. */ - status = 0; - break; - case 2: - /* Updating failed. */ - status = 2; - break; - case 1: - /* We are under -q and would run some commands. */ - status = 1; - break; - default: - abort (); - } - } - else - { - if (read_makefiles == 0) - fatal ("No targets specified and no makefile found"); - else - fatal ("No targets"); - } - - /* Exit. */ - die (status); - } - - return 0; -} - -/* Parsing of arguments, decoding of switches. */ - -static char options[1 + sizeof (switches) / sizeof (switches[0]) * 3]; -static struct option long_options[(sizeof (switches) / sizeof (switches[0])) + - (sizeof (long_option_aliases) / - sizeof (long_option_aliases[0]))]; - -/* Fill in the string and vector for getopt. */ -static void -init_switches () -{ - register char *p; - register int c; - register unsigned int i; - - if (options[0] != '\0') - /* Already done. */ - return; - - p = options; - - /* Return switch and non-switch args in order, regardless of - POSIXLY_CORRECT. Non-switch args are returned as option 1. */ - *p++ = '-'; - - for (i = 0; switches[i].c != '\0'; ++i) - { - long_options[i].name = (switches[i].long_name == 0 ? "" : - switches[i].long_name); - long_options[i].flag = 0; - long_options[i].val = switches[i].c; - if (isalnum (switches[i].c)) - *p++ = switches[i].c; - switch (switches[i].type) - { - case flag: - case flag_off: - case ignore: - long_options[i].has_arg = no_argument; - break; - - case string: - case positive_int: - case floating: - if (isalnum (switches[i].c)) - *p++ = ':'; - if (switches[i].noarg_value != 0) - { - if (isalnum (switches[i].c)) - *p++ = ':'; - long_options[i].has_arg = optional_argument; - } - else - long_options[i].has_arg = required_argument; - break; - } - } - *p = '\0'; - for (c = 0; c < (sizeof (long_option_aliases) / - sizeof (long_option_aliases[0])); - ++c) - long_options[i++] = long_option_aliases[c]; - long_options[i].name = 0; -} - -static void -handle_non_switch_argument (arg, env) - char *arg; - int env; -{ - /* Non-option argument. It might be a variable definition. */ - struct variable *v; - if (arg[0] == '-' && arg[1] == '\0') - /* Ignore plain `-' for compatibility. */ - return; - v = try_variable_definition ((char *) 0, 0, arg, o_command); - if (v != 0) - { - /* It is indeed a variable definition. Record a pointer to - the variable for later use in define_makeflags. */ - struct command_variable *cv - = (struct command_variable *) xmalloc (sizeof (*cv)); - cv->variable = v; - cv->next = command_variables; - command_variables = cv; - } - else if (! env) - { - /* Not an option or variable definition; it must be a goal - target! Enter it as a file and add it to the dep chain of - goals. */ - struct file *f = enter_command_line_file (arg); - f->cmd_target = 1; - - if (goals == 0) - { - goals = (struct dep *) xmalloc (sizeof (struct dep)); - lastgoal = goals; - } - else - { - lastgoal->next - = (struct dep *) xmalloc (sizeof (struct dep)); - lastgoal = lastgoal->next; - } - lastgoal->name = 0; - lastgoal->file = f; - } -} - -/* Decode switches from ARGC and ARGV. - They came from the environment if ENV is nonzero. */ - -static void -decode_switches (argc, argv, env) - int argc; - char **argv; - int env; -{ - int bad = 0; - register const struct command_switch *cs; - register struct stringlist *sl; - register int c; - - /* getopt does most of the parsing for us. - First, get its vectors set up. */ - - init_switches (); - - /* Let getopt produce error messages for the command line, - but not for options from the environment. */ - opterr = !env; - /* Reset getopt's state. */ - optind = 0; - - while (optind < argc) - { - /* Parse the next argument. */ - c = getopt_long (argc, argv, options, long_options, (int *) 0); - if (c == EOF) - /* End of arguments, or "--" marker seen. */ - break; - else if (c == 1) - /* An argument not starting with a dash. */ - handle_non_switch_argument (optarg, env); - else if (c == '?') - /* Bad option. We will print a usage message and die later. - But continue to parse the other options so the user can - see all he did wrong. */ - bad = 1; - else - for (cs = switches; cs->c != '\0'; ++cs) - if (cs->c == c) - { - /* Whether or not we will actually do anything with - this switch. We test this individually inside the - switch below rather than just once outside it, so that - options which are to be ignored still consume args. */ - int doit = !env || cs->env; - - switch (cs->type) - { - default: - abort (); - - case ignore: - break; - - case flag: - case flag_off: - if (doit) - *(int *) cs->value_ptr = cs->type == flag; - break; - - case string: - if (!doit) - break; - - if (optarg == 0) - optarg = cs->noarg_value; - - sl = *(struct stringlist **) cs->value_ptr; - if (sl == 0) - { - sl = (struct stringlist *) - xmalloc (sizeof (struct stringlist)); - sl->max = 5; - sl->idx = 0; - sl->list = (char **) xmalloc (5 * sizeof (char *)); - *(struct stringlist **) cs->value_ptr = sl; - } - else if (sl->idx == sl->max - 1) - { - sl->max += 5; - sl->list = (char **) - xrealloc ((char *) sl->list, - sl->max * sizeof (char *)); - } - sl->list[sl->idx++] = optarg; - sl->list[sl->idx] = 0; - break; - - case positive_int: - if (optarg == 0 && argc > optind - && isdigit (argv[optind][0])) - optarg = argv[optind++]; - - if (!doit) - break; - - if (optarg != 0) - { - int i = atoi (optarg); - if (i < 1) - { - if (doit) - error ("the `-%c' option requires a \ -positive integral argument", - cs->c); - bad = 1; - } - else - *(unsigned int *) cs->value_ptr = i; - } - else - *(unsigned int *) cs->value_ptr - = *(unsigned int *) cs->noarg_value; - break; - - case floating: - if (optarg == 0 && optind < argc - && (isdigit (argv[optind][0]) || argv[optind][0] == '.')) - optarg = argv[optind++]; - - if (doit) - *(double *) cs->value_ptr - = (optarg != 0 ? atof (optarg) - : *(double *) cs->noarg_value); - - break; - } - - /* We've found the switch. Stop looking. */ - break; - } - } - - /* There are no more options according to getting getopt, but there may - be some arguments left. Since we have asked for non-option arguments - to be returned in order, this only happens when there is a "--" - argument to prevent later arguments from being options. */ - while (optind < argc) - handle_non_switch_argument (argv[optind++], env); - - - if (!env && (bad || print_usage_flag)) - { - /* Print a nice usage message. */ - FILE *usageto; - - if (print_version_flag) - print_version (); - - usageto = bad ? stderr : stdout; - - fprintf (usageto, "Usage: %s [options] [target] ...\n", program); - - fputs ("Options:\n", usageto); - for (cs = switches; cs->c != '\0'; ++cs) - { - char buf[1024], shortarg[50], longarg[50], *p; - - if (cs->description[0] == '-') - continue; - - switch (long_options[cs - switches].has_arg) - { - case no_argument: - shortarg[0] = longarg[0] = '\0'; - break; - case required_argument: - sprintf (longarg, "=%s", cs->argdesc); - sprintf (shortarg, " %s", cs->argdesc); - break; - case optional_argument: - sprintf (longarg, "[=%s]", cs->argdesc); - sprintf (shortarg, " [%s]", cs->argdesc); - break; - } - - p = buf; - - if (isalnum (cs->c)) - { - sprintf (buf, " -%c%s", cs->c, shortarg); - p += strlen (p); - } - if (cs->long_name != 0) - { - unsigned int i; - sprintf (p, "%s--%s%s", - !isalnum (cs->c) ? " " : ", ", - cs->long_name, longarg); - p += strlen (p); - for (i = 0; i < (sizeof (long_option_aliases) / - sizeof (long_option_aliases[0])); - ++i) - if (long_option_aliases[i].val == cs->c) - { - sprintf (p, ", --%s%s", - long_option_aliases[i].name, longarg); - p += strlen (p); - } - } - { - const struct command_switch *ncs = cs; - while ((++ncs)->c != '\0') - if (ncs->description[0] == '-' && - ncs->description[1] == cs->c) - { - /* This is another switch that does the same - one as the one we are processing. We want - to list them all together on one line. */ - sprintf (p, ", -%c%s", ncs->c, shortarg); - p += strlen (p); - if (ncs->long_name != 0) - { - sprintf (p, ", --%s%s", ncs->long_name, longarg); - p += strlen (p); - } - } - } - - if (p - buf > DESCRIPTION_COLUMN - 2) - /* The list of option names is too long to fit on the same - line with the description, leaving at least two spaces. - Print it on its own line instead. */ - { - fprintf (usageto, "%s\n", buf); - buf[0] = '\0'; - } - - fprintf (usageto, "%*s%s.\n", - - DESCRIPTION_COLUMN, - buf, cs->description); - } - - die (bad ? 2 : 0); - } -} - -/* Decode switches from environment variable ENVAR (which is LEN chars long). - We do this by chopping the value into a vector of words, prepending a - dash to the first word if it lacks one, and passing the vector to - decode_switches. */ - -static void -decode_env_switches (envar, len) - char *envar; - unsigned int len; -{ - char *varref = (char *) alloca (2 + len + 2); - char *value, *p; - int argc; - char **argv; - - /* Get the variable's value. */ - varref[0] = '$'; - varref[1] = '('; - bcopy (envar, &varref[2], len); - varref[2 + len] = ')'; - varref[2 + len + 1] = '\0'; - value = variable_expand (varref); - - /* Skip whitespace, and check for an empty value. */ - value = next_token (value); - len = strlen (value); - if (len == 0) - return; - - /* Allocate a vector that is definitely big enough. */ - argv = (char **) alloca ((1 + len + 1) * sizeof (char *)); - - /* Allocate a buffer to copy the value into while we split it into words - and unquote it. We must use permanent storage for this because - decode_switches may store pointers into the passed argument words. */ - p = (char *) xmalloc (2 * len); - - /* getopt will look at the arguments starting at ARGV[1]. - Prepend a spacer word. */ - argv[0] = 0; - argc = 1; - argv[argc] = p; - while (*value != '\0') - { - if (*value == '\\') - ++value; /* Skip the backslash. */ - else if (isblank (*value)) - { - /* End of the word. */ - *p++ = '\0'; - argv[++argc] = p; - do - ++value; - while (isblank (*value)); - continue; - } - *p++ = *value++; - } - *p = '\0'; - argv[++argc] = 0; - - if (argc == 2 && argv[1][0] != '-') - { - /* There is just one word in the value, and it is not a switch. - Either this is the single-word form and we should prepend a dash - before calling decode_switches, or this is the multi-word form and - there is no dash because it is a variable definition. */ - struct variable *v; - v = try_variable_definition ((char *) 0, 0, argv[1], o_command); - if (v != 0) - { - /* It was indeed a variable definition, and now it has been - processed. There is nothing for decode_switches to do. - Record a pointer to the variable for later use in - define_makeflags. */ - struct command_variable *cv - = (struct command_variable *) xmalloc (sizeof (*cv)); - cv->variable = v; - cv->next = command_variables; - command_variables = cv; - return; - } - - /* It wasn't a variable definition, so it's some switches without a - leading dash. Add one and pass it along to decode_switches. We - need permanent storage for this in case decode_switches saves - pointers into the value. */ - argv[1] = concat ("-", argv[1], ""); - } - - /* Parse those words. */ - decode_switches (argc, argv, 1); -} - -/* Quote the string IN so that it will be interpreted as a single word with - no magic by the shell; if DOUBLE_DOLLARS is nonzero, also double dollar - signs to avoid variable expansion in make itself. Write the result into - OUT, returning the address of the next character to be written. - Allocating space for OUT twice the length of IN (thrice if - DOUBLE_DOLLARS is nonzero) is always sufficient. */ - -static char * -quote_as_word (out, in, double_dollars) - char *out, *in; - int double_dollars; -{ - while (*in != '\0') - { - if (index ("^;'\"*?[]$<>(){}|&~`\\ \t\r\n\f\v", *in) != 0) - *out++ = '\\'; - if (double_dollars && *in == '$') - *out++ = '$'; - *out++ = *in++; - } - - return out; -} - -/* Define the MAKEFLAGS and MFLAGS variables to reflect the settings of the - command switches. Include options with args if ALL is nonzero. - Don't include options with the `no_makefile' flag set if MAKEFILE. */ - -static void -define_makeflags (all, makefile) - int all, makefile; -{ - static const char ref[] = "$(MAKEOVERRIDES)"; - static const char posixref[] = "$(-*-command-variables-*-)"; - register const struct command_switch *cs; - char *flagstring; - register char *p; - unsigned int words; - struct variable *v; - - /* We will construct a linked list of `struct flag's describing - all the flags which need to go in MAKEFLAGS. Then, once we - know how many there are and their lengths, we can put them all - together in a string. */ - - struct flag - { - struct flag *next; - const struct command_switch *cs; - char *arg; - }; - struct flag *flags = 0; - unsigned int flagslen = 0; -#define ADD_FLAG(ARG, LEN) \ - do { \ - struct flag *new = (struct flag *) alloca (sizeof (struct flag)); \ - new->cs = cs; \ - new->arg = (ARG); \ - new->next = flags; \ - flags = new; \ - if (new->arg == 0) \ - ++flagslen; /* Just a single flag letter. */ \ - else \ - flagslen += 1 + 1 + 1 + 1 + 3 * (LEN); /* " -x foo" */ \ - if (!isalnum (cs->c)) \ - /* This switch has no single-letter version, so we use the long. */ \ - flagslen += 2 + strlen (cs->long_name); \ - } while (0) - - for (cs = switches; cs->c != '\0'; ++cs) - if (cs->toenv && (!makefile || !cs->no_makefile)) - switch (cs->type) - { - default: - abort (); - - case ignore: - break; - - case flag: - case flag_off: - if (!*(int *) cs->value_ptr == (cs->type == flag_off) - && (cs->default_value == 0 - || *(int *) cs->value_ptr != *(int *) cs->default_value)) - ADD_FLAG (0, 0); - break; - - case positive_int: - if (all) - { - if ((cs->default_value != 0 - && (*(unsigned int *) cs->value_ptr - == *(unsigned int *) cs->default_value))) - break; - else if (cs->noarg_value != 0 - && (*(unsigned int *) cs->value_ptr == - *(unsigned int *) cs->noarg_value)) - ADD_FLAG ("", 0); /* Optional value omitted; see below. */ - else if (cs->c == 'j') - /* Special case for `-j'. */ - ADD_FLAG ("1", 1); - else - { - char *buf = (char *) alloca (30); - sprintf (buf, "%u", *(unsigned int *) cs->value_ptr); - ADD_FLAG (buf, strlen (buf)); - } - } - break; - - case floating: - if (all) - { - if (cs->default_value != 0 - && (*(double *) cs->value_ptr - == *(double *) cs->default_value)) - break; - else if (cs->noarg_value != 0 - && (*(double *) cs->value_ptr - == *(double *) cs->noarg_value)) - ADD_FLAG ("", 0); /* Optional value omitted; see below. */ - else - { - char *buf = (char *) alloca (100); - sprintf (buf, "%g", *(double *) cs->value_ptr); - ADD_FLAG (buf, strlen (buf)); - } - } - break; - - case string: - if (all) - { - struct stringlist *sl = *(struct stringlist **) cs->value_ptr; - if (sl != 0) - { - /* Add the elements in reverse order, because - all the flags get reversed below; and the order - matters for some switches (like -I). */ - register unsigned int i = sl->idx; - while (i-- > 0) - ADD_FLAG (sl->list[i], strlen (sl->list[i])); - } - } - break; - } - - flagslen += 4 + sizeof posixref; /* Four more for the possible " -- ". */ - -#undef ADD_FLAG - - /* Construct the value in FLAGSTRING. - We allocate enough space for a preceding dash and trailing null. */ - flagstring = (char *) alloca (1 + flagslen + 1); - p = flagstring; - words = 1; - *p++ = '-'; - while (flags != 0) - { - /* Add the flag letter or name to the string. */ - if (!isalnum (flags->cs->c)) - { - *p++ = '-'; - strcpy (p, flags->cs->long_name); - p += strlen (p); - } - else - *p++ = flags->cs->c; - if (flags->arg != 0) - { - /* A flag that takes an optional argument which in this case is - omitted is specified by ARG being "". We must distinguish - because a following flag appended without an intervening " -" - is considered the arg for the first. */ - if (flags->arg[0] != '\0') - { - /* Add its argument too. */ - *p++ = !isalnum (flags->cs->c) ? '=' : ' '; - p = quote_as_word (p, flags->arg, 1); - } - ++words; - /* Write a following space and dash, for the next flag. */ - *p++ = ' '; - *p++ = '-'; - } - else if (!isalnum (flags->cs->c)) - { - ++words; - /* Long options must each go in their own word, - so we write the following space and dash. */ - *p++ = ' '; - *p++ = '-'; - } - flags = flags->next; - } - - if (all && command_variables != 0) - { - /* Now write a reference to $(MAKEOVERRIDES), which contains all the - command-line variable definitions. */ - - if (p == &flagstring[1]) - /* No flags written, so elide the leading dash already written. */ - p = flagstring; - else - { - /* Separate the variables from the switches with a "--" arg. */ - if (p[-1] != '-') - { - /* We did not already write a trailing " -". */ - *p++ = ' '; - *p++ = '-'; - } - /* There is a trailing " -"; fill it out to " -- ". */ - *p++ = '-'; - *p++ = ' '; - } - - /* Copy in the string. */ - if (posix_pedantic) - { - bcopy (posixref, p, sizeof posixref - 1); - p += sizeof posixref - 1; - } - else - { - bcopy (ref, p, sizeof ref - 1); - p += sizeof ref - 1; - } - } - else if (p == &flagstring[1]) - { - words = 0; - --p; - } - else if (p[-1] == '-') - /* Kill the final space and dash. */ - p -= 2; - /* Terminate the string. */ - *p = '\0'; - - v = define_variable ("MAKEFLAGS", 9, - /* If there is just a single word of switches, - omit the leading dash unless it is a single - long option with two leading dashes. */ - &flagstring[(words == 1 && command_variables == 0 - && flagstring[1] != '-') - ? 1 : 0], - /* This used to use o_env, but that lost when a - makefile defined MAKEFLAGS. Makefiles set - MAKEFLAGS to add switches, but we still want - to redefine its value with the full set of - switches. Of course, an override or command - definition will still take precedence. */ - o_file, 1); - if (! all) - /* The first time we are called, set MAKEFLAGS to always be exported. - We should not do this again on the second call, because that is - after reading makefiles which might have done `unexport MAKEFLAGS'. */ - v->export = v_export; - /* Since MFLAGS is not parsed for flags, there is no reason to - override any makefile redefinition. */ - (void) define_variable ("MFLAGS", 6, flagstring, o_env, 1); -} - -/* Print version information. */ - -static void -print_version () -{ - static int printed_version = 0; - - char *precede = print_data_base_flag ? "# " : ""; - - if (printed_version) - /* Do it only once. */ - return; - - printf ("%sGNU Make version %s", precede, version_string); - if (remote_description != 0 && *remote_description != '\0') - printf ("-%s", remote_description); - - printf (", by Richard Stallman and Roland McGrath.\n\ -%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.\n\ -%sThis is free software; see the source for copying conditions.\n\ -%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ -%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede); - -#ifdef NETSCAPE -/* - * When you do a release build, you can define the macros - * DEFAULT_SHELL and BUILD_NUMBER to make the following message - * appear in the version information. - * - * For example, you can say: - * #define DEFAULT_SHELL "shmsdos" - * #define BUILD_NUMBER 19970918 - */ - -#define DEFAULT_SHELL "shmsdos" -#define BUILD_NUMBER 19980324 - -#if defined(DEFAULT_SHELL) && defined(BUILD_NUMBER) - - printf ("\ -%sThis version was ported to Win32 by Netscape Communications Corp.\n\ -%sDefault shell: %s. Build number: %d.\n\n", precede, precede, -DEFAULT_SHELL, BUILD_NUMBER); - -#endif /* DEFAULT_SHELL, BUILD_NUMBER */ -#endif /* NETSCAPE */ - - printed_version = 1; - - /* Flush stdout so the user doesn't have to wait to see the - version information while things are thought about. */ - fflush (stdout); -} - -/* Print a bunch of information about this and that. */ - -static void -print_data_base () -{ - extern char *ctime (); - time_t when; - - when = time ((time_t *) 0); - printf ("\n# Make data base, printed on %s", ctime (&when)); - - print_variable_data_base (); - print_dir_data_base (); - print_rule_data_base (); - print_file_data_base (); - print_vpath_data_base (); - - when = time ((time_t *) 0); - printf ("\n# Finished Make data base on %s\n", ctime (&when)); -} - -/* Exit with STATUS, cleaning up as necessary. */ - -void -die (status) - int status; -{ - static char dying = 0; - - if (!dying) - { - int err; - - dying = 1; - - /* Try to move back to the original directory. This is essential on - MS-DOS (where there is really only one process), and on Unix it - puts core files in the original directory instead of the -C - directory. */ - if (directory_before_chdir != 0) - chdir (directory_before_chdir); - - if (print_version_flag) - print_version (); - - /* Wait for children to die. */ - for (err = status != 0; job_slots_used > 0; err = 0) - reap_children (1, err); - - /* Remove the intermediate files. */ - remove_intermediates (0); - - if (print_data_base_flag) - print_data_base (); - - if (print_directory_flag) - log_working_directory (0); - } - - exit (status); -} - -/* Write a message indicating that we've just entered or - left (according to ENTERING) the current directory. */ - -static void -log_working_directory (entering) - int entering; -{ - static int entered = 0; - char *message = entering ? "Entering" : "Leaving"; - - if (entering) - entered = 1; - else if (!entered) - /* Don't print the leaving message if we - haven't printed the entering message. */ - return; - - if (print_data_base_flag) - fputs ("# ", stdout); - - if (makelevel == 0) - printf ("%s: %s ", program, message); - else - printf ("%s[%u]: %s ", program, makelevel, message); - - if (starting_directory == 0) - puts ("an unknown directory"); - else - printf ("directory `%s'\n", starting_directory); -} diff --git a/buildtools/windows/source/make/make-stds.texi b/buildtools/windows/source/make/make-stds.texi deleted file mode 100644 index 887b7ade207..00000000000 --- a/buildtools/windows/source/make/make-stds.texi +++ /dev/null @@ -1,656 +0,0 @@ -@comment This file is included by both standards.texi and make.texinfo. -@comment It was broken out of standards.texi on 1/6/93 by roland. - -@node Makefile Conventions -@chapter Makefile Conventions -@comment standards.texi does not print an index, but make.texinfo does. -@cindex makefile, conventions for -@cindex conventions for makefiles -@cindex standards for makefiles - -This chapter describes conventions for writing the Makefiles for GNU programs. - -@menu -* Makefile Basics:: -* Utilities in Makefiles:: -* Standard Targets:: -* Command Variables:: -* Directory Variables:: -@end menu - -@node Makefile Basics -@section General Conventions for Makefiles - -Every Makefile should contain this line: - -@example -SHELL = /bin/sh -@end example - -@noindent -to avoid trouble on systems where the @code{SHELL} variable might be -inherited from the environment. (This is never a problem with GNU -@code{make}.) - -Different @code{make} programs have incompatible suffix lists and -implicit rules, and this sometimes creates confusion or misbehavior. So -it is a good idea to set the suffix list explicitly using only the -suffixes you need in the particular Makefile, like this: - -@example -.SUFFIXES: -.SUFFIXES: .c .o -@end example - -@noindent -The first line clears out the suffix list, the second introduces all -suffixes which may be subject to implicit rules in this Makefile. - -Don't assume that @file{.} is in the path for command execution. When -you need to run programs that are a part of your package during the -make, please make sure that it uses @file{./} if the program is built as -part of the make or @file{$(srcdir)/} if the file is an unchanging part -of the source code. Without one of these prefixes, the current search -path is used. - -The distinction between @file{./} and @file{$(srcdir)/} is important -when using the @samp{--srcdir} option to @file{configure}. A rule of -the form: - -@smallexample -foo.1 : foo.man sedscript - sed -e sedscript foo.man > foo.1 -@end smallexample - -@noindent -will fail when the current directory is not the source directory, -because @file{foo.man} and @file{sedscript} are not in the current -directory. - -When using GNU @code{make}, relying on @samp{VPATH} to find the source -file will work in the case where there is a single dependency file, -since the @file{make} automatic variable @samp{$<} will represent the -source file wherever it is. (Many versions of @code{make} set @samp{$<} -only in implicit rules.) A makefile target like - -@smallexample -foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o -@end smallexample - -@noindent -should instead be written as - -@smallexample -foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@@ -@end smallexample - -@noindent -in order to allow @samp{VPATH} to work correctly. When the target has -multiple dependencies, using an explicit @samp{$(srcdir)} is the easiest -way to make the rule work well. For example, the target above for -@file{foo.1} is best written as: - -@smallexample -foo.1 : foo.man sedscript - sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@ -@end smallexample - -@node Utilities in Makefiles -@section Utilities in Makefiles - -Write the Makefile commands (and any shell scripts, such as -@code{configure}) to run in @code{sh}, not in @code{csh}. Don't use any -special features of @code{ksh} or @code{bash}. - -The @code{configure} script and the Makefile rules for building and -installation should not use any utilities directly except these: - -@example -cat cmp cp echo egrep expr grep -ln mkdir mv pwd rm rmdir sed test touch -@end example - -Stick to the generally supported options for these programs. For -example, don't use @samp{mkdir -p}, convenient as it may be, because -most systems don't support it. - -The Makefile rules for building and installation can also use compilers -and related programs, but should do so via @code{make} variables so that the -user can substitute alternatives. Here are some of the programs we -mean: - -@example -ar bison cc flex install ld lex -make makeinfo ranlib texi2dvi yacc -@end example - -Use the following @code{make} variables: - -@example -$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) -$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) -@end example - -When you use @code{ranlib}, you should make sure nothing bad happens if -the system does not have @code{ranlib}. Arrange to ignore an error -from that command, and print a message before the command to tell the -user that failure of the @code{ranlib} command does not mean a problem. - -If you use symbolic links, you should implement a fallback for systems -that don't have symbolic links. - -It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities to -exist. - -@node Standard Targets -@section Standard Targets for Users - -All GNU programs should have the following targets in their Makefiles: - -@table @samp -@item all -Compile the entire program. This should be the default target. This -target need not rebuild any documentation files; Info files should -normally be included in the distribution, and DVI files should be made -only when explicitly asked for. - -@item install -Compile the program and copy the executables, libraries, and so on to -the file names where they should reside for actual use. If there is a -simple test to verify that a program is properly installed, this target -should run that test. - -If possible, write the @code{install} target rule so that it does not -modify anything in the directory where the program was built, provided -@samp{make all} has just been done. This is convenient for building the -program under one user name and installing it under another. - -The commands should create all the directories in which files are to be -installed, if they don't already exist. This includes the directories -specified as the values of the variables @code{prefix} and -@code{exec_prefix}, as well as all subdirectories that are needed. -One way to do this is by means of an @code{installdirs} target -as described below. - -Use @samp{-} before any command for installing a man page, so that -@code{make} will ignore any errors. This is in case there are systems -that don't have the Unix man page documentation system installed. - -The way to install Info files is to copy them into @file{$(infodir)} -with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run -the @code{install-info} program if it is present. @code{install-info} -is a script that edits the Info @file{dir} file to add or update the -menu entry for the given Info file; it will be part of the Texinfo package. -Here is a sample rule to install an Info file: - -@comment This example has been carefully formatted for the Make manual. -@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu. -@smallexample -$(infodir)/foo.info: foo.info -# There may be a newer info file in . than in srcdir. - -if test -f foo.info; then d=.; \ - else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $@@; \ -# Run install-info only if it exists. -# Use `if' instead of just prepending `-' to the -# line so we notice real errors from install-info. -# We use `$(SHELL) -c' because some shells do not -# fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' \ - >/dev/null 2>&1; then \ - install-info --infodir=$(infodir) $$d/foo.info; \ - else true; fi -@end smallexample - -@item uninstall -Delete all the installed files that the @samp{install} target would -create (but not the noninstalled files such as @samp{make all} would -create). - -This rule should not modify the directories where compilation is done, -only the directories where files are installed. - -@comment The gratuitous blank line here is to make the table look better -@comment in the printed Make manual. Please leave it in. -@item clean - -Delete all files from the current directory that are normally created by -building the program. Don't delete the files that record the -configuration. Also preserve files that could be made by building, but -normally aren't because the distribution comes with them. - -Delete @file{.dvi} files here if they are not part of the distribution. - -@item distclean -Delete all files from the current directory that are created by -configuring or building the program. If you have unpacked the source -and built the program without creating any other files, @samp{make -distclean} should leave only the files that were in the distribution. - -@item mostlyclean -Like @samp{clean}, but may refrain from deleting a few files that people -normally don't want to recompile. For example, the @samp{mostlyclean} -target for GCC does not delete @file{libgcc.a}, because recompiling it -is rarely necessary and takes a lot of time. - -@item maintainer-clean -Delete almost everything from the current directory that can be -reconstructed with this Makefile. This typically includes everything -deleted by @code{distclean}, plus more: C source files produced by -Bison, tags tables, Info files, and so on. - -The reason we say ``almost everything'' is that @samp{make -maintainer-clean} should not delete @file{configure} even if -@file{configure} can be remade using a rule in the Makefile. More -generally, @samp{make maintainer-clean} should not delete anything that -needs to exist in order to run @file{configure} and then begin to build -the program. This is the only exception; @code{maintainer-clean} should -delete everything else that can be rebuilt. - -The @samp{maintainer-clean} is intended to be used by a maintainer of -the package, not by ordinary users. You may need special tools to -reconstruct some of the files that @samp{make maintainer-clean} deletes. -Since these files are normally included in the distribution, we don't -take care to make them easy to reconstruct. If you find you need to -unpack the full distribution again, don't blame us. - -To help make users aware of this, the commands for -@code{maintainer-clean} should start with these two: - -@example -@@echo "This command is intended for maintainers to use;" -@@echo "it deletes files that may require special tools to rebuild." -@end example - -@item TAGS -Update a tags table for this program. - -@item info -Generate any Info files needed. The best way to write the rules is as -follows: - -@smallexample -info: foo.info - -foo.info: foo.texi chap1.texi chap2.texi - $(MAKEINFO) $(srcdir)/foo.texi -@end smallexample - -@noindent -You must define the variable @code{MAKEINFO} in the Makefile. It should -run the @code{makeinfo} program, which is part of the Texinfo -distribution. - -@item dvi -Generate DVI files for all TeXinfo documentation. -For example: - -@smallexample -dvi: foo.dvi - -foo.dvi: foo.texi chap1.texi chap2.texi - $(TEXI2DVI) $(srcdir)/foo.texi -@end smallexample - -@noindent -You must define the variable @code{TEXI2DVI} in the Makefile. It should -run the program @code{texi2dvi}, which is part of the Texinfo -distribution. Alternatively, write just the dependencies, and allow GNU -Make to provide the command. - -@item dist -Create a distribution tar file for this program. The tar file should be -set up so that the file names in the tar file start with a subdirectory -name which is the name of the package it is a distribution for. This -name can include the version number. - -For example, the distribution tar file of GCC version 1.40 unpacks into -a subdirectory named @file{gcc-1.40}. - -The easiest way to do this is to create a subdirectory appropriately -named, use @code{ln} or @code{cp} to install the proper files in it, and -then @code{tar} that subdirectory. - -The @code{dist} target should explicitly depend on all non-source files -that are in the distribution, to make sure they are up to date in the -distribution. -@xref{Releases, , Making Releases, standards, GNU Coding Standards}. - -@item check -Perform self-tests (if any). The user must build the program before -running the tests, but need not install the program; you should write -the self-tests so that they work when the program is built but not -installed. -@end table - -The following targets are suggested as conventional names, for programs -in which they are useful. - -@table @code -@item installcheck -Perform installation tests (if any). The user must build and install -the program before running the tests. You should not assume that -@file{$(bindir)} is in the search path. - -@item installdirs -It's useful to add a target named @samp{installdirs} to create the -directories where files are installed, and their parent directories. -There is a script called @file{mkinstalldirs} which is convenient for -this; find it in the Texinfo package.@c It's in /gd/gnu/lib/mkinstalldirs. -You can use a rule like this: - -@comment This has been carefully formatted to look decent in the Make manual. -@comment Please be sure not to make it extend any further to the right.--roland -@smallexample -# Make sure all installation directories (e.g. $(bindir)) -# actually exist by making them if necessary. -installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ - $(libdir) $(infodir) \ - $(mandir) -@end smallexample - -This rule should not modify the directories where compilation is done. -It should do nothing but create installation directories. -@end table - -@node Command Variables -@section Variables for Specifying Commands - -Makefiles should provide variables for overriding certain commands, options, -and so on. - -In particular, you should run most utility programs via variables. -Thus, if you use Bison, have a variable named @code{BISON} whose default -value is set with @samp{BISON = bison}, and refer to it with -@code{$(BISON)} whenever you need to use Bison. - -File management utilities such as @code{ln}, @code{rm}, @code{mv}, and -so on, need not be referred to through variables in this way, since users -don't need to replace them with other programs. - -Each program-name variable should come with an options variable that is -used to supply options to the program. Append @samp{FLAGS} to the -program-name variable name to get the options variable name---for -example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to -this rule, but we keep it because it is standard.) Use @code{CPPFLAGS} -in any compilation command that runs the preprocessor, and use -@code{LDFLAGS} in any compilation command that does linking as well as -in any direct use of @code{ld}. - -If there are C compiler options that @emph{must} be used for proper -compilation of certain files, do not include them in @code{CFLAGS}. -Users expect to be able to specify @code{CFLAGS} freely themselves. -Instead, arrange to pass the necessary options to the C compiler -independently of @code{CFLAGS}, by writing them explicitly in the -compilation commands or by defining an implicit rule, like this: - -@smallexample -CFLAGS = -g -ALL_CFLAGS = -I. $(CFLAGS) -.c.o: - $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -@end smallexample - -Do include the @samp{-g} option in @code{CFLAGS}, because that is not -@emph{required} for proper compilation. You can consider it a default -that is only recommended. If the package is set up so that it is -compiled with GCC by default, then you might as well include @samp{-O} -in the default value of @code{CFLAGS} as well. - -Put @code{CFLAGS} last in the compilation command, after other variables -containing compiler options, so the user can use @code{CFLAGS} to -override the others. - -Every Makefile should define the variable @code{INSTALL}, which is the -basic command for installing a file into the system. - -Every Makefile should also define the variables @code{INSTALL_PROGRAM} -and @code{INSTALL_DATA}. (The default for each of these should be -@code{$(INSTALL)}.) Then it should use those variables as the commands -for actual installation, for executables and nonexecutables -respectively. Use these variables as follows: - -@example -$(INSTALL_PROGRAM) foo $(bindir)/foo -$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a -@end example - -@noindent -Always use a file name, not a directory name, as the second argument of -the installation commands. Use a separate command for each file to be -installed. - -@node Directory Variables -@section Variables for Installation Directories - -Installation directories should always be named by variables, so it is -easy to install in a nonstandard place. The standard names for these -variables are described below. They are based on a standard filesystem -layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and -other modern operating systems. - -These two variables set the root for the installation. All the other -installation directories should be subdirectories of one of these two, -and nothing should be directly installed into these two directories. - -@table @samp -@item prefix -A prefix used in constructing the default values of the variables listed -below. The default value of @code{prefix} should be @file{/usr/local} -When building the complete GNU system, the prefix will be empty and -@file{/usr} will be a symbolic link to @file{/}. - -@item exec_prefix -A prefix used in constructing the default values of some of the -variables listed below. The default value of @code{exec_prefix} should -be @code{$(prefix)}. - -Generally, @code{$(exec_prefix)} is used for directories that contain -machine-specific files (such as executables and subroutine libraries), -while @code{$(prefix)} is used directly for other directories. -@end table - -Executable programs are installed in one of the following directories. - -@table @samp -@item bindir -The directory for installing executable programs that users can run. -This should normally be @file{/usr/local/bin}, but write it as -@file{$(exec_prefix)/bin}. - -@item sbindir -The directory for installing executable programs that can be run from -the shell, but are only generally useful to system administrators. This -should normally be @file{/usr/local/sbin}, but write it as -@file{$(exec_prefix)/sbin}. - -@item libexecdir -@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94 -The directory for installing executable programs to be run by other -programs rather than by users. This directory should normally be -@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}. -@end table - -Data files used by the program during its execution are divided into -categories in two ways. - -@itemize @bullet -@item -Some files are normally modified by programs; others are never normally -modified (though users may edit some of these). - -@item -Some files are architecture-independent and can be shared by all -machines at a site; some are architecture-dependent and can be shared -only by machines of the same kind and operating system; others may never -be shared between two machines. -@end itemize - -This makes for six different possibilities. However, we want to -discourage the use of architecture-dependent files, aside from of object -files and libraries. It is much cleaner to make other data files -architecture-independent, and it is generally not hard. - -Therefore, here are the variables makefiles should use to specify -directories: - -@table @samp -@item datadir -The directory for installing read-only architecture independent data -files. This should normally be @file{/usr/local/share}, but write it as -@file{$(prefix)/share}. As a special exception, see @file{$(infodir)} -and @file{$(includedir)} below. - -@item sysconfdir -The directory for installing read-only data files that pertain to a -single machine--that is to say, files for configuring a host. Mailer -and network configuration files, @file{/etc/passwd}, and so forth belong -here. All the files in this directory should be ordinary ASCII text -files. This directory should normally be @file{/usr/local/etc}, but -write it as @file{$(prefix)/etc}. - -@c rewritten to avoid overfull hbox --tower -Do not install executables -@c here -in this directory (they probably -belong in @file{$(libexecdir)} or @file{$(sbindir))}. Also do not -install files that are modified in the normal course of their use -(programs whose purpose is to change the configuration of the system -excluded). Those probably belong in @file{$(localstatedir)}. - -@item sharedstatedir -The directory for installing architecture-independent data files which -the programs modify while they run. This should normally be -@file{/usr/local/com}, but write it as @file{$(prefix)/com}. - -@item localstatedir -The directory for installing data files which the programs modify while -they run, and that pertain to one specific machine. Users should never -need to modify files in this directory to configure the package's -operation; put such configuration information in separate files that go -in @file{datadir} or @file{$(sysconfdir)}. @file{$(localstatedir)} -should normally be @file{/usr/local/var}, but write it as -@file{$(prefix)/var}. - -@item libdir -The directory for object files and libraries of object code. Do not -install executables here, they probably belong in @file{$(libexecdir)} -instead. The value of @code{libdir} should normally be -@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}. - -@item infodir -The directory for installing the Info files for this package. By -default, it should be @file{/usr/local/info}, but it should be written -as @file{$(prefix)/info}. - -@item includedir -@c rewritten to avoid overfull hbox --roland -The directory for installing header files to be included by user -programs with the C @samp{#include} preprocessor directive. This -should normally be @file{/usr/local/include}, but write it as -@file{$(prefix)/include}. - -Most compilers other than GCC do not look for header files in -@file{/usr/local/include}. So installing the header files this way is -only useful with GCC. Sometimes this is not a problem because some -libraries are only really intended to work with GCC. But some libraries -are intended to work with other compilers. They should install their -header files in two places, one specified by @code{includedir} and one -specified by @code{oldincludedir}. - -@item oldincludedir -The directory for installing @samp{#include} header files for use with -compilers other than GCC. This should normally be @file{/usr/include}. - -The Makefile commands should check whether the value of -@code{oldincludedir} is empty. If it is, they should not try to use -it; they should cancel the second installation of the header files. - -A package should not replace an existing header in this directory unless -the header came from the same package. Thus, if your Foo package -provides a header file @file{foo.h}, then it should install the header -file in the @code{oldincludedir} directory if either (1) there is no -@file{foo.h} there or (2) the @file{foo.h} that exists came from the Foo -package. - -To tell whether @file{foo.h} came from the Foo package, put a magic -string in the file---part of a comment---and grep for that string. -@end table - -Unix-style man pages are installed in one of the following: - -@table @samp -@item mandir -The directory for installing the man pages (if any) for this package. -It should include the suffix for the proper section of the -manual---usually @samp{1} for a utility. It will normally be -@file{/usr/local/man/man1}, but you should write it as -@file{$(prefix)/man/man1}. - -@item man1dir -The directory for installing section 1 man pages. -@item man2dir -The directory for installing section 2 man pages. -@item @dots{} -Use these names instead of @samp{mandir} if the package needs to install man -pages in more than one section of the manual. - -@strong{Don't make the primary documentation for any GNU software be a -man page. Write a manual in Texinfo instead. Man pages are just for -the sake of people running GNU software on Unix, which is a secondary -application only.} - -@item manext -The file name extension for the installed man page. This should contain -a period followed by the appropriate digit; it should normally be @samp{.1}. - -@item man1ext -The file name extension for installed section 1 man pages. -@item man2ext -The file name extension for installed section 2 man pages. -@item @dots{} -Use these names instead of @samp{manext} if the package needs to install man -pages in more than one section of the manual. -@end table - -And finally, you should set the following variable: - -@table @samp -@item srcdir -The directory for the sources being compiled. The value of this -variable is normally inserted by the @code{configure} shell script. -@end table - -For example: - -@smallexample -@c I have changed some of the comments here slightly to fix an overfull -@c hbox, so the make manual can format correctly. --roland -# Common prefix for installation directories. -# NOTE: This directory must exist when you start the install. -prefix = /usr/local -exec_prefix = $(prefix) -# Where to put the executable for the command `gcc'. -bindir = $(exec_prefix)/bin -# Where to put the directories used by the compiler. -libexecdir = $(exec_prefix)/libexec -# Where to put the Info files. -infodir = $(prefix)/info -@end smallexample - -If your program installs a large number of files into one of the -standard user-specified directories, it might be useful to group them -into a subdirectory particular to that program. If you do this, you -should write the @code{install} rule to create these subdirectories. - -Do not expect the user to include the subdirectory name in the value of -any of the variables listed above. The idea of having a uniform set of -variable names for installation directories is to enable the user to -specify the exact same values for several different GNU packages. In -order for this to be useful, all the packages must be designed so that -they will work sensibly when the user does so. - diff --git a/buildtools/windows/source/make/make.aux b/buildtools/windows/source/make/make.aux deleted file mode 100644 index ea790c9f12b..00000000000 --- a/buildtools/windows/source/make/make.aux +++ /dev/null @@ -1,354 +0,0 @@ -'xrdef {Overview-title}{Overview of \code {make}} -'xrdef {Overview-pg}{1} -'xrdef {Overview-snt}{Chapter'tie1} -'xrdef {Reading-title}{How to Read This Manual} -'xrdef {Reading-pg}{1} -'xrdef {Reading-snt}{Section'tie1.1} -'xrdef {Bugs-title}{Problems and Bugs} -'xrdef {Bugs-pg}{2} -'xrdef {Bugs-snt}{Section'tie1.2} -'xrdef {Introduction-title}{An Introduction to Makefiles} -'xrdef {Introduction-pg}{5} -'xrdef {Introduction-snt}{Chapter'tie2} -'xrdef {Rule Introduction-title}{What a Rule Looks Like} -'xrdef {Rule Introduction-pg}{5} -'xrdef {Rule Introduction-snt}{Section'tie2.1} -'xrdef {Simple Makefile-title}{A Simple Makefile} -'xrdef {Simple Makefile-pg}{6} -'xrdef {Simple Makefile-snt}{Section'tie2.2} -'xrdef {How Make Works-title}{How \code {make} Processes a Makefile} -'xrdef {How Make Works-pg}{8} -'xrdef {How Make Works-snt}{Section'tie2.3} -'xrdef {Variables Simplify-title}{Variables Make Makefiles Simpler} -'xrdef {Variables Simplify-pg}{9} -'xrdef {Variables Simplify-snt}{Section'tie2.4} -'xrdef {make Deduces-title}{Letting \code {make} Deduce the Commands} -'xrdef {make Deduces-pg}{10} -'xrdef {make Deduces-snt}{Section'tie2.5} -'xrdef {Combine By Dependency-title}{Another Style of Makefile} -'xrdef {Combine By Dependency-pg}{11} -'xrdef {Combine By Dependency-snt}{Section'tie2.6} -'xrdef {Cleanup-title}{Rules for Cleaning the Directory} -'xrdef {Cleanup-pg}{12} -'xrdef {Cleanup-snt}{Section'tie2.7} -'xrdef {Makefiles-title}{Writing Makefiles} -'xrdef {Makefiles-pg}{13} -'xrdef {Makefiles-snt}{Chapter'tie3} -'xrdef {Makefile Contents-title}{What Makefiles Contain} -'xrdef {Makefile Contents-pg}{13} -'xrdef {Makefile Contents-snt}{Section'tie3.1} -'xrdef {Makefile Names-title}{What Name to Give Your Makefile} -'xrdef {Makefile Names-pg}{14} -'xrdef {Makefile Names-snt}{Section'tie3.2} -'xrdef {Include-title}{Including Other Makefiles} -'xrdef {Include-pg}{14} -'xrdef {Include-snt}{Section'tie3.3} -'xrdef {MAKEFILES Variable-title}{The Variable \code {MAKEFILES}} -'xrdef {MAKEFILES Variable-pg}{16} -'xrdef {MAKEFILES Variable-snt}{Section'tie3.4} -'xrdef {Remaking Makefiles-title}{How Makefiles Are Remade} -'xrdef {Remaking Makefiles-pg}{16} -'xrdef {Remaking Makefiles-snt}{Section'tie3.5} -'xrdef {Overriding Makefiles-title}{Overriding Part of Another Makefile} -'xrdef {Overriding Makefiles-pg}{18} -'xrdef {Overriding Makefiles-snt}{Section'tie3.6} -'xrdef {Rules-title}{Writing Rules} -'xrdef {Rules-pg}{19} -'xrdef {Rules-snt}{Chapter'tie4} -'xrdef {Rule Syntax-title}{Rule Syntax} -'xrdef {Rule Syntax-pg}{19} -'xrdef {Rule Syntax-snt}{Section'tie4.1} -'xrdef {Wildcards-title}{Using Wildcard Characters in File Names} -'xrdef {Wildcards-pg}{20} -'xrdef {Wildcards-snt}{Section'tie4.2} -'xrdef {Wildcard Examples-title}{Wildcard Examples} -'xrdef {Wildcard Examples-pg}{21} -'xrdef {Wildcard Examples-snt}{Section'tie4.2.1} -'xrdef {Wildcard Pitfall-title}{Pitfalls of Using Wildcards} -'xrdef {Wildcard Pitfall-pg}{22} -'xrdef {Wildcard Pitfall-snt}{Section'tie4.2.2} -'xrdef {Wildcard Function-title}{The Function \code {wildcard}} -'xrdef {Wildcard Function-pg}{22} -'xrdef {Wildcard Function-snt}{Section'tie4.2.3} -'xrdef {Directory Search-title}{Searching Directories for Dependencies} -'xrdef {Directory Search-pg}{23} -'xrdef {Directory Search-snt}{Section'tie4.3} -'xrdef {General Search-title}{\code {VPATH}: Search Path for All Dependencies} -'xrdef {General Search-pg}{23} -'xrdef {General Search-snt}{Section'tie4.3.1} -'xrdef {Selective Search-title}{The \code {vpath} Directive} -'xrdef {Selective Search-pg}{24} -'xrdef {Selective Search-snt}{Section'tie4.3.2} -'xrdef {Commands/Search-title}{Writing Shell Commands with Directory Search} -'xrdef {Commands/Search-pg}{26} -'xrdef {Commands/Search-snt}{Section'tie4.3.3} -'xrdef {Implicit/Search-title}{Directory Search and Implicit Rules} -'xrdef {Implicit/Search-pg}{27} -'xrdef {Implicit/Search-snt}{Section'tie4.3.4} -'xrdef {Libraries/Search-title}{Directory Search for Link Libraries} -'xrdef {Libraries/Search-pg}{27} -'xrdef {Libraries/Search-snt}{Section'tie4.3.5} -'xrdef {Phony Targets-title}{Phony Targets} -'xrdef {Phony Targets-pg}{28} -'xrdef {Phony Targets-snt}{Section'tie4.4} -'xrdef {Force Targets-title}{Rules without Commands or Dependencies} -'xrdef {Force Targets-pg}{30} -'xrdef {Force Targets-snt}{Section'tie4.5} -'xrdef {Empty Targets-title}{Empty Target Files to Record Events} -'xrdef {Empty Targets-pg}{30} -'xrdef {Empty Targets-snt}{Section'tie4.6} -'xrdef {Special Targets-title}{Special Built-in Target Names} -'xrdef {Special Targets-pg}{31} -'xrdef {Special Targets-snt}{Section'tie4.7} -'xrdef {Multiple Targets-title}{Multiple Targets in a Rule} -'xrdef {Multiple Targets-pg}{32} -'xrdef {Multiple Targets-snt}{Section'tie4.8} -'xrdef {Multiple Rules-title}{Multiple Rules for One Target} -'xrdef {Multiple Rules-pg}{33} -'xrdef {Multiple Rules-snt}{Section'tie4.9} -'xrdef {Static Pattern-title}{Static Pattern Rules} -'xrdef {Static Pattern-pg}{34} -'xrdef {Static Pattern-snt}{Section'tie4.10} -'xrdef {Static Usage-title}{Syntax of Static Pattern Rules} -'xrdef {Static Usage-pg}{34} -'xrdef {Static Usage-snt}{Section'tie4.10.1} -'xrdef {Static versus Implicit-title}{Static Pattern Rules versus Implicit Rules} -'xrdef {Static versus Implicit-pg}{36} -'xrdef {Static versus Implicit-snt}{Section'tie4.10.2} -'xrdef {Double-Colon-title}{Double-Colon Rules} -'xrdef {Double-Colon-pg}{37} -'xrdef {Double-Colon-snt}{Section'tie4.11} -'xrdef {Automatic Dependencies-title}{Generating Dependencies Automatically} -'xrdef {Automatic Dependencies-pg}{37} -'xrdef {Automatic Dependencies-snt}{Section'tie4.12} -'xrdef {Commands-title}{Writing the Commands in Rules} -'xrdef {Commands-pg}{41} -'xrdef {Commands-snt}{Chapter'tie5} -'xrdef {Echoing-title}{Command Echoing} -'xrdef {Echoing-pg}{41} -'xrdef {Echoing-snt}{Section'tie5.1} -'xrdef {Execution-title}{Command Execution} -'xrdef {Execution-pg}{42} -'xrdef {Execution-snt}{Section'tie5.2} -'xrdef {Parallel-title}{Parallel Execution} -'xrdef {Parallel-pg}{42} -'xrdef {Parallel-snt}{Section'tie5.3} -'xrdef {Errors-title}{Errors in Commands} -'xrdef {Errors-pg}{44} -'xrdef {Errors-snt}{Section'tie5.4} -'xrdef {Interrupts-title}{Interrupting or Killing \code {make}} -'xrdef {Interrupts-pg}{45} -'xrdef {Interrupts-snt}{Section'tie5.5} -'xrdef {Recursion-title}{Recursive Use of \code {make}} -'xrdef {Recursion-pg}{46} -'xrdef {Recursion-snt}{Section'tie5.6} -'xrdef {MAKE Variable-title}{How the \code {MAKE} Variable Works} -'xrdef {MAKE Variable-pg}{46} -'xrdef {MAKE Variable-snt}{Section'tie5.6.1} -'xrdef {Variables/Recursion-title}{Communicating Variables to a Sub-\code {make}} -'xrdef {Variables/Recursion-pg}{47} -'xrdef {Variables/Recursion-snt}{Section'tie5.6.2} -'xrdef {Options/Recursion-title}{Communicating Options to a Sub-\code {make}} -'xrdef {Options/Recursion-pg}{50} -'xrdef {Options/Recursion-snt}{Section'tie5.6.3} -'xrdef {-w Option-title}{The \samp {--print-directory} Option} -'xrdef {-w Option-pg}{52} -'xrdef {-w Option-snt}{Section'tie5.6.4} -'xrdef {Sequences-title}{Defining Canned Command Sequences} -'xrdef {Sequences-pg}{52} -'xrdef {Sequences-snt}{Section'tie5.7} -'xrdef {Empty Commands-title}{Using Empty Commands} -'xrdef {Empty Commands-pg}{54} -'xrdef {Empty Commands-snt}{Section'tie5.8} -'xrdef {Using Variables-title}{How to Use Variables} -'xrdef {Using Variables-pg}{55} -'xrdef {Using Variables-snt}{Chapter'tie6} -'xrdef {Reference-title}{Basics of Variable References} -'xrdef {Reference-pg}{55} -'xrdef {Reference-snt}{Section'tie6.1} -'xrdef {Flavors-title}{The Two Flavors of Variables} -'xrdef {Flavors-pg}{56} -'xrdef {Flavors-snt}{Section'tie6.2} -'xrdef {Advanced-title}{Advanced Features for Reference to Variables} -'xrdef {Advanced-pg}{59} -'xrdef {Advanced-snt}{Section'tie6.3} -'xrdef {Substitution Refs-title}{Substitution References} -'xrdef {Substitution Refs-pg}{59} -'xrdef {Substitution Refs-snt}{Section'tie6.3.1} -'xrdef {Computed Names-title}{Computed Variable Names} -'xrdef {Computed Names-pg}{60} -'xrdef {Computed Names-snt}{Section'tie6.3.2} -'xrdef {Values-title}{How Variables Get Their Values} -'xrdef {Values-pg}{63} -'xrdef {Values-snt}{Section'tie6.4} -'xrdef {Setting-title}{Setting Variables} -'xrdef {Setting-pg}{63} -'xrdef {Setting-snt}{Section'tie6.5} -'xrdef {Appending-title}{Appending More Text to Variables} -'xrdef {Appending-pg}{64} -'xrdef {Appending-snt}{Section'tie6.6} -'xrdef {Override Directive-title}{The \code {override} Directive} -'xrdef {Override Directive-pg}{66} -'xrdef {Override Directive-snt}{Section'tie6.7} -'xrdef {Defining-title}{Defining Variables Verbatim} -'xrdef {Defining-pg}{67} -'xrdef {Defining-snt}{Section'tie6.8} -'xrdef {Environment-title}{Variables from the Environment} -'xrdef {Environment-pg}{68} -'xrdef {Environment-snt}{Section'tie6.9} -'xrdef {Conditionals-title}{Conditional Parts of Makefiles} -'xrdef {Conditionals-pg}{71} -'xrdef {Conditionals-snt}{Chapter'tie7} -'xrdef {Conditional Example-title}{Example of a Conditional} -'xrdef {Conditional Example-pg}{71} -'xrdef {Conditional Example-snt}{Section'tie7.1} -'xrdef {Conditional Syntax-title}{Syntax of Conditionals} -'xrdef {Conditional Syntax-pg}{72} -'xrdef {Conditional Syntax-snt}{Section'tie7.2} -'xrdef {Testing Flags-title}{Conditionals that Test Flags} -'xrdef {Testing Flags-pg}{75} -'xrdef {Testing Flags-snt}{Section'tie7.3} -'xrdef {Functions-title}{Functions for Transforming Text} -'xrdef {Functions-pg}{77} -'xrdef {Functions-snt}{Chapter'tie8} -'xrdef {Syntax of Functions-title}{Function Call Syntax} -'xrdef {Syntax of Functions-pg}{77} -'xrdef {Syntax of Functions-snt}{Section'tie8.1} -'xrdef {Text Functions-title}{Functions for String Substitution and Analysis} -'xrdef {Text Functions-pg}{78} -'xrdef {Text Functions-snt}{Section'tie8.2} -'xrdef {Filename Functions-title}{Functions for File Names} -'xrdef {Filename Functions-pg}{81} -'xrdef {Filename Functions-snt}{Section'tie8.3} -'xrdef {Foreach Function-title}{The \code {foreach} Function} -'xrdef {Foreach Function-pg}{83} -'xrdef {Foreach Function-snt}{Section'tie8.4} -'xrdef {Origin Function-title}{The \code {origin} Function} -'xrdef {Origin Function-pg}{85} -'xrdef {Origin Function-snt}{Section'tie8.5} -'xrdef {Shell Function-title}{The \code {shell} Function} -'xrdef {Shell Function-pg}{87} -'xrdef {Shell Function-snt}{Section'tie8.6} -'xrdef {Running-title}{How to Run \code {make}} -'xrdef {Running-pg}{89} -'xrdef {Running-snt}{Chapter'tie9} -'xrdef {Makefile Arguments-title}{Arguments to Specify the Makefile} -'xrdef {Makefile Arguments-pg}{89} -'xrdef {Makefile Arguments-snt}{Section'tie9.1} -'xrdef {Goals-title}{Arguments to Specify the Goals} -'xrdef {Goals-pg}{90} -'xrdef {Goals-snt}{Section'tie9.2} -'xrdef {Instead of Execution-title}{Instead of Executing the Commands} -'xrdef {Instead of Execution-pg}{91} -'xrdef {Instead of Execution-snt}{Section'tie9.3} -'xrdef {Avoiding Compilation-title}{Avoiding Recompilation of Some Files} -'xrdef {Avoiding Compilation-pg}{93} -'xrdef {Avoiding Compilation-snt}{Section'tie9.4} -'xrdef {Overriding-title}{Overriding Variables} -'xrdef {Overriding-pg}{94} -'xrdef {Overriding-snt}{Section'tie9.5} -'xrdef {Testing-title}{Testing the Compilation of a Program} -'xrdef {Testing-pg}{95} -'xrdef {Testing-snt}{Section'tie9.6} -'xrdef {Options Summary-title}{Summary of Options} -'xrdef {Options Summary-pg}{95} -'xrdef {Options Summary-snt}{Section'tie9.7} -'xrdef {Implicit Rules-title}{Using Implicit Rules} -'xrdef {Implicit Rules-pg}{101} -'xrdef {Implicit Rules-snt}{Chapter'tie10} -'xrdef {Using Implicit-title}{Using Implicit Rules} -'xrdef {Using Implicit-pg}{101} -'xrdef {Using Implicit-snt}{Section'tie10.1} -'xrdef {Catalogue of Rules-title}{Catalogue of Implicit Rules} -'xrdef {Catalogue of Rules-pg}{103} -'xrdef {Catalogue of Rules-snt}{Section'tie10.2} -'xrdef {Implicit Variables-title}{Variables Used by Implicit Rules} -'xrdef {Implicit Variables-pg}{106} -'xrdef {Implicit Variables-snt}{Section'tie10.3} -'xrdef {Chained Rules-title}{Chains of Implicit Rules} -'xrdef {Chained Rules-pg}{108} -'xrdef {Chained Rules-snt}{Section'tie10.4} -'xrdef {Pattern Rules-title}{Defining and Redefining Pattern Rules} -'xrdef {Pattern Rules-pg}{109} -'xrdef {Pattern Rules-snt}{Section'tie10.5} -'xrdef {Pattern Intro-title}{Introduction to Pattern Rules} -'xrdef {Pattern Intro-pg}{110} -'xrdef {Pattern Intro-snt}{Section'tie10.5.1} -'xrdef {Pattern Examples-title}{Pattern Rule Examples} -'xrdef {Pattern Examples-pg}{111} -'xrdef {Pattern Examples-snt}{Section'tie10.5.2} -'xrdef {Automatic-title}{Automatic Variables} -'xrdef {Automatic-pg}{112} -'xrdef {Automatic-snt}{Section'tie10.5.3} -'xrdef {Pattern Match-title}{How Patterns Match} -'xrdef {Pattern Match-pg}{114} -'xrdef {Pattern Match-snt}{Section'tie10.5.4} -'xrdef {Match-Anything Rules-title}{Match-Anything Pattern Rules} -'xrdef {Match-Anything Rules-pg}{115} -'xrdef {Match-Anything Rules-snt}{Section'tie10.5.5} -'xrdef {Canceling Rules-title}{Canceling Implicit Rules} -'xrdef {Canceling Rules-pg}{116} -'xrdef {Canceling Rules-snt}{Section'tie10.5.6} -'xrdef {Last Resort-title}{Defining Last-Resort Default Rules} -'xrdef {Last Resort-pg}{116} -'xrdef {Last Resort-snt}{Section'tie10.6} -'xrdef {Suffix Rules-title}{Old-Fashioned Suffix Rules} -'xrdef {Suffix Rules-pg}{117} -'xrdef {Suffix Rules-snt}{Section'tie10.7} -'xrdef {Search Algorithm-title}{Implicit Rule Search Algorithm} -'xrdef {Search Algorithm-pg}{119} -'xrdef {Search Algorithm-snt}{Section'tie10.8} -'xrdef {Archives-title}{Using \code {make} to Update Archive Files} -'xrdef {Archives-pg}{121} -'xrdef {Archives-snt}{Chapter'tie11} -'xrdef {Archive Members-title}{Archive Members as Targets} -'xrdef {Archive Members-pg}{121} -'xrdef {Archive Members-snt}{Section'tie11.1} -'xrdef {Archive Update-title}{Implicit Rule for Archive Member Targets} -'xrdef {Archive Update-pg}{122} -'xrdef {Archive Update-snt}{Section'tie11.2} -'xrdef {Archive Symbols-title}{Updating Archive Symbol Directories} -'xrdef {Archive Symbols-pg}{123} -'xrdef {Archive Symbols-snt}{Section'tie11.2.1} -'xrdef {Archive Pitfalls-title}{Dangers When Using Archives} -'xrdef {Archive Pitfalls-pg}{123} -'xrdef {Archive Pitfalls-snt}{Section'tie11.3} -'xrdef {Archive Suffix Rules-title}{Suffix Rules for Archive Files} -'xrdef {Archive Suffix Rules-pg}{124} -'xrdef {Archive Suffix Rules-snt}{Section'tie11.4} -'xrdef {Features-title}{Features of GNU \code {make}} -'xrdef {Features-pg}{125} -'xrdef {Features-snt}{Chapter'tie12} -'xrdef {Missing-title}{Incompatibilities and Missing Features} -'xrdef {Missing-pg}{129} -'xrdef {Missing-snt}{Chapter'tie13} -'xrdef {Makefile Conventions-title}{Makefile Conventions} -'xrdef {Makefile Conventions-pg}{131} -'xrdef {Makefile Conventions-snt}{Chapter'tie14} -'xrdef {Makefile Basics-title}{General Conventions for Makefiles} -'xrdef {Makefile Basics-pg}{131} -'xrdef {Makefile Basics-snt}{Section'tie14.1} -'xrdef {Utilities in Makefiles-title}{Utilities in Makefiles} -'xrdef {Utilities in Makefiles-pg}{132} -'xrdef {Utilities in Makefiles-snt}{Section'tie14.2} -'xrdef {Standard Targets-title}{Standard Targets for Users} -'xrdef {Standard Targets-pg}{133} -'xrdef {Standard Targets-snt}{Section'tie14.3} -'xrdef {Command Variables-title}{Variables for Specifying Commands} -'xrdef {Command Variables-pg}{136} -'xrdef {Command Variables-snt}{Section'tie14.4} -'xrdef {Directory Variables-title}{Variables for Installation Directories} -'xrdef {Directory Variables-pg}{138} -'xrdef {Directory Variables-snt}{Section'tie14.5} -'xrdef {Quick Reference-title}{Quick Reference} -'xrdef {Quick Reference-pg}{143} -'xrdef {Quick Reference-snt}{Appendix'tie'char65{}} -'xrdef {Complex Makefile-title}{Complex Makefile Example} -'xrdef {Complex Makefile-pg}{149} -'xrdef {Complex Makefile-snt}{Appendix'tie'char66{}} -'xrdef {Concept Index-title}{Index of Concepts} -'xrdef {Concept Index-pg}{155} -'xrdef {Concept Index-snt}{} -'xrdef {Name Index-title}{Index of Functions, Variables, & Directives} -'xrdef {Name Index-pg}{165} -'xrdef {Name Index-snt}{} diff --git a/buildtools/windows/source/make/make.cp b/buildtools/windows/source/make/make.cp deleted file mode 100644 index 04d05fb047e..00000000000 --- a/buildtools/windows/source/make/make.cp +++ /dev/null @@ -1,701 +0,0 @@ -\entry {POSIX}{1}{POSIX} -\entry {IEEE Standard 1003.2}{1}{IEEE Standard 1003.2} -\entry {standards conformance}{1}{standards conformance} -\entry {reporting bugs}{2}{reporting bugs} -\entry {bugs, reporting}{2}{bugs, reporting} -\entry {problems and bugs, reporting}{2}{problems and bugs, reporting} -\entry {makefile}{5}{makefile} -\entry {recompilation}{5}{recompilation} -\entry {editor}{5}{editor} -\entry {rule, introduction to}{5}{rule, introduction to} -\entry {makefile rule parts}{5}{makefile rule parts} -\entry {parts of makefile rule}{5}{parts of makefile rule} -\entry {targets, introduction to}{5}{targets, introduction to} -\entry {dependencies, introduction to}{5}{dependencies, introduction to} -\entry {commands, introduction to}{5}{commands, introduction to} -\entry {tabs in rules}{5}{tabs in rules} -\entry {simple makefile}{6}{simple makefile} -\entry {makefile, simple}{6}{makefile, simple} -\entry {continuation lines}{7}{continuation lines} -\entry {{\tt\indexbackslash } (backslash), for continuation lines}{7}{\code {{\tt\indexbackslash }} (backslash), for continuation lines} -\entry {backslash ({\tt\indexbackslash }), for continuation lines}{7}{backslash (\code {{\tt\indexbackslash }}), for continuation lines} -\entry {quoting newline, in makefile}{7}{quoting newline, in makefile} -\entry {newline, quoting, in makefile}{7}{newline, quoting, in makefile} -\entry {shell command}{8}{shell command} -\entry {clean target}{8}{\code {clean} target} -\entry {rm (shell command)}{8}{\code {rm} (shell command)} -\entry {processing a makefile}{8}{processing a makefile} -\entry {makefile, how make processes}{8}{makefile, how \code {make} processes} -\entry {default goal}{8}{default goal} -\entry {goal, default}{8}{goal, default} -\entry {goal}{8}{goal} -\entry {relinking}{9}{relinking} -\entry {variables}{9}{variables} -\entry {simplifying with variables}{9}{simplifying with variables} -\entry {objects}{9}{\code {objects}} -\entry {OBJECTS}{9}{\code {OBJECTS}} -\entry {objs}{9}{\code {objs}} -\entry {OBJS}{9}{\code {OBJS}} -\entry {obj}{9}{\code {obj}} -\entry {OBJ}{9}{\code {OBJ}} -\entry {deducing commands (implicit rules)}{10}{deducing commands (implicit rules)} -\entry {implicit rule, introduction to}{10}{implicit rule, introduction to} -\entry {rule, implicit, introduction to}{10}{rule, implicit, introduction to} -\entry {combining rules by dependency}{11}{combining rules by dependency} -\entry {cleaning up}{12}{cleaning up} -\entry {removing, to clean up}{12}{removing, to clean up} -\entry {clean target}{12}{\code {clean} target} -\entry {makefile, how to write}{13}{makefile, how to write} -\entry {rule, explicit, definition of}{13}{rule, explicit, definition of} -\entry {explicit rule, definition of}{13}{explicit rule, definition of} -\entry {rule, implicit, definition of}{13}{rule, implicit, definition of} -\entry {implicit rule, definition of}{13}{implicit rule, definition of} -\entry {variable definition}{13}{variable definition} -\entry {directive}{13}{directive} -\entry {comments, in makefile}{13}{comments, in makefile} -\entry {# (comments), in makefile}{13}{\code {#} (comments), in makefile} -\entry {makefile name}{14}{makefile name} -\entry {name of makefile}{14}{name of makefile} -\entry {default makefile name}{14}{default makefile name} -\entry {file name of makefile}{14}{file name of makefile} -\entry {README}{14}{\code {README}} -\entry {-f}{14}{\code {-f}} -\entry {--file}{14}{\code {--file}} -\entry {--makefile}{14}{\code {--makefile}} -\entry {specifying makefile name}{14}{specifying makefile name} -\entry {makefile name, how to specify}{14}{makefile name, how to specify} -\entry {name of makefile, how to specify}{14}{name of makefile, how to specify} -\entry {file name of makefile, how to specify}{14}{file name of makefile, how to specify} -\entry {including other makefiles}{14}{including other makefiles} -\entry {makefile, including}{14}{makefile, including} -\entry {shell file name pattern (in include)}{14}{shell file name pattern (in \code {include})} -\entry {shell wildcards (in include)}{14}{shell wildcards (in \code {include})} -\entry {wildcard, in include}{14}{wildcard, in \code {include}} -\entry {dependencies, automatic generation}{15}{dependencies, automatic generation} -\entry {automatic generation of dependencies}{15}{automatic generation of dependencies} -\entry {generating dependencies automatically}{15}{generating dependencies automatically} -\entry {-I}{15}{\code {-I}} -\entry {--include-dir}{15}{\code {--include-dir}} -\entry {makefile, and MAKEFILES variable}{16}{makefile, and \code {MAKEFILES} variable} -\entry {including (MAKEFILES variable)}{16}{including (\code {MAKEFILES} variable)} -\entry {recursion, and MAKEFILES variable}{16}{recursion, and \code {MAKEFILES} variable} -\entry {updating makefiles}{16}{updating makefiles} -\entry {remaking makefiles}{16}{remaking makefiles} -\entry {makefile, remaking of}{16}{makefile, remaking of} -\entry {overriding makefiles}{18}{overriding makefiles} -\entry {makefile, overriding}{18}{makefile, overriding} -\entry {match-anything rule, used to override}{18}{match-anything rule, used to override} -\entry {writing rules}{19}{writing rules} -\entry {rule, how to write}{19}{rule, how to write} -\entry {target}{19}{target} -\entry {dependency}{19}{dependency} -\entry {default goal}{19}{default goal} -\entry {goal, default}{19}{goal, default} -\entry {rule syntax}{19}{rule syntax} -\entry {syntax of rules}{19}{syntax of rules} -\entry {targets}{19}{targets} -\entry {rule targets}{19}{rule targets} -\entry {commands}{19}{commands} -\entry {tab character (in commands)}{19}{tab character (in commands)} -\entry {dollar sign ($), in rules}{20}{dollar sign (\code {$}), in rules} -\entry {$, in rules}{20}{\code {$}, in rules} -\entry {rule, and $}{20}{rule, and \code {$}} -\entry {dependencies}{20}{dependencies} -\entry {rule dependencies}{20}{rule dependencies} -\entry {wildcard}{20}{wildcard} -\entry {file name with wildcards}{20}{file name with wildcards} -\entry {globbing (wildcards)}{20}{globbing (wildcards)} -\entry {* (wildcard character)}{20}{\code {*} (wildcard character)} -\entry {? (wildcard character)}{20}{\code {?} (wildcard character)} -\entry {[...{}] (wildcard characters)}{20}{\code {[\dots {}]} (wildcard characters)} -\entry {{\tt\char'176} (tilde)}{20}{\code {{\tt\char'176}} (tilde)} -\entry {tilde ({\tt\char'176})}{20}{tilde (\code {{\tt\char'176}})} -\entry {home directory}{20}{home directory} -\entry {rm (shell command)}{21}{\code {rm} (shell command)} -\entry {print target}{21}{\code {print} target} -\entry {lpr (shell command)}{21}{\code {lpr} (shell command)} -\entry {touch (shell command)}{21}{\code {touch} (shell command)} -\entry {wildcard pitfalls}{22}{wildcard pitfalls} -\entry {pitfalls of wildcards}{22}{pitfalls of wildcards} -\entry {mistakes with wildcards}{22}{mistakes with wildcards} -\entry {errors with wildcards}{22}{errors with wildcards} -\entry {problems with wildcards}{22}{problems with wildcards} -\entry {vpath}{23}{vpath} -\entry {search path for dependencies (VPATH)}{23}{search path for dependencies (\code {VPATH})} -\entry {directory search (VPATH)}{23}{directory search (\code {VPATH})} -\entry {%, quoting in vpath}{25}{\code {%}, quoting in \code {vpath}} -\entry {%, quoting with {\tt\indexbackslash } (backslash)}{25}{\code {%}, quoting with \code {{\tt\indexbackslash }} (backslash)} -\entry {{\tt\indexbackslash } (backslash), to quote %}{25}{\code {{\tt\indexbackslash }} (backslash), to quote \code {%}} -\entry {backslash ({\tt\indexbackslash }), to quote %}{25}{backslash (\code {{\tt\indexbackslash }}), to quote \code {%}} -\entry {quoting %, in vpath}{25}{quoting \code {%}, in \code {vpath}} -\entry {shell command, and directory search}{26}{shell command, and directory search} -\entry {directory search (VPATH), and shell commands}{26}{directory search (\code {VPATH}), and shell commands} -\entry {VPATH, and implicit rules}{27}{\code {VPATH}, and implicit rules} -\entry {directory search (VPATH), and implicit rules}{27}{directory search (\code {VPATH}), and implicit rules} -\entry {search path for dependencies (VPATH), and implicit rules}{27}{search path for dependencies (\code {VPATH}), and implicit rules} -\entry {implicit rule, and directory search}{27}{implicit rule, and directory search} -\entry {implicit rule, and VPATH}{27}{implicit rule, and \code {VPATH}} -\entry {rule, implicit, and directory search}{27}{rule, implicit, and directory search} -\entry {rule, implicit, and VPATH}{27}{rule, implicit, and \code {VPATH}} -\entry {link libraries, and directory search}{27}{link libraries, and directory search} -\entry {libraries for linking, directory search}{27}{libraries for linking, directory search} -\entry {directory search (VPATH), and link libraries}{27}{directory search (\code {VPATH}), and link libraries} -\entry {VPATH, and link libraries}{27}{\code {VPATH}, and link libraries} -\entry {search path for dependencies (VPATH), and link libraries}{27}{search path for dependencies (\code {VPATH}), and link libraries} -\entry {-l (library search)}{27}{\code {-l} (library search)} -\entry {phony targets}{28}{phony targets} -\entry {targets, phony}{28}{targets, phony} -\entry {targets without a file}{28}{targets without a file} -\entry {rm (shell command)}{28}{\code {rm} (shell command)} -\entry {force targets}{30}{force targets} -\entry {targets, force}{30}{targets, force} -\entry {FORCE}{30}{\code {FORCE}} -\entry {rule, no commands or dependencies}{30}{rule, no commands or dependencies} -\entry {empty targets}{30}{empty targets} -\entry {targets, empty}{30}{targets, empty} -\entry {recording events with empty targets}{30}{recording events with empty targets} -\entry {print target}{30}{\code {print} target} -\entry {lpr (shell command)}{30}{\code {lpr} (shell command)} -\entry {touch (shell command)}{30}{\code {touch} (shell command)} -\entry {special targets}{31}{special targets} -\entry {built-in special targets}{31}{built-in special targets} -\entry {targets, built-in special}{31}{targets, built-in special} -\entry {precious targets}{31}{precious targets} -\entry {preserving with .PRECIOUS}{31}{preserving with \code {.PRECIOUS}} -\entry {multiple targets}{32}{multiple targets} -\entry {several targets in a rule}{32}{several targets in a rule} -\entry {targets, multiple}{32}{targets, multiple} -\entry {rule, with multiple targets}{32}{rule, with multiple targets} -\entry {multiple rules for one target}{33}{multiple rules for one target} -\entry {several rules for one target}{33}{several rules for one target} -\entry {rule, multiple for one target}{33}{rule, multiple for one target} -\entry {target, multiple rules for one}{33}{target, multiple rules for one} -\entry {static pattern rule}{34}{static pattern rule} -\entry {rule, static pattern}{34}{rule, static pattern} -\entry {pattern rules, static (not implicit)}{34}{pattern rules, static (not implicit)} -\entry {varying dependencies}{34}{varying dependencies} -\entry {dependencies, varying (static pattern)}{34}{dependencies, varying (static pattern)} -\entry {static pattern rule, syntax of}{34}{static pattern rule, syntax of} -\entry {pattern rules, static, syntax of}{34}{pattern rules, static, syntax of} -\entry {target pattern, static (not implicit)}{35}{target pattern, static (not implicit)} -\entry {stem}{35}{stem} -\entry {dependency pattern, static (not implicit)}{35}{dependency pattern, static (not implicit)} -\entry {%, quoting in static pattern}{35}{\code {%}, quoting in static pattern} -\entry {%, quoting with {\tt\indexbackslash } (backslash)}{35}{\code {%}, quoting with \code {{\tt\indexbackslash }} (backslash)} -\entry {{\tt\indexbackslash } (backslash), to quote %}{35}{\code {{\tt\indexbackslash }} (backslash), to quote \code {%}} -\entry {backslash ({\tt\indexbackslash }), to quote %}{35}{backslash (\code {{\tt\indexbackslash }}), to quote \code {%}} -\entry {quoting %, in static pattern}{35}{quoting \code {%}, in static pattern} -\entry {rule, static pattern versus implicit}{36}{rule, static pattern versus implicit} -\entry {static pattern rule, versus implicit}{36}{static pattern rule, versus implicit} -\entry {double-colon rules}{37}{double-colon rules} -\entry {rule, double-colon (::)}{37}{rule, double-colon (\code {::})} -\entry {multiple rules for one target (::)}{37}{multiple rules for one target (\code {::})} -\entry {:: rules (double-colon)}{37}{\code {::} rules (double-colon)} -\entry {dependencies, automatic generation}{37}{dependencies, automatic generation} -\entry {automatic generation of dependencies}{37}{automatic generation of dependencies} -\entry {generating dependencies automatically}{37}{generating dependencies automatically} -\entry {#include}{38}{\code {#include}} -\entry {-M (to compiler)}{38}{\code {-M} (to compiler)} -\entry {make depend}{38}{\code {make depend}} -\entry {-e (shell flag)}{39}{\code {-e} (shell flag)} -\entry {-MM (to GNU compiler)}{39}{\code {-MM} (to GNU compiler)} -\entry {sed (shell command)}{39}{\code {sed} (shell command)} -\entry {.d}{39}{\code {.d}} -\entry {commands, how to write}{41}{commands, how to write} -\entry {rule commands}{41}{rule commands} -\entry {writing rule commands}{41}{writing rule commands} -\entry {comments, in commands}{41}{comments, in commands} -\entry {commands, comments in}{41}{commands, comments in} -\entry {# (comments), in commands}{41}{\code {#} (comments), in commands} -\entry {echoing of commands}{41}{echoing of commands} -\entry {silent operation}{41}{silent operation} -\entry {{\tt\char'100} (in commands)}{41}{\code {{\tt\char'100}} (in commands)} -\entry {commands, echoing}{41}{commands, echoing} -\entry {printing of commands}{41}{printing of commands} -\entry {-n}{41}{\code {-n}} -\entry {--just-print}{41}{\code {--just-print}} -\entry {--dry-run}{41}{\code {--dry-run}} -\entry {--recon}{41}{\code {--recon}} -\entry {-s}{41}{\code {-s}} -\entry {--silent}{41}{\code {--silent}} -\entry {--quiet}{41}{\code {--quiet}} -\entry {commands, execution}{42}{commands, execution} -\entry {execution, of commands}{42}{execution, of commands} -\entry {shell command, execution}{42}{shell command, execution} -\entry {cd (shell command)}{42}{\code {cd} (shell command)} -\entry {commands, backslash ({\tt\indexbackslash }) in}{42}{commands, backslash (\code {{\tt\indexbackslash }}) in} -\entry {commands, quoting newlines in}{42}{commands, quoting newlines in} -\entry {backslash ({\tt\indexbackslash }), in commands}{42}{backslash (\code {{\tt\indexbackslash }}), in commands} -\entry {{\tt\indexbackslash } (backslash), in commands}{42}{\code {{\tt\indexbackslash }} (backslash), in commands} -\entry {quoting newline, in commands}{42}{quoting newline, in commands} -\entry {newline, quoting, in commands}{42}{newline, quoting, in commands} -\entry {environment, SHELL in}{42}{environment, \code {SHELL} in} -\entry {commands, execution in parallel}{42}{commands, execution in parallel} -\entry {parallel execution}{42}{parallel execution} -\entry {execution, in parallel}{42}{execution, in parallel} -\entry {job slots}{42}{job slots} -\entry {-j}{42}{\code {-j}} -\entry {--jobs}{42}{\code {--jobs}} -\entry {broken pipe}{43}{broken pipe} -\entry {standard input}{43}{standard input} -\entry {load average}{43}{load average} -\entry {limiting jobs based on load}{43}{limiting jobs based on load} -\entry {jobs, limiting based on load}{43}{jobs, limiting based on load} -\entry {-l (load average)}{43}{\code {-l} (load average)} -\entry {--max-load}{43}{\code {--max-load}} -\entry {--load-average}{43}{\code {--load-average}} -\entry {errors (in commands)}{44}{errors (in commands)} -\entry {commands, errors in}{44}{commands, errors in} -\entry {exit status (errors)}{44}{exit status (errors)} -\entry {- (in commands)}{44}{\code {-} (in commands)} -\entry {rm (shell command)}{44}{\code {rm} (shell command)} -\entry {-i}{44}{\code {-i}} -\entry {--ignore-errors}{44}{\code {--ignore-errors}} -\entry {-k}{45}{\code {-k}} -\entry {--keep-going}{45}{\code {--keep-going}} -\entry {Emacs (M-x compile)}{45}{Emacs (\code {M-x compile})} -\entry {deletion of target files}{45}{deletion of target files} -\entry {removal of target files}{45}{removal of target files} -\entry {target, deleting on error}{45}{target, deleting on error} -\entry {interrupt}{45}{interrupt} -\entry {signal}{45}{signal} -\entry {deletion of target files}{45}{deletion of target files} -\entry {removal of target files}{45}{removal of target files} -\entry {target, deleting on interrupt}{45}{target, deleting on interrupt} -\entry {killing (interruption)}{45}{killing (interruption)} -\entry {recursion}{46}{recursion} -\entry {subdirectories, recursion for}{46}{subdirectories, recursion for} -\entry {-C}{46}{\code {-C}} -\entry {--directory}{46}{\code {--directory}} -\entry {recursion, and MAKE variable}{46}{recursion, and \code {MAKE} variable} -\entry {cd (shell command)}{47}{\code {cd} (shell command)} -\entry {-t, and recursion}{47}{\code {-t}, and recursion} -\entry {recursion, and -t}{47}{recursion, and \code {-t}} -\entry {--touch, and recursion}{47}{\code {--touch}, and recursion} -\entry {sub-make}{47}{sub-\code {make}} -\entry {environment, and recursion}{47}{environment, and recursion} -\entry {exporting variables}{47}{exporting variables} -\entry {variables, environment}{47}{variables, environment} -\entry {variables, exporting}{47}{variables, exporting} -\entry {recursion, and environment}{47}{recursion, and environment} -\entry {recursion, and variables}{47}{recursion, and variables} -\entry {compatibility in exporting}{49}{compatibility in exporting} -\entry {recursion, level of}{49}{recursion, level of} -\entry {options, and recursion}{50}{options, and recursion} -\entry {recursion, and options}{50}{recursion, and options} -\entry {command line variable definitions, and recursion}{50}{command line variable definitions, and recursion} -\entry {variables, command line, and recursion}{50}{variables, command line, and recursion} -\entry {recursion, and command line variable definitions}{50}{recursion, and command line variable definitions} -\entry {-C, and recursion}{50}{\code {-C}, and recursion} -\entry {-f, and recursion}{50}{\code {-f}, and recursion} -\entry {-o, and recursion}{50}{\code {-o}, and recursion} -\entry {-W, and recursion}{50}{\code {-W}, and recursion} -\entry {--directory, and recursion}{50}{\code {--directory}, and recursion} -\entry {--file, and recursion}{50}{\code {--file}, and recursion} -\entry {--old-file, and recursion}{50}{\code {--old-file}, and recursion} -\entry {--assume-old, and recursion}{50}{\code {--assume-old}, and recursion} -\entry {--assume-new, and recursion}{50}{\code {--assume-new}, and recursion} -\entry {--new-file, and recursion}{50}{\code {--new-file}, and recursion} -\entry {recursion, and -C}{50}{recursion, and \code {-C}} -\entry {recursion, and -f}{50}{recursion, and \code {-f}} -\entry {recursion, and -o}{50}{recursion, and \code {-o}} -\entry {recursion, and -W}{50}{recursion, and \code {-W}} -\entry {-j, and recursion}{50}{\code {-j}, and recursion} -\entry {--jobs, and recursion}{50}{\code {--jobs}, and recursion} -\entry {recursion, and -j}{50}{recursion, and \code {-j}} -\entry {job slots, and recursion}{50}{job slots, and recursion} -\entry {Arg list too long}{51}{Arg list too long} -\entry {E2BIG}{51}{E2BIG} -\entry {POSIX.2}{51}{POSIX.2} -\entry {setting options from environment}{51}{setting options from environment} -\entry {options, setting from environment}{51}{options, setting from environment} -\entry {setting options in makefiles}{51}{setting options in makefiles} -\entry {options, setting in makefiles}{51}{options, setting in makefiles} -\entry {directories, printing them}{52}{directories, printing them} -\entry {printing directories}{52}{printing directories} -\entry {recursion, and printing directories}{52}{recursion, and printing directories} -\entry {-C, and -w}{52}{\code {-C}, and \code {-w}} -\entry {--directory, and --print-directory}{52}{\code {--directory}, and \code {--print-directory}} -\entry {recursion, and -w}{52}{recursion, and \code {-w}} -\entry {-w, and -C}{52}{\code {-w}, and \code {-C}} -\entry {-w, and recursion}{52}{\code {-w}, and recursion} -\entry {--print-directory, and --directory}{52}{\code {--print-directory}, and \code {--directory}} -\entry {--print-directory, and recursion}{52}{\code {--print-directory}, and recursion} -\entry {--no-print-directory}{52}{\code {--no-print-directory}} -\entry {--print-directory, disabling}{52}{\code {--print-directory}, disabling} -\entry {-w, disabling}{52}{\code {-w}, disabling} -\entry {sequences of commands}{52}{sequences of commands} -\entry {commands, sequences of}{52}{commands, sequences of} -\entry {yacc}{53}{\code {yacc}} -\entry {{\tt\char'100}, and define}{53}{{\tt\char'100}, and \code {define}} -\entry {-, and define}{53}{-, and \code {define}} -\entry {{\tt\char43}, and define}{53}{{\tt\char43}, and \code {define}} -\entry {empty commands}{54}{empty commands} -\entry {commands, empty}{54}{commands, empty} -\entry {variable}{55}{variable} -\entry {value}{55}{value} -\entry {recursive variable expansion}{55}{recursive variable expansion} -\entry {simple variable expansion}{55}{simple variable expansion} -\entry {macro}{55}{macro} -\entry {variables, how to reference}{55}{variables, how to reference} -\entry {reference to variables}{55}{reference to variables} -\entry {$, in variable reference}{55}{\code {$}, in variable reference} -\entry {dollar sign ($), in variable reference}{55}{dollar sign (\code {$}), in variable reference} -\entry {flavors of variables}{56}{flavors of variables} -\entry {recursive variable expansion}{56}{recursive variable expansion} -\entry {variables, flavors}{56}{variables, flavors} -\entry {recursively expanded variables}{56}{recursively expanded variables} -\entry {variables, recursively expanded}{56}{variables, recursively expanded} -\entry {=}{56}{=} -\entry {loops in variable expansion}{57}{loops in variable expansion} -\entry {variables, loops in expansion}{57}{variables, loops in expansion} -\entry {simply expanded variables}{57}{simply expanded variables} -\entry {variables, simply expanded}{57}{variables, simply expanded} -\entry {:=}{57}{:=} -\entry {spaces, in variable values}{58}{spaces, in variable values} -\entry {whitespace, in variable values}{58}{whitespace, in variable values} -\entry {variables, spaces in values}{58}{variables, spaces in values} -\entry {reference to variables}{59}{reference to variables} -\entry {modified variable reference}{59}{modified variable reference} -\entry {substitution variable reference}{59}{substitution variable reference} -\entry {variables, modified reference}{59}{variables, modified reference} -\entry {variables, substitution reference}{59}{variables, substitution reference} -\entry {variables, substituting suffix in}{59}{variables, substituting suffix in} -\entry {suffix, substituting in variables}{59}{suffix, substituting in variables} -\entry {nested variable reference}{60}{nested variable reference} -\entry {computed variable name}{60}{computed variable name} -\entry {variables, computed names}{60}{variables, computed names} -\entry {variables, nested references}{60}{variables, nested references} -\entry {variables, $ in name}{60}{variables, \samp {$} in name} -\entry {$, in variable name}{60}{\code {$}, in variable name} -\entry {dollar sign ($), in variable name}{60}{dollar sign (\code {$}), in variable name} -\entry {variables, how they get their values}{63}{variables, how they get their values} -\entry {value, how a variable gets it}{63}{value, how a variable gets it} -\entry {setting variables}{63}{setting variables} -\entry {variables, setting}{63}{variables, setting} -\entry {=}{63}{=} -\entry {:=}{63}{:=} -\entry {{\tt\char43}=}{64}{{\tt\char43}=} -\entry {appending to variables}{64}{appending to variables} -\entry {variables, appending to}{64}{variables, appending to} -\entry {overriding with override}{66}{overriding with \code {override}} -\entry {variables, overriding}{66}{variables, overriding} -\entry {verbatim variable definition}{67}{verbatim variable definition} -\entry {defining variables verbatim}{67}{defining variables verbatim} -\entry {variables, defining verbatim}{67}{variables, defining verbatim} -\entry {variables, environment}{68}{variables, environment} -\entry {environment}{68}{environment} -\entry {conditionals}{71}{conditionals} -\entry {functions}{77}{functions} -\entry {$, in function call}{77}{\code {$}, in function call} -\entry {dollar sign ($), in function call}{77}{dollar sign (\code {$}), in function call} -\entry {arguments of functions}{77}{arguments of functions} -\entry {functions, syntax of}{77}{functions, syntax of} -\entry {functions, for text}{78}{functions, for text} -\entry {%, quoting in patsubst}{78}{\code {%}, quoting in \code {patsubst}} -\entry {%, quoting with {\tt\indexbackslash } (backslash)}{78}{\code {%}, quoting with \code {{\tt\indexbackslash }} (backslash)} -\entry {{\tt\indexbackslash } (backslash), to quote %}{78}{\code {{\tt\indexbackslash }} (backslash), to quote \code {%}} -\entry {backslash ({\tt\indexbackslash }), to quote %}{78}{backslash (\code {{\tt\indexbackslash }}), to quote \code {%}} -\entry {quoting %, in patsubst}{78}{quoting \code {%}, in \code {patsubst}} -\entry {stripping whitespace}{79}{stripping whitespace} -\entry {whitespace, stripping}{79}{whitespace, stripping} -\entry {spaces, stripping}{79}{spaces, stripping} -\entry {searching for strings}{79}{searching for strings} -\entry {finding strings}{79}{finding strings} -\entry {strings, searching for}{79}{strings, searching for} -\entry {filtering words}{80}{filtering words} -\entry {words, filtering}{80}{words, filtering} -\entry {filtering out words}{80}{filtering out words} -\entry {words, filtering out}{80}{words, filtering out} -\entry {sorting words}{80}{sorting words} -\entry {removing duplicate words}{80}{removing duplicate words} -\entry {duplicate words, removing}{80}{duplicate words, removing} -\entry {words, removing duplicates}{80}{words, removing duplicates} -\entry {functions, for file names}{81}{functions, for file names} -\entry {file name functions}{81}{file name functions} -\entry {directory part}{81}{directory part} -\entry {file name, directory part}{81}{file name, directory part} -\entry {file name, nondirectory part}{81}{file name, nondirectory part} -\entry {nondirectory part}{81}{nondirectory part} -\entry {suffix, function to find}{82}{suffix, function to find} -\entry {file name suffix}{82}{file name suffix} -\entry {basename}{82}{basename} -\entry {file name, basename of}{82}{file name, basename of} -\entry {suffix, adding}{82}{suffix, adding} -\entry {file name suffix, adding}{82}{file name suffix, adding} -\entry {prefix, adding}{82}{prefix, adding} -\entry {file name prefix, adding}{82}{file name prefix, adding} -\entry {joining lists of words}{82}{joining lists of words} -\entry {words, joining lists}{82}{words, joining lists} -\entry {words, selecting}{83}{words, selecting} -\entry {selecting words}{83}{selecting words} -\entry {words, finding number}{83}{words, finding number} -\entry {words, extracting first}{83}{words, extracting first} -\entry {wildcard, function}{83}{wildcard, function} -\entry {words, iterating over}{83}{words, iterating over} -\entry {variables, origin of}{85}{variables, origin of} -\entry {origin of variable}{85}{origin of variable} -\entry {commands, expansion}{87}{commands, expansion} -\entry {backquotes}{87}{backquotes} -\entry {shell command, function for}{87}{shell command, function for} -\entry {--file}{89}{\code {--file}} -\entry {--makefile}{89}{\code {--makefile}} -\entry {-f}{89}{\code {-f}} -\entry {goal, how to specify}{90}{goal, how to specify} -\entry {all (standard target)}{91}{\code {all} \r {(standard target)}} -\entry {clean (standard target)}{91}{\code {clean} \r {(standard target)}} -\entry {mostlyclean (standard target)}{91}{\code {mostlyclean} \r {(standard target)}} -\entry {distclean (standard target)}{91}{\code {distclean} \r {(standard target)}} -\entry {realclean (standard target)}{91}{\code {realclean} \r {(standard target)}} -\entry {clobber (standard target)}{91}{\code {clobber} \r {(standard target)}} -\entry {install (standard target)}{91}{\code {install} \r {(standard target)}} -\entry {print (standard target)}{91}{\code {print} \r {(standard target)}} -\entry {tar (standard target)}{91}{\code {tar} \r {(standard target)}} -\entry {shar (standard target)}{91}{\code {shar} \r {(standard target)}} -\entry {dist (standard target)}{91}{\code {dist} \r {(standard target)}} -\entry {TAGS (standard target)}{91}{\code {TAGS} \r {(standard target)}} -\entry {check (standard target)}{91}{\code {check} \r {(standard target)}} -\entry {test (standard target)}{91}{\code {test} \r {(standard target)}} -\entry {execution, instead of}{91}{execution, instead of} -\entry {commands, instead of executing}{91}{commands, instead of executing} -\entry {--just-print}{91}{\code {--just-print}} -\entry {--dry-run}{91}{\code {--dry-run}} -\entry {--recon}{91}{\code {--recon}} -\entry {-n}{91}{\code {-n}} -\entry {--touch}{92}{\code {--touch}} -\entry {touching files}{92}{touching files} -\entry {target, touching}{92}{target, touching} -\entry {-t}{92}{\code {-t}} -\entry {--question}{92}{\code {--question}} -\entry {-q}{92}{\code {-q}} -\entry {question mode}{92}{question mode} -\entry {--what-if}{92}{\code {--what-if}} -\entry {-W}{92}{\code {-W}} -\entry {--assume-new}{92}{\code {--assume-new}} -\entry {--new-file}{92}{\code {--new-file}} -\entry {what if}{92}{what if} -\entry {files, assuming new}{92}{files, assuming new} -\entry {-o}{93}{\code {-o}} -\entry {--old-file}{93}{\code {--old-file}} -\entry {--assume-old}{93}{\code {--assume-old}} -\entry {files, assuming old}{93}{files, assuming old} -\entry {files, avoiding recompilation of}{93}{files, avoiding recompilation of} -\entry {recompilation, avoiding}{93}{recompilation, avoiding} -\entry {overriding variables with arguments}{94}{overriding variables with arguments} -\entry {variables, overriding with arguments}{94}{variables, overriding with arguments} -\entry {command line variables}{94}{command line variables} -\entry {variables, command line}{94}{variables, command line} -\entry {testing compilation}{95}{testing compilation} -\entry {compilation, testing}{95}{compilation, testing} -\entry {-k}{95}{\code {-k}} -\entry {--keep-going}{95}{\code {--keep-going}} -\entry {options}{95}{options} -\entry {flags}{95}{flags} -\entry {switches}{95}{switches} -\entry {-b}{95}{\code {-b}} -\entry {-m}{95}{\code {-m}} -\entry {-C}{95}{\code {-C}} -\entry {--directory}{95}{\code {--directory}} -\entry {-d}{96}{\code {-d}} -\entry {--debug}{96}{\code {--debug}} -\entry {-e}{96}{\code {-e}} -\entry {--environment-overrides}{96}{\code {--environment-overrides}} -\entry {-f}{96}{\code {-f}} -\entry {--file}{96}{\code {--file}} -\entry {--makefile}{96}{\code {--makefile}} -\entry {-h}{96}{\code {-h}} -\entry {--help}{96}{\code {--help}} -\entry {-i}{96}{\code {-i}} -\entry {--ignore-errors}{96}{\code {--ignore-errors}} -\entry {-I}{96}{\code {-I}} -\entry {--include-dir}{96}{\code {--include-dir}} -\entry {-j}{96}{\code {-j}} -\entry {--jobs}{96}{\code {--jobs}} -\entry {-k}{96}{\code {-k}} -\entry {--keep-going}{96}{\code {--keep-going}} -\entry {-l}{97}{\code {-l}} -\entry {--load-average}{97}{\code {--load-average}} -\entry {--max-load}{97}{\code {--max-load}} -\entry {-n}{97}{\code {-n}} -\entry {--just-print}{97}{\code {--just-print}} -\entry {--dry-run}{97}{\code {--dry-run}} -\entry {--recon}{97}{\code {--recon}} -\entry {-o}{97}{\code {-o}} -\entry {--old-file}{97}{\code {--old-file}} -\entry {--assume-old}{97}{\code {--assume-old}} -\entry {-p}{97}{\code {-p}} -\entry {--print-data-base}{97}{\code {--print-data-base}} -\entry {-q}{97}{\code {-q}} -\entry {--question}{97}{\code {--question}} -\entry {-r}{97}{\code {-r}} -\entry {--no-builtin-rules}{97}{\code {--no-builtin-rules}} -\entry {-s}{97}{\code {-s}} -\entry {--silent}{98}{\code {--silent}} -\entry {--quiet}{98}{\code {--quiet}} -\entry {-S}{98}{\code {-S}} -\entry {--no-keep-going}{98}{\code {--no-keep-going}} -\entry {--stop}{98}{\code {--stop}} -\entry {-t}{98}{\code {-t}} -\entry {--touch}{98}{\code {--touch}} -\entry {-v}{98}{\code {-v}} -\entry {--version}{98}{\code {--version}} -\entry {-w}{98}{\code {-w}} -\entry {--print-directory}{98}{\code {--print-directory}} -\entry {--no-print-directory}{98}{\code {--no-print-directory}} -\entry {-W}{98}{\code {-W}} -\entry {--what-if}{98}{\code {--what-if}} -\entry {--new-file}{98}{\code {--new-file}} -\entry {--assume-new}{98}{\code {--assume-new}} -\entry {--warn-undefined-variables}{99}{\code {--warn-undefined-variables}} -\entry {variables, warning for undefined}{99}{variables, warning for undefined} -\entry {undefined variables, warning message}{99}{undefined variables, warning message} -\entry {implicit rule}{101}{implicit rule} -\entry {rule, implicit}{101}{rule, implicit} -\entry {implicit rule, how to use}{101}{implicit rule, how to use} -\entry {rule, implicit, how to use}{101}{rule, implicit, how to use} -\entry {implicit rule, predefined}{103}{implicit rule, predefined} -\entry {rule, implicit, predefined}{103}{rule, implicit, predefined} -\entry {C, rule to compile}{103}{C, rule to compile} -\entry {cc}{103}{\code {cc}} -\entry {gcc}{103}{\code {gcc}} -\entry {.o}{103}{\code {.o}} -\entry {.c}{103}{\code {.c}} -\entry {C{\tt\char43}{\tt\char43}, rule to compile}{103}{C{\tt\char43}{\tt\char43}, rule to compile} -\entry {g{\tt\char43}{\tt\char43}}{103}{\code {g{\tt\char43}{\tt\char43}}} -\entry {.C}{103}{\code {.C}} -\entry {.cc}{103}{\code {.cc}} -\entry {Pascal, rule to compile}{103}{Pascal, rule to compile} -\entry {pc}{103}{\code {pc}} -\entry {.p}{103}{\code {.p}} -\entry {Fortran, rule to compile}{103}{Fortran, rule to compile} -\entry {Ratfor, rule to compile}{103}{Ratfor, rule to compile} -\entry {f77}{103}{\code {f77}} -\entry {.f}{103}{\code {.f}} -\entry {.r}{103}{\code {.r}} -\entry {.F}{103}{\code {.F}} -\entry {Modula-2, rule to compile}{104}{Modula-2, rule to compile} -\entry {m2c}{104}{\code {m2c}} -\entry {.sym}{104}{\code {.sym}} -\entry {.def}{104}{\code {.def}} -\entry {.mod}{104}{\code {.mod}} -\entry {assembly, rule to compile}{104}{assembly, rule to compile} -\entry {as}{104}{\code {as}} -\entry {.s}{104}{\code {.s}} -\entry {.S}{104}{\code {.S}} -\entry {linking, predefined rule for}{104}{linking, predefined rule for} -\entry {ld}{104}{\code {ld}} -\entry {.o}{104}{\code {.o}} -\entry {yacc}{105}{\code {yacc}} -\entry {Yacc, rule to run}{105}{Yacc, rule to run} -\entry {.y}{105}{\code {.y}} -\entry {lex}{105}{\code {lex}} -\entry {Lex, rule to run}{105}{Lex, rule to run} -\entry {.l}{105}{\code {.l}} -\entry {lint}{105}{\code {lint}} -\entry {lint, rule to run}{105}{\code {lint}, rule to run} -\entry {.ln}{105}{\code {.ln}} -\entry {TeX{}, rule to run}{105}{\TeX{}, rule to run} -\entry {Web, rule to run}{105}{Web, rule to run} -\entry {tex}{105}{\code {tex}} -\entry {cweave}{105}{\code {cweave}} -\entry {weave}{105}{\code {weave}} -\entry {tangle}{105}{\code {tangle}} -\entry {ctangle}{105}{\code {ctangle}} -\entry {.dvi}{105}{\code {.dvi}} -\entry {.tex}{105}{\code {.tex}} -\entry {.web}{105}{\code {.web}} -\entry {.w}{105}{\code {.w}} -\entry {.ch}{105}{\code {.ch}} -\entry {Texinfo, rule to format}{105}{Texinfo, rule to format} -\entry {Info, rule to format}{105}{Info, rule to format} -\entry {texi2dvi}{105}{\code {texi2dvi}} -\entry {makeinfo}{105}{\code {makeinfo}} -\entry {.texinfo}{105}{\code {.texinfo}} -\entry {.info}{105}{\code {.info}} -\entry {.texi}{105}{\code {.texi}} -\entry {.txinfo}{105}{\code {.txinfo}} -\entry {RCS, rule to extract from}{105}{RCS, rule to extract from} -\entry {co}{105}{\code {co}} -\entry {,v (RCS file extension)}{105}{\code {,v \r {(RCS file extension)}}} -\entry {SCCS, rule to extract from}{105}{SCCS, rule to extract from} -\entry {get}{105}{\code {get}} -\entry {s. (SCCS file prefix)}{105}{\code {s. \r {(SCCS file prefix)}}} -\entry {.sh}{105}{\code {.sh}} -\entry {flags for compilers}{106}{flags for compilers} -\entry {ar}{107}{\code {ar}} -\entry {as}{107}{\code {as}} -\entry {cc}{107}{\code {cc}} -\entry {g{\tt\char43}{\tt\char43}}{107}{\code {g{\tt\char43}{\tt\char43}}} -\entry {co}{107}{\code {co}} -\entry {f77}{107}{\code {f77}} -\entry {get}{107}{\code {get}} -\entry {lex}{107}{\code {lex}} -\entry {pc}{107}{\code {pc}} -\entry {yacc}{107}{\code {yacc}} -\entry {makeinfo}{107}{\code {makeinfo}} -\entry {tex}{107}{\code {tex}} -\entry {texi2dvi}{107}{\code {texi2dvi}} -\entry {weave}{107}{\code {weave}} -\entry {cweave}{107}{\code {cweave}} -\entry {tangle}{107}{\code {tangle}} -\entry {ctangle}{107}{\code {ctangle}} -\entry {rm}{107}{\code {rm}} -\entry {chains of rules}{108}{chains of rules} -\entry {rule, implicit, chains of}{108}{rule, implicit, chains of} -\entry {intermediate files}{108}{intermediate files} -\entry {files, intermediate}{108}{files, intermediate} -\entry {intermediate files, preserving}{109}{intermediate files, preserving} -\entry {preserving intermediate files}{109}{preserving intermediate files} -\entry {preserving with .PRECIOUS}{109}{preserving with \code {.PRECIOUS}} -\entry {.PRECIOUS intermediate files}{109}{\code {.PRECIOUS} intermediate files} -\entry {pattern rule}{110}{pattern rule} -\entry {rule, pattern}{110}{rule, pattern} -\entry {target pattern, implicit}{110}{target pattern, implicit} -\entry {%, in pattern rules}{110}{\code {%}, in pattern rules} -\entry {dependency pattern, implicit}{110}{dependency pattern, implicit} -\entry {multiple targets, in pattern rule}{110}{multiple targets, in pattern rule} -\entry {target, multiple in pattern rule}{110}{target, multiple in pattern rule} -\entry {pattern rules, order of}{111}{pattern rules, order of} -\entry {order of pattern rules}{111}{order of pattern rules} -\entry {automatic variables}{112}{automatic variables} -\entry {variables, automatic}{112}{variables, automatic} -\entry {variables, and implicit rule}{112}{variables, and implicit rule} -\entry {dependencies, list of changed}{112}{dependencies, list of changed} -\entry {list of changed dependencies}{112}{list of changed dependencies} -\entry {dependencies, list of all}{112}{dependencies, list of all} -\entry {list of all dependencies}{112}{list of all dependencies} -\entry {stem, variable for}{113}{stem, variable for} -\entry {stem}{114}{stem} -\entry {match-anything rule}{115}{match-anything rule} -\entry {terminal rule}{115}{terminal rule} -\entry {last-resort default rules}{116}{last-resort default rules} -\entry {default rules, last-resort}{116}{default rules, last-resort} -\entry {old-fashioned suffix rules}{117}{old-fashioned suffix rules} -\entry {suffix rule}{117}{suffix rule} -\entry {implicit rule, search algorithm}{119}{implicit rule, search algorithm} -\entry {search algorithm, implicit rule}{119}{search algorithm, implicit rule} -\entry {archive}{121}{archive} -\entry {archive member targets}{121}{archive member targets} -\entry {wildcard, in archive member}{121}{wildcard, in archive member} -\entry {{\_}{\_}.SYMDEF}{123}{\code {{\_}{\_}.SYMDEF}} -\entry {updating archive symbol directories}{123}{updating archive symbol directories} -\entry {archive symbol directory updating}{123}{archive symbol directory updating} -\entry {symbol directories, updating archive}{123}{symbol directories, updating archive} -\entry {directories, updating archive symbol}{123}{directories, updating archive symbol} -\entry {archive, and parallel execution}{123}{archive, and parallel execution} -\entry {parallel execution, and archive update}{123}{parallel execution, and archive update} -\entry {archive, and -j}{123}{archive, and \code {-j}} -\entry {-j, and archive update}{123}{\code {-j}, and archive update} -\entry {suffix rule, for archive}{124}{suffix rule, for archive} -\entry {archive, suffix rule for}{124}{archive, suffix rule for} -\entry {library archive, suffix rule for}{124}{library archive, suffix rule for} -\entry {.a (archives)}{124}{\code {.a} (archives)} -\entry {features of GNU make}{125}{features of GNU \code {make}} -\entry {portability}{125}{portability} -\entry {compatibility}{125}{compatibility} -\entry {incompatibilities}{129}{incompatibilities} -\entry {missing features}{129}{missing features} -\entry {features, missing}{129}{features, missing} -\entry {makefile, conventions for}{131}{makefile, conventions for} -\entry {conventions for makefiles}{131}{conventions for makefiles} -\entry {standards for makefiles}{131}{standards for makefiles} diff --git a/buildtools/windows/source/make/make.cps b/buildtools/windows/source/make/make.cps deleted file mode 100644 index 0b8cbac3bfa..00000000000 --- a/buildtools/windows/source/make/make.cps +++ /dev/null @@ -1,652 +0,0 @@ -\initial {#} -\entry {\code {#} (comments), in commands}{41} -\entry {\code {#} (comments), in makefile}{13} -\entry {\code {#include}}{38} -\initial {$} -\entry {\code {$}, in function call}{77} -\entry {\code {$}, in rules}{20} -\entry {\code {$}, in variable name}{60} -\entry {\code {$}, in variable reference}{55} -\initial {%} -\entry {\code {%}, in pattern rules}{110} -\entry {\code {%}, quoting in \code {patsubst}}{78} -\entry {\code {%}, quoting in static pattern}{35} -\entry {\code {%}, quoting in \code {vpath}}{25} -\entry {\code {%}, quoting with \code {{\tt\indexbackslash }} (backslash)}{25, 35, 78} -\initial {*} -\entry {\code {*} (wildcard character)}{20} -\initial {,} -\entry {\code {,v \r {(RCS file extension)}}}{105} -\initial {-} -\entry {\code {-} (in commands)}{44} -\entry {-, and \code {define}}{53} -\entry {\code {--assume-new}}{92, 98} -\entry {\code {--assume-new}, and recursion}{50} -\entry {\code {--assume-old}}{93, 97} -\entry {\code {--assume-old}, and recursion}{50} -\entry {\code {--debug}}{96} -\entry {\code {--directory}}{46, 95} -\entry {\code {--directory}, and \code {--print-directory}}{52} -\entry {\code {--directory}, and recursion}{50} -\entry {\code {--dry-run}}{41, 91, 97} -\entry {\code {--environment-overrides}}{96} -\entry {\code {--file}}{14, 89, 96} -\entry {\code {--file}, and recursion}{50} -\entry {\code {--help}}{96} -\entry {\code {--ignore-errors}}{44, 96} -\entry {\code {--include-dir}}{15, 96} -\entry {\code {--jobs}}{42, 96} -\entry {\code {--jobs}, and recursion}{50} -\entry {\code {--just-print}}{41, 91, 97} -\entry {\code {--keep-going}}{45, 95, 96} -\entry {\code {--load-average}}{43, 97} -\entry {\code {--makefile}}{14, 89, 96} -\entry {\code {--max-load}}{43, 97} -\entry {\code {--new-file}}{92, 98} -\entry {\code {--new-file}, and recursion}{50} -\entry {\code {--no-builtin-rules}}{97} -\entry {\code {--no-keep-going}}{98} -\entry {\code {--no-print-directory}}{52, 98} -\entry {\code {--old-file}}{93, 97} -\entry {\code {--old-file}, and recursion}{50} -\entry {\code {--print-data-base}}{97} -\entry {\code {--print-directory}}{98} -\entry {\code {--print-directory}, and \code {--directory}}{52} -\entry {\code {--print-directory}, and recursion}{52} -\entry {\code {--print-directory}, disabling}{52} -\entry {\code {--question}}{92, 97} -\entry {\code {--quiet}}{41, 98} -\entry {\code {--recon}}{41, 91, 97} -\entry {\code {--silent}}{41, 98} -\entry {\code {--stop}}{98} -\entry {\code {--touch}}{92, 98} -\entry {\code {--touch}, and recursion}{47} -\entry {\code {--version}}{98} -\entry {\code {--warn-undefined-variables}}{99} -\entry {\code {--what-if}}{92, 98} -\entry {\code {-b}}{95} -\entry {\code {-C}}{46, 95} -\entry {\code {-C}, and \code {-w}}{52} -\entry {\code {-C}, and recursion}{50} -\entry {\code {-d}}{96} -\entry {\code {-e}}{96} -\entry {\code {-e} (shell flag)}{39} -\entry {\code {-f}}{14, 89, 96} -\entry {\code {-f}, and recursion}{50} -\entry {\code {-h}}{96} -\entry {\code {-i}}{44, 96} -\entry {\code {-I}}{15, 96} -\entry {\code {-j}}{42, 96} -\entry {\code {-j}, and archive update}{123} -\entry {\code {-j}, and recursion}{50} -\entry {\code {-k}}{45, 95, 96} -\entry {\code {-l}}{97} -\entry {\code {-l} (library search)}{27} -\entry {\code {-l} (load average)}{43} -\entry {\code {-m}}{95} -\entry {\code {-M} (to compiler)}{38} -\entry {\code {-MM} (to GNU compiler)}{39} -\entry {\code {-n}}{41, 91, 97} -\entry {\code {-o}}{93, 97} -\entry {\code {-o}, and recursion}{50} -\entry {\code {-p}}{97} -\entry {\code {-q}}{92, 97} -\entry {\code {-r}}{97} -\entry {\code {-s}}{41, 97} -\entry {\code {-S}}{98} -\entry {\code {-t}}{92, 98} -\entry {\code {-t}, and recursion}{47} -\entry {\code {-v}}{98} -\entry {\code {-w}}{98} -\entry {\code {-W}}{92, 98} -\entry {\code {-w}, and \code {-C}}{52} -\entry {\code {-w}, and recursion}{52} -\entry {\code {-W}, and recursion}{50} -\entry {\code {-w}, disabling}{52} -\initial {.} -\entry {\code {.a} (archives)}{124} -\entry {\code {.c}}{103} -\entry {\code {.C}}{103} -\entry {\code {.cc}}{103} -\entry {\code {.ch}}{105} -\entry {\code {.d}}{39} -\entry {\code {.def}}{104} -\entry {\code {.dvi}}{105} -\entry {\code {.f}}{103} -\entry {\code {.F}}{103} -\entry {\code {.info}}{105} -\entry {\code {.l}}{105} -\entry {\code {.ln}}{105} -\entry {\code {.mod}}{104} -\entry {\code {.o}}{103, 104} -\entry {\code {.p}}{103} -\entry {\code {.PRECIOUS} intermediate files}{109} -\entry {\code {.r}}{103} -\entry {\code {.s}}{104} -\entry {\code {.S}}{104} -\entry {\code {.sh}}{105} -\entry {\code {.sym}}{104} -\entry {\code {.tex}}{105} -\entry {\code {.texi}}{105} -\entry {\code {.texinfo}}{105} -\entry {\code {.txinfo}}{105} -\entry {\code {.w}}{105} -\entry {\code {.web}}{105} -\entry {\code {.y}}{105} -\initial {:} -\entry {\code {::} rules (double-colon)}{37} -\entry {:=}{57, 63} -\initial {=} -\entry {=}{56, 63} -\initial {?} -\entry {\code {?} (wildcard character)}{20} -\initial {[} -\entry {\code {[\dots {}]} (wildcard characters)}{20} -\initial {{\_}} -\entry {\code {{\_}{\_}.SYMDEF}}{123} -\initial {{\tt\char'100}} -\entry {\code {{\tt\char'100}} (in commands)}{41} -\entry {{\tt\char'100}, and \code {define}}{53} -\initial {{\tt\char'176}} -\entry {\code {{\tt\char'176}} (tilde)}{20} -\initial {{\tt\char43}} -\entry {{\tt\char43}, and \code {define}}{53} -\entry {{\tt\char43}=}{64} -\initial {{\tt\indexbackslash }} -\entry {\code {{\tt\indexbackslash }} (backslash), for continuation lines}{7} -\entry {\code {{\tt\indexbackslash }} (backslash), in commands}{42} -\entry {\code {{\tt\indexbackslash }} (backslash), to quote \code {%}}{25, 35, 78} -\initial {A} -\entry {\code {all} \r {(standard target)}}{91} -\entry {appending to variables}{64} -\entry {\code {ar}}{107} -\entry {archive}{121} -\entry {archive member targets}{121} -\entry {archive symbol directory updating}{123} -\entry {archive, and \code {-j}}{123} -\entry {archive, and parallel execution}{123} -\entry {archive, suffix rule for}{124} -\entry {Arg list too long}{51} -\entry {arguments of functions}{77} -\entry {\code {as}}{104, 107} -\entry {assembly, rule to compile}{104} -\entry {automatic generation of dependencies}{15, 37} -\entry {automatic variables}{112} -\initial {B} -\entry {backquotes}{87} -\entry {backslash (\code {{\tt\indexbackslash }}), for continuation lines}{7} -\entry {backslash (\code {{\tt\indexbackslash }}), in commands}{42} -\entry {backslash (\code {{\tt\indexbackslash }}), to quote \code {%}}{25, 35, 78} -\entry {basename}{82} -\entry {broken pipe}{43} -\entry {bugs, reporting}{2} -\entry {built-in special targets}{31} -\initial {C} -\entry {C, rule to compile}{103} -\entry {C{\tt\char43}{\tt\char43}, rule to compile}{103} -\entry {\code {cc}}{103, 107} -\entry {\code {cd} (shell command)}{42, 47} -\entry {chains of rules}{108} -\entry {\code {check} \r {(standard target)}}{91} -\entry {\code {clean} \r {(standard target)}}{91} -\entry {\code {clean} target}{8, 12} -\entry {cleaning up}{12} -\entry {\code {clobber} \r {(standard target)}}{91} -\entry {\code {co}}{105, 107} -\entry {combining rules by dependency}{11} -\entry {command line variable definitions, and recursion}{50} -\entry {command line variables}{94} -\entry {commands}{19} -\entry {commands, backslash (\code {{\tt\indexbackslash }}) in}{42} -\entry {commands, comments in}{41} -\entry {commands, echoing}{41} -\entry {commands, empty}{54} -\entry {commands, errors in}{44} -\entry {commands, execution}{42} -\entry {commands, execution in parallel}{42} -\entry {commands, expansion}{87} -\entry {commands, how to write}{41} -\entry {commands, instead of executing}{91} -\entry {commands, introduction to}{5} -\entry {commands, quoting newlines in}{42} -\entry {commands, sequences of}{52} -\entry {comments, in commands}{41} -\entry {comments, in makefile}{13} -\entry {compatibility}{125} -\entry {compatibility in exporting}{49} -\entry {compilation, testing}{95} -\entry {computed variable name}{60} -\entry {conditionals}{71} -\entry {continuation lines}{7} -\entry {conventions for makefiles}{131} -\entry {\code {ctangle}}{105, 107} -\entry {\code {cweave}}{105, 107} -\initial {D} -\entry {deducing commands (implicit rules)}{10} -\entry {default goal}{8, 19} -\entry {default makefile name}{14} -\entry {default rules, last-resort}{116} -\entry {defining variables verbatim}{67} -\entry {deletion of target files}{45} -\entry {dependencies}{20} -\entry {dependencies, automatic generation}{15, 37} -\entry {dependencies, introduction to}{5} -\entry {dependencies, list of all}{112} -\entry {dependencies, list of changed}{112} -\entry {dependencies, varying (static pattern)}{34} -\entry {dependency}{19} -\entry {dependency pattern, implicit}{110} -\entry {dependency pattern, static (not implicit)}{35} -\entry {directive}{13} -\entry {directories, printing them}{52} -\entry {directories, updating archive symbol}{123} -\entry {directory part}{81} -\entry {directory search (\code {VPATH})}{23} -\entry {directory search (\code {VPATH}), and implicit rules}{27} -\entry {directory search (\code {VPATH}), and link libraries}{27} -\entry {directory search (\code {VPATH}), and shell commands}{26} -\entry {\code {dist} \r {(standard target)}}{91} -\entry {\code {distclean} \r {(standard target)}}{91} -\entry {dollar sign (\code {$}), in function call}{77} -\entry {dollar sign (\code {$}), in rules}{20} -\entry {dollar sign (\code {$}), in variable name}{60} -\entry {dollar sign (\code {$}), in variable reference}{55} -\entry {double-colon rules}{37} -\entry {duplicate words, removing}{80} -\initial {E} -\entry {E2BIG}{51} -\entry {echoing of commands}{41} -\entry {editor}{5} -\entry {Emacs (\code {M-x compile})}{45} -\entry {empty commands}{54} -\entry {empty targets}{30} -\entry {environment}{68} -\entry {environment, and recursion}{47} -\entry {environment, \code {SHELL} in}{42} -\entry {errors (in commands)}{44} -\entry {errors with wildcards}{22} -\entry {execution, in parallel}{42} -\entry {execution, instead of}{91} -\entry {execution, of commands}{42} -\entry {exit status (errors)}{44} -\entry {explicit rule, definition of}{13} -\entry {exporting variables}{47} -\initial {F} -\entry {\code {f77}}{103, 107} -\entry {features of GNU \code {make}}{125} -\entry {features, missing}{129} -\entry {file name functions}{81} -\entry {file name of makefile}{14} -\entry {file name of makefile, how to specify}{14} -\entry {file name prefix, adding}{82} -\entry {file name suffix}{82} -\entry {file name suffix, adding}{82} -\entry {file name with wildcards}{20} -\entry {file name, basename of}{82} -\entry {file name, directory part}{81} -\entry {file name, nondirectory part}{81} -\entry {files, assuming new}{92} -\entry {files, assuming old}{93} -\entry {files, avoiding recompilation of}{93} -\entry {files, intermediate}{108} -\entry {filtering out words}{80} -\entry {filtering words}{80} -\entry {finding strings}{79} -\entry {flags}{95} -\entry {flags for compilers}{106} -\entry {flavors of variables}{56} -\entry {\code {FORCE}}{30} -\entry {force targets}{30} -\entry {Fortran, rule to compile}{103} -\entry {functions}{77} -\entry {functions, for file names}{81} -\entry {functions, for text}{78} -\entry {functions, syntax of}{77} -\initial {G} -\entry {\code {g{\tt\char43}{\tt\char43}}}{103, 107} -\entry {\code {gcc}}{103} -\entry {generating dependencies automatically}{15, 37} -\entry {\code {get}}{105, 107} -\entry {globbing (wildcards)}{20} -\entry {goal}{8} -\entry {goal, default}{8, 19} -\entry {goal, how to specify}{90} -\initial {H} -\entry {home directory}{20} -\initial {I} -\entry {IEEE Standard 1003.2}{1} -\entry {implicit rule}{101} -\entry {implicit rule, and directory search}{27} -\entry {implicit rule, and \code {VPATH}}{27} -\entry {implicit rule, definition of}{13} -\entry {implicit rule, how to use}{101} -\entry {implicit rule, introduction to}{10} -\entry {implicit rule, predefined}{103} -\entry {implicit rule, search algorithm}{119} -\entry {including (\code {MAKEFILES} variable)}{16} -\entry {including other makefiles}{14} -\entry {incompatibilities}{129} -\entry {Info, rule to format}{105} -\entry {\code {install} \r {(standard target)}}{91} -\entry {intermediate files}{108} -\entry {intermediate files, preserving}{109} -\entry {interrupt}{45} -\initial {J} -\entry {job slots}{42} -\entry {job slots, and recursion}{50} -\entry {jobs, limiting based on load}{43} -\entry {joining lists of words}{82} -\initial {K} -\entry {killing (interruption)}{45} -\initial {L} -\entry {last-resort default rules}{116} -\entry {\code {ld}}{104} -\entry {\code {lex}}{105, 107} -\entry {Lex, rule to run}{105} -\entry {libraries for linking, directory search}{27} -\entry {library archive, suffix rule for}{124} -\entry {limiting jobs based on load}{43} -\entry {link libraries, and directory search}{27} -\entry {linking, predefined rule for}{104} -\entry {\code {lint}}{105} -\entry {\code {lint}, rule to run}{105} -\entry {list of all dependencies}{112} -\entry {list of changed dependencies}{112} -\entry {load average}{43} -\entry {loops in variable expansion}{57} -\entry {\code {lpr} (shell command)}{21, 30} -\initial {M} -\entry {\code {m2c}}{104} -\entry {macro}{55} -\entry {\code {make depend}}{38} -\entry {makefile}{5} -\entry {makefile name}{14} -\entry {makefile name, how to specify}{14} -\entry {makefile rule parts}{5} -\entry {makefile, and \code {MAKEFILES} variable}{16} -\entry {makefile, conventions for}{131} -\entry {makefile, how \code {make} processes}{8} -\entry {makefile, how to write}{13} -\entry {makefile, including}{14} -\entry {makefile, overriding}{18} -\entry {makefile, remaking of}{16} -\entry {makefile, simple}{6} -\entry {\code {makeinfo}}{105, 107} -\entry {match-anything rule}{115} -\entry {match-anything rule, used to override}{18} -\entry {missing features}{129} -\entry {mistakes with wildcards}{22} -\entry {modified variable reference}{59} -\entry {Modula-2, rule to compile}{104} -\entry {\code {mostlyclean} \r {(standard target)}}{91} -\entry {multiple rules for one target}{33} -\entry {multiple rules for one target (\code {::})}{37} -\entry {multiple targets}{32} -\entry {multiple targets, in pattern rule}{110} -\initial {N} -\entry {name of makefile}{14} -\entry {name of makefile, how to specify}{14} -\entry {nested variable reference}{60} -\entry {newline, quoting, in commands}{42} -\entry {newline, quoting, in makefile}{7} -\entry {nondirectory part}{81} -\initial {O} -\entry {\code {obj}}{9} -\entry {\code {OBJ}}{9} -\entry {\code {objects}}{9} -\entry {\code {OBJECTS}}{9} -\entry {\code {objs}}{9} -\entry {\code {OBJS}}{9} -\entry {old-fashioned suffix rules}{117} -\entry {options}{95} -\entry {options, and recursion}{50} -\entry {options, setting from environment}{51} -\entry {options, setting in makefiles}{51} -\entry {order of pattern rules}{111} -\entry {origin of variable}{85} -\entry {overriding makefiles}{18} -\entry {overriding variables with arguments}{94} -\entry {overriding with \code {override}}{66} -\initial {P} -\entry {parallel execution}{42} -\entry {parallel execution, and archive update}{123} -\entry {parts of makefile rule}{5} -\entry {Pascal, rule to compile}{103} -\entry {pattern rule}{110} -\entry {pattern rules, order of}{111} -\entry {pattern rules, static (not implicit)}{34} -\entry {pattern rules, static, syntax of}{34} -\entry {\code {pc}}{103, 107} -\entry {phony targets}{28} -\entry {pitfalls of wildcards}{22} -\entry {portability}{125} -\entry {POSIX}{1} -\entry {POSIX.2}{51} -\entry {precious targets}{31} -\entry {prefix, adding}{82} -\entry {preserving intermediate files}{109} -\entry {preserving with \code {.PRECIOUS}}{31, 109} -\entry {\code {print} \r {(standard target)}}{91} -\entry {\code {print} target}{21, 30} -\entry {printing directories}{52} -\entry {printing of commands}{41} -\entry {problems and bugs, reporting}{2} -\entry {problems with wildcards}{22} -\entry {processing a makefile}{8} -\initial {Q} -\entry {question mode}{92} -\entry {quoting \code {%}, in \code {patsubst}}{78} -\entry {quoting \code {%}, in static pattern}{35} -\entry {quoting \code {%}, in \code {vpath}}{25} -\entry {quoting newline, in commands}{42} -\entry {quoting newline, in makefile}{7} -\initial {R} -\entry {Ratfor, rule to compile}{103} -\entry {RCS, rule to extract from}{105} -\entry {\code {README}}{14} -\entry {\code {realclean} \r {(standard target)}}{91} -\entry {recompilation}{5} -\entry {recompilation, avoiding}{93} -\entry {recording events with empty targets}{30} -\entry {recursion}{46} -\entry {recursion, and \code {-C}}{50} -\entry {recursion, and \code {-f}}{50} -\entry {recursion, and \code {-j}}{50} -\entry {recursion, and \code {-o}}{50} -\entry {recursion, and \code {-t}}{47} -\entry {recursion, and \code {-w}}{52} -\entry {recursion, and \code {-W}}{50} -\entry {recursion, and command line variable definitions}{50} -\entry {recursion, and environment}{47} -\entry {recursion, and \code {MAKE} variable}{46} -\entry {recursion, and \code {MAKEFILES} variable}{16} -\entry {recursion, and options}{50} -\entry {recursion, and printing directories}{52} -\entry {recursion, and variables}{47} -\entry {recursion, level of}{49} -\entry {recursive variable expansion}{55, 56} -\entry {recursively expanded variables}{56} -\entry {reference to variables}{55, 59} -\entry {relinking}{9} -\entry {remaking makefiles}{16} -\entry {removal of target files}{45} -\entry {removing duplicate words}{80} -\entry {removing, to clean up}{12} -\entry {reporting bugs}{2} -\entry {\code {rm}}{107} -\entry {\code {rm} (shell command)}{8, 21, 28, 44} -\entry {rule commands}{41} -\entry {rule dependencies}{20} -\entry {rule syntax}{19} -\entry {rule targets}{19} -\entry {rule, and \code {$}}{20} -\entry {rule, double-colon (\code {::})}{37} -\entry {rule, explicit, definition of}{13} -\entry {rule, how to write}{19} -\entry {rule, implicit}{101} -\entry {rule, implicit, and directory search}{27} -\entry {rule, implicit, and \code {VPATH}}{27} -\entry {rule, implicit, chains of}{108} -\entry {rule, implicit, definition of}{13} -\entry {rule, implicit, how to use}{101} -\entry {rule, implicit, introduction to}{10} -\entry {rule, implicit, predefined}{103} -\entry {rule, introduction to}{5} -\entry {rule, multiple for one target}{33} -\entry {rule, no commands or dependencies}{30} -\entry {rule, pattern}{110} -\entry {rule, static pattern}{34} -\entry {rule, static pattern versus implicit}{36} -\entry {rule, with multiple targets}{32} -\initial {S} -\entry {\code {s. \r {(SCCS file prefix)}}}{105} -\entry {SCCS, rule to extract from}{105} -\entry {search algorithm, implicit rule}{119} -\entry {search path for dependencies (\code {VPATH})}{23} -\entry {search path for dependencies (\code {VPATH}), and implicit rules}{27} -\entry {search path for dependencies (\code {VPATH}), and link libraries}{27} -\entry {searching for strings}{79} -\entry {\code {sed} (shell command)}{39} -\entry {selecting words}{83} -\entry {sequences of commands}{52} -\entry {setting options from environment}{51} -\entry {setting options in makefiles}{51} -\entry {setting variables}{63} -\entry {several rules for one target}{33} -\entry {several targets in a rule}{32} -\entry {\code {shar} \r {(standard target)}}{91} -\entry {shell command}{8} -\entry {shell command, and directory search}{26} -\entry {shell command, execution}{42} -\entry {shell command, function for}{87} -\entry {shell file name pattern (in \code {include})}{14} -\entry {shell wildcards (in \code {include})}{14} -\entry {signal}{45} -\entry {silent operation}{41} -\entry {simple makefile}{6} -\entry {simple variable expansion}{55} -\entry {simplifying with variables}{9} -\entry {simply expanded variables}{57} -\entry {sorting words}{80} -\entry {spaces, in variable values}{58} -\entry {spaces, stripping}{79} -\entry {special targets}{31} -\entry {specifying makefile name}{14} -\entry {standard input}{43} -\entry {standards conformance}{1} -\entry {standards for makefiles}{131} -\entry {static pattern rule}{34} -\entry {static pattern rule, syntax of}{34} -\entry {static pattern rule, versus implicit}{36} -\entry {stem}{35, 114} -\entry {stem, variable for}{113} -\entry {strings, searching for}{79} -\entry {stripping whitespace}{79} -\entry {sub-\code {make}}{47} -\entry {subdirectories, recursion for}{46} -\entry {substitution variable reference}{59} -\entry {suffix rule}{117} -\entry {suffix rule, for archive}{124} -\entry {suffix, adding}{82} -\entry {suffix, function to find}{82} -\entry {suffix, substituting in variables}{59} -\entry {switches}{95} -\entry {symbol directories, updating archive}{123} -\entry {syntax of rules}{19} -\initial {T} -\entry {tab character (in commands)}{19} -\entry {tabs in rules}{5} -\entry {\code {TAGS} \r {(standard target)}}{91} -\entry {\code {tangle}}{105, 107} -\entry {\code {tar} \r {(standard target)}}{91} -\entry {target}{19} -\entry {target pattern, implicit}{110} -\entry {target pattern, static (not implicit)}{35} -\entry {target, deleting on error}{45} -\entry {target, deleting on interrupt}{45} -\entry {target, multiple in pattern rule}{110} -\entry {target, multiple rules for one}{33} -\entry {target, touching}{92} -\entry {targets}{19} -\entry {targets without a file}{28} -\entry {targets, built-in special}{31} -\entry {targets, empty}{30} -\entry {targets, force}{30} -\entry {targets, introduction to}{5} -\entry {targets, multiple}{32} -\entry {targets, phony}{28} -\entry {terminal rule}{115} -\entry {\code {test} \r {(standard target)}}{91} -\entry {testing compilation}{95} -\entry {\code {tex}}{105, 107} -\entry {\TeX{}, rule to run}{105} -\entry {\code {texi2dvi}}{105, 107} -\entry {Texinfo, rule to format}{105} -\entry {tilde (\code {{\tt\char'176}})}{20} -\entry {\code {touch} (shell command)}{21, 30} -\entry {touching files}{92} -\initial {U} -\entry {undefined variables, warning message}{99} -\entry {updating archive symbol directories}{123} -\entry {updating makefiles}{16} -\initial {V} -\entry {value}{55} -\entry {value, how a variable gets it}{63} -\entry {variable}{55} -\entry {variable definition}{13} -\entry {variables}{9} -\entry {variables, \samp {$} in name}{60} -\entry {variables, and implicit rule}{112} -\entry {variables, appending to}{64} -\entry {variables, automatic}{112} -\entry {variables, command line}{94} -\entry {variables, command line, and recursion}{50} -\entry {variables, computed names}{60} -\entry {variables, defining verbatim}{67} -\entry {variables, environment}{47, 68} -\entry {variables, exporting}{47} -\entry {variables, flavors}{56} -\entry {variables, how they get their values}{63} -\entry {variables, how to reference}{55} -\entry {variables, loops in expansion}{57} -\entry {variables, modified reference}{59} -\entry {variables, nested references}{60} -\entry {variables, origin of}{85} -\entry {variables, overriding}{66} -\entry {variables, overriding with arguments}{94} -\entry {variables, recursively expanded}{56} -\entry {variables, setting}{63} -\entry {variables, simply expanded}{57} -\entry {variables, spaces in values}{58} -\entry {variables, substituting suffix in}{59} -\entry {variables, substitution reference}{59} -\entry {variables, warning for undefined}{99} -\entry {varying dependencies}{34} -\entry {verbatim variable definition}{67} -\entry {vpath}{23} -\entry {\code {VPATH}, and implicit rules}{27} -\entry {\code {VPATH}, and link libraries}{27} -\initial {W} -\entry {\code {weave}}{105, 107} -\entry {Web, rule to run}{105} -\entry {what if}{92} -\entry {whitespace, in variable values}{58} -\entry {whitespace, stripping}{79} -\entry {wildcard}{20} -\entry {wildcard pitfalls}{22} -\entry {wildcard, function}{83} -\entry {wildcard, in archive member}{121} -\entry {wildcard, in \code {include}}{14} -\entry {words, extracting first}{83} -\entry {words, filtering}{80} -\entry {words, filtering out}{80} -\entry {words, finding number}{83} -\entry {words, iterating over}{83} -\entry {words, joining lists}{82} -\entry {words, removing duplicates}{80} -\entry {words, selecting}{83} -\entry {writing rule commands}{41} -\entry {writing rules}{19} -\initial {Y} -\entry {\code {yacc}}{53, 105, 107} -\entry {Yacc, rule to run}{105} diff --git a/buildtools/windows/source/make/make.fn b/buildtools/windows/source/make/make.fn deleted file mode 100644 index 6000f78fd6b..00000000000 --- a/buildtools/windows/source/make/make.fn +++ /dev/null @@ -1,149 +0,0 @@ -\entry {Makefile}{14}{\code {Makefile}} -\entry {GNUmakefile}{14}{\code {GNUmakefile}} -\entry {makefile}{14}{\code {makefile}} -\entry {include}{14}{\code {include}} -\entry {/usr/gnu/include}{15}{\code {/usr/gnu/include}} -\entry {/usr/local/include}{15}{\code {/usr/local/include}} -\entry {/usr/include}{15}{\code {/usr/include}} -\entry {MAKEFILES}{16}{\code {MAKEFILES}} -\entry {wildcard}{22}{\code {wildcard}} -\entry {VPATH}{23}{\code {VPATH}} -\entry {vpath}{23}{\code {vpath}} -\entry {VPATH}{23}{\code {VPATH}} -\entry {vpath}{24}{\code {vpath}} -\entry {.PHONY}{28}{\code {.PHONY}} -\entry {.PHONY}{31}{\code {.PHONY}} -\entry {.SUFFIXES}{31}{\code {.SUFFIXES}} -\entry {.DEFAULT}{31}{\code {.DEFAULT}} -\entry {.PRECIOUS}{31}{\code {.PRECIOUS}} -\entry {.IGNORE}{31}{\code {.IGNORE}} -\entry {.SILENT}{32}{\code {.SILENT}} -\entry {.EXPORT{\_}ALL{\_}VARIABLES}{32}{\code {.EXPORT{\_}ALL{\_}VARIABLES}} -\entry {subst}{33}{\code {subst}} -\entry {$*, and static pattern}{36}{\code {$*\r {, and static pattern}}} -\entry {.SILENT}{41}{\code {.SILENT}} -\entry {SHELL (command execution)}{42}{\code {SHELL \r {(command execution)}}} -\entry {SHELL}{42}{\code {SHELL}} -\entry {.IGNORE}{44}{\code {.IGNORE}} -\entry {.DELETE{\_}ON{\_}ERROR}{45}{\code {.DELETE{\_}ON{\_}ERROR}} -\entry {.PRECIOUS}{46}{\code {.PRECIOUS}} -\entry {MAKE}{46}{\code {MAKE}} -\entry {export}{48}{\code {export}} -\entry {unexport}{48}{\code {unexport}} -\entry {.EXPORT{\_}ALL{\_}VARIABLES}{49}{\code {.EXPORT{\_}ALL{\_}VARIABLES}} -\entry {MAKELEVEL}{49}{\code {MAKELEVEL}} -\entry {MAKEFILES}{50}{\code {MAKEFILES}} -\entry {MAKEFLAGS}{50}{\code {MAKEFLAGS}} -\entry {MAKEOVERRIDES}{51}{\code {MAKEOVERRIDES}} -\entry {.POSIX}{51}{\code {.POSIX}} -\entry {MFLAGS}{51}{\code {MFLAGS}} -\entry {.DEFAULT, and empty commands}{54}{\code {.DEFAULT\r {, and empty commands}}} -\entry {MAKELEVEL}{58}{\code {MAKELEVEL}} -\entry {MAKE}{58}{\code {MAKE}} -\entry {patsubst}{59}{\code {patsubst}} -\entry {override}{66}{\code {override}} -\entry {define}{67}{\code {define}} -\entry {endef}{67}{\code {endef}} -\entry {ifdef}{72}{\code {ifdef}} -\entry {ifeq}{72}{\code {ifeq}} -\entry {ifndef}{72}{\code {ifndef}} -\entry {ifneq}{72}{\code {ifneq}} -\entry {else}{72}{\code {else}} -\entry {endif}{72}{\code {endif}} -\entry {subst}{78}{\code {subst}} -\entry {patsubst}{78}{\code {patsubst}} -\entry {strip}{79}{\code {strip}} -\entry {findstring}{79}{\code {findstring}} -\entry {filter}{80}{\code {filter}} -\entry {filter-out}{80}{\code {filter-out}} -\entry {sort}{80}{\code {sort}} -\entry {dir}{81}{\code {dir}} -\entry {notdir}{81}{\code {notdir}} -\entry {suffix}{82}{\code {suffix}} -\entry {basename}{82}{\code {basename}} -\entry {addsuffix}{82}{\code {addsuffix}} -\entry {addprefix}{82}{\code {addprefix}} -\entry {join}{82}{\code {join}} -\entry {word}{83}{\code {word}} -\entry {words}{83}{\code {words}} -\entry {firstword}{83}{\code {firstword}} -\entry {wildcard}{83}{\code {wildcard}} -\entry {foreach}{83}{\code {foreach}} -\entry {origin}{85}{\code {origin}} -\entry {shell}{87}{\code {shell}} -\entry {OUTPUT{\_}OPTION}{106}{\code {OUTPUT{\_}OPTION}} -\entry {AR}{107}{\code {AR}} -\entry {AS}{107}{\code {AS}} -\entry {CC}{107}{\code {CC}} -\entry {CXX}{107}{\code {CXX}} -\entry {CO}{107}{\code {CO}} -\entry {CPP}{107}{\code {CPP}} -\entry {FC}{107}{\code {FC}} -\entry {GET}{107}{\code {GET}} -\entry {LEX}{107}{\code {LEX}} -\entry {PC}{107}{\code {PC}} -\entry {YACC}{107}{\code {YACC}} -\entry {YACCR}{107}{\code {YACCR}} -\entry {MAKEINFO}{107}{\code {MAKEINFO}} -\entry {TEX}{107}{\code {TEX}} -\entry {TEXI2DVI}{107}{\code {TEXI2DVI}} -\entry {WEAVE}{107}{\code {WEAVE}} -\entry {CWEAVE}{107}{\code {CWEAVE}} -\entry {TANGLE}{107}{\code {TANGLE}} -\entry {CTANGLE}{107}{\code {CTANGLE}} -\entry {RM}{107}{\code {RM}} -\entry {ARFLAGS}{108}{\code {ARFLAGS}} -\entry {ASFLAGS}{108}{\code {ASFLAGS}} -\entry {CFLAGS}{108}{\code {CFLAGS}} -\entry {CXXFLAGS}{108}{\code {CXXFLAGS}} -\entry {COFLAGS}{108}{\code {COFLAGS}} -\entry {CPPFLAGS}{108}{\code {CPPFLAGS}} -\entry {FFLAGS}{108}{\code {FFLAGS}} -\entry {GFLAGS}{108}{\code {GFLAGS}} -\entry {LDFLAGS}{108}{\code {LDFLAGS}} -\entry {LFLAGS}{108}{\code {LFLAGS}} -\entry {PFLAGS}{108}{\code {PFLAGS}} -\entry {RFLAGS}{108}{\code {RFLAGS}} -\entry {YFLAGS}{108}{\code {YFLAGS}} -\entry {${\tt\char'100}}{112}{\code {${\tt\char'100}}} -\entry {{\tt\char'100} (automatic variable)}{112}{\code {{\tt\char'100} \r {(automatic variable)}}} -\entry {$%}{112}{\code {$%}} -\entry {% (automatic variable)}{112}{\code {% \r {(automatic variable)}}} -\entry {${\tt\less}}{112}{\code {${\tt\less}}} -\entry {{\tt\less} (automatic variable)}{112}{\code {{\tt\less} \r {(automatic variable)}}} -\entry {$?}{112}{\code {$?}} -\entry {? (automatic variable)}{112}{\code {? \r {(automatic variable)}}} -\entry {${\tt\hat}}{112}{\code {${\tt\hat}}} -\entry {{\tt\hat} (automatic variable)}{112}{\code {{\tt\hat} \r {(automatic variable)}}} -\entry {${\tt\char43}}{112}{\code {${\tt\char43}}} -\entry {{\tt\char43} (automatic variable)}{112}{\code {{\tt\char43} \r {(automatic variable)}}} -\entry {$*}{112}{\code {$*}} -\entry {* (automatic variable)}{112}{\code {* \r {(automatic variable)}}} -\entry {$({\tt\char'100}D)}{113}{\code {$({\tt\char'100}D)}} -\entry {{\tt\char'100}D (automatic variable)}{113}{\code {{\tt\char'100}D \r {(automatic variable)}}} -\entry {$({\tt\char'100}F)}{113}{\code {$({\tt\char'100}F)}} -\entry {{\tt\char'100}F (automatic variable)}{113}{\code {{\tt\char'100}F \r {(automatic variable)}}} -\entry {$(*D)}{113}{\code {$(*D)}} -\entry {*D (automatic variable)}{113}{\code {*D \r {(automatic variable)}}} -\entry {$(*F)}{113}{\code {$(*F)}} -\entry {*F (automatic variable)}{113}{\code {*F \r {(automatic variable)}}} -\entry {$(%D)}{113}{\code {$(%D)}} -\entry {%D (automatic variable)}{113}{\code {%D \r {(automatic variable)}}} -\entry {$(%F)}{113}{\code {$(%F)}} -\entry {%F (automatic variable)}{113}{\code {%F \r {(automatic variable)}}} -\entry {$({\tt\less}D)}{114}{\code {$({\tt\less}D)}} -\entry {{\tt\less}D (automatic variable)}{114}{\code {{\tt\less}D \r {(automatic variable)}}} -\entry {$({\tt\less}F)}{114}{\code {$({\tt\less}F)}} -\entry {{\tt\less}F (automatic variable)}{114}{\code {{\tt\less}F \r {(automatic variable)}}} -\entry {$({\tt\hat}D)}{114}{\code {$({\tt\hat}D)}} -\entry {{\tt\hat}D (automatic variable)}{114}{\code {{\tt\hat}D \r {(automatic variable)}}} -\entry {$({\tt\hat}F)}{114}{\code {$({\tt\hat}F)}} -\entry {{\tt\hat}F (automatic variable)}{114}{\code {{\tt\hat}F \r {(automatic variable)}}} -\entry {$(?D)}{114}{\code {$(?D)}} -\entry {?D (automatic variable)}{114}{\code {?D \r {(automatic variable)}}} -\entry {$(?F)}{114}{\code {$(?F)}} -\entry {?F (automatic variable)}{114}{\code {?F \r {(automatic variable)}}} -\entry {.DEFAULT}{117}{\code {.DEFAULT}} -\entry {.SUFFIXES}{118}{\code {.SUFFIXES}} -\entry {SUFFIXES}{119}{\code {SUFFIXES}} -\entry {* (automatic variable), unsupported bizarre usage}{129}{\code {* \r {(automatic variable), unsupported bizarre usage}}} diff --git a/buildtools/windows/source/make/make.fns b/buildtools/windows/source/make/make.fns deleted file mode 100644 index e9fe5cd76de..00000000000 --- a/buildtools/windows/source/make/make.fns +++ /dev/null @@ -1,165 +0,0 @@ -\initial {$} -\entry {\code {$%}}{112} -\entry {\code {$(%D)}}{113} -\entry {\code {$(%F)}}{113} -\entry {\code {$(*D)}}{113} -\entry {\code {$(*F)}}{113} -\entry {\code {$(?D)}}{114} -\entry {\code {$(?F)}}{114} -\entry {\code {$({\tt\char'100}D)}}{113} -\entry {\code {$({\tt\char'100}F)}}{113} -\entry {\code {$({\tt\hat}D)}}{114} -\entry {\code {$({\tt\hat}F)}}{114} -\entry {\code {$({\tt\less}D)}}{114} -\entry {\code {$({\tt\less}F)}}{114} -\entry {\code {$*}}{112} -\entry {\code {$*\r {, and static pattern}}}{36} -\entry {\code {$?}}{112} -\entry {\code {${\tt\char'100}}}{112} -\entry {\code {${\tt\char43}}}{112} -\entry {\code {${\tt\hat}}}{112} -\entry {\code {${\tt\less}}}{112} -\initial {%} -\entry {\code {% \r {(automatic variable)}}}{112} -\entry {\code {%D \r {(automatic variable)}}}{113} -\entry {\code {%F \r {(automatic variable)}}}{113} -\initial {*} -\entry {\code {* \r {(automatic variable)}}}{112} -\entry {\code {* \r {(automatic variable), unsupported bizarre usage}}}{129} -\entry {\code {*D \r {(automatic variable)}}}{113} -\entry {\code {*F \r {(automatic variable)}}}{113} -\initial {.} -\entry {\code {.DEFAULT}}{31, 117} -\entry {\code {.DEFAULT\r {, and empty commands}}}{54} -\entry {\code {.DELETE{\_}ON{\_}ERROR}}{45} -\entry {\code {.EXPORT{\_}ALL{\_}VARIABLES}}{32, 49} -\entry {\code {.IGNORE}}{31, 44} -\entry {\code {.PHONY}}{28, 31} -\entry {\code {.POSIX}}{51} -\entry {\code {.PRECIOUS}}{31, 46} -\entry {\code {.SILENT}}{32, 41} -\entry {\code {.SUFFIXES}}{31, 118} -\initial {/} -\entry {\code {/usr/gnu/include}}{15} -\entry {\code {/usr/include}}{15} -\entry {\code {/usr/local/include}}{15} -\initial {?} -\entry {\code {? \r {(automatic variable)}}}{112} -\entry {\code {?D \r {(automatic variable)}}}{114} -\entry {\code {?F \r {(automatic variable)}}}{114} -\initial {{\tt\char'100}} -\entry {\code {{\tt\char'100} \r {(automatic variable)}}}{112} -\entry {\code {{\tt\char'100}D \r {(automatic variable)}}}{113} -\entry {\code {{\tt\char'100}F \r {(automatic variable)}}}{113} -\initial {{\tt\char43}} -\entry {\code {{\tt\char43} \r {(automatic variable)}}}{112} -\initial {{\tt\hat}} -\entry {\code {{\tt\hat} \r {(automatic variable)}}}{112} -\entry {\code {{\tt\hat}D \r {(automatic variable)}}}{114} -\entry {\code {{\tt\hat}F \r {(automatic variable)}}}{114} -\initial {{\tt\less}} -\entry {\code {{\tt\less} \r {(automatic variable)}}}{112} -\entry {\code {{\tt\less}D \r {(automatic variable)}}}{114} -\entry {\code {{\tt\less}F \r {(automatic variable)}}}{114} -\initial {A} -\entry {\code {addprefix}}{82} -\entry {\code {addsuffix}}{82} -\entry {\code {AR}}{107} -\entry {\code {ARFLAGS}}{108} -\entry {\code {AS}}{107} -\entry {\code {ASFLAGS}}{108} -\initial {B} -\entry {\code {basename}}{82} -\initial {C} -\entry {\code {CC}}{107} -\entry {\code {CFLAGS}}{108} -\entry {\code {CO}}{107} -\entry {\code {COFLAGS}}{108} -\entry {\code {CPP}}{107} -\entry {\code {CPPFLAGS}}{108} -\entry {\code {CTANGLE}}{107} -\entry {\code {CWEAVE}}{107} -\entry {\code {CXX}}{107} -\entry {\code {CXXFLAGS}}{108} -\initial {D} -\entry {\code {define}}{67} -\entry {\code {dir}}{81} -\initial {E} -\entry {\code {else}}{72} -\entry {\code {endef}}{67} -\entry {\code {endif}}{72} -\entry {\code {export}}{48} -\initial {F} -\entry {\code {FC}}{107} -\entry {\code {FFLAGS}}{108} -\entry {\code {filter}}{80} -\entry {\code {filter-out}}{80} -\entry {\code {findstring}}{79} -\entry {\code {firstword}}{83} -\entry {\code {foreach}}{83} -\initial {G} -\entry {\code {GET}}{107} -\entry {\code {GFLAGS}}{108} -\entry {\code {GNUmakefile}}{14} -\initial {I} -\entry {\code {ifdef}}{72} -\entry {\code {ifeq}}{72} -\entry {\code {ifndef}}{72} -\entry {\code {ifneq}}{72} -\entry {\code {include}}{14} -\initial {J} -\entry {\code {join}}{82} -\initial {L} -\entry {\code {LDFLAGS}}{108} -\entry {\code {LEX}}{107} -\entry {\code {LFLAGS}}{108} -\initial {M} -\entry {\code {MAKE}}{46, 58} -\entry {\code {makefile}}{14} -\entry {\code {Makefile}}{14} -\entry {\code {MAKEFILES}}{16, 50} -\entry {\code {MAKEFLAGS}}{50} -\entry {\code {MAKEINFO}}{107} -\entry {\code {MAKELEVEL}}{49, 58} -\entry {\code {MAKEOVERRIDES}}{51} -\entry {\code {MFLAGS}}{51} -\initial {N} -\entry {\code {notdir}}{81} -\initial {O} -\entry {\code {origin}}{85} -\entry {\code {OUTPUT{\_}OPTION}}{106} -\entry {\code {override}}{66} -\initial {P} -\entry {\code {patsubst}}{59, 78} -\entry {\code {PC}}{107} -\entry {\code {PFLAGS}}{108} -\initial {R} -\entry {\code {RFLAGS}}{108} -\entry {\code {RM}}{107} -\initial {S} -\entry {\code {shell}}{87} -\entry {\code {SHELL}}{42} -\entry {\code {SHELL \r {(command execution)}}}{42} -\entry {\code {sort}}{80} -\entry {\code {strip}}{79} -\entry {\code {subst}}{33, 78} -\entry {\code {suffix}}{82} -\entry {\code {SUFFIXES}}{119} -\initial {T} -\entry {\code {TANGLE}}{107} -\entry {\code {TEX}}{107} -\entry {\code {TEXI2DVI}}{107} -\initial {U} -\entry {\code {unexport}}{48} -\initial {V} -\entry {\code {vpath}}{23, 24} -\entry {\code {VPATH}}{23} -\initial {W} -\entry {\code {WEAVE}}{107} -\entry {\code {wildcard}}{22, 83} -\entry {\code {word}}{83} -\entry {\code {words}}{83} -\initial {Y} -\entry {\code {YACC}}{107} -\entry {\code {YACCR}}{107} -\entry {\code {YFLAGS}}{108} diff --git a/buildtools/windows/source/make/make.h b/buildtools/windows/source/make/make.h deleted file mode 100644 index 62ff2d89167..00000000000 --- a/buildtools/windows/source/make/make.h +++ /dev/null @@ -1,355 +0,0 @@ -/* Miscellaneous global declarations and portability cruft for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* AIX requires this to be the first thing in the file. */ -#if defined (_AIX) && !defined (__GNUC__) - #pragma alloca -#endif - -/* We use instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because make.h was found in $srcdir). */ -#include -#undef HAVE_CONFIG_H -#define HAVE_CONFIG_H - -#ifdef CRAY -/* This must happen before #include so - that the declaration therein is changed. */ -#define signal bsdsignal -#endif - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TIMEB_H -/* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in that bombs - unless has been included first. Does every system have a - ? If any does not, configure should check for it. */ -#include -#endif -#include -#include - -#ifndef errno -extern int errno; -#endif - -#ifndef isblank -#define isblank(c) ((c) == ' ' || (c) == '\t') -#endif - -#ifdef HAVE_UNISTD_H -#include -/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get - POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */ -#if defined (_POSIX_VERSION) && !defined (ultrix) -#define POSIX -#endif -#endif - -/* Some systems define _POSIX_VERSION but are not really POSIX.1. */ -#if (defined (butterfly) || defined (__arm) || \ - (defined (__mips) && defined (_SYSTYPE_SVR3)) || \ - (defined (sequent) && defined (i386))) -#undef POSIX -#endif - -#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) -#define POSIX -#endif - -#if !defined (HAVE_SYS_SIGLIST) && defined (HAVE__SYS_SIGLIST) -#define sys_siglist _sys_siglist -#define HAVE_SYS_SIGLIST /* Now we have it. */ - -/* It was declared in , with who knows what type. - Don't declare it again and risk conflicting. */ -#define SYS_SIGLIST_DECLARED -#endif - -#ifdef HAVE_SYS_SIGLIST -#ifndef SYS_SIGLIST_DECLARED -extern char *sys_siglist[]; -#endif -#else -#include "signame.h" -#endif - -/* Some systems do not define NSIG in . */ -#ifndef NSIG -#ifdef _NSIG -#define NSIG _NSIG -#else -#define NSIG 32 -#endif -#endif - -#ifndef RETSIGTYPE -#define RETSIGTYPE void -#endif - -#ifndef sigmask -#define sigmask(sig) (1 << ((sig) - 1)) -#endif - -#ifdef HAVE_LIMITS_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifndef PATH_MAX -#ifndef POSIX -#define PATH_MAX MAXPATHLEN -#endif /* Not POSIX. */ -#endif /* No PATH_MAX. */ -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif /* No MAXPATHLEN. */ - -#ifdef PATH_MAX -#define GET_PATH_MAX PATH_MAX -#define PATH_VAR(var) char var[PATH_MAX] -#else -#define NEED_GET_PATH_MAX -extern unsigned int get_path_max (); -#define GET_PATH_MAX (get_path_max ()) -#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX) -#endif - -#ifdef STAT_MACROS_BROKEN -#ifdef S_ISREG -#undef S_ISREG -#endif -#ifdef S_ISDIR -#undef S_ISDIR -#endif -#endif /* STAT_MACROS_BROKEN. */ - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif - - -#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) -#include -#include -#define ANSI_STRING -#else /* No standard headers. */ - -#ifdef HAVE_STRING_H -#include -#define ANSI_STRING -#else -#include -#endif -#ifdef HAVE_MEMORY_H -#include -#endif - -extern char *malloc (), *realloc (); -extern void free (); - -extern void abort (), exit (); - -#endif /* Standard headers. */ - -#ifdef ANSI_STRING - -#ifndef index -#define index(s, c) strchr((s), (c)) -#endif -#ifndef rindex -#define rindex(s, c) strrchr((s), (c)) -#endif - -#ifndef bcmp -#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) -#endif -#ifndef bzero -#define bzero(s, n) memset ((s), 0, (n)) -#endif -#ifndef bcopy -#define bcopy(s, d, n) memcpy ((d), (s), (n)) -#endif - -#else /* Not ANSI_STRING. */ - -#ifndef bcmp -extern int bcmp (); -#endif -#ifndef bzero -extern void bzero (); -#endif -#ifndef bcopy -extern void bcopy (); -#endif - -#endif /* ANSI_STRING. */ -#undef ANSI_STRING - -/* SCO Xenix has a buggy macro definition in . */ -#undef strerror - -#ifndef ANSI_STRING -extern char *strerror (); -#endif - - -#ifdef __GNUC__ -#undef alloca -#define alloca(n) __builtin_alloca (n) -#else /* Not GCC. */ -#ifdef HAVE_ALLOCA_H -#include -#elif defined(NETSCAPE) -#include -#else /* Not HAVE_ALLOCA_H. */ -#ifndef _AIX -extern char *alloca (); -#endif /* Not AIX. */ -#endif /* HAVE_ALLOCA_H. */ -#endif /* GCC. */ - -#ifndef iAPX286 -#define streq(a, b) \ - ((a) == (b) || \ - (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) -#else -/* Buggy compiler can't handle this. */ -#define streq(a, b) (strcmp ((a), (b)) == 0) -#endif - -/* Add to VAR the hashing value of C, one character in a name. */ -#define HASH(var, c) \ - ((var += (c)), (var = ((var) << 7) + ((var) >> 20))) - -#if defined(__GNUC__) || defined(ENUM_BITFIELDS) -#define ENUM_BITFIELD(bits) :bits -#else -#define ENUM_BITFIELD(bits) -#endif - -#if defined(__MSDOS__) || defined(NETSCAPE) -#define PATH_SEPARATOR_CHAR ';' -#else -#define PATH_SEPARATOR_CHAR ':' -#endif - -extern void die (); -extern void message (), fatal (), error (); -extern void makefile_error (), makefile_fatal (); -extern void pfatal_with_name (), perror_with_name (); -extern char *savestring (), *concat (); -extern char *xmalloc (), *xrealloc (); -extern char *find_next_token (), *next_token (), *end_of_token (); -extern void collapse_continuations (), remove_comments (); -extern char *sindex (), *lindex (); -extern int alpha_compare (const void *elem1, const void *elem2); -extern void print_spaces (); -extern struct dep *copy_dep_chain (); -extern char *find_char_unquote (), *find_percent (); - -extern int safe_stat (char * name, struct stat * buf); - - -#ifndef NO_ARCHIVES -extern int ar_name (); -extern void ar_parse_name (); -extern int ar_touch (); -extern time_t ar_member_date (); -#endif - -extern void dir_load (); -extern int dir_file_exists_p (), file_exists_p (), file_impossible_p (); -extern void file_impossible (); -extern char *dir_name (); - -extern void define_default_variables (); -extern void set_default_suffixes (), install_default_suffix_rules (); -extern void install_default_implicit_rules (), count_implicit_rule_limits (); -extern void convert_to_pattern (), create_pattern_rule (); - -extern void build_vpath_lists (), construct_vpath_list (); -extern int vpath_search (); - -extern void construct_include_path (); -extern void uniquize_deps (); - -extern int update_goal_chain (); -extern void notice_finished_file (); - -extern void user_access (), make_access (), child_access (); - - -#ifdef HAVE_VFORK_H -#include -#endif - -/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, - because such systems often declare the in header files anyway. */ - -#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) - -extern long int atol (); -extern long int lseek (); - -#endif /* Not GNU C library or POSIX. */ - -#ifdef HAVE_GETCWD -extern char *getcwd (); -#else -extern char *getwd (); -#define getcwd(buf, len) getwd (buf) -#endif - -extern char **environ; - -extern char *reading_filename; -extern unsigned int *reading_lineno_ptr; - -extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; -extern int debug_flag, print_data_base_flag, question_flag, touch_flag; -extern int env_overrides, no_builtin_rules_flag, print_version_flag; -extern int print_directory_flag, warn_undefined_variables_flag; -extern int posix_pedantic; - -extern unsigned int job_slots; -extern double max_load_average; - -extern char *program; -extern char *starting_directory; -extern unsigned int makelevel; -extern char *version_string, *remote_description; - -extern unsigned int commands_started; - -extern int handling_fatal_signal; - - -#define DEBUGPR(msg) \ - do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \ - fflush (stdout); } while (0) diff --git a/buildtools/windows/source/make/make.info b/buildtools/windows/source/make/make.info deleted file mode 100644 index be5446863a9..00000000000 --- a/buildtools/windows/source/make/make.info +++ /dev/null @@ -1,163 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -Indirect: -make.info-1: 1141 -make.info-2: 50405 -make.info-3: 97832 -make.info-4: 147393 -make.info-5: 196701 -make.info-6: 243137 -make.info-7: 292772 -make.info-8: 318335 - -Tag Table: -(Indirect) -Node: Top1141 -Node: Overview12012 -Node: Preparing12949 -Node: Reading13904 -Node: Bugs14826 -Node: Introduction16694 -Node: Rule Introduction18281 -Node: Simple Makefile19990 -Node: How Make Works23603 -Node: Variables Simplify26101 -Node: make Deduces28307 -Node: Combine By Dependency30054 -Node: Cleanup31082 -Node: Makefiles32492 -Node: Makefile Contents33189 -Node: Makefile Names35449 -Node: Include37051 -Node: MAKEFILES Variable40462 -Node: Remaking Makefiles41964 -Node: Overriding Makefiles45782 -Node: Rules47805 -Node: Rule Example50405 -Node: Rule Syntax51240 -Node: Wildcards53449 -Node: Wildcard Examples54959 -Node: Wildcard Pitfall56194 -Node: Wildcard Function57444 -Node: Directory Search59225 -Node: General Search60285 -Node: Selective Search61803 -Node: Commands/Search64723 -Node: Implicit/Search66063 -Node: Libraries/Search66998 -Node: Phony Targets68067 -Node: Force Targets71412 -Node: Empty Targets72449 -Node: Special Targets73709 -Node: Multiple Targets77631 -Node: Multiple Rules79498 -Node: Static Pattern81581 -Node: Static Usage82221 -Node: Static versus Implicit85875 -Node: Double-Colon87606 -Node: Automatic Dependencies89136 -Node: Commands93214 -Node: Echoing94906 -Node: Execution96164 -Node: Parallel97832 -Node: Errors101147 -Node: Interrupts104783 -Node: Recursion106364 -Node: MAKE Variable107650 -Node: Variables/Recursion109608 -Node: Options/Recursion114571 -Node: -w Option119257 -Node: Sequences120243 -Node: Empty Commands123238 -Node: Using Variables124406 -Node: Reference127390 -Node: Flavors128935 -Node: Advanced134252 -Node: Substitution Refs134752 -Node: Computed Names136279 -Node: Values140849 -Node: Setting141766 -Node: Appending143475 -Node: Override Directive147393 -Node: Defining148772 -Node: Environment150770 -Node: Conditionals152898 -Node: Conditional Example153607 -Node: Conditional Syntax156173 -Node: Testing Flags160919 -Node: Functions162016 -Node: Syntax of Functions163014 -Node: Text Functions165151 -Node: Filename Functions171905 -Node: Foreach Function177026 -Node: Origin Function180232 -Node: Shell Function183457 -Node: Running184834 -Node: Makefile Arguments186822 -Node: Goals187517 -Node: Instead of Execution191519 -Node: Avoiding Compilation194800 -Node: Overriding196701 -Node: Testing198989 -Node: Options Summary200866 -Node: Implicit Rules207676 -Node: Using Implicit209822 -Node: Catalogue of Rules213309 -Node: Implicit Variables222290 -Node: Chained Rules226416 -Node: Pattern Rules229114 -Node: Pattern Intro230642 -Node: Pattern Examples233453 -Node: Automatic235246 -Node: Pattern Match241533 -Node: Match-Anything Rules243137 -Node: Canceling Rules246996 -Node: Last Resort247699 -Node: Suffix Rules249536 -Node: Search Algorithm253243 -Node: Archives256739 -Node: Archive Members257434 -Node: Archive Update259013 -Node: Archive Symbols260929 -Node: Archive Pitfalls262128 -Node: Archive Suffix Rules262844 -Node: Features264384 -Node: Missing272736 -Node: Makefile Conventions277065 -Node: Makefile Basics277413 -Node: Utilities in Makefiles279752 -Node: Standard Targets281444 -Node: Command Variables289947 -Node: Directory Variables292772 -Node: Quick Reference302070 -Node: Complex Makefile309668 -Node: Concept Index318335 -Node: Name Index357722 - -End Tag Table diff --git a/buildtools/windows/source/make/make.info-1 b/buildtools/windows/source/make/make.info-1 deleted file mode 100644 index 84630943d3f..00000000000 --- a/buildtools/windows/source/make/make.info-1 +++ /dev/null @@ -1,1122 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - -Make -**** - - The GNU `make' utility automatically determines which pieces of a -large program need to be recompiled, and issues the commands to -recompile them. - - This is Edition 0.48 of the `GNU Make Manual', last updated 4 April -1995 for `make' Version 3.73 Beta. - - This manual describes `make' and contains the following chapters: - -* Menu: - -* Overview:: Overview of `make'. -* Introduction:: An introduction to `make'. -* Makefiles:: Makefiles tell `make' what to do. -* Rules:: Rules describe when a file must be remade. -* Commands:: Commands say how to remake a file. -* Using Variables:: You can use variables to avoid repetition. -* Conditionals:: Use or ignore parts of the makefile based - on the values of variables. -* Functions:: Many powerful ways to manipulate text. -* make Invocation: Running. How to invoke `make' on the command line. -* Implicit Rules:: Use implicit rules to treat many files alike, - based on their file names. -* Archives:: How `make' can update library archives. -* Features:: Features GNU `make' has over other `make's. -* Missing:: What GNU `make' lacks from other `make's. -* Makefile Conventions:: Conventions for makefiles in GNU programs. -* Quick Reference:: A quick reference for experienced users. -* Complex Makefile:: A real example of a straightforward, - but nontrivial, makefile. -* Concept Index:: Index of Concepts -* Name Index:: Index of Functions, Variables, & Directives - - -- The Detailed Node Listing -- - -Overview of `make' - -* Preparing:: Preparing and Running Make -* Reading:: On Reading this Text -* Bugs:: Problems and Bugs - -An Introduction to Makefiles - -* Rule Introduction:: What a rule looks like. -* Simple Makefile:: A Simple Makefile -* How Make Works:: How `make' Processes This Makefile -* Variables Simplify:: Variables Make Makefiles Simpler -* make Deduces:: Letting `make' Deduce the Commands -* Combine By Dependency:: Another Style of Makefile -* Cleanup:: Rules for Cleaning the Directory - -Writing Makefiles - -* Makefile Contents:: What makefiles contain. -* Makefile Names:: How to name your makefile. -* Include:: How one makefile can use another makefile. -* MAKEFILES Variable:: The environment can specify extra makefiles. -* Remaking Makefiles:: How makefiles get remade. -* Overriding Makefiles:: How to override part of one makefile - with another makefile. - -Writing Rules - -* Rule Example:: An example explained. -* Rule Syntax:: General syntax explained. -* Wildcards:: Using wildcard characters such as `*'. -* Directory Search:: Searching other directories for source files. -* Phony Targets:: Using a target that is not a real file's name. -* Force Targets:: You can use a target without commands - or dependencies to mark other - targets as phony. -* Empty Targets:: When only the date matters and the - files are empty. -* Special Targets:: Targets with special built-in meanings. -* Multiple Targets:: When to make use of several targets in a rule. -* Multiple Rules:: How to use several rules with the same target. -* Static Pattern:: Static pattern rules apply to multiple targets - and can vary the dependencies according to - the target name. -* Double-Colon:: How to use a special kind of rule to allow - several independent rules for one target. -* Automatic Dependencies:: How to automatically generate rules giving - dependencies from the source files themselves. - -Using Wildcard Characters in File Names - -* Wildcard Examples:: Several examples -* Wildcard Pitfall:: Problems to avoid. -* Wildcard Function:: How to cause wildcard expansion where - it does not normally take place. - -Searching Directories for Dependencies - -* General Search:: Specifying a search path that applies - to every dependency. -* Selective Search:: Specifying a search path - for a specified class of names. -* Commands/Search:: How to write shell commands that work together - with search paths. -* Implicit/Search:: How search paths affect implicit rules. -* Libraries/Search:: Directory search for link libraries. - -Static Pattern Rules - -* Static Usage:: The syntax of static pattern rules. -* Static versus Implicit:: When are they better than implicit rules? - -Writing the Commands in Rules - -* Echoing:: How to control when commands are echoed. -* Execution:: How commands are executed. -* Parallel:: How commands can be executed in parallel. -* Errors:: What happens after a command execution error. -* Interrupts:: What happens when a command is interrupted. -* Recursion:: Invoking `make' from makefiles. -* Sequences:: Defining canned sequences of commands. -* Empty Commands:: Defining useful, do-nothing commands. - -Recursive Use of `make' - -* MAKE Variable:: The special effects of using `$(MAKE)'. -* Variables/Recursion:: How to communicate variables to a sub-`make'. -* Options/Recursion:: How to communicate options to a sub-`make'. -* -w Option:: How the `-w' or `--print-directory' option - helps debug use of recursive `make' commands. - -How to Use Variables - -* Reference:: How to use the value of a variable. -* Flavors:: Variables come in two flavors. -* Advanced:: Advanced features for referencing a variable. -* Values:: All the ways variables get their values. -* Setting:: How to set a variable in the makefile. -* Appending:: How to append more text to the old value - of a variable. -* Override Directive:: How to set a variable in the makefile even if - the user has set it with a command argument. -* Defining:: An alternate way to set a variable - to a verbatim string. -* Environment:: Variable values can come from the environment. - -Advanced Features for Reference to Variables - -* Substitution Refs:: Referencing a variable with - substitutions on the value. -* Computed Names:: Computing the name of the variable to refer to. - -Conditional Parts of Makefiles - -* Conditional Example:: Example of a conditional -* Conditional Syntax:: The syntax of conditionals. -* Testing Flags:: Conditionals that test flags. - -Functions for Transforming Text - -* Syntax of Functions:: How to write a function call. -* Text Functions:: General-purpose text manipulation functions. -* Filename Functions:: Functions for manipulating file names. -* Foreach Function:: Repeat some text with controlled variation. -* Origin Function:: Find where a variable got its value. -* Shell Function:: Substitute the output of a shell command. - -How to Run `make' - -* Makefile Arguments:: How to specify which makefile to use. -* Goals:: How to use goal arguments to specify which - parts of the makefile to use. -* Instead of Execution:: How to use mode flags to specify what - kind of thing to do with the commands - in the makefile other than simply - execute them. -* Avoiding Compilation:: How to avoid recompiling certain files. -* Overriding:: How to override a variable to specify - an alternate compiler and other things. -* Testing:: How to proceed past some errors, to - test compilation. -* Options Summary:: Summary of Options - -Using Implicit Rules - -* Using Implicit:: How to use an existing implicit rule - to get the commands for updating a file. -* Catalogue of Rules:: A list of built-in implicit rules. -* Implicit Variables:: How to change what predefined rules do. -* Chained Rules:: How to use a chain of implicit rules. -* Pattern Rules:: How to define new implicit rules. -* Last Resort:: How to defining commands for rules - which cannot find any. -* Suffix Rules:: The old-fashioned style of implicit rule. -* Search Algorithm:: The precise algorithm for applying - implicit rules. - -Defining and Redefining Pattern Rules - -* Pattern Intro:: An introduction to pattern rules. -* Pattern Examples:: Examples of pattern rules. -* Automatic:: How to use automatic variables in the - commands of implicit rules. -* Pattern Match:: How patterns match. -* Match-Anything Rules:: Precautions you should take prior to - defining rules that can match any - target file whatever. -* Canceling Rules:: How to override or cancel built-in rules. - -Using `make' to Update Archive Files - -* Archive Members:: Archive members as targets. -* Archive Update:: The implicit rule for archive member targets. -* Archive Suffix Rules:: You can write a special kind of suffix rule - for updating archives. - -Implicit Rule for Archive Member Targets - -* Archive Symbols:: How to update archive symbol directories. - - -File: make.info, Node: Overview, Next: Introduction, Prev: Top, Up: Top - -Overview of `make' -****************** - - The `make' utility automatically determines which pieces of a large -program need to be recompiled, and issues commands to recompile them. -This manual describes GNU `make', which was implemented by Richard -Stallman and Roland McGrath. GNU `make' conforms to section 6.2 of -`IEEE Standard 1003.2-1992' (POSIX.2). - - Our examples show C programs, since they are most common, but you -can use `make' with any programming language whose compiler can be run -with a shell command. Indeed, `make' is not limited to programs. You -can use it to describe any task where some files must be updated -automatically from others whenever the others change. - -* Menu: - -* Preparing:: Preparing and Running Make -* Reading:: On Reading this Text -* Bugs:: Problems and Bugs - - -File: make.info, Node: Preparing, Next: Reading, Up: Overview - -Preparing and Running Make -========================== - - To prepare to use `make', you must write a file called the -"makefile" that describes the relationships among files in your program -and provides commands for updating each file. In a program, typically, -the executable file is updated from object files, which are in turn -made by compiling source files. - - Once a suitable makefile exists, each time you change some source -files, this simple shell command: - - make - -suffices to perform all necessary recompilations. The `make' program -uses the makefile data base and the last-modification times of the -files to decide which of the files need to be updated. For each of -those files, it issues the commands recorded in the data base. - - You can provide command line arguments to `make' to control which -files should be recompiled, or how. *Note How to Run `make': Running. - - -File: make.info, Node: Reading, Next: Bugs, Prev: Preparing, Up: Overview - -How to Read This Manual -======================= - - If you are new to `make', or are looking for a general introduction, -read the first few sections of each chapter, skipping the later -sections. In each chapter, the first few sections contain introductory -or general information and the later sections contain specialized or -technical information. The exception is the second chapter, *Note An -Introduction to Makefiles: Introduction, all of which is introductory. - - If you are familiar with other `make' programs, see *Note Features -of GNU `make': Features, which lists the enhancements GNU `make' has, -and *Note Incompatibilities and Missing Features: Missing, which -explains the few things GNU `make' lacks that others have. - - For a quick summary, see *Note Options Summary::, *Note Quick -Reference::, and *Note Special Targets::. - - -File: make.info, Node: Bugs, Prev: Reading, Up: Overview - -Problems and Bugs -================= - - If you have problems with GNU `make' or think you've found a bug, -please report it to the developers; we cannot promise to do anything but -we might well want to fix it. - - Before reporting a bug, make sure you've actually found a real bug. -Carefully reread the documentation and see if it really says you can do -what you're trying to do. If it's not clear whether you should be able -to do something or not, report that too; it's a bug in the -documentation! - - Before reporting a bug or trying to fix it yourself, try to isolate -it to the smallest possible makefile that reproduces the problem. Then -send us the makefile and the exact results `make' gave you. Also say -what you expected to occur; this will help us decide whether the -problem was really in the documentation. - - Once you've got a precise problem, please send electronic mail either -through the Internet or via UUCP: - - Internet address: - bug-gnu-utils@prep.ai.mit.edu - - UUCP path: - mit-eddie!prep.ai.mit.edu!bug-gnu-utils - -Please include the version number of `make' you are using. You can get -this information with the command `make --version'. Be sure also to -include the type of machine and operating system you are using. If -possible, include the contents of the file `config.h' that is generated -by the configuration process. - - Non-bug suggestions are always welcome as well. If you have -questions about things that are unclear in the documentation or are -just obscure features, send a message to the bug reporting address. We -cannot guarantee you'll get help with your problem, but many seasoned -`make' users read the mailing list and they will probably try to help -you out. The maintainers sometimes answer such questions as well, when -time permits. - - -File: make.info, Node: Introduction, Next: Makefiles, Prev: Overview, Up: Top - -An Introduction to Makefiles -**************************** - - You need a file called a "makefile" to tell `make' what to do. Most -often, the makefile tells `make' how to compile and link a program. - - In this chapter, we will discuss a simple makefile that describes -how to compile and link a text editor which consists of eight C source -files and three header files. The makefile can also tell `make' how to -run miscellaneous commands when explicitly asked (for example, to remove -certain files as a clean-up operation). To see a more complex example -of a makefile, see *Note Complex Makefile::. - - When `make' recompiles the editor, each changed C source file must -be recompiled. If a header file has changed, each C source file that -includes the header file must be recompiled to be safe. Each -compilation produces an object file corresponding to the source file. -Finally, if any source file has been recompiled, all the object files, -whether newly made or saved from previous compilations, must be linked -together to produce the new executable editor. - -* Menu: - -* Rule Introduction:: What a rule looks like. -* Simple Makefile:: A Simple Makefile -* How Make Works:: How `make' Processes This Makefile -* Variables Simplify:: Variables Make Makefiles Simpler -* make Deduces:: Letting `make' Deduce the Commands -* Combine By Dependency:: Another Style of Makefile -* Cleanup:: Rules for Cleaning the Directory - - -File: make.info, Node: Rule Introduction, Next: Simple Makefile, Up: Introduction - -What a Rule Looks Like -====================== - - A simple makefile consists of "rules" with the following shape: - - TARGET ... : DEPENDENCIES ... - COMMAND - ... - ... - - A "target" is usually the name of a file that is generated by a -program; examples of targets are executable or object files. A target -can also be the name of an action to carry out, such as `clean' (*note -Phony Targets::.). - - A "dependency" is a file that is used as input to create the target. -A target often depends on several files. - - A "command" is an action that `make' carries out. A rule may have -more than one command, each on its own line. *Please note:* you need -to put a tab character at the beginning of every command line! This is -an obscurity that catches the unwary. - - Usually a command is in a rule with dependencies and serves to -create a target file if any of the dependencies change. However, the -rule that specifies commands for the target need not have dependencies. -For example, the rule containing the delete command associated with the -target `clean' does not have dependencies. - - A "rule", then, explains how and when to remake certain files which -are the targets of the particular rule. `make' carries out the -commands on the dependencies to create or update the target. A rule -can also explain how and when to carry out an action. *Note Writing -Rules: Rules. - - A makefile may contain other text besides rules, but a simple -makefile need only contain rules. Rules may look somewhat more -complicated than shown in this template, but all fit the pattern more -or less. - - -File: make.info, Node: Simple Makefile, Next: How Make Works, Prev: Rule Introduction, Up: Introduction - -A Simple Makefile -================= - - Here is a straightforward makefile that describes the way an -executable file called `edit' depends on eight object files which, in -turn, depend on eight C source and three header files. - - In this example, all the C files include `defs.h', but only those -defining editing commands include `command.h', and only low level files -that change the editor buffer include `buffer.h'. - - edit : main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - cc -o edit main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - - main.o : main.c defs.h - cc -c main.c - kbd.o : kbd.c defs.h command.h - cc -c kbd.c - command.o : command.c defs.h command.h - cc -c command.c - display.o : display.c defs.h buffer.h - cc -c display.c - insert.o : insert.c defs.h buffer.h - cc -c insert.c - search.o : search.c defs.h buffer.h - cc -c search.c - files.o : files.c defs.h buffer.h command.h - cc -c files.c - utils.o : utils.c defs.h - cc -c utils.c - clean : - rm edit main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - -We split each long line into two lines using backslash-newline; this is -like using one long line, but is easier to read. - - To use this makefile to create the executable file called `edit', -type: - - make - - To use this makefile to delete the executable file and all the object -files from the directory, type: - - make clean - - In the example makefile, the targets include the executable file -`edit', and the object files `main.o' and `kbd.o'. The dependencies -are files such as `main.c' and `defs.h'. In fact, each `.o' file is -both a target and a dependency. Commands include `cc -c main.c' and -`cc -c kbd.c'. - - When a target is a file, it needs to be recompiled or relinked if any -of its dependencies change. In addition, any dependencies that are -themselves automatically generated should be updated first. In this -example, `edit' depends on each of the eight object files; the object -file `main.o' depends on the source file `main.c' and on the header -file `defs.h'. - - A shell command follows each line that contains a target and -dependencies. These shell commands say how to update the target file. -A tab character must come at the beginning of every command line to -distinguish commands lines from other lines in the makefile. (Bear in -mind that `make' does not know anything about how the commands work. -It is up to you to supply commands that will update the target file -properly. All `make' does is execute the commands in the rule you have -specified when the target file needs to be updated.) - - The target `clean' is not a file, but merely the name of an action. -Since you normally do not want to carry out the actions in this rule, -`clean' is not a dependency of any other rule. Consequently, `make' -never does anything with it unless you tell it specifically. Note that -this rule not only is not a dependency, it also does not have any -dependencies, so the only purpose of the rule is to run the specified -commands. Targets that do not refer to files but are just actions are -called "phony targets". *Note Phony Targets::, for information about -this kind of target. *Note Errors in Commands: Errors, to see how to -cause `make' to ignore errors from `rm' or any other command. - - -File: make.info, Node: How Make Works, Next: Variables Simplify, Prev: Simple Makefile, Up: Introduction - -How `make' Processes a Makefile -=============================== - - By default, `make' starts with the first rule (not counting rules -whose target names start with `.'). This is called the "default goal". -("Goals" are the targets that `make' strives ultimately to update. -*Note Arguments to Specify the Goals: Goals.) - - In the simple example of the previous section, the default goal is to -update the executable program `edit'; therefore, we put that rule first. - - Thus, when you give the command: - - make - -`make' reads the makefile in the current directory and begins by -processing the first rule. In the example, this rule is for relinking -`edit'; but before `make' can fully process this rule, it must process -the rules for the files that `edit' depends on, which in this case are -the object files. Each of these files is processed according to its -own rule. These rules say to update each `.o' file by compiling its -source file. The recompilation must be done if the source file, or any -of the header files named as dependencies, is more recent than the -object file, or if the object file does not exist. - - The other rules are processed because their targets appear as -dependencies of the goal. If some other rule is not depended on by the -goal (or anything it depends on, etc.), that rule is not processed, -unless you tell `make' to do so (with a command such as `make clean'). - - Before recompiling an object file, `make' considers updating its -dependencies, the source file and header files. This makefile does not -specify anything to be done for them--the `.c' and `.h' files are not -the targets of any rules--so `make' does nothing for these files. But -`make' would update automatically generated C programs, such as those -made by Bison or Yacc, by their own rules at this time. - - After recompiling whichever object files need it, `make' decides -whether to relink `edit'. This must be done if the file `edit' does -not exist, or if any of the object files are newer than it. If an -object file was just recompiled, it is now newer than `edit', so `edit' -is relinked. - - Thus, if we change the file `insert.c' and run `make', `make' will -compile that file to update `insert.o', and then link `edit'. If we -change the file `command.h' and run `make', `make' will recompile the -object files `kbd.o', `command.o' and `files.o' and then link the file -`edit'. - - -File: make.info, Node: Variables Simplify, Next: make Deduces, Prev: How Make Works, Up: Introduction - -Variables Make Makefiles Simpler -================================ - - In our example, we had to list all the object files twice in the -rule for `edit' (repeated here): - - edit : main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - cc -o edit main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - - Such duplication is error-prone; if a new object file is added to the -system, we might add it to one list and forget the other. We can -eliminate the risk and simplify the makefile by using a variable. -"Variables" allow a text string to be defined once and substituted in -multiple places later (*note How to Use Variables: Using Variables.). - - It is standard practice for every makefile to have a variable named -`objects', `OBJECTS', `objs', `OBJS', `obj', or `OBJ' which is a list -of all object file names. We would define such a variable `objects' -with a line like this in the makefile: - - objects = main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - -Then, each place we want to put a list of the object file names, we can -substitute the variable's value by writing `$(objects)' (*note How to -Use Variables: Using Variables.). - - Here is how the complete simple makefile looks when you use a -variable for the object files: - - objects = main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - - edit : $(objects) - cc -o edit $(objects) - main.o : main.c defs.h - cc -c main.c - kbd.o : kbd.c defs.h command.h - cc -c kbd.c - command.o : command.c defs.h command.h - cc -c command.c - display.o : display.c defs.h buffer.h - cc -c display.c - insert.o : insert.c defs.h buffer.h - cc -c insert.c - search.o : search.c defs.h buffer.h - cc -c search.c - files.o : files.c defs.h buffer.h command.h - cc -c files.c - utils.o : utils.c defs.h - cc -c utils.c - clean : - rm edit $(objects) - - -File: make.info, Node: make Deduces, Next: Combine By Dependency, Prev: Variables Simplify, Up: Introduction - -Letting `make' Deduce the Commands -================================== - - It is not necessary to spell out the commands for compiling the -individual C source files, because `make' can figure them out: it has an -"implicit rule" for updating a `.o' file from a correspondingly named -`.c' file using a `cc -c' command. For example, it will use the -command `cc -c main.c -o main.o' to compile `main.c' into `main.o'. We -can therefore omit the commands from the rules for the object files. -*Note Using Implicit Rules: Implicit Rules. - - When a `.c' file is used automatically in this way, it is also -automatically added to the list of dependencies. We can therefore omit -the `.c' files from the dependencies, provided we omit the commands. - - Here is the entire example, with both of these changes, and a -variable `objects' as suggested above: - - objects = main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - - edit : $(objects) - cc -o edit $(objects) - - main.o : defs.h - kbd.o : defs.h command.h - command.o : defs.h command.h - display.o : defs.h buffer.h - insert.o : defs.h buffer.h - search.o : defs.h buffer.h - files.o : defs.h buffer.h command.h - utils.o : defs.h - - .PHONY : clean - clean : - -rm edit $(objects) - -This is how we would write the makefile in actual practice. (The -complications associated with `clean' are described elsewhere. See -*Note Phony Targets::, and *Note Errors in Commands: Errors.) - - Because implicit rules are so convenient, they are important. You -will see them used frequently. - - -File: make.info, Node: Combine By Dependency, Next: Cleanup, Prev: make Deduces, Up: Introduction - -Another Style of Makefile -========================= - - When the objects of a makefile are created only by implicit rules, an -alternative style of makefile is possible. In this style of makefile, -you group entries by their dependencies instead of by their targets. -Here is what one looks like: - - objects = main.o kbd.o command.o display.o \ - insert.o search.o files.o utils.o - - edit : $(objects) - cc -o edit $(objects) - - $(objects) : defs.h - kbd.o command.o files.o : command.h - display.o insert.o search.o files.o : buffer.h - -Here `defs.h' is given as a dependency of all the object files; -`command.h' and `buffer.h' are dependencies of the specific object -files listed for them. - - Whether this is better is a matter of taste: it is more compact, but -some people dislike it because they find it clearer to put all the -information about each target in one place. - - -File: make.info, Node: Cleanup, Prev: Combine By Dependency, Up: Introduction - -Rules for Cleaning the Directory -================================ - - Compiling a program is not the only thing you might want to write -rules for. Makefiles commonly tell how to do a few other things besides -compiling a program: for example, how to delete all the object files -and executables so that the directory is `clean'. - - Here is how we could write a `make' rule for cleaning our example -editor: - - clean: - rm edit $(objects) - - In practice, we might want to write the rule in a somewhat more -complicated manner to handle unanticipated situations. We would do -this: - - .PHONY : clean - clean : - -rm edit $(objects) - -This prevents `make' from getting confused by an actual file called -`clean' and causes it to continue in spite of errors from `rm'. (See -*Note Phony Targets::, and *Note Errors in Commands: Errors.) - -A rule such as this should not be placed at the beginning of the -makefile, because we do not want it to run by default! Thus, in the -example makefile, we want the rule for `edit', which recompiles the -editor, to remain the default goal. - - Since `clean' is not a dependency of `edit', this rule will not run -at all if we give the command `make' with no arguments. In order to -make the rule run, we have to type `make clean'. *Note How to Run -`make': Running. - - -File: make.info, Node: Makefiles, Next: Rules, Prev: Introduction, Up: Top - -Writing Makefiles -***************** - - The information that tells `make' how to recompile a system comes -from reading a data base called the "makefile". - -* Menu: - -* Makefile Contents:: What makefiles contain. -* Makefile Names:: How to name your makefile. -* Include:: How one makefile can use another makefile. -* MAKEFILES Variable:: The environment can specify extra makefiles. -* Remaking Makefiles:: How makefiles get remade. -* Overriding Makefiles:: How to override part of one makefile - with another makefile. - - -File: make.info, Node: Makefile Contents, Next: Makefile Names, Up: Makefiles - -What Makefiles Contain -====================== - - Makefiles contain five kinds of things: "explicit rules", "implicit -rules", "variable definitions", "directives", and "comments". Rules, -variables, and directives are described at length in later chapters. - - * An "explicit rule" says when and how to remake one or more files, - called the rule's targets. It lists the other files that the - targets "depend on", and may also give commands to use to create - or update the targets. *Note Writing Rules: Rules. - - * An "implicit rule" says when and how to remake a class of files - based on their names. It describes how a target may depend on a - file with a name similar to the target and gives commands to - create or update such a target. *Note Using Implicit Rules: - Implicit Rules. - - * A "variable definition" is a line that specifies a text string - value for a variable that can be substituted into the text later. - The simple makefile example shows a variable definition for - `objects' as a list of all object files (*note Variables Make - Makefiles Simpler: Variables Simplify.). - - * A "directive" is a command for `make' to do something special while - reading the makefile. These include: - - * Reading another makefile (*note Including Other Makefiles: - Include.). - - * Deciding (based on the values of variables) whether to use or - ignore a part of the makefile (*note Conditional Parts of - Makefiles: Conditionals.). - - * Defining a variable from a verbatim string containing - multiple lines (*note Defining Variables Verbatim: Defining.). - - * `#' in a line of a makefile starts a "comment". It and the rest of - the line are ignored, except that a trailing backslash not escaped - by another backslash will continue the comment across multiple - lines. Comments may appear on any of the lines in the makefile, - except within a `define' directive, and perhaps within commands - (where the shell decides what is a comment). A line containing - just a comment (with perhaps spaces before it) is effectively - blank, and is ignored. - - -File: make.info, Node: Makefile Names, Next: Include, Prev: Makefile Contents, Up: Makefiles - -What Name to Give Your Makefile -=============================== - - By default, when `make' looks for the makefile, it tries the -following names, in order: `GNUmakefile', `makefile' and `Makefile'. - - Normally you should call your makefile either `makefile' or -`Makefile'. (We recommend `Makefile' because it appears prominently -near the beginning of a directory listing, right near other important -files such as `README'.) The first name checked, `GNUmakefile', is not -recommended for most makefiles. You should use this name if you have a -makefile that is specific to GNU `make', and will not be understood by -other versions of `make'. Other `make' programs look for `makefile' and -`Makefile', but not `GNUmakefile'. - - If `make' finds none of these names, it does not use any makefile. -Then you must specify a goal with a command argument, and `make' will -attempt to figure out how to remake it using only its built-in implicit -rules. *Note Using Implicit Rules: Implicit Rules. - - If you want to use a nonstandard name for your makefile, you can -specify the makefile name with the `-f' or `--file' option. The -arguments `-f NAME' or `--file=NAME' tell `make' to read the file NAME -as the makefile. If you use more than one `-f' or `--file' option, you -can specify several makefiles. All the makefiles are effectively -concatenated in the order specified. The default makefile names -`GNUmakefile', `makefile' and `Makefile' are not checked automatically -if you specify `-f' or `--file'. - - -File: make.info, Node: Include, Next: MAKEFILES Variable, Prev: Makefile Names, Up: Makefiles - -Including Other Makefiles -========================= - - The `include' directive tells `make' to suspend reading the current -makefile and read one or more other makefiles before continuing. The -directive is a line in the makefile that looks like this: - - include FILENAMES... - -FILENAMES can contain shell file name patterns. - - Extra spaces are allowed and ignored at the beginning of the line, -but a tab is not allowed. (If the line begins with a tab, it will be -considered a command line.) Whitespace is required between `include' -and the file names, and between file names; extra whitespace is ignored -there and at the end of the directive. A comment starting with `#' is -allowed at the end of the line. If the file names contain any variable -or function references, they are expanded. *Note How to Use Variables: -Using Variables. - - For example, if you have three `.mk' files, `a.mk', `b.mk', and -`c.mk', and `$(bar)' expands to `bish bash', then the following -expression - - include foo *.mk $(bar) - - is equivalent to - - include foo a.mk b.mk c.mk bish bash - - When `make' processes an `include' directive, it suspends reading of -the containing makefile and reads from each listed file in turn. When -that is finished, `make' resumes reading the makefile in which the -directive appears. - - One occasion for using `include' directives is when several programs, -handled by individual makefiles in various directories, need to use a -common set of variable definitions (*note Setting Variables: Setting.) -or pattern rules (*note Defining and Redefining Pattern Rules: Pattern -Rules.). - - Another such occasion is when you want to generate dependencies from -source files automatically; the dependencies can be put in a file that -is included by the main makefile. This practice is generally cleaner -than that of somehow appending the dependencies to the end of the main -makefile as has been traditionally done with other versions of `make'. -*Note Automatic Dependencies::. - - If the specified name does not start with a slash, and the file is -not found in the current directory, several other directories are -searched. First, any directories you have specified with the `-I' or -`--include-dir' option are searched (*note Summary of Options: Options -Summary.). Then the following directories (if they exist) are -searched, in this order: `PREFIX/include' (normally -`/usr/local/include') `/usr/gnu/include', `/usr/local/include', -`/usr/include'. - - If an included makefile cannot be found in any of these directories, -a warning message is generated, but it is not an immediately fatal -error; processing of the makefile containing the `include' continues. -Once it has finished reading makefiles, `make' will try to remake any -that are out of date or don't exist. *Note How Makefiles Are Remade: -Remaking Makefiles. Only after it has tried to find a way to remake a -makefile and failed, will `make' diagnose the missing makefile as a -fatal error. - - If you want `make' to simply ignore a makefile which does not exist -and cannot be remade, with no error message, use the `-include' -directive instead of `include', like this: - - -include FILENAMES... - - This is acts like `include' in every way except that there is no -error (not even a warning) if any of the FILENAMES do not exist. - - -File: make.info, Node: MAKEFILES Variable, Next: Remaking Makefiles, Prev: Include, Up: Makefiles - -The Variable `MAKEFILES' -======================== - - If the environment variable `MAKEFILES' is defined, `make' considers -its value as a list of names (separated by whitespace) of additional -makefiles to be read before the others. This works much like the -`include' directive: various directories are searched for those files -(*note Including Other Makefiles: Include.). In addition, the default -goal is never taken from one of these makefiles and it is not an error -if the files listed in `MAKEFILES' are not found. - - The main use of `MAKEFILES' is in communication between recursive -invocations of `make' (*note Recursive Use of `make': Recursion.). It -usually is not desirable to set the environment variable before a -top-level invocation of `make', because it is usually better not to -mess with a makefile from outside. However, if you are running `make' -without a specific makefile, a makefile in `MAKEFILES' can do useful -things to help the built-in implicit rules work better, such as -defining search paths (*note Directory Search::.). - - Some users are tempted to set `MAKEFILES' in the environment -automatically on login, and program makefiles to expect this to be done. -This is a very bad idea, because such makefiles will fail to work if -run by anyone else. It is much better to write explicit `include' -directives in the makefiles. *Note Including Other Makefiles: Include. - - -File: make.info, Node: Remaking Makefiles, Next: Overriding Makefiles, Prev: MAKEFILES Variable, Up: Makefiles - -How Makefiles Are Remade -======================== - - Sometimes makefiles can be remade from other files, such as RCS or -SCCS files. If a makefile can be remade from other files, you probably -want `make' to get an up-to-date version of the makefile to read in. - - To this end, after reading in all makefiles, `make' will consider -each as a goal target and attempt to update it. If a makefile has a -rule which says how to update it (found either in that very makefile or -in another one) or if an implicit rule applies to it (*note Using -Implicit Rules: Implicit Rules.), it will be updated if necessary. -After all makefiles have been checked, if any have actually been -changed, `make' starts with a clean slate and reads all the makefiles -over again. (It will also attempt to update each of them over again, -but normally this will not change them again, since they are already up -to date.) - - If the makefiles specify a double-colon rule to remake a file with -commands but no dependencies, that file will always be remade (*note -Double-Colon::.). In the case of makefiles, a makefile that has a -double-colon rule with commands but no dependencies will be remade every -time `make' is run, and then again after `make' starts over and reads -the makefiles in again. This would cause an infinite loop: `make' -would constantly remake the makefile, and never do anything else. So, -to avoid this, `make' will *not* attempt to remake makefiles which are -specified as double-colon targets but have no dependencies. - - If you do not specify any makefiles to be read with `-f' or `--file' -options, `make' will try the default makefile names; *note What Name to -Give Your Makefile: Makefile Names.. Unlike makefiles explicitly -requested with `-f' or `--file' options, `make' is not certain that -these makefiles should exist. However, if a default makefile does not -exist but can be created by running `make' rules, you probably want the -rules to be run so that the makefile can be used. - - Therefore, if none of the default makefiles exists, `make' will try -to make each of them in the same order in which they are searched for -(*note What Name to Give Your Makefile: Makefile Names.) until it -succeeds in making one, or it runs out of names to try. Note that it -is not an error if `make' cannot find or make any makefile; a makefile -is not always necessary. - - When you use the `-t' or `--touch' option (*note Instead of -Executing the Commands: Instead of Execution.), you would not want to -use an out-of-date makefile to decide which targets to touch. So the -`-t' option has no effect on updating makefiles; they are really -updated even if `-t' is specified. Likewise, `-q' (or `--question') -and `-n' (or `--just-print') do not prevent updating of makefiles, -because an out-of-date makefile would result in the wrong output for -other targets. Thus, `make -f mfile -n foo' will update `mfile', read -it in, and then print the commands to update `foo' and its dependencies -without running them. The commands printed for `foo' will be those -specified in the updated contents of `mfile'. - - However, on occasion you might actually wish to prevent updating of -even the makefiles. You can do this by specifying the makefiles as -goals in the command line as well as specifying them as makefiles. -When the makefile name is specified explicitly as a goal, the options -`-t' and so on do apply to them. - - Thus, `make -f mfile -n mfile foo' would read the makefile `mfile', -print the commands needed to update it without actually running them, -and then print the commands needed to update `foo' without running -them. The commands for `foo' will be those specified by the existing -contents of `mfile'. - - -File: make.info, Node: Overriding Makefiles, Prev: Remaking Makefiles, Up: Makefiles - -Overriding Part of Another Makefile -=================================== - - Sometimes it is useful to have a makefile that is mostly just like -another makefile. You can often use the `include' directive to include -one in the other, and add more targets or variable definitions. -However, if the two makefiles give different commands for the same -target, `make' will not let you just do this. But there is another way. - - In the containing makefile (the one that wants to include the other), -you can use a match-anything pattern rule to say that to remake any -target that cannot be made from the information in the containing -makefile, `make' should look in another makefile. *Note Pattern -Rules::, for more information on pattern rules. - - For example, if you have a makefile called `Makefile' that says how -to make the target `foo' (and other targets), you can write a makefile -called `GNUmakefile' that contains: - - foo: - frobnicate > foo - - %: force - @$(MAKE) -f Makefile $@ - force: ; - - If you say `make foo', `make' will find `GNUmakefile', read it, and -see that to make `foo', it needs to run the command `frobnicate > foo'. -If you say `make bar', `make' will find no way to make `bar' in -`GNUmakefile', so it will use the commands from the pattern rule: `make --f Makefile bar'. If `Makefile' provides a rule for updating `bar', -`make' will apply the rule. And likewise for any other target that -`GNUmakefile' does not say how to make. - - The way this works is that the pattern rule has a pattern of just -`%', so it matches any target whatever. The rule specifies a -dependency `force', to guarantee that the commands will be run even if -the target file already exists. We give `force' target empty commands -to prevent `make' from searching for an implicit rule to build -it--otherwise it would apply the same match-anything rule to `force' -itself and create a dependency loop! - - -File: make.info, Node: Rules, Next: Commands, Prev: Makefiles, Up: Top - -Writing Rules -************* - - A "rule" appears in the makefile and says when and how to remake -certain files, called the rule's "targets" (most often only one per -rule). It lists the other files that are the "dependencies" of the -target, and "commands" to use to create or update the target. - - The order of rules is not significant, except for determining the -"default goal": the target for `make' to consider, if you do not -otherwise specify one. The default goal is the target of the first -rule in the first makefile. If the first rule has multiple targets, -only the first target is taken as the default. There are two -exceptions: a target starting with a period is not a default unless it -contains one or more slashes, `/', as well; and, a target that defines -a pattern rule has no effect on the default goal. (*Note Defining and -Redefining Pattern Rules: Pattern Rules.) - - Therefore, we usually write the makefile so that the first rule is -the one for compiling the entire program or all the programs described -by the makefile (often with a target called `all'). *Note Arguments to -Specify the Goals: Goals. - -* Menu: - -* Rule Example:: An example explained. -* Rule Syntax:: General syntax explained. -* Wildcards:: Using wildcard characters such as `*'. -* Directory Search:: Searching other directories for source files. -* Phony Targets:: Using a target that is not a real file's name. -* Force Targets:: You can use a target without commands - or dependencies to mark other - targets as phony. -* Empty Targets:: When only the date matters and the - files are empty. -* Special Targets:: Targets with special built-in meanings. -* Multiple Targets:: When to make use of several targets in a rule. -* Multiple Rules:: How to use several rules with the same target. -* Static Pattern:: Static pattern rules apply to multiple targets - and can vary the dependencies according to - the target name. -* Double-Colon:: How to use a special kind of rule to allow - several independent rules for one target. -* Automatic Dependencies:: How to automatically generate rules giving - dependencies from the source files themselves. - diff --git a/buildtools/windows/source/make/make.info-2 b/buildtools/windows/source/make/make.info-2 deleted file mode 100644 index 3a6e261fcc4..00000000000 --- a/buildtools/windows/source/make/make.info-2 +++ /dev/null @@ -1,1195 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Rule Example, Next: Rule Syntax, Up: Rules - -Rule Example -============ - - Here is an example of a rule: - - foo.o : foo.c defs.h # module for twiddling the frobs - cc -c -g foo.c - - Its target is `foo.o' and its dependencies are `foo.c' and `defs.h'. -It has one command, which is `cc -c -g foo.c'. The command line -starts with a tab to identify it as a command. - - This rule says two things: - - * How to decide whether `foo.o' is out of date: it is out of date if - it does not exist, or if either `foo.c' or `defs.h' is more recent - than it. - - * How to update the file `foo.o': by running `cc' as stated. The - command does not explicitly mention `defs.h', but we presume that - `foo.c' includes it, and that that is why `defs.h' was added to - the dependencies. - - -File: make.info, Node: Rule Syntax, Next: Wildcards, Prev: Rule Example, Up: Rules - -Rule Syntax -=========== - - In general, a rule looks like this: - - TARGETS : DEPENDENCIES - COMMAND - ... - -or like this: - - TARGETS : DEPENDENCIES ; COMMAND - COMMAND - ... - - The TARGETS are file names, separated by spaces. Wildcard -characters may be used (*note Using Wildcard Characters in File Names: -Wildcards.) and a name of the form `A(M)' represents member M in -archive file A (*note Archive Members as Targets: Archive Members.). -Usually there is only one target per rule, but occasionally there is a -reason to have more (*note Multiple Targets in a Rule: Multiple -Targets.). - - The COMMAND lines start with a tab character. The first command may -appear on the line after the dependencies, with a tab character, or may -appear on the same line, with a semicolon. Either way, the effect is -the same. *Note Writing the Commands in Rules: Commands. - - Because dollar signs are used to start variable references, if you -really want a dollar sign in a rule you must write two of them, `$$' -(*note How to Use Variables: Using Variables.). You may split a long -line by inserting a backslash followed by a newline, but this is not -required, as `make' places no limit on the length of a line in a -makefile. - - A rule tells `make' two things: when the targets are out of date, -and how to update them when necessary. - - The criterion for being out of date is specified in terms of the -DEPENDENCIES, which consist of file names separated by spaces. -(Wildcards and archive members (*note Archives::.) are allowed here -too.) A target is out of date if it does not exist or if it is older -than any of the dependencies (by comparison of last-modification -times). The idea is that the contents of the target file are computed -based on information in the dependencies, so if any of the dependencies -changes, the contents of the existing target file are no longer -necessarily valid. - - How to update is specified by COMMANDS. These are lines to be -executed by the shell (normally `sh'), but with some extra features -(*note Writing the Commands in Rules: Commands.). - - -File: make.info, Node: Wildcards, Next: Directory Search, Prev: Rule Syntax, Up: Rules - -Using Wildcard Characters in File Names -======================================= - - A single file name can specify many files using "wildcard -characters". The wildcard characters in `make' are `*', `?' and -`[...]', the same as in the Bourne shell. For example, `*.c' specifies -a list of all the files (in the working directory) whose names end in -`.c'. - - The character `~' at the beginning of a file name also has special -significance. If alone, or followed by a slash, it represents your home -directory. For example `~/bin' expands to `/home/you/bin'. If the `~' -is followed by a word, the string represents the home directory of the -user named by that word. For example `~john/bin' expands to -`/home/john/bin'. - - Wildcard expansion happens automatically in targets, in dependencies, -and in commands (where the shell does the expansion). In other -contexts, wildcard expansion happens only if you request it explicitly -with the `wildcard' function. - - The special significance of a wildcard character can be turned off by -preceding it with a backslash. Thus, `foo\*bar' would refer to a -specific file whose name consists of `foo', an asterisk, and `bar'. - -* Menu: - -* Wildcard Examples:: Several examples -* Wildcard Pitfall:: Problems to avoid. -* Wildcard Function:: How to cause wildcard expansion where - it does not normally take place. - - -File: make.info, Node: Wildcard Examples, Next: Wildcard Pitfall, Up: Wildcards - -Wildcard Examples ------------------ - - Wildcards can be used in the commands of a rule, where they are -expanded by the shell. For example, here is a rule to delete all the -object files: - - clean: - rm -f *.o - - Wildcards are also useful in the dependencies of a rule. With the -following rule in the makefile, `make print' will print all the `.c' -files that have changed since the last time you printed them: - - print: *.c - lpr -p $? - touch print - -This rule uses `print' as an empty target file; see *Note Empty Target -Files to Record Events: Empty Targets. (The automatic variable `$?' is -used to print only those files that have changed; see *Note Automatic -Variables: Automatic.) - - Wildcard expansion does not happen when you define a variable. -Thus, if you write this: - - objects = *.o - -then the value of the variable `objects' is the actual string `*.o'. -However, if you use the value of `objects' in a target, dependency or -command, wildcard expansion will take place at that time. To set -`objects' to the expansion, instead use: - - objects := $(wildcard *.o) - -*Note Wildcard Function::. - - -File: make.info, Node: Wildcard Pitfall, Next: Wildcard Function, Prev: Wildcard Examples, Up: Wildcards - -Pitfalls of Using Wildcards ---------------------------- - - Now here is an example of a naive way of using wildcard expansion, -that does not do what you would intend. Suppose you would like to say -that the executable file `foo' is made from all the object files in the -directory, and you write this: - - objects = *.o - - foo : $(objects) - cc -o foo $(CFLAGS) $(objects) - -The value of `objects' is the actual string `*.o'. Wildcard expansion -happens in the rule for `foo', so that each *existing* `.o' file -becomes a dependency of `foo' and will be recompiled if necessary. - - But what if you delete all the `.o' files? When a wildcard matches -no files, it is left as it is, so then `foo' will depend on the -oddly-named file `*.o'. Since no such file is likely to exist, `make' -will give you an error saying it cannot figure out how to make `*.o'. -This is not what you want! - - Actually it is possible to obtain the desired result with wildcard -expansion, but you need more sophisticated techniques, including the -`wildcard' function and string substitution. *Note The Function -`wildcard': Wildcard Function. - - -File: make.info, Node: Wildcard Function, Prev: Wildcard Pitfall, Up: Wildcards - -The Function `wildcard' ------------------------ - - Wildcard expansion happens automatically in rules. But wildcard -expansion does not normally take place when a variable is set, or -inside the arguments of a function. If you want to do wildcard -expansion in such places, you need to use the `wildcard' function, like -this: - - $(wildcard PATTERN...) - -This string, used anywhere in a makefile, is replaced by a -space-separated list of names of existing files that match one of the -given file name patterns. If no existing file name matches a pattern, -then that pattern is omitted from the output of the `wildcard' -function. Note that this is different from how unmatched wildcards -behave in rules, where they are used verbatim rather than ignored -(*note Wildcard Pitfall::.). - - One use of the `wildcard' function is to get a list of all the C -source files in a directory, like this: - - $(wildcard *.c) - - We can change the list of C source files into a list of object files -by replacing the `.o' suffix with `.c' in the result, like this: - - $(patsubst %.c,%.o,$(wildcard *.c)) - -(Here we have used another function, `patsubst'. *Note Functions for -String Substitution and Analysis: Text Functions.) - - Thus, a makefile to compile all C source files in the directory and -then link them together could be written as follows: - - objects := $(patsubst %.c,%.o,$(wildcard *.c)) - - foo : $(objects) - cc -o foo $(objects) - -(This takes advantage of the implicit rule for compiling C programs, so -there is no need to write explicit rules for compiling the files. -*Note The Two Flavors of Variables: Flavors, for an explanation of -`:=', which is a variant of `='.) - - -File: make.info, Node: Directory Search, Next: Phony Targets, Prev: Wildcards, Up: Rules - -Searching Directories for Dependencies -====================================== - - For large systems, it is often desirable to put sources in a separate -directory from the binaries. The "directory search" features of `make' -facilitate this by searching several directories automatically to find -a dependency. When you redistribute the files among directories, you -do not need to change the individual rules, just the search paths. - -* Menu: - -* General Search:: Specifying a search path that applies - to every dependency. -* Selective Search:: Specifying a search path - for a specified class of names. -* Commands/Search:: How to write shell commands that work together - with search paths. -* Implicit/Search:: How search paths affect implicit rules. -* Libraries/Search:: Directory search for link libraries. - - -File: make.info, Node: General Search, Next: Selective Search, Up: Directory Search - -`VPATH': Search Path for All Dependencies ------------------------------------------ - - The value of the `make' variable `VPATH' specifies a list of -directories that `make' should search. Most often, the directories are -expected to contain dependency files that are not in the current -directory; however, `VPATH' specifies a search list that `make' applies -for all files, including files which are targets of rules. - - Thus, if a file that is listed as a target or dependency does not -exist in the current directory, `make' searches the directories listed -in `VPATH' for a file with that name. If a file is found in one of -them, that file becomes the dependency. Rules may then specify the -names of source files in the dependencies as if they all existed in the -current directory. *Note Writing Shell Commands with Directory Search: -Commands/Search. - - In the `VPATH' variable, directory names are separated by colons or -blanks. The order in which directories are listed is the order followed -by `make' in its search. - - For example, - - VPATH = src:../headers - -specifies a path containing two directories, `src' and `../headers', -which `make' searches in that order. - - With this value of `VPATH', the following rule, - - foo.o : foo.c - -is interpreted as if it were written like this: - - foo.o : src/foo.c - -assuming the file `foo.c' does not exist in the current directory but -is found in the directory `src'. - - -File: make.info, Node: Selective Search, Next: Commands/Search, Prev: General Search, Up: Directory Search - -The `vpath' Directive ---------------------- - - Similar to the `VPATH' variable but more selective is the `vpath' -directive (note lower case), which allows you to specify a search path -for a particular class of file names, those that match a particular -pattern. Thus you can supply certain search directories for one class -of file names and other directories (or none) for other file names. - - There are three forms of the `vpath' directive: - -`vpath PATTERN DIRECTORIES' - Specify the search path DIRECTORIES for file names that match - PATTERN. - - The search path, DIRECTORIES, is a list of directories to be - searched, separated by colons or blanks, just like the search path - used in the `VPATH' variable. - -`vpath PATTERN' - Clear out the search path associated with PATTERN. - -`vpath' - Clear all search paths previously specified with `vpath' - directives. - - A `vpath' pattern is a string containing a `%' character. The -string must match the file name of a dependency that is being searched -for, the `%' character matching any sequence of zero or more characters -(as in pattern rules; *note Defining and Redefining Pattern Rules: -Pattern Rules.). For example, `%.h' matches files that end in `.h'. -(If there is no `%', the pattern must match the dependency exactly, -which is not useful very often.) - - `%' characters in a `vpath' directive's pattern can be quoted with -preceding backslashes (`\'). Backslashes that would otherwise quote -`%' characters can be quoted with more backslashes. Backslashes that -quote `%' characters or other backslashes are removed from the pattern -before it is compared to file names. Backslashes that are not in -danger of quoting `%' characters go unmolested. - - When a dependency fails to exist in the current directory, if the -PATTERN in a `vpath' directive matches the name of the dependency file, -then the DIRECTORIES in that directive are searched just like (and -before) the directories in the `VPATH' variable. - - For example, - - vpath %.h ../headers - -tells `make' to look for any dependency whose name ends in `.h' in the -directory `../headers' if the file is not found in the current -directory. - - If several `vpath' patterns match the dependency file's name, then -`make' processes each matching `vpath' directive one by one, searching -all the directories mentioned in each directive. `make' handles -multiple `vpath' directives in the order in which they appear in the -makefile; multiple directives with the same pattern are independent of -each other. - - Thus, - - vpath %.c foo - vpath % blish - vpath %.c bar - -will look for a file ending in `.c' in `foo', then `blish', then `bar', -while - - vpath %.c foo:bar - vpath % blish - -will look for a file ending in `.c' in `foo', then `bar', then `blish'. - - -File: make.info, Node: Commands/Search, Next: Implicit/Search, Prev: Selective Search, Up: Directory Search - -Writing Shell Commands with Directory Search --------------------------------------------- - - When a dependency is found in another directory through directory -search, this cannot change the commands of the rule; they will execute -as written. Therefore, you must write the commands with care so that -they will look for the dependency in the directory where `make' finds -it. - - This is done with the "automatic variables" such as `$^' (*note -Automatic Variables: Automatic.). For instance, the value of `$^' is a -list of all the dependencies of the rule, including the names of the -directories in which they were found, and the value of `$@' is the -target. Thus: - - foo.o : foo.c - cc -c $(CFLAGS) $^ -o $@ - -(The variable `CFLAGS' exists so you can specify flags for C -compilation by implicit rules; we use it here for consistency so it will -affect all C compilations uniformly; *note Variables Used by Implicit -Rules: Implicit Variables..) - - Often the dependencies include header files as well, which you do not -want to mention in the commands. The automatic variable `$<' is just -the first dependency: - - VPATH = src:../headers - foo.o : foo.c defs.h hack.h - cc -c $(CFLAGS) $< -o $@ - - -File: make.info, Node: Implicit/Search, Next: Libraries/Search, Prev: Commands/Search, Up: Directory Search - -Directory Search and Implicit Rules ------------------------------------ - - The search through the directories specified in `VPATH' or with -`vpath' also happens during consideration of implicit rules (*note -Using Implicit Rules: Implicit Rules.). - - For example, when a file `foo.o' has no explicit rule, `make' -considers implicit rules, such as the built-in rule to compile `foo.c' -if that file exists. If such a file is lacking in the current -directory, the appropriate directories are searched for it. If `foo.c' -exists (or is mentioned in the makefile) in any of the directories, the -implicit rule for C compilation is applied. - - The commands of implicit rules normally use automatic variables as a -matter of necessity; consequently they will use the file names found by -directory search with no extra effort. - - -File: make.info, Node: Libraries/Search, Prev: Implicit/Search, Up: Directory Search - -Directory Search for Link Libraries ------------------------------------ - - Directory search applies in a special way to libraries used with the -linker. This special feature comes into play when you write a -dependency whose name is of the form `-lNAME'. (You can tell something -strange is going on here because the dependency is normally the name of -a file, and the *file name* of the library looks like `libNAME.a', not -like `-lNAME'.) - - When a dependency's name has the form `-lNAME', `make' handles it -specially by searching for the file `libNAME.a' in the current -directory, in directories specified by matching `vpath' search paths -and the `VPATH' search path, and then in the directories `/lib', -`/usr/lib', and `PREFIX/lib' (normally `/usr/local/lib'). - - For example, - - foo : foo.c -lcurses - cc $^ -o $@ - -would cause the command `cc foo.c /usr/lib/libcurses.a -o foo' to be -executed when `foo' is older than `foo.c' or than -`/usr/lib/libcurses.a'. - - -File: make.info, Node: Phony Targets, Next: Force Targets, Prev: Directory Search, Up: Rules - -Phony Targets -============= - - A phony target is one that is not really the name of a file. It is -just a name for some commands to be executed when you make an explicit -request. There are two reasons to use a phony target: to avoid a -conflict with a file of the same name, and to improve performance. - - If you write a rule whose commands will not create the target file, -the commands will be executed every time the target comes up for -remaking. Here is an example: - - clean: - rm *.o temp - -Because the `rm' command does not create a file named `clean', probably -no such file will ever exist. Therefore, the `rm' command will be -executed every time you say `make clean'. - - The phony target will cease to work if anything ever does create a -file named `clean' in this directory. Since it has no dependencies, the -file `clean' would inevitably be considered up to date, and its -commands would not be executed. To avoid this problem, you can -explicitly declare the target to be phony, using the special target -`.PHONY' (*note Special Built-in Target Names: Special Targets.) as -follows: - - .PHONY : clean - -Once this is done, `make clean' will run the commands regardless of -whether there is a file named `clean'. - - Since it knows that phony targets do not name actual files that -could be remade from other files, `make' skips the implicit rule search -for phony targets (*note Implicit Rules::.). This is why declaring a -target phony is good for performance, even if you are not worried about -the actual file existing. - - Thus, you first write the line that states that `clean' is a phony -target, then you write the rule, like this: - - .PHONY: clean - clean: - rm *.o temp - - A phony target should not be a dependency of a real target file; if -it is, its commands are run every time `make' goes to update that file. -As long as a phony target is never a dependency of a real target, the -phony target commands will be executed only when the phony target is a -specified goal (*note Arguments to Specify the Goals: Goals.). - - Phony targets can have dependencies. When one directory contains -multiple programs, it is most convenient to describe all of the -programs in one makefile `./Makefile'. Since the target remade by -default will be the first one in the makefile, it is common to make -this a phony target named `all' and give it, as dependencies, all the -individual programs. For example: - - all : prog1 prog2 prog3 - .PHONY : all - - prog1 : prog1.o utils.o - cc -o prog1 prog1.o utils.o - - prog2 : prog2.o - cc -o prog2 prog2.o - - prog3 : prog3.o sort.o utils.o - cc -o prog3 prog3.o sort.o utils.o - -Now you can say just `make' to remake all three programs, or specify as -arguments the ones to remake (as in `make prog1 prog3'). - - When one phony target is a dependency of another, it serves as a -subroutine of the other. For example, here `make cleanall' will delete -the object files, the difference files, and the file `program': - - .PHONY: cleanall cleanobj cleandiff - - cleanall : cleanobj cleandiff - rm program - - cleanobj : - rm *.o - - cleandiff : - rm *.diff - - -File: make.info, Node: Force Targets, Next: Empty Targets, Prev: Phony Targets, Up: Rules - -Rules without Commands or Dependencies -====================================== - - If a rule has no dependencies or commands, and the target of the rule -is a nonexistent file, then `make' imagines this target to have been -updated whenever its rule is run. This implies that all targets -depending on this one will always have their commands run. - - An example will illustrate this: - - clean: FORCE - rm $(objects) - FORCE: - - Here the target `FORCE' satisfies the special conditions, so the -target `clean' that depends on it is forced to run its commands. There -is nothing special about the name `FORCE', but that is one name -commonly used this way. - - As you can see, using `FORCE' this way has the same results as using -`.PHONY: clean'. - - Using `.PHONY' is more explicit and more efficient. However, other -versions of `make' do not support `.PHONY'; thus `FORCE' appears in -many makefiles. *Note Phony Targets::. - - -File: make.info, Node: Empty Targets, Next: Special Targets, Prev: Force Targets, Up: Rules - -Empty Target Files to Record Events -=================================== - - The "empty target" is a variant of the phony target; it is used to -hold commands for an action that you request explicitly from time to -time. Unlike a phony target, this target file can really exist; but -the file's contents do not matter, and usually are empty. - - The purpose of the empty target file is to record, with its -last-modification time, when the rule's commands were last executed. It -does so because one of the commands is a `touch' command to update the -target file. - - The empty target file must have some dependencies. When you ask to -remake the empty target, the commands are executed if any dependency is -more recent than the target; in other words, if a dependency has -changed since the last time you remade the target. Here is an example: - - print: foo.c bar.c - lpr -p $? - touch print - -With this rule, `make print' will execute the `lpr' command if either -source file has changed since the last `make print'. The automatic -variable `$?' is used to print only those files that have changed -(*note Automatic Variables: Automatic.). - - -File: make.info, Node: Special Targets, Next: Multiple Targets, Prev: Empty Targets, Up: Rules - -Special Built-in Target Names -============================= - - Certain names have special meanings if they appear as targets. - -`.PHONY' - The dependencies of the special target `.PHONY' are considered to - be phony targets. When it is time to consider such a target, - `make' will run its commands unconditionally, regardless of - whether a file with that name exists or what its last-modification - time is. *Note Phony Targets: Phony Targets. - -`.SUFFIXES' - The dependencies of the special target `.SUFFIXES' are the list of - suffixes to be used in checking for suffix rules. *Note - Old-Fashioned Suffix Rules: Suffix Rules. - -`.DEFAULT' - The commands specified for `.DEFAULT' are used for any target for - which no rules are found (either explicit rules or implicit rules). - *Note Last Resort::. If `.DEFAULT' commands are specified, every - file mentioned as a dependency, but not as a target in a rule, - will have these commands executed on its behalf. *Note Implicit - Rule Search Algorithm: Search Algorithm. - -`.PRECIOUS' - The targets which `.PRECIOUS' depends on are given the following - special treatment: if `make' is killed or interrupted during the - execution of their commands, the target is not deleted. *Note - Interrupting or Killing `make': Interrupts. Also, if the target - is an intermediate file, it will not be deleted after it is no - longer needed, as is normally done. *Note Chains of Implicit - Rules: Chained Rules. - - You can also list the target pattern of an implicit rule (such as - `%.o') as a dependency file of the special target `.PRECIOUS' to - preserve intermediate files created by rules whose target patterns - match that file's name. - -`.IGNORE' - If you specify dependencies for `.IGNORE', then `make' will ignore - errors in execution of the commands run for those particular - files. The commands for `.IGNORE' are not meaningful. - - If mentioned as a target with no dependencies, `.IGNORE' says to - ignore errors in execution of commands for all files. This usage - of `.IGNORE' is supported only for historical compatibility. Since - this affects every command in the makefile, it is not very useful; - we recommend you use the more selective ways to ignore errors in - specific commands. *Note Errors in Commands: Errors. - -`.SILENT' - If you specify dependencies for `.SILENT', then `make' will not - the print commands to remake those particular files before - executing them. The commands for `.SILENT' are not meaningful. - - If mentioned as a target with no dependencies, `.SILENT' says not - to print any commands before executing them. This usage of - `.SILENT' is supported only for historical compatibility. We - recommend you use the more selective ways to silence specific - commands. *Note Command Echoing: Echoing. If you want to silence - all commands for a particular run of `make', use the `-s' or - `--silent' option (*note Options Summary::.). - -`.EXPORT_ALL_VARIABLES' - Simply by being mentioned as a target, this tells `make' to export - all variables to child processes by default. *Note Communicating - Variables to a Sub-`make': Variables/Recursion. - - Any defined implicit rule suffix also counts as a special target if -it appears as a target, and so does the concatenation of two suffixes, -such as `.c.o'. These targets are suffix rules, an obsolete way of -defining implicit rules (but a way still widely used). In principle, -any target name could be special in this way if you break it in two and -add both pieces to the suffix list. In practice, suffixes normally -begin with `.', so these special target names also begin with `.'. -*Note Old-Fashioned Suffix Rules: Suffix Rules. - - -File: make.info, Node: Multiple Targets, Next: Multiple Rules, Prev: Special Targets, Up: Rules - -Multiple Targets in a Rule -========================== - - A rule with multiple targets is equivalent to writing many rules, -each with one target, and all identical aside from that. The same -commands apply to all the targets, but their effects may vary because -you can substitute the actual target name into the command using `$@'. -The rule contributes the same dependencies to all the targets also. - - This is useful in two cases. - - * You want just dependencies, no commands. For example: - - kbd.o command.o files.o: command.h - - gives an additional dependency to each of the three object files - mentioned. - - * Similar commands work for all the targets. The commands do not - need to be absolutely identical, since the automatic variable `$@' - can be used to substitute the particular target to be remade into - the commands (*note Automatic Variables: Automatic.). For example: - - bigoutput littleoutput : text.g - generate text.g -$(subst output,,$@) > $@ - - is equivalent to - - bigoutput : text.g - generate text.g -big > bigoutput - littleoutput : text.g - generate text.g -little > littleoutput - - Here we assume the hypothetical program `generate' makes two types - of output, one if given `-big' and one if given `-little'. *Note - Functions for String Substitution and Analysis: Text Functions, - for an explanation of the `subst' function. - - Suppose you would like to vary the dependencies according to the -target, much as the variable `$@' allows you to vary the commands. You -cannot do this with multiple targets in an ordinary rule, but you can -do it with a "static pattern rule". *Note Static Pattern Rules: Static -Pattern. - - -File: make.info, Node: Multiple Rules, Next: Static Pattern, Prev: Multiple Targets, Up: Rules - -Multiple Rules for One Target -============================= - - One file can be the target of several rules. All the dependencies -mentioned in all the rules are merged into one list of dependencies for -the target. If the target is older than any dependency from any rule, -the commands are executed. - - There can only be one set of commands to be executed for a file. If -more than one rule gives commands for the same file, `make' uses the -last set given and prints an error message. (As a special case, if the -file's name begins with a dot, no error message is printed. This odd -behavior is only for compatibility with other implementations of -`make'.) There is no reason to write your makefiles this way; that is -why `make' gives you an error message. - - An extra rule with just dependencies can be used to give a few extra -dependencies to many files at once. For example, one usually has a -variable named `objects' containing a list of all the compiler output -files in the system being made. An easy way to say that all of them -must be recompiled if `config.h' changes is to write the following: - - objects = foo.o bar.o - foo.o : defs.h - bar.o : defs.h test.h - $(objects) : config.h - - This could be inserted or taken out without changing the rules that -really specify how to make the object files, making it a convenient -form to use if you wish to add the additional dependency intermittently. - - Another wrinkle is that the additional dependencies could be -specified with a variable that you set with a command argument to `make' -(*note Overriding Variables: Overriding.). For example, - - extradeps= - $(objects) : $(extradeps) - -means that the command `make extradeps=foo.h' will consider `foo.h' as -a dependency of each object file, but plain `make' will not. - - If none of the explicit rules for a target has commands, then `make' -searches for an applicable implicit rule to find some commands *note -Using Implicit Rules: Implicit Rules.). - - -File: make.info, Node: Static Pattern, Next: Double-Colon, Prev: Multiple Rules, Up: Rules - -Static Pattern Rules -==================== - - "Static pattern rules" are rules which specify multiple targets and -construct the dependency names for each target based on the target name. -They are more general than ordinary rules with multiple targets because -the targets do not have to have identical dependencies. Their -dependencies must be *analogous*, but not necessarily *identical*. - -* Menu: - -* Static Usage:: The syntax of static pattern rules. -* Static versus Implicit:: When are they better than implicit rules? - - -File: make.info, Node: Static Usage, Next: Static versus Implicit, Up: Static Pattern - -Syntax of Static Pattern Rules ------------------------------- - - Here is the syntax of a static pattern rule: - - TARGETS ...: TARGET-PATTERN: DEP-PATTERNS ... - COMMANDS - ... - -The TARGETS list specifies the targets that the rule applies to. The -targets can contain wildcard characters, just like the targets of -ordinary rules (*note Using Wildcard Characters in File Names: -Wildcards.). - - The TARGET-PATTERN and DEP-PATTERNS say how to compute the -dependencies of each target. Each target is matched against the -TARGET-PATTERN to extract a part of the target name, called the "stem". -This stem is substituted into each of the DEP-PATTERNS to make the -dependency names (one from each DEP-PATTERN). - - Each pattern normally contains the character `%' just once. When the -TARGET-PATTERN matches a target, the `%' can match any part of the -target name; this part is called the "stem". The rest of the pattern -must match exactly. For example, the target `foo.o' matches the -pattern `%.o', with `foo' as the stem. The targets `foo.c' and -`foo.out' do not match that pattern. - - The dependency names for each target are made by substituting the -stem for the `%' in each dependency pattern. For example, if one -dependency pattern is `%.c', then substitution of the stem `foo' gives -the dependency name `foo.c'. It is legitimate to write a dependency -pattern that does not contain `%'; then this dependency is the same for -all targets. - - `%' characters in pattern rules can be quoted with preceding -backslashes (`\'). Backslashes that would otherwise quote `%' -characters can be quoted with more backslashes. Backslashes that quote -`%' characters or other backslashes are removed from the pattern before -it is compared to file names or has a stem substituted into it. -Backslashes that are not in danger of quoting `%' characters go -unmolested. For example, the pattern `the\%weird\\%pattern\\' has -`the%weird\' preceding the operative `%' character, and `pattern\\' -following it. The final two backslashes are left alone because they -cannot affect any `%' character. - - Here is an example, which compiles each of `foo.o' and `bar.o' from -the corresponding `.c' file: - - objects = foo.o bar.o - - $(objects): %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@ - -Here `$<' is the automatic variable that holds the name of the -dependency and `$@' is the automatic variable that holds the name of -the target; see *Note Automatic Variables: Automatic. - - Each target specified must match the target pattern; a warning is -issued for each target that does not. If you have a list of files, -only some of which will match the pattern, you can use the `filter' -function to remove nonmatching file names (*note Functions for String -Substitution and Analysis: Text Functions.): - - files = foo.elc bar.o lose.o - - $(filter %.o,$(files)): %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@ - $(filter %.elc,$(files)): %.elc: %.el - emacs -f batch-byte-compile $< - -In this example the result of `$(filter %.o,$(files))' is `bar.o -lose.o', and the first static pattern rule causes each of these object -files to be updated by compiling the corresponding C source file. The -result of `$(filter %.elc,$(files))' is `foo.elc', so that file is made -from `foo.el'. - - Another example shows how to use `$*' in static pattern rules: - - bigoutput littleoutput : %output : text.g - generate text.g -$* > $@ - -When the `generate' command is run, `$*' will expand to the stem, -either `big' or `little'. - - -File: make.info, Node: Static versus Implicit, Prev: Static Usage, Up: Static Pattern - -Static Pattern Rules versus Implicit Rules ------------------------------------------- - - A static pattern rule has much in common with an implicit rule -defined as a pattern rule (*note Defining and Redefining Pattern Rules: -Pattern Rules.). Both have a pattern for the target and patterns for -constructing the names of dependencies. The difference is in how -`make' decides *when* the rule applies. - - An implicit rule *can* apply to any target that matches its pattern, -but it *does* apply only when the target has no commands otherwise -specified, and only when the dependencies can be found. If more than -one implicit rule appears applicable, only one applies; the choice -depends on the order of rules. - - By contrast, a static pattern rule applies to the precise list of -targets that you specify in the rule. It cannot apply to any other -target and it invariably does apply to each of the targets specified. -If two conflicting rules apply, and both have commands, that's an error. - - The static pattern rule can be better than an implicit rule for these -reasons: - - * You may wish to override the usual implicit rule for a few files - whose names cannot be categorized syntactically but can be given - in an explicit list. - - * If you cannot be sure of the precise contents of the directories - you are using, you may not be sure which other irrelevant files - might lead `make' to use the wrong implicit rule. The choice - might depend on the order in which the implicit rule search is - done. With static pattern rules, there is no uncertainty: each - rule applies to precisely the targets specified. - - -File: make.info, Node: Double-Colon, Next: Automatic Dependencies, Prev: Static Pattern, Up: Rules - -Double-Colon Rules -================== - - "Double-colon" rules are rules written with `::' instead of `:' -after the target names. They are handled differently from ordinary -rules when the same target appears in more than one rule. - - When a target appears in multiple rules, all the rules must be the -same type: all ordinary, or all double-colon. If they are -double-colon, each of them is independent of the others. Each -double-colon rule's commands are executed if the target is older than -any dependencies of that rule. This can result in executing none, any, -or all of the double-colon rules. - - Double-colon rules with the same target are in fact completely -separate from one another. Each double-colon rule is processed -individually, just as rules with different targets are processed. - - The double-colon rules for a target are executed in the order they -appear in the makefile. However, the cases where double-colon rules -really make sense are those where the order of executing the commands -would not matter. - - Double-colon rules are somewhat obscure and not often very useful; -they provide a mechanism for cases in which the method used to update a -target differs depending on which dependency files caused the update, -and such cases are rare. - - Each double-colon rule should specify commands; if it does not, an -implicit rule will be used if one applies. *Note Using Implicit Rules: -Implicit Rules. - - -File: make.info, Node: Automatic Dependencies, Prev: Double-Colon, Up: Rules - -Generating Dependencies Automatically -===================================== - - In the makefile for a program, many of the rules you need to write -often say only that some object file depends on some header file. For -example, if `main.c' uses `defs.h' via an `#include', you would write: - - main.o: defs.h - -You need this rule so that `make' knows that it must remake `main.o' -whenever `defs.h' changes. You can see that for a large program you -would have to write dozens of such rules in your makefile. And, you -must always be very careful to update the makefile every time you add -or remove an `#include'. - - To avoid this hassle, most modern C compilers can write these rules -for you, by looking at the `#include' lines in the source files. -Usually this is done with the `-M' option to the compiler. For -example, the command: - - cc -M main.c - -generates the output: - - main.o : main.c defs.h - -Thus you no longer have to write all those rules yourself. The -compiler will do it for you. - - Note that such a dependency constitutes mentioning `main.o' in a -makefile, so it can never be considered an intermediate file by implicit -rule search. This means that `make' won't ever remove the file after -using it; *note Chains of Implicit Rules: Chained Rules.. - - With old `make' programs, it was traditional practice to use this -compiler feature to generate dependencies on demand with a command like -`make depend'. That command would create a file `depend' containing -all the automatically-generated dependencies; then the makefile could -use `include' to read them in (*note Include::.). - - In GNU `make', the feature of remaking makefiles makes this practice -obsolete--you need never tell `make' explicitly to regenerate the -dependencies, because it always regenerates any makefile that is out of -date. *Note Remaking Makefiles::. - - The practice we recommend for automatic dependency generation is to -have one makefile corresponding to each source file. For each source -file `NAME.c' there is a makefile `NAME.d' which lists what files the -object file `NAME.o' depends on. That way only the source files that -have changed need to be rescanned to produce the new dependencies. - - Here is the pattern rule to generate a file of dependencies (i.e., a -makefile) called `NAME.d' from a C source file called `NAME.c': - - %.d: %.c - $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \ - | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@' - -*Note Pattern Rules::, for information on defining pattern rules. The -`-e' flag to the shell makes it exit immediately if the `$(CC)' command -fails (exits with a nonzero status). Normally the shell exits with the -status of the last command in the pipeline (`sed' in this case), so -`make' would not notice a nonzero status from the compiler. - - With the GNU C compiler, you may wish to use the `-MM' flag instead -of `-M'. This omits dependencies on system header files. *Note -Options Controlling the Preprocessor: (gcc.info)Preprocessor Options, -for details. - - The purpose of the `sed' command is to translate (for example): - - main.o : main.c defs.h - -into: - - main.o main.d : main.c defs.h - -This makes each `.d' file depend on all the source and header files -that the corresponding `.o' file depends on. `make' then knows it must -regenerate the dependencies whenever any of the source or header files -changes. - - Once you've defined the rule to remake the `.d' files, you then use -the `include' directive to read them all in. *Note Include::. For -example: - - sources = foo.c bar.c - - include $(sources:.c=.d) - -(This example uses a substitution variable reference to translate the -list of source files `foo.c bar.c' into a list of dependency makefiles, -`foo.d bar.d'. *Note Substitution Refs::, for full information on -substitution references.) Since the `.d' files are makefiles like any -others, `make' will remake them as necessary with no further work from -you. *Note Remaking Makefiles::. - - -File: make.info, Node: Commands, Next: Using Variables, Prev: Rules, Up: Top - -Writing the Commands in Rules -***************************** - - The commands of a rule consist of shell command lines to be executed -one by one. Each command line must start with a tab, except that the -first command line may be attached to the target-and-dependencies line -with a semicolon in between. Blank lines and lines of just comments -may appear among the command lines; they are ignored. (But beware, an -apparently "blank" line that begins with a tab is *not* blank! It is an -empty command; *note Empty Commands::..) - - Users use many different shell programs, but commands in makefiles -are always interpreted by `/bin/sh' unless the makefile specifies -otherwise. *Note Command Execution: Execution. - - The shell that is in use determines whether comments can be written -on command lines, and what syntax they use. When the shell is -`/bin/sh', a `#' starts a comment that extends to the end of the line. -The `#' does not have to be at the beginning of a line. Text on a line -before a `#' is not part of the comment. - -* Menu: - -* Echoing:: How to control when commands are echoed. -* Execution:: How commands are executed. -* Parallel:: How commands can be executed in parallel. -* Errors:: What happens after a command execution error. -* Interrupts:: What happens when a command is interrupted. -* Recursion:: Invoking `make' from makefiles. -* Sequences:: Defining canned sequences of commands. -* Empty Commands:: Defining useful, do-nothing commands. - - -File: make.info, Node: Echoing, Next: Execution, Up: Commands - -Command Echoing -=============== - - Normally `make' prints each command line before it is executed. We -call this "echoing" because it gives the appearance that you are typing -the commands yourself. - - When a line starts with `@', the echoing of that line is suppressed. -The `@' is discarded before the command is passed to the shell. -Typically you would use this for a command whose only effect is to print -something, such as an `echo' command to indicate progress through the -makefile: - - @echo About to make distribution files - - When `make' is given the flag `-n' or `--just-print', echoing is all -that happens, no execution. *Note Summary of Options: Options Summary. -In this case and only this case, even the commands starting with `@' -are printed. This flag is useful for finding out which commands `make' -thinks are necessary without actually doing them. - - The `-s' or `--silent' flag to `make' prevents all echoing, as if -all commands started with `@'. A rule in the makefile for the special -target `.SILENT' without dependencies has the same effect (*note -Special Built-in Target Names: Special Targets.). `.SILENT' is -essentially obsolete since `@' is more flexible. - - -File: make.info, Node: Execution, Next: Parallel, Prev: Echoing, Up: Commands - -Command Execution -================= - - When it is time to execute commands to update a target, they are -executed by making a new subshell for each line. (In practice, `make' -may take shortcuts that do not affect the results.) - - *Please note:* this implies that shell commands such as `cd' that -set variables local to each process will not affect the following -command lines. If you want to use `cd' to affect the next command, put -the two on a single line with a semicolon between them. Then `make' -will consider them a single command and pass them, together, to a shell -which will execute them in sequence. For example: - - foo : bar/lose - cd bar; gobble lose > ../foo - - If you would like to split a single shell command into multiple -lines of text, you must use a backslash at the end of all but the last -subline. Such a sequence of lines is combined into a single line, by -deleting the backslash-newline sequences, before passing it to the -shell. Thus, the following is equivalent to the preceding example: - - foo : bar/lose - cd bar; \ - gobble lose > ../foo - - The program used as the shell is taken from the variable `SHELL'. -By default, the program `/bin/sh' is used. - - Unlike most variables, the variable `SHELL' is never set from the -environment. This is because the `SHELL' environment variable is used -to specify your personal choice of shell program for interactive use. -It would be very bad for personal choices like this to affect the -functioning of makefiles. *Note Variables from the Environment: -Environment. - diff --git a/buildtools/windows/source/make/make.info-3 b/buildtools/windows/source/make/make.info-3 deleted file mode 100644 index d9607df08fc..00000000000 --- a/buildtools/windows/source/make/make.info-3 +++ /dev/null @@ -1,1228 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Parallel, Next: Errors, Prev: Execution, Up: Commands - -Parallel Execution -================== - - GNU `make' knows how to execute several commands at once. Normally, -`make' will execute only one command at a time, waiting for it to -finish before executing the next. However, the `-j' or `--jobs' option -tells `make' to execute many commands simultaneously. - - If the `-j' option is followed by an integer, this is the number of -commands to execute at once; this is called the number of "job slots". -If there is nothing looking like an integer after the `-j' option, -there is no limit on the number of job slots. The default number of job -slots is one, which means serial execution (one thing at a time). - - One unpleasant consequence of running several commands -simultaneously is that output from all of the commands comes when the -commands send it, so messages from different commands may be -interspersed. - - Another problem is that two processes cannot both take input from the -same device; so to make sure that only one command tries to take input -from the terminal at once, `make' will invalidate the standard input -streams of all but one running command. This means that attempting to -read from standard input will usually be a fatal error (a `Broken pipe' -signal) for most child processes if there are several. - - It is unpredictable which command will have a valid standard input -stream (which will come from the terminal, or wherever you redirect the -standard input of `make'). The first command run will always get it -first, and the first command started after that one finishes will get -it next, and so on. - - We will change how this aspect of `make' works if we find a better -alternative. In the mean time, you should not rely on any command using -standard input at all if you are using the parallel execution feature; -but if you are not using this feature, then standard input works -normally in all commands. - - If a command fails (is killed by a signal or exits with a nonzero -status), and errors are not ignored for that command (*note Errors in -Commands: Errors.), the remaining command lines to remake the same -target will not be run. If a command fails and the `-k' or -`--keep-going' option was not given (*note Summary of Options: Options -Summary.), `make' aborts execution. If make terminates for any reason -(including a signal) with child processes running, it waits for them to -finish before actually exiting. - - When the system is heavily loaded, you will probably want to run -fewer jobs than when it is lightly loaded. You can use the `-l' option -to tell `make' to limit the number of jobs to run at once, based on the -load average. The `-l' or `--max-load' option is followed by a -floating-point number. For example, - - -l 2.5 - -will not let `make' start more than one job if the load average is -above 2.5. The `-l' option with no following number removes the load -limit, if one was given with a previous `-l' option. - - More precisely, when `make' goes to start up a job, and it already -has at least one job running, it checks the current load average; if it -is not lower than the limit given with `-l', `make' waits until the load -average goes below that limit, or until all the other jobs finish. - - By default, there is no load limit. - - -File: make.info, Node: Errors, Next: Interrupts, Prev: Parallel, Up: Commands - -Errors in Commands -================== - - After each shell command returns, `make' looks at its exit status. -If the command completed successfully, the next command line is executed -in a new shell; after the last command line is finished, the rule is -finished. - - If there is an error (the exit status is nonzero), `make' gives up on -the current rule, and perhaps on all rules. - - Sometimes the failure of a certain command does not indicate a -problem. For example, you may use the `mkdir' command to ensure that a -directory exists. If the directory already exists, `mkdir' will report -an error, but you probably want `make' to continue regardless. - - To ignore errors in a command line, write a `-' at the beginning of -the line's text (after the initial tab). The `-' is discarded before -the command is passed to the shell for execution. - - For example, - - clean: - -rm -f *.o - -This causes `rm' to continue even if it is unable to remove a file. - - When you run `make' with the `-i' or `--ignore-errors' flag, errors -are ignored in all commands of all rules. A rule in the makefile for -the special target `.IGNORE' has the same effect, if there are no -dependencies. These ways of ignoring errors are obsolete because `-' -is more flexible. - - When errors are to be ignored, because of either a `-' or the `-i' -flag, `make' treats an error return just like success, except that it -prints out a message that tells you the status code the command exited -with, and says that the error has been ignored. - - When an error happens that `make' has not been told to ignore, it -implies that the current target cannot be correctly remade, and neither -can any other that depends on it either directly or indirectly. No -further commands will be executed for these targets, since their -preconditions have not been achieved. - - Normally `make' gives up immediately in this circumstance, returning -a nonzero status. However, if the `-k' or `--keep-going' flag is -specified, `make' continues to consider the other dependencies of the -pending targets, remaking them if necessary, before it gives up and -returns nonzero status. For example, after an error in compiling one -object file, `make -k' will continue compiling other object files even -though it already knows that linking them will be impossible. *Note -Summary of Options: Options Summary. - - The usual behavior assumes that your purpose is to get the specified -targets up to date; once `make' learns that this is impossible, it -might as well report the failure immediately. The `-k' option says -that the real purpose is to test as many of the changes made in the -program as possible, perhaps to find several independent problems so -that you can correct them all before the next attempt to compile. This -is why Emacs' `compile' command passes the `-k' flag by default. - - Usually when a command fails, if it has changed the target file at -all, the file is corrupted and cannot be used--or at least it is not -completely updated. Yet the file's timestamp says that it is now up to -date, so the next time `make' runs, it will not try to update that -file. The situation is just the same as when the command is killed by a -signal; *note Interrupts::.. So generally the right thing to do is to -delete the target file if the command fails after beginning to change -the file. `make' will do this if `.DELETE_ON_ERROR' appears as a -target. This is almost always what you want `make' to do, but it is -not historical practice; so for compatibility, you must explicitly -request it. - - -File: make.info, Node: Interrupts, Next: Recursion, Prev: Errors, Up: Commands - -Interrupting or Killing `make' -============================== - - If `make' gets a fatal signal while a command is executing, it may -delete the target file that the command was supposed to update. This is -done if the target file's last-modification time has changed since -`make' first checked it. - - The purpose of deleting the target is to make sure that it is remade -from scratch when `make' is next run. Why is this? Suppose you type -`Ctrl-c' while a compiler is running, and it has begun to write an -object file `foo.o'. The `Ctrl-c' kills the compiler, resulting in an -incomplete file whose last-modification time is newer than the source -file `foo.c'. But `make' also receives the `Ctrl-c' signal and deletes -this incomplete file. If `make' did not do this, the next invocation -of `make' would think that `foo.o' did not require updating--resulting -in a strange error message from the linker when it tries to link an -object file half of which is missing. - - You can prevent the deletion of a target file in this way by making -the special target `.PRECIOUS' depend on it. Before remaking a target, -`make' checks to see whether it appears on the dependencies of -`.PRECIOUS', and thereby decides whether the target should be deleted -if a signal happens. Some reasons why you might do this are that the -target is updated in some atomic fashion, or exists only to record a -modification-time (its contents do not matter), or must exist at all -times to prevent other sorts of trouble. - - -File: make.info, Node: Recursion, Next: Sequences, Prev: Interrupts, Up: Commands - -Recursive Use of `make' -======================= - - Recursive use of `make' means using `make' as a command in a -makefile. This technique is useful when you want separate makefiles for -various subsystems that compose a larger system. For example, suppose -you have a subdirectory `subdir' which has its own makefile, and you -would like the containing directory's makefile to run `make' on the -subdirectory. You can do it by writing this: - - subsystem: - cd subdir; $(MAKE) - -or, equivalently, this (*note Summary of Options: Options Summary.): - - subsystem: - $(MAKE) -C subdir - - You can write recursive `make' commands just by copying this example, -but there are many things to know about how they work and why, and about -how the sub-`make' relates to the top-level `make'. - -* Menu: - -* MAKE Variable:: The special effects of using `$(MAKE)'. -* Variables/Recursion:: How to communicate variables to a sub-`make'. -* Options/Recursion:: How to communicate options to a sub-`make'. -* -w Option:: How the `-w' or `--print-directory' option - helps debug use of recursive `make' commands. - - -File: make.info, Node: MAKE Variable, Next: Variables/Recursion, Up: Recursion - -How the `MAKE' Variable Works ------------------------------ - - Recursive `make' commands should always use the variable `MAKE', not -the explicit command name `make', as shown here: - - subsystem: - cd subdir; $(MAKE) - - The value of this variable is the file name with which `make' was -invoked. If this file name was `/bin/make', then the command executed -is `cd subdir; /bin/make'. If you use a special version of `make' to -run the top-level makefile, the same special version will be executed -for recursive invocations. - - As a special feature, using the variable `MAKE' in the commands of a -rule alters the effects of the `-t' (`--touch'), `-n' (`--just-print'), -or `-q' (`--question') option. Using the `MAKE' variable has the same -effect as using a `+' character at the beginning of the command line. -*Note Instead of Executing the Commands: Instead of Execution. - - Consider the command `make -t' in the above example. (The `-t' -option marks targets as up to date without actually running any -commands; see *Note Instead of Execution::.) Following the usual -definition of `-t', a `make -t' command in the example would create a -file named `subsystem' and do nothing else. What you really want it to -do is run `cd subdir; make -t'; but that would require executing the -command, and `-t' says not to execute commands. - - The special feature makes this do what you want: whenever a command -line of a rule contains the variable `MAKE', the flags `-t', `-n' and -`-q' do not apply to that line. Command lines containing `MAKE' are -executed normally despite the presence of a flag that causes most -commands not to be run. The usual `MAKEFLAGS' mechanism passes the -flags to the sub-`make' (*note Communicating Options to a Sub-`make': -Options/Recursion.), so your request to touch the files, or print the -commands, is propagated to the subsystem. - - -File: make.info, Node: Variables/Recursion, Next: Options/Recursion, Prev: MAKE Variable, Up: Recursion - -Communicating Variables to a Sub-`make' ---------------------------------------- - - Variable values of the top-level `make' can be passed to the -sub-`make' through the environment by explicit request. These -variables are defined in the sub-`make' as defaults, but do not -override what is specified in the makefile used by the sub-`make' -makefile unless you use the `-e' switch (*note Summary of Options: -Options Summary.). - - To pass down, or "export", a variable, `make' adds the variable and -its value to the environment for running each command. The sub-`make', -in turn, uses the environment to initialize its table of variable -values. *Note Variables from the Environment: Environment. - - Except by explicit request, `make' exports a variable only if it is -either defined in the environment initially or set on the command line, -and if its name consists only of letters, numbers, and underscores. -Some shells cannot cope with environment variable names consisting of -characters other than letters, numbers, and underscores. - - The special variables `SHELL' and `MAKEFLAGS' are always exported -(unless you unexport them). `MAKEFILES' is exported if you set it to -anything. - - `make' automatically passes down variable values that were defined -on the command line, by putting them in the `MAKEFLAGS' variable. -*Note Options/Recursion::. - - Variables are *not* normally passed down if they were created by -default by `make' (*note Variables Used by Implicit Rules: Implicit -Variables.). The sub-`make' will define these for itself. - - If you want to export specific variables to a sub-`make', use the -`export' directive, like this: - - export VARIABLE ... - -If you want to *prevent* a variable from being exported, use the -`unexport' directive, like this: - - unexport VARIABLE ... - -As a convenience, you can define a variable and export it at the same -time by doing: - - export VARIABLE = value - -has the same result as: - - VARIABLE = value - export VARIABLE - -and - - export VARIABLE := value - -has the same result as: - - VARIABLE := value - export VARIABLE - - Likewise, - - export VARIABLE += value - -is just like: - - VARIABLE += value - export VARIABLE - -*Note Appending More Text to Variables: Appending. - - You may notice that the `export' and `unexport' directives work in -`make' in the same way they work in the shell, `sh'. - - If you want all variables to be exported by default, you can use -`export' by itself: - - export - -This tells `make' that variables which are not explicitly mentioned in -an `export' or `unexport' directive should be exported. Any variable -given in an `unexport' directive will still *not* be exported. If you -use `export' by itself to export variables by default, variables whose -names contain characters other than alphanumerics and underscores will -not be exported unless specifically mentioned in an `export' directive. - - The behavior elicited by an `export' directive by itself was the -default in older versions of GNU `make'. If your makefiles depend on -this behavior and you want to be compatible with old versions of -`make', you can write a rule for the special target -`.EXPORT_ALL_VARIABLES' instead of using the `export' directive. This -will be ignored by old `make's, while the `export' directive will cause -a syntax error. - - Likewise, you can use `unexport' by itself to tell `make' *not* to -export variables by default. Since this is the default behavior, you -would only need to do this if `export' had been used by itself earlier -(in an included makefile, perhaps). You *cannot* use `export' and -`unexport' by themselves to have variables exported for some commands -and not for others. The last `export' or `unexport' directive that -appears by itself determines the behavior for the entire run of `make'. - - As a special feature, the variable `MAKELEVEL' is changed when it is -passed down from level to level. This variable's value is a string -which is the depth of the level as a decimal number. The value is `0' -for the top-level `make'; `1' for a sub-`make', `2' for a -sub-sub-`make', and so on. The incrementation happens when `make' sets -up the environment for a command. - - The main use of `MAKELEVEL' is to test it in a conditional directive -(*note Conditional Parts of Makefiles: Conditionals.); this way you can -write a makefile that behaves one way if run recursively and another -way if run directly by you. - - You can use the variable `MAKEFILES' to cause all sub-`make' -commands to use additional makefiles. The value of `MAKEFILES' is a -whitespace-separated list of file names. This variable, if defined in -the outer-level makefile, is passed down through the environment; then -it serves as a list of extra makefiles for the sub-`make' to read -before the usual or specified ones. *Note The Variable `MAKEFILES': -MAKEFILES Variable. - - -File: make.info, Node: Options/Recursion, Next: -w Option, Prev: Variables/Recursion, Up: Recursion - -Communicating Options to a Sub-`make' -------------------------------------- - - Flags such as `-s' and `-k' are passed automatically to the -sub-`make' through the variable `MAKEFLAGS'. This variable is set up -automatically by `make' to contain the flag letters that `make' -received. Thus, if you do `make -ks' then `MAKEFLAGS' gets the value -`ks'. - - As a consequence, every sub-`make' gets a value for `MAKEFLAGS' in -its environment. In response, it takes the flags from that value and -processes them as if they had been given as arguments. *Note Summary -of Options: Options Summary. - - Likewise variables defined on the command line are passed to the -sub-`make' through `MAKEFLAGS'. Words in the value of `MAKEFLAGS' that -contain `=', `make' treats as variable definitions just as if they -appeared on the command line. *Note Overriding Variables: Overriding. - - The options `-C', `-f', `-o', and `-W' are not put into `MAKEFLAGS'; -these options are not passed down. - - The `-j' option is a special case (*note Parallel Execution: -Parallel.). If you set it to some numeric value, `-j 1' is always put -into `MAKEFLAGS' instead of the value you specified. This is because if -the `-j' option were passed down to sub-`make's, you would get many -more jobs running in parallel than you asked for. If you give `-j' -with no numeric argument, meaning to run as many jobs as possible in -parallel, this is passed down, since multiple infinities are no more -than one. - - If you do not want to pass the other flags down, you must change the -value of `MAKEFLAGS', like this: - - MAKEFLAGS= - subsystem: - cd subdir; $(MAKE) - - or like this: - - subsystem: - cd subdir; $(MAKE) MAKEFLAGS= - - The command line variable definitions really appear in the variable -`MAKEOVERRIDES', and `MAKEFLAGS' contains a reference to this variable. -If you do want to pass flags down normally, but don't want to pass -down the command line variable definitions, you can reset -`MAKEOVERRIDES' to empty, like this: - - MAKEOVERRIDES = - -This is not usually useful to do. However, some systems have a small -fixed limit on the size of the environment, and putting so much -information in into the value of `MAKEFLAGS' can exceed it. If you see -the error message `Arg list too long', this may be the problem. (For -strict compliance with POSIX.2, changing `MAKEOVERRIDES' does not -affect `MAKEFLAGS' if the special target `.POSIX' appears in the -makefile. You probably do not care about this.) - - A similar variable `MFLAGS' exists also, for historical -compatibility. It has the same value as `MAKEFLAGS' except that it -does not contain the command line variable definitions, and it always -begins with a hyphen unless it is empty (`MAKEFLAGS' begins with a -hyphen only when it begins with an option that has no single-letter -version, such as `--warn-undefined-variables'). `MFLAGS' was -traditionally used explicitly in the recursive `make' command, like -this: - - subsystem: - cd subdir; $(MAKE) $(MFLAGS) - -but now `MAKEFLAGS' makes this usage redundant. If you want your -makefiles to be compatible with old `make' programs, use this -technique; it will work fine with more modern `make' versions too. - - The `MAKEFLAGS' variable can also be useful if you want to have -certain options, such as `-k' (*note Summary of Options: Options -Summary.), set each time you run `make'. You simply put a value for -`MAKEFLAGS' in your environment. You can also set `MAKEFLAGS' in a -makefile, to specify additional flags that should also be in effect for -that makefile. (Note that you cannot use `MFLAGS' this way. That -variable is set only for compatibility; `make' does not interpret a -value you set for it in any way.) - - When `make' interprets the value of `MAKEFLAGS' (either from the -environment or from a makefile), it first prepends a hyphen if the value -does not already begin with one. Then it chops the value into words -separated by blanks, and parses these words as if they were options -given on the command line (except that `-C', `-f', `-h', `-o', `-W', -and their long-named versions are ignored; and there is no error for an -invalid option). - - If you do put `MAKEFLAGS' in your environment, you should be sure not -to include any options that will drastically affect the actions of -`make' and undermine the purpose of makefiles and of `make' itself. -For instance, the `-t', `-n', and `-q' options, if put in one of these -variables, could have disastrous consequences and would certainly have -at least surprising and probably annoying effects. - - -File: make.info, Node: -w Option, Prev: Options/Recursion, Up: Recursion - -The `--print-directory' Option ------------------------------- - - If you use several levels of recursive `make' invocations, the `-w' -or `--print-directory' option can make the output a lot easier to -understand by showing each directory as `make' starts processing it and -as `make' finishes processing it. For example, if `make -w' is run in -the directory `/u/gnu/make', `make' will print a line of the form: - - make: Entering directory `/u/gnu/make'. - -before doing anything else, and a line of the form: - - make: Leaving directory `/u/gnu/make'. - -when processing is completed. - - Normally, you do not need to specify this option because `make' does -it for you: `-w' is turned on automatically when you use the `-C' -option, and in sub-`make's. `make' will not automatically turn on `-w' -if you also use `-s', which says to be silent, or if you use -`--no-print-directory' to explicitly disable it. - - -File: make.info, Node: Sequences, Next: Empty Commands, Prev: Recursion, Up: Commands - -Defining Canned Command Sequences -================================= - - When the same sequence of commands is useful in making various -targets, you can define it as a canned sequence with the `define' -directive, and refer to the canned sequence from the rules for those -targets. The canned sequence is actually a variable, so the name must -not conflict with other variable names. - - Here is an example of defining a canned sequence of commands: - - define run-yacc - yacc $(firstword $^) - mv y.tab.c $@ - endef - -Here `run-yacc' is the name of the variable being defined; `endef' -marks the end of the definition; the lines in between are the commands. -The `define' directive does not expand variable references and -function calls in the canned sequence; the `$' characters, parentheses, -variable names, and so on, all become part of the value of the variable -you are defining. *Note Defining Variables Verbatim: Defining, for a -complete explanation of `define'. - - The first command in this example runs Yacc on the first dependency -of whichever rule uses the canned sequence. The output file from Yacc -is always named `y.tab.c'. The second command moves the output to the -rule's target file name. - - To use the canned sequence, substitute the variable into the -commands of a rule. You can substitute it like any other variable -(*note Basics of Variable References: Reference.). Because variables -defined by `define' are recursively expanded variables, all the -variable references you wrote inside the `define' are expanded now. -For example: - - foo.c : foo.y - $(run-yacc) - -`foo.y' will be substituted for the variable `$^' when it occurs in -`run-yacc''s value, and `foo.c' for `$@'. - - This is a realistic example, but this particular one is not needed in -practice because `make' has an implicit rule to figure out these -commands based on the file names involved (*note Using Implicit Rules: -Implicit Rules.). - - In command execution, each line of a canned sequence is treated just -as if the line appeared on its own in the rule, preceded by a tab. In -particular, `make' invokes a separate subshell for each line. You can -use the special prefix characters that affect command lines (`@', `-', -and `+') on each line of a canned sequence. *Note Writing the Commands -in Rules: Commands. For example, using this canned sequence: - - define frobnicate - @echo "frobnicating target $@" - frob-step-1 $< -o $@-step-1 - frob-step-2 $@-step-1 -o $@ - endef - -`make' will not echo the first line, the `echo' command. But it *will* -echo the following two command lines. - - On the other hand, prefix characters on the command line that refers -to a canned sequence apply to every line in the sequence. So the rule: - - frob.out: frob.in - @$(frobnicate) - -does not echo *any* commands. (*Note Command Echoing: Echoing, for a -full explanation of `@'.) - - -File: make.info, Node: Empty Commands, Prev: Sequences, Up: Commands - -Using Empty Commands -==================== - - It is sometimes useful to define commands which do nothing. This is -done simply by giving a command that consists of nothing but -whitespace. For example: - - target: ; - -defines an empty command string for `target'. You could also use a -line beginning with a tab character to define an empty command string, -but this would be confusing because such a line looks empty. - - You may be wondering why you would want to define a command string -that does nothing. The only reason this is useful is to prevent a -target from getting implicit commands (from implicit rules or the -`.DEFAULT' special target; *note Implicit Rules::. and *note Defining -Last-Resort Default Rules: Last Resort.). - - You may be inclined to define empty command strings for targets that -are not actual files, but only exist so that their dependencies can be -remade. However, this is not the best way to do that, because the -dependencies may not be remade properly if the target file actually -does exist. *Note Phony Targets: Phony Targets, for a better way to do -this. - - -File: make.info, Node: Using Variables, Next: Conditionals, Prev: Commands, Up: Top - -How to Use Variables -******************** - - A "variable" is a name defined in a makefile to represent a string -of text, called the variable's "value". These values are substituted -by explicit request into targets, dependencies, commands, and other -parts of the makefile. (In some other versions of `make', variables -are called "macros".) - - Variables and functions in all parts of a makefile are expanded when -read, except for the shell commands in rules, the right-hand sides of -variable definitions using `=', and the bodies of variable definitions -using the `define' directive. - - Variables can represent lists of file names, options to pass to -compilers, programs to run, directories to look in for source files, -directories to write output in, or anything else you can imagine. - - A variable name may be any sequence of characters not containing `:', -`#', `=', or leading or trailing whitespace. However, variable names -containing characters other than letters, numbers, and underscores -should be avoided, as they may be given special meanings in the future, -and with some shells they cannot be passed through the environment to a -sub-`make' (*note Communicating Variables to a Sub-`make': -Variables/Recursion.). - - Variable names are case-sensitive. The names `foo', `FOO', and -`Foo' all refer to different variables. - - It is traditional to use upper case letters in variable names, but we -recommend using lower case letters for variable names that serve -internal purposes in the makefile, and reserving upper case for -parameters that control implicit rules or for parameters that the user -should override with command options (*note Overriding Variables: -Overriding.). - - A few variables have names that are a single punctuation character or -just a few characters. These are the "automatic variables", and they -have particular specialized uses. *Note Automatic Variables: Automatic. - -* Menu: - -* Reference:: How to use the value of a variable. -* Flavors:: Variables come in two flavors. -* Advanced:: Advanced features for referencing a variable. -* Values:: All the ways variables get their values. -* Setting:: How to set a variable in the makefile. -* Appending:: How to append more text to the old value - of a variable. -* Override Directive:: How to set a variable in the makefile even if - the user has set it with a command argument. -* Defining:: An alternate way to set a variable - to a verbatim string. -* Environment:: Variable values can come from the environment. -* Automatic:: Some special variables have predefined - meanings for use with implicit rules. - - -File: make.info, Node: Reference, Next: Flavors, Up: Using Variables - -Basics of Variable References -============================= - - To substitute a variable's value, write a dollar sign followed by -the name of the variable in parentheses or braces: either `$(foo)' or -`${foo}' is a valid reference to the variable `foo'. This special -significance of `$' is why you must write `$$' to have the effect of a -single dollar sign in a file name or command. - - Variable references can be used in any context: targets, -dependencies, commands, most directives, and new variable values. Here -is an example of a common case, where a variable holds the names of all -the object files in a program: - - objects = program.o foo.o utils.o - program : $(objects) - cc -o program $(objects) - - $(objects) : defs.h - - Variable references work by strict textual substitution. Thus, the -rule - - foo = c - prog.o : prog.$(foo) - $(foo)$(foo) -$(foo) prog.$(foo) - -could be used to compile a C program `prog.c'. Since spaces before the -variable value are ignored in variable assignments, the value of `foo' -is precisely `c'. (Don't actually write your makefiles this way!) - - A dollar sign followed by a character other than a dollar sign, -open-parenthesis or open-brace treats that single character as the -variable name. Thus, you could reference the variable `x' with `$x'. -However, this practice is strongly discouraged, except in the case of -the automatic variables (*note Automatic Variables: Automatic.). - - -File: make.info, Node: Flavors, Next: Advanced, Prev: Reference, Up: Using Variables - -The Two Flavors of Variables -============================ - - There are two ways that a variable in GNU `make' can have a value; -we call them the two "flavors" of variables. The two flavors are -distinguished in how they are defined and in what they do when expanded. - - The first flavor of variable is a "recursively expanded" variable. -Variables of this sort are defined by lines using `=' (*note Setting -Variables: Setting.) or by the `define' directive (*note Defining -Variables Verbatim: Defining.). The value you specify is installed -verbatim; if it contains references to other variables, these -references are expanded whenever this variable is substituted (in the -course of expanding some other string). When this happens, it is -called "recursive expansion". - - For example, - - foo = $(bar) - bar = $(ugh) - ugh = Huh? - - all:;echo $(foo) - -will echo `Huh?': `$(foo)' expands to `$(bar)' which expands to -`$(ugh)' which finally expands to `Huh?'. - - This flavor of variable is the only sort supported by other versions -of `make'. It has its advantages and its disadvantages. An advantage -(most would say) is that: - - CFLAGS = $(include_dirs) -O - include_dirs = -Ifoo -Ibar - -will do what was intended: when `CFLAGS' is expanded in a command, it -will expand to `-Ifoo -Ibar -O'. A major disadvantage is that you -cannot append something on the end of a variable, as in - - CFLAGS = $(CFLAGS) -O - -because it will cause an infinite loop in the variable expansion. -(Actually `make' detects the infinite loop and reports an error.) - - Another disadvantage is that any functions (*note Functions for -Transforming Text: Functions.) referenced in the definition will be -executed every time the variable is expanded. This makes `make' run -slower; worse, it causes the `wildcard' and `shell' functions to give -unpredictable results because you cannot easily control when they are -called, or even how many times. - - To avoid all the problems and inconveniences of recursively expanded -variables, there is another flavor: simply expanded variables. - - "Simply expanded variables" are defined by lines using `:=' (*note -Setting Variables: Setting.). The value of a simply expanded variable -is scanned once and for all, expanding any references to other -variables and functions, when the variable is defined. The actual -value of the simply expanded variable is the result of expanding the -text that you write. It does not contain any references to other -variables; it contains their values *as of the time this variable was -defined*. Therefore, - - x := foo - y := $(x) bar - x := later - -is equivalent to - - y := foo bar - x := later - - When a simply expanded variable is referenced, its value is -substituted verbatim. - - Here is a somewhat more complicated example, illustrating the use of -`:=' in conjunction with the `shell' function. (*Note The `shell' -Function: Shell Function.) This example also shows use of the variable -`MAKELEVEL', which is changed when it is passed down from level to -level. (*Note Communicating Variables to a Sub-`make': -Variables/Recursion, for information about `MAKELEVEL'.) - - ifeq (0,${MAKELEVEL}) - cur-dir := $(shell pwd) - whoami := $(shell whoami) - host-type := $(shell arch) - MAKE := ${MAKE} host-type=${host-type} whoami=${whoami} - endif - -An advantage of this use of `:=' is that a typical `descend into a -directory' command then looks like this: - - ${subdirs}: - ${MAKE} cur-dir=${cur-dir}/$@ -C $@ all - - Simply expanded variables generally make complicated makefile -programming more predictable because they work like variables in most -programming languages. They allow you to redefine a variable using its -own value (or its value processed in some way by one of the expansion -functions) and to use the expansion functions much more efficiently -(*note Functions for Transforming Text: Functions.). - - You can also use them to introduce controlled leading whitespace into -variable values. Leading whitespace characters are discarded from your -input before substitution of variable references and function calls; -this means you can include leading spaces in a variable value by -protecting them with variable references, like this: - - nullstring := - space := $(nullstring) # end of the line - -Here the value of the variable `space' is precisely one space. The -comment `# end of the line' is included here just for clarity. Since -trailing space characters are *not* stripped from variable values, just -a space at the end of the line would have the same effect (but be -rather hard to read). If you put whitespace at the end of a variable -value, it is a good idea to put a comment like that at the end of the -line to make your intent clear. Conversely, if you do *not* want any -whitespace characters at the end of your variable value, you must -remember not to put a random comment on the end of the line after some -whitespace, such as this: - - dir := /foo/bar # directory to put the frobs in - -Here the value of the variable `dir' is `/foo/bar ' (with four -trailing spaces), which was probably not the intention. (Imagine -something like `$(dir)/file' with this definition!) - - -File: make.info, Node: Advanced, Next: Values, Prev: Flavors, Up: Using Variables - -Advanced Features for Reference to Variables -============================================ - - This section describes some advanced features you can use to -reference variables in more flexible ways. - -* Menu: - -* Substitution Refs:: Referencing a variable with - substitutions on the value. -* Computed Names:: Computing the name of the variable to refer to. - - -File: make.info, Node: Substitution Refs, Next: Computed Names, Up: Advanced - -Substitution References ------------------------ - - A "substitution reference" substitutes the value of a variable with -alterations that you specify. It has the form `$(VAR:A=B)' (or -`${VAR:A=B}') and its meaning is to take the value of the variable VAR, -replace every A at the end of a word with B in that value, and -substitute the resulting string. - - When we say "at the end of a word", we mean that A must appear -either followed by whitespace or at the end of the value in order to be -replaced; other occurrences of A in the value are unaltered. For -example: - - foo := a.o b.o c.o - bar := $(foo:.o=.c) - -sets `bar' to `a.c b.c c.c'. *Note Setting Variables: Setting. - - A substitution reference is actually an abbreviation for use of the -`patsubst' expansion function (*note Functions for String Substitution -and Analysis: Text Functions.). We provide substitution references as -well as `patsubst' for compatibility with other implementations of -`make'. - - Another type of substitution reference lets you use the full power of -the `patsubst' function. It has the same form `$(VAR:A=B)' described -above, except that now A must contain a single `%' character. This -case is equivalent to `$(patsubst A,B,$(VAR))'. *Note Functions for -String Substitution and Analysis: Text Functions, for a description of -the `patsubst' function. - -For example: - - foo := a.o b.o c.o - bar := $(foo:%.o=%.c) - -sets `bar' to `a.c b.c c.c'. - - -File: make.info, Node: Computed Names, Prev: Substitution Refs, Up: Advanced - -Computed Variable Names ------------------------ - - Computed variable names are a complicated concept needed only for -sophisticated makefile programming. For most purposes you need not -consider them, except to know that making a variable with a dollar sign -in its name might have strange results. However, if you are the type -that wants to understand everything, or you are actually interested in -what they do, read on. - - Variables may be referenced inside the name of a variable. This is -called a "computed variable name" or a "nested variable reference". -For example, - - x = y - y = z - a := $($(x)) - -defines `a' as `z': the `$(x)' inside `$($(x))' expands to `y', so -`$($(x))' expands to `$(y)' which in turn expands to `z'. Here the -name of the variable to reference is not stated explicitly; it is -computed by expansion of `$(x)'. The reference `$(x)' here is nested -within the outer variable reference. - - The previous example shows two levels of nesting, but any number of -levels is possible. For example, here are three levels: - - x = y - y = z - z = u - a := $($($(x))) - -Here the innermost `$(x)' expands to `y', so `$($(x))' expands to -`$(y)' which in turn expands to `z'; now we have `$(z)', which becomes -`u'. - - References to recursively-expanded variables within a variable name -are reexpanded in the usual fashion. For example: - - x = $(y) - y = z - z = Hello - a := $($(x)) - -defines `a' as `Hello': `$($(x))' becomes `$($(y))' which becomes -`$(z)' which becomes `Hello'. - - Nested variable references can also contain modified references and -function invocations (*note Functions for Transforming Text: -Functions.), just like any other reference. For example, using the -`subst' function (*note Functions for String Substitution and Analysis: -Text Functions.): - - x = variable1 - variable2 := Hello - y = $(subst 1,2,$(x)) - z = y - a := $($($(z))) - -eventually defines `a' as `Hello'. It is doubtful that anyone would -ever want to write a nested reference as convoluted as this one, but it -works: `$($($(z)))' expands to `$($(y))' which becomes `$($(subst -1,2,$(x)))'. This gets the value `variable1' from `x' and changes it -by substitution to `variable2', so that the entire string becomes -`$(variable2)', a simple variable reference whose value is `Hello'. - - A computed variable name need not consist entirely of a single -variable reference. It can contain several variable references, as -well as some invariant text. For example, - - a_dirs := dira dirb - 1_dirs := dir1 dir2 - - a_files := filea fileb - 1_files := file1 file2 - - ifeq "$(use_a)" "yes" - a1 := a - else - a1 := 1 - endif - - ifeq "$(use_dirs)" "yes" - df := dirs - else - df := files - endif - - dirs := $($(a1)_$(df)) - -will give `dirs' the same value as `a_dirs', `1_dirs', `a_files' or -`1_files' depending on the settings of `use_a' and `use_dirs'. - - Computed variable names can also be used in substitution references: - - a_objects := a.o b.o c.o - 1_objects := 1.o 2.o 3.o - - sources := $($(a1)_objects:.o=.c) - -defines `sources' as either `a.c b.c c.c' or `1.c 2.c 3.c', depending -on the value of `a1'. - - The only restriction on this sort of use of nested variable -references is that they cannot specify part of the name of a function -to be called. This is because the test for a recognized function name -is done before the expansion of nested references. For example, - - ifdef do_sort - func := sort - else - func := strip - endif - - bar := a d b g q c - - foo := $($(func) $(bar)) - -attempts to give `foo' the value of the variable `sort a d b g q c' or -`strip a d b g q c', rather than giving `a d b g q c' as the argument -to either the `sort' or the `strip' function. This restriction could -be removed in the future if that change is shown to be a good idea. - - You can also use computed variable names in the left-hand side of a -variable assignment, or in a `define' directive, as in: - - dir = foo - $(dir)_sources := $(wildcard $(dir)/*.c) - define $(dir)_print - lpr $($(dir)_sources) - endef - -This example defines the variables `dir', `foo_sources', and -`foo_print'. - - Note that "nested variable references" are quite different from -"recursively expanded variables" (*note The Two Flavors of Variables: -Flavors.), though both are used together in complex ways when doing -makefile programming. - - -File: make.info, Node: Values, Next: Setting, Prev: Advanced, Up: Using Variables - -How Variables Get Their Values -============================== - - Variables can get values in several different ways: - - * You can specify an overriding value when you run `make'. *Note - Overriding Variables: Overriding. - - * You can specify a value in the makefile, either with an assignment - (*note Setting Variables: Setting.) or with a verbatim definition - (*note Defining Variables Verbatim: Defining.). - - * Variables in the environment become `make' variables. *Note - Variables from the Environment: Environment. - - * Several "automatic" variables are given new values for each rule. - Each of these has a single conventional use. *Note Automatic - Variables: Automatic. - - * Several variables have constant initial values. *Note Variables - Used by Implicit Rules: Implicit Variables. - - -File: make.info, Node: Setting, Next: Appending, Prev: Values, Up: Using Variables - -Setting Variables -================= - - To set a variable from the makefile, write a line starting with the -variable name followed by `=' or `:='. Whatever follows the `=' or -`:=' on the line becomes the value. For example, - - objects = main.o foo.o bar.o utils.o - -defines a variable named `objects'. Whitespace around the variable -name and immediately after the `=' is ignored. - - Variables defined with `=' are "recursively expanded" variables. -Variables defined with `:=' are "simply expanded" variables; these -definitions can contain variable references which will be expanded -before the definition is made. *Note The Two Flavors of Variables: -Flavors. - - The variable name may contain function and variable references, which -are expanded when the line is read to find the actual variable name to -use. - - There is no limit on the length of the value of a variable except the -amount of swapping space on the computer. When a variable definition is -long, it is a good idea to break it into several lines by inserting -backslash-newline at convenient places in the definition. This will not -affect the functioning of `make', but it will make the makefile easier -to read. - - Most variable names are considered to have the empty string as a -value if you have never set them. Several variables have built-in -initial values that are not empty, but you can set them in the usual -ways (*note Variables Used by Implicit Rules: Implicit Variables.). -Several special variables are set automatically to a new value for each -rule; these are called the "automatic" variables (*note Automatic -Variables: Automatic.). - - -File: make.info, Node: Appending, Next: Override Directive, Prev: Setting, Up: Using Variables - -Appending More Text to Variables -================================ - - Often it is useful to add more text to the value of a variable -already defined. You do this with a line containing `+=', like this: - - objects += another.o - -This takes the value of the variable `objects', and adds the text -`another.o' to it (preceded by a single space). Thus: - - objects = main.o foo.o bar.o utils.o - objects += another.o - -sets `objects' to `main.o foo.o bar.o utils.o another.o'. - - Using `+=' is similar to: - - objects = main.o foo.o bar.o utils.o - objects := $(objects) another.o - -but differs in ways that become important when you use more complex -values. - - When the variable in question has not been defined before, `+=' acts -just like normal `=': it defines a recursively-expanded variable. -However, when there *is* a previous definition, exactly what `+=' does -depends on what flavor of variable you defined originally. *Note The -Two Flavors of Variables: Flavors, for an explanation of the two -flavors of variables. - - When you add to a variable's value with `+=', `make' acts -essentially as if you had included the extra text in the initial -definition of the variable. If you defined it first with `:=', making -it a simply-expanded variable, `+=' adds to that simply-expanded -definition, and expands the new text before appending it to the old -value just as `:=' does (*note Setting Variables: Setting., for a full -explanation of `:='). In fact, - - variable := value - variable += more - -is exactly equivalent to: - - variable := value - variable := $(variable) more - - On the other hand, when you use `+=' with a variable that you defined -first to be recursively-expanded using plain `=', `make' does something -a bit different. Recall that when you define a recursively-expanded -variable, `make' does not expand the value you set for variable and -function references immediately. Instead it stores the text verbatim, -and saves these variable and function references to be expanded later, -when you refer to the new variable (*note The Two Flavors of Variables: -Flavors.). When you use `+=' on a recursively-expanded variable, it is -this unexpanded text to which `make' appends the new text you specify. - - variable = value - variable += more - -is roughly equivalent to: - - temp = value - variable = $(temp) more - -except that of course it never defines a variable called `temp'. The -importance of this comes when the variable's old value contains -variable references. Take this common example: - - CFLAGS = $(includes) -O - ... - CFLAGS += -pg # enable profiling - -The first line defines the `CFLAGS' variable with a reference to another -variable, `includes'. (`CFLAGS' is used by the rules for C -compilation; *note Catalogue of Implicit Rules: Catalogue of Rules..) -Using `=' for the definition makes `CFLAGS' a recursively-expanded -variable, meaning `$(includes) -O' is *not* expanded when `make' -processes the definition of `CFLAGS'. Thus, `includes' need not be -defined yet for its value to take effect. It only has to be defined -before any reference to `CFLAGS'. If we tried to append to the value -of `CFLAGS' without using `+=', we might do it like this: - - CFLAGS := $(CFLAGS) -pg # enable profiling - -This is pretty close, but not quite what we want. Using `:=' redefines -`CFLAGS' as a simply-expanded variable; this means `make' expands the -text `$(CFLAGS) -pg' before setting the variable. If `includes' is not -yet defined, we get ` -O -pg', and a later definition of `includes' -will have no effect. Conversely, by using `+=' we set `CFLAGS' to the -*unexpanded* value `$(includes) -O -pg'. Thus we preserve the -reference to `includes', so if that variable gets defined at any later -point, a reference like `$(CFLAGS)' still uses its value. - diff --git a/buildtools/windows/source/make/make.info-4 b/buildtools/windows/source/make/make.info-4 deleted file mode 100644 index 15a1d75dcbd..00000000000 --- a/buildtools/windows/source/make/make.info-4 +++ /dev/null @@ -1,1296 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Override Directive, Next: Defining, Prev: Appending, Up: Using Variables - -The `override' Directive -======================== - - If a variable has been set with a command argument (*note Overriding -Variables: Overriding.), then ordinary assignments in the makefile are -ignored. If you want to set the variable in the makefile even though -it was set with a command argument, you can use an `override' -directive, which is a line that looks like this: - - override VARIABLE = VALUE - -or - - override VARIABLE := VALUE - - To append more text to a variable defined on the command line, use: - - override VARIABLE += MORE TEXT - -*Note Appending More Text to Variables: Appending. - - The `override' directive was not invented for escalation in the war -between makefiles and command arguments. It was invented so you can -alter and add to values that the user specifies with command arguments. - - For example, suppose you always want the `-g' switch when you run the -C compiler, but you would like to allow the user to specify the other -switches with a command argument just as usual. You could use this -`override' directive: - - override CFLAGS += -g - - You can also use `override' directives with `define' directives. -This is done as you might expect: - - override define foo - bar - endef - -*Note Defining Variables Verbatim: Defining. - - -File: make.info, Node: Defining, Next: Environment, Prev: Override Directive, Up: Using Variables - -Defining Variables Verbatim -=========================== - -Another way to set the value of a variable is to use the `define' -directive. This directive has an unusual syntax which allows newline -characters to be included in the value, which is convenient for defining -canned sequences of commands (*note Defining Canned Command Sequences: -Sequences.). - - The `define' directive is followed on the same line by the name of -the variable and nothing more. The value to give the variable appears -on the following lines. The end of the value is marked by a line -containing just the word `endef'. Aside from this difference in -syntax, `define' works just like `=': it creates a recursively-expanded -variable (*note The Two Flavors of Variables: Flavors.). The variable -name may contain function and variable references, which are expanded -when the directive is read to find the actual variable name to use. - - define two-lines - echo foo - echo $(bar) - endef - - The value in an ordinary assignment cannot contain a newline; but the -newlines that separate the lines of the value in a `define' become part -of the variable's value (except for the final newline which precedes -the `endef' and is not considered part of the value). - - The previous example is functionally equivalent to this: - - two-lines = echo foo; echo $(bar) - -since two commands separated by semicolon behave much like two separate -shell commands. However, note that using two separate lines means -`make' will invoke the shell twice, running an independent subshell for -each line. *Note Command Execution: Execution. - - If you want variable definitions made with `define' to take -precedence over command-line variable definitions, you can use the -`override' directive together with `define': - - override define two-lines - foo - $(bar) - endef - -*Note The `override' Directive: Override Directive. - - -File: make.info, Node: Environment, Prev: Defining, Up: Using Variables - -Variables from the Environment -============================== - - Variables in `make' can come from the environment in which `make' is -run. Every environment variable that `make' sees when it starts up is -transformed into a `make' variable with the same name and value. But -an explicit assignment in the makefile, or with a command argument, -overrides the environment. (If the `-e' flag is specified, then values -from the environment override assignments in the makefile. *Note -Summary of Options: Options Summary. But this is not recommended -practice.) - - Thus, by setting the variable `CFLAGS' in your environment, you can -cause all C compilations in most makefiles to use the compiler switches -you prefer. This is safe for variables with standard or conventional -meanings because you know that no makefile will use them for other -things. (But this is not totally reliable; some makefiles set `CFLAGS' -explicitly and therefore are not affected by the value in the -environment.) - - When `make' is invoked recursively, variables defined in the outer -invocation can be passed to inner invocations through the environment -(*note Recursive Use of `make': Recursion.). By default, only -variables that came from the environment or the command line are passed -to recursive invocations. You can use the `export' directive to pass -other variables. *Note Communicating Variables to a Sub-`make': -Variables/Recursion, for full details. - - Other use of variables from the environment is not recommended. It -is not wise for makefiles to depend for their functioning on -environment variables set up outside their control, since this would -cause different users to get different results from the same makefile. -This is against the whole purpose of most makefiles. - - Such problems would be especially likely with the variable `SHELL', -which is normally present in the environment to specify the user's -choice of interactive shell. It would be very undesirable for this -choice to affect `make'. So `make' ignores the environment value of -`SHELL'. - - -File: make.info, Node: Conditionals, Next: Functions, Prev: Using Variables, Up: Top - -Conditional Parts of Makefiles -****************************** - - A "conditional" causes part of a makefile to be obeyed or ignored -depending on the values of variables. Conditionals can compare the -value of one variable to another, or the value of a variable to a -constant string. Conditionals control what `make' actually "sees" in -the makefile, so they *cannot* be used to control shell commands at the -time of execution. - -* Menu: - -* Conditional Example:: Example of a conditional -* Conditional Syntax:: The syntax of conditionals. -* Testing Flags:: Conditionals that test flags. - - -File: make.info, Node: Conditional Example, Next: Conditional Syntax, Up: Conditionals - -Example of a Conditional -======================== - - The following example of a conditional tells `make' to use one set -of libraries if the `CC' variable is `gcc', and a different set of -libraries otherwise. It works by controlling which of two command -lines will be used as the command for a rule. The result is that -`CC=gcc' as an argument to `make' changes not only which compiler is -used but also which libraries are linked. - - libs_for_gcc = -lgnu - normal_libs = - - foo: $(objects) - ifeq ($(CC),gcc) - $(CC) -o foo $(objects) $(libs_for_gcc) - else - $(CC) -o foo $(objects) $(normal_libs) - endif - - This conditional uses three directives: one `ifeq', one `else' and -one `endif'. - - The `ifeq' directive begins the conditional, and specifies the -condition. It contains two arguments, separated by a comma and -surrounded by parentheses. Variable substitution is performed on both -arguments and then they are compared. The lines of the makefile -following the `ifeq' are obeyed if the two arguments match; otherwise -they are ignored. - - The `else' directive causes the following lines to be obeyed if the -previous conditional failed. In the example above, this means that the -second alternative linking command is used whenever the first -alternative is not used. It is optional to have an `else' in a -conditional. - - The `endif' directive ends the conditional. Every conditional must -end with an `endif'. Unconditional makefile text follows. - - As this example illustrates, conditionals work at the textual level: -the lines of the conditional are treated as part of the makefile, or -ignored, according to the condition. This is why the larger syntactic -units of the makefile, such as rules, may cross the beginning or the -end of the conditional. - - When the variable `CC' has the value `gcc', the above example has -this effect: - - foo: $(objects) - $(CC) -o foo $(objects) $(libs_for_gcc) - -When the variable `CC' has any other value, the effect is this: - - foo: $(objects) - $(CC) -o foo $(objects) $(normal_libs) - - Equivalent results can be obtained in another way by -conditionalizing a variable assignment and then using the variable -unconditionally: - - libs_for_gcc = -lgnu - normal_libs = - - ifeq ($(CC),gcc) - libs=$(libs_for_gcc) - else - libs=$(normal_libs) - endif - - foo: $(objects) - $(CC) -o foo $(objects) $(libs) - - -File: make.info, Node: Conditional Syntax, Next: Testing Flags, Prev: Conditional Example, Up: Conditionals - -Syntax of Conditionals -====================== - - The syntax of a simple conditional with no `else' is as follows: - - CONDITIONAL-DIRECTIVE - TEXT-IF-TRUE - endif - -The TEXT-IF-TRUE may be any lines of text, to be considered as part of -the makefile if the condition is true. If the condition is false, no -text is used instead. - - The syntax of a complex conditional is as follows: - - CONDITIONAL-DIRECTIVE - TEXT-IF-TRUE - else - TEXT-IF-FALSE - endif - -If the condition is true, TEXT-IF-TRUE is used; otherwise, -TEXT-IF-FALSE is used instead. The TEXT-IF-FALSE can be any number of -lines of text. - - The syntax of the CONDITIONAL-DIRECTIVE is the same whether the -conditional is simple or complex. There are four different directives -that test different conditions. Here is a table of them: - -`ifeq (ARG1, ARG2)' -`ifeq 'ARG1' 'ARG2'' -`ifeq "ARG1" "ARG2"' -`ifeq "ARG1" 'ARG2'' -`ifeq 'ARG1' "ARG2"' - Expand all variable references in ARG1 and ARG2 and compare them. - If they are identical, the TEXT-IF-TRUE is effective; otherwise, - the TEXT-IF-FALSE, if any, is effective. - - Often you want to test if a variable has a non-empty value. When - the value results from complex expansions of variables and - functions, expansions you would consider empty may actually - contain whitespace characters and thus are not seen as empty. - However, you can use the `strip' function (*note Text - Functions::.) to avoid interpreting whitespace as a non-empty - value. For example: - - ifeq ($(strip $(foo)),) - TEXT-IF-EMPTY - endif - - will evaluate TEXT-IF-EMPTY even if the expansion of `$(foo)' - contains whitespace characters. - -`ifneq (ARG1, ARG2)' -`ifneq 'ARG1' 'ARG2'' -`ifneq "ARG1" "ARG2"' -`ifneq "ARG1" 'ARG2'' -`ifneq 'ARG1' "ARG2"' - Expand all variable references in ARG1 and ARG2 and compare them. - If they are different, the TEXT-IF-TRUE is effective; otherwise, - the TEXT-IF-FALSE, if any, is effective. - -`ifdef VARIABLE-NAME' - If the variable VARIABLE-NAME has a non-empty value, the - TEXT-IF-TRUE is effective; otherwise, the TEXT-IF-FALSE, if any, - is effective. Variables that have never been defined have an - empty value. - - Note that `ifdef' only tests whether a variable has a value. It - does not expand the variable to see if that value is nonempty. - Consequently, tests using `ifdef' return true for all definitions - except those like `foo ='. To test for an empty value, use - `ifeq ($(foo),)'. For example, - - bar = - foo = $(bar) - ifdef foo - frobozz = yes - else - frobozz = no - endif - - sets `frobozz' to `yes', while: - - foo = - ifdef foo - frobozz = yes - else - frobozz = no - endif - - sets `frobozz' to `no'. - -`ifndef VARIABLE-NAME' - If the variable VARIABLE-NAME has an empty value, the TEXT-IF-TRUE - is effective; otherwise, the TEXT-IF-FALSE, if any, is effective. - - Extra spaces are allowed and ignored at the beginning of the -conditional directive line, but a tab is not allowed. (If the line -begins with a tab, it will be considered a command for a rule.) Aside -from this, extra spaces or tabs may be inserted with no effect anywhere -except within the directive name or within an argument. A comment -starting with `#' may appear at the end of the line. - - The other two directives that play a part in a conditional are `else' -and `endif'. Each of these directives is written as one word, with no -arguments. Extra spaces are allowed and ignored at the beginning of the -line, and spaces or tabs at the end. A comment starting with `#' may -appear at the end of the line. - - Conditionals affect which lines of the makefile `make' uses. If the -condition is true, `make' reads the lines of the TEXT-IF-TRUE as part -of the makefile; if the condition is false, `make' ignores those lines -completely. It follows that syntactic units of the makefile, such as -rules, may safely be split across the beginning or the end of the -conditional. - - `make' evaluates conditionals when it reads a makefile. -Consequently, you cannot use automatic variables in the tests of -conditionals because they are not defined until commands are run (*note -Automatic Variables: Automatic.). - - To prevent intolerable confusion, it is not permitted to start a -conditional in one makefile and end it in another. However, you may -write an `include' directive within a conditional, provided you do not -attempt to terminate the conditional inside the included file. - - -File: make.info, Node: Testing Flags, Prev: Conditional Syntax, Up: Conditionals - -Conditionals that Test Flags -============================ - - You can write a conditional that tests `make' command flags such as -`-t' by using the variable `MAKEFLAGS' together with the `findstring' -function (*note Functions for String Substitution and Analysis: Text -Functions.). This is useful when `touch' is not enough to make a file -appear up to date. - - The `findstring' function determines whether one string appears as a -substring of another. If you want to test for the `-t' flag, use `t' -as the first string and the value of `MAKEFLAGS' as the other. - - For example, here is how to arrange to use `ranlib -t' to finish -marking an archive file up to date: - - archive.a: ... - ifneq (,$(findstring t,$(MAKEFLAGS))) - +touch archive.a - +ranlib -t archive.a - else - ranlib archive.a - endif - -The `+' prefix marks those command lines as "recursive" so that they -will be executed despite use of the `-t' flag. *Note Recursive Use of -`make': Recursion. - - -File: make.info, Node: Functions, Next: Running, Prev: Conditionals, Up: Top - -Functions for Transforming Text -******************************* - - "Functions" allow you to do text processing in the makefile to -compute the files to operate on or the commands to use. You use a -function in a "function call", where you give the name of the function -and some text (the "arguments") for the function to operate on. The -result of the function's processing is substituted into the makefile at -the point of the call, just as a variable might be substituted. - -* Menu: - -* Syntax of Functions:: How to write a function call. -* Text Functions:: General-purpose text manipulation functions. -* Filename Functions:: Functions for manipulating file names. -* Foreach Function:: Repeat some text with controlled variation. -* Origin Function:: Find where a variable got its value. -* Shell Function:: Substitute the output of a shell command. - - -File: make.info, Node: Syntax of Functions, Next: Text Functions, Up: Functions - -Function Call Syntax -==================== - - A function call resembles a variable reference. It looks like this: - - $(FUNCTION ARGUMENTS) - -or like this: - - ${FUNCTION ARGUMENTS} - - Here FUNCTION is a function name; one of a short list of names that -are part of `make'. There is no provision for defining new functions. - - The ARGUMENTS are the arguments of the function. They are separated -from the function name by one or more spaces or tabs, and if there is -more than one argument, then they are separated by commas. Such -whitespace and commas are not part of an argument's value. The -delimiters which you use to surround the function call, whether -parentheses or braces, can appear in an argument only in matching pairs; -the other kind of delimiters may appear singly. If the arguments -themselves contain other function calls or variable references, it is -wisest to use the same kind of delimiters for all the references; write -`$(subst a,b,$(x))', not `$(subst a,b,${x})'. This is because it is -clearer, and because only one type of delimiter is matched to find the -end of the reference. - - The text written for each argument is processed by substitution of -variables and function calls to produce the argument value, which is -the text on which the function acts. The substitution is done in the -order in which the arguments appear. - - Commas and unmatched parentheses or braces cannot appear in the text -of an argument as written; leading spaces cannot appear in the text of -the first argument as written. These characters can be put into the -argument value by variable substitution. First define variables -`comma' and `space' whose values are isolated comma and space -characters, then substitute these variables where such characters are -wanted, like this: - - comma:= , - empty:= - space:= $(empty) $(empty) - foo:= a b c - bar:= $(subst $(space),$(comma),$(foo)) - # bar is now `a,b,c'. - -Here the `subst' function replaces each space with a comma, through the -value of `foo', and substitutes the result. - - -File: make.info, Node: Text Functions, Next: Filename Functions, Prev: Syntax of Functions, Up: Functions - -Functions for String Substitution and Analysis -============================================== - - Here are some functions that operate on strings: - -`$(subst FROM,TO,TEXT)' - Performs a textual replacement on the text TEXT: each occurrence - of FROM is replaced by TO. The result is substituted for the - function call. For example, - - $(subst ee,EE,feet on the street) - - substitutes the string `fEEt on the strEEt'. - -`$(patsubst PATTERN,REPLACEMENT,TEXT)' - Finds whitespace-separated words in TEXT that match PATTERN and - replaces them with REPLACEMENT. Here PATTERN may contain a `%' - which acts as a wildcard, matching any number of any characters - within a word. If REPLACEMENT also contains a `%', the `%' is - replaced by the text that matched the `%' in PATTERN. - - `%' characters in `patsubst' function invocations can be quoted - with preceding backslashes (`\'). Backslashes that would - otherwise quote `%' characters can be quoted with more backslashes. - Backslashes that quote `%' characters or other backslashes are - removed from the pattern before it is compared file names or has a - stem substituted into it. Backslashes that are not in danger of - quoting `%' characters go unmolested. For example, the pattern - `the\%weird\\%pattern\\' has `the%weird\' preceding the operative - `%' character, and `pattern\\' following it. The final two - backslashes are left alone because they cannot affect any `%' - character. - - Whitespace between words is folded into single space characters; - leading and trailing whitespace is discarded. - - For example, - - $(patsubst %.c,%.o,x.c.c bar.c) - - produces the value `x.c.o bar.o'. - - Substitution references (*note Substitution References: - Substitution Refs.) are a simpler way to get the effect of the - `patsubst' function: - - $(VAR:PATTERN=REPLACEMENT) - - is equivalent to - - $(patsubst PATTERN,REPLACEMENT,$(VAR)) - - The second shorthand simplifies one of the most common uses of - `patsubst': replacing the suffix at the end of file names. - - $(VAR:SUFFIX=REPLACEMENT) - - is equivalent to - - $(patsubst %SUFFIX,%REPLACEMENT,$(VAR)) - - For example, you might have a list of object files: - - objects = foo.o bar.o baz.o - - To get the list of corresponding source files, you could simply - write: - - $(objects:.o=.c) - - instead of using the general form: - - $(patsubst %.o,%.c,$(objects)) - -`$(strip STRING)' - Removes leading and trailing whitespace from STRING and replaces - each internal sequence of one or more whitespace characters with a - single space. Thus, `$(strip a b c )' results in `a b c'. - - The function `strip' can be very useful when used in conjunction - with conditionals. When comparing something with the empty string - `' using `ifeq' or `ifneq', you usually want a string of just - whitespace to match the empty string (*note Conditionals::.). - - Thus, the following may fail to have the desired results: - - .PHONY: all - ifneq "$(needs_made)" "" - all: $(needs_made) - else - all:;@echo 'Nothing to make!' - endif - - Replacing the variable reference `$(needs_made)' with the function - call `$(strip $(needs_made))' in the `ifneq' directive would make - it more robust. - -`$(findstring FIND,IN)' - Searches IN for an occurrence of FIND. If it occurs, the value is - FIND; otherwise, the value is empty. You can use this function in - a conditional to test for the presence of a specific substring in - a given string. Thus, the two examples, - - $(findstring a,a b c) - $(findstring a,b c) - - produce the values `a' and `' (the empty string), respectively. - *Note Testing Flags::, for a practical application of `findstring'. - -`$(filter PATTERN...,TEXT)' - Removes all whitespace-separated words in TEXT that do *not* match - any of the PATTERN words, returning only matching words. The - patterns are written using `%', just like the patterns used in the - `patsubst' function above. - - The `filter' function can be used to separate out different types - of strings (such as file names) in a variable. For example: - - sources := foo.c bar.c baz.s ugh.h - foo: $(sources) - cc $(filter %.c %.s,$(sources)) -o foo - - says that `foo' depends of `foo.c', `bar.c', `baz.s' and `ugh.h' - but only `foo.c', `bar.c' and `baz.s' should be specified in the - command to the compiler. - -`$(filter-out PATTERN...,TEXT)' - Removes all whitespace-separated words in TEXT that *do* match the - PATTERN words, returning only the words that *do not* match. This - is the exact opposite of the `filter' function. - - For example, given: - - objects=main1.o foo.o main2.o bar.o - mains=main1.o main2.o - - the following generates a list which contains all the object files - not in `mains': - - $(filter-out $(mains),$(objects)) - -`$(sort LIST)' - Sorts the words of LIST in lexical order, removing duplicate - words. The output is a list of words separated by single spaces. - Thus, - - $(sort foo bar lose) - - returns the value `bar foo lose'. - - Incidentally, since `sort' removes duplicate words, you can use it - for this purpose even if you don't care about the sort order. - - Here is a realistic example of the use of `subst' and `patsubst'. -Suppose that a makefile uses the `VPATH' variable to specify a list of -directories that `make' should search for dependency files (*note -`VPATH' Search Path for All Dependencies: General Search.). This -example shows how to tell the C compiler to search for header files in -the same list of directories. - - The value of `VPATH' is a list of directories separated by colons, -such as `src:../headers'. First, the `subst' function is used to -change the colons to spaces: - - $(subst :, ,$(VPATH)) - -This produces `src ../headers'. Then `patsubst' is used to turn each -directory name into a `-I' flag. These can be added to the value of -the variable `CFLAGS', which is passed automatically to the C compiler, -like this: - - override CFLAGS += $(patsubst %,-I%,$(subst :, ,$(VPATH))) - -The effect is to append the text `-Isrc -I../headers' to the previously -given value of `CFLAGS'. The `override' directive is used so that the -new value is assigned even if the previous value of `CFLAGS' was -specified with a command argument (*note The `override' Directive: -Override Directive.). - - -File: make.info, Node: Filename Functions, Next: Foreach Function, Prev: Text Functions, Up: Functions - -Functions for File Names -======================== - - Several of the built-in expansion functions relate specifically to -taking apart file names or lists of file names. - - Each of the following functions performs a specific transformation -on a file name. The argument of the function is regarded as a series -of file names, separated by whitespace. (Leading and trailing -whitespace is ignored.) Each file name in the series is transformed in -the same way and the results are concatenated with single spaces -between them. - -`$(dir NAMES...)' - Extracts the directory-part of each file name in NAMES. The - directory-part of the file name is everything up through (and - including) the last slash in it. If the file name contains no - slash, the directory part is the string `./'. For example, - - $(dir src/foo.c hacks) - - produces the result `src/ ./'. - -`$(notdir NAMES...)' - Extracts all but the directory-part of each file name in NAMES. - If the file name contains no slash, it is left unchanged. - Otherwise, everything through the last slash is removed from it. - - A file name that ends with a slash becomes an empty string. This - is unfortunate, because it means that the result does not always - have the same number of whitespace-separated file names as the - argument had; but we do not see any other valid alternative. - - For example, - - $(notdir src/foo.c hacks) - - produces the result `foo.c hacks'. - -`$(suffix NAMES...)' - Extracts the suffix of each file name in NAMES. If the file name - contains a period, the suffix is everything starting with the last - period. Otherwise, the suffix is the empty string. This - frequently means that the result will be empty when NAMES is not, - and if NAMES contains multiple file names, the result may contain - fewer file names. - - For example, - - $(suffix src/foo.c hacks) - - produces the result `.c'. - -`$(basename NAMES...)' - Extracts all but the suffix of each file name in NAMES. If the - file name contains a period, the basename is everything starting - up to (and not including) the last period. Otherwise, the - basename is the entire file name. For example, - - $(basename src/foo.c hacks) - - produces the result `src/foo hacks'. - -`$(addsuffix SUFFIX,NAMES...)' - The argument NAMES is regarded as a series of names, separated by - whitespace; SUFFIX is used as a unit. The value of SUFFIX is - appended to the end of each individual name and the resulting - larger names are concatenated with single spaces between them. - For example, - - $(addsuffix .c,foo bar) - - produces the result `foo.c bar.c'. - -`$(addprefix PREFIX,NAMES...)' - The argument NAMES is regarded as a series of names, separated by - whitespace; PREFIX is used as a unit. The value of PREFIX is - prepended to the front of each individual name and the resulting - larger names are concatenated with single spaces between them. - For example, - - $(addprefix src/,foo bar) - - produces the result `src/foo src/bar'. - -`$(join LIST1,LIST2)' - Concatenates the two arguments word by word: the two first words - (one from each argument) concatenated form the first word of the - result, the two second words form the second word of the result, - and so on. So the Nth word of the result comes from the Nth word - of each argument. If one argument has more words that the other, - the extra words are copied unchanged into the result. - - For example, `$(join a b,.c .o)' produces `a.c b.o'. - - Whitespace between the words in the lists is not preserved; it is - replaced with a single space. - - This function can merge the results of the `dir' and `notdir' - functions, to produce the original list of files which was given - to those two functions. - -`$(word N,TEXT)' - Returns the Nth word of TEXT. The legitimate values of N start - from 1. If N is bigger than the number of words in TEXT, the - value is empty. For example, - - $(word 2, foo bar baz) - - returns `bar'. - -`$(words TEXT)' - Returns the number of words in TEXT. Thus, the last word of TEXT - is `$(word $(words TEXT),TEXT)'. - -`$(firstword NAMES...)' - The argument NAMES is regarded as a series of names, separated by - whitespace. The value is the first name in the series. The rest - of the names are ignored. - - For example, - - $(firstword foo bar) - - produces the result `foo'. Although `$(firstword TEXT)' is the - same as `$(word 1,TEXT)', the `firstword' function is retained for - its simplicity. - -`$(wildcard PATTERN)' - The argument PATTERN is a file name pattern, typically containing - wildcard characters (as in shell file name patterns). The result - of `wildcard' is a space-separated list of the names of existing - files that match the pattern. *Note Using Wildcard Characters in - File Names: Wildcards. - - -File: make.info, Node: Foreach Function, Next: Origin Function, Prev: Filename Functions, Up: Functions - -The `foreach' Function -====================== - - The `foreach' function is very different from other functions. It -causes one piece of text to be used repeatedly, each time with a -different substitution performed on it. It resembles the `for' command -in the shell `sh' and the `foreach' command in the C-shell `csh'. - - The syntax of the `foreach' function is: - - $(foreach VAR,LIST,TEXT) - -The first two arguments, VAR and LIST, are expanded before anything -else is done; note that the last argument, TEXT, is *not* expanded at -the same time. Then for each word of the expanded value of LIST, the -variable named by the expanded value of VAR is set to that word, and -TEXT is expanded. Presumably TEXT contains references to that -variable, so its expansion will be different each time. - - The result is that TEXT is expanded as many times as there are -whitespace-separated words in LIST. The multiple expansions of TEXT -are concatenated, with spaces between them, to make the result of -`foreach'. - - This simple example sets the variable `files' to the list of all -files in the directories in the list `dirs': - - dirs := a b c d - files := $(foreach dir,$(dirs),$(wildcard $(dir)/*)) - - Here TEXT is `$(wildcard $(dir)/*)'. The first repetition finds the -value `a' for `dir', so it produces the same result as `$(wildcard -a/*)'; the second repetition produces the result of `$(wildcard b/*)'; -and the third, that of `$(wildcard c/*)'. - - This example has the same result (except for setting `dirs') as the -following example: - - files := $(wildcard a/* b/* c/* d/*) - - When TEXT is complicated, you can improve readability by giving it a -name, with an additional variable: - - find_files = $(wildcard $(dir)/*) - dirs := a b c d - files := $(foreach dir,$(dirs),$(find_files)) - -Here we use the variable `find_files' this way. We use plain `=' to -define a recursively-expanding variable, so that its value contains an -actual function call to be reexpanded under the control of `foreach'; a -simply-expanded variable would not do, since `wildcard' would be called -only once at the time of defining `find_files'. - - The `foreach' function has no permanent effect on the variable VAR; -its value and flavor after the `foreach' function call are the same as -they were beforehand. The other values which are taken from LIST are -in effect only temporarily, during the execution of `foreach'. The -variable VAR is a simply-expanded variable during the execution of -`foreach'. If VAR was undefined before the `foreach' function call, it -is undefined after the call. *Note The Two Flavors of Variables: -Flavors. - - You must take care when using complex variable expressions that -result in variable names because many strange things are valid variable -names, but are probably not what you intended. For example, - - files := $(foreach Esta escrito en espanol!,b c ch,$(find_files)) - -might be useful if the value of `find_files' references the variable -whose name is `Esta escrito en espanol!' (es un nombre bastante largo, -no?), but it is more likely to be a mistake. - - -File: make.info, Node: Origin Function, Next: Shell Function, Prev: Foreach Function, Up: Functions - -The `origin' Function -===================== - - The `origin' function is unlike most other functions in that it does -not operate on the values of variables; it tells you something *about* -a variable. Specifically, it tells you where it came from. - - The syntax of the `origin' function is: - - $(origin VARIABLE) - - Note that VARIABLE is the *name* of a variable to inquire about; not -a *reference* to that variable. Therefore you would not normally use a -`$' or parentheses when writing it. (You can, however, use a variable -reference in the name if you want the name not to be a constant.) - - The result of this function is a string telling you how the variable -VARIABLE was defined: - -`undefined' - if VARIABLE was never defined. - -`default' - if VARIABLE has a default definition, as is usual with `CC' and so - on. *Note Variables Used by Implicit Rules: Implicit Variables. - Note that if you have redefined a default variable, the `origin' - function will return the origin of the later definition. - -`environment' - if VARIABLE was defined as an environment variable and the `-e' - option is *not* turned on (*note Summary of Options: Options - Summary.). - -`environment override' - if VARIABLE was defined as an environment variable and the `-e' - option *is* turned on (*note Summary of Options: Options Summary.). - -`file' - if VARIABLE was defined in a makefile. - -`command line' - if VARIABLE was defined on the command line. - -`override' - if VARIABLE was defined with an `override' directive in a makefile - (*note The `override' Directive: Override Directive.). - -`automatic' - if VARIABLE is an automatic variable defined for the execution of - the commands for each rule (*note Automatic Variables: Automatic.). - - This information is primarily useful (other than for your curiosity) -to determine if you want to believe the value of a variable. For -example, suppose you have a makefile `foo' that includes another -makefile `bar'. You want a variable `bletch' to be defined in `bar' if -you run the command `make -f bar', even if the environment contains a -definition of `bletch'. However, if `foo' defined `bletch' before -including `bar', you do not want to override that definition. This -could be done by using an `override' directive in `foo', giving that -definition precedence over the later definition in `bar'; -unfortunately, the `override' directive would also override any command -line definitions. So, `bar' could include: - - ifdef bletch - ifeq "$(origin bletch)" "environment" - bletch = barf, gag, etc. - endif - endif - -If `bletch' has been defined from the environment, this will redefine -it. - - If you want to override a previous definition of `bletch' if it came -from the environment, even under `-e', you could instead write: - - ifneq "$(findstring environment,$(origin bletch))" "" - bletch = barf, gag, etc. - endif - - Here the redefinition takes place if `$(origin bletch)' returns -either `environment' or `environment override'. *Note Functions for -String Substitution and Analysis: Text Functions. - - -File: make.info, Node: Shell Function, Prev: Origin Function, Up: Functions - -The `shell' Function -==================== - - The `shell' function is unlike any other function except the -`wildcard' function (*note The Function `wildcard': Wildcard Function.) -in that it communicates with the world outside of `make'. - - The `shell' function performs the same function that backquotes -(``') perform in most shells: it does "command expansion". This means -that it takes an argument that is a shell command and returns the -output of the command. The only processing `make' does on the result, -before substituting it into the surrounding text, is to convert -newlines to spaces. - - The commands run by calls to the `shell' function are run when the -function calls are expanded. In most cases, this is when the makefile -is read in. The exception is that function calls in the commands of -the rules are expanded when the commands are run, and this applies to -`shell' function calls like all others. - - Here are some examples of the use of the `shell' function: - - contents := $(shell cat foo) - -sets `contents' to the contents of the file `foo', with a space (rather -than a newline) separating each line. - - files := $(shell echo *.c) - -sets `files' to the expansion of `*.c'. Unless `make' is using a very -strange shell, this has the same result as `$(wildcard *.c)'. - - -File: make.info, Node: Running, Next: Implicit Rules, Prev: Functions, Up: Top - -How to Run `make' -***************** - - A makefile that says how to recompile a program can be used in more -than one way. The simplest use is to recompile every file that is out -of date. Usually, makefiles are written so that if you run `make' with -no arguments, it does just that. - - But you might want to update only some of the files; you might want -to use a different compiler or different compiler options; you might -want just to find out which files are out of date without changing them. - - By giving arguments when you run `make', you can do any of these -things and many others. - - The exit status of `make' is always one of three values: -`0' - The exit status is zero if `make' is successful. - -`2' - The exit status is two if `make' encounters any errors. It will - print messages describing the particular errors. - -`1' - The exit status is one if you use the `-q' flag and `make' - determines that some target is not already up to date. *Note - Instead of Executing the Commands: Instead of Execution. - -* Menu: - -* Makefile Arguments:: How to specify which makefile to use. -* Goals:: How to use goal arguments to specify which - parts of the makefile to use. -* Instead of Execution:: How to use mode flags to specify what - kind of thing to do with the commands - in the makefile other than simply - execute them. -* Avoiding Compilation:: How to avoid recompiling certain files. -* Overriding:: How to override a variable to specify - an alternate compiler and other things. -* Testing:: How to proceed past some errors, to - test compilation. -* Options Summary:: Summary of Options - - -File: make.info, Node: Makefile Arguments, Next: Goals, Up: Running - -Arguments to Specify the Makefile -================================= - - The way to specify the name of the makefile is with the `-f' or -`--file' option (`--makefile' also works). For example, `-f altmake' -says to use the file `altmake' as the makefile. - - If you use the `-f' flag several times and follow each `-f' with an -argument, all the specified files are used jointly as makefiles. - - If you do not use the `-f' or `--file' flag, the default is to try -`GNUmakefile', `makefile', and `Makefile', in that order, and use the -first of these three which exists or can be made (*note Writing -Makefiles: Makefiles.). - - -File: make.info, Node: Goals, Next: Instead of Execution, Prev: Makefile Arguments, Up: Running - -Arguments to Specify the Goals -============================== - - The "goals" are the targets that `make' should strive ultimately to -update. Other targets are updated as well if they appear as -dependencies of goals, or dependencies of dependencies of goals, etc. - - By default, the goal is the first target in the makefile (not -counting targets that start with a period). Therefore, makefiles are -usually written so that the first target is for compiling the entire -program or programs they describe. If the first rule in the makefile -has several targets, only the first target in the rule becomes the -default goal, not the whole list. - - You can specify a different goal or goals with arguments to `make'. -Use the name of the goal as an argument. If you specify several goals, -`make' processes each of them in turn, in the order you name them. - - Any target in the makefile may be specified as a goal (unless it -starts with `-' or contains an `=', in which case it will be parsed as -a switch or variable definition, respectively). Even targets not in -the makefile may be specified, if `make' can find implicit rules that -say how to make them. - - One use of specifying a goal is if you want to compile only a part of -the program, or only one of several programs. Specify as a goal each -file that you wish to remake. For example, consider a directory -containing several programs, with a makefile that starts like this: - - .PHONY: all - all: size nm ld ar as - - If you are working on the program `size', you might want to say -`make size' so that only the files of that program are recompiled. - - Another use of specifying a goal is to make files that are not -normally made. For example, there may be a file of debugging output, -or a version of the program that is compiled specially for testing, -which has a rule in the makefile but is not a dependency of the default -goal. - - Another use of specifying a goal is to run the commands associated -with a phony target (*note Phony Targets::.) or empty target (*note -Empty Target Files to Record Events: Empty Targets.). Many makefiles -contain a phony target named `clean' which deletes everything except -source files. Naturally, this is done only if you request it -explicitly with `make clean'. Following is a list of typical phony and -empty target names. *Note Standard Targets::, for a detailed list of -all the standard target names which GNU software packages use. - -`all' - Make all the top-level targets the makefile knows about. - -`clean' - Delete all files that are normally created by running `make'. - -`mostlyclean' - Like `clean', but may refrain from deleting a few files that people - normally don't want to recompile. For example, the `mostlyclean' - target for GCC does not delete `libgcc.a', because recompiling it - is rarely necessary and takes a lot of time. - -`distclean' -`realclean' -`clobber' - Any of these targets might be defined to delete *more* files than - `clean' does. For example, this would delete configuration files - or links that you would normally create as preparation for - compilation, even if the makefile itself cannot create these files. - -`install' - Copy the executable file into a directory that users typically - search for commands; copy any auxiliary files that the executable - uses into the directories where it will look for them. - -`print' - Print listings of the source files that have changed. - -`tar' - Create a tar file of the source files. - -`shar' - Create a shell archive (shar file) of the source files. - -`dist' - Create a distribution file of the source files. This might be a - tar file, or a shar file, or a compressed version of one of the - above, or even more than one of the above. - -`TAGS' - Update a tags table for this program. - -`check' -`test' - Perform self tests on the program this makefile builds. - - -File: make.info, Node: Instead of Execution, Next: Avoiding Compilation, Prev: Goals, Up: Running - -Instead of Executing the Commands -================================= - - The makefile tells `make' how to tell whether a target is up to date, -and how to update each target. But updating the targets is not always -what you want. Certain options specify other activities for `make'. - -`-n' -`--just-print' -`--dry-run' -`--recon' - "No-op". The activity is to print what commands would be used to - make the targets up to date, but not actually execute them. - -`-t' -`--touch' - "Touch". The activity is to mark the targets as up to date without - actually changing them. In other words, `make' pretends to compile - the targets but does not really change their contents. - -`-q' -`--question' - "Question". The activity is to find out silently whether the - targets are up to date already; but execute no commands in either - case. In other words, neither compilation nor output will occur. - -`-W FILE' -`--what-if=FILE' -`--assume-new=FILE' -`--new-file=FILE' - "What if". Each `-W' flag is followed by a file name. The given - files' modification times are recorded by `make' as being the - present time, although the actual modification times remain the - same. You can use the `-W' flag in conjunction with the `-n' flag - to see what would happen if you were to modify specific files. - - With the `-n' flag, `make' prints the commands that it would -normally execute but does not execute them. - - With the `-t' flag, `make' ignores the commands in the rules and -uses (in effect) the command `touch' for each target that needs to be -remade. The `touch' command is also printed, unless `-s' or `.SILENT' -is used. For speed, `make' does not actually invoke the program -`touch'. It does the work directly. - - With the `-q' flag, `make' prints nothing and executes no commands, -but the exit status code it returns is zero if and only if the targets -to be considered are already up to date. If the exit status is one, -then some updating needs to be done. If `make' encounters an error, -the exit status is two, so you can distinguish an error from a target -that is not up to date. - - It is an error to use more than one of these three flags in the same -invocation of `make'. - - The `-n', `-t', and `-q' options do not affect command lines that -begin with `+' characters or contain the strings `$(MAKE)' or -`${MAKE}'. Note that only the line containing the `+' character or the -strings `$(MAKE)' or `${MAKE}' is run regardless of these options. -Other lines in the same rule are not run unless they too begin with `+' -or contain `$(MAKE)' or `${MAKE}' (*Note How the `MAKE' Variable Works: -MAKE Variable.) - - The `-W' flag provides two features: - - * If you also use the `-n' or `-q' flag, you can see what `make' - would do if you were to modify some files. - - * Without the `-n' or `-q' flag, when `make' is actually executing - commands, the `-W' flag can direct `make' to act as if some files - had been modified, without actually modifying the files. - - Note that the options `-p' and `-v' allow you to obtain other -information about `make' or about the makefiles in use (*note Summary -of Options: Options Summary.). - - -File: make.info, Node: Avoiding Compilation, Next: Overriding, Prev: Instead of Execution, Up: Running - -Avoiding Recompilation of Some Files -==================================== - - Sometimes you may have changed a source file but you do not want to -recompile all the files that depend on it. For example, suppose you -add a macro or a declaration to a header file that many other files -depend on. Being conservative, `make' assumes that any change in the -header file requires recompilation of all dependent files, but you know -that they do not need to be recompiled and you would rather not waste -the time waiting for them to compile. - - If you anticipate the problem before changing the header file, you -can use the `-t' flag. This flag tells `make' not to run the commands -in the rules, but rather to mark the target up to date by changing its -last-modification date. You would follow this procedure: - - 1. Use the command `make' to recompile the source files that really - need recompilation. - - 2. Make the changes in the header files. - - 3. Use the command `make -t' to mark all the object files as up to - date. The next time you run `make', the changes in the header - files will not cause any recompilation. - - If you have already changed the header file at a time when some files -do need recompilation, it is too late to do this. Instead, you can use -the `-o FILE' flag, which marks a specified file as "old" (*note -Summary of Options: Options Summary.). This means that the file itself -will not be remade, and nothing else will be remade on its account. -Follow this procedure: - - 1. Recompile the source files that need compilation for reasons - independent of the particular header file, with `make -o - HEADERFILE'. If several header files are involved, use a separate - `-o' option for each header file. - - 2. Touch all the object files with `make -t'. - diff --git a/buildtools/windows/source/make/make.info-5 b/buildtools/windows/source/make/make.info-5 deleted file mode 100644 index 13914a10faa..00000000000 --- a/buildtools/windows/source/make/make.info-5 +++ /dev/null @@ -1,1131 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Overriding, Next: Testing, Prev: Avoiding Compilation, Up: Running - -Overriding Variables -==================== - - An argument that contains `=' specifies the value of a variable: -`V=X' sets the value of the variable V to X. If you specify a value in -this way, all ordinary assignments of the same variable in the makefile -are ignored; we say they have been "overridden" by the command line -argument. - - The most common way to use this facility is to pass extra flags to -compilers. For example, in a properly written makefile, the variable -`CFLAGS' is included in each command that runs the C compiler, so a -file `foo.c' would be compiled something like this: - - cc -c $(CFLAGS) foo.c - - Thus, whatever value you set for `CFLAGS' affects each compilation -that occurs. The makefile probably specifies the usual value for -`CFLAGS', like this: - - CFLAGS=-g - - Each time you run `make', you can override this value if you wish. -For example, if you say `make CFLAGS='-g -O'', each C compilation will -be done with `cc -c -g -O'. (This illustrates how you can use quoting -in the shell to enclose spaces and other special characters in the -value of a variable when you override it.) - - The variable `CFLAGS' is only one of many standard variables that -exist just so that you can change them this way. *Note Variables Used -by Implicit Rules: Implicit Variables, for a complete list. - - You can also program the makefile to look at additional variables of -your own, giving the user the ability to control other aspects of how -the makefile works by changing the variables. - - When you override a variable with a command argument, you can define -either a recursively-expanded variable or a simply-expanded variable. -The examples shown above make a recursively-expanded variable; to make a -simply-expanded variable, write `:=' instead of `='. But, unless you -want to include a variable reference or function call in the *value* -that you specify, it makes no difference which kind of variable you -create. - - There is one way that the makefile can change a variable that you -have overridden. This is to use the `override' directive, which is a -line that looks like this: `override VARIABLE = VALUE' (*note The -`override' Directive: Override Directive.). - - -File: make.info, Node: Testing, Next: Options Summary, Prev: Overriding, Up: Running - -Testing the Compilation of a Program -==================================== - - Normally, when an error happens in executing a shell command, `make' -gives up immediately, returning a nonzero status. No further commands -are executed for any target. The error implies that the goal cannot be -correctly remade, and `make' reports this as soon as it knows. - - When you are compiling a program that you have just changed, this is -not what you want. Instead, you would rather that `make' try compiling -every file that can be tried, to show you as many compilation errors as -possible. - - On these occasions, you should use the `-k' or `--keep-going' flag. -This tells `make' to continue to consider the other dependencies of the -pending targets, remaking them if necessary, before it gives up and -returns nonzero status. For example, after an error in compiling one -object file, `make -k' will continue compiling other object files even -though it already knows that linking them will be impossible. In -addition to continuing after failed shell commands, `make -k' will -continue as much as possible after discovering that it does not know -how to make a target or dependency file. This will always cause an -error message, but without `-k', it is a fatal error (*note Summary of -Options: Options Summary.). - - The usual behavior of `make' assumes that your purpose is to get the -goals up to date; once `make' learns that this is impossible, it might -as well report the failure immediately. The `-k' flag says that the -real purpose is to test as much as possible of the changes made in the -program, perhaps to find several independent problems so that you can -correct them all before the next attempt to compile. This is why Emacs' -`M-x compile' command passes the `-k' flag by default. - - -File: make.info, Node: Options Summary, Prev: Testing, Up: Running - -Summary of Options -================== - - Here is a table of all the options `make' understands: - -`-b' -`-m' - These options are ignored for compatibility with other versions of - `make'. - -`-C DIR' -`--directory=DIR' - Change to directory DIR before reading the makefiles. If multiple - `-C' options are specified, each is interpreted relative to the - previous one: `-C / -C etc' is equivalent to `-C /etc'. This is - typically used with recursive invocations of `make' (*note - Recursive Use of `make': Recursion.). - -`-d' -`--debug' - Print debugging information in addition to normal processing. The - debugging information says which files are being considered for - remaking, which file-times are being compared and with what - results, which files actually need to be remade, which implicit - rules are considered and which are applied--everything interesting - about how `make' decides what to do. - -`-e' -`--environment-overrides' - Give variables taken from the environment precedence over - variables from makefiles. *Note Variables from the Environment: - Environment. - -`-f FILE' -`--file=FILE' -`--makefile=FILE' - Read the file named FILE as a makefile. *Note Writing Makefiles: - Makefiles. - -`-h' -`--help' - Remind you of the options that `make' understands and then exit. - -`-i' -`--ignore-errors' - Ignore all errors in commands executed to remake files. *Note - Errors in Commands: Errors. - -`-I DIR' -`--include-dir=DIR' - Specifies a directory DIR to search for included makefiles. *Note - Including Other Makefiles: Include. If several `-I' options are - used to specify several directories, the directories are searched - in the order specified. - -`-j [JOBS]' -`--jobs=[JOBS]' - Specifies the number of jobs (commands) to run simultaneously. - With no argument, `make' runs as many jobs simultaneously as - possible. If there is more than one `-j' option, the last one is - effective. *Note Parallel Execution: Parallel, for more - information on how commands are run. - -`-k' -`--keep-going' - Continue as much as possible after an error. While the target that - failed, and those that depend on it, cannot be remade, the other - dependencies of these targets can be processed all the same. - *Note Testing the Compilation of a Program: Testing. - -`-l [LOAD]' -`--load-average[=LOAD]' -`--max-load[=LOAD]' - Specifies that no new jobs (commands) should be started if there - are other jobs running and the load average is at least LOAD (a - floating-point number). With no argument, removes a previous load - limit. *Note Parallel Execution: Parallel. - -`-n' -`--just-print' -`--dry-run' -`--recon' - Print the commands that would be executed, but do not execute them. - *Note Instead of Executing the Commands: Instead of Execution. - -`-o FILE' -`--old-file=FILE' -`--assume-old=FILE' - Do not remake the file FILE even if it is older than its - dependencies, and do not remake anything on account of changes in - FILE. Essentially the file is treated as very old and its rules - are ignored. *Note Avoiding Recompilation of Some Files: Avoiding - Compilation. - -`-p' -`--print-data-base' - Print the data base (rules and variable values) that results from - reading the makefiles; then execute as usual or as otherwise - specified. This also prints the version information given by the - `-v' switch (see below). To print the data base without trying to - remake any files, use `make -p -f /dev/null'. - -`-q' -`--question' - "Question mode". Do not run any commands, or print anything; just - return an exit status that is zero if the specified targets are - already up to date, one if any remaking is required, or two if an - error is encountered. *Note Instead of Executing the Commands: - Instead of Execution. - -`-r' -`--no-builtin-rules' - Eliminate use of the built-in implicit rules (*note Using Implicit - Rules: Implicit Rules.). You can still define your own by writing - pattern rules (*note Defining and Redefining Pattern Rules: - Pattern Rules.). The `-r' option also clears out the default list - of suffixes for suffix rules (*note Old-Fashioned Suffix Rules: - Suffix Rules.). But you can still define your own suffixes with a - rule for `.SUFFIXES', and then define your own suffix rules. - -`-s' -`--silent' -`--quiet' - Silent operation; do not print the commands as they are executed. - *Note Command Echoing: Echoing. - -`-S' -`--no-keep-going' -`--stop' - Cancel the effect of the `-k' option. This is never necessary - except in a recursive `make' where `-k' might be inherited from - the top-level `make' via `MAKEFLAGS' (*note Recursive Use of - `make': Recursion.) or if you set `-k' in `MAKEFLAGS' in your - environment. - -`-t' -`--touch' - Touch files (mark them up to date without really changing them) - instead of running their commands. This is used to pretend that - the commands were done, in order to fool future invocations of - `make'. *Note Instead of Executing the Commands: Instead of - Execution. - -`-v' -`--version' - Print the version of the `make' program plus a copyright, a list - of authors, and a notice that there is no warranty; then exit. - -`-w' -`--print-directory' - Print a message containing the working directory both before and - after executing the makefile. This may be useful for tracking - down errors from complicated nests of recursive `make' commands. - *Note Recursive Use of `make': Recursion. (In practice, you - rarely need to specify this option since `make' does it for you; - see *Note The `--print-directory' Option: -w Option.) - -`--no-print-directory' - Disable printing of the working directory under `-w'. This option - is useful when `-w' is turned on automatically, but you do not - want to see the extra messages. *Note The `--print-directory' - Option: -w Option. - -`-W FILE' -`--what-if=FILE' -`--new-file=FILE' -`--assume-new=FILE' - Pretend that the target FILE has just been modified. When used - with the `-n' flag, this shows you what would happen if you were - to modify that file. Without `-n', it is almost the same as - running a `touch' command on the given file before running `make', - except that the modification time is changed only in the - imagination of `make'. *Note Instead of Executing the Commands: - Instead of Execution. - -`--warn-undefined-variables' - Issue a warning message whenever `make' sees a reference to an - undefined variable. This can be helpful when you are trying to - debug makefiles which use variables in complex ways. - - -File: make.info, Node: Implicit Rules, Next: Archives, Prev: Running, Up: Top - -Using Implicit Rules -******************** - - Certain standard ways of remaking target files are used very often. -For example, one customary way to make an object file is from a C -source file using the C compiler, `cc'. - - "Implicit rules" tell `make' how to use customary techniques so that -you do not have to specify them in detail when you want to use them. -For example, there is an implicit rule for C compilation. File names -determine which implicit rules are run. For example, C compilation -typically takes a `.c' file and makes a `.o' file. So `make' applies -the implicit rule for C compilation when it sees this combination of -file name endings. - - A chain of implicit rules can apply in sequence; for example, `make' -will remake a `.o' file from a `.y' file by way of a `.c' file. - - The built-in implicit rules use several variables in their commands -so that, by changing the values of the variables, you can change the -way the implicit rule works. For example, the variable `CFLAGS' -controls the flags given to the C compiler by the implicit rule for C -compilation. - - You can define your own implicit rules by writing "pattern rules". - - "Suffix rules" are a more limited way to define implicit rules. -Pattern rules are more general and clearer, but suffix rules are -retained for compatibility. - -* Menu: - -* Using Implicit:: How to use an existing implicit rule - to get the commands for updating a file. -* Catalogue of Rules:: A list of built-in implicit rules. -* Implicit Variables:: How to change what predefined rules do. -* Chained Rules:: How to use a chain of implicit rules. -* Pattern Rules:: How to define new implicit rules. -* Last Resort:: How to defining commands for rules - which cannot find any. -* Suffix Rules:: The old-fashioned style of implicit rule. -* Search Algorithm:: The precise algorithm for applying - implicit rules. - - -File: make.info, Node: Using Implicit, Next: Catalogue of Rules, Up: Implicit Rules - -Using Implicit Rules -==================== - - To allow `make' to find a customary method for updating a target -file, all you have to do is refrain from specifying commands yourself. -Either write a rule with no command lines, or don't write a rule at -all. Then `make' will figure out which implicit rule to use based on -which kind of source file exists or can be made. - - For example, suppose the makefile looks like this: - - foo : foo.o bar.o - cc -o foo foo.o bar.o $(CFLAGS) $(LDFLAGS) - -Because you mention `foo.o' but do not give a rule for it, `make' will -automatically look for an implicit rule that tells how to update it. -This happens whether or not the file `foo.o' currently exists. - - If an implicit rule is found, it can supply both commands and one or -more dependencies (the source files). You would want to write a rule -for `foo.o' with no command lines if you need to specify additional -dependencies, such as header files, that the implicit rule cannot -supply. - - Each implicit rule has a target pattern and dependency patterns. -There may be many implicit rules with the same target pattern. For -example, numerous rules make `.o' files: one, from a `.c' file with the -C compiler; another, from a `.p' file with the Pascal compiler; and so -on. The rule that actually applies is the one whose dependencies exist -or can be made. So, if you have a file `foo.c', `make' will run the C -compiler; otherwise, if you have a file `foo.p', `make' will run the -Pascal compiler; and so on. - - Of course, when you write the makefile, you know which implicit rule -you want `make' to use, and you know it will choose that one because you -know which possible dependency files are supposed to exist. *Note -Catalogue of Implicit Rules: Catalogue of Rules, for a catalogue of all -the predefined implicit rules. - - Above, we said an implicit rule applies if the required dependencies -"exist or can be made". A file "can be made" if it is mentioned -explicitly in the makefile as a target or a dependency, or if an -implicit rule can be recursively found for how to make it. When an -implicit dependency is the result of another implicit rule, we say that -"chaining" is occurring. *Note Chains of Implicit Rules: Chained Rules. - - In general, `make' searches for an implicit rule for each target, and -for each double-colon rule, that has no commands. A file that is -mentioned only as a dependency is considered a target whose rule -specifies nothing, so implicit rule search happens for it. *Note -Implicit Rule Search Algorithm: Search Algorithm, for the details of -how the search is done. - - Note that explicit dependencies do not influence implicit rule -search. For example, consider this explicit rule: - - foo.o: foo.p - -The dependency on `foo.p' does not necessarily mean that `make' will -remake `foo.o' according to the implicit rule to make an object file, a -`.o' file, from a Pascal source file, a `.p' file. For example, if -`foo.c' also exists, the implicit rule to make an object file from a C -source file is used instead, because it appears before the Pascal rule -in the list of predefined implicit rules (*note Catalogue of Implicit -Rules: Catalogue of Rules.). - - If you do not want an implicit rule to be used for a target that has -no commands, you can give that target empty commands by writing a -semicolon (*note Defining Empty Commands: Empty Commands.). - - -File: make.info, Node: Catalogue of Rules, Next: Implicit Variables, Prev: Using Implicit, Up: Implicit Rules - -Catalogue of Implicit Rules -=========================== - - Here is a catalogue of predefined implicit rules which are always -available unless the makefile explicitly overrides or cancels them. -*Note Canceling Implicit Rules: Canceling Rules, for information on -canceling or overriding an implicit rule. The `-r' or -`--no-builtin-rules' option cancels all predefined rules. - - Not all of these rules will always be defined, even when the `-r' -option is not given. Many of the predefined implicit rules are -implemented in `make' as suffix rules, so which ones will be defined -depends on the "suffix list" (the list of dependencies of the special -target `.SUFFIXES'). The default suffix list is: `.out', `.a', `.ln', -`.o', `.c', `.cc', `.C', `.p', `.f', `.F', `.r', `.y', `.l', `.s', -`.S', `.mod', `.sym', `.def', `.h', `.info', `.dvi', `.tex', `.texinfo', -`.texi', `.txinfo', `.w', `.ch' `.web', `.sh', `.elc', `.el'. All of -the implicit rules described below whose dependencies have one of these -suffixes are actually suffix rules. If you modify the suffix list, the -only predefined suffix rules in effect will be those named by one or -two of the suffixes that are on the list you specify; rules whose -suffixes fail to be on the list are disabled. *Note Old-Fashioned -Suffix Rules: Suffix Rules, for full details on suffix rules. - -Compiling C programs - `N.o' is made automatically from `N.c' with a command of the form - `$(CC) -c $(CPPFLAGS) $(CFLAGS)'. - -Compiling C++ programs - `N.o' is made automatically from `N.cc' or `N.C' with a command of - the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We encourage you to - use the suffix `.cc' for C++ source files instead of `.C'. - -Compiling Pascal programs - `N.o' is made automatically from `N.p' with the command `$(PC) -c - $(PFLAGS)'. - -Compiling Fortran and Ratfor programs - `N.o' is made automatically from `N.r', `N.F' or `N.f' by running - the Fortran compiler. The precise command used is as follows: - - `.f' - `$(FC) -c $(FFLAGS)'. - - `.F' - `$(FC) -c $(FFLAGS) $(CPPFLAGS)'. - - `.r' - `$(FC) -c $(FFLAGS) $(RFLAGS)'. - -Preprocessing Fortran and Ratfor programs - `N.f' is made automatically from `N.r' or `N.F'. This rule runs - just the preprocessor to convert a Ratfor or preprocessable - Fortran program into a strict Fortran program. The precise - command used is as follows: - - `.F' - `$(FC) -F $(CPPFLAGS) $(FFLAGS)'. - - `.r' - `$(FC) -F $(FFLAGS) $(RFLAGS)'. - -Compiling Modula-2 programs - `N.sym' is made from `N.def' with a command of the form `$(M2C) - $(M2FLAGS) $(DEFFLAGS)'. `N.o' is made from `N.mod'; the form is: - `$(M2C) $(M2FLAGS) $(MODFLAGS)'. - -Assembling and preprocessing assembler programs - `N.o' is made automatically from `N.s' by running the assembler, - `as'. The precise command is `$(AS) $(ASFLAGS)'. - - `N.s' is made automatically from `N.S' by running the C - preprocessor, `cpp'. The precise command is `$(CPP) $(CPPFLAGS)'. - -Linking a single object file - `N' is made automatically from `N.o' by running the linker - (usually called `ld') via the C compiler. The precise command - used is `$(CC) $(LDFLAGS) N.o $(LOADLIBES)'. - - This rule does the right thing for a simple program with only one - source file. It will also do the right thing if there are multiple - object files (presumably coming from various other source files), - one of which has a name matching that of the executable file. - Thus, - - x: y.o z.o - - when `x.c', `y.c' and `z.c' all exist will execute: - - cc -c x.c -o x.o - cc -c y.c -o y.o - cc -c z.c -o z.o - cc x.o y.o z.o -o x - rm -f x.o - rm -f y.o - rm -f z.o - - In more complicated cases, such as when there is no object file - whose name derives from the executable file name, you must write - an explicit command for linking. - - Each kind of file automatically made into `.o' object files will - be automatically linked by using the compiler (`$(CC)', `$(FC)' or - `$(PC)'; the C compiler `$(CC)' is used to assemble `.s' files) - without the `-c' option. This could be done by using the `.o' - object files as intermediates, but it is faster to do the - compiling and linking in one step, so that's how it's done. - -Yacc for C programs - `N.c' is made automatically from `N.y' by running Yacc with the - command `$(YACC) $(YFLAGS)'. - -Lex for C programs - `N.c' is made automatically from `N.l' by by running Lex. The - actual command is `$(LEX) $(LFLAGS)'. - -Lex for Ratfor programs - `N.r' is made automatically from `N.l' by by running Lex. The - actual command is `$(LEX) $(LFLAGS)'. - - The convention of using the same suffix `.l' for all Lex files - regardless of whether they produce C code or Ratfor code makes it - impossible for `make' to determine automatically which of the two - languages you are using in any particular case. If `make' is - called upon to remake an object file from a `.l' file, it must - guess which compiler to use. It will guess the C compiler, because - that is more common. If you are using Ratfor, make sure `make' - knows this by mentioning `N.r' in the makefile. Or, if you are - using Ratfor exclusively, with no C files, remove `.c' from the - list of implicit rule suffixes with: - - .SUFFIXES: - .SUFFIXES: .o .r .f .l ... - -Making Lint Libraries from C, Yacc, or Lex programs - `N.ln' is made from `N.c' by running `lint'. The precise command - is `$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i'. The same command is - used on the C code produced from `N.y' or `N.l'. - -TeX and Web - `N.dvi' is made from `N.tex' with the command `$(TEX)'. `N.tex' - is made from `N.web' with `$(WEAVE)', or from `N.w' (and from - `N.ch' if it exists or can be made) with `$(CWEAVE)'. `N.p' is - made from `N.web' with `$(TANGLE)' and `N.c' is made from `N.w' - (and from `N.ch' if it exists or can be made) with `$(CTANGLE)'. - -Texinfo and Info - `N.dvi' is made from `N.texinfo', `N.texi', or `N.txinfo', with - the command `$(TEXI2DVI) $(TEXI2DVI_FLAGS)'. `N.info' is made from - `N.texinfo', `N.texi', or `N.txinfo', with the command - `$(MAKEINFO) $(MAKEINFO_FLAGS)'. - -RCS - Any file `N' is extracted if necessary from an RCS file named - either `N,v' or `RCS/N,v'. The precise command used is - `$(CO) $(COFLAGS)'. `N' will not be extracted from RCS if it - already exists, even if the RCS file is newer. The rules for RCS - are terminal (*note Match-Anything Pattern Rules: Match-Anything - Rules.), so RCS files cannot be generated from another source; - they must actually exist. - -SCCS - Any file `N' is extracted if necessary from an SCCS file named - either `s.N' or `SCCS/s.N'. The precise command used is - `$(GET) $(GFLAGS)'. The rules for SCCS are terminal (*note - Match-Anything Pattern Rules: Match-Anything Rules.), so SCCS - files cannot be generated from another source; they must actually - exist. - - For the benefit of SCCS, a file `N' is copied from `N.sh' and made - executable (by everyone). This is for shell scripts that are - checked into SCCS. Since RCS preserves the execution permission - of a file, you do not need to use this feature with RCS. - - We recommend that you avoid using of SCCS. RCS is widely held to - be superior, and is also free. By choosing free software in place - of comparable (or inferior) proprietary software, you support the - free software movement. - - Usually, you want to change only the variables listed in the table -above, which are documented in the following section. - - However, the commands in built-in implicit rules actually use -variables such as `COMPILE.c', `LINK.p', and `PREPROCESS.S', whose -values contain the commands listed above. - - `make' follows the convention that the rule to compile a `.X' source -file uses the variable `COMPILE.X'. Similarly, the rule to produce an -executable from a `.X' file uses `LINK.X'; and the rule to preprocess a -`.X' file uses `PREPROCESS.X'. - - Every rule that produces an object file uses the variable -`OUTPUT_OPTION'. `make' defines this variable either to contain `-o -$@', or to be empty, depending on a compile-time option. You need the -`-o' option to ensure that the output goes into the right file when the -source file is in a different directory, as when using `VPATH' (*note -Directory Search::.). However, compilers on some systems do not accept -a `-o' switch for object files. If you use such a system, and use -`VPATH', some compilations will put their output in the wrong place. A -possible workaround for this problem is to give `OUTPUT_OPTION' the -value `; mv $*.o $@'. - - -File: make.info, Node: Implicit Variables, Next: Chained Rules, Prev: Catalogue of Rules, Up: Implicit Rules - -Variables Used by Implicit Rules -================================ - - The commands in built-in implicit rules make liberal use of certain -predefined variables. You can alter these variables in the makefile, -with arguments to `make', or in the environment to alter how the -implicit rules work without redefining the rules themselves. - - For example, the command used to compile a C source file actually -says `$(CC) -c $(CFLAGS) $(CPPFLAGS)'. The default values of the -variables used are `cc' and nothing, resulting in the command `cc -c'. -By redefining `CC' to `ncc', you could cause `ncc' to be used for all C -compilations performed by the implicit rule. By redefining `CFLAGS' to -be `-g', you could pass the `-g' option to each compilation. *All* -implicit rules that do C compilation use `$(CC)' to get the program -name for the compiler and *all* include `$(CFLAGS)' among the arguments -given to the compiler. - - The variables used in implicit rules fall into two classes: those -that are names of programs (like `CC') and those that contain arguments -for the programs (like `CFLAGS'). (The "name of a program" may also -contain some command arguments, but it must start with an actual -executable program name.) If a variable value contains more than one -argument, separate them with spaces. - - Here is a table of variables used as names of programs in built-in -rules: - -`AR' - Archive-maintaining program; default `ar'. - -`AS' - Program for doing assembly; default `as'. - -`CC' - Program for compiling C programs; default `cc'. - -`CXX' - Program for compiling C++ programs; default `g++'. - -`CO' - Program for extracting a file from RCS; default `co'. - -`CPP' - Program for running the C preprocessor, with results to standard - output; default `$(CC) -E'. - -`FC' - Program for compiling or preprocessing Fortran and Ratfor programs; - default `f77'. - -`GET' - Program for extracting a file from SCCS; default `get'. - -`LEX' - Program to use to turn Lex grammars into C programs or Ratfor - programs; default `lex'. - -`PC' - Program for compiling Pascal programs; default `pc'. - -`YACC' - Program to use to turn Yacc grammars into C programs; default - `yacc'. - -`YACCR' - Program to use to turn Yacc grammars into Ratfor programs; default - `yacc -r'. - -`MAKEINFO' - Program to convert a Texinfo source file into an Info file; default - `makeinfo'. - -`TEX' - Program to make TeX DVI files from TeX source; default `tex'. - -`TEXI2DVI' - Program to make TeX DVI files from Texinfo source; default - `texi2dvi'. - -`WEAVE' - Program to translate Web into TeX; default `weave'. - -`CWEAVE' - Program to translate C Web into TeX; default `cweave'. - -`TANGLE' - Program to translate Web into Pascal; default `tangle'. - -`CTANGLE' - Program to translate C Web into C; default `ctangle'. - -`RM' - Command to remove a file; default `rm -f'. - - Here is a table of variables whose values are additional arguments -for the programs above. The default values for all of these is the -empty string, unless otherwise noted. - -`ARFLAGS' - Flags to give the archive-maintaining program; default `rv'. - -`ASFLAGS' - Extra flags to give to the assembler (when explicitly invoked on a - `.s' or `.S' file). - -`CFLAGS' - Extra flags to give to the C compiler. - -`CXXFLAGS' - Extra flags to give to the C++ compiler. - -`COFLAGS' - Extra flags to give to the RCS `co' program. - -`CPPFLAGS' - Extra flags to give to the C preprocessor and programs that use it - (the C and Fortran compilers). - -`FFLAGS' - Extra flags to give to the Fortran compiler. - -`GFLAGS' - Extra flags to give to the SCCS `get' program. - -`LDFLAGS' - Extra flags to give to compilers when they are supposed to invoke - the linker, `ld'. - -`LFLAGS' - Extra flags to give to Lex. - -`PFLAGS' - Extra flags to give to the Pascal compiler. - -`RFLAGS' - Extra flags to give to the Fortran compiler for Ratfor programs. - -`YFLAGS' - Extra flags to give to Yacc. - - -File: make.info, Node: Chained Rules, Next: Pattern Rules, Prev: Implicit Variables, Up: Implicit Rules - -Chains of Implicit Rules -======================== - - Sometimes a file can be made by a sequence of implicit rules. For -example, a file `N.o' could be made from `N.y' by running first Yacc -and then `cc'. Such a sequence is called a "chain". - - If the file `N.c' exists, or is mentioned in the makefile, no -special searching is required: `make' finds that the object file can be -made by C compilation from `N.c'; later on, when considering how to -make `N.c', the rule for running Yacc is used. Ultimately both `N.c' -and `N.o' are updated. - - However, even if `N.c' does not exist and is not mentioned, `make' -knows how to envision it as the missing link between `N.o' and `N.y'! -In this case, `N.c' is called an "intermediate file". Once `make' has -decided to use the intermediate file, it is entered in the data base as -if it had been mentioned in the makefile, along with the implicit rule -that says how to create it. - - Intermediate files are remade using their rules just like all other -files. The difference is that the intermediate file is deleted when -`make' is finished. Therefore, the intermediate file which did not -exist before `make' also does not exist after `make'. The deletion is -reported to you by printing a `rm -f' command that shows what `make' is -doing. (You can list the target pattern of an implicit rule (such as -`%.o') as a dependency of the special target `.PRECIOUS' to preserve -intermediate files made by implicit rules whose target patterns match -that file's name; see *Note Interrupts::.) - - A chain can involve more than two implicit rules. For example, it is -possible to make a file `foo' from `RCS/foo.y,v' by running RCS, Yacc -and `cc'. Then both `foo.y' and `foo.c' are intermediate files that -are deleted at the end. - - No single implicit rule can appear more than once in a chain. This -means that `make' will not even consider such a ridiculous thing as -making `foo' from `foo.o.o' by running the linker twice. This -constraint has the added benefit of preventing any infinite loop in the -search for an implicit rule chain. - - There are some special implicit rules to optimize certain cases that -would otherwise be handled by rule chains. For example, making `foo' -from `foo.c' could be handled by compiling and linking with separate -chained rules, using `foo.o' as an intermediate file. But what -actually happens is that a special rule for this case does the -compilation and linking with a single `cc' command. The optimized rule -is used in preference to the step-by-step chain because it comes -earlier in the ordering of rules. - - -File: make.info, Node: Pattern Rules, Next: Last Resort, Prev: Chained Rules, Up: Implicit Rules - -Defining and Redefining Pattern Rules -===================================== - - You define an implicit rule by writing a "pattern rule". A pattern -rule looks like an ordinary rule, except that its target contains the -character `%' (exactly one of them). The target is considered a -pattern for matching file names; the `%' can match any nonempty -substring, while other characters match only themselves. The -dependencies likewise use `%' to show how their names relate to the -target name. - - Thus, a pattern rule `%.o : %.c' says how to make any file `STEM.o' -from another file `STEM.c'. - - Note that expansion using `%' in pattern rules occurs *after* any -variable or function expansions, which take place when the makefile is -read. *Note How to Use Variables: Using Variables, and *Note Functions -for Transforming Text: Functions. - -* Menu: - -* Pattern Intro:: An introduction to pattern rules. -* Pattern Examples:: Examples of pattern rules. -* Automatic:: How to use automatic variables in the - commands of implicit rules. -* Pattern Match:: How patterns match. -* Match-Anything Rules:: Precautions you should take prior to - defining rules that can match any - target file whatever. -* Canceling Rules:: How to override or cancel built-in rules. - - -File: make.info, Node: Pattern Intro, Next: Pattern Examples, Up: Pattern Rules - -Introduction to Pattern Rules ------------------------------ - - A pattern rule contains the character `%' (exactly one of them) in -the target; otherwise, it looks exactly like an ordinary rule. The -target is a pattern for matching file names; the `%' matches any -nonempty substring, while other characters match only themselves. - - For example, `%.c' as a pattern matches any file name that ends in -`.c'. `s.%.c' as a pattern matches any file name that starts with -`s.', ends in `.c' and is at least five characters long. (There must -be at least one character to match the `%'.) The substring that the -`%' matches is called the "stem". - - `%' in a dependency of a pattern rule stands for the same stem that -was matched by the `%' in the target. In order for the pattern rule to -apply, its target pattern must match the file name under consideration, -and its dependency patterns must name files that exist or can be made. -These files become dependencies of the target. - - Thus, a rule of the form - - %.o : %.c ; COMMAND... - -specifies how to make a file `N.o', with another file `N.c' as its -dependency, provided that `N.c' exists or can be made. - - There may also be dependencies that do not use `%'; such a dependency -attaches to every file made by this pattern rule. These unvarying -dependencies are useful occasionally. - - A pattern rule need not have any dependencies that contain `%', or -in fact any dependencies at all. Such a rule is effectively a general -wildcard. It provides a way to make any file that matches the target -pattern. *Note Last Resort::. - - Pattern rules may have more than one target. Unlike normal rules, -this does not act as many different rules with the same dependencies and -commands. If a pattern rule has multiple targets, `make' knows that -the rule's commands are responsible for making all of the targets. The -commands are executed only once to make all the targets. When searching -for a pattern rule to match a target, the target patterns of a rule -other than the one that matches the target in need of a rule are -incidental: `make' worries only about giving commands and dependencies -to the file presently in question. However, when this file's commands -are run, the other targets are marked as having been updated themselves. - - The order in which pattern rules appear in the makefile is important -since this is the order in which they are considered. Of equally -applicable rules, only the first one found is used. The rules you -write take precedence over those that are built in. Note however, that -a rule whose dependencies actually exist or are mentioned always takes -priority over a rule with dependencies that must be made by chaining -other implicit rules. - - -File: make.info, Node: Pattern Examples, Next: Automatic, Prev: Pattern Intro, Up: Pattern Rules - -Pattern Rule Examples ---------------------- - - Here are some examples of pattern rules actually predefined in -`make'. First, the rule that compiles `.c' files into `.o' files: - - %.o : %.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - -defines a rule that can make any file `X.o' from `X.c'. The command -uses the automatic variables `$@' and `$<' to substitute the names of -the target file and the source file in each case where the rule applies -(*note Automatic Variables: Automatic.). - - Here is a second built-in rule: - - % :: RCS/%,v - $(CO) $(COFLAGS) $< - -defines a rule that can make any file `X' whatsoever from a -corresponding file `X,v' in the subdirectory `RCS'. Since the target -is `%', this rule will apply to any file whatever, provided the -appropriate dependency file exists. The double colon makes the rule -"terminal", which means that its dependency may not be an intermediate -file (*note Match-Anything Pattern Rules: Match-Anything Rules.). - - This pattern rule has two targets: - - %.tab.c %.tab.h: %.y - bison -d $< - -This tells `make' that the command `bison -d X.y' will make both -`X.tab.c' and `X.tab.h'. If the file `foo' depends on the files -`parse.tab.o' and `scan.o' and the file `scan.o' depends on the file -`parse.tab.h', when `parse.y' is changed, the command `bison -d parse.y' -will be executed only once, and the dependencies of both `parse.tab.o' -and `scan.o' will be satisfied. (Presumably the file `parse.tab.o' -will be recompiled from `parse.tab.c' and the file `scan.o' from -`scan.c', while `foo' is linked from `parse.tab.o', `scan.o', and its -other dependencies, and it will execute happily ever after.) - - -File: make.info, Node: Automatic, Next: Pattern Match, Prev: Pattern Examples, Up: Pattern Rules - -Automatic Variables -------------------- - - Suppose you are writing a pattern rule to compile a `.c' file into a -`.o' file: how do you write the `cc' command so that it operates on the -right source file name? You cannot write the name in the command, -because the name is different each time the implicit rule is applied. - - What you do is use a special feature of `make', the "automatic -variables". These variables have values computed afresh for each rule -that is executed, based on the target and dependencies of the rule. In -this example, you would use `$@' for the object file name and `$<' for -the source file name. - - Here is a table of automatic variables: - -`$@' - The file name of the target of the rule. If the target is an - archive member, then `$@' is the name of the archive file. In a - pattern rule that has multiple targets (*note Introduction to - Pattern Rules: Pattern Intro.), `$@' is the name of whichever - target caused the rule's commands to be run. - -`$%' - The target member name, when the target is an archive member. - *Note Archives::. For example, if the target is `foo.a(bar.o)' - then `$%' is `bar.o' and `$@' is `foo.a'. `$%' is empty when the - target is not an archive member. - -`$<' - The name of the first dependency. If the target got its commands - from an implicit rule, this will be the first dependency added by - the implicit rule (*note Implicit Rules::.). - -`$?' - The names of all the dependencies that are newer than the target, - with spaces between them. For dependencies which are archive - members, only the member named is used (*note Archives::.). - -`$^' - The names of all the dependencies, with spaces between them. For - dependencies which are archive members, only the member named is - used (*note Archives::.). A target has only one dependency on - each other file it depends on, no matter how many times each file - is listed as a dependency. So if you list a dependency more than - once for a target, the value of `$^' contains just one copy of the - name. - -`$+' - This is like `$^', but dependencies listed more than once are - duplicated in the order they were listed in the makefile. This is - primarily useful for use in linking commands where it is - meaningful to repeat library file names in a particular order. - -`$*' - The stem with which an implicit rule matches (*note How Patterns - Match: Pattern Match.). If the target is `dir/a.foo.b' and the - target pattern is `a.%.b' then the stem is `dir/foo'. The stem is - useful for constructing names of related files. - - In a static pattern rule, the stem is part of the file name that - matched the `%' in the target pattern. - - In an explicit rule, there is no stem; so `$*' cannot be determined - in that way. Instead, if the target name ends with a recognized - suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), `$*' is - set to the target name minus the suffix. For example, if the - target name is `foo.c', then `$*' is set to `foo', since `.c' is a - suffix. GNU `make' does this bizarre thing only for compatibility - with other implementations of `make'. You should generally avoid - using `$*' except in implicit rules or static pattern rules. - - If the target name in an explicit rule does not end with a - recognized suffix, `$*' is set to the empty string for that rule. - - `$?' is useful even in explicit rules when you wish to operate on -only the dependencies that have changed. For example, suppose that an -archive named `lib' is supposed to contain copies of several object -files. This rule copies just the changed object files into the archive: - - lib: foo.o bar.o lose.o win.o - ar r lib $? - - Of the variables listed above, four have values that are single file -names, and two have values that are lists of file names. These six have -variants that get just the file's directory name or just the file name -within the directory. The variant variables' names are formed by -appending `D' or `F', respectively. These variants are semi-obsolete -in GNU `make' since the functions `dir' and `notdir' can be used to get -a similar effect (*note Functions for File Names: Filename Functions.). -Note, however, that the `F' variants all omit the trailing slash which -always appears in the output of the `dir' function. Here is a table of -the variants: - -`$(@D)' - The directory part of the file name of the target, with the - trailing slash removed. If the value of `$@' is `dir/foo.o' then - `$(@D)' is `dir'. This value is `.' if `$@' does not contain a - slash. - -`$(@F)' - The file-within-directory part of the file name of the target. If - the value of `$@' is `dir/foo.o' then `$(@F)' is `foo.o'. `$(@F)' - is equivalent to `$(notdir $@)'. - -`$(*D)' -`$(*F)' - The directory part and the file-within-directory part of the stem; - `dir' and `foo' in this example. - -`$(%D)' -`$(%F)' - The directory part and the file-within-directory part of the target - archive member name. This makes sense only for archive member - targets of the form `ARCHIVE(MEMBER)' and is useful only when - MEMBER may contain a directory name. (*Note Archive Members as - Targets: Archive Members.) - -`$( foo.1 - -will fail when the current directory is not the source directory, -because `foo.man' and `sedscript' are not in the current directory. - - When using GNU `make', relying on `VPATH' to find the source file -will work in the case where there is a single dependency file, since -the `make' automatic variable `$<' will represent the source file -wherever it is. (Many versions of `make' set `$<' only in implicit -rules.) A makefile target like - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o - -should instead be written as - - foo.o : bar.c - $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ - -in order to allow `VPATH' to work correctly. When the target has -multiple dependencies, using an explicit `$(srcdir)' is the easiest way -to make the rule work well. For example, the target above for `foo.1' -is best written as: - - foo.1 : foo.man sedscript - sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ - - -File: make.info, Node: Utilities in Makefiles, Next: Standard Targets, Prev: Makefile Basics, Up: Makefile Conventions - -Utilities in Makefiles -====================== - - Write the Makefile commands (and any shell scripts, such as -`configure') to run in `sh', not in `csh'. Don't use any special -features of `ksh' or `bash'. - - The `configure' script and the Makefile rules for building and -installation should not use any utilities directly except these: - - cat cmp cp echo egrep expr grep - ln mkdir mv pwd rm rmdir sed test touch - - Stick to the generally supported options for these programs. For -example, don't use `mkdir -p', convenient as it may be, because most -systems don't support it. - - The Makefile rules for building and installation can also use -compilers and related programs, but should do so via `make' variables -so that the user can substitute alternatives. Here are some of the -programs we mean: - - ar bison cc flex install ld lex - make makeinfo ranlib texi2dvi yacc - - Use the following `make' variables: - - $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) - $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) - - When you use `ranlib', you should make sure nothing bad happens if -the system does not have `ranlib'. Arrange to ignore an error from -that command, and print a message before the command to tell the user -that failure of the `ranlib' command does not mean a problem. - - If you use symbolic links, you should implement a fallback for -systems that don't have symbolic links. - - It is ok to use other utilities in Makefile portions (or scripts) -intended only for particular systems where you know those utilities to -exist. - - -File: make.info, Node: Standard Targets, Next: Command Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions - -Standard Targets for Users -========================== - - All GNU programs should have the following targets in their -Makefiles: - -`all' - Compile the entire program. This should be the default target. - This target need not rebuild any documentation files; Info files - should normally be included in the distribution, and DVI files - should be made only when explicitly asked for. - -`install' - Compile the program and copy the executables, libraries, and so on - to the file names where they should reside for actual use. If - there is a simple test to verify that a program is properly - installed, this target should run that test. - - If possible, write the `install' target rule so that it does not - modify anything in the directory where the program was built, - provided `make all' has just been done. This is convenient for - building the program under one user name and installing it under - another. - - The commands should create all the directories in which files are - to be installed, if they don't already exist. This includes the - directories specified as the values of the variables `prefix' and - `exec_prefix', as well as all subdirectories that are needed. One - way to do this is by means of an `installdirs' target as described - below. - - Use `-' before any command for installing a man page, so that - `make' will ignore any errors. This is in case there are systems - that don't have the Unix man page documentation system installed. - - The way to install Info files is to copy them into `$(infodir)' - with `$(INSTALL_DATA)' (*note Command Variables::.), and then run - the `install-info' program if it is present. `install-info' is a - script that edits the Info `dir' file to add or update the menu - entry for the given Info file; it will be part of the Texinfo - package. Here is a sample rule to install an Info file: - - $(infodir)/foo.info: foo.info - # There may be a newer info file in . than in srcdir. - -if test -f foo.info; then d=.; \ - else d=$(srcdir); fi; \ - $(INSTALL_DATA) $$d/foo.info $@; \ - # Run install-info only if it exists. - # Use `if' instead of just prepending `-' to the - # line so we notice real errors from install-info. - # We use `$(SHELL) -c' because some shells do not - # fail gracefully when there is an unknown command. - if $(SHELL) -c 'install-info --version' \ - >/dev/null 2>&1; then \ - install-info --infodir=$(infodir) $$d/foo.info; \ - else true; fi - -`uninstall' - Delete all the installed files that the `install' target would - create (but not the noninstalled files such as `make all' would - create). - - This rule should not modify the directories where compilation is - done, only the directories where files are installed. - -`clean' - Delete all files from the current directory that are normally - created by building the program. Don't delete the files that - record the configuration. Also preserve files that could be made - by building, but normally aren't because the distribution comes - with them. - - Delete `.dvi' files here if they are not part of the distribution. - -`distclean' - Delete all files from the current directory that are created by - configuring or building the program. If you have unpacked the - source and built the program without creating any other files, - `make distclean' should leave only the files that were in the - distribution. - -`mostlyclean' - Like `clean', but may refrain from deleting a few files that people - normally don't want to recompile. For example, the `mostlyclean' - target for GCC does not delete `libgcc.a', because recompiling it - is rarely necessary and takes a lot of time. - -`maintainer-clean' - Delete almost everything from the current directory that can be - reconstructed with this Makefile. This typically includes - everything deleted by `distclean', plus more: C source files - produced by Bison, tags tables, Info files, and so on. - - The reason we say "almost everything" is that `make - maintainer-clean' should not delete `configure' even if - `configure' can be remade using a rule in the Makefile. More - generally, `make maintainer-clean' should not delete anything that - needs to exist in order to run `configure' and then begin to build - the program. This is the only exception; `maintainer-clean' should - delete everything else that can be rebuilt. - - The `maintainer-clean' is intended to be used by a maintainer of - the package, not by ordinary users. You may need special tools to - reconstruct some of the files that `make maintainer-clean' deletes. - Since these files are normally included in the distribution, we - don't take care to make them easy to reconstruct. If you find you - need to unpack the full distribution again, don't blame us. - - To help make users aware of this, the commands for - `maintainer-clean' should start with these two: - - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -`TAGS' - Update a tags table for this program. - -`info' - Generate any Info files needed. The best way to write the rules - is as follows: - - info: foo.info - - foo.info: foo.texi chap1.texi chap2.texi - $(MAKEINFO) $(srcdir)/foo.texi - - You must define the variable `MAKEINFO' in the Makefile. It should - run the `makeinfo' program, which is part of the Texinfo - distribution. - -`dvi' - Generate DVI files for all TeXinfo documentation. For example: - - dvi: foo.dvi - - foo.dvi: foo.texi chap1.texi chap2.texi - $(TEXI2DVI) $(srcdir)/foo.texi - - You must define the variable `TEXI2DVI' in the Makefile. It should - run the program `texi2dvi', which is part of the Texinfo - distribution. Alternatively, write just the dependencies, and - allow GNU Make to provide the command. - -`dist' - Create a distribution tar file for this program. The tar file - should be set up so that the file names in the tar file start with - a subdirectory name which is the name of the package it is a - distribution for. This name can include the version number. - - For example, the distribution tar file of GCC version 1.40 unpacks - into a subdirectory named `gcc-1.40'. - - The easiest way to do this is to create a subdirectory - appropriately named, use `ln' or `cp' to install the proper files - in it, and then `tar' that subdirectory. - - The `dist' target should explicitly depend on all non-source files - that are in the distribution, to make sure they are up to date in - the distribution. *Note Making Releases: (standards)Releases. - -`check' - Perform self-tests (if any). The user must build the program - before running the tests, but need not install the program; you - should write the self-tests so that they work when the program is - built but not installed. - - The following targets are suggested as conventional names, for -programs in which they are useful. - -`installcheck' - Perform installation tests (if any). The user must build and - install the program before running the tests. You should not - assume that `$(bindir)' is in the search path. - -`installdirs' - It's useful to add a target named `installdirs' to create the - directories where files are installed, and their parent - directories. There is a script called `mkinstalldirs' which is - convenient for this; find it in the Texinfo package.You can use a - rule like this: - - # Make sure all installation directories (e.g. $(bindir)) - # actually exist by making them if necessary. - installdirs: mkinstalldirs - $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ - $(libdir) $(infodir) \ - $(mandir) - - This rule should not modify the directories where compilation is - done. It should do nothing but create installation directories. - - -File: make.info, Node: Command Variables, Next: Directory Variables, Prev: Standard Targets, Up: Makefile Conventions - -Variables for Specifying Commands -================================= - - Makefiles should provide variables for overriding certain commands, -options, and so on. - - In particular, you should run most utility programs via variables. -Thus, if you use Bison, have a variable named `BISON' whose default -value is set with `BISON = bison', and refer to it with `$(BISON)' -whenever you need to use Bison. - - File management utilities such as `ln', `rm', `mv', and so on, need -not be referred to through variables in this way, since users don't -need to replace them with other programs. - - Each program-name variable should come with an options variable that -is used to supply options to the program. Append `FLAGS' to the -program-name variable name to get the options variable name--for -example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this -rule, but we keep it because it is standard.) Use `CPPFLAGS' in any -compilation command that runs the preprocessor, and use `LDFLAGS' in -any compilation command that does linking as well as in any direct use -of `ld'. - - If there are C compiler options that *must* be used for proper -compilation of certain files, do not include them in `CFLAGS'. Users -expect to be able to specify `CFLAGS' freely themselves. Instead, -arrange to pass the necessary options to the C compiler independently -of `CFLAGS', by writing them explicitly in the compilation commands or -by defining an implicit rule, like this: - - CFLAGS = -g - ALL_CFLAGS = -I. $(CFLAGS) - .c.o: - $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< - - Do include the `-g' option in `CFLAGS', because that is not -*required* for proper compilation. You can consider it a default that -is only recommended. If the package is set up so that it is compiled -with GCC by default, then you might as well include `-O' in the default -value of `CFLAGS' as well. - - Put `CFLAGS' last in the compilation command, after other variables -containing compiler options, so the user can use `CFLAGS' to override -the others. - - Every Makefile should define the variable `INSTALL', which is the -basic command for installing a file into the system. - - Every Makefile should also define the variables `INSTALL_PROGRAM' -and `INSTALL_DATA'. (The default for each of these should be -`$(INSTALL)'.) Then it should use those variables as the commands for -actual installation, for executables and nonexecutables respectively. -Use these variables as follows: - - $(INSTALL_PROGRAM) foo $(bindir)/foo - $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a - -Always use a file name, not a directory name, as the second argument of -the installation commands. Use a separate command for each file to be -installed. - diff --git a/buildtools/windows/source/make/make.info-7 b/buildtools/windows/source/make/make.info-7 deleted file mode 100644 index 843095c0a9b..00000000000 --- a/buildtools/windows/source/make/make.info-7 +++ /dev/null @@ -1,727 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Directory Variables, Prev: Command Variables, Up: Makefile Conventions - -Variables for Installation Directories -====================================== - - Installation directories should always be named by variables, so it -is easy to install in a nonstandard place. The standard names for these -variables are described below. They are based on a standard filesystem -layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and -other modern operating systems. - - These two variables set the root for the installation. All the other -installation directories should be subdirectories of one of these two, -and nothing should be directly installed into these two directories. - -`prefix' - A prefix used in constructing the default values of the variables - listed below. The default value of `prefix' should be `/usr/local' - When building the complete GNU system, the prefix will be empty and - `/usr' will be a symbolic link to `/'. - -`exec_prefix' - A prefix used in constructing the default values of some of the - variables listed below. The default value of `exec_prefix' should - be `$(prefix)'. - - Generally, `$(exec_prefix)' is used for directories that contain - machine-specific files (such as executables and subroutine - libraries), while `$(prefix)' is used directly for other - directories. - - Executable programs are installed in one of the following -directories. - -`bindir' - The directory for installing executable programs that users can - run. This should normally be `/usr/local/bin', but write it as - `$(exec_prefix)/bin'. - -`sbindir' - The directory for installing executable programs that can be run - from the shell, but are only generally useful to system - administrators. This should normally be `/usr/local/sbin', but - write it as `$(exec_prefix)/sbin'. - -`libexecdir' - The directory for installing executable programs to be run by other - programs rather than by users. This directory should normally be - `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'. - - Data files used by the program during its execution are divided into -categories in two ways. - - * Some files are normally modified by programs; others are never - normally modified (though users may edit some of these). - - * Some files are architecture-independent and can be shared by all - machines at a site; some are architecture-dependent and can be - shared only by machines of the same kind and operating system; - others may never be shared between two machines. - - This makes for six different possibilities. However, we want to -discourage the use of architecture-dependent files, aside from of object -files and libraries. It is much cleaner to make other data files -architecture-independent, and it is generally not hard. - - Therefore, here are the variables makefiles should use to specify -directories: - -`datadir' - The directory for installing read-only architecture independent - data files. This should normally be `/usr/local/share', but write - it as `$(prefix)/share'. As a special exception, see `$(infodir)' - and `$(includedir)' below. - -`sysconfdir' - The directory for installing read-only data files that pertain to a - single machine-that is to say, files for configuring a host. - Mailer and network configuration files, `/etc/passwd', and so - forth belong here. All the files in this directory should be - ordinary ASCII text files. This directory should normally be - `/usr/local/etc', but write it as `$(prefix)/etc'. - - Do not install executables in this directory (they probably belong - in `$(libexecdir)' or `$(sbindir))'. Also do not install files - that are modified in the normal course of their use (programs - whose purpose is to change the configuration of the system - excluded). Those probably belong in `$(localstatedir)'. - -`sharedstatedir' - The directory for installing architecture-independent data files - which the programs modify while they run. This should normally be - `/usr/local/com', but write it as `$(prefix)/com'. - -`localstatedir' - The directory for installing data files which the programs modify - while they run, and that pertain to one specific machine. Users - should never need to modify files in this directory to configure - the package's operation; put such configuration information in - separate files that go in `datadir' or `$(sysconfdir)'. - `$(localstatedir)' should normally be `/usr/local/var', but write - it as `$(prefix)/var'. - -`libdir' - The directory for object files and libraries of object code. Do - not install executables here, they probably belong in - `$(libexecdir)' instead. The value of `libdir' should normally be - `/usr/local/lib', but write it as `$(exec_prefix)/lib'. - -`infodir' - The directory for installing the Info files for this package. By - default, it should be `/usr/local/info', but it should be written - as `$(prefix)/info'. - -`includedir' - The directory for installing header files to be included by user - programs with the C `#include' preprocessor directive. This - should normally be `/usr/local/include', but write it as - `$(prefix)/include'. - - Most compilers other than GCC do not look for header files in - `/usr/local/include'. So installing the header files this way is - only useful with GCC. Sometimes this is not a problem because some - libraries are only really intended to work with GCC. But some - libraries are intended to work with other compilers. They should - install their header files in two places, one specified by - `includedir' and one specified by `oldincludedir'. - -`oldincludedir' - The directory for installing `#include' header files for use with - compilers other than GCC. This should normally be `/usr/include'. - - The Makefile commands should check whether the value of - `oldincludedir' is empty. If it is, they should not try to use - it; they should cancel the second installation of the header files. - - A package should not replace an existing header in this directory - unless the header came from the same package. Thus, if your Foo - package provides a header file `foo.h', then it should install the - header file in the `oldincludedir' directory if either (1) there - is no `foo.h' there or (2) the `foo.h' that exists came from the - Foo package. - - To tell whether `foo.h' came from the Foo package, put a magic - string in the file--part of a comment--and grep for that string. - - Unix-style man pages are installed in one of the following: - -`mandir' - The directory for installing the man pages (if any) for this - package. It should include the suffix for the proper section of - the manual--usually `1' for a utility. It will normally be - `/usr/local/man/man1', but you should write it as - `$(prefix)/man/man1'. - -`man1dir' - The directory for installing section 1 man pages. - -`man2dir' - The directory for installing section 2 man pages. - -`...' - Use these names instead of `mandir' if the package needs to - install man pages in more than one section of the manual. - - *Don't make the primary documentation for any GNU software be a - man page. Write a manual in Texinfo instead. Man pages are just - for the sake of people running GNU software on Unix, which is a - secondary application only.* - -`manext' - The file name extension for the installed man page. This should - contain a period followed by the appropriate digit; it should - normally be `.1'. - -`man1ext' - The file name extension for installed section 1 man pages. - -`man2ext' - The file name extension for installed section 2 man pages. - -`...' - Use these names instead of `manext' if the package needs to - install man pages in more than one section of the manual. - - And finally, you should set the following variable: - -`srcdir' - The directory for the sources being compiled. The value of this - variable is normally inserted by the `configure' shell script. - - For example: - - # Common prefix for installation directories. - # NOTE: This directory must exist when you start the install. - prefix = /usr/local - exec_prefix = $(prefix) - # Where to put the executable for the command `gcc'. - bindir = $(exec_prefix)/bin - # Where to put the directories used by the compiler. - libexecdir = $(exec_prefix)/libexec - # Where to put the Info files. - infodir = $(prefix)/info - - If your program installs a large number of files into one of the -standard user-specified directories, it might be useful to group them -into a subdirectory particular to that program. If you do this, you -should write the `install' rule to create these subdirectories. - - Do not expect the user to include the subdirectory name in the value -of any of the variables listed above. The idea of having a uniform set -of variable names for installation directories is to enable the user to -specify the exact same values for several different GNU packages. In -order for this to be useful, all the packages must be designed so that -they will work sensibly when the user does so. - - -File: make.info, Node: Quick Reference, Next: Complex Makefile, Prev: Makefile Conventions, Up: Top - -Quick Reference -*************** - - This appendix summarizes the directives, text manipulation functions, -and special variables which GNU `make' understands. *Note Special -Targets::, *Note Catalogue of Implicit Rules: Catalogue of Rules, and -*Note Summary of Options: Options Summary, for other summaries. - - Here is a summary of the directives GNU `make' recognizes: - -`define VARIABLE' -`endef' - Define a multi-line, recursively-expanded variable. - *Note Sequences::. - -`ifdef VARIABLE' -`ifndef VARIABLE' -`ifeq (A,B)' -`ifeq "A" "B"' -`ifeq 'A' 'B'' -`ifneq (A,B)' -`ifneq "A" "B"' -`ifneq 'A' 'B'' -`else' -`endif' - Conditionally evaluate part of the makefile. - *Note Conditionals::. - -`include FILE' - Include another makefile. - *Note Including Other Makefiles: Include. - -`override VARIABLE = VALUE' -`override VARIABLE := VALUE' -`override VARIABLE += VALUE' -`override define VARIABLE' -`endef' - Define a variable, overriding any previous definition, even one - from the command line. - *Note The `override' Directive: Override Directive. - -`export' - Tell `make' to export all variables to child processes by default. - *Note Communicating Variables to a Sub-`make': Variables/Recursion. - -`export VARIABLE' -`export VARIABLE = VALUE' -`export VARIABLE := VALUE' -`export VARIABLE += VALUE' -`unexport VARIABLE' - Tell `make' whether or not to export a particular variable to child - processes. - *Note Communicating Variables to a Sub-`make': Variables/Recursion. - -`vpath PATTERN PATH' - Specify a search path for files matching a `%' pattern. - *Note The `vpath' Directive: Selective Search. - -`vpath PATTERN' - Remove all search paths previously specified for PATTERN. - -`vpath' - Remove all search paths previously specified in any `vpath' - directive. - - Here is a summary of the text manipulation functions (*note -Functions::.): - -`$(subst FROM,TO,TEXT)' - Replace FROM with TO in TEXT. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(patsubst PATTERN,REPLACEMENT,TEXT)' - Replace words matching PATTERN with REPLACEMENT in TEXT. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(strip STRING)' - Remove excess whitespace characters from STRING. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(findstring FIND,TEXT)' - Locate FIND in TEXT. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(filter PATTERN...,TEXT)' - Select words in TEXT that match one of the PATTERN words. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(filter-out PATTERN...,TEXT)' - Select words in TEXT that *do not* match any of the PATTERN words. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(sort LIST)' - Sort the words in LIST lexicographically, removing duplicates. - *Note Functions for String Substitution and Analysis: Text - Functions. - -`$(dir NAMES...)' - Extract the directory part of each file name. - *Note Functions for File Names: Filename Functions. - -`$(notdir NAMES...)' - Extract the non-directory part of each file name. - *Note Functions for File Names: Filename Functions. - -`$(suffix NAMES...)' - Extract the suffix (the last `.' and following characters) of each - file name. - *Note Functions for File Names: Filename Functions. - -`$(basename NAMES...)' - Extract the base name (name without suffix) of each file name. - *Note Functions for File Names: Filename Functions. - -`$(addsuffix SUFFIX,NAMES...)' - Append SUFFIX to each word in NAMES. - *Note Functions for File Names: Filename Functions. - -`$(addprefix PREFIX,NAMES...)' - Prepend PREFIX to each word in NAMES. - *Note Functions for File Names: Filename Functions. - -`$(join LIST1,LIST2)' - Join two parallel lists of words. - *Note Functions for File Names: Filename Functions. - -`$(word N,TEXT)' - Extract the Nth word (one-origin) of TEXT. - *Note Functions for File Names: Filename Functions. - -`$(words TEXT)' - Count the number of words in TEXT. - *Note Functions for File Names: Filename Functions. - -`$(firstword NAMES...)' - Extract the first word of NAMES. - *Note Functions for File Names: Filename Functions. - -`$(wildcard PATTERN...)' - Find file names matching a shell file name pattern (*not* a `%' - pattern). - *Note The Function `wildcard': Wildcard Function. - -`$(shell COMMAND)' - Execute a shell command and return its output. - *Note The `shell' Function: Shell Function. - -`$(origin VARIABLE)' - Return a string describing how the `make' variable VARIABLE was - defined. - *Note The `origin' Function: Origin Function. - -`$(foreach VAR,WORDS,TEXT)' - Evaluate TEXT with VAR bound to each word in WORDS, and - concatenate the results. - *Note The `foreach' Function: Foreach Function. - - Here is a summary of the automatic variables. *Note Automatic -Variables: Automatic, for full information. - -`$@' - The file name of the target. - -`$%' - The target member name, when the target is an archive member. - -`$<' - The name of the first dependency. - -`$?' - The names of all the dependencies that are newer than the target, - with spaces between them. For dependencies which are archive - members, only the member named is used (*note Archives::.). - -`$^' -`$+' - The names of all the dependencies, with spaces between them. For - dependencies which are archive members, only the member named is - used (*note Archives::.). The value of `$^' omits duplicate - dependencies, while `$+' retains them and preserves their order. - -`$*' - The stem with which an implicit rule matches (*note How Patterns - Match: Pattern Match.). - -`$(@D)' -`$(@F)' - The directory part and the file-within-directory part of `$@'. - -`$(*D)' -`$(*F)' - The directory part and the file-within-directory part of `$*'. - -`$(%D)' -`$(%F)' - The directory part and the file-within-directory part of `$%'. - -`$( tar-`sed -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ - -e q - version.c`.shar.Z - - dist: $(SRCS) $(AUX) - echo tar-`sed \ - -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ - -e q - version.c` > .fname - -rm -rf `cat .fname` - mkdir `cat .fname` - ln $(SRCS) $(AUX) `cat .fname` - -rm -rf `cat .fname` .fname - tar chZf `cat .fname`.tar.Z `cat .fname` - - tar.zoo: $(SRCS) $(AUX) - -rm -rf tmp.dir - -mkdir tmp.dir - -rm tar.zoo - for X in $(SRCS) $(AUX) ; do \ - echo $$X ; \ - sed 's/$$/^M/' $$X \ - > tmp.dir/$$X ; done - cd tmp.dir ; zoo aM ../tar.zoo * - -rm -rf tmp.dir - diff --git a/buildtools/windows/source/make/make.info-8 b/buildtools/windows/source/make/make.info-8 deleted file mode 100644 index f2c5def3abc..00000000000 --- a/buildtools/windows/source/make/make.info-8 +++ /dev/null @@ -1,896 +0,0 @@ -This is Info file make.info, produced by Makeinfo-1.55 from the input -file ./make.texinfo. - - This file documents the GNU Make utility, which determines -automatically which pieces of a large program need to be recompiled, -and issues the commands to recompile them. - - This is Edition 0.48, last updated 4 April 1995, of `The GNU Make -Manual', for `make', Version 3.73 Beta. - - Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95 Free -Software Foundation, Inc. - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - -File: make.info, Node: Concept Index, Next: Name Index, Prev: Complex Makefile, Up: Top - -Index of Concepts -***************** - -* Menu: - -* +, and define: Sequences. -* +=: Appending. -* ,v (RCS file extension): Catalogue of Rules. -* -, and define: Sequences. -* .C: Catalogue of Rules. -* .c: Catalogue of Rules. -* .cc: Catalogue of Rules. -* .ch: Catalogue of Rules. -* .def: Catalogue of Rules. -* .dvi: Catalogue of Rules. -* .F: Catalogue of Rules. -* .f: Catalogue of Rules. -* .info: Catalogue of Rules. -* .l: Catalogue of Rules. -* .ln: Catalogue of Rules. -* .mod: Catalogue of Rules. -* .o: Catalogue of Rules. -* .o: Catalogue of Rules. -* .p: Catalogue of Rules. -* .r: Catalogue of Rules. -* .S: Catalogue of Rules. -* .s: Catalogue of Rules. -* .sh: Catalogue of Rules. -* .sym: Catalogue of Rules. -* .tex: Catalogue of Rules. -* .texi: Catalogue of Rules. -* .texinfo: Catalogue of Rules. -* .txinfo: Catalogue of Rules. -* .w: Catalogue of Rules. -* .web: Catalogue of Rules. -* .y: Catalogue of Rules. -* :=: Setting. -* :=: Flavors. -* =: Flavors. -* =: Setting. -* @, and define: Sequences. -* #include: Automatic Dependencies. -* # (comments), in commands: Commands. -* # (comments), in makefile: Makefile Contents. -* $, in function call: Syntax of Functions. -* $, in rules: Rule Syntax. -* $, in variable name: Computed Names. -* $, in variable reference: Reference. -* %, in pattern rules: Pattern Intro. -* %, quoting in patsubst: Text Functions. -* %, quoting in vpath: Selective Search. -* %, quoting in static pattern: Static Usage. -* %, quoting with \ (backslash): Selective Search. -* %, quoting with \ (backslash): Static Usage. -* %, quoting with \ (backslash): Text Functions. -* * (wildcard character): Wildcards. -* -assume-new: Options Summary. -* -assume-new: Instead of Execution. -* -assume-new, and recursion: Options/Recursion. -* -assume-old: Avoiding Compilation. -* -assume-old: Options Summary. -* -assume-old, and recursion: Options/Recursion. -* -debug: Options Summary. -* -directory: Options Summary. -* -directory: Recursion. -* -directory, and -print-directory: -w Option. -* -directory, and recursion: Options/Recursion. -* -dry-run: Echoing. -* -dry-run: Instead of Execution. -* -dry-run: Options Summary. -* -environment-overrides: Options Summary. -* -file: Options Summary. -* -file: Makefile Arguments. -* -file: Makefile Names. -* -file, and recursion: Options/Recursion. -* -help: Options Summary. -* -ignore-errors: Errors. -* -ignore-errors: Options Summary. -* -include-dir: Options Summary. -* -include-dir: Include. -* -jobs: Parallel. -* -jobs: Options Summary. -* -jobs, and recursion: Options/Recursion. -* -just-print: Options Summary. -* -just-print: Instead of Execution. -* -just-print: Echoing. -* -keep-going: Options Summary. -* -keep-going: Errors. -* -keep-going: Testing. -* -load-average: Options Summary. -* -load-average: Parallel. -* -makefile: Options Summary. -* -makefile: Makefile Arguments. -* -makefile: Makefile Names. -* -max-load: Options Summary. -* -max-load: Parallel. -* -new-file: Instead of Execution. -* -new-file: Options Summary. -* -new-file, and recursion: Options/Recursion. -* -no-builtin-rules: Options Summary. -* -no-keep-going: Options Summary. -* -no-print-directory: -w Option. -* -no-print-directory: Options Summary. -* -old-file: Avoiding Compilation. -* -old-file: Options Summary. -* -old-file, and recursion: Options/Recursion. -* -print-data-base: Options Summary. -* -print-directory: Options Summary. -* -print-directory, and -directory: -w Option. -* -print-directory, and recursion: -w Option. -* -print-directory, disabling: -w Option. -* -question: Instead of Execution. -* -question: Options Summary. -* -quiet: Echoing. -* -quiet: Options Summary. -* -recon: Options Summary. -* -recon: Echoing. -* -recon: Instead of Execution. -* -silent: Options Summary. -* -silent: Echoing. -* -stop: Options Summary. -* -touch: Instead of Execution. -* -touch: Options Summary. -* -touch, and recursion: MAKE Variable. -* -version: Options Summary. -* -warn-undefined-variables: Options Summary. -* -what-if: Instead of Execution. -* -what-if: Options Summary. -* -b: Options Summary. -* -C: Options Summary. -* -C: Recursion. -* -C, and -w: -w Option. -* -C, and recursion: Options/Recursion. -* -d: Options Summary. -* -e: Options Summary. -* -e (shell flag): Automatic Dependencies. -* -f: Makefile Arguments. -* -f: Makefile Names. -* -f: Options Summary. -* -f, and recursion: Options/Recursion. -* -h: Options Summary. -* -I: Options Summary. -* -i: Options Summary. -* -i: Errors. -* -I: Include. -* -j: Options Summary. -* -j: Parallel. -* -j, and archive update: Archive Pitfalls. -* -j, and recursion: Options/Recursion. -* -k: Errors. -* -k: Testing. -* -k: Options Summary. -* -l: Options Summary. -* -l (library search): Libraries/Search. -* -l (load average): Parallel. -* -MM (to GNU compiler): Automatic Dependencies. -* -m: Options Summary. -* -M (to compiler): Automatic Dependencies. -* -n: Echoing. -* -n: Instead of Execution. -* -n: Options Summary. -* -o: Avoiding Compilation. -* -o: Options Summary. -* -o, and recursion: Options/Recursion. -* -p: Options Summary. -* -q: Options Summary. -* -q: Instead of Execution. -* -r: Options Summary. -* -s: Echoing. -* -s: Options Summary. -* -S: Options Summary. -* -t: Options Summary. -* -t: Instead of Execution. -* -t, and recursion: MAKE Variable. -* -v: Options Summary. -* -w: Options Summary. -* -W: Options Summary. -* -W: Instead of Execution. -* -w, and -C: -w Option. -* -W, and recursion: Options/Recursion. -* -w, and recursion: -w Option. -* -w, disabling: -w Option. -* - (in commands): Errors. -* .a (archives): Archive Suffix Rules. -* .d: Automatic Dependencies. -* .PRECIOUS intermediate files: Chained Rules. -* :: rules (double-colon): Double-Colon. -* ? (wildcard character): Wildcards. -* @ (in commands): Echoing. -* all (standard target): Goals. -* cd (shell command): Execution. -* cd (shell command): MAKE Variable. -* check (standard target): Goals. -* clean (standard target): Goals. -* clean target: Cleanup. -* clean target: Simple Makefile. -* clobber (standard target): Goals. -* distclean (standard target): Goals. -* dist (standard target): Goals. -* FORCE: Force Targets. -* install (standard target): Goals. -* lint, rule to run: Catalogue of Rules. -* lpr (shell command): Wildcard Examples. -* lpr (shell command): Empty Targets. -* make depend: Automatic Dependencies. -* mostlyclean (standard target): Goals. -* OBJECTS: Variables Simplify. -* objects: Variables Simplify. -* objs: Variables Simplify. -* OBJS: Variables Simplify. -* obj: Variables Simplify. -* OBJ: Variables Simplify. -* print (standard target): Goals. -* print target: Empty Targets. -* print target: Wildcard Examples. -* README: Makefile Names. -* realclean (standard target): Goals. -* rm (shell command): Phony Targets. -* rm (shell command): Errors. -* rm (shell command): Simple Makefile. -* rm (shell command): Wildcard Examples. -* sed (shell command): Automatic Dependencies. -* shar (standard target): Goals. -* TAGS (standard target): Goals. -* tar (standard target): Goals. -* test (standard target): Goals. -* touch (shell command): Empty Targets. -* touch (shell command): Wildcard Examples. -* VPATH, and implicit rules: Implicit/Search. -* VPATH, and link libraries: Libraries/Search. -* yacc: Sequences. -* [...] (wildcard characters): Wildcards. -* \ (backslash), for continuation lines: Simple Makefile. -* \ (backslash), in commands: Execution. -* \ (backslash), to quote %: Text Functions. -* \ (backslash), to quote %: Static Usage. -* \ (backslash), to quote %: Selective Search. -* __.SYMDEF: Archive Symbols. -* ~ (tilde): Wildcards. -* TeX, rule to run: Catalogue of Rules. -* appending to variables: Appending. -* ar: Implicit Variables. -* archive: Archives. -* archive member targets: Archive Members. -* archive symbol directory updating: Archive Symbols. -* archive, and -j: Archive Pitfalls. -* archive, and parallel execution: Archive Pitfalls. -* archive, suffix rule for: Archive Suffix Rules. -* Arg list too long: Options/Recursion. -* arguments of functions: Syntax of Functions. -* as: Implicit Variables. -* as: Catalogue of Rules. -* assembly, rule to compile: Catalogue of Rules. -* automatic generation of dependencies: Include. -* automatic generation of dependencies: Automatic Dependencies. -* automatic variables: Automatic. -* backquotes: Shell Function. -* backslash (\), for continuation lines: Simple Makefile. -* backslash (\), in commands: Execution. -* backslash (\), to quote %: Text Functions. -* backslash (\), to quote %: Selective Search. -* backslash (\), to quote %: Static Usage. -* basename: Filename Functions. -* broken pipe: Parallel. -* bugs, reporting: Bugs. -* built-in special targets: Special Targets. -* C++, rule to compile: Catalogue of Rules. -* C, rule to compile: Catalogue of Rules. -* cc: Implicit Variables. -* cc: Catalogue of Rules. -* chains of rules: Chained Rules. -* cleaning up: Cleanup. -* co: Implicit Variables. -* co: Catalogue of Rules. -* combining rules by dependency: Combine By Dependency. -* command line variable definitions, and recursion: Options/Recursion. -* command line variables: Overriding. -* commands: Rule Syntax. -* commands, backslash (\) in: Execution. -* commands, comments in: Commands. -* commands, echoing: Echoing. -* commands, empty: Empty Commands. -* commands, errors in: Errors. -* commands, execution: Execution. -* commands, execution in parallel: Parallel. -* commands, expansion: Shell Function. -* commands, how to write: Commands. -* commands, instead of executing: Instead of Execution. -* commands, introduction to: Rule Introduction. -* commands, quoting newlines in: Execution. -* commands, sequences of: Sequences. -* comments, in commands: Commands. -* comments, in makefile: Makefile Contents. -* compatibility: Features. -* compatibility in exporting: Variables/Recursion. -* compilation, testing: Testing. -* computed variable name: Computed Names. -* conditionals: Conditionals. -* continuation lines: Simple Makefile. -* conventions for makefiles: Makefile Conventions. -* ctangle: Implicit Variables. -* ctangle: Catalogue of Rules. -* cweave: Catalogue of Rules. -* cweave: Implicit Variables. -* deducing commands (implicit rules): make Deduces. -* default goal: Rules. -* default goal: How Make Works. -* default makefile name: Makefile Names. -* default rules, last-resort: Last Resort. -* defining variables verbatim: Defining. -* deletion of target files: Interrupts. -* deletion of target files: Errors. -* dependencies: Rule Syntax. -* dependencies, automatic generation: Automatic Dependencies. -* dependencies, automatic generation: Include. -* dependencies, introduction to: Rule Introduction. -* dependencies, list of all: Automatic. -* dependencies, list of changed: Automatic. -* dependencies, varying (static pattern): Static Pattern. -* dependency: Rules. -* dependency pattern, implicit: Pattern Intro. -* dependency pattern, static (not implicit): Static Usage. -* directive: Makefile Contents. -* directories, printing them: -w Option. -* directories, updating archive symbol: Archive Symbols. -* directory part: Filename Functions. -* directory search (VPATH): Directory Search. -* directory search (VPATH), and implicit rules: Implicit/Search. -* directory search (VPATH), and link libraries: Libraries/Search. -* directory search (VPATH), and shell commands: Commands/Search. -* dollar sign ($), in function call: Syntax of Functions. -* dollar sign ($), in rules: Rule Syntax. -* dollar sign ($), in variable name: Computed Names. -* dollar sign ($), in variable reference: Reference. -* double-colon rules: Double-Colon. -* duplicate words, removing: Text Functions. -* E2BIG: Options/Recursion. -* echoing of commands: Echoing. -* editor: Introduction. -* Emacs (M-x compile): Errors. -* empty commands: Empty Commands. -* empty targets: Empty Targets. -* environment: Environment. -* environment, SHELL in: Execution. -* environment, and recursion: Variables/Recursion. -* errors (in commands): Errors. -* errors with wildcards: Wildcard Pitfall. -* execution, in parallel: Parallel. -* execution, instead of: Instead of Execution. -* execution, of commands: Execution. -* exit status (errors): Errors. -* explicit rule, definition of: Makefile Contents. -* exporting variables: Variables/Recursion. -* f77: Catalogue of Rules. -* f77: Implicit Variables. -* features of GNU make: Features. -* features, missing: Missing. -* file name functions: Filename Functions. -* file name of makefile: Makefile Names. -* file name of makefile, how to specify: Makefile Names. -* file name prefix, adding: Filename Functions. -* file name suffix: Filename Functions. -* file name suffix, adding: Filename Functions. -* file name with wildcards: Wildcards. -* file name, basename of: Filename Functions. -* file name, directory part: Filename Functions. -* file name, nondirectory part: Filename Functions. -* files, assuming new: Instead of Execution. -* files, assuming old: Avoiding Compilation. -* files, avoiding recompilation of: Avoiding Compilation. -* files, intermediate: Chained Rules. -* filtering out words: Text Functions. -* filtering words: Text Functions. -* finding strings: Text Functions. -* flags: Options Summary. -* flags for compilers: Implicit Variables. -* flavors of variables: Flavors. -* force targets: Force Targets. -* Fortran, rule to compile: Catalogue of Rules. -* functions: Functions. -* functions, for file names: Filename Functions. -* functions, for text: Text Functions. -* functions, syntax of: Syntax of Functions. -* g++: Implicit Variables. -* g++: Catalogue of Rules. -* gcc: Catalogue of Rules. -* generating dependencies automatically: Include. -* generating dependencies automatically: Automatic Dependencies. -* get: Catalogue of Rules. -* get: Implicit Variables. -* globbing (wildcards): Wildcards. -* goal: How Make Works. -* goal, default: Rules. -* goal, default: How Make Works. -* goal, how to specify: Goals. -* home directory: Wildcards. -* IEEE Standard 1003.2: Overview. -* implicit rule: Implicit Rules. -* implicit rule, and VPATH: Implicit/Search. -* implicit rule, and directory search: Implicit/Search. -* implicit rule, definition of: Makefile Contents. -* implicit rule, how to use: Using Implicit. -* implicit rule, introduction to: make Deduces. -* implicit rule, predefined: Catalogue of Rules. -* implicit rule, search algorithm: Search Algorithm. -* including (MAKEFILES variable): MAKEFILES Variable. -* including other makefiles: Include. -* incompatibilities: Missing. -* Info, rule to format: Catalogue of Rules. -* intermediate files: Chained Rules. -* intermediate files, preserving: Chained Rules. -* interrupt: Interrupts. -* job slots: Parallel. -* job slots, and recursion: Options/Recursion. -* jobs, limiting based on load: Parallel. -* joining lists of words: Filename Functions. -* killing (interruption): Interrupts. -* last-resort default rules: Last Resort. -* ld: Catalogue of Rules. -* lex: Implicit Variables. -* lex: Catalogue of Rules. -* Lex, rule to run: Catalogue of Rules. -* libraries for linking, directory search: Libraries/Search. -* library archive, suffix rule for: Archive Suffix Rules. -* limiting jobs based on load: Parallel. -* link libraries, and directory search: Libraries/Search. -* linking, predefined rule for: Catalogue of Rules. -* lint: Catalogue of Rules. -* list of all dependencies: Automatic. -* list of changed dependencies: Automatic. -* load average: Parallel. -* loops in variable expansion: Flavors. -* m2c: Catalogue of Rules. -* macro: Using Variables. -* makefile: Introduction. -* makefile name: Makefile Names. -* makefile name, how to specify: Makefile Names. -* makefile rule parts: Rule Introduction. -* makefile, and MAKEFILES variable: MAKEFILES Variable. -* makefile, conventions for: Makefile Conventions. -* makefile, how make processes: How Make Works. -* makefile, how to write: Makefiles. -* makefile, including: Include. -* makefile, overriding: Overriding Makefiles. -* makefile, remaking of: Remaking Makefiles. -* makefile, simple: Simple Makefile. -* makeinfo: Catalogue of Rules. -* makeinfo: Implicit Variables. -* match-anything rule: Match-Anything Rules. -* match-anything rule, used to override: Overriding Makefiles. -* missing features: Missing. -* mistakes with wildcards: Wildcard Pitfall. -* modified variable reference: Substitution Refs. -* Modula-2, rule to compile: Catalogue of Rules. -* multiple rules for one target: Multiple Rules. -* multiple rules for one target (::): Double-Colon. -* multiple targets: Multiple Targets. -* multiple targets, in pattern rule: Pattern Intro. -* name of makefile: Makefile Names. -* name of makefile, how to specify: Makefile Names. -* nested variable reference: Computed Names. -* newline, quoting, in commands: Execution. -* newline, quoting, in makefile: Simple Makefile. -* nondirectory part: Filename Functions. -* old-fashioned suffix rules: Suffix Rules. -* options: Options Summary. -* options, and recursion: Options/Recursion. -* options, setting from environment: Options/Recursion. -* options, setting in makefiles: Options/Recursion. -* order of pattern rules: Pattern Intro. -* origin of variable: Origin Function. -* overriding makefiles: Overriding Makefiles. -* overriding variables with arguments: Overriding. -* overriding with override: Override Directive. -* parallel execution: Parallel. -* parallel execution, and archive update: Archive Pitfalls. -* parts of makefile rule: Rule Introduction. -* Pascal, rule to compile: Catalogue of Rules. -* pattern rule: Pattern Intro. -* pattern rules, order of: Pattern Intro. -* pattern rules, static (not implicit): Static Pattern. -* pattern rules, static, syntax of: Static Usage. -* pc: Implicit Variables. -* pc: Catalogue of Rules. -* phony targets: Phony Targets. -* pitfalls of wildcards: Wildcard Pitfall. -* portability: Features. -* POSIX: Overview. -* POSIX.2: Options/Recursion. -* precious targets: Special Targets. -* prefix, adding: Filename Functions. -* preserving intermediate files: Chained Rules. -* preserving with .PRECIOUS: Chained Rules. -* preserving with .PRECIOUS: Special Targets. -* printing directories: -w Option. -* printing of commands: Echoing. -* problems and bugs, reporting: Bugs. -* problems with wildcards: Wildcard Pitfall. -* processing a makefile: How Make Works. -* question mode: Instead of Execution. -* quoting %, in patsubst: Text Functions. -* quoting %, in vpath: Selective Search. -* quoting %, in static pattern: Static Usage. -* quoting newline, in commands: Execution. -* quoting newline, in makefile: Simple Makefile. -* Ratfor, rule to compile: Catalogue of Rules. -* RCS, rule to extract from: Catalogue of Rules. -* recompilation: Introduction. -* recompilation, avoiding: Avoiding Compilation. -* recording events with empty targets: Empty Targets. -* recursion: Recursion. -* recursion, and -C: Options/Recursion. -* recursion, and -f: Options/Recursion. -* recursion, and -j: Options/Recursion. -* recursion, and -o: Options/Recursion. -* recursion, and -t: MAKE Variable. -* recursion, and -W: Options/Recursion. -* recursion, and -w: -w Option. -* recursion, and MAKEFILES variable: MAKEFILES Variable. -* recursion, and MAKE variable: MAKE Variable. -* recursion, and command line variable definitions: Options/Recursion. -* recursion, and environment: Variables/Recursion. -* recursion, and options: Options/Recursion. -* recursion, and printing directories: -w Option. -* recursion, and variables: Variables/Recursion. -* recursion, level of: Variables/Recursion. -* recursive variable expansion: Using Variables. -* recursive variable expansion: Flavors. -* recursively expanded variables: Flavors. -* reference to variables: Reference. -* reference to variables: Advanced. -* relinking: How Make Works. -* remaking makefiles: Remaking Makefiles. -* removal of target files: Errors. -* removal of target files: Interrupts. -* removing duplicate words: Text Functions. -* removing, to clean up: Cleanup. -* reporting bugs: Bugs. -* rm: Implicit Variables. -* rule commands: Commands. -* rule dependencies: Rule Syntax. -* rule syntax: Rule Syntax. -* rule targets: Rule Syntax. -* rule, and $: Rule Syntax. -* rule, double-colon (::): Double-Colon. -* rule, explicit, definition of: Makefile Contents. -* rule, how to write: Rules. -* rule, implicit: Implicit Rules. -* rule, implicit, and VPATH: Implicit/Search. -* rule, implicit, and directory search: Implicit/Search. -* rule, implicit, chains of: Chained Rules. -* rule, implicit, definition of: Makefile Contents. -* rule, implicit, how to use: Using Implicit. -* rule, implicit, introduction to: make Deduces. -* rule, implicit, predefined: Catalogue of Rules. -* rule, introduction to: Rule Introduction. -* rule, multiple for one target: Multiple Rules. -* rule, no commands or dependencies: Force Targets. -* rule, pattern: Pattern Intro. -* rule, static pattern: Static Pattern. -* rule, static pattern versus implicit: Static versus Implicit. -* rule, with multiple targets: Multiple Targets. -* s. (SCCS file prefix): Catalogue of Rules. -* SCCS, rule to extract from: Catalogue of Rules. -* search algorithm, implicit rule: Search Algorithm. -* search path for dependencies (VPATH): Directory Search. -* search path for dependencies (VPATH), and implicit rules: Implicit/Search. -* search path for dependencies (VPATH), and link libraries: Libraries/Search. -* searching for strings: Text Functions. -* selecting words: Filename Functions. -* sequences of commands: Sequences. -* setting options from environment: Options/Recursion. -* setting options in makefiles: Options/Recursion. -* setting variables: Setting. -* several rules for one target: Multiple Rules. -* several targets in a rule: Multiple Targets. -* shell command: Simple Makefile. -* shell command, and directory search: Commands/Search. -* shell command, execution: Execution. -* shell command, function for: Shell Function. -* shell file name pattern (in include): Include. -* shell wildcards (in include): Include. -* signal: Interrupts. -* silent operation: Echoing. -* simple makefile: Simple Makefile. -* simple variable expansion: Using Variables. -* simplifying with variables: Variables Simplify. -* simply expanded variables: Flavors. -* sorting words: Text Functions. -* spaces, in variable values: Flavors. -* spaces, stripping: Text Functions. -* special targets: Special Targets. -* specifying makefile name: Makefile Names. -* standard input: Parallel. -* standards conformance: Overview. -* standards for makefiles: Makefile Conventions. -* static pattern rule: Static Pattern. -* static pattern rule, syntax of: Static Usage. -* static pattern rule, versus implicit: Static versus Implicit. -* stem: Pattern Match. -* stem: Static Usage. -* stem, variable for: Automatic. -* strings, searching for: Text Functions. -* stripping whitespace: Text Functions. -* sub-make: Variables/Recursion. -* subdirectories, recursion for: Recursion. -* substitution variable reference: Substitution Refs. -* suffix rule: Suffix Rules. -* suffix rule, for archive: Archive Suffix Rules. -* suffix, adding: Filename Functions. -* suffix, function to find: Filename Functions. -* suffix, substituting in variables: Substitution Refs. -* switches: Options Summary. -* symbol directories, updating archive: Archive Symbols. -* syntax of rules: Rule Syntax. -* tab character (in commands): Rule Syntax. -* tabs in rules: Rule Introduction. -* tangle: Implicit Variables. -* tangle: Catalogue of Rules. -* target: Rules. -* target pattern, implicit: Pattern Intro. -* target pattern, static (not implicit): Static Usage. -* target, deleting on error: Errors. -* target, deleting on interrupt: Interrupts. -* target, multiple in pattern rule: Pattern Intro. -* target, multiple rules for one: Multiple Rules. -* target, touching: Instead of Execution. -* targets: Rule Syntax. -* targets without a file: Phony Targets. -* targets, built-in special: Special Targets. -* targets, empty: Empty Targets. -* targets, force: Force Targets. -* targets, introduction to: Rule Introduction. -* targets, multiple: Multiple Targets. -* targets, phony: Phony Targets. -* terminal rule: Match-Anything Rules. -* testing compilation: Testing. -* tex: Catalogue of Rules. -* tex: Implicit Variables. -* texi2dvi: Catalogue of Rules. -* texi2dvi: Implicit Variables. -* Texinfo, rule to format: Catalogue of Rules. -* tilde (~): Wildcards. -* touching files: Instead of Execution. -* undefined variables, warning message: Options Summary. -* updating archive symbol directories: Archive Symbols. -* updating makefiles: Remaking Makefiles. -* value: Using Variables. -* value, how a variable gets it: Values. -* variable: Using Variables. -* variable definition: Makefile Contents. -* variables: Variables Simplify. -* variables, $ in name: Computed Names. -* variables, and implicit rule: Automatic. -* variables, appending to: Appending. -* variables, automatic: Automatic. -* variables, command line: Overriding. -* variables, command line, and recursion: Options/Recursion. -* variables, computed names: Computed Names. -* variables, defining verbatim: Defining. -* variables, environment: Variables/Recursion. -* variables, environment: Environment. -* variables, exporting: Variables/Recursion. -* variables, flavors: Flavors. -* variables, how they get their values: Values. -* variables, how to reference: Reference. -* variables, loops in expansion: Flavors. -* variables, modified reference: Substitution Refs. -* variables, nested references: Computed Names. -* variables, origin of: Origin Function. -* variables, overriding: Override Directive. -* variables, overriding with arguments: Overriding. -* variables, recursively expanded: Flavors. -* variables, setting: Setting. -* variables, simply expanded: Flavors. -* variables, spaces in values: Flavors. -* variables, substituting suffix in: Substitution Refs. -* variables, substitution reference: Substitution Refs. -* variables, warning for undefined: Options Summary. -* varying dependencies: Static Pattern. -* verbatim variable definition: Defining. -* vpath: Directory Search. -* weave: Catalogue of Rules. -* weave: Implicit Variables. -* Web, rule to run: Catalogue of Rules. -* what if: Instead of Execution. -* whitespace, in variable values: Flavors. -* whitespace, stripping: Text Functions. -* wildcard: Wildcards. -* wildcard pitfalls: Wildcard Pitfall. -* wildcard, function: Filename Functions. -* wildcard, in include: Include. -* wildcard, in archive member: Archive Members. -* words, extracting first: Filename Functions. -* words, filtering: Text Functions. -* words, filtering out: Text Functions. -* words, finding number: Filename Functions. -* words, iterating over: Foreach Function. -* words, joining lists: Filename Functions. -* words, removing duplicates: Text Functions. -* words, selecting: Filename Functions. -* writing rule commands: Commands. -* writing rules: Rules. -* yacc: Implicit Variables. -* yacc: Catalogue of Rules. -* Yacc, rule to run: Catalogue of Rules. - - -File: make.info, Node: Name Index, Prev: Concept Index, Up: Top - -Index of Functions, Variables, & Directives -******************************************* - -* Menu: - -* $%: Automatic. -* $(%D): Automatic. -* $(%F): Automatic. -* $(*D): Automatic. -* $(*F): Automatic. -* $( foo - -%: force - @@$(MAKE) -f Makefile $@@ -force: ; -@end example - -If you say @samp{make foo}, @code{make} will find @file{GNUmakefile}, -read it, and see that to make @file{foo}, it needs to run the command -@samp{frobnicate > foo}. If you say @samp{make bar}, @code{make} will -find no way to make @file{bar} in @file{GNUmakefile}, so it will use the -commands from the pattern rule: @samp{make -f Makefile bar}. If -@file{Makefile} provides a rule for updating @file{bar}, @code{make} -will apply the rule. And likewise for any other target that -@file{GNUmakefile} does not say how to make. - -The way this works is that the pattern rule has a pattern of just -@samp{%}, so it matches any target whatever. The rule specifies a -dependency @file{force}, to guarantee that the commands will be run even -if the target file already exists. We give @file{force} target empty -commands to prevent @code{make} from searching for an implicit rule to -build it---otherwise it would apply the same match-anything rule to -@file{force} itself and create a dependency loop! - -@node Rules, Commands, Makefiles, Top -@chapter Writing Rules -@cindex writing rules -@cindex rule, how to write -@cindex target -@cindex dependency - -A @dfn{rule} appears in the makefile and says when and how to remake -certain files, called the rule's @dfn{targets} (most often only one per rule). -It lists the other files that are the @dfn{dependencies} of the target, and -@dfn{commands} to use to create or update the target. - -@cindex default goal -@cindex goal, default -The order of rules is not significant, except for determining the -@dfn{default goal}: the target for @code{make} to consider, if you do -not otherwise specify one. The default goal is the target of the first -rule in the first makefile. If the first rule has multiple targets, -only the first target is taken as the default. There are two -exceptions: a target starting with a period is not a default unless it -contains one or more slashes, @samp{/}, as well; and, a target that -defines a pattern rule has no effect on the default goal. -(@xref{Pattern Rules, ,Defining and Redefining Pattern Rules}.) - -Therefore, we usually write the makefile so that the first rule is the -one for compiling the entire program or all the programs described by -the makefile (often with a target called @samp{all}). -@xref{Goals, ,Arguments to Specify the Goals}. - -@menu -* Rule Example:: An example explained. -* Rule Syntax:: General syntax explained. -* Wildcards:: Using wildcard characters such as `*'. -* Directory Search:: Searching other directories for source files. -* Phony Targets:: Using a target that is not a real file's name. -* Force Targets:: You can use a target without commands - or dependencies to mark other - targets as phony. -* Empty Targets:: When only the date matters and the - files are empty. -* Special Targets:: Targets with special built-in meanings. -* Multiple Targets:: When to make use of several targets in a rule. -* Multiple Rules:: How to use several rules with the same target. -* Static Pattern:: Static pattern rules apply to multiple targets - and can vary the dependencies according to - the target name. -* Double-Colon:: How to use a special kind of rule to allow - several independent rules for one target. -* Automatic Dependencies:: How to automatically generate rules giving - dependencies from the source files themselves. -@end menu - -@ifinfo -@node Rule Example, Rule Syntax, , Rules -@section Rule Example - -Here is an example of a rule: - -@example -foo.o : foo.c defs.h # module for twiddling the frobs - cc -c -g foo.c -@end example - -Its target is @file{foo.o} and its dependencies are @file{foo.c} and -@file{defs.h}. It has one command, which is @samp{cc -c -g foo.c}. -The command line starts with a tab to identify it as a command. - -This rule says two things: - -@itemize @bullet -@item -How to decide whether @file{foo.o} is out of date: it is out of date -if it does not exist, or if either @file{foo.c} or @file{defs.h} is -more recent than it. - -@item -How to update the file @file{foo.o}: by running @code{cc} as stated. -The command does not explicitly mention @file{defs.h}, but we presume -that @file{foo.c} includes it, and that that is why @file{defs.h} was -added to the dependencies. -@end itemize -@end ifinfo - -@node Rule Syntax, Wildcards, Rule Example, Rules -@section Rule Syntax - -@cindex rule syntax -@cindex syntax of rules -In general, a rule looks like this: - -@example -@var{targets} : @var{dependencies} - @var{command} - @dots{} -@end example - -@noindent -or like this: - -@example -@var{targets} : @var{dependencies} ; @var{command} - @var{command} - @dots{} -@end example - -@cindex targets -@cindex rule targets -The @var{targets} are file names, separated by spaces. Wildcard -characters may be used (@pxref{Wildcards, ,Using Wildcard Characters -in File Names}) and a name of the form @file{@var{a}(@var{m})} -represents member @var{m} in archive file @var{a} -(@pxref{Archive Members, ,Archive Members as Targets}). -Usually there is only one -target per rule, but occasionally there is a reason to have more -(@pxref{Multiple Targets, , Multiple Targets in a Rule}).@refill - -@cindex commands -@cindex tab character (in commands) -The @var{command} lines start with a tab character. The first command may -appear on the line after the dependencies, with a tab character, or may -appear on the same line, with a semicolon. Either way, the effect is the -same. @xref{Commands, ,Writing the Commands in Rules}. - -@cindex dollar sign (@code{$}), in rules -@cindex @code{$}, in rules -@cindex rule, and @code{$} -Because dollar signs are used to start variable references, if you really -want a dollar sign in a rule you must write two of them, @samp{$$} -(@pxref{Using Variables, ,How to Use Variables}). -You may split a long line by inserting a backslash -followed by a newline, but this is not required, as @code{make} places no -limit on the length of a line in a makefile. - -A rule tells @code{make} two things: when the targets are out of date, -and how to update them when necessary. - -@cindex dependencies -@cindex rule dependencies -The criterion for being out of date is specified in terms of the -@var{dependencies}, which consist of file names separated by spaces. -(Wildcards and archive members (@pxref{Archives}) are allowed here too.) -A target is out of date if it does not exist or if it is older than any -of the dependencies (by comparison of last-modification times). The -idea is that the contents of the target file are computed based on -information in the dependencies, so if any of the dependencies changes, -the contents of the existing target file are no longer necessarily -valid. - -How to update is specified by @var{commands}. These are lines to be -executed by the shell (normally @samp{sh}), but with some extra features -(@pxref{Commands, ,Writing the Commands in Rules}). - -@node Wildcards, Directory Search, Rule Syntax, Rules -@section Using Wildcard Characters in File Names -@cindex wildcard -@cindex file name with wildcards -@cindex globbing (wildcards) - -@cindex @code{*} (wildcard character) -@cindex @code{?} (wildcard character) -@cindex @code{[@dots{}]} (wildcard characters) -A single file name can specify many files using @dfn{wildcard characters}. -The wildcard characters in @code{make} are @samp{*}, @samp{?} and -@samp{[@dots{}]}, the same as in the Bourne shell. For example, @file{*.c} -specifies a list of all the files (in the working directory) whose names -end in @samp{.c}.@refill - -@cindex @code{~} (tilde) -@cindex tilde (@code{~}) -@cindex home directory -The character @samp{~} at the beginning of a file name also has special -significance. If alone, or followed by a slash, it represents your home -directory. For example @file{~/bin} expands to @file{/home/you/bin}. -If the @samp{~} is followed by a word, the string represents the home -directory of the user named by that word. For example @file{~john/bin} -expands to @file{/home/john/bin}.@refill - -Wildcard expansion happens automatically in targets, in dependencies, -and in commands (where the shell does the expansion). In other -contexts, wildcard expansion happens only if you request it explicitly -with the @code{wildcard} function. - -The special significance of a wildcard character can be turned off by -preceding it with a backslash. Thus, @file{foo\*bar} would refer to a -specific file whose name consists of @samp{foo}, an asterisk, and -@samp{bar}.@refill - -@menu -* Wildcard Examples:: Several examples -* Wildcard Pitfall:: Problems to avoid. -* Wildcard Function:: How to cause wildcard expansion where - it does not normally take place. -@end menu - -@node Wildcard Examples, Wildcard Pitfall, , Wildcards -@subsection Wildcard Examples - -Wildcards can be used in the commands of a rule, where they are expanded -by the shell. For example, here is a rule to delete all the object files: - -@example -@group -clean: - rm -f *.o -@end group -@end example -@cindex @code{rm} (shell command) - -Wildcards are also useful in the dependencies of a rule. With the -following rule in the makefile, @samp{make print} will print all the -@samp{.c} files that have changed since the last time you printed them: - -@example -print: *.c - lpr -p $? - touch print -@end example - -@cindex @code{print} target -@cindex @code{lpr} (shell command) -@cindex @code{touch} (shell command) -@noindent -This rule uses @file{print} as an empty target file; see @ref{Empty -Targets, ,Empty Target Files to Record Events}. (The automatic variable -@samp{$?} is used to print only those files that have changed; see -@ref{Automatic, ,Automatic Variables}.)@refill - -Wildcard expansion does not happen when you define a variable. Thus, if -you write this: - -@example -objects = *.o -@end example - -@noindent -then the value of the variable @code{objects} is the actual string -@samp{*.o}. However, if you use the value of @code{objects} in a target, -dependency or command, wildcard expansion will take place at that time. -To set @code{objects} to the expansion, instead use: - -@example -objects := $(wildcard *.o) -@end example - -@noindent -@xref{Wildcard Function}. - -@node Wildcard Pitfall, Wildcard Function, Wildcard Examples, Wildcards -@subsection Pitfalls of Using Wildcards -@cindex wildcard pitfalls -@cindex pitfalls of wildcards -@cindex mistakes with wildcards -@cindex errors with wildcards -@cindex problems with wildcards - -Now here is an example of a naive way of using wildcard expansion, that -does not do what you would intend. Suppose you would like to say that the -executable file @file{foo} is made from all the object files in the -directory, and you write this: - -@example -objects = *.o - -foo : $(objects) - cc -o foo $(CFLAGS) $(objects) -@end example - -@noindent -The value of @code{objects} is the actual string @samp{*.o}. Wildcard -expansion happens in the rule for @file{foo}, so that each @emph{existing} -@samp{.o} file becomes a dependency of @file{foo} and will be recompiled if -necessary. - -But what if you delete all the @samp{.o} files? When a wildcard matches -no files, it is left as it is, so then @file{foo} will depend on the -oddly-named file @file{*.o}. Since no such file is likely to exist, -@code{make} will give you an error saying it cannot figure out how to -make @file{*.o}. This is not what you want! - -Actually it is possible to obtain the desired result with wildcard -expansion, but you need more sophisticated techniques, including the -@code{wildcard} function and string substitution. -@ifinfo -@xref{Wildcard Function, ,The Function @code{wildcard}}. -@end ifinfo -@iftex -These are described in the following section. -@end iftex - -@node Wildcard Function, , Wildcard Pitfall, Wildcards -@subsection The Function @code{wildcard} -@findex wildcard - -Wildcard expansion happens automatically in rules. But wildcard expansion -does not normally take place when a variable is set, or inside the -arguments of a function. If you want to do wildcard expansion in such -places, you need to use the @code{wildcard} function, like this: - -@example -$(wildcard @var{pattern}@dots{}) -@end example - -@noindent -This string, used anywhere in a makefile, is replaced by a -space-separated list of names of existing files that match one of the -given file name patterns. If no existing file name matches a pattern, -then that pattern is omitted from the output of the @code{wildcard} -function. Note that this is different from how unmatched wildcards -behave in rules, where they are used verbatim rather than ignored -(@pxref{Wildcard Pitfall}). - -One use of the @code{wildcard} function is to get a list of all the C source -files in a directory, like this: - -@example -$(wildcard *.c) -@end example - -We can change the list of C source files into a list of object files by -replacing the @samp{.o} suffix with @samp{.c} in the result, like this: - -@example -$(patsubst %.c,%.o,$(wildcard *.c)) -@end example - -@noindent -(Here we have used another function, @code{patsubst}. -@xref{Text Functions, ,Functions for String Substitution and Analysis}.)@refill - -Thus, a makefile to compile all C source files in the directory and then -link them together could be written as follows: - -@example -objects := $(patsubst %.c,%.o,$(wildcard *.c)) - -foo : $(objects) - cc -o foo $(objects) -@end example - -@noindent -(This takes advantage of the implicit rule for compiling C programs, so -there is no need to write explicit rules for compiling the files. -@xref{Flavors, ,The Two Flavors of Variables}, for an explanation of -@samp{:=}, which is a variant of @samp{=}.) - -@node Directory Search, Phony Targets, Wildcards, Rules -@section Searching Directories for Dependencies -@vindex VPATH -@findex vpath -@cindex vpath -@cindex search path for dependencies (@code{VPATH}) -@cindex directory search (@code{VPATH}) - -For large systems, it is often desirable to put sources in a separate -directory from the binaries. The @dfn{directory search} features of -@code{make} facilitate this by searching several directories -automatically to find a dependency. When you redistribute the files -among directories, you do not need to change the individual rules, -just the search paths. - -@menu -* General Search:: Specifying a search path that applies - to every dependency. -* Selective Search:: Specifying a search path - for a specified class of names. -* Commands/Search:: How to write shell commands that work together - with search paths. -* Implicit/Search:: How search paths affect implicit rules. -* Libraries/Search:: Directory search for link libraries. -@end menu - -@node General Search, Selective Search, , Directory Search -@subsection @code{VPATH}: Search Path for All Dependencies -@vindex VPATH - -The value of the @code{make} variable @code{VPATH} specifies a list of -directories that @code{make} should search. Most often, the -directories are expected to contain dependency files that are not in the -current directory; however, @code{VPATH} specifies a search list that -@code{make} applies for all files, including files which are targets of -rules. - -Thus, if a file that is listed as a target or dependency does not exist -in the current directory, @code{make} searches the directories listed in -@code{VPATH} for a file with that name. If a file is found in one of -them, that file becomes the dependency. Rules may then specify the -names of source files in the dependencies as if they all existed in the -current directory. @xref{Commands/Search, ,Writing Shell Commands with -Directory Search}. - -In the @code{VPATH} variable, directory names are separated by colons or -blanks. The order in which directories are listed is the order followed -by @code{make} in its search. - -For example, - -@example -VPATH = src:../headers -@end example - -@noindent -specifies a path containing two directories, @file{src} and -@file{../headers}, which @code{make} searches in that order. - -With this value of @code{VPATH}, the following rule, - -@example -foo.o : foo.c -@end example - -@noindent -is interpreted as if it were written like this: - -@example -foo.o : src/foo.c -@end example - -@noindent -assuming the file @file{foo.c} does not exist in the current directory but -is found in the directory @file{src}. - -@node Selective Search, Commands/Search, General Search, Directory Search -@subsection The @code{vpath} Directive -@findex vpath - -Similar to the @code{VPATH} variable but more selective is the @code{vpath} -directive (note lower case), which allows you to specify a search path for a particular class -of file names, those that match a particular pattern. Thus you can supply -certain search directories for one class of file names and other directories -(or none) for other file names. - -There are three forms of the @code{vpath} directive: - -@table @code -@item vpath @var{pattern} @var{directories} -Specify the search path @var{directories} for file names that match -@var{pattern}. - -The search path, @var{directories}, is a list of directories to be -searched, separated by colons or blanks, just like the search path used -in the @code{VPATH} variable. - -@item vpath @var{pattern} -Clear out the search path associated with @var{pattern}. - -@c Extra blank line makes sure this gets two lines. -@item vpath - -Clear all search paths previously specified with @code{vpath} directives. -@end table - -A @code{vpath} pattern is a string containing a @samp{%} character. The -string must match the file name of a dependency that is being searched -for, the @samp{%} character matching any sequence of zero or more -characters (as in pattern rules; @pxref{Pattern Rules, ,Defining and -Redefining Pattern Rules}). For example, @code{%.h} matches files that -end in @code{.h}. (If there is no @samp{%}, the pattern must match the -dependency exactly, which is not useful very often.) - -@cindex @code{%}, quoting in @code{vpath} -@cindex @code{%}, quoting with @code{\} (backslash) -@cindex @code{\} (backslash), to quote @code{%} -@cindex backslash (@code{\}), to quote @code{%} -@cindex quoting @code{%}, in @code{vpath} -@samp{%} characters in a @code{vpath} directive's pattern can be quoted -with preceding backslashes (@samp{\}). Backslashes that would otherwise -quote @samp{%} characters can be quoted with more backslashes. -Backslashes that quote @samp{%} characters or other backslashes are -removed from the pattern before it is compared to file names. Backslashes -that are not in danger of quoting @samp{%} characters go unmolested.@refill - -When a dependency fails to exist in the current directory, if the -@var{pattern} in a @code{vpath} directive matches the name of the -dependency file, then the @var{directories} in that directive are searched -just like (and before) the directories in the @code{VPATH} variable. - -For example, - -@example -vpath %.h ../headers -@end example - -@noindent -tells @code{make} to look for any dependency whose name ends in @file{.h} -in the directory @file{../headers} if the file is not found in the current -directory. - -If several @code{vpath} patterns match the dependency file's name, then -@code{make} processes each matching @code{vpath} directive one by one, -searching all the directories mentioned in each directive. @code{make} -handles multiple @code{vpath} directives in the order in which they -appear in the makefile; multiple directives with the same pattern are -independent of each other. - -@need 750 -Thus, - -@example -@group -vpath %.c foo -vpath % blish -vpath %.c bar -@end group -@end example - -@noindent -will look for a file ending in @samp{.c} in @file{foo}, then -@file{blish}, then @file{bar}, while - -@example -@group -vpath %.c foo:bar -vpath % blish -@end group -@end example - -@noindent -will look for a file ending in @samp{.c} in @file{foo}, then -@file{bar}, then @file{blish}. - -@node Commands/Search, Implicit/Search, Selective Search, Directory Search -@subsection Writing Shell Commands with Directory Search -@cindex shell command, and directory search -@cindex directory search (@code{VPATH}), and shell commands - -When a dependency is found in another directory through directory search, -this cannot change the commands of the rule; they will execute as written. -Therefore, you must write the commands with care so that they will look for -the dependency in the directory where @code{make} finds it. - -This is done with the @dfn{automatic variables} such as @samp{$^} -(@pxref{Automatic, ,Automatic Variables}). -For instance, the value of @samp{$^} is a -list of all the dependencies of the rule, including the names of -the directories in which they were found, and the value of -@samp{$@@} is the target. Thus:@refill - -@example -foo.o : foo.c - cc -c $(CFLAGS) $^ -o $@@ -@end example - -@noindent -(The variable @code{CFLAGS} exists so you can specify flags for C -compilation by implicit rules; we use it here for consistency so it will -affect all C compilations uniformly; -@pxref{Implicit Variables, ,Variables Used by Implicit Rules}.) - -Often the dependencies include header files as well, which you do not -want to mention in the commands. The automatic variable @samp{$<} is -just the first dependency: - -@example -VPATH = src:../headers -foo.o : foo.c defs.h hack.h - cc -c $(CFLAGS) $< -o $@@ -@end example - -@node Implicit/Search, Libraries/Search, Commands/Search, Directory Search -@subsection Directory Search and Implicit Rules -@cindex @code{VPATH}, and implicit rules -@cindex directory search (@code{VPATH}), and implicit rules -@cindex search path for dependencies (@code{VPATH}), and implicit rules -@cindex implicit rule, and directory search -@cindex implicit rule, and @code{VPATH} -@cindex rule, implicit, and directory search -@cindex rule, implicit, and @code{VPATH} - -The search through the directories specified in @code{VPATH} or with -@code{vpath} also happens during consideration of implicit rules -(@pxref{Implicit Rules, ,Using Implicit Rules}). - -For example, when a file @file{foo.o} has no explicit rule, @code{make} -considers implicit rules, such as the built-in rule to compile -@file{foo.c} if that file exists. If such a file is lacking in the -current directory, the appropriate directories are searched for it. If -@file{foo.c} exists (or is mentioned in the makefile) in any of the -directories, the implicit rule for C compilation is applied. - -The commands of implicit rules normally use automatic variables as a -matter of necessity; consequently they will use the file names found by -directory search with no extra effort. - -@node Libraries/Search, , Implicit/Search, Directory Search -@subsection Directory Search for Link Libraries -@cindex link libraries, and directory search -@cindex libraries for linking, directory search -@cindex directory search (@code{VPATH}), and link libraries -@cindex @code{VPATH}, and link libraries -@cindex search path for dependencies (@code{VPATH}), and link libraries -@cindex @code{-l} (library search) - -Directory search applies in a special way to libraries used with the -linker. This special feature comes into play when you write a dependency -whose name is of the form @samp{-l@var{name}}. (You can tell something -strange is going on here because the dependency is normally the name of a -file, and the @emph{file name} of the library looks like -@file{lib@var{name}.a}, not like @samp{-l@var{name}}.)@refill - -When a dependency's name has the form @samp{-l@var{name}}, @code{make} -handles it specially by searching for the file @file{lib@var{name}.a} in -the current directory, in directories specified by matching @code{vpath} -search paths and the @code{VPATH} search path, and then in the -directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib} -(normally @file{/usr/local/lib}). - -For example, - -@example -@group -foo : foo.c -lcurses - cc $^ -o $@@ -@end group -@end example - -@noindent -would cause the command @samp{cc foo.c /usr/lib/libcurses.a -o foo} to -be executed when @file{foo} is older than @file{foo.c} or than -@file{/usr/lib/libcurses.a}.@refill - -@node Phony Targets, Force Targets, Directory Search, Rules -@section Phony Targets -@cindex phony targets -@cindex targets, phony -@cindex targets without a file - -A phony target is one that is not really the name of a file. It is just a -name for some commands to be executed when you make an explicit request. -There are two reasons to use a phony target: to avoid a conflict with -a file of the same name, and to improve performance. - -If you write a rule whose commands will not create the target file, the -commands will be executed every time the target comes up for remaking. -Here is an example: - -@example -@group -clean: - rm *.o temp -@end group -@end example - -@noindent -Because the @code{rm} command does not create a file named @file{clean}, -probably no such file will ever exist. Therefore, the @code{rm} command -will be executed every time you say @samp{make clean}. -@cindex @code{rm} (shell command) - -@findex .PHONY -The phony target will cease to work if anything ever does create a file -named @file{clean} in this directory. Since it has no dependencies, the -file @file{clean} would inevitably be considered up to date, and its -commands would not be executed. To avoid this problem, you can explicitly -declare the target to be phony, using the special target @code{.PHONY} -(@pxref{Special Targets, ,Special Built-in Target Names}) as follows: - -@example -.PHONY : clean -@end example - -@noindent -Once this is done, @samp{make clean} will run the commands regardless of -whether there is a file named @file{clean}. - -Since it knows that phony targets do not name actual files that could be -remade from other files, @code{make} skips the implicit rule search for -phony targets (@pxref{Implicit Rules}). This is why declaring a target -phony is good for performance, even if you are not worried about the -actual file existing. - -Thus, you first write the line that states that @code{clean} is a -phony target, then you write the rule, like this: - -@example -@group -.PHONY: clean -clean: - rm *.o temp -@end group -@end example - -A phony target should not be a dependency of a real target file; if it -is, its commands are run every time @code{make} goes to update that -file. As long as a phony target is never a dependency of a real -target, the phony target commands will be executed only when the phony -target is a specified goal (@pxref{Goals, ,Arguments to Specify the -Goals}). - -Phony targets can have dependencies. When one directory contains multiple -programs, it is most convenient to describe all of the programs in one -makefile @file{./Makefile}. Since the target remade by default will be the -first one in the makefile, it is common to make this a phony target named -@samp{all} and give it, as dependencies, all the individual programs. For -example: - -@example -all : prog1 prog2 prog3 -.PHONY : all - -prog1 : prog1.o utils.o - cc -o prog1 prog1.o utils.o - -prog2 : prog2.o - cc -o prog2 prog2.o - -prog3 : prog3.o sort.o utils.o - cc -o prog3 prog3.o sort.o utils.o -@end example - -@noindent -Now you can say just @samp{make} to remake all three programs, or specify -as arguments the ones to remake (as in @samp{make prog1 prog3}). - -When one phony target is a dependency of another, it serves as a subroutine -of the other. For example, here @samp{make cleanall} will delete the -object files, the difference files, and the file @file{program}: - -@example -.PHONY: cleanall cleanobj cleandiff - -cleanall : cleanobj cleandiff - rm program - -cleanobj : - rm *.o - -cleandiff : - rm *.diff -@end example - -@node Force Targets, Empty Targets, Phony Targets, Rules -@section Rules without Commands or Dependencies -@cindex force targets -@cindex targets, force -@cindex @code{FORCE} -@cindex rule, no commands or dependencies - -If a rule has no dependencies or commands, and the target of the rule -is a nonexistent file, then @code{make} imagines this target to have -been updated whenever its rule is run. This implies that all targets -depending on this one will always have their commands run. - -An example will illustrate this: - -@example -@group -clean: FORCE - rm $(objects) -FORCE: -@end group -@end example - -Here the target @samp{FORCE} satisfies the special conditions, so the -target @file{clean} that depends on it is forced to run its commands. -There is nothing special about the name @samp{FORCE}, but that is one name -commonly used this way. - -As you can see, using @samp{FORCE} this way has the same results as using -@samp{.PHONY: clean}. - -Using @samp{.PHONY} is more explicit and more efficient. However, -other versions of @code{make} do not support @samp{.PHONY}; thus -@samp{FORCE} appears in many makefiles. @xref{Phony Targets}. - -@node Empty Targets, Special Targets, Force Targets, Rules -@section Empty Target Files to Record Events -@cindex empty targets -@cindex targets, empty -@cindex recording events with empty targets - -The @dfn{empty target} is a variant of the phony target; it is used to hold -commands for an action that you request explicitly from time to time. -Unlike a phony target, this target file can really exist; but the file's -contents do not matter, and usually are empty. - -The purpose of the empty target file is to record, with its -last-modification time, when the rule's commands were last executed. It -does so because one of the commands is a @code{touch} command to update the -target file. - -The empty target file must have some dependencies. When you ask to remake -the empty target, the commands are executed if any dependency is more -recent than the target; in other words, if a dependency has changed since -the last time you remade the target. Here is an example: - -@example -print: foo.c bar.c - lpr -p $? - touch print -@end example -@cindex @code{print} target -@cindex @code{lpr} (shell command) -@cindex @code{touch} (shell command) - -@noindent -With this rule, @samp{make print} will execute the @code{lpr} command if -either source file has changed since the last @samp{make print}. The -automatic variable @samp{$?} is used to print only those files that have -changed (@pxref{Automatic, ,Automatic Variables}). - -@node Special Targets, Multiple Targets, Empty Targets, Rules -@section Special Built-in Target Names -@cindex special targets -@cindex built-in special targets -@cindex targets, built-in special - -Certain names have special meanings if they appear as targets. - -@table @code -@findex .PHONY -@item .PHONY - -The dependencies of the special target @code{.PHONY} are considered to -be phony targets. When it is time to consider such a target, -@code{make} will run its commands unconditionally, regardless of -whether a file with that name exists or what its last-modification -time is. @xref{Phony Targets, ,Phony Targets}. - -@findex .SUFFIXES -@item .SUFFIXES - -The dependencies of the special target @code{.SUFFIXES} are the list -of suffixes to be used in checking for suffix rules. -@xref{Suffix Rules, , Old-Fashioned Suffix Rules}. - -@findex .DEFAULT -@item .DEFAULT - -The commands specified for @code{.DEFAULT} are used for any target for -which no rules are found (either explicit rules or implicit rules). -@xref{Last Resort}. If @code{.DEFAULT} commands are specified, every -file mentioned as a dependency, but not as a target in a rule, will have -these commands executed on its behalf. @xref{Search Algorithm, -,Implicit Rule Search Algorithm}. - -@findex .PRECIOUS -@item .PRECIOUS -@cindex precious targets -@cindex preserving with @code{.PRECIOUS} - -The targets which @code{.PRECIOUS} depends on are given the following -special treatment: if @code{make} is killed or interrupted during the -execution of their commands, the target is not deleted. -@xref{Interrupts, ,Interrupting or Killing @code{make}}. -Also, if the target is an intermediate file, it will not be deleted -after it is no longer needed, as is normally done. -@xref{Chained Rules, ,Chains of Implicit Rules}. - -You can also list the target pattern of an implicit rule (such as -@samp{%.o}) as a dependency file of the special target @code{.PRECIOUS} -to preserve intermediate files created by rules whose target patterns -match that file's name. - -@findex .IGNORE -@item .IGNORE - -If you specify dependencies for @code{.IGNORE}, then @code{make} will -ignore errors in execution of the commands run for those particular -files. The commands for @code{.IGNORE} are not meaningful. - -If mentioned as a target with no dependencies, @code{.IGNORE} says to -ignore errors in execution of commands for all files. This usage of -@samp{.IGNORE} is supported only for historical compatibility. Since -this affects every command in the makefile, it is not very useful; we -recommend you use the more selective ways to ignore errors in specific -commands. @xref{Errors, ,Errors in Commands}. - -@findex .SILENT -@item .SILENT - -If you specify dependencies for @code{.SILENT}, then @code{make} will -not the print commands to remake those particular files before executing -them. The commands for @code{.SILENT} are not meaningful. - -If mentioned as a target with no dependencies, @code{.SILENT} says not -to print any commands before executing them. This usage of -@samp{.SILENT} is supported only for historical compatibility. We -recommend you use the more selective ways to silence specific commands. -@xref{Echoing, ,Command Echoing}. If you want to silence all commands -for a particular run of @code{make}, use the @samp{-s} or -@w{@samp{--silent}} option (@pxref{Options Summary}). - -@findex .EXPORT_ALL_VARIABLES -@item .EXPORT_ALL_VARIABLES - -Simply by being mentioned as a target, this tells @code{make} to -export all variables to child processes by default. -@xref{Variables/Recursion, ,Communicating Variables to a -Sub-@code{make}}. -@end table - -Any defined implicit rule suffix also counts as a special target if it -appears as a target, and so does the concatenation of two suffixes, such -as @samp{.c.o}. These targets are suffix rules, an obsolete way of -defining implicit rules (but a way still widely used). In principle, any -target name could be special in this way if you break it in two and add -both pieces to the suffix list. In practice, suffixes normally begin with -@samp{.}, so these special target names also begin with @samp{.}. -@xref{Suffix Rules, ,Old-Fashioned Suffix Rules}. - -@node Multiple Targets, Multiple Rules, Special Targets, Rules -@section Multiple Targets in a Rule -@cindex multiple targets -@cindex several targets in a rule -@cindex targets, multiple -@cindex rule, with multiple targets - -A rule with multiple targets is equivalent to writing many rules, each with -one target, and all identical aside from that. The same commands apply to -all the targets, but their effects may vary because you can substitute the -actual target name into the command using @samp{$@@}. The rule contributes -the same dependencies to all the targets also. - -This is useful in two cases. - -@itemize @bullet -@item -You want just dependencies, no commands. For example: - -@example -kbd.o command.o files.o: command.h -@end example - -@noindent -gives an additional dependency to each of the three object files -mentioned. - -@item -Similar commands work for all the targets. The commands do not need -to be absolutely identical, since the automatic variable @samp{$@@} -can be used to substitute the particular target to be remade into the -commands (@pxref{Automatic, ,Automatic Variables}). For example: - -@example -@group -bigoutput littleoutput : text.g - generate text.g -$(subst output,,$@@) > $@@ -@end group -@end example -@findex subst - -@noindent -is equivalent to - -@example -bigoutput : text.g - generate text.g -big > bigoutput -littleoutput : text.g - generate text.g -little > littleoutput -@end example - -@noindent -Here we assume the hypothetical program @code{generate} makes two -types of output, one if given @samp{-big} and one if given -@samp{-little}. -@xref{Text Functions, ,Functions for String Substitution and Analysis}, -for an explanation of the @code{subst} function. -@end itemize - -Suppose you would like to vary the dependencies according to the target, -much as the variable @samp{$@@} allows you to vary the commands. -You cannot do this with multiple targets in an ordinary rule, but you can -do it with a @dfn{static pattern rule}. -@xref{Static Pattern, ,Static Pattern Rules}. - -@node Multiple Rules, Static Pattern, Multiple Targets, Rules -@section Multiple Rules for One Target -@cindex multiple rules for one target -@cindex several rules for one target -@cindex rule, multiple for one target -@cindex target, multiple rules for one - -One file can be the target of several rules. All the dependencies -mentioned in all the rules are merged into one list of dependencies for -the target. If the target is older than any dependency from any rule, -the commands are executed. - -There can only be one set of commands to be executed for a file. -If more than one rule gives commands for the same file, -@code{make} uses the last set given and prints an error message. -(As a special case, if the file's name begins with a dot, no -error message is printed. This odd behavior is only for -compatibility with other implementations of @code{make}.) -There is no reason to -write your makefiles this way; that is why @code{make} gives you -an error message.@refill - -An extra rule with just dependencies can be used to give a few extra -dependencies to many files at once. For example, one usually has a -variable named @code{objects} containing a list of all the compiler output -files in the system being made. An easy way to say that all of them must -be recompiled if @file{config.h} changes is to write the following: - -@example -objects = foo.o bar.o -foo.o : defs.h -bar.o : defs.h test.h -$(objects) : config.h -@end example - -This could be inserted or taken out without changing the rules that really -specify how to make the object files, making it a convenient form to use if -you wish to add the additional dependency intermittently. - -Another wrinkle is that the additional dependencies could be specified with -a variable that you set with a command argument to @code{make} -(@pxref{Overriding, ,Overriding Variables}). For example, - -@example -@group -extradeps= -$(objects) : $(extradeps) -@end group -@end example - -@noindent -means that the command @samp{make extradeps=foo.h} will consider -@file{foo.h} as a dependency of each object file, but plain @samp{make} -will not. - -If none of the explicit rules for a target has commands, then @code{make} -searches for an applicable implicit rule to find some commands -@pxref{Implicit Rules, ,Using Implicit Rules}). - -@node Static Pattern, Double-Colon, Multiple Rules, Rules -@section Static Pattern Rules -@cindex static pattern rule -@cindex rule, static pattern -@cindex pattern rules, static (not implicit) -@cindex varying dependencies -@cindex dependencies, varying (static pattern) - -@dfn{Static pattern rules} are rules which specify multiple targets and -construct the dependency names for each target based on the target name. -They are more general than ordinary rules with multiple targets because the -targets do not have to have identical dependencies. Their dependencies must -be @emph{analogous}, but not necessarily @emph{identical}. - -@menu -* Static Usage:: The syntax of static pattern rules. -* Static versus Implicit:: When are they better than implicit rules? -@end menu - -@node Static Usage, Static versus Implicit, , Static Pattern -@subsection Syntax of Static Pattern Rules -@cindex static pattern rule, syntax of -@cindex pattern rules, static, syntax of - -Here is the syntax of a static pattern rule: - -@example -@var{targets} @dots{}: @var{target-pattern}: @var{dep-patterns} @dots{} - @var{commands} - @dots{} -@end example - -@noindent -The @var{targets} list specifies the targets that the rule applies to. -The targets can contain wildcard characters, just like the targets of -ordinary rules (@pxref{Wildcards, ,Using Wildcard Characters in File -Names}). - -@cindex target pattern, static (not implicit) -@cindex stem -The @var{target-pattern} and @var{dep-patterns} say how to compute the -dependencies of each target. Each target is matched against the -@var{target-pattern} to extract a part of the target name, called the -@dfn{stem}. This stem is substituted into each of the @var{dep-patterns} -to make the dependency names (one from each @var{dep-pattern}). - -Each pattern normally contains the character @samp{%} just once. When the -@var{target-pattern} matches a target, the @samp{%} can match any part of -the target name; this part is called the @dfn{stem}. The rest of the -pattern must match exactly. For example, the target @file{foo.o} matches -the pattern @samp{%.o}, with @samp{foo} as the stem. The targets -@file{foo.c} and @file{foo.out} do not match that pattern.@refill - -@cindex dependency pattern, static (not implicit) -The dependency names for each target are made by substituting the stem -for the @samp{%} in each dependency pattern. For example, if one -dependency pattern is @file{%.c}, then substitution of the stem -@samp{foo} gives the dependency name @file{foo.c}. It is legitimate -to write a dependency pattern that does not contain @samp{%}; then this -dependency is the same for all targets. - -@cindex @code{%}, quoting in static pattern -@cindex @code{%}, quoting with @code{\} (backslash) -@cindex @code{\} (backslash), to quote @code{%} -@cindex backslash (@code{\}), to quote @code{%} -@cindex quoting @code{%}, in static pattern -@samp{%} characters in pattern rules can be quoted with preceding -backslashes (@samp{\}). Backslashes that would otherwise quote @samp{%} -characters can be quoted with more backslashes. Backslashes that quote -@samp{%} characters or other backslashes are removed from the pattern -before it is compared to file names or has a stem substituted into it. -Backslashes that are not in danger of quoting @samp{%} characters go -unmolested. For example, the pattern @file{the\%weird\\%pattern\\} has -@samp{the%weird\} preceding the operative @samp{%} character, and -@samp{pattern\\} following it. The final two backslashes are left alone -because they cannot affect any @samp{%} character.@refill - -Here is an example, which compiles each of @file{foo.o} and @file{bar.o} -from the corresponding @file{.c} file: - -@example -@group -objects = foo.o bar.o - -$(objects): %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@@ -@end group -@end example - -@noindent -Here @samp{$<} is the automatic variable that holds the name of the -dependency and @samp{$@@} is the automatic variable that holds the name -of the target; see @ref{Automatic, , Automatic Variables}. - -Each target specified must match the target pattern; a warning is issued -for each target that does not. If you have a list of files, only some of -which will match the pattern, you can use the @code{filter} function to -remove nonmatching file names (@pxref{Text Functions, ,Functions for String Substitution and Analysis}): - -@example -files = foo.elc bar.o lose.o - -$(filter %.o,$(files)): %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@@ -$(filter %.elc,$(files)): %.elc: %.el - emacs -f batch-byte-compile $< -@end example - -@noindent -In this example the result of @samp{$(filter %.o,$(files))} is -@file{bar.o lose.o}, and the first static pattern rule causes each of -these object files to be updated by compiling the corresponding C source -file. The result of @w{@samp{$(filter %.elc,$(files))}} is -@file{foo.elc}, so that file is made from @file{foo.el}.@refill - -Another example shows how to use @code{$*} in static pattern rules: -@vindex $*@r{, and static pattern} - -@example -@group -bigoutput littleoutput : %output : text.g - generate text.g -$* > $@@ -@end group -@end example - -@noindent -When the @code{generate} command is run, @code{$*} will expand to the -stem, either @samp{big} or @samp{little}. - -@node Static versus Implicit, , Static Usage, Static Pattern -@subsection Static Pattern Rules versus Implicit Rules -@cindex rule, static pattern versus implicit -@cindex static pattern rule, versus implicit - -A static pattern rule has much in common with an implicit rule defined as a -pattern rule (@pxref{Pattern Rules, ,Defining and Redefining Pattern Rules}). -Both have a pattern for the target and patterns for constructing the -names of dependencies. The difference is in how @code{make} decides -@emph{when} the rule applies. - -An implicit rule @emph{can} apply to any target that matches its pattern, -but it @emph{does} apply only when the target has no commands otherwise -specified, and only when the dependencies can be found. If more than one -implicit rule appears applicable, only one applies; the choice depends on -the order of rules. - -By contrast, a static pattern rule applies to the precise list of targets -that you specify in the rule. It cannot apply to any other target and it -invariably does apply to each of the targets specified. If two conflicting -rules apply, and both have commands, that's an error. - -The static pattern rule can be better than an implicit rule for these -reasons: - -@itemize @bullet -@item -You may wish to override the usual implicit rule for a few -files whose names cannot be categorized syntactically but -can be given in an explicit list. - -@item -If you cannot be sure of the precise contents of the directories -you are using, you may not be sure which other irrelevant files -might lead @code{make} to use the wrong implicit rule. The choice -might depend on the order in which the implicit rule search is done. -With static pattern rules, there is no uncertainty: each rule applies -to precisely the targets specified. -@end itemize - -@node Double-Colon, Automatic Dependencies, Static Pattern, Rules -@section Double-Colon Rules -@cindex double-colon rules -@cindex rule, double-colon (@code{::}) -@cindex multiple rules for one target (@code{::}) -@cindex @code{::} rules (double-colon) - -@dfn{Double-colon} rules are rules written with @samp{::} instead of -@samp{:} after the target names. They are handled differently from -ordinary rules when the same target appears in more than one rule. - -When a target appears in multiple rules, all the rules must be the same -type: all ordinary, or all double-colon. If they are double-colon, each of -them is independent of the others. Each double-colon rule's commands are -executed if the target is older than any dependencies of that rule. This -can result in executing none, any, or all of the double-colon rules. - -Double-colon rules with the same target are in fact completely separate -from one another. Each double-colon rule is processed individually, just -as rules with different targets are processed. - -The double-colon rules for a target are executed in the order they appear -in the makefile. However, the cases where double-colon rules really make -sense are those where the order of executing the commands would not matter. - -Double-colon rules are somewhat obscure and not often very useful; they -provide a mechanism for cases in which the method used to update a target -differs depending on which dependency files caused the update, and such -cases are rare. - -Each double-colon rule should specify commands; if it does not, an -implicit rule will be used if one applies. -@xref{Implicit Rules, ,Using Implicit Rules}. - -@node Automatic Dependencies, , Double-Colon, Rules -@section Generating Dependencies Automatically -@cindex dependencies, automatic generation -@cindex automatic generation of dependencies -@cindex generating dependencies automatically - -In the makefile for a program, many of the rules you need to write often -say only that some object file depends on some header -file. For example, if @file{main.c} uses @file{defs.h} via an -@code{#include}, you would write: - -@example -main.o: defs.h -@end example - -@noindent -You need this rule so that @code{make} knows that it must remake -@file{main.o} whenever @file{defs.h} changes. You can see that for a -large program you would have to write dozens of such rules in your -makefile. And, you must always be very careful to update the makefile -every time you add or remove an @code{#include}. -@cindex @code{#include} - -@cindex @code{-M} (to compiler) -To avoid this hassle, most modern C compilers can write these rules for -you, by looking at the @code{#include} lines in the source files. -Usually this is done with the @samp{-M} option to the compiler. -For example, the command: - -@example -cc -M main.c -@end example - -@noindent -generates the output: - -@example -main.o : main.c defs.h -@end example - -@noindent -Thus you no longer have to write all those rules yourself. -The compiler will do it for you. - -Note that such a dependency constitutes mentioning @file{main.o} in a -makefile, so it can never be considered an intermediate file by implicit -rule search. This means that @code{make} won't ever remove the file -after using it; @pxref{Chained Rules, ,Chains of Implicit Rules}. - -@cindex @code{make depend} -With old @code{make} programs, it was traditional practice to use this -compiler feature to generate dependencies on demand with a command like -@samp{make depend}. That command would create a file @file{depend} -containing all the automatically-generated dependencies; then the -makefile could use @code{include} to read them in (@pxref{Include}). - -In GNU @code{make}, the feature of remaking makefiles makes this -practice obsolete---you need never tell @code{make} explicitly to -regenerate the dependencies, because it always regenerates any makefile -that is out of date. @xref{Remaking Makefiles}. - -The practice we recommend for automatic dependency generation is to have -one makefile corresponding to each source file. For each source file -@file{@var{name}.c} there is a makefile @file{@var{name}.d} which lists -what files the object file @file{@var{name}.o} depends on. That way -only the source files that have changed need to be rescanned to produce -the new dependencies. - -Here is the pattern rule to generate a file of dependencies (i.e., a makefile) -called @file{@var{name}.d} from a C source file called @file{@var{name}.c}: - -@example -@group -%.d: %.c - $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \ - | sed '\''s/$*\\.o[ :]*/& $@@/g'\'' > $@@' -@end group -@end example - -@noindent -@xref{Pattern Rules}, for information on defining pattern rules. The -@samp{-e} flag to the shell makes it exit immediately if the -@code{$(CC)} command fails (exits with a nonzero status). Normally the -shell exits with the status of the last command in the pipeline -(@code{sed} in this case), so @code{make} would not notice a nonzero -status from the compiler. -@cindex @code{-e} (shell flag) - -@cindex @code{-MM} (to GNU compiler) -With the GNU C compiler, you may wish to use the @samp{-MM} flag instead -of @samp{-M}. This omits dependencies on system header files. -@xref{Preprocessor Options, , Options Controlling the Preprocessor, -gcc.info, Using GNU CC}, for details. - -@cindex @code{sed} (shell command) -The purpose of the @code{sed} command is to translate (for example): - -@example -main.o : main.c defs.h -@end example - -@noindent -into: - -@example -main.o main.d : main.c defs.h -@end example - -@noindent -@cindex @code{.d} -This makes each @samp{.d} file depend on all the source and header files -that the corresponding @samp{.o} file depends on. @code{make} then -knows it must regenerate the dependencies whenever any of the source or -header files changes. - -Once you've defined the rule to remake the @samp{.d} files, -you then use the @code{include} directive to read them all in. -@xref{Include}. For example: - -@example -@group -sources = foo.c bar.c - -include $(sources:.c=.d) -@end group -@end example - -@noindent -(This example uses a substitution variable reference to translate the -list of source files @samp{foo.c bar.c} into a list of dependency -makefiles, @samp{foo.d bar.d}. @xref{Substitution Refs}, for full -information on substitution references.) Since the @samp{.d} files are -makefiles like any others, @code{make} will remake them as necessary -with no further work from you. @xref{Remaking Makefiles}. - -@node Commands, Using Variables, Rules, Top -@chapter Writing the Commands in Rules -@cindex commands, how to write -@cindex rule commands -@cindex writing rule commands - -The commands of a rule consist of shell command lines to be executed one -by one. Each command line must start with a tab, except that the first -command line may be attached to the target-and-dependencies line with a -semicolon in between. Blank lines and lines of just comments may appear -among the command lines; they are ignored. (But beware, an apparently -``blank'' line that begins with a tab is @emph{not} blank! It is an -empty command; @pxref{Empty Commands}.) - -Users use many different shell programs, but commands in makefiles are -always interpreted by @file{/bin/sh} unless the makefile specifies -otherwise. @xref{Execution, ,Command Execution}. - -@cindex comments, in commands -@cindex commands, comments in -@cindex @code{#} (comments), in commands -The shell that is in use determines whether comments can be written on -command lines, and what syntax they use. When the shell is -@file{/bin/sh}, a @samp{#} starts a comment that extends to the end of -the line. The @samp{#} does not have to be at the beginning of a line. -Text on a line before a @samp{#} is not part of the comment. - -@menu -* Echoing:: How to control when commands are echoed. -* Execution:: How commands are executed. -* Parallel:: How commands can be executed in parallel. -* Errors:: What happens after a command execution error. -* Interrupts:: What happens when a command is interrupted. -* Recursion:: Invoking @code{make} from makefiles. -* Sequences:: Defining canned sequences of commands. -* Empty Commands:: Defining useful, do-nothing commands. -@end menu - -@node Echoing, Execution, , Commands -@section Command Echoing -@cindex echoing of commands -@cindex silent operation -@cindex @code{@@} (in commands) -@cindex commands, echoing -@cindex printing of commands - -Normally @code{make} prints each command line before it is executed. -We call this @dfn{echoing} because it gives the appearance that you -are typing the commands yourself. - -When a line starts with @samp{@@}, the echoing of that line is suppressed. -The @samp{@@} is discarded before the command is passed to the shell. -Typically you would use this for a command whose only effect is to print -something, such as an @code{echo} command to indicate progress through -the makefile: - -@example -@@echo About to make distribution files -@end example - -@cindex @code{-n} -@cindex @code{--just-print} -@cindex @code{--dry-run} -@cindex @code{--recon} -When @code{make} is given the flag @samp{-n} or @samp{--just-print}, -echoing is all that happens, no execution. @xref{Options Summary, -,Summary of Options}. In this case and only this case, even the -commands starting with @samp{@@} are printed. This flag is useful for -finding out which commands @code{make} thinks are necessary without -actually doing them. - -@cindex @code{-s} -@cindex @code{--silent} -@cindex @code{--quiet} -@findex .SILENT -The @samp{-s} or @samp{--silent} -flag to @code{make} prevents all echoing, as if all commands -started with @samp{@@}. A rule in the makefile for the special target -@code{.SILENT} without dependencies has the same effect -(@pxref{Special Targets, ,Special Built-in Target Names}). -@code{.SILENT} is essentially obsolete since @samp{@@} is more flexible.@refill - -@node Execution, Parallel, Echoing, Commands -@section Command Execution -@cindex commands, execution -@cindex execution, of commands -@cindex shell command, execution -@vindex SHELL @r{(command execution)} - -When it is time to execute commands to update a target, they are executed -by making a new subshell for each line. (In practice, @code{make} may -take shortcuts that do not affect the results.) - -@cindex @code{cd} (shell command) -@strong{Please note:} this implies that shell commands such as -@code{cd} that set variables local to each process will not affect the -following command lines. If you want to use @code{cd} to affect the -next command, put the two on a single line with a semicolon between -them. Then @code{make} will consider them a single command and pass -them, together, to a shell which will execute them in sequence. For -example: - -@example -foo : bar/lose - cd bar; gobble lose > ../foo -@end example - -@cindex commands, backslash (@code{\}) in -@cindex commands, quoting newlines in -@cindex backslash (@code{\}), in commands -@cindex @code{\} (backslash), in commands -@cindex quoting newline, in commands -@cindex newline, quoting, in commands -If you would like to split a single shell command into multiple lines of -text, you must use a backslash at the end of all but the last subline. -Such a sequence of lines is combined into a single line, by deleting the -backslash-newline sequences, before passing it to the shell. Thus, the -following is equivalent to the preceding example: - -@example -@group -foo : bar/lose - cd bar; \ - gobble lose > ../foo -@end group -@end example - -@vindex SHELL -The program used as the shell is taken from the variable @code{SHELL}. -By default, the program @file{/bin/sh} is used. - -@cindex environment, @code{SHELL} in -Unlike most variables, the variable @code{SHELL} is never set from the -environment. This is because the @code{SHELL} environment variable is -used to specify your personal choice of shell program for interactive -use. It would be very bad for personal choices like this to affect -the functioning of makefiles. @xref{Environment, ,Variables from the -Environment}. - -@node Parallel, Errors, Execution, Commands -@section Parallel Execution -@cindex commands, execution in parallel -@cindex parallel execution -@cindex execution, in parallel -@cindex job slots -@cindex @code{-j} -@cindex @code{--jobs} - -GNU @code{make} knows how to execute several commands at once. -Normally, @code{make} will execute only one command at a time, waiting -for it to finish before executing the next. However, the @samp{-j} or -@samp{--jobs} option tells @code{make} to execute many commands -simultaneously.@refill - -If the @samp{-j} option is followed by an integer, this is the number of -commands to execute at once; this is called the number of @dfn{job slots}. -If there is nothing looking like an integer after the @samp{-j} option, -there is no limit on the number of job slots. The default number of job -slots is one, which means serial execution (one thing at a time). - -One unpleasant consequence of running several commands simultaneously is -that output from all of the commands comes when the commands send it, so -messages from different commands may be interspersed. - -Another problem is that two processes cannot both take input from the -same device; so to make sure that only one command tries to take input -from the terminal at once, @code{make} will invalidate the standard -input streams of all but one running command. This means that -attempting to read from standard input will usually be a fatal error (a -@samp{Broken pipe} signal) for most child processes if there are -several. -@cindex broken pipe -@cindex standard input - -It is unpredictable which command will have a valid standard input stream -(which will come from the terminal, or wherever you redirect the standard -input of @code{make}). The first command run will always get it first, and -the first command started after that one finishes will get it next, and so -on. - -We will change how this aspect of @code{make} works if we find a better -alternative. In the mean time, you should not rely on any command using -standard input at all if you are using the parallel execution feature; but -if you are not using this feature, then standard input works normally in -all commands. - -If a command fails (is killed by a signal or exits with a nonzero -status), and errors are not ignored for that command -(@pxref{Errors, ,Errors in Commands}), -the remaining command lines to remake the same target will not be run. -If a command fails and the @samp{-k} or @samp{--keep-going} -option was not given -(@pxref{Options Summary, ,Summary of Options}), -@code{make} aborts execution. If make -terminates for any reason (including a signal) with child processes -running, it waits for them to finish before actually exiting.@refill - -@cindex load average -@cindex limiting jobs based on load -@cindex jobs, limiting based on load -@cindex @code{-l} (load average) -@cindex @code{--max-load} -@cindex @code{--load-average} -When the system is heavily loaded, you will probably want to run fewer jobs -than when it is lightly loaded. You can use the @samp{-l} option to tell -@code{make} to limit the number of jobs to run at once, based on the load -average. The @samp{-l} or @samp{--max-load} -option is followed by a floating-point number. For -example, - -@example --l 2.5 -@end example - -@noindent -will not let @code{make} start more than one job if the load average is -above 2.5. The @samp{-l} option with no following number removes the -load limit, if one was given with a previous @samp{-l} option.@refill - -More precisely, when @code{make} goes to start up a job, and it already has -at least one job running, it checks the current load average; if it is not -lower than the limit given with @samp{-l}, @code{make} waits until the load -average goes below that limit, or until all the other jobs finish. - -By default, there is no load limit. - -@node Errors, Interrupts, Parallel, Commands -@section Errors in Commands -@cindex errors (in commands) -@cindex commands, errors in -@cindex exit status (errors) - -After each shell command returns, @code{make} looks at its exit status. -If the command completed successfully, the next command line is executed -in a new shell; after the last command line is finished, the rule is -finished. - -If there is an error (the exit status is nonzero), @code{make} gives up on -the current rule, and perhaps on all rules. - -Sometimes the failure of a certain command does not indicate a problem. -For example, you may use the @code{mkdir} command to ensure that a -directory exists. If the directory already exists, @code{mkdir} will -report an error, but you probably want @code{make} to continue regardless. - -@cindex @code{-} (in commands) -To ignore errors in a command line, write a @samp{-} at the beginning of -the line's text (after the initial tab). The @samp{-} is discarded before -the command is passed to the shell for execution. - -For example, - -@example -@group -clean: - -rm -f *.o -@end group -@end example -@cindex @code{rm} (shell command) - -@noindent -This causes @code{rm} to continue even if it is unable to remove a file. - -@cindex @code{-i} -@cindex @code{--ignore-errors} -@findex .IGNORE -When you run @code{make} with the @samp{-i} or @samp{--ignore-errors} -flag, errors are ignored in all commands of all rules. A rule in the -makefile for the special target @code{.IGNORE} has the same effect, if -there are no dependencies. These ways of ignoring errors are obsolete -because @samp{-} is more flexible. - -When errors are to be ignored, because of either a @samp{-} or the -@samp{-i} flag, @code{make} treats an error return just like success, -except that it prints out a message that tells you the status code -the command exited with, and says that the error has been ignored. - -When an error happens that @code{make} has not been told to ignore, -it implies that the current target cannot be correctly remade, and neither -can any other that depends on it either directly or indirectly. No further -commands will be executed for these targets, since their preconditions -have not been achieved. - - -@cindex @code{-k} -@cindex @code{--keep-going} -Normally @code{make} gives up immediately in this circumstance, returning a -nonzero status. However, if the @samp{-k} or @samp{--keep-going} -flag is specified, @code{make} -continues to consider the other dependencies of the pending targets, -remaking them if necessary, before it gives up and returns nonzero status. -For example, after an error in compiling one object file, @samp{make -k} -will continue compiling other object files even though it already knows -that linking them will be impossible. @xref{Options Summary, ,Summary of Options}. - -The usual behavior assumes that your purpose is to get the specified -targets up to date; once @code{make} learns that this is impossible, it -might as well report the failure immediately. The @samp{-k} option says -that the real purpose is to test as many of the changes made in the -program as possible, perhaps to find several independent problems so -that you can correct them all before the next attempt to compile. This -is why Emacs' @code{compile} command passes the @samp{-k} flag by -default. -@cindex Emacs (@code{M-x compile}) - -@findex .DELETE_ON_ERROR -@cindex deletion of target files -@cindex removal of target files -@cindex target, deleting on error -Usually when a command fails, if it has changed the target file at all, -the file is corrupted and cannot be used---or at least it is not -completely updated. Yet the file's timestamp says that it is now up to -date, so the next time @code{make} runs, it will not try to update that -file. The situation is just the same as when the command is killed by a -signal; @pxref{Interrupts}. So generally the right thing to do is to -delete the target file if the command fails after beginning to change -the file. @code{make} will do this if @code{.DELETE_ON_ERROR} appears -as a target. This is almost always what you want @code{make} to do, but -it is not historical practice; so for compatibility, you must explicitly -request it. - -@node Interrupts, Recursion, Errors, Commands -@section Interrupting or Killing @code{make} -@cindex interrupt -@cindex signal -@cindex deletion of target files -@cindex removal of target files -@cindex target, deleting on interrupt -@cindex killing (interruption) - -If @code{make} gets a fatal signal while a command is executing, it may -delete the target file that the command was supposed to update. This is -done if the target file's last-modification time has changed since -@code{make} first checked it. - -The purpose of deleting the target is to make sure that it is remade from -scratch when @code{make} is next run. Why is this? Suppose you type -@kbd{Ctrl-c} while a compiler is running, and it has begun to write an -object file @file{foo.o}. The @kbd{Ctrl-c} kills the compiler, resulting -in an incomplete file whose last-modification time is newer than the source -file @file{foo.c}. But @code{make} also receives the @kbd{Ctrl-c} signal -and deletes this incomplete file. If @code{make} did not do this, the next -invocation of @code{make} would think that @file{foo.o} did not require -updating---resulting in a strange error message from the linker when it -tries to link an object file half of which is missing. - -@findex .PRECIOUS -You can prevent the deletion of a target file in this way by making the -special target @code{.PRECIOUS} depend on it. Before remaking a target, -@code{make} checks to see whether it appears on the dependencies of -@code{.PRECIOUS}, and thereby decides whether the target should be deleted -if a signal happens. Some reasons why you might do this are that the -target is updated in some atomic fashion, or exists only to record a -modification-time (its contents do not matter), or must exist at all -times to prevent other sorts of trouble. - -@node Recursion, Sequences, Interrupts, Commands -@section Recursive Use of @code{make} -@cindex recursion -@cindex subdirectories, recursion for - -Recursive use of @code{make} means using @code{make} as a command in a -makefile. This technique is useful when you want separate makefiles for -various subsystems that compose a larger system. For example, suppose you -have a subdirectory @file{subdir} which has its own makefile, and you would -like the containing directory's makefile to run @code{make} on the -subdirectory. You can do it by writing this: - -@example -subsystem: - cd subdir; $(MAKE) -@end example - -@noindent -or, equivalently, this (@pxref{Options Summary, ,Summary of Options}): - -@example -subsystem: - $(MAKE) -C subdir -@end example -@cindex @code{-C} -@cindex @code{--directory} - -You can write recursive @code{make} commands just by copying this example, -but there are many things to know about how they work and why, and about -how the sub-@code{make} relates to the top-level @code{make}. - -@menu -* MAKE Variable:: The special effects of using @samp{$(MAKE)}. -* Variables/Recursion:: How to communicate variables to a sub-@code{make}. -* Options/Recursion:: How to communicate options to a sub-@code{make}. -* -w Option:: How the @samp{-w} or @samp{--print-directory} option - helps debug use of recursive @code{make} commands. -@end menu - -@node MAKE Variable, Variables/Recursion, , Recursion -@subsection How the @code{MAKE} Variable Works -@vindex MAKE -@cindex recursion, and @code{MAKE} variable - -Recursive @code{make} commands should always use the variable @code{MAKE}, -not the explicit command name @samp{make}, as shown here: - -@example -@group -subsystem: - cd subdir; $(MAKE) -@end group -@end example - -The value of this variable is the file name with which @code{make} was -invoked. If this file name was @file{/bin/make}, then the command executed -is @samp{cd subdir; /bin/make}. If you use a special version of -@code{make} to run the top-level makefile, the same special version will be -executed for recursive invocations. -@cindex @code{cd} (shell command) - -As a special feature, using the variable @code{MAKE} in the commands of -a rule alters the effects of the @samp{-t} (@samp{--touch}), @samp{-n} -(@samp{--just-print}), or @samp{-q} (@w{@samp{--question}}) option. -Using the @code{MAKE} variable has the same effect as using a @samp{+} -character at the beginning of the command line. @xref{Instead of -Execution, ,Instead of Executing the Commands}.@refill - -Consider the command @samp{make -t} in the above example. (The -@samp{-t} option marks targets as up to date without actually running -any commands; see @ref{Instead of Execution}.) Following the usual -definition of @samp{-t}, a @samp{make -t} command in the example would -create a file named @file{subsystem} and do nothing else. What you -really want it to do is run @samp{@w{cd subdir;} @w{make -t}}; but that would -require executing the command, and @samp{-t} says not to execute -commands.@refill -@cindex @code{-t}, and recursion -@cindex recursion, and @code{-t} -@cindex @code{--touch}, and recursion - -The special feature makes this do what you want: whenever a command -line of a rule contains the variable @code{MAKE}, the flags @samp{-t}, -@samp{-n} and @samp{-q} do not apply to that line. Command lines -containing @code{MAKE} are executed normally despite the presence of a -flag that causes most commands not to be run. The usual -@code{MAKEFLAGS} mechanism passes the flags to the sub-@code{make} -(@pxref{Options/Recursion, ,Communicating Options to a -Sub-@code{make}}), so your request to touch the files, or print the -commands, is propagated to the subsystem.@refill - -@node Variables/Recursion, Options/Recursion, MAKE Variable, Recursion -@subsection Communicating Variables to a Sub-@code{make} -@cindex sub-@code{make} -@cindex environment, and recursion -@cindex exporting variables -@cindex variables, environment -@cindex variables, exporting -@cindex recursion, and environment -@cindex recursion, and variables - -Variable values of the top-level @code{make} can be passed to the -sub-@code{make} through the environment by explicit request. These -variables are defined in the sub-@code{make} as defaults, but do not -override what is specified in the makefile used by the sub-@code{make} -makefile unless you use the @samp{-e} switch (@pxref{Options Summary, -,Summary of Options}).@refill - -To pass down, or @dfn{export}, a variable, @code{make} adds the variable -and its value to the environment for running each command. The -sub-@code{make}, in turn, uses the environment to initialize its table -of variable values. @xref{Environment, ,Variables from the -Environment}. - -Except by explicit request, @code{make} exports a variable only if it -is either defined in the environment initially or set on the command -line, and if its name consists only of letters, numbers, and underscores. -Some shells cannot cope with environment variable names consisting of -characters other than letters, numbers, and underscores. - -The special variables @code{SHELL} and @code{MAKEFLAGS} are always -exported (unless you unexport them). -@code{MAKEFILES} is exported if you set it to anything. - -@code{make} automatically passes down variable values that were defined -on the command line, by putting them in the @code{MAKEFLAGS} variable. -@iftex -See the next section. -@end iftex -@ifinfo -@xref{Options/Recursion}. -@end ifinfo - -Variables are @emph{not} normally passed down if they were created by -default by @code{make} (@pxref{Implicit Variables, ,Variables Used by -Implicit Rules}). The sub-@code{make} will define these for -itself.@refill - -@findex export -If you want to export specific variables to a sub-@code{make}, use the -@code{export} directive, like this: - -@example -export @var{variable} @dots{} -@end example - -@noindent -@findex unexport -If you want to @emph{prevent} a variable from being exported, use the -@code{unexport} directive, like this: - -@example -unexport @var{variable} @dots{} -@end example - -@noindent -As a convenience, you can define a variable and export it at the same -time by doing: - -@example -export @var{variable} = value -@end example - -@noindent -has the same result as: - -@example -@var{variable} = value -export @var{variable} -@end example - -@noindent -and - -@example -export @var{variable} := value -@end example - -@noindent -has the same result as: - -@example -@var{variable} := value -export @var{variable} -@end example - -Likewise, - -@example -export @var{variable} += value -@end example - -@noindent -is just like: - -@example -@var{variable} += value -export @var{variable} -@end example - -@noindent -@xref{Appending, ,Appending More Text to Variables}. - -You may notice that the @code{export} and @code{unexport} directives -work in @code{make} in the same way they work in the shell, @code{sh}. - -If you want all variables to be exported by default, you can use -@code{export} by itself: - -@example -export -@end example - -@noindent -This tells @code{make} that variables which are not explicitly mentioned -in an @code{export} or @code{unexport} directive should be exported. -Any variable given in an @code{unexport} directive will still @emph{not} -be exported. If you use @code{export} by itself to export variables by -default, variables whose names contain characters other than -alphanumerics and underscores will not be exported unless specifically -mentioned in an @code{export} directive.@refill - -@findex .EXPORT_ALL_VARIABLES -The behavior elicited by an @code{export} directive by itself was the -default in older versions of GNU @code{make}. If your makefiles depend -on this behavior and you want to be compatible with old versions of -@code{make}, you can write a rule for the special target -@code{.EXPORT_ALL_VARIABLES} instead of using the @code{export} directive. -This will be ignored by old @code{make}s, while the @code{export} -directive will cause a syntax error.@refill -@cindex compatibility in exporting - -Likewise, you can use @code{unexport} by itself to tell @code{make} -@emph{not} to export variables by default. Since this is the default -behavior, you would only need to do this if @code{export} had been used -by itself earlier (in an included makefile, perhaps). You -@strong{cannot} use @code{export} and @code{unexport} by themselves to -have variables exported for some commands and not for others. The last -@code{export} or @code{unexport} directive that appears by itself -determines the behavior for the entire run of @code{make}.@refill - -@vindex MAKELEVEL -@cindex recursion, level of -As a special feature, the variable @code{MAKELEVEL} is changed when it -is passed down from level to level. This variable's value is a string -which is the depth of the level as a decimal number. The value is -@samp{0} for the top-level @code{make}; @samp{1} for a sub-@code{make}, -@samp{2} for a sub-sub-@code{make}, and so on. The incrementation -happens when @code{make} sets up the environment for a command.@refill - -The main use of @code{MAKELEVEL} is to test it in a conditional -directive (@pxref{Conditionals, ,Conditional Parts of Makefiles}); this -way you can write a makefile that behaves one way if run recursively and -another way if run directly by you.@refill - -@vindex MAKEFILES -You can use the variable @code{MAKEFILES} to cause all sub-@code{make} -commands to use additional makefiles. The value of @code{MAKEFILES} is -a whitespace-separated list of file names. This variable, if defined in -the outer-level makefile, is passed down through the environment; then -it serves as a list of extra makefiles for the sub-@code{make} to read -before the usual or specified ones. @xref{MAKEFILES Variable, ,The -Variable @code{MAKEFILES}}.@refill - -@node Options/Recursion, -w Option, Variables/Recursion, Recursion -@subsection Communicating Options to a Sub-@code{make} -@cindex options, and recursion -@cindex recursion, and options - -@vindex MAKEFLAGS -Flags such as @samp{-s} and @samp{-k} are passed automatically to the -sub-@code{make} through the variable @code{MAKEFLAGS}. This variable is -set up automatically by @code{make} to contain the flag letters that -@code{make} received. Thus, if you do @w{@samp{make -ks}} then -@code{MAKEFLAGS} gets the value @samp{ks}.@refill - -As a consequence, every sub-@code{make} gets a value for @code{MAKEFLAGS} -in its environment. In response, it takes the flags from that value and -processes them as if they had been given as arguments. -@xref{Options Summary, ,Summary of Options}. - -@cindex command line variable definitions, and recursion -@cindex variables, command line, and recursion -@cindex recursion, and command line variable definitions -Likewise variables defined on the command line are passed to the -sub-@code{make} through @code{MAKEFLAGS}. Words in the value of -@code{MAKEFLAGS} that contain @samp{=}, @code{make} treats as variable -definitions just as if they appeared on the command line. -@xref{Overriding, ,Overriding Variables}. - -@cindex @code{-C}, and recursion -@cindex @code{-f}, and recursion -@cindex @code{-o}, and recursion -@cindex @code{-W}, and recursion -@cindex @code{--directory}, and recursion -@cindex @code{--file}, and recursion -@cindex @code{--old-file}, and recursion -@cindex @code{--assume-old}, and recursion -@cindex @code{--assume-new}, and recursion -@cindex @code{--new-file}, and recursion -@cindex recursion, and @code{-C} -@cindex recursion, and @code{-f} -@cindex recursion, and @code{-o} -@cindex recursion, and @code{-W} -The options @samp{-C}, @samp{-f}, @samp{-o}, and @samp{-W} are not put -into @code{MAKEFLAGS}; these options are not passed down.@refill - -@cindex @code{-j}, and recursion -@cindex @code{--jobs}, and recursion -@cindex recursion, and @code{-j} -@cindex job slots, and recursion -The @samp{-j} option is a special case (@pxref{Parallel, ,Parallel Execution}). -If you set it to some numeric value, @samp{-j 1} is always put into -@code{MAKEFLAGS} instead of the value you specified. This is because if -the @w{@samp{-j}} option were passed down to sub-@code{make}s, you would -get many more jobs running in parallel than you asked for. If you give -@samp{-j} with no numeric argument, meaning to run as many jobs as -possible in parallel, this is passed down, since multiple infinities are -no more than one.@refill - -If you do not want to pass the other flags down, you must change the -value of @code{MAKEFLAGS}, like this: - -@example -MAKEFLAGS= -subsystem: - cd subdir; $(MAKE) -@end example - -or like this: - -@example -subsystem: - cd subdir; $(MAKE) MAKEFLAGS= -@end example - -@vindex MAKEOVERRIDES -The command line variable definitions really appear in the variable -@code{MAKEOVERRIDES}, and @code{MAKEFLAGS} contains a reference to this -variable. If you do want to pass flags down normally, but don't want to -pass down the command line variable definitions, you can reset -@code{MAKEOVERRIDES} to empty, like this: - -@example -MAKEOVERRIDES = -@end example - -@noindent -@cindex Arg list too long -@cindex E2BIG -This is not usually useful to do. However, some systems have a small -fixed limit on the size of the environment, and putting so much -information in into the value of @code{MAKEFLAGS} can exceed it. -If you see the error message @samp{Arg list too long}, this may be the problem. -@findex .POSIX -@cindex POSIX.2 -(For strict compliance with POSIX.2, changing @code{MAKEOVERRIDES} does -not affect @code{MAKEFLAGS} if the special target @samp{.POSIX} appears -in the makefile. You probably do not care about this.) - -@vindex MFLAGS -A similar variable @code{MFLAGS} exists also, for historical -compatibility. It has the same value as @code{MAKEFLAGS} except that it -does not contain the command line variable definitions, and it always -begins with a hyphen unless it is empty (@code{MAKEFLAGS} begins with a -hyphen only when it begins with an option that has no single-letter -version, such as @samp{--warn-undefined-variables}). @code{MFLAGS} was -traditionally used explicitly in the recursive @code{make} command, like -this: - -@example -subsystem: - cd subdir; $(MAKE) $(MFLAGS) -@end example - -@noindent -but now @code{MAKEFLAGS} makes this usage redundant. If you want your -makefiles to be compatible with old @code{make} programs, use this -technique; it will work fine with more modern @code{make} versions too. - -@cindex setting options from environment -@cindex options, setting from environment -@cindex setting options in makefiles -@cindex options, setting in makefiles -The @code{MAKEFLAGS} variable can also be useful if you want to have -certain options, such as @samp{-k} (@pxref{Options Summary, ,Summary of -Options}), set each time you run @code{make}. You simply put a value for -@code{MAKEFLAGS} in your environment. You can also set @code{MAKEFLAGS} in -a makefile, to specify additional flags that should also be in effect for -that makefile. (Note that you cannot use @code{MFLAGS} this way. That -variable is set only for compatibility; @code{make} does not interpret a -value you set for it in any way.) - -When @code{make} interprets the value of @code{MAKEFLAGS} (either from the -environment or from a makefile), it first prepends a hyphen if the value -does not already begin with one. Then it chops the value into words -separated by blanks, and parses these words as if they were options given -on the command line (except that @samp{-C}, @samp{-f}, @samp{-h}, -@samp{-o}, @samp{-W}, and their long-named versions are ignored; and there -is no error for an invalid option). - -If you do put @code{MAKEFLAGS} in your environment, you should be sure not -to include any options that will drastically affect the actions of -@code{make} and undermine the purpose of makefiles and of @code{make} -itself. For instance, the @samp{-t}, @samp{-n}, and @samp{-q} options, if -put in one of these variables, could have disastrous consequences and would -certainly have at least surprising and probably annoying effects.@refill - -@node -w Option, , Options/Recursion, Recursion -@subsection The @samp{--print-directory} Option -@cindex directories, printing them -@cindex printing directories -@cindex recursion, and printing directories - -If you use several levels of recursive @code{make} invocations, the -@samp{-w} or @w{@samp{--print-directory}} option can make the output a -lot easier to understand by showing each directory as @code{make} -starts processing it and as @code{make} finishes processing it. For -example, if @samp{make -w} is run in the directory @file{/u/gnu/make}, -@code{make} will print a line of the form:@refill - -@example -make: Entering directory `/u/gnu/make'. -@end example - -@noindent -before doing anything else, and a line of the form: - -@example -make: Leaving directory `/u/gnu/make'. -@end example - -@noindent -when processing is completed. - -@cindex @code{-C}, and @code{-w} -@cindex @code{--directory}, and @code{--print-directory} -@cindex recursion, and @code{-w} -@cindex @code{-w}, and @code{-C} -@cindex @code{-w}, and recursion -@cindex @code{--print-directory}, and @code{--directory} -@cindex @code{--print-directory}, and recursion -@cindex @code{--no-print-directory} -@cindex @code{--print-directory}, disabling -@cindex @code{-w}, disabling -Normally, you do not need to specify this option because @samp{make} -does it for you: @samp{-w} is turned on automatically when you use the -@samp{-C} option, and in sub-@code{make}s. @code{make} will not -automatically turn on @samp{-w} if you also use @samp{-s}, which says to -be silent, or if you use @samp{--no-print-directory} to explicitly -disable it. - -@node Sequences, Empty Commands, Recursion, Commands -@section Defining Canned Command Sequences -@cindex sequences of commands -@cindex commands, sequences of - -When the same sequence of commands is useful in making various targets, you -can define it as a canned sequence with the @code{define} directive, and -refer to the canned sequence from the rules for those targets. The canned -sequence is actually a variable, so the name must not conflict with other -variable names. - -Here is an example of defining a canned sequence of commands: - -@example -define run-yacc -yacc $(firstword $^) -mv y.tab.c $@@ -endef -@end example -@cindex @code{yacc} - -@noindent -Here @code{run-yacc} is the name of the variable being defined; -@code{endef} marks the end of the definition; the lines in between are the -commands. The @code{define} directive does not expand variable references -and function calls in the canned sequence; the @samp{$} characters, -parentheses, variable names, and so on, all become part of the value of the -variable you are defining. -@xref{Defining, ,Defining Variables Verbatim}, -for a complete explanation of @code{define}. - -The first command in this example runs Yacc on the first dependency of -whichever rule uses the canned sequence. The output file from Yacc is -always named @file{y.tab.c}. The second command moves the output to the -rule's target file name. - -To use the canned sequence, substitute the variable into the commands of a -rule. You can substitute it like any other variable -(@pxref{Reference, ,Basics of Variable References}). -Because variables defined by @code{define} are recursively expanded -variables, all the variable references you wrote inside the @code{define} -are expanded now. For example: - -@example -foo.c : foo.y - $(run-yacc) -@end example - -@noindent -@samp{foo.y} will be substituted for the variable @samp{$^} when it occurs in -@code{run-yacc}'s value, and @samp{foo.c} for @samp{$@@}.@refill - -This is a realistic example, but this particular one is not needed in -practice because @code{make} has an implicit rule to figure out these -commands based on the file names involved -(@pxref{Implicit Rules, ,Using Implicit Rules}). - -@cindex @@, and @code{define} -@cindex -, and @code{define} -@cindex +, and @code{define} -In command execution, each line of a canned sequence is treated just as -if the line appeared on its own in the rule, preceded by a tab. In -particular, @code{make} invokes a separate subshell for each line. You -can use the special prefix characters that affect command lines -(@samp{@@}, @samp{-}, and @samp{+}) on each line of a canned sequence. -@xref{Commands, ,Writing the Commands in Rules}. -For example, using this canned sequence: - -@example -define frobnicate -@@echo "frobnicating target $@@" -frob-step-1 $< -o $@@-step-1 -frob-step-2 $@@-step-1 -o $@@ -endef -@end example - -@noindent -@code{make} will not echo the first line, the @code{echo} command. -But it @emph{will} echo the following two command lines. - -On the other hand, prefix characters on the command line that refers to -a canned sequence apply to every line in the sequence. So the rule: - -@example -frob.out: frob.in - @@$(frobnicate) -@end example - -@noindent -does not echo @emph{any} commands. -(@xref{Echoing, ,Command Echoing}, for a full explanation of @samp{@@}.) - -@node Empty Commands, , Sequences, Commands -@section Using Empty Commands -@cindex empty commands -@cindex commands, empty - -It is sometimes useful to define commands which do nothing. This is done -simply by giving a command that consists of nothing but whitespace. For -example: - -@example -target: ; -@end example - -@noindent -defines an empty command string for @file{target}. You could also use a -line beginning with a tab character to define an empty command string, -but this would be confusing because such a line looks empty. - -@findex .DEFAULT@r{, and empty commands} -You may be wondering why you would want to define a command string that -does nothing. The only reason this is useful is to prevent a target -from getting implicit commands (from implicit rules or the -@code{.DEFAULT} special target; @pxref{Implicit Rules} and -@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill - -You may be inclined to define empty command strings for targets that are -not actual files, but only exist so that their dependencies can be -remade. However, this is not the best way to do that, because the -dependencies may not be remade properly if the target file actually does exist. -@xref{Phony Targets, ,Phony Targets}, for a better way to do this. - -@node Using Variables, Conditionals, Commands, Top -@chapter How to Use Variables -@cindex variable -@cindex value -@cindex recursive variable expansion -@cindex simple variable expansion - -A @dfn{variable} is a name defined in a makefile to represent a string -of text, called the variable's @dfn{value}. These values are -substituted by explicit request into targets, dependencies, commands, -and other parts of the makefile. (In some other versions of @code{make}, -variables are called @dfn{macros}.) -@cindex macro - -Variables and functions in all parts of a makefile are expanded when -read, except for the shell commands in rules, the right-hand sides of -variable definitions using @samp{=}, and the bodies of variable -definitions using the @code{define} directive.@refill - -Variables can represent lists of file names, options to pass to compilers, -programs to run, directories to look in for source files, directories to -write output in, or anything else you can imagine. - -A variable name may be any sequence of characters not containing @samp{:}, -@samp{#}, @samp{=}, or leading or trailing whitespace. However, -variable names containing characters other than letters, numbers, and -underscores should be avoided, as they may be given special meanings in the -future, and with some shells they cannot be passed through the environment to a -sub-@code{make} -(@pxref{Variables/Recursion, ,Communicating Variables to a Sub-@code{make}}). - -Variable names are case-sensitive. The names @samp{foo}, @samp{FOO}, -and @samp{Foo} all refer to different variables. - -It is traditional to use upper case letters in variable names, but we -recommend using lower case letters for variable names that serve internal -purposes in the makefile, and reserving upper case for parameters that -control implicit rules or for parameters that the user should override with -command options (@pxref{Overriding, ,Overriding Variables}). - -A few variables have names that are a single punctuation character or -just a few characters. These are the @dfn{automatic variables}, and -they have particular specialized uses. @xref{Automatic, ,Automatic Variables}. - -@menu -* Reference:: How to use the value of a variable. -* Flavors:: Variables come in two flavors. -* Advanced:: Advanced features for referencing a variable. -* Values:: All the ways variables get their values. -* Setting:: How to set a variable in the makefile. -* Appending:: How to append more text to the old value - of a variable. -* Override Directive:: How to set a variable in the makefile even if - the user has set it with a command argument. -* Defining:: An alternate way to set a variable - to a verbatim string. -* Environment:: Variable values can come from the environment. -* Automatic:: Some special variables have predefined - meanings for use with implicit rules. -@end menu - -@node Reference, Flavors, , Using Variables -@section Basics of Variable References -@cindex variables, how to reference -@cindex reference to variables -@cindex @code{$}, in variable reference -@cindex dollar sign (@code{$}), in variable reference - -To substitute a variable's value, write a dollar sign followed by the name -of the variable in parentheses or braces: either @samp{$(foo)} or -@samp{$@{foo@}} is a valid reference to the variable @code{foo}. This -special significance of @samp{$} is why you must write @samp{$$} to have -the effect of a single dollar sign in a file name or command. - -Variable references can be used in any context: targets, dependencies, -commands, most directives, and new variable values. Here is an -example of a common case, where a variable holds the names of all the -object files in a program: - -@example -@group -objects = program.o foo.o utils.o -program : $(objects) - cc -o program $(objects) - -$(objects) : defs.h -@end group -@end example - -Variable references work by strict textual substitution. Thus, the rule - -@example -@group -foo = c -prog.o : prog.$(foo) - $(foo)$(foo) -$(foo) prog.$(foo) -@end group -@end example - -@noindent -could be used to compile a C program @file{prog.c}. Since spaces before -the variable value are ignored in variable assignments, the value of -@code{foo} is precisely @samp{c}. (Don't actually write your makefiles -this way!) - -A dollar sign followed by a character other than a dollar sign, -open-parenthesis or open-brace treats that single character as the -variable name. Thus, you could reference the variable @code{x} with -@samp{$x}. However, this practice is strongly discouraged, except in -the case of the automatic variables (@pxref{Automatic, ,Automatic Variables}). - -@node Flavors, Advanced, Reference, Using Variables -@section The Two Flavors of Variables -@cindex flavors of variables -@cindex recursive variable expansion -@cindex variables, flavors -@cindex recursively expanded variables -@cindex variables, recursively expanded - -There are two ways that a variable in GNU @code{make} can have a value; -we call them the two @dfn{flavors} of variables. The two flavors are -distinguished in how they are defined and in what they do when expanded. - -@cindex = -The first flavor of variable is a @dfn{recursively expanded} variable. -Variables of this sort are defined by lines using @samp{=} -(@pxref{Setting, ,Setting Variables}) or by the @code{define} directive -(@pxref{Defining, ,Defining Variables Verbatim}). The value you specify -is installed verbatim; if it contains references to other variables, -these references are expanded whenever this variable is substituted (in -the course of expanding some other string). When this happens, it is -called @dfn{recursive expansion}.@refill - -For example, - -@example -foo = $(bar) -bar = $(ugh) -ugh = Huh? - -all:;echo $(foo) -@end example - -@noindent -will echo @samp{Huh?}: @samp{$(foo)} expands to @samp{$(bar)} which -expands to @samp{$(ugh)} which finally expands to @samp{Huh?}.@refill - -This flavor of variable is the only sort supported by other versions of -@code{make}. It has its advantages and its disadvantages. An advantage -(most would say) is that: - -@example -CFLAGS = $(include_dirs) -O -include_dirs = -Ifoo -Ibar -@end example - -@noindent -will do what was intended: when @samp{CFLAGS} is expanded in a command, -it will expand to @samp{-Ifoo -Ibar -O}. A major disadvantage is that you -cannot append something on the end of a variable, as in - -@example -CFLAGS = $(CFLAGS) -O -@end example - -@noindent -because it will cause an infinite loop in the variable expansion. -(Actually @code{make} detects the infinite loop and reports an error.) -@cindex loops in variable expansion -@cindex variables, loops in expansion - -Another disadvantage is that any functions -(@pxref{Functions, ,Functions for Transforming Text}) -referenced in the definition will be executed every time the variable is -expanded. This makes @code{make} run slower; worse, it causes the -@code{wildcard} and @code{shell} functions to give unpredictable results -because you cannot easily control when they are called, or even how many -times. - -To avoid all the problems and inconveniences of recursively expanded -variables, there is another flavor: simply expanded variables. - -@cindex simply expanded variables -@cindex variables, simply expanded -@cindex := -@dfn{Simply expanded variables} are defined by lines using @samp{:=} -(@pxref{Setting, ,Setting Variables}). -The value of a simply expanded variable is scanned -once and for all, expanding any references to other variables and -functions, when the variable is defined. The actual value of the simply -expanded variable is the result of expanding the text that you write. -It does not contain any references to other variables; it contains their -values @emph{as of the time this variable was defined}. Therefore, - -@example -x := foo -y := $(x) bar -x := later -@end example - -@noindent -is equivalent to - -@example -y := foo bar -x := later -@end example - -When a simply expanded variable is referenced, its value is substituted -verbatim. - -Here is a somewhat more complicated example, illustrating the use of -@samp{:=} in conjunction with the @code{shell} function. -(@xref{Shell Function, , The @code{shell} Function}.) This example -also shows use of the variable @code{MAKELEVEL}, which is changed -when it is passed down from level to level. -(@xref{Variables/Recursion, , Communicating Variables to a -Sub-@code{make}}, for information about @code{MAKELEVEL}.) - -@vindex MAKELEVEL -@vindex MAKE -@example -@group -ifeq (0,$@{MAKELEVEL@}) -cur-dir := $(shell pwd) -whoami := $(shell whoami) -host-type := $(shell arch) -MAKE := $@{MAKE@} host-type=$@{host-type@} whoami=$@{whoami@} -endif -@end group -@end example - -@noindent -An advantage of this use of @samp{:=} is that a typical -`descend into a directory' command then looks like this: - -@example -@group -$@{subdirs@}: - $@{MAKE@} cur-dir=$@{cur-dir@}/$@@ -C $@@ all -@end group -@end example - -Simply expanded variables generally make complicated makefile programming -more predictable because they work like variables in most programming -languages. They allow you to redefine a variable using its own value (or -its value processed in some way by one of the expansion functions) and to -use the expansion functions much more efficiently -(@pxref{Functions, ,Functions for Transforming Text}). - -@cindex spaces, in variable values -@cindex whitespace, in variable values -@cindex variables, spaces in values -You can also use them to introduce controlled leading whitespace into -variable values. Leading whitespace characters are discarded from your -input before substitution of variable references and function calls; -this means you can include leading spaces in a variable value by -protecting them with variable references, like this: - -@example -nullstring := -space := $(nullstring) # end of the line -@end example - -@noindent -Here the value of the variable @code{space} is precisely one space. The -comment @w{@samp{# end of the line}} is included here just for clarity. -Since trailing space characters are @emph{not} stripped from variable -values, just a space at the end of the line would have the same effect -(but be rather hard to read). If you put whitespace at the end of a -variable value, it is a good idea to put a comment like that at the end -of the line to make your intent clear. Conversely, if you do @emph{not} -want any whitespace characters at the end of your variable value, you -must remember not to put a random comment on the end of the line after -some whitespace, such as this: - -@example -dir := /foo/bar # directory to put the frobs in -@end example - -@noindent -Here the value of the variable @code{dir} is @w{@samp{/foo/bar }} -(with four trailing spaces), which was probably not the intention. -(Imagine something like @w{@samp{$(dir)/file}} with this definition!) - -@node Advanced, Values, Flavors, Using Variables -@section Advanced Features for Reference to Variables -@cindex reference to variables - -This section describes some advanced features you can use to reference -variables in more flexible ways. - -@menu -* Substitution Refs:: Referencing a variable with - substitutions on the value. -* Computed Names:: Computing the name of the variable to refer to. -@end menu - -@node Substitution Refs, Computed Names, , Advanced -@subsection Substitution References -@cindex modified variable reference -@cindex substitution variable reference -@cindex variables, modified reference -@cindex variables, substitution reference - -@cindex variables, substituting suffix in -@cindex suffix, substituting in variables -A @dfn{substitution reference} substitutes the value of a variable with -alterations that you specify. It has the form -@samp{$(@var{var}:@var{a}=@var{b})} (or -@samp{$@{@var{var}:@var{a}=@var{b}@}}) and its meaning is to take the value -of the variable @var{var}, replace every @var{a} at the end of a word with -@var{b} in that value, and substitute the resulting string. - -When we say ``at the end of a word'', we mean that @var{a} must appear -either followed by whitespace or at the end of the value in order to be -replaced; other occurrences of @var{a} in the value are unaltered. For -example:@refill - -@example -foo := a.o b.o c.o -bar := $(foo:.o=.c) -@end example - -@noindent -sets @samp{bar} to @samp{a.c b.c c.c}. @xref{Setting, ,Setting Variables}. - -A substitution reference is actually an abbreviation for use of the -@code{patsubst} expansion function (@pxref{Text Functions, ,Functions for String Substitution and Analysis}). We provide -substitution references as well as @code{patsubst} for compatibility with -other implementations of @code{make}. - -@findex patsubst -Another type of substitution reference lets you use the full power of -the @code{patsubst} function. It has the same form -@samp{$(@var{var}:@var{a}=@var{b})} described above, except that now -@var{a} must contain a single @samp{%} character. This case is -equivalent to @samp{$(patsubst @var{a},@var{b},$(@var{var}))}. -@xref{Text Functions, ,Functions for String Substitution and Analysis}, -for a description of the @code{patsubst} function.@refill - -@example -@group -@exdent For example: - -foo := a.o b.o c.o -bar := $(foo:%.o=%.c) -@end group -@end example - -@noindent -sets @samp{bar} to @samp{a.c b.c c.c}. - -@node Computed Names, , Substitution Refs, Advanced -@subsection Computed Variable Names -@cindex nested variable reference -@cindex computed variable name -@cindex variables, computed names -@cindex variables, nested references -@cindex variables, @samp{$} in name -@cindex @code{$}, in variable name -@cindex dollar sign (@code{$}), in variable name - -Computed variable names are a complicated concept needed only for -sophisticated makefile programming. For most purposes you need not -consider them, except to know that making a variable with a dollar sign -in its name might have strange results. However, if you are the type -that wants to understand everything, or you are actually interested in -what they do, read on. - -Variables may be referenced inside the name of a variable. This is -called a @dfn{computed variable name} or a @dfn{nested variable -reference}. For example, - -@example -x = y -y = z -a := $($(x)) -@end example - -@noindent -defines @code{a} as @samp{z}: the @samp{$(x)} inside @samp{$($(x))} expands -to @samp{y}, so @samp{$($(x))} expands to @samp{$(y)} which in turn expands -to @samp{z}. Here the name of the variable to reference is not stated -explicitly; it is computed by expansion of @samp{$(x)}. The reference -@samp{$(x)} here is nested within the outer variable reference. - -The previous example shows two levels of nesting, but any number of levels -is possible. For example, here are three levels: - -@example -x = y -y = z -z = u -a := $($($(x))) -@end example - -@noindent -Here the innermost @samp{$(x)} expands to @samp{y}, so @samp{$($(x))} -expands to @samp{$(y)} which in turn expands to @samp{z}; now we have -@samp{$(z)}, which becomes @samp{u}. - -References to recursively-expanded variables within a variable name are -reexpanded in the usual fashion. For example: - -@example -x = $(y) -y = z -z = Hello -a := $($(x)) -@end example - -@noindent -defines @code{a} as @samp{Hello}: @samp{$($(x))} becomes @samp{$($(y))} -which becomes @samp{$(z)} which becomes @samp{Hello}. - -Nested variable references can also contain modified references and -function invocations (@pxref{Functions, ,Functions for Transforming Text}), -just like any other reference. -For example, using the @code{subst} function -(@pxref{Text Functions, ,Functions for String Substitution and Analysis}): - -@example -@group -x = variable1 -variable2 := Hello -y = $(subst 1,2,$(x)) -z = y -a := $($($(z))) -@end group -@end example - -@noindent -eventually defines @code{a} as @samp{Hello}. It is doubtful that anyone -would ever want to write a nested reference as convoluted as this one, but -it works: @samp{$($($(z)))} expands to @samp{$($(y))} which becomes -@samp{$($(subst 1,2,$(x)))}. This gets the value @samp{variable1} from -@code{x} and changes it by substitution to @samp{variable2}, so that the -entire string becomes @samp{$(variable2)}, a simple variable reference -whose value is @samp{Hello}.@refill - -A computed variable name need not consist entirely of a single variable -reference. It can contain several variable references, as well as some -invariant text. For example, - -@example -@group -a_dirs := dira dirb -1_dirs := dir1 dir2 -@end group - -@group -a_files := filea fileb -1_files := file1 file2 -@end group - -@group -ifeq "$(use_a)" "yes" -a1 := a -else -a1 := 1 -endif -@end group - -@group -ifeq "$(use_dirs)" "yes" -df := dirs -else -df := files -endif - -dirs := $($(a1)_$(df)) -@end group -@end example - -@noindent -will give @code{dirs} the same value as @code{a_dirs}, @code{1_dirs}, -@code{a_files} or @code{1_files} depending on the settings of @code{use_a} -and @code{use_dirs}.@refill - -Computed variable names can also be used in substitution references: - -@example -@group -a_objects := a.o b.o c.o -1_objects := 1.o 2.o 3.o - -sources := $($(a1)_objects:.o=.c) -@end group -@end example - -@noindent -defines @code{sources} as either @samp{a.c b.c c.c} or @samp{1.c 2.c 3.c}, -depending on the value of @code{a1}. - -The only restriction on this sort of use of nested variable references -is that they cannot specify part of the name of a function to be called. -This is because the test for a recognized function name is done before -the expansion of nested references. For example, - -@example -@group -ifdef do_sort -func := sort -else -func := strip -endif -@end group - -@group -bar := a d b g q c -@end group - -@group -foo := $($(func) $(bar)) -@end group -@end example - -@noindent -attempts to give @samp{foo} the value of the variable @samp{sort a d b g -q c} or @samp{strip a d b g q c}, rather than giving @samp{a d b g q c} -as the argument to either the @code{sort} or the @code{strip} function. -This restriction could be removed in the future if that change is shown -to be a good idea. - -You can also use computed variable names in the left-hand side of a -variable assignment, or in a @code{define} directive, as in: - -@example -dir = foo -$(dir)_sources := $(wildcard $(dir)/*.c) -define $(dir)_print -lpr $($(dir)_sources) -endef -@end example - -@noindent -This example defines the variables @samp{dir}, @samp{foo_sources}, and -@samp{foo_print}. - -Note that @dfn{nested variable references} are quite different from -@dfn{recursively expanded variables} -(@pxref{Flavors, ,The Two Flavors of Variables}), though both are -used together in complex ways when doing makefile programming.@refill - -@node Values, Setting, Advanced, Using Variables -@section How Variables Get Their Values -@cindex variables, how they get their values -@cindex value, how a variable gets it - -Variables can get values in several different ways: - -@itemize @bullet -@item -You can specify an overriding value when you run @code{make}. -@xref{Overriding, ,Overriding Variables}. - -@item -You can specify a value in the makefile, either -with an assignment (@pxref{Setting, ,Setting Variables}) or with a -verbatim definition (@pxref{Defining, ,Defining Variables Verbatim}).@refill - -@item -Variables in the environment become @code{make} variables. -@xref{Environment, ,Variables from the Environment}. - -@item -Several @dfn{automatic} variables are given new values for each rule. -Each of these has a single conventional use. -@xref{Automatic, ,Automatic Variables}. - -@item -Several variables have constant initial values. -@xref{Implicit Variables, ,Variables Used by Implicit Rules}. -@end itemize - -@node Setting, Appending, Values, Using Variables -@section Setting Variables -@cindex setting variables -@cindex variables, setting -@cindex = -@cindex := - -To set a variable from the makefile, write a line starting with the -variable name followed by @samp{=} or @samp{:=}. Whatever follows the -@samp{=} or @samp{:=} on the line becomes the value. For example, - -@example -objects = main.o foo.o bar.o utils.o -@end example - -@noindent -defines a variable named @code{objects}. Whitespace around the variable -name and immediately after the @samp{=} is ignored. - -Variables defined with @samp{=} are @dfn{recursively expanded} variables. -Variables defined with @samp{:=} are @dfn{simply expanded} variables; these -definitions can contain variable references which will be expanded before -the definition is made. @xref{Flavors, ,The Two Flavors of Variables}. - -The variable name may contain function and variable references, which -are expanded when the line is read to find the actual variable name to use. - -There is no limit on the length of the value of a variable except the -amount of swapping space on the computer. When a variable definition is -long, it is a good idea to break it into several lines by inserting -backslash-newline at convenient places in the definition. This will not -affect the functioning of @code{make}, but it will make the makefile easier -to read. - -Most variable names are considered to have the empty string as a value if -you have never set them. Several variables have built-in initial values -that are not empty, but you can set them in the usual ways -(@pxref{Implicit Variables, ,Variables Used by Implicit Rules}). -Several special variables are set -automatically to a new value for each rule; these are called the -@dfn{automatic} variables (@pxref{Automatic, ,Automatic Variables}). - -@node Appending, Override Directive, Setting, Using Variables -@section Appending More Text to Variables -@cindex += -@cindex appending to variables -@cindex variables, appending to - -Often it is useful to add more text to the value of a variable already defined. -You do this with a line containing @samp{+=}, like this: - -@example -objects += another.o -@end example - -@noindent -This takes the value of the variable @code{objects}, and adds the text -@samp{another.o} to it (preceded by a single space). Thus: - -@example -objects = main.o foo.o bar.o utils.o -objects += another.o -@end example - -@noindent -sets @code{objects} to @samp{main.o foo.o bar.o utils.o another.o}. - -Using @samp{+=} is similar to: - -@example -objects = main.o foo.o bar.o utils.o -objects := $(objects) another.o -@end example - -@noindent -but differs in ways that become important when you use more complex values. - -When the variable in question has not been defined before, @samp{+=} -acts just like normal @samp{=}: it defines a recursively-expanded -variable. However, when there @emph{is} a previous definition, exactly -what @samp{+=} does depends on what flavor of variable you defined -originally. @xref{Flavors, ,The Two Flavors of Variables}, for an -explanation of the two flavors of variables. - -When you add to a variable's value with @samp{+=}, @code{make} acts -essentially as if you had included the extra text in the initial -definition of the variable. If you defined it first with @samp{:=}, -making it a simply-expanded variable, @samp{+=} adds to that -simply-expanded definition, and expands the new text before appending it -to the old value just as @samp{:=} does -(@pxref{Setting, ,Setting Variables}, for a full explanation of @samp{:=}). -In fact, - -@example -variable := value -variable += more -@end example - -@noindent -is exactly equivalent to: - -@noindent -@example -variable := value -variable := $(variable) more -@end example - -On the other hand, when you use @samp{+=} with a variable that you defined -first to be recursively-expanded using plain @samp{=}, @code{make} does -something a bit different. Recall that when you define a -recursively-expanded variable, @code{make} does not expand the value you set -for variable and function references immediately. Instead it stores the text -verbatim, and saves these variable and function references to be expanded -later, when you refer to the new variable (@pxref{Flavors, ,The Two Flavors -of Variables}). When you use @samp{+=} on a recursively-expanded variable, -it is this unexpanded text to which @code{make} appends the new text you -specify. - -@example -@group -variable = value -variable += more -@end group -@end example - -@noindent -is roughly equivalent to: - -@example -@group -temp = value -variable = $(temp) more -@end group -@end example - -@noindent -except that of course it never defines a variable called @code{temp}. -The importance of this comes when the variable's old value contains -variable references. Take this common example: - -@example -CFLAGS = $(includes) -O -@dots{} -CFLAGS += -pg # enable profiling -@end example - -@noindent -The first line defines the @code{CFLAGS} variable with a reference to another -variable, @code{includes}. (@code{CFLAGS} is used by the rules for C -compilation; @pxref{Catalogue of Rules, ,Catalogue of Implicit Rules}.) -Using @samp{=} for the definition makes @code{CFLAGS} a recursively-expanded -variable, meaning @w{@samp{$(includes) -O}} is @emph{not} expanded when -@code{make} processes the definition of @code{CFLAGS}. Thus, @code{includes} -need not be defined yet for its value to take effect. It only has to be -defined before any reference to @code{CFLAGS}. If we tried to append to the -value of @code{CFLAGS} without using @samp{+=}, we might do it like this: - -@example -CFLAGS := $(CFLAGS) -pg # enable profiling -@end example - -@noindent -This is pretty close, but not quite what we want. Using @samp{:=} -redefines @code{CFLAGS} as a simply-expanded variable; this means -@code{make} expands the text @w{@samp{$(CFLAGS) -pg}} before setting the -variable. If @code{includes} is not yet defined, we get @w{@samp{ -O --pg}}, and a later definition of @code{includes} will have no effect. -Conversely, by using @samp{+=} we set @code{CFLAGS} to the -@emph{unexpanded} value @w{@samp{$(includes) -O -pg}}. Thus we preserve -the reference to @code{includes}, so if that variable gets defined at -any later point, a reference like @samp{$(CFLAGS)} still uses its -value. - -@node Override Directive, Defining, Appending, Using Variables -@section The @code{override} Directive -@findex override -@cindex overriding with @code{override} -@cindex variables, overriding - -If a variable has been set with a command argument -(@pxref{Overriding, ,Overriding Variables}), -then ordinary assignments in the makefile are ignored. If you want to set -the variable in the makefile even though it was set with a command -argument, you can use an @code{override} directive, which is a line that -looks like this:@refill - -@example -override @var{variable} = @var{value} -@end example - -@noindent -or - -@example -override @var{variable} := @var{value} -@end example - -To append more text to a variable defined on the command line, use: - -@example -override @var{variable} += @var{more text} -@end example - -@noindent -@xref{Appending, ,Appending More Text to Variables}. - -The @code{override} directive was not invented for escalation in the war -between makefiles and command arguments. It was invented so you can alter -and add to values that the user specifies with command arguments. - -For example, suppose you always want the @samp{-g} switch when you run the -C compiler, but you would like to allow the user to specify the other -switches with a command argument just as usual. You could use this -@code{override} directive: - -@example -override CFLAGS += -g -@end example - -You can also use @code{override} directives with @code{define} directives. -This is done as you might expect: - -@example -override define foo -bar -endef -@end example - -@noindent -@iftex -See the next section for information about @code{define}. -@end iftex -@ifinfo -@xref{Defining, ,Defining Variables Verbatim}. -@end ifinfo - -@node Defining, Environment, Override Directive, Using Variables -@section Defining Variables Verbatim -@findex define -@findex endef -@cindex verbatim variable definition -@cindex defining variables verbatim -@cindex variables, defining verbatim - -Another way to set the value of a variable is to use the @code{define} -directive. This directive has an unusual syntax which allows newline -characters to be included in the value, which is convenient for defining -canned sequences of commands -(@pxref{Sequences, ,Defining Canned Command Sequences}). - -The @code{define} directive is followed on the same line by the name of the -variable and nothing more. The value to give the variable appears on the -following lines. The end of the value is marked by a line containing just -the word @code{endef}. Aside from this difference in syntax, @code{define} -works just like @samp{=}: it creates a recursively-expanded variable -(@pxref{Flavors, ,The Two Flavors of Variables}). -The variable name may contain function and variable references, which -are expanded when the directive is read to find the actual variable name -to use. - -@example -define two-lines -echo foo -echo $(bar) -endef -@end example - -The value in an ordinary assignment cannot contain a newline; but the -newlines that separate the lines of the value in a @code{define} become -part of the variable's value (except for the final newline which precedes -the @code{endef} and is not considered part of the value).@refill - -@need 800 -The previous example is functionally equivalent to this: - -@example -two-lines = echo foo; echo $(bar) -@end example - -@noindent -since two commands separated by semicolon behave much like two separate -shell commands. However, note that using two separate lines means -@code{make} will invoke the shell twice, running an independent subshell -for each line. @xref{Execution, ,Command Execution}. - -If you want variable definitions made with @code{define} to take -precedence over command-line variable definitions, you can use the -@code{override} directive together with @code{define}: - -@example -override define two-lines -foo -$(bar) -endef -@end example - -@noindent -@xref{Override Directive, ,The @code{override} Directive}. - -@node Environment, , Defining, Using Variables -@section Variables from the Environment - -@cindex variables, environment -@cindex environment -Variables in @code{make} can come from the environment in which -@code{make} is run. Every environment variable that @code{make} sees when -it starts up is transformed into a @code{make} variable with the same name -and value. But an explicit assignment in the makefile, or with a command -argument, overrides the environment. (If the @samp{-e} flag is specified, -then values from the environment override assignments in the makefile. -@xref{Options Summary, ,Summary of Options}. -But this is not recommended practice.) - -Thus, by setting the variable @code{CFLAGS} in your environment, you can -cause all C compilations in most makefiles to use the compiler switches you -prefer. This is safe for variables with standard or conventional meanings -because you know that no makefile will use them for other things. (But -this is not totally reliable; some makefiles set @code{CFLAGS} explicitly -and therefore are not affected by the value in the environment.) - -When @code{make} is invoked recursively, variables defined in the -outer invocation can be passed to inner invocations through the -environment (@pxref{Recursion, ,Recursive Use of @code{make}}). By -default, only variables that came from the environment or the command -line are passed to recursive invocations. You can use the -@code{export} directive to pass other variables. -@xref{Variables/Recursion, , Communicating Variables to a -Sub-@code{make}}, for full details. - -Other use of variables from the environment is not recommended. It is not -wise for makefiles to depend for their functioning on environment variables -set up outside their control, since this would cause different users to get -different results from the same makefile. This is against the whole -purpose of most makefiles. - -Such problems would be especially likely with the variable @code{SHELL}, -which is normally present in the environment to specify the user's choice -of interactive shell. It would be very undesirable for this choice to -affect @code{make}. So @code{make} ignores the environment value of -@code{SHELL}.@refill - -@node Conditionals, Functions, Using Variables, Top -@chapter Conditional Parts of Makefiles - -@cindex conditionals -A @dfn{conditional} causes part of a makefile to be obeyed or ignored -depending on the values of variables. Conditionals can compare the -value of one variable to another, or the value of a variable to -a constant string. Conditionals control what @code{make} actually -``sees'' in the makefile, so they @emph{cannot} be used to control shell -commands at the time of execution.@refill - -@menu -* Conditional Example:: Example of a conditional -* Conditional Syntax:: The syntax of conditionals. -* Testing Flags:: Conditionals that test flags. -@end menu - -@node Conditional Example, Conditional Syntax, , Conditionals -@section Example of a Conditional - -The following example of a conditional tells @code{make} to use one set -of libraries if the @code{CC} variable is @samp{gcc}, and a different -set of libraries otherwise. It works by controlling which of two -command lines will be used as the command for a rule. The result is -that @samp{CC=gcc} as an argument to @code{make} changes not only which -compiler is used but also which libraries are linked. - -@example -libs_for_gcc = -lgnu -normal_libs = - -foo: $(objects) -ifeq ($(CC),gcc) - $(CC) -o foo $(objects) $(libs_for_gcc) -else - $(CC) -o foo $(objects) $(normal_libs) -endif -@end example - -This conditional uses three directives: one @code{ifeq}, one @code{else} -and one @code{endif}. - -The @code{ifeq} directive begins the conditional, and specifies the -condition. It contains two arguments, separated by a comma and surrounded -by parentheses. Variable substitution is performed on both arguments and -then they are compared. The lines of the makefile following the -@code{ifeq} are obeyed if the two arguments match; otherwise they are -ignored. - -The @code{else} directive causes the following lines to be obeyed if the -previous conditional failed. In the example above, this means that the -second alternative linking command is used whenever the first alternative -is not used. It is optional to have an @code{else} in a conditional. - -The @code{endif} directive ends the conditional. Every conditional must -end with an @code{endif}. Unconditional makefile text follows. - -As this example illustrates, conditionals work at the textual level: -the lines of the conditional are treated as part of the makefile, or -ignored, according to the condition. This is why the larger syntactic -units of the makefile, such as rules, may cross the beginning or the -end of the conditional. - -When the variable @code{CC} has the value @samp{gcc}, the above example has -this effect: - -@example -foo: $(objects) - $(CC) -o foo $(objects) $(libs_for_gcc) -@end example - -@noindent -When the variable @code{CC} has any other value, the effect is this: - -@example -foo: $(objects) - $(CC) -o foo $(objects) $(normal_libs) -@end example - -Equivalent results can be obtained in another way by conditionalizing a -variable assignment and then using the variable unconditionally: - -@example -libs_for_gcc = -lgnu -normal_libs = - -ifeq ($(CC),gcc) - libs=$(libs_for_gcc) -else - libs=$(normal_libs) -endif - -foo: $(objects) - $(CC) -o foo $(objects) $(libs) -@end example - -@node Conditional Syntax, Testing Flags, Conditional Example, Conditionals -@section Syntax of Conditionals -@findex ifdef -@findex ifeq -@findex ifndef -@findex ifneq -@findex else -@findex endif - -The syntax of a simple conditional with no @code{else} is as follows: - -@example -@var{conditional-directive} -@var{text-if-true} -endif -@end example - -@noindent -The @var{text-if-true} may be any lines of text, to be considered as part -of the makefile if the condition is true. If the condition is false, no -text is used instead. - -The syntax of a complex conditional is as follows: - -@example -@var{conditional-directive} -@var{text-if-true} -else -@var{text-if-false} -endif -@end example - -@noindent -If the condition is true, @var{text-if-true} is used; otherwise, -@var{text-if-false} is used instead. The @var{text-if-false} can be any -number of lines of text. - -The syntax of the @var{conditional-directive} is the same whether the -conditional is simple or complex. There are four different directives that -test different conditions. Here is a table of them: - -@table @code -@item ifeq (@var{arg1}, @var{arg2}) -@itemx ifeq '@var{arg1}' '@var{arg2}' -@itemx ifeq "@var{arg1}" "@var{arg2}" -@itemx ifeq "@var{arg1}" '@var{arg2}' -@itemx ifeq '@var{arg1}' "@var{arg2}" -Expand all variable references in @var{arg1} and @var{arg2} and -compare them. If they are identical, the @var{text-if-true} is -effective; otherwise, the @var{text-if-false}, if any, is effective. - -Often you want to test if a variable has a non-empty value. When the -value results from complex expansions of variables and functions, -expansions you would consider empty may actually contain whitespace -characters and thus are not seen as empty. However, you can use the -@code{strip} function (@pxref{Text Functions}) to avoid interpreting -whitespace as a non-empty value. For example: - -@example -@group -ifeq ($(strip $(foo)),) -@var{text-if-empty} -endif -@end group -@end example - -@noindent -will evaluate @var{text-if-empty} even if the expansion of -@code{$(foo)} contains whitespace characters. - -@item ifneq (@var{arg1}, @var{arg2}) -@itemx ifneq '@var{arg1}' '@var{arg2}' -@itemx ifneq "@var{arg1}" "@var{arg2}" -@itemx ifneq "@var{arg1}" '@var{arg2}' -@itemx ifneq '@var{arg1}' "@var{arg2}" -Expand all variable references in @var{arg1} and @var{arg2} and -compare them. If they are different, the @var{text-if-true} is -effective; otherwise, the @var{text-if-false}, if any, is effective. - -@item ifdef @var{variable-name} -If the variable @var{variable-name} has a non-empty value, the -@var{text-if-true} is effective; otherwise, the @var{text-if-false}, -if any, is effective. Variables that have never been defined have an -empty value. - -Note that @code{ifdef} only tests whether a variable has a value. It -does not expand the variable to see if that value is nonempty. -Consequently, tests using @code{ifdef} return true for all definitions -except those like @code{foo =}. To test for an empty value, use -@w{@code{ifeq ($(foo),)}}. For example, - -@example -bar = -foo = $(bar) -ifdef foo -frobozz = yes -else -frobozz = no -endif -@end example - -@noindent -sets @samp{frobozz} to @samp{yes}, while: - -@example -foo = -ifdef foo -frobozz = yes -else -frobozz = no -endif -@end example - -@noindent -sets @samp{frobozz} to @samp{no}. - -@item ifndef @var{variable-name} -If the variable @var{variable-name} has an empty value, the -@var{text-if-true} is effective; otherwise, the @var{text-if-false}, -if any, is effective. -@end table - -Extra spaces are allowed and ignored at the beginning of the conditional -directive line, but a tab is not allowed. (If the line begins with a tab, -it will be considered a command for a rule.) Aside from this, extra spaces -or tabs may be inserted with no effect anywhere except within the directive -name or within an argument. A comment starting with @samp{#} may appear at -the end of the line. - -The other two directives that play a part in a conditional are @code{else} -and @code{endif}. Each of these directives is written as one word, with no -arguments. Extra spaces are allowed and ignored at the beginning of the -line, and spaces or tabs at the end. A comment starting with @samp{#} may -appear at the end of the line. - -Conditionals affect which lines of the makefile @code{make} uses. If -the condition is true, @code{make} reads the lines of the -@var{text-if-true} as part of the makefile; if the condition is false, -@code{make} ignores those lines completely. It follows that syntactic -units of the makefile, such as rules, may safely be split across the -beginning or the end of the conditional.@refill - -@code{make} evaluates conditionals when it reads a makefile. -Consequently, you cannot use automatic variables in the tests of -conditionals because they are not defined until commands are run -(@pxref{Automatic, , Automatic Variables}). - -To prevent intolerable confusion, it is not permitted to start a -conditional in one makefile and end it in another. However, you may -write an @code{include} directive within a conditional, provided you do -not attempt to terminate the conditional inside the included file. - -@node Testing Flags, , Conditional Syntax, Conditionals -@section Conditionals that Test Flags - -You can write a conditional that tests @code{make} command flags such as -@samp{-t} by using the variable @code{MAKEFLAGS} together with the -@code{findstring} function -(@pxref{Text Functions, , Functions for String Substitution and Analysis}). -This is useful when @code{touch} is not enough to make a file appear up -to date. - -The @code{findstring} function determines whether one string appears as a -substring of another. If you want to test for the @samp{-t} flag, -use @samp{t} as the first string and the value of @code{MAKEFLAGS} as -the other. - -For example, here is how to arrange to use @samp{ranlib -t} to finish -marking an archive file up to date: - -@example -archive.a: @dots{} -ifneq (,$(findstring t,$(MAKEFLAGS))) - +touch archive.a - +ranlib -t archive.a -else - ranlib archive.a -endif -@end example - -@noindent -The @samp{+} prefix marks those command lines as ``recursive'' so -that they will be executed despite use of the @samp{-t} flag. -@xref{Recursion, ,Recursive Use of @code{make}}. - -@node Functions, Running, Conditionals, Top -@chapter Functions for Transforming Text -@cindex functions - -@dfn{Functions} allow you to do text processing in the makefile to compute -the files to operate on or the commands to use. You use a function in a -@dfn{function call}, where you give the name of the function and some text -(the @dfn{arguments}) for the function to operate on. The result of the -function's processing is substituted into the makefile at the point of the -call, just as a variable might be substituted. - -@menu -* Syntax of Functions:: How to write a function call. -* Text Functions:: General-purpose text manipulation functions. -* Filename Functions:: Functions for manipulating file names. -* Foreach Function:: Repeat some text with controlled variation. -* Origin Function:: Find where a variable got its value. -* Shell Function:: Substitute the output of a shell command. -@end menu - -@node Syntax of Functions, Text Functions, , Functions -@section Function Call Syntax -@cindex @code{$}, in function call -@cindex dollar sign (@code{$}), in function call -@cindex arguments of functions -@cindex functions, syntax of - -A function call resembles a variable reference. It looks like this: - -@example -$(@var{function} @var{arguments}) -@end example - -@noindent -or like this: - -@example -$@{@var{function} @var{arguments}@} -@end example - -Here @var{function} is a function name; one of a short list of names that -are part of @code{make}. There is no provision for defining new functions. - -The @var{arguments} are the arguments of the function. They are -separated from the function name by one or more spaces or tabs, and if -there is more than one argument, then they are separated by commas. -Such whitespace and commas are not part of an argument's value. The -delimiters which you use to surround the function call, whether -parentheses or braces, can appear in an argument only in matching pairs; -the other kind of delimiters may appear singly. If the arguments -themselves contain other function calls or variable references, it is -wisest to use the same kind of delimiters for all the references; write -@w{@samp{$(subst a,b,$(x))}}, not @w{@samp{$(subst a,b,$@{x@})}}. This -is because it is clearer, and because only one type of delimiter is -matched to find the end of the reference. - -The text written for each argument is processed by substitution of -variables and function calls to produce the argument value, which -is the text on which the function acts. The substitution is done in the -order in which the arguments appear. - -Commas and unmatched parentheses or braces cannot appear in the text of an -argument as written; leading spaces cannot appear in the text of the first -argument as written. These characters can be put into the argument value -by variable substitution. First define variables @code{comma} and -@code{space} whose values are isolated comma and space characters, then -substitute these variables where such characters are wanted, like this: - -@example -@group -comma:= , -empty:= -space:= $(empty) $(empty) -foo:= a b c -bar:= $(subst $(space),$(comma),$(foo)) -# @r{bar is now `a,b,c'.} -@end group -@end example - -@noindent -Here the @code{subst} function replaces each space with a comma, through -the value of @code{foo}, and substitutes the result. - -@node Text Functions, Filename Functions, Syntax of Functions, Functions -@section Functions for String Substitution and Analysis -@cindex functions, for text - -Here are some functions that operate on strings: - -@table @code -@item $(subst @var{from},@var{to},@var{text}) -@findex subst -Performs a textual replacement on the text @var{text}: each occurrence -of @var{from} is replaced by @var{to}. The result is substituted for -the function call. For example, - -@example -$(subst ee,EE,feet on the street) -@end example - -substitutes the string @samp{fEEt on the strEEt}. - -@item $(patsubst @var{pattern},@var{replacement},@var{text}) -@findex patsubst -Finds whitespace-separated words in @var{text} that match -@var{pattern} and replaces them with @var{replacement}. Here -@var{pattern} may contain a @samp{%} which acts as a wildcard, -matching any number of any characters within a word. If -@var{replacement} also contains a @samp{%}, the @samp{%} is replaced -by the text that matched the @samp{%} in @var{pattern}.@refill - -@cindex @code{%}, quoting in @code{patsubst} -@cindex @code{%}, quoting with @code{\} (backslash) -@cindex @code{\} (backslash), to quote @code{%} -@cindex backslash (@code{\}), to quote @code{%} -@cindex quoting @code{%}, in @code{patsubst} -@samp{%} characters in @code{patsubst} function invocations can be -quoted with preceding backslashes (@samp{\}). Backslashes that would -otherwise quote @samp{%} characters can be quoted with more backslashes. -Backslashes that quote @samp{%} characters or other backslashes are -removed from the pattern before it is compared file names or has a stem -substituted into it. Backslashes that are not in danger of quoting -@samp{%} characters go unmolested. For example, the pattern -@file{the\%weird\\%pattern\\} has @samp{the%weird\} preceding the -operative @samp{%} character, and @samp{pattern\\} following it. The -final two backslashes are left alone because they cannot affect any -@samp{%} character.@refill - -Whitespace between words is folded into single space characters; -leading and trailing whitespace is discarded. - -For example, - -@example -$(patsubst %.c,%.o,x.c.c bar.c) -@end example - -@noindent -produces the value @samp{x.c.o bar.o}. - -Substitution references (@pxref{Substitution Refs, ,Substitution -References}) are a simpler way to get the effect of the @code{patsubst} -function: - -@example -$(@var{var}:@var{pattern}=@var{replacement}) -@end example - -@noindent -is equivalent to - -@example -$(patsubst @var{pattern},@var{replacement},$(@var{var})) -@end example - -The second shorthand simplifies one of the most common uses of -@code{patsubst}: replacing the suffix at the end of file names. - -@example -$(@var{var}:@var{suffix}=@var{replacement}) -@end example - -@noindent -is equivalent to - -@example -$(patsubst %@var{suffix},%@var{replacement},$(@var{var})) -@end example - -@noindent -For example, you might have a list of object files: - -@example -objects = foo.o bar.o baz.o -@end example - -@noindent -To get the list of corresponding source files, you could simply write: - -@example -$(objects:.o=.c) -@end example - -@noindent -instead of using the general form: - -@example -$(patsubst %.o,%.c,$(objects)) -@end example - -@item $(strip @var{string}) -@cindex stripping whitespace -@cindex whitespace, stripping -@cindex spaces, stripping -@findex strip -Removes leading and trailing whitespace from @var{string} and replaces -each internal sequence of one or more whitespace characters with a -single space. Thus, @samp{$(strip a b c )} results in @w{@samp{a b c}}. - -The function @code{strip} can be very useful when used in conjunction -with conditionals. When comparing something with the empty string -@samp{} using @code{ifeq} or @code{ifneq}, you usually want a string of -just whitespace to match the empty string (@pxref{Conditionals}). - -Thus, the following may fail to have the desired results: - -@example -.PHONY: all -ifneq "$(needs_made)" "" -all: $(needs_made) -else -all:;@@echo 'Nothing to make!' -endif -@end example - -@noindent -Replacing the variable reference @w{@samp{$(needs_made)}} with the -function call @w{@samp{$(strip $(needs_made))}} in the @code{ifneq} -directive would make it more robust.@refill - -@item $(findstring @var{find},@var{in}) -@findex findstring -@cindex searching for strings -@cindex finding strings -@cindex strings, searching for -Searches @var{in} for an occurrence of @var{find}. If it occurs, the -value is @var{find}; otherwise, the value is empty. You can use this -function in a conditional to test for the presence of a specific -substring in a given string. Thus, the two examples, - -@example -$(findstring a,a b c) -$(findstring a,b c) -@end example - -@noindent -produce the values @samp{a} and @samp{} (the empty string), -respectively. @xref{Testing Flags}, for a practical application of -@code{findstring}.@refill - -@need 750 -@findex filter -@cindex filtering words -@cindex words, filtering -@item $(filter @var{pattern}@dots{},@var{text}) -Removes all whitespace-separated words in @var{text} that do -@emph{not} match any of the @var{pattern} words, returning only -matching words. The patterns are written using @samp{%}, just like -the patterns used in the @code{patsubst} function above.@refill - -The @code{filter} function can be used to separate out different types -of strings (such as file names) in a variable. For example: - -@example -sources := foo.c bar.c baz.s ugh.h -foo: $(sources) - cc $(filter %.c %.s,$(sources)) -o foo -@end example - -@noindent -says that @file{foo} depends of @file{foo.c}, @file{bar.c}, -@file{baz.s} and @file{ugh.h} but only @file{foo.c}, @file{bar.c} and -@file{baz.s} should be specified in the command to the -compiler.@refill - -@item $(filter-out @var{pattern}@dots{},@var{text}) -@findex filter-out -@cindex filtering out words -@cindex words, filtering out -Removes all whitespace-separated words in @var{text} that @emph{do} -match the @var{pattern} words, returning only the words that @emph{do -not} match. This is the exact opposite of the @code{filter} -function.@refill - -For example, given: - -@example -@group -objects=main1.o foo.o main2.o bar.o -mains=main1.o main2.o -@end group -@end example - -@noindent -the following generates a list which contains all the object files not -in @samp{mains}: - -@example -$(filter-out $(mains),$(objects)) -@end example - -@need 1500 -@findex sort -@cindex sorting words -@item $(sort @var{list}) -Sorts the words of @var{list} in lexical order, removing duplicate -words. The output is a list of words separated by single spaces. -Thus, - -@example -$(sort foo bar lose) -@end example - -@noindent -returns the value @samp{bar foo lose}. - -@cindex removing duplicate words -@cindex duplicate words, removing -@cindex words, removing duplicates -Incidentally, since @code{sort} removes duplicate words, you can use -it for this purpose even if you don't care about the sort order. -@end table - -Here is a realistic example of the use of @code{subst} and -@code{patsubst}. Suppose that a makefile uses the @code{VPATH} variable -to specify a list of directories that @code{make} should search for -dependency files -(@pxref{General Search, , @code{VPATH} Search Path for All Dependencies}). -This example shows how to -tell the C compiler to search for header files in the same list of -directories.@refill - -The value of @code{VPATH} is a list of directories separated by colons, -such as @samp{src:../headers}. First, the @code{subst} function is used to -change the colons to spaces: - -@example -$(subst :, ,$(VPATH)) -@end example - -@noindent -This produces @samp{src ../headers}. Then @code{patsubst} is used to turn -each directory name into a @samp{-I} flag. These can be added to the -value of the variable @code{CFLAGS}, which is passed automatically to the C -compiler, like this: - -@example -override CFLAGS += $(patsubst %,-I%,$(subst :, ,$(VPATH))) -@end example - -@noindent -The effect is to append the text @samp{-Isrc -I../headers} to the -previously given value of @code{CFLAGS}. The @code{override} directive is -used so that the new value is assigned even if the previous value of -@code{CFLAGS} was specified with a command argument (@pxref{Override -Directive, , The @code{override} Directive}). - -@node Filename Functions, Foreach Function, Text Functions, Functions -@section Functions for File Names -@cindex functions, for file names -@cindex file name functions - -Several of the built-in expansion functions relate specifically to -taking apart file names or lists of file names. - -Each of the following functions performs a specific transformation on a -file name. The argument of the function is regarded as a series of file -names, separated by whitespace. (Leading and trailing whitespace is -ignored.) Each file name in the series is transformed in the same way and -the results are concatenated with single spaces between them. - -@table @code -@item $(dir @var{names}@dots{}) -@findex dir -@cindex directory part -@cindex file name, directory part -Extracts the directory-part of each file name in @var{names}. The -directory-part of the file name is everything up through (and -including) the last slash in it. If the file name contains no slash, -the directory part is the string @samp{./}. For example, - -@example -$(dir src/foo.c hacks) -@end example - -@noindent -produces the result @samp{src/ ./}. - -@item $(notdir @var{names}@dots{}) -@findex notdir -@cindex file name, nondirectory part -@cindex nondirectory part -Extracts all but the directory-part of each file name in @var{names}. -If the file name contains no slash, it is left unchanged. Otherwise, -everything through the last slash is removed from it. - -A file name that ends with a slash becomes an empty string. This is -unfortunate, because it means that the result does not always have the -same number of whitespace-separated file names as the argument had; -but we do not see any other valid alternative. - -For example, - -@example -$(notdir src/foo.c hacks) -@end example - -@noindent -produces the result @samp{foo.c hacks}. - -@item $(suffix @var{names}@dots{}) -@findex suffix -@cindex suffix, function to find -@cindex file name suffix -Extracts the suffix of each file name in @var{names}. If the file name -contains a period, the suffix is everything starting with the last -period. Otherwise, the suffix is the empty string. This frequently -means that the result will be empty when @var{names} is not, and if -@var{names} contains multiple file names, the result may contain fewer -file names. - -For example, - -@example -$(suffix src/foo.c hacks) -@end example - -@noindent -produces the result @samp{.c}. - -@item $(basename @var{names}@dots{}) -@findex basename -@cindex basename -@cindex file name, basename of -Extracts all but the suffix of each file name in @var{names}. If the -file name contains a period, the basename is everything starting up to -(and not including) the last period. Otherwise, the basename is the -entire file name. For example, - -@example -$(basename src/foo.c hacks) -@end example - -@noindent -produces the result @samp{src/foo hacks}. - -@c plural convention with dots (be consistent) -@item $(addsuffix @var{suffix},@var{names}@dots{}) -@findex addsuffix -@cindex suffix, adding -@cindex file name suffix, adding -The argument @var{names} is regarded as a series of names, separated -by whitespace; @var{suffix} is used as a unit. The value of -@var{suffix} is appended to the end of each individual name and the -resulting larger names are concatenated with single spaces between -them. For example, - -@example -$(addsuffix .c,foo bar) -@end example - -@noindent -produces the result @samp{foo.c bar.c}. - -@item $(addprefix @var{prefix},@var{names}@dots{}) -@findex addprefix -@cindex prefix, adding -@cindex file name prefix, adding -The argument @var{names} is regarded as a series of names, separated -by whitespace; @var{prefix} is used as a unit. The value of -@var{prefix} is prepended to the front of each individual name and the -resulting larger names are concatenated with single spaces between -them. For example, - -@example -$(addprefix src/,foo bar) -@end example - -@noindent -produces the result @samp{src/foo src/bar}. - -@item $(join @var{list1},@var{list2}) -@findex join -@cindex joining lists of words -@cindex words, joining lists -Concatenates the two arguments word by word: the two first words (one -from each argument) concatenated form the first word of the result, the -two second words form the second word of the result, and so on. So the -@var{n}th word of the result comes from the @var{n}th word of each -argument. If one argument has more words that the other, the extra -words are copied unchanged into the result. - -For example, @samp{$(join a b,.c .o)} produces @samp{a.c b.o}. - -Whitespace between the words in the lists is not preserved; it is -replaced with a single space. - -This function can merge the results of the @code{dir} and -@code{notdir} functions, to produce the original list of files which -was given to those two functions.@refill - -@item $(word @var{n},@var{text}) -@findex word -@cindex words, selecting -@cindex selecting words -Returns the @var{n}th word of @var{text}. The legitimate values of -@var{n} start from 1. If @var{n} is bigger than the number of words -in @var{text}, the value is empty. For example, - -@example -$(word 2, foo bar baz) -@end example - -@noindent -returns @samp{bar}. - -@c Following item phrased to prevent overfull hbox. --RJC 17 Jul 92 -@item $(words @var{text}) -@findex words -@cindex words, finding number -Returns the number of words in @var{text}. -Thus, the last word of @var{text} is -@w{@code{$(word $(words @var{text}),@var{text})}}.@refill - -@item $(firstword @var{names}@dots{}) -@findex firstword -@cindex words, extracting first -The argument @var{names} is regarded as a series of names, separated -by whitespace. The value is the first name in the series. The rest -of the names are ignored. - -For example, - -@example -$(firstword foo bar) -@end example - -@noindent -produces the result @samp{foo}. Although @code{$(firstword -@var{text})} is the same as @code{$(word 1,@var{text})}, the -@code{firstword} function is retained for its simplicity.@refill - -@item $(wildcard @var{pattern}) -@findex wildcard -@cindex wildcard, function -The argument @var{pattern} is a file name pattern, typically containing -wildcard characters (as in shell file name patterns). The result of -@code{wildcard} is a space-separated list of the names of existing files -that match the pattern. -@xref{Wildcards, ,Using Wildcard Characters in File Names}. -@end table - -@node Foreach Function, Origin Function, Filename Functions, Functions -@section The @code{foreach} Function -@findex foreach -@cindex words, iterating over - -The @code{foreach} function is very different from other functions. It -causes one piece of text to be used repeatedly, each time with a different -substitution performed on it. It resembles the @code{for} command in the -shell @code{sh} and the @code{foreach} command in the C-shell @code{csh}. - -The syntax of the @code{foreach} function is: - -@example -$(foreach @var{var},@var{list},@var{text}) -@end example - -@noindent -The first two arguments, @var{var} and @var{list}, are expanded before -anything else is done; note that the last argument, @var{text}, is -@strong{not} expanded at the same time. Then for each word of the expanded -value of @var{list}, the variable named by the expanded value of @var{var} -is set to that word, and @var{text} is expanded. Presumably @var{text} -contains references to that variable, so its expansion will be different -each time. - -The result is that @var{text} is expanded as many times as there are -whitespace-separated words in @var{list}. The multiple expansions of -@var{text} are concatenated, with spaces between them, to make the result -of @code{foreach}. - -This simple example sets the variable @samp{files} to the list of all files -in the directories in the list @samp{dirs}: - -@example -dirs := a b c d -files := $(foreach dir,$(dirs),$(wildcard $(dir)/*)) -@end example - -Here @var{text} is @samp{$(wildcard $(dir)/*)}. The first repetition -finds the value @samp{a} for @code{dir}, so it produces the same result -as @samp{$(wildcard a/*)}; the second repetition produces the result -of @samp{$(wildcard b/*)}; and the third, that of @samp{$(wildcard c/*)}. - -This example has the same result (except for setting @samp{dirs}) as -the following example: - -@example -files := $(wildcard a/* b/* c/* d/*) -@end example - -When @var{text} is complicated, you can improve readability by giving it -a name, with an additional variable: - -@example -find_files = $(wildcard $(dir)/*) -dirs := a b c d -files := $(foreach dir,$(dirs),$(find_files)) -@end example - -@noindent -Here we use the variable @code{find_files} this way. We use plain @samp{=} -to define a recursively-expanding variable, so that its value contains an -actual function call to be reexpanded under the control of @code{foreach}; -a simply-expanded variable would not do, since @code{wildcard} would be -called only once at the time of defining @code{find_files}. - -The @code{foreach} function has no permanent effect on the variable -@var{var}; its value and flavor after the @code{foreach} function call are -the same as they were beforehand. The other values which are taken from -@var{list} are in effect only temporarily, during the execution of -@code{foreach}. The variable @var{var} is a simply-expanded variable -during the execution of @code{foreach}. If @var{var} was undefined -before the @code{foreach} function call, it is undefined after the call. -@xref{Flavors, ,The Two Flavors of Variables}.@refill - -You must take care when using complex variable expressions that result in -variable names because many strange things are valid variable names, but -are probably not what you intended. For example, - -@smallexample -files := $(foreach Esta escrito en espanol!,b c ch,$(find_files)) -@end smallexample - -@noindent -might be useful if the value of @code{find_files} references the variable -whose name is @samp{Esta escrito en espanol!} (es un nombre bastante largo, -no?), but it is more likely to be a mistake. - -@node Origin Function, Shell Function, Foreach Function, Functions -@section The @code{origin} Function -@findex origin -@cindex variables, origin of -@cindex origin of variable - -The @code{origin} function is unlike most other functions in that it does -not operate on the values of variables; it tells you something @emph{about} -a variable. Specifically, it tells you where it came from. - -The syntax of the @code{origin} function is: - -@example -$(origin @var{variable}) -@end example - -Note that @var{variable} is the @emph{name} of a variable to inquire about; -not a @emph{reference} to that variable. Therefore you would not normally -use a @samp{$} or parentheses when writing it. (You can, however, use a -variable reference in the name if you want the name not to be a constant.) - -The result of this function is a string telling you how the variable -@var{variable} was defined: - -@table @samp -@item undefined - -if @var{variable} was never defined. - -@item default - -if @var{variable} has a default definition, as is usual with @code{CC} -and so on. @xref{Implicit Variables, ,Variables Used by Implicit Rules}. -Note that if you have redefined a default variable, the @code{origin} -function will return the origin of the later definition. - -@item environment - -if @var{variable} was defined as an environment variable and the -@samp{-e} option is @emph{not} turned on (@pxref{Options Summary, ,Summary of Options}). - -@item environment override - -if @var{variable} was defined as an environment variable and the -@w{@samp{-e}} option @emph{is} turned on (@pxref{Options Summary, -,Summary of Options}).@refill - -@item file - -if @var{variable} was defined in a makefile. - -@item command line - -if @var{variable} was defined on the command line. - -@item override - -if @var{variable} was defined with an @code{override} directive in a -makefile (@pxref{Override Directive, ,The @code{override} Directive}). - -@item automatic - -if @var{variable} is an automatic variable defined for the -execution of the commands for each rule -(@pxref{Automatic, , Automatic Variables}). -@end table - -This information is primarily useful (other than for your curiosity) to -determine if you want to believe the value of a variable. For example, -suppose you have a makefile @file{foo} that includes another makefile -@file{bar}. You want a variable @code{bletch} to be defined in @file{bar} -if you run the command @w{@samp{make -f bar}}, even if the environment contains -a definition of @code{bletch}. However, if @file{foo} defined -@code{bletch} before including @file{bar}, you do not want to override that -definition. This could be done by using an @code{override} directive in -@file{foo}, giving that definition precedence over the later definition in -@file{bar}; unfortunately, the @code{override} directive would also -override any command line definitions. So, @file{bar} could -include:@refill - -@example -@group -ifdef bletch -ifeq "$(origin bletch)" "environment" -bletch = barf, gag, etc. -endif -endif -@end group -@end example - -@noindent -If @code{bletch} has been defined from the environment, this will redefine -it. - -If you want to override a previous definition of @code{bletch} if it came -from the environment, even under @samp{-e}, you could instead write: - -@example -@group -ifneq "$(findstring environment,$(origin bletch))" "" -bletch = barf, gag, etc. -endif -@end group -@end example - -Here the redefinition takes place if @samp{$(origin bletch)} returns either -@samp{environment} or @samp{environment override}. -@xref{Text Functions, , Functions for String Substitution and Analysis}. - -@node Shell Function, , Origin Function, Functions -@section The @code{shell} Function -@findex shell -@cindex commands, expansion -@cindex backquotes -@cindex shell command, function for - -The @code{shell} function is unlike any other function except the -@code{wildcard} function -(@pxref{Wildcard Function, ,The Function @code{wildcard}}) in that it -communicates with the world outside of @code{make}. - -The @code{shell} function performs the same function that backquotes -(@samp{`}) perform in most shells: it does @dfn{command expansion}. This -means that it takes an argument that is a shell command and returns the -output of the command. The only processing @code{make} does on the result, -before substituting it into the surrounding text, is to convert newlines to -spaces.@refill - -The commands run by calls to the @code{shell} function are run when the -function calls are expanded. In most cases, this is when the makefile is -read in. The exception is that function calls in the commands of the rules -are expanded when the commands are run, and this applies to @code{shell} -function calls like all others. - -Here are some examples of the use of the @code{shell} function: - -@example -contents := $(shell cat foo) -@end example - -@noindent -sets @code{contents} to the contents of the file @file{foo}, with a space -(rather than a newline) separating each line. - -@example -files := $(shell echo *.c) -@end example - -@noindent -sets @code{files} to the expansion of @samp{*.c}. Unless @code{make} is -using a very strange shell, this has the same result as -@w{@samp{$(wildcard *.c)}}.@refill - -@node Running, Implicit Rules, Functions, Top -@chapter How to Run @code{make} - -A makefile that says how to recompile a program can be used in more -than one way. The simplest use is to recompile every file that is out -of date. Usually, makefiles are written so that if you run -@code{make} with no arguments, it does just that. - -But you might want to update only some of the files; you might want to use -a different compiler or different compiler options; you might want just to -find out which files are out of date without changing them. - -By giving arguments when you run @code{make}, you can do any of these -things and many others. - -The exit status of @code{make} is always one of three values: -@table @code -@item 0 -The exit status is zero if @code{make} is successful. -@item 2 -The exit status is two if @code{make} encounters any errors. -It will print messages describing the particular errors. -@item 1 -The exit status is one if you use the @samp{-q} flag and @code{make} -determines that some target is not already up to date. -@xref{Instead of Execution, ,Instead of Executing the Commands}. -@end table - -@menu -* Makefile Arguments:: How to specify which makefile to use. -* Goals:: How to use goal arguments to specify which - parts of the makefile to use. -* Instead of Execution:: How to use mode flags to specify what - kind of thing to do with the commands - in the makefile other than simply - execute them. -* Avoiding Compilation:: How to avoid recompiling certain files. -* Overriding:: How to override a variable to specify - an alternate compiler and other things. -* Testing:: How to proceed past some errors, to - test compilation. -* Options Summary:: Summary of Options -@end menu - -@node Makefile Arguments, Goals, , Running -@section Arguments to Specify the Makefile -@cindex @code{--file} -@cindex @code{--makefile} -@cindex @code{-f} - -The way to specify the name of the makefile is with the @samp{-f} or -@samp{--file} option (@samp{--makefile} also works). For example, -@samp{-f altmake} says to use the file @file{altmake} as the makefile. - -If you use the @samp{-f} flag several times and follow each @samp{-f} -with an argument, all the specified files are used jointly as -makefiles. - -If you do not use the @samp{-f} or @samp{--file} flag, the default is -to try @file{GNUmakefile}, @file{makefile}, and @file{Makefile}, in -that order, and use the first of these three which exists or can be made -(@pxref{Makefiles, ,Writing Makefiles}).@refill - -@node Goals, Instead of Execution, Makefile Arguments, Running -@section Arguments to Specify the Goals -@cindex goal, how to specify - -The @dfn{goals} are the targets that @code{make} should strive ultimately -to update. Other targets are updated as well if they appear as -dependencies of goals, or dependencies of dependencies of goals, etc. - -By default, the goal is the first target in the makefile (not counting -targets that start with a period). Therefore, makefiles are usually -written so that the first target is for compiling the entire program or -programs they describe. If the first rule in the makefile has several -targets, only the first target in the rule becomes the default goal, not -the whole list. - -You can specify a different goal or goals with arguments to @code{make}. -Use the name of the goal as an argument. If you specify several goals, -@code{make} processes each of them in turn, in the order you name them. - -Any target in the makefile may be specified as a goal (unless it -starts with @samp{-} or contains an @samp{=}, in which case it will be -parsed as a switch or variable definition, respectively). Even -targets not in the makefile may be specified, if @code{make} can find -implicit rules that say how to make them. - -One use of specifying a goal is if you want to compile only a part of -the program, or only one of several programs. Specify as a goal each -file that you wish to remake. For example, consider a directory containing -several programs, with a makefile that starts like this: - -@example -.PHONY: all -all: size nm ld ar as -@end example - -If you are working on the program @code{size}, you might want to say -@w{@samp{make size}} so that only the files of that program are recompiled. - -Another use of specifying a goal is to make files that are not normally -made. For example, there may be a file of debugging output, or a -version of the program that is compiled specially for testing, which has -a rule in the makefile but is not a dependency of the default goal. - -Another use of specifying a goal is to run the commands associated with -a phony target (@pxref{Phony Targets}) or empty target (@pxref{Empty -Targets, ,Empty Target Files to Record Events}). Many makefiles contain -a phony target named @file{clean} which deletes everything except source -files. Naturally, this is done only if you request it explicitly with -@w{@samp{make clean}}. Following is a list of typical phony and empty -target names. @xref{Standard Targets}, for a detailed list of all the -standard target names which GNU software packages use. - -@table @file -@item all -@cindex @code{all} @r{(standard target)} -Make all the top-level targets the makefile knows about. - -@item clean -@cindex @code{clean} @r{(standard target)} -Delete all files that are normally created by running @code{make}. - -@item mostlyclean -@cindex @code{mostlyclean} @r{(standard target)} -Like @samp{clean}, but may refrain from deleting a few files that people -normally don't want to recompile. For example, the @samp{mostlyclean} -target for GCC does not delete @file{libgcc.a}, because recompiling it -is rarely necessary and takes a lot of time. - -@item distclean -@cindex @code{distclean} @r{(standard target)} -@itemx realclean -@cindex @code{realclean} @r{(standard target)} -@itemx clobber -@cindex @code{clobber} @r{(standard target)} -Any of these targets might be defined to delete @emph{more} files than -@samp{clean} does. For example, this would delete configuration files -or links that you would normally create as preparation for compilation, -even if the makefile itself cannot create these files. - -@item install -@cindex @code{install} @r{(standard target)} -Copy the executable file into a directory that users typically search -for commands; copy any auxiliary files that the executable uses into -the directories where it will look for them. - -@item print -@cindex @code{print} @r{(standard target)} -Print listings of the source files that have changed. - -@item tar -@cindex @code{tar} @r{(standard target)} -Create a tar file of the source files. - -@item shar -@cindex @code{shar} @r{(standard target)} -Create a shell archive (shar file) of the source files. - -@item dist -@cindex @code{dist} @r{(standard target)} -Create a distribution file of the source files. This might -be a tar file, or a shar file, or a compressed version of one of the -above, or even more than one of the above. - -@item TAGS -@cindex @code{TAGS} @r{(standard target)} -Update a tags table for this program. - -@item check -@cindex @code{check} @r{(standard target)} -@itemx test -@cindex @code{test} @r{(standard target)} -Perform self tests on the program this makefile builds. -@end table - -@node Instead of Execution, Avoiding Compilation, Goals, Running -@section Instead of Executing the Commands -@cindex execution, instead of -@cindex commands, instead of executing - -The makefile tells @code{make} how to tell whether a target is up to date, -and how to update each target. But updating the targets is not always -what you want. Certain options specify other activities for @code{make}. - -@comment Extra blank lines make it print better. -@table @samp -@item -n -@itemx --just-print -@itemx --dry-run -@itemx --recon -@cindex @code{--just-print} -@cindex @code{--dry-run} -@cindex @code{--recon} -@cindex @code{-n} - -``No-op''. The activity is to print what commands would be used to make -the targets up to date, but not actually execute them. - -@item -t -@itemx --touch -@cindex @code{--touch} -@cindex touching files -@cindex target, touching -@cindex @code{-t} - -``Touch''. The activity is to mark the targets as up to date without -actually changing them. In other words, @code{make} pretends to compile -the targets but does not really change their contents. - -@item -q -@itemx --question -@cindex @code{--question} -@cindex @code{-q} -@cindex question mode - -``Question''. The activity is to find out silently whether the targets -are up to date already; but execute no commands in either case. In other -words, neither compilation nor output will occur. - -@item -W @var{file} -@itemx --what-if=@var{file} -@itemx --assume-new=@var{file} -@itemx --new-file=@var{file} -@cindex @code{--what-if} -@cindex @code{-W} -@cindex @code{--assume-new} -@cindex @code{--new-file} -@cindex what if -@cindex files, assuming new - -``What if''. Each @samp{-W} flag is followed by a file name. The given -files' modification times are recorded by @code{make} as being the present -time, although the actual modification times remain the same. -You can use the @samp{-W} flag in conjunction with the @samp{-n} flag -to see what would happen if you were to modify specific files.@refill -@end table - -With the @samp{-n} flag, @code{make} prints the commands that it would -normally execute but does not execute them. - -With the @samp{-t} flag, @code{make} ignores the commands in the rules -and uses (in effect) the command @code{touch} for each target that needs to -be remade. The @code{touch} command is also printed, unless @samp{-s} or -@code{.SILENT} is used. For speed, @code{make} does not actually invoke -the program @code{touch}. It does the work directly. - -With the @samp{-q} flag, @code{make} prints nothing and executes no -commands, but the exit status code it returns is zero if and only if the -targets to be considered are already up to date. If the exit status is -one, then some updating needs to be done. If @code{make} encounters an -error, the exit status is two, so you can distinguish an error from a -target that is not up to date. - -It is an error to use more than one of these three flags in the same -invocation of @code{make}. - -The @samp{-n}, @samp{-t}, and @samp{-q} options do not affect command -lines that begin with @samp{+} characters or contain the strings -@samp{$(MAKE)} or @samp{$@{MAKE@}}. Note that only the line containing -the @samp{+} character or the strings @samp{$(MAKE)} or @samp{$@{MAKE@}} -is run regardless of these options. Other lines in the same rule are -not run unless they too begin with @samp{+} or contain @samp{$(MAKE)} or -@samp{$@{MAKE@}} (@xref{MAKE Variable, ,How the @code{MAKE} Variable Works}.) - -The @samp{-W} flag provides two features: - -@itemize @bullet -@item -If you also use the @samp{-n} or @samp{-q} flag, you can see what -@code{make} would do if you were to modify some files. - -@item -Without the @samp{-n} or @samp{-q} flag, when @code{make} is actually -executing commands, the @samp{-W} flag can direct @code{make} to act -as if some files had been modified, without actually modifying the -files.@refill -@end itemize - -Note that the options @samp{-p} and @samp{-v} allow you to obtain other -information about @code{make} or about the makefiles in use -(@pxref{Options Summary, ,Summary of Options}).@refill - -@node Avoiding Compilation, Overriding, Instead of Execution, Running -@section Avoiding Recompilation of Some Files -@cindex @code{-o} -@cindex @code{--old-file} -@cindex @code{--assume-old} -@cindex files, assuming old -@cindex files, avoiding recompilation of -@cindex recompilation, avoiding - -Sometimes you may have changed a source file but you do not want to -recompile all the files that depend on it. For example, suppose you add a -macro or a declaration to a header file that many other files depend on. -Being conservative, @code{make} assumes that any change in the header file -requires recompilation of all dependent files, but you know that they do not -need to be recompiled and you would rather not waste the time waiting for -them to compile. - -If you anticipate the problem before changing the header file, you can -use the @samp{-t} flag. This flag tells @code{make} not to run the -commands in the rules, but rather to mark the target up to date by -changing its last-modification date. You would follow this procedure: - -@enumerate -@item -Use the command @samp{make} to recompile the source files that really -need recompilation. - -@item -Make the changes in the header files. - -@item -Use the command @samp{make -t} to mark all the object files as -up to date. The next time you run @code{make}, the changes in the -header files will not cause any recompilation. -@end enumerate - -If you have already changed the header file at a time when some files -do need recompilation, it is too late to do this. Instead, you can -use the @w{@samp{-o @var{file}}} flag, which marks a specified file as -``old'' (@pxref{Options Summary, ,Summary of Options}). This means -that the file itself will not be remade, and nothing else will be -remade on its account. Follow this procedure: - -@enumerate -@item -Recompile the source files that need compilation for reasons independent -of the particular header file, with @samp{make -o @var{headerfile}}. -If several header files are involved, use a separate @samp{-o} option -for each header file. - -@item -Touch all the object files with @samp{make -t}. -@end enumerate - -@node Overriding, Testing, Avoiding Compilation, Running -@section Overriding Variables -@cindex overriding variables with arguments -@cindex variables, overriding with arguments -@cindex command line variables -@cindex variables, command line - -An argument that contains @samp{=} specifies the value of a variable: -@samp{@var{v}=@var{x}} sets the value of the variable @var{v} to @var{x}. -If you specify a value in this way, all ordinary assignments of the same -variable in the makefile are ignored; we say they have been -@dfn{overridden} by the command line argument. - -The most common way to use this facility is to pass extra flags to -compilers. For example, in a properly written makefile, the variable -@code{CFLAGS} is included in each command that runs the C compiler, so a -file @file{foo.c} would be compiled something like this: - -@example -cc -c $(CFLAGS) foo.c -@end example - -Thus, whatever value you set for @code{CFLAGS} affects each compilation -that occurs. The makefile probably specifies the usual value for -@code{CFLAGS}, like this: - -@example -CFLAGS=-g -@end example - -Each time you run @code{make}, you can override this value if you -wish. For example, if you say @samp{make CFLAGS='-g -O'}, each C -compilation will be done with @samp{cc -c -g -O}. (This illustrates -how you can use quoting in the shell to enclose spaces and other -special characters in the value of a variable when you override it.) - -The variable @code{CFLAGS} is only one of many standard variables that -exist just so that you can change them this way. @xref{Implicit -Variables, , Variables Used by Implicit Rules}, for a complete list. - -You can also program the makefile to look at additional variables of your -own, giving the user the ability to control other aspects of how the -makefile works by changing the variables. - -When you override a variable with a command argument, you can define either -a recursively-expanded variable or a simply-expanded variable. The -examples shown above make a recursively-expanded variable; to make a -simply-expanded variable, write @samp{:=} instead of @samp{=}. But, unless -you want to include a variable reference or function call in the -@emph{value} that you specify, it makes no difference which kind of -variable you create. - -There is one way that the makefile can change a variable that you have -overridden. This is to use the @code{override} directive, which is a line -that looks like this: @samp{override @var{variable} = @var{value}} -(@pxref{Override Directive, ,The @code{override} Directive}). - -@node Testing, Options Summary, Overriding, Running -@section Testing the Compilation of a Program -@cindex testing compilation -@cindex compilation, testing - -Normally, when an error happens in executing a shell command, @code{make} -gives up immediately, returning a nonzero status. No further commands are -executed for any target. The error implies that the goal cannot be -correctly remade, and @code{make} reports this as soon as it knows. - -When you are compiling a program that you have just changed, this is not -what you want. Instead, you would rather that @code{make} try compiling -every file that can be tried, to show you as many compilation errors -as possible. - -@cindex @code{-k} -@cindex @code{--keep-going} -On these occasions, you should use the @samp{-k} or -@samp{--keep-going} flag. This tells @code{make} to continue to -consider the other dependencies of the pending targets, remaking them -if necessary, before it gives up and returns nonzero status. For -example, after an error in compiling one object file, @samp{make -k} -will continue compiling other object files even though it already -knows that linking them will be impossible. In addition to continuing -after failed shell commands, @samp{make -k} will continue as much as -possible after discovering that it does not know how to make a target -or dependency file. This will always cause an error message, but -without @samp{-k}, it is a fatal error (@pxref{Options Summary, -,Summary of Options}).@refill - -The usual behavior of @code{make} assumes that your purpose is to get the -goals up to date; once @code{make} learns that this is impossible, it might -as well report the failure immediately. The @samp{-k} flag says that the -real purpose is to test as much as possible of the changes made in the -program, perhaps to find several independent problems so that you can -correct them all before the next attempt to compile. This is why Emacs' -@kbd{M-x compile} command passes the @samp{-k} flag by default. - -@node Options Summary, , Testing, Running -@section Summary of Options -@cindex options -@cindex flags -@cindex switches - -Here is a table of all the options @code{make} understands: - -@table @samp -@item -b -@cindex @code{-b} -@itemx -m -@cindex @code{-m} -These options are ignored for compatibility with other versions of @code{make}. - -@item -C @var{dir} -@cindex @code{-C} -@itemx --directory=@var{dir} -@cindex @code{--directory} -Change to directory @var{dir} before reading the makefiles. If multiple -@samp{-C} options are specified, each is interpreted relative to the -previous one: @samp{-C / -C etc} is equivalent to @samp{-C /etc}. -This is typically used with recursive invocations of @code{make} -(@pxref{Recursion, ,Recursive Use of @code{make}}). - -@item -d -@cindex @code{-d} -@itemx --debug -@cindex @code{--debug} -@c Extra blank line here makes the table look better. - -Print debugging information in addition to normal processing. The -debugging information says which files are being considered for -remaking, which file-times are being compared and with what results, -which files actually need to be remade, which implicit rules are -considered and which are applied---everything interesting about how -@code{make} decides what to do. - -@item -e -@cindex @code{-e} -@itemx --environment-overrides -@cindex @code{--environment-overrides} -Give variables taken from the environment precedence -over variables from makefiles. -@xref{Environment, ,Variables from the Environment}. - -@item -f @var{file} -@cindex @code{-f} -@itemx --file=@var{file} -@cindex @code{--file} -@itemx --makefile=@var{file} -@cindex @code{--makefile} -Read the file named @var{file} as a makefile. -@xref{Makefiles, ,Writing Makefiles}. - -@item -h -@cindex @code{-h} -@itemx --help -@cindex @code{--help} -@c Extra blank line here makes the table look better. - -Remind you of the options that @code{make} understands and then exit. - -@item -i -@cindex @code{-i} -@itemx --ignore-errors -@cindex @code{--ignore-errors} -Ignore all errors in commands executed to remake files. -@xref{Errors, ,Errors in Commands}. - -@item -I @var{dir} -@cindex @code{-I} -@itemx --include-dir=@var{dir} -@cindex @code{--include-dir} -Specifies a directory @var{dir} to search for included makefiles. -@xref{Include, ,Including Other Makefiles}. If several @samp{-I} -options are used to specify several directories, the directories are -searched in the order specified. - -@item -j [@var{jobs}] -@cindex @code{-j} -@itemx --jobs=[@var{jobs}] -@cindex @code{--jobs} -Specifies the number of jobs (commands) to run simultaneously. With no -argument, @code{make} runs as many jobs simultaneously as possible. If -there is more than one @samp{-j} option, the last one is effective. -@xref{Parallel, ,Parallel Execution}, -for more information on how commands are run. - -@item -k -@cindex @code{-k} -@itemx --keep-going -@cindex @code{--keep-going} -Continue as much as possible after an error. While the target that -failed, and those that depend on it, cannot be remade, the other -dependencies of these targets can be processed all the same. -@xref{Testing, ,Testing the Compilation of a Program}. - -@item -l [@var{load}] -@cindex @code{-l} -@itemx --load-average[=@var{load}] -@cindex @code{--load-average} -@itemx --max-load[=@var{load}] -@cindex @code{--max-load} -Specifies that no new jobs (commands) should be started if there are -other jobs running and the load average is at least @var{load} (a -floating-point number). With no argument, removes a previous load -limit. @xref{Parallel, ,Parallel Execution}. - -@item -n -@cindex @code{-n} -@itemx --just-print -@cindex @code{--just-print} -@itemx --dry-run -@cindex @code{--dry-run} -@itemx --recon -@cindex @code{--recon} -@c Extra blank line here makes the table look better. - -Print the commands that would be executed, but do not execute them. -@xref{Instead of Execution, ,Instead of Executing the Commands}. - -@item -o @var{file} -@cindex @code{-o} -@itemx --old-file=@var{file} -@cindex @code{--old-file} -@itemx --assume-old=@var{file} -@cindex @code{--assume-old} -Do not remake the file @var{file} even if it is older than its -dependencies, and do not remake anything on account of changes in -@var{file}. Essentially the file is treated as very old and its rules -are ignored. @xref{Avoiding Compilation, ,Avoiding Recompilation of -Some Files}.@refill - -@item -p -@cindex @code{-p} -@itemx --print-data-base -@cindex @code{--print-data-base} -Print the data base (rules and variable values) that results from -reading the makefiles; then execute as usual or as otherwise -specified. This also prints the version information given by -the @samp{-v} switch (see below). To print the data base without -trying to remake any files, use @w{@samp{make -p -f /dev/null}}. - -@item -q -@cindex @code{-q} -@itemx --question -@cindex @code{--question} -``Question mode''. Do not run any commands, or print anything; just -return an exit status that is zero if the specified targets are already -up to date, one if any remaking is required, or two if an error is -encountered. @xref{Instead of Execution, ,Instead of Executing the -Commands}.@refill - -@item -r -@cindex @code{-r} -@itemx --no-builtin-rules -@cindex @code{--no-builtin-rules} -Eliminate use of the built-in implicit rules (@pxref{Implicit Rules, -,Using Implicit Rules}). You can still define your own by writing -pattern rules (@pxref{Pattern Rules, ,Defining and Redefining Pattern -Rules}). The @samp{-r} option also clears out the default list of -suffixes for suffix rules (@pxref{Suffix Rules, ,Old-Fashioned Suffix -Rules}). But you can still define your own suffixes with a rule for -@code{.SUFFIXES}, and then define your own suffix rules. - -@item -s -@cindex @code{-s} -@itemx --silent -@cindex @code{--silent} -@itemx --quiet -@cindex @code{--quiet} -@c Extra blank line here makes the table look better. - -Silent operation; do not print the commands as they are executed. -@xref{Echoing, ,Command Echoing}. - -@item -S -@cindex @code{-S} -@itemx --no-keep-going -@cindex @code{--no-keep-going} -@itemx --stop -@cindex @code{--stop} -@c Extra blank line here makes the table look better. - -Cancel the effect of the @samp{-k} option. This is never necessary -except in a recursive @code{make} where @samp{-k} might be inherited -from the top-level @code{make} via @code{MAKEFLAGS} -(@pxref{Recursion, ,Recursive Use of @code{make}}) -or if you set @samp{-k} in @code{MAKEFLAGS} in your environment.@refill - -@item -t -@cindex @code{-t} -@itemx --touch -@cindex @code{--touch} -@c Extra blank line here makes the table look better. - -Touch files (mark them up to date without really changing them) -instead of running their commands. This is used to pretend that the -commands were done, in order to fool future invocations of -@code{make}. @xref{Instead of Execution, ,Instead of Executing the Commands}. - -@item -v -@cindex @code{-v} -@itemx --version -@cindex @code{--version} -Print the version of the @code{make} program plus a copyright, a list -of authors, and a notice that there is no warranty; then exit. - -@item -w -@cindex @code{-w} -@itemx --print-directory -@cindex @code{--print-directory} -Print a message containing the working directory both before and after -executing the makefile. This may be useful for tracking down errors -from complicated nests of recursive @code{make} commands. -@xref{Recursion, ,Recursive Use of @code{make}}. (In practice, you -rarely need to specify this option since @samp{make} does it for you; -see @ref{-w Option, ,The @samp{--print-directory} Option}.) - -@itemx --no-print-directory -@cindex @code{--no-print-directory} -Disable printing of the working directory under @code{-w}. -This option is useful when @code{-w} is turned on automatically, -but you do not want to see the extra messages. -@xref{-w Option, ,The @samp{--print-directory} Option}. - -@item -W @var{file} -@cindex @code{-W} -@itemx --what-if=@var{file} -@cindex @code{--what-if} -@itemx --new-file=@var{file} -@cindex @code{--new-file} -@itemx --assume-new=@var{file} -@cindex @code{--assume-new} -Pretend that the target @var{file} has just been modified. When used -with the @samp{-n} flag, this shows you what would happen if you were -to modify that file. Without @samp{-n}, it is almost the same as -running a @code{touch} command on the given file before running -@code{make}, except that the modification time is changed only in the -imagination of @code{make}. -@xref{Instead of Execution, ,Instead of Executing the Commands}. - -@item --warn-undefined-variables -@cindex @code{--warn-undefined-variables} -@cindex variables, warning for undefined -@cindex undefined variables, warning message -Issue a warning message whenever @code{make} sees a reference to an -undefined variable. This can be helpful when you are trying to debug -makefiles which use variables in complex ways. -@end table - -@node Implicit Rules, Archives, Running, Top -@chapter Using Implicit Rules -@cindex implicit rule -@cindex rule, implicit - -Certain standard ways of remaking target files are used very often. For -example, one customary way to make an object file is from a C source file -using the C compiler, @code{cc}. - -@dfn{Implicit rules} tell @code{make} how to use customary techniques so -that you do not have to specify them in detail when you want to use -them. For example, there is an implicit rule for C compilation. File -names determine which implicit rules are run. For example, C -compilation typically takes a @file{.c} file and makes a @file{.o} file. -So @code{make} applies the implicit rule for C compilation when it sees -this combination of file name endings.@refill - -A chain of implicit rules can apply in sequence; for example, @code{make} -will remake a @file{.o} file from a @file{.y} file by way of a @file{.c} file. -@iftex -@xref{Chained Rules, ,Chains of Implicit Rules}. -@end iftex - -The built-in implicit rules use several variables in their commands so -that, by changing the values of the variables, you can change the way the -implicit rule works. For example, the variable @code{CFLAGS} controls the -flags given to the C compiler by the implicit rule for C compilation. -@iftex -@xref{Implicit Variables, ,Variables Used by Implicit Rules}. -@end iftex - -You can define your own implicit rules by writing @dfn{pattern rules}. -@iftex -@xref{Pattern Rules, ,Defining and Redefining Pattern Rules}. -@end iftex - -@dfn{Suffix rules} are a more limited way to define implicit rules. -Pattern rules are more general and clearer, but suffix rules are -retained for compatibility. -@iftex -@xref{Suffix Rules, ,Old-Fashioned Suffix Rules}. -@end iftex - -@menu -* Using Implicit:: How to use an existing implicit rule - to get the commands for updating a file. -* Catalogue of Rules:: A list of built-in implicit rules. -* Implicit Variables:: How to change what predefined rules do. -* Chained Rules:: How to use a chain of implicit rules. -* Pattern Rules:: How to define new implicit rules. -* Last Resort:: How to defining commands for rules - which cannot find any. -* Suffix Rules:: The old-fashioned style of implicit rule. -* Search Algorithm:: The precise algorithm for applying - implicit rules. -@end menu - -@node Using Implicit, Catalogue of Rules, , Implicit Rules -@section Using Implicit Rules -@cindex implicit rule, how to use -@cindex rule, implicit, how to use - -To allow @code{make} to find a customary method for updating a target file, -all you have to do is refrain from specifying commands yourself. Either -write a rule with no command lines, or don't write a rule at all. Then -@code{make} will figure out which implicit rule to use based on which -kind of source file exists or can be made. - -For example, suppose the makefile looks like this: - -@example -foo : foo.o bar.o - cc -o foo foo.o bar.o $(CFLAGS) $(LDFLAGS) -@end example - -@noindent -Because you mention @file{foo.o} but do not give a rule for it, @code{make} -will automatically look for an implicit rule that tells how to update it. -This happens whether or not the file @file{foo.o} currently exists. - -If an implicit rule is found, it can supply both commands and one or -more dependencies (the source files). You would want to write a rule -for @file{foo.o} with no command lines if you need to specify additional -dependencies, such as header files, that the implicit rule cannot -supply. - -Each implicit rule has a target pattern and dependency patterns. There may -be many implicit rules with the same target pattern. For example, numerous -rules make @samp{.o} files: one, from a @samp{.c} file with the C compiler; -another, from a @samp{.p} file with the Pascal compiler; and so on. The rule -that actually applies is the one whose dependencies exist or can be made. -So, if you have a file @file{foo.c}, @code{make} will run the C compiler; -otherwise, if you have a file @file{foo.p}, @code{make} will run the Pascal -compiler; and so on. - -Of course, when you write the makefile, you know which implicit rule you -want @code{make} to use, and you know it will choose that one because you -know which possible dependency files are supposed to exist. -@xref{Catalogue of Rules, ,Catalogue of Implicit Rules}, -for a catalogue of all the predefined implicit rules. - -Above, we said an implicit rule applies if the required dependencies ``exist -or can be made''. A file ``can be made'' if it is mentioned explicitly in -the makefile as a target or a dependency, or if an implicit rule can be -recursively found for how to make it. When an implicit dependency is the -result of another implicit rule, we say that @dfn{chaining} is occurring. -@xref{Chained Rules, ,Chains of Implicit Rules}. - -In general, @code{make} searches for an implicit rule for each target, and -for each double-colon rule, that has no commands. A file that is mentioned -only as a dependency is considered a target whose rule specifies nothing, -so implicit rule search happens for it. @xref{Search Algorithm, ,Implicit Rule Search Algorithm}, for the -details of how the search is done. - -Note that explicit dependencies do not influence implicit rule search. -For example, consider this explicit rule: - -@example -foo.o: foo.p -@end example - -@noindent -The dependency on @file{foo.p} does not necessarily mean that -@code{make} will remake @file{foo.o} according to the implicit rule to -make an object file, a @file{.o} file, from a Pascal source file, a -@file{.p} file. For example, if @file{foo.c} also exists, the implicit -rule to make an object file from a C source file is used instead, -because it appears before the Pascal rule in the list of predefined -implicit rules (@pxref{Catalogue of Rules, , Catalogue of Implicit -Rules}). - -If you do not want an implicit rule to be used for a target that has no -commands, you can give that target empty commands by writing a semicolon -(@pxref{Empty Commands, ,Defining Empty Commands}). - -@node Catalogue of Rules, Implicit Variables, Using Implicit, Implicit Rules -@section Catalogue of Implicit Rules -@cindex implicit rule, predefined -@cindex rule, implicit, predefined - -Here is a catalogue of predefined implicit rules which are always -available unless the makefile explicitly overrides or cancels them. -@xref{Canceling Rules, ,Canceling Implicit Rules}, for information on -canceling or overriding an implicit rule. The @samp{-r} or -@samp{--no-builtin-rules} option cancels all predefined rules. - -Not all of these rules will always be defined, even when the @samp{-r} -option is not given. Many of the predefined implicit rules are -implemented in @code{make} as suffix rules, so which ones will be -defined depends on the @dfn{suffix list} (the list of dependencies of -the special target @code{.SUFFIXES}). The default suffix list is: -@code{.out}, @code{.a}, @code{.ln}, @code{.o}, @code{.c}, @code{.cc}, -@code{.C}, @code{.p}, @code{.f}, @code{.F}, @code{.r}, @code{.y}, -@code{.l}, @code{.s}, @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, -@code{.h}, @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, -@code{.texi}, @code{.txinfo}, @code{.w}, @code{.ch} @code{.web}, -@code{.sh}, @code{.elc}, @code{.el}. All of the implicit rules -described below whose dependencies have one of these suffixes are -actually suffix rules. If you modify the suffix list, the only -predefined suffix rules in effect will be those named by one or two of -the suffixes that are on the list you specify; rules whose suffixes fail -to be on the list are disabled. @xref{Suffix Rules, ,Old-Fashioned -Suffix Rules}, for full details on suffix rules. - -@table @asis -@item Compiling C programs -@cindex C, rule to compile -@pindex cc -@pindex gcc -@pindex .o -@pindex .c -@file{@var{n}.o} is made automatically from @file{@var{n}.c} with -a command of the form @samp{$(CC) -c $(CPPFLAGS) $(CFLAGS)}.@refill - -@item Compiling C++ programs -@cindex C++, rule to compile -@pindex g++ -@pindex .C -@pindex .cc -@file{@var{n}.o} is made automatically from @file{@var{n}.cc} or -@file{@var{n}.C} with a command of the form @samp{$(CXX) -c $(CPPFLAGS) -$(CXXFLAGS)}. We encourage you to use the suffix @samp{.cc} for C++ -source files instead of @samp{.C}.@refill - -@item Compiling Pascal programs -@cindex Pascal, rule to compile -@pindex pc -@pindex .p -@file{@var{n}.o} is made automatically from @file{@var{n}.p} -with the command @samp{$(PC) -c $(PFLAGS)}.@refill - -@item Compiling Fortran and Ratfor programs -@cindex Fortran, rule to compile -@cindex Ratfor, rule to compile -@pindex f77 -@pindex .f -@pindex .r -@pindex .F -@file{@var{n}.o} is made automatically from @file{@var{n}.r}, -@file{@var{n}.F} or @file{@var{n}.f} by running the -Fortran compiler. The precise command used is as follows:@refill - -@table @samp -@item .f -@samp{$(FC) -c $(FFLAGS)}. -@item .F -@samp{$(FC) -c $(FFLAGS) $(CPPFLAGS)}. -@item .r -@samp{$(FC) -c $(FFLAGS) $(RFLAGS)}. -@end table - -@item Preprocessing Fortran and Ratfor programs -@file{@var{n}.f} is made automatically from @file{@var{n}.r} or -@file{@var{n}.F}. This rule runs just the preprocessor to convert a -Ratfor or preprocessable Fortran program into a strict Fortran -program. The precise command used is as follows:@refill - -@table @samp -@item .F -@samp{$(FC) -F $(CPPFLAGS) $(FFLAGS)}. -@item .r -@samp{$(FC) -F $(FFLAGS) $(RFLAGS)}. -@end table - -@item Compiling Modula-2 programs -@cindex Modula-2, rule to compile -@pindex m2c -@pindex .sym -@pindex .def -@pindex .mod -@file{@var{n}.sym} is made from @file{@var{n}.def} with a command -of the form @samp{$(M2C) $(M2FLAGS) $(DEFFLAGS)}. @file{@var{n}.o} -is made from @file{@var{n}.mod}; the form is: -@w{@samp{$(M2C) $(M2FLAGS) $(MODFLAGS)}}.@refill - -@need 1200 -@item Assembling and preprocessing assembler programs -@cindex assembly, rule to compile -@pindex as -@pindex .s -@file{@var{n}.o} is made automatically from @file{@var{n}.s} by -running the assembler, @code{as}. The precise command is -@samp{$(AS) $(ASFLAGS)}.@refill - -@pindex .S -@file{@var{n}.s} is made automatically from @file{@var{n}.S} by -running the C preprocessor, @code{cpp}. The precise command is -@w{@samp{$(CPP) $(CPPFLAGS)}}. - -@item Linking a single object file -@cindex linking, predefined rule for -@pindex ld -@pindex .o -@file{@var{n}} is made automatically from @file{@var{n}.o} by running -the linker (usually called @code{ld}) via the C compiler. The precise -command used is @w{@samp{$(CC) $(LDFLAGS) @var{n}.o $(LOADLIBES)}}. - -This rule does the right thing for a simple program with only one -source file. It will also do the right thing if there are multiple -object files (presumably coming from various other source files), one -of which has a name matching that of the executable file. Thus, - -@example -x: y.o z.o -@end example - -@noindent -when @file{x.c}, @file{y.c} and @file{z.c} all exist will execute: - -@example -@group -cc -c x.c -o x.o -cc -c y.c -o y.o -cc -c z.c -o z.o -cc x.o y.o z.o -o x -rm -f x.o -rm -f y.o -rm -f z.o -@end group -@end example - -@noindent -In more complicated cases, such as when there is no object file whose -name derives from the executable file name, you must write an explicit -command for linking. - -Each kind of file automatically made into @samp{.o} object files will -be automatically linked by using the compiler (@samp{$(CC)}, -@samp{$(FC)} or @samp{$(PC)}; the C compiler @samp{$(CC)} is used to -assemble @samp{.s} files) without the @samp{-c} option. This could be -done by using the @samp{.o} object files as intermediates, but it is -faster to do the compiling and linking in one step, so that's how it's -done.@refill - -@item Yacc for C programs -@pindex yacc -@cindex Yacc, rule to run -@pindex .y -@file{@var{n}.c} is made automatically from @file{@var{n}.y} by -running Yacc with the command @samp{$(YACC) $(YFLAGS)}. - -@item Lex for C programs -@pindex lex -@cindex Lex, rule to run -@pindex .l -@file{@var{n}.c} is made automatically from @file{@var{n}.l} by -by running Lex. The actual command is @samp{$(LEX) $(LFLAGS)}. - -@item Lex for Ratfor programs -@file{@var{n}.r} is made automatically from @file{@var{n}.l} by -by running Lex. The actual command is @samp{$(LEX) $(LFLAGS)}. - -The convention of using the same suffix @samp{.l} for all Lex files -regardless of whether they produce C code or Ratfor code makes it -impossible for @code{make} to determine automatically which of the two -languages you are using in any particular case. If @code{make} is -called upon to remake an object file from a @samp{.l} file, it must -guess which compiler to use. It will guess the C compiler, because -that is more common. If you are using Ratfor, make sure @code{make} -knows this by mentioning @file{@var{n}.r} in the makefile. Or, if you -are using Ratfor exclusively, with no C files, remove @samp{.c} from -the list of implicit rule suffixes with:@refill - -@example -@group -.SUFFIXES: -.SUFFIXES: .o .r .f .l @dots{} -@end group -@end example - -@item Making Lint Libraries from C, Yacc, or Lex programs -@pindex lint -@cindex @code{lint}, rule to run -@pindex .ln -@file{@var{n}.ln} is made from @file{@var{n}.c} by running @code{lint}. -The precise command is @w{@samp{$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i}}. -The same command is used on the C code produced from -@file{@var{n}.y} or @file{@var{n}.l}.@refill - -@item @TeX{} and Web -@cindex @TeX{}, rule to run -@cindex Web, rule to run -@pindex tex -@pindex cweave -@pindex weave -@pindex tangle -@pindex ctangle -@pindex .dvi -@pindex .tex -@pindex .web -@pindex .w -@pindex .ch -@file{@var{n}.dvi} is made from @file{@var{n}.tex} with the command -@samp{$(TEX)}. @file{@var{n}.tex} is made from @file{@var{n}.web} with -@samp{$(WEAVE)}, or from @file{@var{n}.w} (and from @file{@var{n}.ch} if -it exists or can be made) with @samp{$(CWEAVE)}. @file{@var{n}.p} is -made from @file{@var{n}.web} with @samp{$(TANGLE)} and @file{@var{n}.c} -is made from @file{@var{n}.w} (and from @file{@var{n}.ch} if it exists -or can be made) with @samp{$(CTANGLE)}.@refill - -@item Texinfo and Info -@cindex Texinfo, rule to format -@cindex Info, rule to format -@pindex texi2dvi -@pindex makeinfo -@pindex .texinfo -@pindex .info -@pindex .texi -@pindex .txinfo -@file{@var{n}.dvi} is made from @file{@var{n}.texinfo}, -@file{@var{n}.texi}, or @file{@var{n}.txinfo}, with the command -@w{@samp{$(TEXI2DVI) $(TEXI2DVI_FLAGS)}}. @file{@var{n}.info} is made from -@file{@var{n}.texinfo}, @file{@var{n}.texi}, or @file{@var{n}.txinfo}, with -the command @w{@samp{$(MAKEINFO) $(MAKEINFO_FLAGS)}}. - -@item RCS -@cindex RCS, rule to extract from -@pindex co -@pindex ,v @r{(RCS file extension)} -Any file @file{@var{n}} is extracted if necessary from an RCS file -named either @file{@var{n},v} or @file{RCS/@var{n},v}. The precise -command used is @w{@samp{$(CO) $(COFLAGS)}}. @file{@var{n}} will not be -extracted from RCS if it already exists, even if the RCS file is -newer. The rules for RCS are terminal -(@pxref{Match-Anything Rules, ,Match-Anything Pattern Rules}), -so RCS files cannot be generated from another source; they must -actually exist.@refill - -@item SCCS -@cindex SCCS, rule to extract from -@pindex get -@pindex s. @r{(SCCS file prefix)} -Any file @file{@var{n}} is extracted if necessary from an SCCS file -named either @file{s.@var{n}} or @file{SCCS/s.@var{n}}. The precise -command used is @w{@samp{$(GET) $(GFLAGS)}}. The rules for SCCS are -terminal (@pxref{Match-Anything Rules, ,Match-Anything Pattern Rules}), -so SCCS files cannot be generated from another source; they must -actually exist.@refill - -@pindex .sh -For the benefit of SCCS, a file @file{@var{n}} is copied from -@file{@var{n}.sh} and made executable (by everyone). This is for -shell scripts that are checked into SCCS. Since RCS preserves the -execution permission of a file, you do not need to use this feature -with RCS.@refill - -We recommend that you avoid using of SCCS. RCS is widely held to be -superior, and is also free. By choosing free software in place of -comparable (or inferior) proprietary software, you support the free -software movement. -@end table - -Usually, you want to change only the variables listed in the table -above, which are documented in the following section. - -However, the commands in built-in implicit rules actually use -variables such as @code{COMPILE.c}, @code{LINK.p}, and -@code{PREPROCESS.S}, whose values contain the commands listed above. - -@code{make} follows the convention that the rule to compile a -@file{.@var{x}} source file uses the variable @code{COMPILE.@var{x}}. -Similarly, the rule to produce an executable from a @file{.@var{x}} -file uses @code{LINK.@var{x}}; and the rule to preprocess a -@file{.@var{x}} file uses @code{PREPROCESS.@var{x}}. - -@vindex OUTPUT_OPTION -Every rule that produces an object file uses the variable -@code{OUTPUT_OPTION}. @code{make} defines this variable either to -contain @samp{-o $@@}, or to be empty, depending on a compile-time -option. You need the @samp{-o} option to ensure that the output goes -into the right file when the source file is in a different directory, -as when using @code{VPATH} (@pxref{Directory Search}). However, -compilers on some systems do not accept a @samp{-o} switch for object -files. If you use such a system, and use @code{VPATH}, some -compilations will put their output in the wrong place. -A possible workaround for this problem is to give @code{OUTPUT_OPTION} -the value @w{@samp{; mv $*.o $@@}}. - -@node Implicit Variables, Chained Rules, Catalogue of Rules, Implicit Rules -@section Variables Used by Implicit Rules -@cindex flags for compilers - -The commands in built-in implicit rules make liberal use of certain -predefined variables. You can alter these variables in the makefile, -with arguments to @code{make}, or in the environment to alter how the -implicit rules work without redefining the rules themselves. - -For example, the command used to compile a C source file actually says -@samp{$(CC) -c $(CFLAGS) $(CPPFLAGS)}. The default values of the variables -used are @samp{cc} and nothing, resulting in the command @samp{cc -c}. By -redefining @samp{CC} to @samp{ncc}, you could cause @samp{ncc} to be -used for all C compilations performed by the implicit rule. By redefining -@samp{CFLAGS} to be @samp{-g}, you could pass the @samp{-g} option to -each compilation. @emph{All} implicit rules that do C compilation use -@samp{$(CC)} to get the program name for the compiler and @emph{all} -include @samp{$(CFLAGS)} among the arguments given to the compiler.@refill - -The variables used in implicit rules fall into two classes: those that are -names of programs (like @code{CC}) and those that contain arguments for the -programs (like @code{CFLAGS}). (The ``name of a program'' may also contain -some command arguments, but it must start with an actual executable program -name.) If a variable value contains more than one argument, separate them -with spaces. - -Here is a table of variables used as names of programs in built-in rules: - -@table @code -@item AR -@vindex AR -Archive-maintaining program; default @samp{ar}. -@pindex ar - -@item AS -@vindex AS -Program for doing assembly; default @samp{as}. -@pindex as - -@item CC -@vindex CC -Program for compiling C programs; default @samp{cc}. -@pindex cc - -@item CXX -@vindex CXX -Program for compiling C++ programs; default @samp{g++}. -@pindex g++ - -@item CO -@vindex CO -Program for extracting a file from RCS; default @samp{co}. -@pindex co - -@item CPP -@vindex CPP -Program for running the C preprocessor, with results to standard output; -default @samp{$(CC) -E}. - -@item FC -@vindex FC -Program for compiling or preprocessing Fortran and Ratfor programs; -default @samp{f77}. -@pindex f77 - -@item GET -@vindex GET -Program for extracting a file from SCCS; default @samp{get}. -@pindex get - -@item LEX -@vindex LEX -Program to use to turn Lex grammars into C programs or Ratfor programs; -default @samp{lex}. -@pindex lex - -@item PC -@vindex PC -Program for compiling Pascal programs; default @samp{pc}. -@pindex pc - -@item YACC -@vindex YACC -Program to use to turn Yacc grammars into C programs; default @samp{yacc}. -@pindex yacc - -@item YACCR -@vindex YACCR -Program to use to turn Yacc grammars into Ratfor -programs; default @samp{yacc -r}. - -@item MAKEINFO -@vindex MAKEINFO -Program to convert a Texinfo source file into an Info file; default -@samp{makeinfo}. -@pindex makeinfo - -@item TEX -@vindex TEX -Program to make @TeX{} @sc{dvi} files from @TeX{} source; -default @samp{tex}. -@pindex tex - -@item TEXI2DVI -@vindex TEXI2DVI -Program to make @TeX{} @sc{dvi} files from Texinfo source; -default @samp{texi2dvi}. -@pindex texi2dvi - -@item WEAVE -@vindex WEAVE -Program to translate Web into @TeX{}; default @samp{weave}. -@pindex weave - -@item CWEAVE -@vindex CWEAVE -Program to translate C Web into @TeX{}; default @samp{cweave}. -@pindex cweave - -@item TANGLE -@vindex TANGLE -Program to translate Web into Pascal; default @samp{tangle}. -@pindex tangle - -@item CTANGLE -@vindex CTANGLE -Program to translate C Web into C; default @samp{ctangle}. -@pindex ctangle - -@item RM -@vindex RM -Command to remove a file; default @samp{rm -f}. -@pindex rm -@end table - -Here is a table of variables whose values are additional arguments for the -programs above. The default values for all of these is the empty -string, unless otherwise noted. - -@table @code -@item ARFLAGS -@vindex ARFLAGS -Flags to give the archive-maintaining program; default @samp{rv}. - -@item ASFLAGS -@vindex ASFLAGS -Extra flags to give to the assembler (when explicitly -invoked on a @samp{.s} or @samp{.S} file). - -@item CFLAGS -@vindex CFLAGS -Extra flags to give to the C compiler. - -@item CXXFLAGS -@vindex CXXFLAGS -Extra flags to give to the C++ compiler. - -@item COFLAGS -@vindex COFLAGS -Extra flags to give to the RCS @code{co} program. - -@item CPPFLAGS -@vindex CPPFLAGS -Extra flags to give to the C preprocessor and programs -that use it (the C and Fortran compilers). - -@item FFLAGS -@vindex FFLAGS -Extra flags to give to the Fortran compiler. - -@item GFLAGS -@vindex GFLAGS -Extra flags to give to the SCCS @code{get} program. - -@item LDFLAGS -@vindex LDFLAGS -Extra flags to give to compilers when they are -supposed to invoke the linker, @samp{ld}. - -@item LFLAGS -@vindex LFLAGS -Extra flags to give to Lex. - -@item PFLAGS -@vindex PFLAGS -Extra flags to give to the Pascal compiler. - -@item RFLAGS -@vindex RFLAGS -Extra flags to give to the Fortran compiler for Ratfor programs. - -@item YFLAGS -@vindex YFLAGS -Extra flags to give to Yacc. -@end table - -@node Chained Rules, Pattern Rules, Implicit Variables, Implicit Rules -@section Chains of Implicit Rules - -@cindex chains of rules -@cindex rule, implicit, chains of -Sometimes a file can be made by a sequence of implicit rules. For example, -a file @file{@var{n}.o} could be made from @file{@var{n}.y} by running -first Yacc and then @code{cc}. Such a sequence is called a @dfn{chain}. - -If the file @file{@var{n}.c} exists, or is mentioned in the makefile, no -special searching is required: @code{make} finds that the object file can -be made by C compilation from @file{@var{n}.c}; later on, when considering -how to make @file{@var{n}.c}, the rule for running Yacc is -used. Ultimately both @file{@var{n}.c} and @file{@var{n}.o} are -updated.@refill - -@cindex intermediate files -@cindex files, intermediate -However, even if @file{@var{n}.c} does not exist and is not mentioned, -@code{make} knows how to envision it as the missing link between -@file{@var{n}.o} and @file{@var{n}.y}! In this case, @file{@var{n}.c} is -called an @dfn{intermediate file}. Once @code{make} has decided to use the -intermediate file, it is entered in the data base as if it had been -mentioned in the makefile, along with the implicit rule that says how to -create it.@refill - -Intermediate files are remade using their rules just like all other -files. The difference is that the intermediate file is deleted when -@code{make} is finished. Therefore, the intermediate file which did not -exist before @code{make} also does not exist after @code{make}. The -deletion is reported to you by printing a @samp{rm -f} command that -shows what @code{make} is doing. (You can list the target pattern of an -implicit rule (such as @samp{%.o}) as a dependency of the special -target @code{.PRECIOUS} to preserve intermediate files made by implicit -rules whose target patterns match that file's name; -see @ref{Interrupts}.)@refill -@cindex intermediate files, preserving -@cindex preserving intermediate files -@cindex preserving with @code{.PRECIOUS} -@cindex @code{.PRECIOUS} intermediate files - -A chain can involve more than two implicit rules. For example, it is -possible to make a file @file{foo} from @file{RCS/foo.y,v} by running RCS, -Yacc and @code{cc}. Then both @file{foo.y} and @file{foo.c} are -intermediate files that are deleted at the end.@refill - -No single implicit rule can appear more than once in a chain. This means -that @code{make} will not even consider such a ridiculous thing as making -@file{foo} from @file{foo.o.o} by running the linker twice. This -constraint has the added benefit of preventing any infinite loop in the -search for an implicit rule chain. - -There are some special implicit rules to optimize certain cases that would -otherwise be handled by rule chains. For example, making @file{foo} from -@file{foo.c} could be handled by compiling and linking with separate -chained rules, using @file{foo.o} as an intermediate file. But what -actually happens is that a special rule for this case does the compilation -and linking with a single @code{cc} command. The optimized rule is used in -preference to the step-by-step chain because it comes earlier in the -ordering of rules. - -@node Pattern Rules, Last Resort, Chained Rules, Implicit Rules -@section Defining and Redefining Pattern Rules - -You define an implicit rule by writing a @dfn{pattern rule}. A pattern -rule looks like an ordinary rule, except that its target contains the -character @samp{%} (exactly one of them). The target is considered a -pattern for matching file names; the @samp{%} can match any nonempty -substring, while other characters match only themselves. The dependencies -likewise use @samp{%} to show how their names relate to the target name. - -Thus, a pattern rule @samp{%.o : %.c} says how to make any file -@file{@var{stem}.o} from another file @file{@var{stem}.c}.@refill - -Note that expansion using @samp{%} in pattern rules occurs -@strong{after} any variable or function expansions, which take place -when the makefile is read. @xref{Using Variables, , How to Use -Variables}, and @ref{Functions, ,Functions for Transforming Text}. - -@menu -* Pattern Intro:: An introduction to pattern rules. -* Pattern Examples:: Examples of pattern rules. -* Automatic:: How to use automatic variables in the - commands of implicit rules. -* Pattern Match:: How patterns match. -* Match-Anything Rules:: Precautions you should take prior to - defining rules that can match any - target file whatever. -* Canceling Rules:: How to override or cancel built-in rules. -@end menu - -@node Pattern Intro, Pattern Examples, , Pattern Rules -@subsection Introduction to Pattern Rules -@cindex pattern rule -@cindex rule, pattern - -A pattern rule contains the character @samp{%} (exactly one of them) -in the target; otherwise, it looks exactly like an ordinary rule. The -target is a pattern for matching file names; the @samp{%} matches any -nonempty substring, while other characters match only themselves. -@cindex target pattern, implicit -@cindex @code{%}, in pattern rules - -For example, @samp{%.c} as a pattern matches any file name that ends in -@samp{.c}. @samp{s.%.c} as a pattern matches any file name that starts -with @samp{s.}, ends in @samp{.c} and is at least five characters long. -(There must be at least one character to match the @samp{%}.) The substring -that the @samp{%} matches is called the @dfn{stem}.@refill - -@samp{%} in a dependency of a pattern rule stands for the same stem -that was matched by the @samp{%} in the target. In order for -the pattern rule to apply, its target pattern must match the file name -under consideration, and its dependency patterns must name files that -exist or can be made. These files become dependencies of the target. -@cindex dependency pattern, implicit - -Thus, a rule of the form - -@example -%.o : %.c ; @var{command}@dots{} -@end example - -@noindent -specifies how to make a file @file{@var{n}.o}, with another file -@file{@var{n}.c} as its dependency, provided that @file{@var{n}.c} -exists or can be made. - -There may also be dependencies that do not use @samp{%}; such a dependency -attaches to every file made by this pattern rule. These unvarying -dependencies are useful occasionally. - -A pattern rule need not have any dependencies that contain @samp{%}, or -in fact any dependencies at all. Such a rule is effectively a general -wildcard. It provides a way to make any file that matches the target -pattern. @xref{Last Resort}. - -@c !!! The end of of this paragraph should be rewritten. --bob -Pattern rules may have more than one target. Unlike normal rules, this -does not act as many different rules with the same dependencies and -commands. If a pattern rule has multiple targets, @code{make} knows that -the rule's commands are responsible for making all of the targets. The -commands are executed only once to make all the targets. When searching -for a pattern rule to match a target, the target patterns of a rule other -than the one that matches the target in need of a rule are incidental: -@code{make} worries only about giving commands and dependencies to the file -presently in question. However, when this file's commands are run, the -other targets are marked as having been updated themselves. -@cindex multiple targets, in pattern rule -@cindex target, multiple in pattern rule - -The order in which pattern rules appear in the makefile is important -since this is the order in which they are considered. -Of equally applicable -rules, only the first one found is used. The rules you write take precedence -over those that are built in. Note however, that a rule whose -dependencies actually exist or are mentioned always takes priority over a -rule with dependencies that must be made by chaining other implicit rules. -@cindex pattern rules, order of -@cindex order of pattern rules - -@node Pattern Examples, Automatic, Pattern Intro, Pattern Rules -@subsection Pattern Rule Examples - -Here are some examples of pattern rules actually predefined in -@code{make}. First, the rule that compiles @samp{.c} files into @samp{.o} -files:@refill - -@example -%.o : %.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@@ -@end example - -@noindent -defines a rule that can make any file @file{@var{x}.o} from -@file{@var{x}.c}. The command uses the automatic variables @samp{$@@} and -@samp{$<} to substitute the names of the target file and the source file -in each case where the rule applies (@pxref{Automatic, ,Automatic Variables}).@refill - -Here is a second built-in rule: - -@example -% :: RCS/%,v - $(CO) $(COFLAGS) $< -@end example - -@noindent -defines a rule that can make any file @file{@var{x}} whatsoever from a -corresponding file @file{@var{x},v} in the subdirectory @file{RCS}. Since -the target is @samp{%}, this rule will apply to any file whatever, provided -the appropriate dependency file exists. The double colon makes the rule -@dfn{terminal}, which means that its dependency may not be an intermediate -file (@pxref{Match-Anything Rules, ,Match-Anything Pattern Rules}).@refill - -@need 500 -This pattern rule has two targets: - -@example -@group -%.tab.c %.tab.h: %.y - bison -d $< -@end group -@end example - -@noindent -@c The following paragraph is rewritten to avoid overfull hboxes -This tells @code{make} that the command @samp{bison -d @var{x}.y} will -make both @file{@var{x}.tab.c} and @file{@var{x}.tab.h}. If the file -@file{foo} depends on the files @file{parse.tab.o} and @file{scan.o} -and the file @file{scan.o} depends on the file @file{parse.tab.h}, -when @file{parse.y} is changed, the command @samp{bison -d parse.y} -will be executed only once, and the dependencies of both -@file{parse.tab.o} and @file{scan.o} will be satisfied. (Presumably -the file @file{parse.tab.o} will be recompiled from @file{parse.tab.c} -and the file @file{scan.o} from @file{scan.c}, while @file{foo} is -linked from @file{parse.tab.o}, @file{scan.o}, and its other -dependencies, and it will execute happily ever after.)@refill - -@node Automatic, Pattern Match, Pattern Examples, Pattern Rules -@subsection Automatic Variables -@cindex automatic variables -@cindex variables, automatic -@cindex variables, and implicit rule - -Suppose you are writing a pattern rule to compile a @samp{.c} file into a -@samp{.o} file: how do you write the @samp{cc} command so that it operates -on the right source file name? You cannot write the name in the command, -because the name is different each time the implicit rule is applied. - -What you do is use a special feature of @code{make}, the @dfn{automatic -variables}. These variables have values computed afresh for each rule that -is executed, based on the target and dependencies of the rule. In this -example, you would use @samp{$@@} for the object file name and @samp{$<} -for the source file name. - -Here is a table of automatic variables: - -@table @code -@vindex $@@ -@vindex @@ @r{(automatic variable)} -@item $@@ -The file name of the target of the rule. If the target is an archive -member, then @samp{$@@} is the name of the archive file. In a pattern -rule that has multiple targets (@pxref{Pattern Intro, ,Introduction to -Pattern Rules}), @samp{$@@} is the name of whichever target caused the -rule's commands to be run. - -@vindex $% -@vindex % @r{(automatic variable)} -@item $% -The target member name, when the target is an archive member. -@xref{Archives}. For example, if the target is @file{foo.a(bar.o)} then -@samp{$%} is @file{bar.o} and @samp{$@@} is @file{foo.a}. @samp{$%} is -empty when the target is not an archive member. - -@vindex $< -@vindex < @r{(automatic variable)} -@item $< -The name of the first dependency. If the target got its commands from -an implicit rule, this will be the first dependency added by the -implicit rule (@pxref{Implicit Rules}). - -@vindex $? -@vindex ? @r{(automatic variable)} -@item $? -The names of all the dependencies that are newer than the target, with -spaces between them. For dependencies which are archive members, only -the member named is used (@pxref{Archives}). -@cindex dependencies, list of changed -@cindex list of changed dependencies - -@vindex $^ -@vindex ^ @r{(automatic variable)} -@item $^ -The names of all the dependencies, with spaces between them. For -dependencies which are archive members, only the member named is used -(@pxref{Archives}). A target has only one dependency on each other file -it depends on, no matter how many times each file is listed as a -dependency. So if you list a dependency more than once for a target, -the value of @code{$^} contains just one copy of the name. -@cindex dependencies, list of all -@cindex list of all dependencies - -@vindex $+ -@vindex + @r{(automatic variable)} -@item $+ -This is like @samp{$^}, but dependencies listed more than once are -duplicated in the order they were listed in the makefile. This is -primarily useful for use in linking commands where it is meaningful to -repeat library file names in a particular order. - -@vindex $* -@vindex * @r{(automatic variable)} -@item $* -The stem with which an implicit rule matches (@pxref{Pattern Match, ,How -Patterns Match}). If the target is @file{dir/a.foo.b} and the target -pattern is @file{a.%.b} then the stem is @file{dir/foo}. The stem is -useful for constructing names of related files.@refill -@cindex stem, variable for - -In a static pattern rule, the stem is part of the file name that matched -the @samp{%} in the target pattern. - -In an explicit rule, there is no stem; so @samp{$*} cannot be determined -in that way. Instead, if the target name ends with a recognized suffix -(@pxref{Suffix Rules, ,Old-Fashioned Suffix Rules}), @samp{$*} is set to -the target name minus the suffix. For example, if the target name is -@samp{foo.c}, then @samp{$*} is set to @samp{foo}, since @samp{.c} is a -suffix. GNU @code{make} does this bizarre thing only for compatibility -with other implementations of @code{make}. You should generally avoid -using @samp{$*} except in implicit rules or static pattern rules.@refill - -If the target name in an explicit rule does not end with a recognized -suffix, @samp{$*} is set to the empty string for that rule. -@end table - -@samp{$?} is useful even in explicit rules when you wish to operate on only -the dependencies that have changed. For example, suppose that an archive -named @file{lib} is supposed to contain copies of several object files. -This rule copies just the changed object files into the archive: - -@example -@group -lib: foo.o bar.o lose.o win.o - ar r lib $? -@end group -@end example - -Of the variables listed above, four have values that are single file -names, and two have values that are lists of file names. These six have -variants that get just the file's directory name or just the file name -within the directory. The variant variables' names are formed by -appending @samp{D} or @samp{F}, respectively. These variants are -semi-obsolete in GNU @code{make} since the functions @code{dir} and -@code{notdir} can be used to get a similar effect (@pxref{Filename -Functions, , Functions for File Names}). Note, however, that the -@samp{F} variants all omit the trailing slash which always appears in -the output of the @code{dir} function. Here is a table of the variants: - -@table @samp -@vindex $(@@D) -@vindex @@D @r{(automatic variable)} -@item $(@@D) -The directory part of the file name of the target, with the trailing -slash removed. If the value of @samp{$@@} is @file{dir/foo.o} then -@samp{$(@@D)} is @file{dir}. This value is @file{.} if @samp{$@@} does -not contain a slash. - -@vindex $(@@F) -@vindex @@F @r{(automatic variable)} -@item $(@@F) -The file-within-directory part of the file name of the target. If the -value of @samp{$@@} is @file{dir/foo.o} then @samp{$(@@F)} is -@file{foo.o}. @samp{$(@@F)} is equivalent to @samp{$(notdir $@@)}. - -@vindex $(*D) -@vindex *D @r{(automatic variable)} -@item $(*D) -@vindex $(*F) -@vindex *F @r{(automatic variable)} -@itemx $(*F) -The directory part and the file-within-directory -part of the stem; @file{dir} and @file{foo} in this example. - -@vindex $(%D) -@vindex %D @r{(automatic variable)} -@item $(%D) -@vindex $(%F) -@vindex %F @r{(automatic variable)} -@itemx $(%F) -The directory part and the file-within-directory part of the target -archive member name. This makes sense only for archive member targets -of the form @file{@var{archive}(@var{member})} and is useful only when -@var{member} may contain a directory name. (@xref{Archive Members, -,Archive Members as Targets}.) - -@vindex $( tar-`sed -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ - -e q - version.c`.shar.Z -@end group - -@group -dist: $(SRCS) $(AUX) - echo tar-`sed \ - -e '/version_string/!d' \ - -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ - -e q - version.c` > .fname - -rm -rf `cat .fname` - mkdir `cat .fname` - ln $(SRCS) $(AUX) `cat .fname` - -rm -rf `cat .fname` .fname - tar chZf `cat .fname`.tar.Z `cat .fname` -@end group - -@group -tar.zoo: $(SRCS) $(AUX) - -rm -rf tmp.dir - -mkdir tmp.dir - -rm tar.zoo - for X in $(SRCS) $(AUX) ; do \ - echo $$X ; \ - sed 's/$$/^M/' $$X \ - > tmp.dir/$$X ; done - cd tmp.dir ; zoo aM ../tar.zoo * - -rm -rf tmp.dir -@end group -@end example - -@node Concept Index, Name Index, Complex Makefile, Top -@unnumbered Index of Concepts - -@printindex cp - -@node Name Index, , Concept Index, Top -@unnumbered Index of Functions, Variables, & Directives - -@printindex fn - -@summarycontents -@contents -@bye diff --git a/buildtools/windows/source/make/make.toc b/buildtools/windows/source/make/make.toc deleted file mode 100644 index 311573ce690..00000000000 --- a/buildtools/windows/source/make/make.toc +++ /dev/null @@ -1,118 +0,0 @@ -\chapentry {Overview of \code {make}}{1}{1} -\secentry {How to Read This Manual}{1}{1}{1} -\secentry {Problems and Bugs}{1}{2}{2} -\chapentry {An Introduction to Makefiles}{2}{5} -\secentry {What a Rule Looks Like}{2}{1}{5} -\secentry {A Simple Makefile}{2}{2}{6} -\secentry {How \code {make} Processes a Makefile}{2}{3}{8} -\secentry {Variables Make Makefiles Simpler}{2}{4}{9} -\secentry {Letting \code {make} Deduce the Commands}{2}{5}{10} -\secentry {Another Style of Makefile}{2}{6}{11} -\secentry {Rules for Cleaning the Directory}{2}{7}{12} -\chapentry {Writing Makefiles}{3}{13} -\secentry {What Makefiles Contain}{3}{1}{13} -\secentry {What Name to Give Your Makefile}{3}{2}{14} -\secentry {Including Other Makefiles}{3}{3}{14} -\secentry {The Variable \code {MAKEFILES}}{3}{4}{16} -\secentry {How Makefiles Are Remade}{3}{5}{16} -\secentry {Overriding Part of Another Makefile}{3}{6}{18} -\chapentry {Writing Rules}{4}{19} -\secentry {Rule Syntax}{4}{1}{19} -\secentry {Using Wildcard Characters in File Names}{4}{2}{20} -\subsecentry {Wildcard Examples}{4}{2}{1}{21} -\subsecentry {Pitfalls of Using Wildcards}{4}{2}{2}{22} -\subsecentry {The Function \code {wildcard}}{4}{2}{3}{22} -\secentry {Searching Directories for Dependencies}{4}{3}{23} -\subsecentry {\code {VPATH}: Search Path for All Dependencies}{4}{3}{1}{23} -\subsecentry {The \code {vpath} Directive}{4}{3}{2}{24} -\subsecentry {Writing Shell Commands with Directory Search}{4}{3}{3}{26} -\subsecentry {Directory Search and Implicit Rules}{4}{3}{4}{27} -\subsecentry {Directory Search for Link Libraries}{4}{3}{5}{27} -\secentry {Phony Targets}{4}{4}{28} -\secentry {Rules without Commands or Dependencies}{4}{5}{30} -\secentry {Empty Target Files to Record Events}{4}{6}{30} -\secentry {Special Built-in Target Names}{4}{7}{31} -\secentry {Multiple Targets in a Rule}{4}{8}{32} -\secentry {Multiple Rules for One Target}{4}{9}{33} -\secentry {Static Pattern Rules}{4}{10}{34} -\subsecentry {Syntax of Static Pattern Rules}{4}{10}{1}{34} -\subsecentry {Static Pattern Rules versus Implicit Rules}{4}{10}{2}{36} -\secentry {Double-Colon Rules}{4}{11}{37} -\secentry {Generating Dependencies Automatically}{4}{12}{37} -\chapentry {Writing the Commands in Rules}{5}{41} -\secentry {Command Echoing}{5}{1}{41} -\secentry {Command Execution}{5}{2}{42} -\secentry {Parallel Execution}{5}{3}{42} -\secentry {Errors in Commands}{5}{4}{44} -\secentry {Interrupting or Killing \code {make}}{5}{5}{45} -\secentry {Recursive Use of \code {make}}{5}{6}{46} -\subsecentry {How the \code {MAKE} Variable Works}{5}{6}{1}{46} -\subsecentry {Communicating Variables to a Sub-\code {make}}{5}{6}{2}{47} -\subsecentry {Communicating Options to a Sub-\code {make}}{5}{6}{3}{50} -\subsecentry {The \samp {--print-directory} Option}{5}{6}{4}{52} -\secentry {Defining Canned Command Sequences}{5}{7}{52} -\secentry {Using Empty Commands}{5}{8}{54} -\chapentry {How to Use Variables}{6}{55} -\secentry {Basics of Variable References}{6}{1}{55} -\secentry {The Two Flavors of Variables}{6}{2}{56} -\secentry {Advanced Features for Reference to Variables}{6}{3}{59} -\subsecentry {Substitution References}{6}{3}{1}{59} -\subsecentry {Computed Variable Names}{6}{3}{2}{60} -\secentry {How Variables Get Their Values}{6}{4}{63} -\secentry {Setting Variables}{6}{5}{63} -\secentry {Appending More Text to Variables}{6}{6}{64} -\secentry {The \code {override} Directive}{6}{7}{66} -\secentry {Defining Variables Verbatim}{6}{8}{67} -\secentry {Variables from the Environment}{6}{9}{68} -\chapentry {Conditional Parts of Makefiles}{7}{71} -\secentry {Example of a Conditional}{7}{1}{71} -\secentry {Syntax of Conditionals}{7}{2}{72} -\secentry {Conditionals that Test Flags}{7}{3}{75} -\chapentry {Functions for Transforming Text}{8}{77} -\secentry {Function Call Syntax}{8}{1}{77} -\secentry {Functions for String Substitution and Analysis}{8}{2}{78} -\secentry {Functions for File Names}{8}{3}{81} -\secentry {The \code {foreach} Function}{8}{4}{83} -\secentry {The \code {origin} Function}{8}{5}{85} -\secentry {The \code {shell} Function}{8}{6}{87} -\chapentry {How to Run \code {make}}{9}{89} -\secentry {Arguments to Specify the Makefile}{9}{1}{89} -\secentry {Arguments to Specify the Goals}{9}{2}{90} -\secentry {Instead of Executing the Commands}{9}{3}{91} -\secentry {Avoiding Recompilation of Some Files}{9}{4}{93} -\secentry {Overriding Variables}{9}{5}{94} -\secentry {Testing the Compilation of a Program}{9}{6}{95} -\secentry {Summary of Options}{9}{7}{95} -\chapentry {Using Implicit Rules}{10}{101} -\secentry {Using Implicit Rules}{10}{1}{101} -\secentry {Catalogue of Implicit Rules}{10}{2}{103} -\secentry {Variables Used by Implicit Rules}{10}{3}{106} -\secentry {Chains of Implicit Rules}{10}{4}{108} -\secentry {Defining and Redefining Pattern Rules}{10}{5}{109} -\subsecentry {Introduction to Pattern Rules}{10}{5}{1}{110} -\subsecentry {Pattern Rule Examples}{10}{5}{2}{111} -\subsecentry {Automatic Variables}{10}{5}{3}{112} -\subsecentry {How Patterns Match}{10}{5}{4}{114} -\subsecentry {Match-Anything Pattern Rules}{10}{5}{5}{115} -\subsecentry {Canceling Implicit Rules}{10}{5}{6}{116} -\secentry {Defining Last-Resort Default Rules}{10}{6}{116} -\secentry {Old-Fashioned Suffix Rules}{10}{7}{117} -\secentry {Implicit Rule Search Algorithm}{10}{8}{119} -\chapentry {Using \code {make} to Update Archive Files}{11}{121} -\secentry {Archive Members as Targets}{11}{1}{121} -\secentry {Implicit Rule for Archive Member Targets}{11}{2}{122} -\subsecentry {Updating Archive Symbol Directories}{11}{2}{1}{123} -\secentry {Dangers When Using Archives}{11}{3}{123} -\secentry {Suffix Rules for Archive Files}{11}{4}{124} -\chapentry {Features of GNU \code {make}}{12}{125} -\chapentry {Incompatibilities and Missing Features}{13}{129} -\chapentry {Makefile Conventions}{14}{131} -\secentry {General Conventions for Makefiles}{14}{1}{131} -\secentry {Utilities in Makefiles}{14}{2}{132} -\secentry {Standard Targets for Users}{14}{3}{133} -\secentry {Variables for Specifying Commands}{14}{4}{136} -\secentry {Variables for Installation Directories}{14}{5}{138} -\chapentry {Quick Reference}{Appendix{} \char65}{143} -\chapentry {Complex Makefile Example}{Appendix{} \char66}{149} -\unnumbchapentry {Index of Concepts}{155} -\unnumbchapentry {Index of Functions, Variables, & Directives}{165} diff --git a/buildtools/windows/source/make/misc.c b/buildtools/windows/source/make/misc.c deleted file mode 100644 index f2ffc3898a8..00000000000 --- a/buildtools/windows/source/make/misc.c +++ /dev/null @@ -1,739 +0,0 @@ -/* Miscellaneous generic support functions for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "dep.h" - - -/* Compare strings *S1 and *S2. - Return negative if the first is less, positive if it is greater, - zero if they are equal. */ - -int -alpha_compare (const void *elem1, const void *elem2) -{ - char **s1 = (char **)elem1; - char **s2 = (char **)elem2; - if (**s1 != **s2) - return **s1 - **s2; - return strcmp (*s1, *s2); -} - -/* Discard each backslash-newline combination from LINE. - Backslash-backslash-newline combinations become backslash-newlines. - This is done by copying the text at LINE into itself. */ - -void -collapse_continuations (line) - char *line; -{ - register char *in, *out, *p; - register int backslash; - register unsigned int bs_write; - - in = index (line, '\n'); - if (in == 0) - return; - - out = in; - if (out > line) - while (out[-1] == '\\') - --out; - - while (*in != '\0') - { - /* BS_WRITE gets the number of quoted backslashes at - the end just before IN, and BACKSLASH gets nonzero - if the next character is quoted. */ - backslash = 0; - bs_write = 0; - for (p = in - 1; p >= line && *p == '\\'; --p) - { - if (backslash) - ++bs_write; - backslash = !backslash; - - /* It should be impossible to go back this far without exiting, - but if we do, we can't get the right answer. */ - if (in == out - 1) - abort (); - } - - /* Output the appropriate number of backslashes. */ - while (bs_write-- > 0) - *out++ = '\\'; - - /* Skip the newline. */ - ++in; - - /* If the newline is quoted, discard following whitespace - and any preceding whitespace; leave just one space. */ - if (backslash) - { - in = next_token (in); - while (out > line && isblank (out[-1])) - --out; - *out++ = ' '; - } - else - /* If the newline isn't quoted, put it in the output. */ - *out++ = '\n'; - - /* Now copy the following line to the output. - Stop when we find backslashes followed by a newline. */ - while (*in != '\0') - if (*in == '\\') - { - p = in + 1; - while (*p == '\\') - ++p; - if (*p == '\n') - { - in = p; - break; - } - while (in < p) - *out++ = *in++; - } - else - *out++ = *in++; - } - - *out = '\0'; -} - - -/* Remove comments from LINE. - This is done by copying the text at LINE onto itself. */ - -void -remove_comments (line) - char *line; -{ - char *comment; - - comment = find_char_unquote (line, "#", 0); - - if (comment != 0) - /* Cut off the line at the #. */ - *comment = '\0'; -} - -/* Print N spaces (used by DEBUGPR for target-depth). */ - -void -print_spaces (n) - register unsigned int n; -{ - while (n-- > 0) - putchar (' '); -} - - -/* Return a newly-allocated string whose contents - concatenate those of s1, s2, s3. */ - -char * -concat (s1, s2, s3) - register char *s1, *s2, *s3; -{ - register unsigned int len1, len2, len3; - register char *result; - - len1 = *s1 != '\0' ? strlen (s1) : 0; - len2 = *s2 != '\0' ? strlen (s2) : 0; - len3 = *s3 != '\0' ? strlen (s3) : 0; - - result = (char *) xmalloc (len1 + len2 + len3 + 1); - - if (*s1 != '\0') - bcopy (s1, result, len1); - if (*s2 != '\0') - bcopy (s2, result + len1, len2); - if (*s3 != '\0') - bcopy (s3, result + len1 + len2, len3); - *(result + len1 + len2 + len3) = '\0'; - - return result; -} - -/* Print a message on stdout. */ - -void -message (s1, s2, s3, s4, s5, s6) - char *s1, *s2, *s3, *s4, *s5, *s6; -{ - if (makelevel == 0) - printf ("%s: ", program); - else - printf ("%s[%u]: ", program, makelevel); - printf (s1, s2, s3, s4, s5, s6); - putchar ('\n'); - fflush (stdout); -} - -/* Print an error message and exit. */ - -/* VARARGS1 */ -void -fatal (s1, s2, s3, s4, s5, s6) - char *s1, *s2, *s3, *s4, *s5, *s6; -{ - if (makelevel == 0) - fprintf (stderr, "%s: *** ", program); - else - fprintf (stderr, "%s[%u]: *** ", program, makelevel); - fprintf (stderr, s1, s2, s3, s4, s5, s6); - fputs (". Stop.\n", stderr); - - die (2); -} - -/* Print error message. `s1' is printf control string, `s2' is arg for it. */ - -/* VARARGS1 */ - -void -error (s1, s2, s3, s4, s5, s6) - char *s1, *s2, *s3, *s4, *s5, *s6; -{ - if (makelevel == 0) - fprintf (stderr, "%s: ", program); - else - fprintf (stderr, "%s[%u]: ", program, makelevel); - fprintf (stderr, s1, s2, s3, s4, s5, s6); - putc ('\n', stderr); - fflush (stderr); -} - -void -makefile_error (file, lineno, s1, s2, s3, s4, s5, s6) - char *file; - unsigned int lineno; - char *s1, *s2, *s3, *s4, *s5, *s6; -{ - fprintf (stderr, "%s:%u: ", file, lineno); - fprintf (stderr, s1, s2, s3, s4, s5, s6); - putc ('\n', stderr); - fflush (stderr); -} - -void -makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6) - char *file; - unsigned int lineno; - char *s1, *s2, *s3, *s4, *s5, *s6; -{ - fprintf (stderr, "%s:%u: *** ", file, lineno); - fprintf (stderr, s1, s2, s3, s4, s5, s6); - fputs (". Stop.\n", stderr); - - die (2); -} - -#ifndef HAVE_STRERROR - -#undef strerror - -char * -strerror (errnum) - int errnum; -{ - extern int errno, sys_nerr; - extern char *sys_errlist[]; - static char buf[] = "Unknown error 12345678901234567890"; - - if (errno < sys_nerr) - return sys_errlist[errnum]; - - sprintf (buf, "Unknown error %d", errnum); - return buf; -} -#endif - -/* Print an error message from errno. */ - -void -perror_with_name (str, name) - char *str, *name; -{ - error ("%s%s: %s", str, name, strerror (errno)); -} - -/* Print an error message from errno and exit. */ - -void -pfatal_with_name (name) - char *name; -{ - fatal ("%s: %s", name, strerror (errno)); - - /* NOTREACHED */ -} - -/* Like malloc but get fatal error if memory is exhausted. */ - -#undef xmalloc -#undef xrealloc - -char * -xmalloc (size) - unsigned int size; -{ - char *result = (char *) malloc (size); - if (result == 0) - fatal ("virtual memory exhausted"); - return result; -} - - -char * -xrealloc (ptr, size) - char *ptr; - unsigned int size; -{ - char *result = (char *) realloc (ptr, size); - if (result == 0) - fatal ("virtual memory exhausted"); - return result; -} - -char * -savestring (str, length) - char *str; - unsigned int length; -{ - register char *out = (char *) xmalloc (length + 1); - if (length > 0) - bcopy (str, out, length); - out[length] = '\0'; - return out; -} - -/* Search string BIG (length BLEN) for an occurrence of - string SMALL (length SLEN). Return a pointer to the - beginning of the first occurrence, or return nil if none found. */ - -char * -sindex (big, blen, small, slen) - char *big; - unsigned int blen; - char *small; - unsigned int slen; -{ - register unsigned int b; - - if (blen < 1) - blen = strlen (big); - if (slen < 1) - slen = strlen (small); - - for (b = 0; b < blen; ++b) - if (big[b] == *small && !strncmp (&big[b + 1], small + 1, slen - 1)) - return (&big[b]); - - return 0; -} - -/* Limited INDEX: - Search through the string STRING, which ends at LIMIT, for the character C. - Returns a pointer to the first occurrence, or nil if none is found. - Like INDEX except that the string searched ends where specified - instead of at the first null. */ - -char * -lindex (s, limit, c) - register char *s, *limit; - int c; -{ - while (s < limit) - if (*s++ == c) - return s - 1; - - return 0; -} - -/* Return the address of the first whitespace or null in the string S. */ - -char * -end_of_token (s) - char *s; -{ - while (*s != '\0' && !isblank (*s)) - ++s; - return s; -} - -/* Return the address of the first nonwhitespace or null in the string S. */ - -char * -next_token (s) - char *s; -{ - register char *p = s; - - while (isblank (*p)) - ++p; - return p; -} - -/* Find the next token in PTR; return the address of it, and store the - length of the token into *LENGTHPTR if LENGTHPTR is not nil. */ - -char * -find_next_token (ptr, lengthptr) - char **ptr; - unsigned int *lengthptr; -{ - char *p = next_token (*ptr); - char *end; - - if (*p == '\0') - return 0; - - *ptr = end = end_of_token (p); - if (lengthptr != 0) - *lengthptr = end - p; - return p; -} - -/* Copy a chain of `struct dep', making a new chain - with the same contents as the old one. */ - -struct dep * -copy_dep_chain (d) - register struct dep *d; -{ - register struct dep *c; - struct dep *firstnew = 0; - struct dep *lastnew; - - while (d != 0) - { - c = (struct dep *) xmalloc (sizeof (struct dep)); - bcopy ((char *) d, (char *) c, sizeof (struct dep)); - if (c->name != 0) - c->name = savestring (c->name, strlen (c->name)); - c->next = 0; - if (firstnew == 0) - firstnew = lastnew = c; - else - lastnew = lastnew->next = c; - - d = d->next; - } - - return firstnew; -} - -#ifdef iAPX286 -/* The losing compiler on this machine can't handle this macro. */ - -char * -dep_name (dep) - struct dep *dep; -{ - return dep->name == 0 ? dep->file->name : dep->name; -} -#endif - -#ifdef GETLOADAVG_PRIVILEGED - -#ifdef POSIX - -/* Hopefully if a system says it's POSIX.1 and has the setuid and setgid - functions, they work as POSIX.1 says. Some systems (Alpha OSF/1 1.2, - for example) which claim to be POSIX.1 also have the BSD setreuid and - setregid functions, but they don't work as in BSD and only the POSIX.1 - way works. */ - -#undef HAVE_SETREUID -#undef HAVE_SETREGID - -#else /* Not POSIX. */ - -/* Some POSIX.1 systems have the seteuid and setegid functions. In a - POSIX-like system, they are the best thing to use. However, some - non-POSIX systems have them too but they do not work in the POSIX style - and we must use setreuid and setregid instead. */ - -#undef HAVE_SETEUID -#undef HAVE_SETEGID - -#endif /* POSIX. */ - -#ifndef HAVE_UNISTD_H -extern int getuid (), getgid (), geteuid (), getegid (); -extern int setuid (), setgid (); -#ifdef HAVE_SETEUID -extern int seteuid (); -#else -#ifdef HAVE_SETREUID -extern int setreuid (); -#endif /* Have setreuid. */ -#endif /* Have seteuid. */ -#ifdef HAVE_SETEGID -extern int setegid (); -#else -#ifdef HAVE_SETREGID -extern int setregid (); -#endif /* Have setregid. */ -#endif /* Have setegid. */ -#endif /* No . */ - -/* Keep track of the user and group IDs for user- and make- access. */ -static int user_uid = -1, user_gid = -1, make_uid = -1, make_gid = -1; -#define access_inited (user_uid != -1) -static enum { make, user } current_access; - - -/* Under -d, write a message describing the current IDs. */ - -static void -log_access (flavor) - char *flavor; -{ - if (! debug_flag) - return; - - /* All the other debugging messages go to stdout, - but we write this one to stderr because it might be - run in a child fork whose stdout is piped. */ - - fprintf (stderr, "%s access: user %d (real %d), group %d (real %d)\n", - flavor, geteuid (), getuid (), getegid (), getgid ()); - fflush (stderr); -} - - -static void -init_access () -{ - user_uid = getuid (); - user_gid = getgid (); - - make_uid = geteuid (); - make_gid = getegid (); - - /* Do these ever fail? */ - if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1) - pfatal_with_name ("get{e}[gu]id"); - - log_access ("Initialized"); - - current_access = make; -} - -#endif /* GETLOADAVG_PRIVILEGED */ - -/* Give the process appropriate permissions for access to - user data (i.e., to stat files, or to spawn a child process). */ -void -user_access () -{ -#ifdef GETLOADAVG_PRIVILEGED - - if (!access_inited) - init_access (); - - if (current_access == user) - return; - - /* We are in "make access" mode. This means that the effective user and - group IDs are those of make (if it was installed setuid or setgid). - We now want to set the effective user and group IDs to the real IDs, - which are the IDs of the process that exec'd make. */ - -#ifdef HAVE_SETEUID - - /* Modern systems have the seteuid/setegid calls which set only the - effective IDs, which is ideal. */ - - if (seteuid (user_uid) < 0) - pfatal_with_name ("user_access: seteuid"); - -#else /* Not HAVE_SETEUID. */ - -#ifndef HAVE_SETREUID - - /* System V has only the setuid/setgid calls to set user/group IDs. - There is an effective ID, which can be set by setuid/setgid. - It can be set (unless you are root) only to either what it already is - (returned by geteuid/getegid, now in make_uid/make_gid), - the real ID (return by getuid/getgid, now in user_uid/user_gid), - or the saved set ID (what the effective ID was before this set-ID - executable (make) was exec'd). */ - - if (setuid (user_uid) < 0) - pfatal_with_name ("user_access: setuid"); - -#else /* HAVE_SETREUID. */ - - /* In 4BSD, the setreuid/setregid calls set both the real and effective IDs. - They may be set to themselves or each other. So you have two alternatives - at any one time. If you use setuid/setgid, the effective will be set to - the real, leaving only one alternative. Using setreuid/setregid, however, - you can toggle between your two alternatives by swapping the values in a - single setreuid or setregid call. */ - - if (setreuid (make_uid, user_uid) < 0) - pfatal_with_name ("user_access: setreuid"); - -#endif /* Not HAVE_SETREUID. */ -#endif /* HAVE_SETEUID. */ - -#ifdef HAVE_SETEGID - if (setegid (user_gid) < 0) - pfatal_with_name ("user_access: setegid"); -#else -#ifndef HAVE_SETREGID - if (setgid (user_gid) < 0) - pfatal_with_name ("user_access: setgid"); -#else - if (setregid (make_gid, user_gid) < 0) - pfatal_with_name ("user_access: setregid"); -#endif -#endif - - current_access = user; - - log_access ("User"); - -#endif /* GETLOADAVG_PRIVILEGED */ -} - -/* Give the process appropriate permissions for access to - make data (i.e., the load average). */ -void -make_access () -{ -#ifdef GETLOADAVG_PRIVILEGED - - if (!access_inited) - init_access (); - - if (current_access == make) - return; - - /* See comments in user_access, above. */ - -#ifdef HAVE_SETEUID - if (seteuid (make_uid) < 0) - pfatal_with_name ("make_access: seteuid"); -#else -#ifndef HAVE_SETREUID - if (setuid (make_uid) < 0) - pfatal_with_name ("make_access: setuid"); -#else - if (setreuid (user_uid, make_uid) < 0) - pfatal_with_name ("make_access: setreuid"); -#endif -#endif - -#ifdef HAVE_SETEGID - if (setegid (make_gid) < 0) - pfatal_with_name ("make_access: setegid"); -#else -#ifndef HAVE_SETREGID - if (setgid (make_gid) < 0) - pfatal_with_name ("make_access: setgid"); -#else - if (setregid (user_gid, make_gid) < 0) - pfatal_with_name ("make_access: setregid"); -#endif -#endif - - current_access = make; - - log_access ("Make"); - -#endif /* GETLOADAVG_PRIVILEGED */ -} - -/* Give the process appropriate permissions for a child process. - This is like user_access, but you can't get back to make_access. */ -void -child_access () -{ -#ifdef GETLOADAVG_PRIVILEGED - - if (!access_inited) - abort (); - - /* Set both the real and effective UID and GID to the user's. - They cannot be changed back to make's. */ - -#ifndef HAVE_SETREUID - if (setuid (user_uid) < 0) - pfatal_with_name ("child_access: setuid"); -#else - if (setreuid (user_uid, user_uid) < 0) - pfatal_with_name ("child_access: setreuid"); -#endif - -#ifndef HAVE_SETREGID - if (setgid (user_gid) < 0) - pfatal_with_name ("child_access: setgid"); -#else - if (setregid (user_gid, user_gid) < 0) - pfatal_with_name ("child_access: setregid"); -#endif - - log_access ("Child"); - -#endif /* GETLOADAVG_PRIVILEGED */ -} - -#ifdef NEED_GET_PATH_MAX -unsigned int -get_path_max () -{ - static unsigned int value; - - if (value == 0) - { - long int x = pathconf ("/", _PC_PATH_MAX); - if (x > 0) - value = x; - else - return MAXPATHLEN; - } - - return value; -} -#endif - -/* On some systems, stat can return EINTR. */ - -int -safe_stat (name, buf) - char *name; - struct stat *buf; -{ - int ret; - -#ifdef EINTR - do -#endif - ret = stat (name, buf); -#ifdef EINTR - while (ret < 0 && errno == EINTR); -#endif - - return ret; -} diff --git a/buildtools/windows/source/make/mkinstalldirs b/buildtools/windows/source/make/mkinstalldirs deleted file mode 100644 index 0801ec2c966..00000000000 --- a/buildtools/windows/source/make/mkinstalldirs +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Last modified: 1994-03-25 -# Public domain - -errstatus=0 - -for file in ${1+"$@"} ; do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" || errstatus=$? - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/buildtools/windows/source/make/read.c b/buildtools/windows/source/make/read.c deleted file mode 100644 index 75843e7803b..00000000000 --- a/buildtools/windows/source/make/read.c +++ /dev/null @@ -1,2067 +0,0 @@ -/* Reading and parsing of makefiles for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "dep.h" -#include "file.h" -#include "variable.h" - -/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */ -#ifdef HAVE_GLOB_H -#include -#else -#include "glob/glob.h" -#endif - -#ifndef NETSCAPE -#include -struct passwd *getpwnam (); -#endif - -static int read_makefile (); -static unsigned int readline (), do_define (); -static int conditional_line (); -static void record_files (); -static char *find_semicolon (); - - -/* A `struct linebuffer' is a structure which holds a line of text. - `readline' reads a line from a stream into a linebuffer - and works regardless of the length of the line. */ - -struct linebuffer - { - /* Note: This is the number of bytes malloc'ed for `buffer' - It does not indicate `buffer's real length. - Instead, a null char indicates end-of-string. */ - unsigned int size; - char *buffer; - }; - -#define initbuffer(lb) (lb)->buffer = (char *) xmalloc ((lb)->size = 200) -#define freebuffer(lb) free ((lb)->buffer) - - -/* A `struct conditionals' contains the information describing - all the active conditionals in a makefile. - - The global variable `conditionals' contains the conditionals - information for the current makefile. It is initialized from - the static structure `toplevel_conditionals' and is later changed - to new structures for included makefiles. */ - -struct conditionals - { - unsigned int if_cmds; /* Depth of conditional nesting. */ - unsigned int allocated; /* Elts allocated in following arrays. */ - char *ignoring; /* Are we ignoring or interepreting? */ - char *seen_else; /* Have we already seen an `else'? */ - }; - -static struct conditionals toplevel_conditionals; -static struct conditionals *conditionals = &toplevel_conditionals; - - -/* Default directories to search for include files in */ - -static char *default_include_directories[] = - { -#ifndef NETSCAPE - INCLUDEDIR, - "/usr/gnu/include", - "/usr/local/include", - "/usr/include", -#endif - 0 - }; - -/* List of directories to search for include files in */ - -static char **include_directories; - -/* Maximum length of an element of the above. */ - -static unsigned int max_incl_len; - -/* The filename and pointer to line number of the - makefile currently being read in. */ - -char *reading_filename; -unsigned int *reading_lineno_ptr; - -/* The chain of makefiles read by read_makefile. */ - -static struct dep *read_makefiles = 0; - -/* Read in all the makefiles and return the chain of their names. */ - -struct dep * -read_all_makefiles (makefiles) - char **makefiles; -{ - unsigned int num_makefiles = 0; - - if (debug_flag) - puts ("Reading makefiles..."); - - /* If there's a non-null variable MAKEFILES, its value is a list of - files to read first thing. But don't let it prevent reading the - default makefiles and don't let the default goal come from there. */ - - { - char *value; - char *name, *p; - unsigned int length; - - { - /* Turn off --warn-undefined-variables while we expand MAKEFILES. */ - int save = warn_undefined_variables_flag; - warn_undefined_variables_flag = 0; - - value = allocated_variable_expand ("$(MAKEFILES)"); - - warn_undefined_variables_flag = save; - } - - /* Set NAME to the start of next token and LENGTH to its length. - MAKEFILES is updated for finding remaining tokens. */ - p = value; - while ((name = find_next_token (&p, &length)) != 0) - { - if (*p != '\0') - *p++ = '\0'; - (void) read_makefile (name, - RM_NO_DEFAULT_GOAL | RM_INCLUDED | RM_DONTCARE); - } - - free (value); - } - - /* Read makefiles specified with -f switches. */ - - if (makefiles != 0) - while (*makefiles != 0) - { - struct dep *tail = read_makefiles; - register struct dep *d; - - if (! read_makefile (*makefiles, 0)) - perror_with_name ("", *makefiles); - - /* Find the right element of read_makefiles. */ - d = read_makefiles; - while (d->next != tail) - d = d->next; - - /* Use the storage read_makefile allocates. */ - *makefiles = dep_name (d); - ++num_makefiles; - ++makefiles; - } - - /* If there were no -f switches, try the default names. */ - - if (num_makefiles == 0) - { - static char *default_makefiles[] = - { "GNUmakefile", "makefile", "Makefile", 0 }; - register char **p = default_makefiles; - while (*p != 0 && !file_exists_p (*p)) - ++p; - - if (*p != 0) - { - if (! read_makefile (*p, 0)) - perror_with_name ("", *p); - } - else - { - /* No default makefile was found. Add the default makefiles to the - `read_makefiles' chain so they will be updated if possible. */ - struct dep *tail = read_makefiles; - for (p = default_makefiles; *p != 0; ++p) - { - struct dep *d = (struct dep *) xmalloc (sizeof (struct dep)); - d->name = 0; - d->file = enter_file (*p); - d->file->dontcare = 1; - /* Tell update_goal_chain to bail out as soon as this file is - made, and main not to die if we can't make this file. */ - d->changed = RM_DONTCARE; - if (tail == 0) - read_makefiles = d; - else - tail->next = d; - tail = d; - } - if (tail != 0) - tail->next = 0; - } - } - - return read_makefiles; -} - -/* Read file FILENAME as a makefile and add its contents to the data base. - - FLAGS contains bits as above. - - FILENAME is added to the `read_makefiles' chain. - - Returns 1 if a file was found and read, 0 if not. */ - -static int -read_makefile (filename, flags) - char *filename; - int flags; -{ - static char *collapsed = 0; - static unsigned int collapsed_length = 0; - register FILE *infile; - struct linebuffer lb; - unsigned int commands_len = 200; - char *commands = (char *) xmalloc (200); - unsigned int commands_idx = 0; - unsigned int commands_started; - register char *p; - char *p2; - int ignoring = 0, in_ignored_define = 0; - int no_targets = 0; /* Set when reading a rule without targets. */ - char *passed_filename = filename; - - struct nameseq *filenames = 0; - struct dep *deps; - unsigned int lineno = 1; - unsigned int nlines = 0; - int two_colon; - char *pattern = 0, *pattern_percent; - - int makefile_errno; - -#define record_waiting_files() \ - do \ - { \ - if (filenames != 0) \ - record_files (filenames, pattern, pattern_percent, deps, \ - commands_started, commands, commands_idx, \ - two_colon, filename, lineno, \ - !(flags & RM_NO_DEFAULT_GOAL)); \ - filenames = 0; \ - commands_idx = 0; \ - pattern = 0; \ - } while (0) - -#ifdef lint /* Suppress `used before set' messages. */ - two_colon = 0; -#endif - - if (debug_flag) - { - printf ("Reading makefile `%s'", filename); - if (flags & RM_NO_DEFAULT_GOAL) - printf (" (no default goal)"); - if (flags & RM_INCLUDED) - printf (" (search path)"); - if (flags & RM_DONTCARE) - printf (" (don't care)"); - if (flags & RM_NO_TILDE) - printf (" (no ~ expansion)"); - puts ("..."); - } - - /* First, get a stream to read. */ - - /* Expand ~ in FILENAME unless it came from `include', - in which case it was already done. */ - if (!(flags & RM_NO_TILDE) && filename[0] == '~') - { - char *expanded = tilde_expand (filename); - if (expanded != 0) - filename = expanded; - } - - infile = fopen (filename, "r"); - /* Save the error code so we print the right message later. */ - makefile_errno = errno; - - /* If the makefile wasn't found and it's either a makefile from - the `MAKEFILES' variable or an included makefile, - search the included makefile search path for this makefile. */ - - if (infile == 0 && (flags & RM_INCLUDED) && *filename != '/') - { - register unsigned int i; - for (i = 0; include_directories[i] != 0; ++i) - { - char *name = concat (include_directories[i], "/", filename); - infile = fopen (name, "r"); - if (infile == 0) - free (name); - else - { - filename = name; - break; - } - } - } - - /* Add FILENAME to the chain of read makefiles. */ - deps = (struct dep *) xmalloc (sizeof (struct dep)); - deps->next = read_makefiles; - read_makefiles = deps; - deps->name = 0; - deps->file = lookup_file (filename); - if (deps->file == 0) - { - deps->file = enter_file (savestring (filename, strlen (filename))); - if (flags & RM_DONTCARE) - deps->file->dontcare = 1; - } - if (filename != passed_filename) - free (filename); - filename = deps->file->name; - deps->changed = flags; - deps = 0; - - /* If the makefile can't be found at all, give up entirely. */ - - if (infile == 0) - { - /* If we did some searching, errno has the error from the last - attempt, rather from FILENAME itself. Restore it in case the - caller wants to use it in a message. */ - errno = makefile_errno; - return 0; - } - - reading_filename = filename; - reading_lineno_ptr = &lineno; - - /* Loop over lines in the file. - The strategy is to accumulate target names in FILENAMES, dependencies - in DEPS and commands in COMMANDS. These are used to define a rule - when the start of the next rule (or eof) is encountered. */ - - initbuffer (&lb); - - while (!feof (infile)) - { - lineno += nlines; - nlines = readline (&lb, infile, filename, lineno); - - /* Check for a shell command line first. - If it is not one, we can stop treating tab specially. */ - if (lb.buffer[0] == '\t') - { - /* This line is a probably shell command. */ - unsigned int len; - - if (no_targets) - /* Ignore the commands in a rule with no targets. */ - continue; - - /* If there is no preceding rule line, don't treat this line - as a command, even though it begins with a tab character. - SunOS 4 make appears to behave this way. */ - - if (filenames != 0) - { - if (ignoring) - /* Yep, this is a shell command, and we don't care. */ - continue; - - /* Append this command line to the line being accumulated. */ - p = lb.buffer; - if (commands_idx == 0) - commands_started = lineno; - len = strlen (p); - if (len + 1 + commands_idx > commands_len) - { - commands_len = (len + 1 + commands_idx) * 2; - commands = (char *) xrealloc (commands, commands_len); - } - bcopy (p, &commands[commands_idx], len); - commands_idx += len; - commands[commands_idx++] = '\n'; - - continue; - } - } - - /* This line is not a shell command line. Don't worry about tabs. */ - - if (collapsed_length < lb.size) - { - collapsed_length = lb.size; - if (collapsed != 0) - free (collapsed); - collapsed = (char *) xmalloc (collapsed_length); - } - strcpy (collapsed, lb.buffer); - /* Collapse continuation lines. */ - collapse_continuations (collapsed); - remove_comments (collapsed); - - /* strncmp is first to avoid dereferencing out into space. */ -#define word1eq(s, l) (!strncmp (s, p, l) \ - && (p[l] == '\0' || isblank (p[l]))) - p = collapsed; - while (isspace (*p)) - ++p; - if (*p == '\0') - /* This line is completely empty. */ - continue; - - /* We must first check for conditional and `define' directives before - ignoring anything, since they control what we will do with - following lines. */ - - if (!in_ignored_define - && (word1eq ("ifdef", 5) || word1eq ("ifndef", 6) - || word1eq ("ifeq", 4) || word1eq ("ifneq", 5) - || word1eq ("else", 4) || word1eq ("endif", 5))) - { - int i = conditional_line (p, filename, lineno); - if (i >= 0) - ignoring = i; - else - makefile_fatal (filename, lineno, - "invalid syntax in conditional"); - continue; - } - else if (word1eq ("endef", 5)) - { - if (in_ignored_define) - in_ignored_define = 0; - else - makefile_fatal (filename, lineno, "extraneous `endef'"); - continue; - } - else if (word1eq ("define", 6)) - { - if (ignoring) - in_ignored_define = 1; - else - { - p2 = next_token (p + 6); - /* Let the variable name be the whole rest of the line, - with trailing blanks stripped (comments have already been - removed), so it could be a complex variable/function - reference that might contain blanks. */ - p = index (p2, '\0'); - while (isblank (p[-1])) - --p; - lineno = do_define (p2, p - p2, o_file, - lineno, infile, filename); - } - continue; - } - else if (word1eq ("override", 8)) - { - p2 = next_token (p + 8); - if (p2 == 0) - makefile_error (filename, lineno, "empty `override' directive"); - if (!strncmp (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0')) - { - if (ignoring) - in_ignored_define = 1; - else - { - p2 = next_token (p2 + 6); - /* Let the variable name be the whole rest of the line, - with trailing blanks stripped (comments have already been - removed), so it could be a complex variable/function - reference that might contain blanks. */ - p = index (p2, '\0'); - while (isblank (p[-1])) - --p; - lineno = do_define (p2, p - p2, o_override, - lineno, infile, filename); - } - } - else if (!ignoring - && !try_variable_definition (filename, lineno, - p2, o_override)) - makefile_error (filename, lineno, "empty `override' directive"); - - continue; - } - - if (ignoring) - /* Ignore the line. We continue here so conditionals - can appear in the middle of a rule. */ - continue; - else if (word1eq ("export", 6)) - { - struct variable *v; - p2 = next_token (p + 6); - if (*p2 == '\0') - export_all_variables = 1; - v = try_variable_definition (filename, lineno, p2, o_file); - if (v != 0) - v->export = v_export; - else - { - unsigned int len; - for (p = find_next_token (&p2, &len); p != 0; - p = find_next_token (&p2, &len)) - { - v = lookup_variable (p, len); - if (v == 0) - v = define_variable (p, len, "", o_file, 0); - v->export = v_export; - } - } - } - else if (word1eq ("unexport", 8)) - { - unsigned int len; - struct variable *v; - p2 = next_token (p + 8); - if (*p2 == '\0') - export_all_variables = 0; - for (p = find_next_token (&p2, &len); p != 0; - p = find_next_token (&p2, &len)) - { - v = lookup_variable (p, len); - if (v == 0) - v = define_variable (p, len, "", o_file, 0); - v->export = v_noexport; - } - } - else if (word1eq ("include", 7) || word1eq ("-include", 8)) - { - /* We have found an `include' line specifying a nested - makefile to be read at this point. */ - struct conditionals *save, new_conditionals; - struct nameseq *files; - /* "-include" (vs "include") says no - error if the file does not exist. */ - int noerror = p[0] == '-'; - - p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8))); - if (*p == '\0') - { - makefile_error (filename, lineno, - "no file name for `%sinclude'", - noerror ? "-" : ""); - continue; - } - - /* Parse the list of file names. */ - p2 = p; - files = multi_glob (parse_file_seq (&p2, '\0', - sizeof (struct nameseq), - 1), - sizeof (struct nameseq)); - free (p); - - /* Save the state of conditionals and start - the included makefile with a clean slate. */ - save = conditionals; - bzero ((char *) &new_conditionals, sizeof new_conditionals); - conditionals = &new_conditionals; - - /* Record the rules that are waiting so they will determine - the default goal before those in the included makefile. */ - record_waiting_files (); - - /* Read each included makefile. */ - while (files != 0) - { - struct nameseq *next = files->next; - char *name = files->name; - free (files); - files = next; - - if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE - | (noerror ? RM_DONTCARE : 0))) - && ! noerror) - makefile_error (filename, lineno, - "%s: %s", name, strerror (errno)); - } - - /* Free any space allocated by conditional_line. */ - if (conditionals->ignoring) - free (conditionals->ignoring); - if (conditionals->seen_else) - free (conditionals->seen_else); - - /* Restore state. */ - conditionals = save; - reading_filename = filename; - reading_lineno_ptr = &lineno; - } - else if (word1eq ("vpath", 5)) - { - char *pattern; - unsigned int len; - p2 = variable_expand (p + 5); - p = find_next_token (&p2, &len); - if (p != 0) - { - pattern = savestring (p, len); - p = find_next_token (&p2, &len); - /* No searchpath means remove all previous - selective VPATH's with the same pattern. */ - } - else - /* No pattern means remove all previous selective VPATH's. */ - pattern = 0; - construct_vpath_list (pattern, p); - if (pattern != 0) - free (pattern); - } -#undef word1eq - else if (try_variable_definition (filename, lineno, p, o_file)) - /* This line has been dealt with. */ - ; - else if (lb.buffer[0] == '\t') - { - p = collapsed; /* Ignore comments. */ - while (isblank (*p)) - ++p; - if (*p == '\0') - /* The line is completely blank; that is harmless. */ - continue; - /* This line starts with a tab but was not caught above - because there was no preceding target, and the line - might have been usable as a variable definition. - But now it is definitely lossage. */ - makefile_fatal (filename, lineno, - "commands commence before first target"); - } - else - { - /* This line describes some target files. */ - - char *cmdleft; - - /* Record the previous rule. */ - - record_waiting_files (); - - /* Look for a semicolon in the unexpanded line. */ - cmdleft = find_semicolon (lb.buffer); - if (cmdleft != 0) - /* Found one. Cut the line short there before expanding it. */ - *cmdleft = '\0'; - - collapse_continuations (lb.buffer); - - /* Expand variable and function references before doing anything - else so that special characters can be inside variables. */ - p = variable_expand (lb.buffer); - - if (cmdleft == 0) - /* Look for a semicolon in the expanded line. */ - cmdleft = find_semicolon (p); - - if (cmdleft != 0) - /* Cut the line short at the semicolon. */ - *cmdleft = '\0'; - - /* Remove comments from the line. */ - remove_comments (p); - - p2 = next_token (p); - if (*p2 == '\0') - { - if (cmdleft != 0) - makefile_fatal (filename, lineno, - "missing rule before commands"); - else - /* This line contained a variable reference that - expanded to nothing but whitespace. */ - continue; - } - else if (*p2 == ':') - { - /* We accept and ignore rules without targets for - compatibility with SunOS 4 make. */ - no_targets = 1; - continue; - } - - filenames = multi_glob (parse_file_seq (&p2, ':', - sizeof (struct nameseq), - 1), - sizeof (struct nameseq)); - if (*p2++ == '\0') - makefile_fatal (filename, lineno, "missing separator"); - /* Is this a one-colon or two-colon entry? */ - two_colon = *p2 == ':'; - if (two_colon) - p2++; - - /* We have some targets, so don't ignore the following commands. */ - no_targets = 0; - - /* Is this a static pattern rule: `target: %targ: %dep; ...'? */ - p = index (p2, ':'); - while (p != 0 && p[-1] == '\\') - { - register char *q = &p[-1]; - register int backslash = 0; - while (*q-- == '\\') - backslash = !backslash; - if (backslash) - p = index (p + 1, ':'); - else - break; - } -#if defined(__MSDOS__) || defined(NETSCAPE) - /* For MS-DOS, skip a "C:\...". */ - if (p != 0 && p[1] == '\\' && isalpha (p[-1])) - p = 0; -#endif - if (p != 0) - { - struct nameseq *target; - target = parse_file_seq (&p2, ':', sizeof (struct nameseq), 1); - ++p2; - if (target == 0) - makefile_fatal (filename, lineno, "missing target pattern"); - else if (target->next != 0) - makefile_fatal (filename, lineno, "multiple target patterns"); - pattern = target->name; - pattern_percent = find_percent (pattern); - if (pattern_percent == 0) - makefile_fatal (filename, lineno, - "target pattern contains no `%%'"); - } - else - pattern = 0; - - /* Parse the dependencies. */ - deps = (struct dep *) - multi_glob (parse_file_seq (&p2, '\0', sizeof (struct dep), 1), - sizeof (struct dep)); - - commands_idx = 0; - if (cmdleft != 0) - { - /* Semicolon means rest of line is a command. */ - unsigned int len = strlen (cmdleft + 1); - - commands_started = lineno; - - /* Add this command line to the buffer. */ - if (len + 2 > commands_len) - { - commands_len = (len + 2) * 2; - commands = (char *) xrealloc (commands, commands_len); - } - bcopy (cmdleft + 1, commands, len); - commands_idx += len; - commands[commands_idx++] = '\n'; - } - - continue; - } - - /* We get here except in the case that we just read a rule line. - Record now the last rule we read, so following spurious - commands are properly diagnosed. */ - record_waiting_files (); - no_targets = 0; - } - - if (conditionals->if_cmds) - makefile_fatal (filename, lineno, "missing `endif'"); - - /* At eof, record the last rule. */ - record_waiting_files (); - - freebuffer (&lb); - free ((char *) commands); - fclose (infile); - - reading_filename = 0; - reading_lineno_ptr = 0; - - return 1; -} - -/* Execute a `define' directive. - The first line has already been read, and NAME is the name of - the variable to be defined. The following lines remain to be read. - LINENO, INFILE and FILENAME refer to the makefile being read. - The value returned is LINENO, updated for lines read here. */ - -static unsigned int -do_define (name, namelen, origin, lineno, infile, filename) - char *name; - unsigned int namelen; - enum variable_origin origin; - unsigned int lineno; - FILE *infile; - char *filename; -{ - struct linebuffer lb; - unsigned int nlines = 0; - unsigned int length = 100; - char *definition = (char *) xmalloc (100); - register unsigned int idx = 0; - register char *p; - - /* Expand the variable name. */ - char *var = (char *) alloca (namelen + 1); - bcopy (name, var, namelen); - var[namelen] = '\0'; - var = variable_expand (var); - - initbuffer (&lb); - while (!feof (infile)) - { - lineno += nlines; - nlines = readline (&lb, infile, filename, lineno); - - collapse_continuations (lb.buffer); - - p = next_token (lb.buffer); - if ((p[5] == '\0' || isblank (p[5])) && !strncmp (p, "endef", 5)) - { - p += 5; - remove_comments (p); - if (*next_token (p) != '\0') - makefile_error (filename, lineno, - "Extraneous text after `endef' directive"); - /* Define the variable. */ - if (idx == 0) - definition[0] = '\0'; - else - definition[idx - 1] = '\0'; - (void) define_variable (var, strlen (var), definition, origin, 1); - free (definition); - freebuffer (&lb); - return lineno; - } - else - { - unsigned int len = strlen (lb.buffer); - - /* Increase the buffer size if necessary. */ - if (idx + len + 1 > length) - { - length = (idx + len) * 2; - definition = (char *) xrealloc (definition, length + 1); - } - - bcopy (lb.buffer, &definition[idx], len); - idx += len; - /* Separate lines with a newline. */ - definition[idx++] = '\n'; - } - } - - /* No `endef'!! */ - makefile_fatal (filename, lineno, "missing `endef', unterminated `define'"); - - /* NOTREACHED */ - return 0; -} - -/* Interpret conditional commands "ifdef", "ifndef", "ifeq", - "ifneq", "else" and "endif". - LINE is the input line, with the command as its first word. - - FILENAME and LINENO are the filename and line number in the - current makefile. They are used for error messages. - - Value is -1 if the line is invalid, - 0 if following text should be interpreted, - 1 if following text should be ignored. */ - -static int -conditional_line (line, filename, lineno) - char *line; - char *filename; - unsigned int lineno; -{ - int notdef; - char *cmdname; - register unsigned int i; - - if (*line == 'i') - { - /* It's an "if..." command. */ - notdef = line[2] == 'n'; - if (notdef) - { - cmdname = line[3] == 'd' ? "ifndef" : "ifneq"; - line += cmdname[3] == 'd' ? 7 : 6; - } - else - { - cmdname = line[2] == 'd' ? "ifdef" : "ifeq"; - line += cmdname[2] == 'd' ? 6 : 5; - } - } - else - { - /* It's an "else" or "endif" command. */ - notdef = line[1] == 'n'; - cmdname = notdef ? "endif" : "else"; - line += notdef ? 5 : 4; - } - - line = next_token (line); - - if (*cmdname == 'e') - { - if (*line != '\0') - makefile_error (filename, lineno, - "Extraneous text after `%s' directive", - cmdname); - /* "Else" or "endif". */ - if (conditionals->if_cmds == 0) - makefile_fatal (filename, lineno, "extraneous `%s'", cmdname); - /* NOTDEF indicates an `endif' command. */ - if (notdef) - --conditionals->if_cmds; - else if (conditionals->seen_else[conditionals->if_cmds - 1]) - makefile_fatal (filename, lineno, "only one `else' per conditional"); - else - { - /* Toggle the state of ignorance. */ - conditionals->ignoring[conditionals->if_cmds - 1] - = !conditionals->ignoring[conditionals->if_cmds - 1]; - /* Record that we have seen an `else' in this conditional. - A second `else' will be erroneous. */ - conditionals->seen_else[conditionals->if_cmds - 1] = 1; - } - for (i = 0; i < conditionals->if_cmds; ++i) - if (conditionals->ignoring[i]) - return 1; - return 0; - } - - if (conditionals->allocated == 0) - { - conditionals->allocated = 5; - conditionals->ignoring = (char *) xmalloc (conditionals->allocated); - conditionals->seen_else = (char *) xmalloc (conditionals->allocated); - } - - ++conditionals->if_cmds; - if (conditionals->if_cmds > conditionals->allocated) - { - conditionals->allocated += 5; - conditionals->ignoring = (char *) - xrealloc (conditionals->ignoring, conditionals->allocated); - conditionals->seen_else = (char *) - xrealloc (conditionals->seen_else, conditionals->allocated); - } - - /* Record that we have seen an `if...' but no `else' so far. */ - conditionals->seen_else[conditionals->if_cmds - 1] = 0; - - /* Search through the stack to see if we're already ignoring. */ - for (i = 0; i < conditionals->if_cmds - 1; ++i) - if (conditionals->ignoring[i]) - { - /* We are already ignoring, so just push a level - to match the next "else" or "endif", and keep ignoring. - We don't want to expand variables in the condition. */ - conditionals->ignoring[conditionals->if_cmds - 1] = 1; - return 1; - } - - if (cmdname[notdef ? 3 : 2] == 'd') - { - /* "Ifdef" or "ifndef". */ - struct variable *v; - register char *p = end_of_token (line); - i = p - line; - p = next_token (p); - if (*p != '\0') - return -1; - v = lookup_variable (line, i); - conditionals->ignoring[conditionals->if_cmds - 1] - = (v != 0 && *v->value != '\0') == notdef; - } - else - { - /* "Ifeq" or "ifneq". */ - char *s1, *s2; - unsigned int len; - char termin = *line == '(' ? ',' : *line; - - if (termin != ',' && termin != '"' && termin != '\'') - return -1; - - s1 = ++line; - /* Find the end of the first string. */ - if (termin == ',') - { - register int count = 0; - for (; *line != '\0'; ++line) - if (*line == '(') - ++count; - else if (*line == ')') - --count; - else if (*line == ',' && count <= 0) - break; - } - else - while (*line != '\0' && *line != termin) - ++line; - - if (*line == '\0') - return -1; - - *line++ = '\0'; - - s2 = variable_expand (s1); - /* We must allocate a new copy of the expanded string because - variable_expand re-uses the same buffer. */ - len = strlen (s2); - s1 = (char *) alloca (len + 1); - bcopy (s2, s1, len + 1); - - if (termin != ',') - /* Find the start of the second string. */ - line = next_token (line); - - termin = termin == ',' ? ')' : *line; - if (termin != ')' && termin != '"' && termin != '\'') - return -1; - - /* Find the end of the second string. */ - if (termin == ')') - { - register int count = 0; - s2 = next_token (line); - for (line = s2; *line != '\0'; ++line) - { - if (*line == '(') - ++count; - else if (*line == ')') - if (count <= 0) - break; - else - --count; - } - } - else - { - ++line; - s2 = line; - while (*line != '\0' && *line != termin) - ++line; - } - - if (*line == '\0') - return -1; - - *line = '\0'; - line = next_token (++line); - if (*line != '\0') - makefile_error (filename, lineno, - "Extraneous text after `%s' directive", - cmdname); - - s2 = variable_expand (s2); - conditionals->ignoring[conditionals->if_cmds - 1] - = streq (s1, s2) == notdef; - } - - /* Search through the stack to see if we're ignoring. */ - for (i = 0; i < conditionals->if_cmds; ++i) - if (conditionals->ignoring[i]) - return 1; - return 0; -} - -/* Remove duplicate dependencies in CHAIN. */ - -void -uniquize_deps (chain) - struct dep *chain; -{ - register struct dep *d; - - /* Make sure that no dependencies are repeated. This does not - really matter for the purpose of updating targets, but it - might make some names be listed twice for $^ and $?. */ - - for (d = chain; d != 0; d = d->next) - { - struct dep *last, *next; - - last = d; - next = d->next; - while (next != 0) - if (streq (dep_name (d), dep_name (next))) - { - struct dep *n = next->next; - last->next = n; - if (next->name != 0 && next->name != d->name) - free (next->name); - if (next != d) - free ((char *) next); - next = n; - } - else - { - last = next; - next = next->next; - } - } -} - -/* Record a description line for files FILENAMES, - with dependencies DEPS, commands to execute described - by COMMANDS and COMMANDS_IDX, coming from FILENAME:COMMANDS_STARTED. - TWO_COLON is nonzero if a double colon was used. - If not nil, PATTERN is the `%' pattern to make this - a static pattern rule, and PATTERN_PERCENT is a pointer - to the `%' within it. - - The links of FILENAMES are freed, and so are any names in it - that are not incorporated into other data structures. */ - -static void -record_files (filenames, pattern, pattern_percent, deps, commands_started, - commands, commands_idx, two_colon, filename, lineno, set_default) - struct nameseq *filenames; - char *pattern, *pattern_percent; - struct dep *deps; - unsigned int commands_started; - char *commands; - unsigned int commands_idx; - int two_colon; - char *filename; - unsigned int lineno; - int set_default; -{ - struct nameseq *nextf; - int implicit = 0; - unsigned int max_targets, target_idx; - char **targets = 0, **target_percents = 0; - struct commands *cmds; - - if (commands_idx > 0) - { - cmds = (struct commands *) xmalloc (sizeof (struct commands)); - cmds->filename = filename; - cmds->lineno = commands_started; - cmds->commands = savestring (commands, commands_idx); - cmds->command_lines = 0; - } - else - cmds = 0; - - for (; filenames != 0; filenames = nextf) - { - register char *name = filenames->name; - register struct file *f; - register struct dep *d; - struct dep *this; - char *implicit_percent; - - nextf = filenames->next; - free ((char *) filenames); - - implicit_percent = find_percent (name); - implicit |= implicit_percent != 0; - - if (implicit && pattern != 0) - makefile_fatal (filename, lineno, - "mixed implicit and static pattern rules"); - - if (implicit && implicit_percent == 0) - makefile_fatal (filename, lineno, "mixed implicit and normal rules"); - - if (implicit) - { - if (targets == 0) - { - max_targets = 5; - targets = (char **) xmalloc (5 * sizeof (char *)); - target_percents = (char **) xmalloc (5 * sizeof (char *)); - target_idx = 0; - } - else if (target_idx == max_targets - 1) - { - max_targets += 5; - targets = (char **) xrealloc ((char *) targets, - max_targets * sizeof (char *)); - target_percents - = (char **) xrealloc ((char *) target_percents, - max_targets * sizeof (char *)); - } - targets[target_idx] = name; - target_percents[target_idx] = implicit_percent; - ++target_idx; - continue; - } - - /* If there are multiple filenames, copy the chain DEPS - for all but the last one. It is not safe for the same deps - to go in more than one place in the data base. */ - this = nextf != 0 ? copy_dep_chain (deps) : deps; - - if (pattern != 0) - /* If this is an extended static rule: - `targets: target%pattern: dep%pattern; cmds', - translate each dependency pattern into a plain filename - using the target pattern and this target's name. */ - if (!pattern_matches (pattern, pattern_percent, name)) - { - /* Give a warning if the rule is meaningless. */ - makefile_error (filename, lineno, - "target `%s' doesn't match the target pattern", - name); - this = 0; - } - else - { - /* We use patsubst_expand to do the work of translating - the target pattern, the target's name and the dependencies' - patterns into plain dependency names. */ - char *buffer = variable_expand (""); - - for (d = this; d != 0; d = d->next) - { - char *o; - char *percent = find_percent (d->name); - if (percent == 0) - continue; - o = patsubst_expand (buffer, name, pattern, d->name, - pattern_percent, percent); - free (d->name); - d->name = savestring (buffer, o - buffer); - } - } - - if (!two_colon) - { - /* Single-colon. Combine these dependencies - with others in file's existing record, if any. */ - f = enter_file (name); - - if (f->double_colon) - makefile_fatal (filename, lineno, - "target file `%s' has both : and :: entries", - f->name); - - /* If CMDS == F->CMDS, this target was listed in this rule - more than once. Just give a warning since this is harmless. */ - if (cmds != 0 && cmds == f->cmds) - makefile_error - (filename, lineno, - "target `%s' given more than once in the same rule.", - f->name); - - /* Check for two single-colon entries both with commands. - Check is_target so that we don't lose on files such as .c.o - whose commands were preinitialized. */ - else if (cmds != 0 && f->cmds != 0 && f->is_target) - { - makefile_error (cmds->filename, cmds->lineno, - "warning: overriding commands for target `%s'", - f->name); - makefile_error (f->cmds->filename, f->cmds->lineno, - "warning: ignoring old commands for target `%s'", - f->name); - } - - f->is_target = 1; - - /* Defining .DEFAULT with no deps or cmds clears it. */ - if (f == default_file && this == 0 && cmds == 0) - f->cmds = 0; - if (cmds != 0) - f->cmds = cmds; - /* Defining .SUFFIXES with no dependencies - clears out the list of suffixes. */ - if (f == suffix_file && this == 0) - { - d = f->deps; - while (d != 0) - { - struct dep *nextd = d->next; - free (d->name); - free (d); - d = nextd; - } - f->deps = 0; - } - else if (f->deps != 0) - { - /* Add the file's old deps and the new ones in THIS together. */ - - struct dep *firstdeps, *moredeps; - if (cmds != 0) - { - /* This is the rule with commands, so put its deps first. - The rationale behind this is that $< expands to the - first dep in the chain, and commands use $< expecting - to get the dep that rule specifies. */ - firstdeps = this; - moredeps = f->deps; - } - else - { - /* Append the new deps to the old ones. */ - firstdeps = f->deps; - moredeps = this; - } - - if (firstdeps == 0) - firstdeps = moredeps; - else - { - d = firstdeps; - while (d->next != 0) - d = d->next; - d->next = moredeps; - } - - f->deps = firstdeps; - } - else - f->deps = this; - - /* If this is a static pattern rule, set the file's stem to - the part of its name that matched the `%' in the pattern, - so you can use $* in the commands. */ - if (pattern != 0) - { - static char *percent = "%"; - char *buffer = variable_expand (""); - char *o = patsubst_expand (buffer, name, pattern, percent, - pattern_percent, percent); - f->stem = savestring (buffer, o - buffer); - } - } - else - { - /* Double-colon. Make a new record - even if the file already has one. */ - f = lookup_file (name); - /* Check for both : and :: rules. Check is_target so - we don't lose on default suffix rules or makefiles. */ - if (f != 0 && f->is_target && !f->double_colon) - makefile_fatal (filename, lineno, - "target file `%s' has both : and :: entries", - f->name); - f = enter_file (name); - /* If there was an existing entry and it was a double-colon - entry, enter_file will have returned a new one, making it the - prev pointer of the old one, and setting its double_colon - pointer to the first one. */ - if (f->double_colon == 0) - /* This is the first entry for this name, so we must - set its double_colon pointer to itself. */ - f->double_colon = f; - f->is_target = 1; - f->deps = this; - f->cmds = cmds; - } - - /* Free name if not needed further. */ - if (f != 0 && name != f->name - && (name < f->name || name > f->name + strlen (f->name))) - { - free (name); - name = f->name; - } - - /* See if this is first target seen whose name does - not start with a `.', unless it contains a slash. */ - if (default_goal_file == 0 && set_default - && (*name != '.' || index (name, '/') != 0)) - { - int reject = 0; - - /* If this file is a suffix, don't - let it be the default goal file. */ - - for (d = suffix_file->deps; d != 0; d = d->next) - { - register struct dep *d2; - if (*dep_name (d) != '.' && streq (name, dep_name (d))) - { - reject = 1; - break; - } - for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next) - { - register unsigned int len = strlen (dep_name (d2)); - if (strncmp (name, dep_name (d2), len)) - continue; - if (streq (name + len, dep_name (d))) - { - reject = 1; - break; - } - } - if (reject) - break; - } - - if (!reject) - default_goal_file = f; - } - } - - if (implicit) - { - targets[target_idx] = 0; - target_percents[target_idx] = 0; - create_pattern_rule (targets, target_percents, two_colon, deps, cmds, 1); - free ((char *) target_percents); - } -} - -/* Search STRING for an unquoted STOPCHAR or blank (if BLANK is nonzero). - Backslashes quote STOPCHAR, blanks if BLANK is nonzero, and backslash. - Quoting backslashes are removed from STRING by compacting it into - itself. Returns a pointer to the first unquoted STOPCHAR if there is - one, or nil if there are none. */ - -char * -find_char_unquote (string, stopchars, blank) - char *string; - char *stopchars; - int blank; -{ - unsigned int string_len = strlen (string); - register char *p = string; - - while (1) - { - while (*p != '\0' && index (stopchars, *p) == 0 - && (!blank || !isblank (*p))) - ++p; - if (*p == '\0') - break; - - if (p > string && p[-1] == '\\') - { - /* Search for more backslashes. */ - register int i = -2; - while (&p[i] >= string && p[i] == '\\') - --i; - ++i; - /* The number of backslashes is now -I. - Copy P over itself to swallow half of them. */ - bcopy (&p[i / 2], &p[i], (string_len - (p - string)) - (i / 2) + 1); - p += i / 2; - if (i % 2 == 0) - /* All the backslashes quoted each other; the STOPCHAR was - unquoted. */ - return p; - - /* The STOPCHAR was quoted by a backslash. Look for another. */ - } - else - /* No backslash in sight. */ - return p; - } - - /* Never hit a STOPCHAR or blank (with BLANK nonzero). */ - return 0; -} - -/* Search PATTERN for an unquoted %. */ - -char * -find_percent (pattern) - char *pattern; -{ - return find_char_unquote (pattern, "%", 0); -} - -/* Search STRING for an unquoted ; that is not after an unquoted #. */ - -static char * -find_semicolon (string) - char *string; -{ - char *match = find_char_unquote (string, ";#", 0); - if (match != 0 && *match == '#') - /* We found a comment before a semicolon. No match. */ - match = 0; - return match; -} - -/* Parse a string into a sequence of filenames represented as a - chain of struct nameseq's in reverse order and return that chain. - - The string is passed as STRINGP, the address of a string pointer. - The string pointer is updated to point at the first character - not parsed, which either is a null char or equals STOPCHAR. - - SIZE is how big to construct chain elements. - This is useful if we want them actually to be other structures - that have room for additional info. - - If STRIP is nonzero, strip `./'s off the beginning. */ - -struct nameseq * -parse_file_seq (stringp, stopchar, size, strip) - char **stringp; - char stopchar; - unsigned int size; - int strip; -{ - register struct nameseq *new = 0; - register struct nameseq *new1; -#ifndef NO_ARCHIVES - register struct nameseq *lastnew1; -#endif - register char *p = *stringp; - char *q; - char *name; - char stopchars[2]; - stopchars[0] = stopchar; - stopchars[1] = '\0'; - - while (1) - { - /* Skip whitespace; see if any more names are left. */ - p = next_token (p); - if (*p == '\0') - break; - if (*p == stopchar) - break; - /* Yes, find end of next name. */ - q = p; - p = find_char_unquote (q, stopchars, 1); -#if defined(__MSDOS__) || defined(NETSCAPE) - /* For MS-DOS, skip a "C:\...". */ - if (stopchar == ':' && p != 0 && p[1] == '\\' && isalpha (p[-1])) - p = 0; -#endif - if (p == 0) - p = q + strlen (q); - - if (strip) - /* Skip leading `./'s. */ - while (p - q > 2 && q[0] == '.' && q[1] == '/') - { - q += 2; /* Skip "./". */ - while (q < p && *q == '/') - /* Skip following slashes: ".//foo" is "foo", not "/foo". */ - ++q; - } - - /* Extract the filename just found, and skip it. */ - - if (q == p) - /* ".///" was stripped to "". */ - name = savestring ("./", 2); - else - name = savestring (q, p - q); - - /* Add it to the front of the chain. */ - new1 = (struct nameseq *) xmalloc (size); - new1->name = name; - new1->next = new; - new = new1; - } - -#ifndef NO_ARCHIVES - - /* Look for multi-word archive references. - They are indicated by a elt ending with an unmatched `)' and - an elt further down the chain (i.e., previous in the file list) - with an unmatched `(' (e.g., "lib(mem"). */ - - new1 = new; - lastnew1 = 0; - while (new1 != 0) - if (new1->name[0] != '(' /* Don't catch "(%)" and suchlike. */ - && new1->name[strlen (new1->name) - 1] == ')' - && index (new1->name, '(') == 0) - { - /* NEW1 ends with a `)' but does not contain a `('. - Look back for an elt with an opening `(' but no closing `)'. */ - - struct nameseq *n = new1->next, *lastn = new1; - char *paren; - while (n != 0 && (paren = index (n->name, '(')) == 0) - { - lastn = n; - n = n->next; - } - if (n != 0 - /* Ignore something starting with `(', as that cannot actually - be an archive-member reference (and treating it as such - results in an empty file name, which causes much lossage). */ - && n->name[0] != '(') - { - /* N is the first element in the archive group. - Its name looks like "lib(mem" (with no closing `)'). */ - - char *libname; - - /* Copy "lib(" into LIBNAME. */ - ++paren; - libname = (char *) alloca (paren - n->name + 1); - bcopy (n->name, libname, paren - n->name); - libname[paren - n->name] = '\0'; - - if (*paren == '\0') - { - /* N was just "lib(", part of something like "lib( a b)". - Edit it out of the chain and free its storage. */ - lastn->next = n->next; - free (n->name); - free ((char *) n); - /* LASTN->next is the new stopping elt for the loop below. */ - n = lastn->next; - } - else - { - /* Replace N's name with the full archive reference. */ - name = concat (libname, paren, ")"); - free (n->name); - n->name = name; - } - - if (new1->name[1] == '\0') - { - /* NEW1 is just ")", part of something like "lib(a b )". - Omit it from the chain and free its storage. */ - if (lastnew1 == 0) - new = new1->next; - else - lastnew1->next = new1->next; - lastn = new1; - new1 = new1->next; - free (lastn->name); - free ((char *) lastn); - } - else - { - /* Replace also NEW1->name, which already has closing `)'. */ - name = concat (libname, new1->name, ""); - free (new1->name); - new1->name = name; - new1 = new1->next; - } - - /* Trace back from NEW1 (the end of the list) until N - (the beginning of the list), rewriting each name - with the full archive reference. */ - - while (new1 != n) - { - name = concat (libname, new1->name, ")"); - free (new1->name); - new1->name = name; - lastnew1 = new1; - new1 = new1->next; - } - } - else - { - /* No frobnication happening. Just step down the list. */ - lastnew1 = new1; - new1 = new1->next; - } - } - else - { - lastnew1 = new1; - new1 = new1->next; - } - -#endif - - *stringp = p; - return new; -} - -/* Read a line of text from STREAM into LINEBUFFER. - Combine continuation lines into one line. - Return the number of actual lines read (> 1 if hacked continuation lines). - */ - -static unsigned int -readline (linebuffer, stream, filename, lineno) - struct linebuffer *linebuffer; - FILE *stream; - char *filename; - unsigned int lineno; -{ - char *buffer = linebuffer->buffer; - register char *p = linebuffer->buffer; - register char *end = p + linebuffer->size; - register int len, lastlen = 0; - register char *p2; - register unsigned int nlines = 0; - register int backslash; - - *p = '\0'; - - while (fgets (p, end - p, stream) != 0) - { - len = strlen (p); - if (len == 0) - { - /* This only happens when the first thing on the line is a '\0'. - It is a pretty hopeless case, but (wonder of wonders) Athena - lossage strikes again! (xmkmf puts NULs in its makefiles.) - There is nothing really to be done; we synthesize a newline so - the following line doesn't appear to be part of this line. */ - makefile_error (filename, lineno, - "warning: NUL character seen; rest of line ignored"); - p[0] = '\n'; - len = 1; - } - - p += len; - if (p[-1] != '\n') - { - /* Probably ran out of buffer space. */ - register unsigned int p_off = p - buffer; - linebuffer->size *= 2; - buffer = (char *) xrealloc (buffer, linebuffer->size); - p = buffer + p_off; - end = buffer + linebuffer->size; - linebuffer->buffer = buffer; - *p = '\0'; - lastlen = len; - continue; - } - - ++nlines; - - if (len == 1 && p > buffer) - /* P is pointing at a newline and it's the beginning of - the buffer returned by the last fgets call. However, - it is not necessarily the beginning of a line if P is - pointing past the beginning of the holding buffer. - If the buffer was just enlarged (right before the newline), - we must account for that, so we pretend that the two lines - were one line. */ - len += lastlen; - lastlen = len; - backslash = 0; - for (p2 = p - 2; --len > 0; --p2) - { - if (*p2 == '\\') - backslash = !backslash; - else - break; - } - - if (!backslash) - { - p[-1] = '\0'; - break; - } - - if (end - p <= 1) - { - /* Enlarge the buffer. */ - register unsigned int p_off = p - buffer; - linebuffer->size *= 2; - buffer = (char *) xrealloc (buffer, linebuffer->size); - p = buffer + p_off; - end = buffer + linebuffer->size; - linebuffer->buffer = buffer; - } - } - - if (ferror (stream)) - pfatal_with_name (filename); - - return nlines; -} - -/* Construct the list of include directories - from the arguments and the default list. */ - -void -construct_include_path (arg_dirs) - char **arg_dirs; -{ - register unsigned int i; - struct stat stbuf; - - /* Table to hold the dirs. */ - - register unsigned int defsize = (sizeof (default_include_directories) - / sizeof (default_include_directories[0])); - register unsigned int max = 5; - register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *)); - register unsigned int idx = 0; - - /* First consider any dirs specified with -I switches. - Ignore dirs that don't exist. */ - - if (arg_dirs != 0) - while (*arg_dirs != 0) - { - char *dir = *arg_dirs++; - - if (dir[0] == '~') - { - char *expanded = tilde_expand (dir); - if (expanded != 0) - dir = expanded; - } - - if (safe_stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode)) - { - if (idx == max - 1) - { - max += 5; - dirs = (char **) - xrealloc ((char *) dirs, (max + defsize) * sizeof (char *)); - } - dirs[idx++] = dir; - } - else if (dir != arg_dirs[-1]) - free (dir); - } - - /* Now add at the end the standard default dirs. */ - - for (i = 0; default_include_directories[i] != 0; ++i) - if (safe_stat (default_include_directories[i], &stbuf) == 0 - && S_ISDIR (stbuf.st_mode)) - dirs[idx++] = default_include_directories[i]; - - dirs[idx] = 0; - - /* Now compute the maximum length of any name in it. */ - - max_incl_len = 0; - for (i = 0; i < idx; ++i) - { - unsigned int len = strlen (dirs[i]); - /* If dir name is written with a trailing slash, discard it. */ - if (dirs[i][len - 1] == '/') - /* We can't just clobber a null in because it may have come from - a literal string and literal strings may not be writable. */ - dirs[i] = savestring (dirs[i], len - 1); - if (len > max_incl_len) - max_incl_len = len; - } - - include_directories = dirs; -} - -/* Expand ~ or ~USER at the beginning of NAME. - Return a newly malloc'd string or 0. */ - -char * -tilde_expand (name) - char *name; -{ -#ifndef NETSCAPE - if (name[1] == '/' || name[1] == '\0') - { - extern char *getenv (); - char *home_dir; - int is_variable; - - { - /* Turn off --warn-undefined-variables while we expand HOME. */ - int save = warn_undefined_variables_flag; - warn_undefined_variables_flag = 0; - - home_dir = allocated_variable_expand ("$(HOME)"); - - warn_undefined_variables_flag = save; - } - - is_variable = home_dir[0] != '\0'; - if (!is_variable) - { - free (home_dir); - home_dir = getenv ("HOME"); - } - if (home_dir == 0 || home_dir[0] == '\0') - { - extern char *getlogin (); - char *name = getlogin (); - home_dir = 0; - if (name != 0) - { - struct passwd *p = getpwnam (name); - if (p != 0) - home_dir = p->pw_dir; - } - } - if (home_dir != 0) - { - char *new = concat (home_dir, "", name + 1); - if (is_variable) - free (home_dir); - return new; - } - } - else - { - struct passwd *pwent; - char *userend = index (name + 1, '/'); - if (userend != 0) - *userend = '\0'; - pwent = getpwnam (name + 1); - if (pwent != 0) - { - if (userend == 0) - return savestring (pwent->pw_dir, strlen (pwent->pw_dir)); - else - return concat (pwent->pw_dir, "/", userend + 1); - } - else if (userend != 0) - *userend = '/'; - } -#endif - return 0; -} - -/* Given a chain of struct nameseq's describing a sequence of filenames, - in reverse of the intended order, return a new chain describing the - result of globbing the filenames. The new chain is in forward order. - The links of the old chain are freed or used in the new chain. - Likewise for the names in the old chain. - - SIZE is how big to construct chain elements. - This is useful if we want them actually to be other structures - that have room for additional info. */ - -struct nameseq * -multi_glob (chain, size) - struct nameseq *chain; - unsigned int size; -{ - register struct nameseq *new = 0; - register struct nameseq *old; - struct nameseq *nexto; - - for (old = chain; old != 0; old = nexto) - { - glob_t gl; -#ifndef NO_ARCHIVES - char *memname; -#endif - - nexto = old->next; - - if (old->name[0] == '~') - { - char *newname = tilde_expand (old->name); - if (newname != 0) - { - free (old->name); - old->name = newname; - } - } - -#ifndef NO_ARCHIVES - if (ar_name (old->name)) - { - /* OLD->name is an archive member reference. - Replace it with the archive file name, - and save the member name in MEMNAME. - We will glob on the archive name and then - reattach MEMNAME later. */ - char *arname; - ar_parse_name (old->name, &arname, &memname); - free (old->name); - old->name = arname; - } - else - memname = 0; -#endif - - switch (glob (old->name, GLOB_NOCHECK, NULL, &gl)) - { - case 0: /* Success. */ - { - register int i = gl.gl_pathc; - while (i-- > 0) - { -#ifndef NO_ARCHIVES - if (memname != 0) - { - /* Try to glob on MEMNAME within the archive. */ - struct nameseq *found - = ar_glob (gl.gl_pathv[i], memname, size); - if (found == 0) - { - /* No matches. Use MEMNAME as-is. */ - struct nameseq *elt - = (struct nameseq *) xmalloc (size); - unsigned int alen = strlen (gl.gl_pathv[i]); - unsigned int mlen = strlen (memname); - elt->name = (char *) xmalloc (alen + 1 + mlen + 2); - bcopy (gl.gl_pathv[i], elt->name, alen); - elt->name[alen] = '('; - bcopy (memname, &elt->name[alen + 1], mlen); - elt->name[alen + 1 + mlen] = ')'; - elt->name[alen + 1 + mlen + 1] = '\0'; - elt->next = new; - new = elt; - } - else - { - /* Find the end of the FOUND chain. */ - struct nameseq *f = found; - while (f->next != 0) - f = f->next; - - /* Attach the chain being built to the end of the FOUND - chain, and make FOUND the new NEW chain. */ - f->next = new; - new = found; - } - - free (memname); - } - else -#endif - { - struct nameseq *elt = (struct nameseq *) xmalloc (size); - elt->name = savestring (gl.gl_pathv[i], - strlen (gl.gl_pathv[i])); - elt->next = new; - new = elt; - } - } - globfree (&gl); - free (old->name); - free (old); - break; - } - - case GLOB_NOSPACE: - fatal ("virtual memory exhausted"); - break; - - default: - old->next = new; - new = old; - break; - } - } - - return new; -} diff --git a/buildtools/windows/source/make/remake.c b/buildtools/windows/source/make/remake.c deleted file mode 100644 index c80c5d59fc0..00000000000 --- a/buildtools/windows/source/make/remake.c +++ /dev/null @@ -1,1086 +0,0 @@ -/* Basic dependency engine for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "job.h" -#include "dep.h" -#include "file.h" -#include - -#ifdef HAVE_FCNTL_H -#include -#else -#include -#endif - -#if defined(NETSCAPE) -#include -#endif - -extern int try_implicit_rule (); - - -/* Incremented when a command is started (under -n, when one would be). */ -unsigned int commands_started = 0; - -static int update_file (), update_file_1 (), check_dep (), touch_file (); -static void remake_file (); -static time_t name_mtime (); -static int library_search (); -extern time_t f_mtime (); - -/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing - was done, 0 if all goals were updated successfully, or 1 if a goal failed. - If MAKEFILES is nonzero, these goals are makefiles, so -t, -q, and -n should - be disabled for them unless they were also command-line targets, and we - should only make one goal at a time and return as soon as one goal whose - `changed' member is nonzero is successfully made. */ - -int -update_goal_chain (goals, makefiles) - register struct dep *goals; - int makefiles; -{ - int t = touch_flag, q = question_flag, n = just_print_flag; - unsigned int j = job_slots; - int status = -1; - -#define MTIME(file) (makefiles ? file_mtime_no_search (file) \ - : file_mtime (file)) - - /* Duplicate the chain so we can remove things from it. */ - - goals = copy_dep_chain (goals); - - { - /* Clear the `changed' flag of each goal in the chain. - We will use the flag below to notice when any commands - have actually been run for a target. When no commands - have been run, we give an "up to date" diagnostic. */ - - struct dep *g; - for (g = goals; g != 0; g = g->next) - g->changed = 0; - } - - if (makefiles) - /* Only run one job at a time. */ - job_slots = 1; - - /* Update all the goals until they are all finished. */ - - while (goals != 0) - { - register struct dep *g, *lastgoal; - - /* Start jobs that are waiting for the load to go down. */ - - start_waiting_jobs (); - - /* Wait for a child to die. */ - - reap_children (1, 0); - - lastgoal = 0; - g = goals; - while (g != 0) - { - /* Iterate over all double-colon entries for this file. */ - struct file *file = g->file; - int stop, any_not_updated = 0; - for (file = g->file->double_colon ? g->file->double_colon : g->file; - file != NULL; - file = file->prev) - { - unsigned int ocommands_started; - int x; - time_t mtime = MTIME (file); - check_renamed (file); - - if (makefiles) - { - if (file->cmd_target) - { - touch_flag = t; - question_flag = q; - just_print_flag = n; - } - else - touch_flag = question_flag = just_print_flag = 0; - } - - /* Save the old value of `commands_started' so we can compare - later. It will be incremented when any commands are - actually run. */ - ocommands_started = commands_started; - - x = update_file (file, makefiles ? 1 : 0); - check_renamed (file); - - /* Set the goal's `changed' flag if any commands were started - by calling update_file above. We check this flag below to - decide when to give an "up to date" diagnostic. */ - g->changed += commands_started - ocommands_started; - - stop = 0; - if (x != 0 || file->updated) - { - /* If STATUS was not already 1, set it to 1 if - updating failed, or to 0 if updating succeeded. - Leave STATUS as it is if no updating was done. */ - - if (status < 1) - { - if (file->update_status != 0) - { - /* Updating failed, or -q triggered. - The STATUS value tells our caller which. */ - status = file->update_status; - /* If -q just triggered, stop immediately. - It doesn't matter how much more we run, - since we already know the answer to return. */ - stop = (!keep_going_flag && !question_flag - && !makefiles); - } - else if (MTIME (file) != mtime) - { - /* Updating was done. If this is a makefile and - just_print_flag or question_flag is set - (meaning -n or -q was given and this file was - specified as a command-line target), don't - change STATUS. If STATUS is changed, we will - get re-exec'd, and fall into an infinite loop. */ - if (!makefiles - || (!just_print_flag && !question_flag)) - status = 0; - if (makefiles && file->dontcare) - /* This is a default makefile. Stop remaking. */ - stop = 1; - } - } - } - - /* Keep track if any double-colon entry is not finished. - When they are all finished, the goal is finished. */ - any_not_updated |= !file->updated; - - if (stop) - break; - } - - /* Reset FILE since it is null at the end of the loop. */ - file = g->file; - - if (stop || !any_not_updated) - { - /* If we have found nothing whatever to do for the goal, - print a message saying nothing needs doing. */ - - if (!makefiles - /* If the update_status is zero, we updated successfully - or not at all. G->changed will have been set above if - any commands were actually started for this goal. */ - && file->update_status == 0 && !g->changed - /* Never give a message under -s or -q. */ - && !silent_flag && !question_flag) - { - if (file->phony || file->cmds == 0) - message ("Nothing to be done for `%s'.", - file->name); - else - message ("`%s' is up to date.", file->name); - fflush (stdout); - } - - /* This goal is finished. Remove it from the chain. */ - if (lastgoal == 0) - goals = g->next; - else - lastgoal->next = g->next; - - /* Free the storage. */ - free ((char *) g); - - g = lastgoal == 0 ? goals : lastgoal->next; - - if (stop) - break; - } - else - { - lastgoal = g; - g = g->next; - } - } - } - - if (makefiles) - { - touch_flag = t; - question_flag = q; - just_print_flag = n; - job_slots = j; - } - - return status; -} - -/* If FILE is not up to date, execute the commands for it. - Return 0 if successful, 1 if unsuccessful; - but with some flag settings, just call `exit' if unsuccessful. - - DEPTH is the depth in recursions of this function. - We increment it during the consideration of our dependencies, - then decrement it again after finding out whether this file - is out of date. - - If there are multiple double-colon entries for FILE, - each is considered in turn. */ - -static int -update_file (file, depth) - struct file *file; - unsigned int depth; -{ - register int status = 0; - register struct file *f; - - for (f = file->double_colon ? file->double_colon : file; f != 0; f = f->prev) - { - status |= update_file_1 (f, depth); - check_renamed (f); - - if (status != 0 && !keep_going_flag) - return status; - - switch (f->command_state) - { - case cs_finished: - /* The file is done being remade. */ - break; - - case cs_running: - case cs_deps_running: - /* Don't run the other :: rules for this - file until this rule is finished. */ - return 0; - - default: - assert (f->command_state == cs_running); - break; - } - } - - return status; -} - -/* Consider a single `struct file' and update it as appropriate. */ - -static int -update_file_1 (file, depth) - struct file *file; - unsigned int depth; -{ - register time_t this_mtime; - int noexist, must_make, deps_changed; - int dep_status = 0; - register struct dep *d, *lastd; - int running = 0; - - DEBUGPR ("Considering target file `%s'.\n"); - - if (file->updated) - { - if (file->update_status > 0) - { - DEBUGPR ("Recently tried and failed to update file `%s'.\n"); - return file->update_status; - } - - DEBUGPR ("File `%s' was considered already.\n"); - return 0; - } - - switch (file->command_state) - { - case cs_not_started: - case cs_deps_running: - break; - case cs_running: - DEBUGPR ("Still updating file `%s'.\n"); - return 0; - case cs_finished: - DEBUGPR ("Finished updating file `%s'.\n"); - return file->update_status; - default: - abort (); - } - - ++depth; - - /* Notice recursive update of the same file. */ - file->updating = 1; - - /* Looking at the file's modtime beforehand allows the possibility - that its name may be changed by a VPATH search, and thus it may - not need an implicit rule. If this were not done, the file - might get implicit commands that apply to its initial name, only - to have that name replaced with another found by VPATH search. */ - - this_mtime = file_mtime (file); - check_renamed (file); - noexist = this_mtime == (time_t) -1; - if (noexist) - DEBUGPR ("File `%s' does not exist.\n"); - - must_make = noexist; - - /* If file was specified as a target with no commands, - come up with some default commands. */ - - if (!file->phony && file->cmds == 0 && !file->tried_implicit) - { - if (try_implicit_rule (file, depth)) - DEBUGPR ("Found an implicit rule for `%s'.\n"); - else - DEBUGPR ("No implicit rule found for `%s'.\n"); - file->tried_implicit = 1; - } - if (file->cmds == 0 && !file->is_target - && default_file != 0 && default_file->cmds != 0) - { - DEBUGPR ("Using default commands for `%s'.\n"); - file->cmds = default_file->cmds; - } - - /* Update all non-intermediate files we depend on, if necessary, - and see whether any of them is more recent than this file. */ - - lastd = 0; - d = file->deps; - while (d != 0) - { - time_t mtime; - - check_renamed (d->file); - - mtime = file_mtime (d->file); - check_renamed (d->file); - - if (d->file->updating) - { - error ("Circular %s <- %s dependency dropped.", - file->name, d->file->name); - if (lastd == 0) - { - file->deps = d->next; - free ((char *) d); - d = file->deps; - } - else - { - lastd->next = d->next; - free ((char *) d); - d = lastd->next; - } - continue; - } - - d->file->parent = file; - dep_status |= check_dep (d->file, depth, this_mtime, &must_make); - check_renamed (d->file); - - { - register struct file *f = d->file; - if (f->double_colon) - f = f->double_colon; - do - { - running |= (f->command_state == cs_running - || f->command_state == cs_deps_running); - f = f->prev; - } - while (f != 0); - } - - if (dep_status != 0 && !keep_going_flag) - break; - - if (!running) - d->changed = file_mtime (d->file) != mtime; - - lastd = d; - d = d->next; - } - - /* Now we know whether this target needs updating. - If it does, update all the intermediate files we depend on. */ - - if (must_make) - { - for (d = file->deps; d != 0; d = d->next) - if (d->file->intermediate) - { - time_t mtime = file_mtime (d->file); - check_renamed (d->file); - d->file->parent = file; - dep_status |= update_file (d->file, depth); - check_renamed (d->file); - - { - register struct file *f = d->file; - if (f->double_colon) - f = f->double_colon; - do - { - running |= (f->command_state == cs_running - || f->command_state == cs_deps_running); - f = f->prev; - } - while (f != 0); - } - - if (dep_status != 0 && !keep_going_flag) - break; - - if (!running) - d->changed = ((file->phony && file->cmds != 0) - || file_mtime (d->file) != mtime); - } - } - - file->updating = 0; - - DEBUGPR ("Finished dependencies of target file `%s'.\n"); - - if (running) - { - set_command_state (file, cs_deps_running); - --depth; - DEBUGPR ("The dependencies of `%s' are being made.\n"); - return 0; - } - - /* If any dependency failed, give up now. */ - - if (dep_status != 0) - { - file->update_status = dep_status; - notice_finished_file (file); - - depth--; - - DEBUGPR ("Giving up on target file `%s'.\n"); - - if (depth == 0 && keep_going_flag - && !just_print_flag && !question_flag) - error ("Target `%s' not remade because of errors.", file->name); - - return dep_status; - } - - if (file->command_state == cs_deps_running) - /* The commands for some deps were running on the last iteration, but - they have finished now. Reset the command_state to not_started to - simplify later bookkeeping. It is important that we do this only - when the prior state was cs_deps_running, because that prior state - was definitely propagated to FILE's also_make's by set_command_state - (called above), but in another state an also_make may have - independently changed to finished state, and we would confuse that - file's bookkeeping (updated, but not_started is bogus state). */ - set_command_state (file, cs_not_started); - - /* Now record which dependencies are more - recent than this file, so we can define $?. */ - - deps_changed = 0; - for (d = file->deps; d != 0; d = d->next) - { - time_t d_mtime = file_mtime (d->file); - check_renamed (d->file); - -#if 1 /* %%% In version 4, remove this code completely to - implement not remaking deps if their deps are newer - than their parents. */ - if (d_mtime == (time_t) -1 && !d->file->intermediate) - /* We must remake if this dep does not - exist and is not intermediate. */ - must_make = 1; -#endif - - /* Set DEPS_CHANGED if this dep actually changed. */ - deps_changed |= d->changed; - - /* Set D->changed if either this dep actually changed, - or its dependent, FILE, is older or does not exist. */ - d->changed |= noexist || d_mtime > this_mtime; - - if (debug_flag && !noexist) - { - print_spaces (depth); - if (d_mtime == (time_t) -1) - printf ("Dependency `%s' does not exist.\n", dep_name (d)); - else - printf ("Dependency `%s' is %s than dependent `%s'.\n", - dep_name (d), d->changed ? "newer" : "older", file->name); - fflush (stdout); - } - } - - /* Here depth returns to the value it had when we were called. */ - depth--; - - if (file->double_colon && file->deps == 0) - { - must_make = 1; - DEBUGPR ("Target `%s' is double-colon and has no dependencies.\n"); - } - else if (!noexist && file->is_target && !deps_changed && file->cmds == 0) - { - must_make = 0; - DEBUGPR ("No commands for `%s' and no dependencies actually changed.\n"); - } - - if (!must_make) - { - DEBUGPR ("No need to remake target `%s'.\n"); - notice_finished_file (file); - return 0; - } - - DEBUGPR ("Must remake target `%s'.\n"); - - /* Now, take appropriate actions to remake the file. */ - remake_file (file); - - if (file->command_state != cs_finished) - { - DEBUGPR ("Commands of `%s' are being run.\n"); - return 0; - } - - switch (file->update_status) - { - case 2: - DEBUGPR ("Failed to remake target file `%s'.\n"); - break; - case 0: - DEBUGPR ("Successfully remade target file `%s'.\n"); - break; - case 1: - DEBUGPR ("Target file `%s' needs remade under -q.\n"); - break; - default: - assert (file->update_status >= 0 && file->update_status <= 2); - break; - } - - file->updated = 1; - return file->update_status; -} - -/* Set FILE's `updated' flag and re-check its mtime and the mtime's of all - files listed in its `also_make' member. Under -t, this function also - touches FILE. - - On return, FILE->update_status will no longer be -1 if it was. */ - -void -notice_finished_file (file) - register struct file *file; -{ - struct dep *d; - int ran = file->command_state == cs_running; - - file->command_state = cs_finished; - file->updated = 1; - - if (touch_flag - /* The update status will be: - -1 if this target was not remade; - 0 if 0 or more commands (+ or ${MAKE}) were run and won; - 1 if some commands were run and lost. - We touch the target if it has commands which either were not run - or won when they ran (i.e. status is 0). */ - && file->update_status == 0) - { - if (file->cmds != 0 && file->cmds->any_recurse) - { - /* If all the command lines were recursive, - we don't want to do the touching. */ - unsigned int i; - for (i = 0; i < file->cmds->ncommand_lines; ++i) - if (!(file->cmds->lines_flags[i] & COMMANDS_RECURSE)) - goto have_nonrecursing; - } - else - { - have_nonrecursing: - if (file->phony) - file->update_status = 0; - else - /* Should set file's modification date and do nothing else. */ - file->update_status = touch_file (file); - } - } - - if (ran && !file->phony) - { - struct file *f; - - if (just_print_flag || question_flag - || (file->is_target && file->cmds == 0)) - file->last_mtime = NEW_MTIME; - else - file->last_mtime = 0; - - /* Propagate the change of modification time to all the double-colon - entries for this file. */ - for (f = file->double_colon; f != 0; f = f->next) - f->last_mtime = file->last_mtime; - } - - if (ran && file->update_status != -1) - /* We actually tried to update FILE, which has - updated its also_make's as well (if it worked). - If it didn't work, it wouldn't work again for them. - So mark them as updated with the same status. */ - for (d = file->also_make; d != 0; d = d->next) - { - d->file->command_state = cs_finished; - d->file->updated = 1; - d->file->update_status = file->update_status; - - if (ran && !d->file->phony) - /* Fetch the new modification time. - We do this instead of just invalidating the cached time - so that a vpath_search can happen. Otherwise, it would - never be done because the target is already updated. */ - (void) f_mtime (d->file, 0); - } - else if (file->update_status == -1) - /* Nothing was done for FILE, but it needed nothing done. - So mark it now as "succeeded". */ - file->update_status = 0; -} - -/* Check whether another file (whose mtime is THIS_MTIME) - needs updating on account of a dependency which is file FILE. - If it does, store 1 in *MUST_MAKE_PTR. - In the process, update any non-intermediate files - that FILE depends on (including FILE itself). - Return nonzero if any updating failed. */ - -static int -check_dep (file, depth, this_mtime, must_make_ptr) - struct file *file; - unsigned int depth; - time_t this_mtime; - int *must_make_ptr; -{ - register struct dep *d; - int dep_status = 0; - - ++depth; - file->updating = 1; - - if (!file->intermediate) - /* If this is a non-intermediate file, update it and record - whether it is newer than THIS_MTIME. */ - { - time_t mtime; - dep_status = update_file (file, depth); - check_renamed (file); - mtime = file_mtime (file); - check_renamed (file); - if (mtime == (time_t) -1 || mtime > this_mtime) - *must_make_ptr = 1; - } - else - { - /* FILE is an intermediate file. - Update all non-intermediate files we depend on, if necessary, - and see whether any of them is more recent than the file - on whose behalf we are checking. */ - register struct dep *lastd; - lastd = 0; - d = file->deps; - while (d != 0) - { - if (d->file->updating) - { - error ("Circular %s <- %s dependency dropped.", - file->name, d->file->name); - if (lastd == 0) - { - file->deps = d->next; - free ((char *) d); - d = file->deps; - } - else - { - lastd->next = d->next; - free ((char *) d); - d = lastd->next; - } - continue; - } - - d->file->parent = file; - dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr); - check_renamed (d->file); - if (dep_status != 0 && !keep_going_flag) - break; - - if (d->file->command_state == cs_running - || d->file->command_state == cs_deps_running) - /* Record that some of FILE's dependencies are still being made. - This tells the upper levels to wait on processing it until - the commands are finished. */ - set_command_state (file, cs_deps_running); - - lastd = d; - d = d->next; - } - } - - file->updating = 0; - return dep_status; -} - -/* Touch FILE. Return zero if successful, one if not. */ - -#define TOUCH_ERROR(call) return (perror_with_name (call, file->name), 1) - -static int -touch_file (file) - register struct file *file; -{ - if (!silent_flag) - { - printf ("touch %s\n", file->name); - fflush (stdout); - } - -#ifndef NO_ARCHIVES - if (ar_name (file->name)) - return ar_touch (file->name); - else -#endif - { - int fd = open (file->name, O_RDWR | O_CREAT, 0666); - - if (fd < 0) - TOUCH_ERROR ("touch: open: "); - else - { - struct stat statbuf; - char buf; - int status; - -#ifdef EINTR - do -#endif - status = fstat (fd, &statbuf); -#ifdef EINTR - while (status < 0 && errno == EINTR); -#endif - if (status < 0) - TOUCH_ERROR ("touch: fstat: "); - /* Rewrite character 0 same as it already is. */ - if (read (fd, &buf, 1) < 0) - TOUCH_ERROR ("touch: read: "); - if (lseek (fd, 0L, 0) < 0L) - TOUCH_ERROR ("touch: lseek: "); - if (write (fd, &buf, 1) < 0) - TOUCH_ERROR ("touch: write: "); - /* If file length was 0, we just - changed it, so change it back. */ - if (statbuf.st_size == 0) - { - (void) close (fd); - fd = open (file->name, O_RDWR | O_TRUNC, 0666); - if (fd < 0) - TOUCH_ERROR ("touch: open: "); - } - (void) close (fd); - } - } - - return 0; -} - -/* Having checked and updated the dependencies of FILE, - do whatever is appropriate to remake FILE itself. - Return the status from executing FILE's commands. */ - -static void -remake_file (file) - struct file *file; -{ - if (file->cmds == 0) - { - if (file->phony) - /* Phony target. Pretend it succeeded. */ - file->update_status = 0; - else if (file->is_target) - /* This is a nonexistent target file we cannot make. - Pretend it was successfully remade. */ - file->update_status = 0; - else - { - /* This is a dependency file we cannot remake. Fail. */ - static const char msg_noparent[] - = "%sNo rule to make target `%s'%s"; - static const char msg_parent[] - = "%sNo rule to make target `%s', needed by `%s'%s"; - if (keep_going_flag || file->dontcare) - { - if (!file->dontcare) - { - if (file->parent == 0) - error (msg_noparent, "*** ", file->name, "."); - else - error (msg_parent, "*** ", - file->name, file->parent->name, "."); - } - file->update_status = 2; - } - else - { - if (file->parent == 0) - fatal (msg_noparent, "", file->name, ""); - else - fatal (msg_parent, "", file->name, file->parent->name, ""); - } - } - } - else - { - chop_commands (file->cmds); - - if (!touch_flag || file->cmds->any_recurse) - { - execute_file_commands (file); - return; - } - else - /* This tells notice_finished_file it is ok to touch the file. */ - file->update_status = 0; - } - - /* This does the touching under -t. */ - notice_finished_file (file); -} - -/* Return the mtime of a file, given a `struct file'. - Caches the time in the struct file to avoid excess stat calls. - - If the file is not found, and SEARCH is nonzero, VPATH searching and - replacement is done. If that fails, a library (-lLIBNAME) is tried and - the library's actual name (/lib/libLIBNAME.a, etc.) is substituted into - FILE. */ - -time_t -f_mtime (file, search) - register struct file *file; - int search; -{ - time_t mtime; - - /* File's mtime is not known; must get it from the system. */ - -#ifndef NO_ARCHIVES - if (ar_name (file->name)) - { - /* This file is an archive-member reference. */ - - char *arname, *memname; - struct file *arfile; - int arname_used = 0; - - /* Find the archive's name. */ - ar_parse_name (file->name, &arname, &memname); - - /* Find the modification time of the archive itself. - Also allow for its name to be changed via VPATH search. */ - arfile = lookup_file (arname); - if (arfile == 0) - { - arfile = enter_file (arname); - arname_used = 1; - } - mtime = f_mtime (arfile, search); - check_renamed (arfile); - if (search && strcmp (arfile->name, arname)) - { - /* The archive's name has changed. - Change the archive-member reference accordingly. */ - - unsigned int arlen, memlen; - - if (!arname_used) - { - free (arname); - arname_used = 1; - } - - arname = arfile->name; - arlen = strlen (arname); - memlen = strlen (memname); - - free (file->name); - - file->name = (char *) xmalloc (arlen + 1 + memlen + 2); - bcopy (arname, file->name, arlen); - file->name[arlen] = '('; - bcopy (memname, file->name + arlen + 1, memlen); - file->name[arlen + 1 + memlen] = ')'; - file->name[arlen + 1 + memlen + 1] = '\0'; - } - - if (!arname_used) - free (arname); - free (memname); - - if (mtime == (time_t) -1) - /* The archive doesn't exist, so it's members don't exist either. */ - return (time_t) -1; - - mtime = ar_member_date (file->name); - } - else -#endif - { - mtime = name_mtime (file->name); - - if (mtime == (time_t) -1 && search) - { - /* If name_mtime failed, search VPATH. */ - char *name = file->name; - if (vpath_search (&name, &mtime) - /* Last resort, is it a library (-lxxx)? */ - || (name[0] == '-' && name[1] == 'l' - && library_search (&name, &mtime))) - { - if (mtime != 0) - /* vpath_search and library_search store zero in MTIME - if they didn't need to do a stat call for their work. */ - file->last_mtime = mtime; - rename_file (file, name); - check_renamed (file); - return file_mtime (file); - } - } - } - - /* Store the mtime into all the entries for this file. */ - if (file->double_colon) - file = file->double_colon; - do - { - file->last_mtime = mtime; - file = file->prev; - } while (file != 0); - - return mtime; -} - - -/* Return the mtime of the file or archive-member reference NAME. */ - -static time_t -name_mtime (name) - register char *name; -{ - struct stat st; - - if (safe_stat (name, &st) < 0) - return (time_t) -1; - - return (time_t) st.st_mtime; -} - - -/* Search for a library file specified as -lLIBNAME, searching for a - suitable library file in the system library directories and the VPATH - directories. */ - -static int -library_search (lib, mtime_ptr) - char **lib; - time_t *mtime_ptr; -{ - static char *dirs[] = - { -#ifndef NETSCAPE - "/lib", - "/usr/lib", -#endif - LIBDIR, /* Defined by configuration. */ - 0 - }; - - char *libname = &(*lib)[2]; /* Name without the `-l'. */ - time_t mtime; - - /* Buffer to construct possible names in. */ - char *buf = xmalloc (sizeof (LIBDIR) + 8 + strlen (libname) + 4 + 2 + 1); - char *file, **dp; - - /* Look first for `libNAME.a' in the current directory. */ - - sprintf (buf, "lib%s.a", libname); - mtime = name_mtime (buf); - if (mtime != (time_t) -1) - { - *lib = buf; - if (mtime_ptr != 0) - *mtime_ptr = mtime; - return 1; - } - - /* Now try VPATH search on that. */ - - file = buf; - if (vpath_search (&file, mtime_ptr)) - { - free (buf); - *lib = file; - return 1; - } - - /* Now try the standard set of directories. */ - - for (dp = dirs; *dp != 0; ++dp) - { - sprintf (buf, "%s/lib%s.a", *dp, libname); - mtime = name_mtime (buf); - if (mtime != (time_t) -1) - { - *lib = buf; - if (mtime_ptr != 0) - *mtime_ptr = mtime; - return 1; - } - } - - free (buf); - return 0; -} diff --git a/buildtools/windows/source/make/remote-cstms.c b/buildtools/windows/source/make/remote-cstms.c deleted file mode 100644 index 6aa2c966a25..00000000000 --- a/buildtools/windows/source/make/remote-cstms.c +++ /dev/null @@ -1,270 +0,0 @@ -/* GNU Make remote job exportation interface to the Customs daemon. - THIS CODE IS NOT SUPPORTED BY THE GNU PROJECT. - Please do not send bug reports or questions about it to - the Make maintainers. - -Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "job.h" -#include -#include - -#define __STRICT_BSD__ /* Don't make conflicting declarations. */ -#include "customs.h" - - -char *remote_description = "Customs"; - -/* File name of the Customs `export' client command. - A full path name can be used to avoid some path-searching overhead. */ -#define EXPORT_COMMAND "/usr/local/bin/export" - -/* ExportPermit gotten by start_remote_job_p, and used by start_remote_job. */ -static ExportPermit permit; - -/* Normalized path name of the current directory. */ -static char *normalized_cwd; - -/* Return nonzero if the next job should be done remotely. */ - -int -start_remote_job_p () -{ - static int inited = 0; - int status; - - /* Allow the user to turn off job exportation - (useful while he is debugging Customs, for example). */ - if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0) - return 0; - - if (!inited) - { - /* For secure Customs, make is installed setuid root and - Customs requires a privileged source port be used. */ - make_access (); - - /* Ping the daemon once to see if it is there. */ - inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1; - - /* Return to normal user access. */ - user_access (); - - if (starting_directory == 0) - /* main couldn't figure it out. */ - inited = -1; - else - { - /* Normalize the current directory path name to something - that should work on all machines exported to. */ - - normalized_cwd = (char *) xmalloc (GET_PATH_MAX); - strcpy (normalized_cwd, starting_directory); - if (Customs_NormPath (normalized_cwd, GET_PATH_MAX) < 0) - /* Path normalization failure means using Customs - won't work, but it's not really an error. */ - inited = -1; - } - } - - if (inited < 0) - return 0; - - status = Customs_Host (EXPORT_SAME, &permit); - if (status != RPC_SUCCESS) - { - if (debug_flag) - printf ("Customs won't export: %s\n", Rpc_ErrorMessage (status)); - return 0; - } - - return !CUSTOMS_FAIL (&permit.addr); -} - -/* Start a remote job running the command in ARGV, with environment from - ENVP. It gets standard input from STDIN_FD. On failure, return - nonzero. On success, return zero, and set *USED_STDIN to nonzero if it - will actually use STDIN_FD, zero if not, set *ID_PTR to a unique - identification, and set *IS_REMOTE to nonzero if the job is remote, zero - if it is local (meaning *ID_PTR is a process ID). */ - -int -start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin) - char **argv, **envp; - int stdin_fd; - int *is_remote; - int *id_ptr; - int *used_stdin; -{ - extern int vfork (), execve (); - char waybill[MAX_DATA_SIZE], msg[128]; - struct timeval timeout; - struct sockaddr_in sin; - int len; - int retsock, retport, sock; - Rpc_Stat status; - int pid; - - /* Create the return socket. */ - retsock = Rpc_UdpCreate (True, 0); - if (retsock < 0) - { - error ("exporting: Couldn't create return socket."); - return 1; - } - - /* Get the return socket's port number. */ - len = sizeof (sin); - if (getsockname (retsock, (struct sockaddr *) &sin, &len) < 0) - { - (void) close (retsock); - perror_with_name ("exporting: ", "getsockname"); - return 1; - } - retport = sin.sin_port; - - /* Create the TCP socket for talking to the remote child. */ - sock = Rpc_TcpCreate (False, 0); - - /* Create a WayBill to give to the server. */ - len = Customs_MakeWayBill (&permit, normalized_cwd, argv[0], argv, - envp, retport, waybill); - - /* Modify the waybill as if the remote child had done `child_access ()'. */ - { - WayBill *wb = (WayBill *) waybill; - wb->euid = wb->ruid; - wb->rgid = wb->rgid; - } - - /* Send the request to the server, timing out in 20 seconds. */ - timeout.tv_usec = 0; - timeout.tv_sec = 20; - sin.sin_family = AF_INET; - sin.sin_port = htons (Customs_Port ()); - sin.sin_addr = permit.addr; - status = Rpc_Call (sock, &sin, (Rpc_Proc) CUSTOMS_IMPORT, - len, (Rpc_Opaque) waybill, - sizeof(msg), (Rpc_Opaque) msg, - 1, &timeout); - if (status != RPC_SUCCESS) - { - (void) close (retsock); - (void) close (sock); - error ("exporting: %s", Rpc_ErrorMessage (status)); - return 1; - } - else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0') - { - (void) close (retsock); - (void) close (sock); - error ("CUSTOMS_IMPORT: %s", msg); - return 1; - } - else if (debug_flag) - { - struct hostent *host = gethostbyaddr (&permit.addr, sizeof (permit.addr), - AF_INET); - printf ("Job exported to %s ID %u\n", - host == 0 ? inet_ntoa (permit.addr) : host->h_name, - permit.id); - } - - fflush (stdout); - fflush (stderr); - - pid = vfork (); - if (pid < 0) - { - /* The fork failed! */ - perror_with_name ("vfork", ""); - return 1; - } - else if (pid == 0) - { - /* Child side. Run `export' to handle the connection. */ - static char sock_buf[20], retsock_buf[20], id_buf[20]; - static char *new_argv[6] = - { EXPORT_COMMAND, "-id", sock_buf, retsock_buf, id_buf, 0 }; - - /* Set up the arguments. */ - (void) sprintf (sock_buf, "%d", sock); - (void) sprintf (retsock_buf, "%d", retsock); - (void) sprintf (id_buf, "%x", permit.id); - - /* Get the right stdin. */ - if (stdin_fd != 0) - (void) dup2 (stdin_fd, 0); - - /* Unblock signals in the child. */ - unblock_sigs (); - - /* Run the command. */ - exec_command (new_argv, envp); - } - - /* Parent side. Return the `export' process's ID. */ - (void) close (retsock); - (void) close (sock); - *is_remote = 0; - *id_ptr = pid; - return 0; -} - -/* Get the status of a dead remote child. Block waiting for one to die - if BLOCK is nonzero. Set *EXIT_CODE_PTR to the exit status, *SIGNAL_PTR - to the termination signal or zero if it exited normally, and *COREDUMP_PTR - nonzero if it dumped core. Return the ID of the child that died, - 0 if we would have to block and !BLOCK, or < 0 if there were none. */ - -int -remote_status (exit_code_ptr, signal_ptr, coredump_ptr, block) - int *exit_code_ptr, *signal_ptr, *coredump_ptr; - int block; -{ - return -1; -} - -/* Block asynchronous notification of remote child death. - If this notification is done by raising the child termination - signal, do not block that signal. */ -void -block_remote_children () -{ - return; -} - -/* Restore asynchronous notification of remote child death. - If this is done by raising the child termination signal, - do not unblock that signal. */ -void -unblock_remote_children () -{ - return; -} - -/* Send signal SIG to child ID. Return 0 if successful, -1 if not. */ -int -remote_kill (id, sig) - int id; - int sig; -{ - return -1; -} diff --git a/buildtools/windows/source/make/remote-stub.c b/buildtools/windows/source/make/remote-stub.c deleted file mode 100644 index 24a860b2e27..00000000000 --- a/buildtools/windows/source/make/remote-stub.c +++ /dev/null @@ -1,92 +0,0 @@ -/* Template for the remote job exportation interface to GNU Make. -Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" - - -char *remote_description = 0; - - -/* Return nonzero if the next job should be done remotely. */ - -int -start_remote_job_p () -{ - return 0; -} - -/* Start a remote job running the command in ARGV, - with environment from ENVP. It gets standard input from STDIN_FD. On - failure, return nonzero. On success, return zero, and set *USED_STDIN - to nonzero if it will actually use STDIN_FD, zero if not, set *ID_PTR to - a unique identification, and set *IS_REMOTE to zero if the job is local, - nonzero if it is remote (meaning *ID_PTR is a process ID). */ - -int -start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin) - char **argv, **envp; - int stdin_fd; - int *is_remote; - int *id_ptr; - int *used_stdin; -{ - return -1; -} - -/* Get the status of a dead remote child. Block waiting for one to die - if BLOCK is nonzero. Set *EXIT_CODE_PTR to the exit status, *SIGNAL_PTR - to the termination signal or zero if it exited normally, and *COREDUMP_PTR - nonzero if it dumped core. Return the ID of the child that died, - 0 if we would have to block and !BLOCK, or < 0 if there were none. */ - -int -remote_status (exit_code_ptr, signal_ptr, coredump_ptr, block) - int *exit_code_ptr, *signal_ptr, *coredump_ptr; - int block; -{ - errno = ECHILD; - return -1; -} - -/* Block asynchronous notification of remote child death. - If this notification is done by raising the child termination - signal, do not block that signal. */ -void -block_remote_children () -{ - return; -} - -/* Restore asynchronous notification of remote child death. - If this is done by raising the child termination signal, - do not unblock that signal. */ -void -unblock_remote_children () -{ - return; -} - -/* Send signal SIG to child ID. Return 0 if successful, -1 if not. */ -int -remote_kill (id, sig) - int id; - int sig; -{ - return -1; -} diff --git a/buildtools/windows/source/make/rule.c b/buildtools/windows/source/make/rule.c deleted file mode 100644 index 51103acd9fe..00000000000 --- a/buildtools/windows/source/make/rule.c +++ /dev/null @@ -1,571 +0,0 @@ -/* Pattern and suffix rule internals for GNU Make. -Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "dep.h" -#include "file.h" -#include "variable.h" -#include "rule.h" - -static void freerule (); - -/* Chain of all pattern rules. */ - -struct rule *pattern_rules; - -/* Pointer to last rule in the chain, so we can add onto the end. */ - -struct rule *last_pattern_rule; - -/* Number of rules in the chain. */ - -unsigned int num_pattern_rules; - -/* Maximum number of target patterns of any pattern rule. */ - -unsigned int max_pattern_targets; - -/* Maximum number of dependencies of any pattern rule. */ - -unsigned int max_pattern_deps; - -/* Maximum length of the name of a dependencies of any pattern rule. */ - -unsigned int max_pattern_dep_length; - -/* Pointer to structure for the file .SUFFIXES - whose dependencies are the suffixes to be searched. */ - -struct file *suffix_file; - -/* Maximum length of a suffix. */ - -unsigned int maxsuffix; - -/* Compute the maximum dependency length and maximum number of - dependencies of all implicit rules. Also sets the subdir - flag for a rule when appropriate, possibly removing the rule - completely when appropriate. */ - -void -count_implicit_rule_limits () -{ - char *name; - unsigned int namelen; - register struct rule *rule, *lastrule; - - num_pattern_rules = max_pattern_targets = max_pattern_deps = 0; - max_pattern_dep_length = 0; - - name = 0; - namelen = 0; - rule = pattern_rules; - lastrule = 0; - while (rule != 0) - { - unsigned int ndeps = 0; - register struct dep *dep; - struct rule *next = rule->next; - unsigned int ntargets; - - ++num_pattern_rules; - - ntargets = 0; - while (rule->targets[ntargets] != 0) - ++ntargets; - - if (ntargets > max_pattern_targets) - max_pattern_targets = ntargets; - - for (dep = rule->deps; dep != 0; dep = dep->next) - { - unsigned int len = strlen (dep->name); - char *p = rindex (dep->name, '/'); - char *p2 = p != 0 ? index (dep->name, '%') : 0; - - ndeps++; - - if (len > max_pattern_dep_length) - max_pattern_dep_length = len; - - if (p != 0 && p2 > p) - { - /* There is a slash before the % in the dep name. - Extract the directory name. */ - if (p == dep->name) - ++p; - if ((unsigned int)(p - dep->name) > namelen) - { - if (name != 0) - free (name); - namelen = p - dep->name; - name = (char *) xmalloc (namelen + 1); - } - bcopy (dep->name, name, p - dep->name); - name[p - dep->name] = '\0'; - - /* In the deps of an implicit rule the `changed' flag - actually indicates that the dependency is in a - nonexistent subdirectory. */ - - dep->changed = !dir_file_exists_p (name, ""); - if (dep->changed && *name == '/') - { - /* The name is absolute and the directory does not exist. - This rule can never possibly match, since this dependency - can never possibly exist. So just remove the rule from - the list. */ - freerule (rule, lastrule); - --num_pattern_rules; - goto end_main_loop; - } - } - else - /* This dependency does not reside in a subdirectory. */ - dep->changed = 0; - } - - if (ndeps > max_pattern_deps) - max_pattern_deps = ndeps; - - lastrule = rule; - end_main_loop: - rule = next; - } - - if (name != 0) - free (name); -} - -/* Create a pattern rule from a suffix rule. - TARGET is the target suffix; SOURCE is the source suffix. - CMDS are the commands. - If TARGET is nil, it means the target pattern should be `(%.o)'. - If SOURCE is nil, it means there should be no deps. */ - -static void -convert_suffix_rule (target, source, cmds) - char *target, *source; - struct commands *cmds; -{ - char *targname, *targpercent, *depname; - char **names, **percents; - struct dep *deps; - unsigned int len; - - if (target == 0) - /* Special case: TARGET being nil means we are defining a - `.X.a' suffix rule; the target pattern is always `(%.o)'. */ - { - targname = savestring ("(%.o)", 5); - targpercent = targname + 1; - } - else - { - /* Construct the target name. */ - len = strlen (target); - targname = xmalloc (1 + len + 1); - targname[0] = '%'; - bcopy (target, targname + 1, len + 1); - targpercent = targname; - } - - names = (char **) xmalloc (2 * sizeof (char *)); - percents = (char **) alloca (2 * sizeof (char *)); - names[0] = targname; - percents[0] = targpercent; - names[1] = percents[1] = 0; - - if (source == 0) - deps = 0; - else - { - /* Construct the dependency name. */ - len = strlen (source); - depname = xmalloc (1 + len + 1); - depname[0] = '%'; - bcopy (source, depname + 1, len + 1); - deps = (struct dep *) xmalloc (sizeof (struct dep)); - deps->next = 0; - deps->name = depname; - } - - create_pattern_rule (names, percents, 0, deps, cmds, 0); -} - -/* Convert old-style suffix rules to pattern rules. - All rules for the suffixes on the .SUFFIXES list - are converted and added to the chain of pattern rules. */ - -void -convert_to_pattern () -{ - register struct dep *d, *d2; - register struct file *f; - register char *rulename; - register unsigned int slen, s2len; - - /* Compute maximum length of all the suffixes. */ - - maxsuffix = 0; - for (d = suffix_file->deps; d != 0; d = d->next) - { - register unsigned int namelen = strlen (dep_name (d)); - if (namelen > maxsuffix) - maxsuffix = namelen; - } - - rulename = (char *) alloca ((maxsuffix * 2) + 1); - - for (d = suffix_file->deps; d != 0; d = d->next) - { - /* Make a rule that is just the suffix, with no deps or commands. - This rule exists solely to disqualify match-anything rules. */ - convert_suffix_rule (dep_name (d), (char *) 0, (struct commands *) 0); - - f = d->file; - if (f->cmds != 0) - /* Record a pattern for this suffix's null-suffix rule. */ - convert_suffix_rule ("", dep_name (d), f->cmds); - - /* Record a pattern for each of this suffix's two-suffix rules. */ - slen = strlen (dep_name (d)); - bcopy (dep_name (d), rulename, slen); - for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next) - { - s2len = strlen (dep_name (d2)); - - if (slen == s2len && streq (dep_name (d), dep_name (d2))) - continue; - - bcopy (dep_name (d2), rulename + slen, s2len + 1); - f = lookup_file (rulename); - if (f == 0 || f->cmds == 0) - continue; - - if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a') - /* A suffix rule `.X.a:' generates the pattern rule `(%.o): %.X'. - It also generates a normal `%.a: %.X' rule below. */ - convert_suffix_rule ((char *) 0, /* Indicates `(%.o)'. */ - dep_name (d), - f->cmds); - - /* The suffix rule `.X.Y:' is converted - to the pattern rule `%.Y: %.X'. */ - convert_suffix_rule (dep_name (d2), dep_name (d), f->cmds); - } - } -} - - -/* Install the pattern rule RULE (whose fields have been filled in) - at the end of the list (so that any rules previously defined - will take precedence). If this rule duplicates a previous one - (identical target and dependencies), the old one is replaced - if OVERRIDE is nonzero, otherwise this new one is thrown out. - When an old rule is replaced, the new one is put at the end of the - list. Return nonzero if RULE is used; zero if not. */ - -int -new_pattern_rule (rule, override) - register struct rule *rule; - int override; -{ - register struct rule *r, *lastrule; - register unsigned int i, j; - - rule->in_use = 0; - rule->terminal = 0; - - rule->next = 0; - - /* Search for an identical rule. */ - lastrule = 0; - for (r = pattern_rules; r != 0; lastrule = r, r = r->next) - for (i = 0; rule->targets[i] != 0; ++i) - { - for (j = 0; r->targets[j] != 0; ++j) - if (!streq (rule->targets[i], r->targets[j])) - break; - if (r->targets[j] == 0) - /* All the targets matched. */ - { - register struct dep *d, *d2; - for (d = rule->deps, d2 = r->deps; - d != 0 && d2 != 0; d = d->next, d2 = d2->next) - if (!streq (dep_name (d), dep_name (d2))) - break; - if (d == 0 && d2 == 0) - /* All the dependencies matched. */ - if (override) - { - /* Remove the old rule. */ - freerule (r, lastrule); - /* Install the new one. */ - if (pattern_rules == 0) - pattern_rules = rule; - else - last_pattern_rule->next = rule; - last_pattern_rule = rule; - - /* We got one. Stop looking. */ - goto matched; - } - else - { - /* The old rule stays intact. Destroy the new one. */ - freerule (rule, (struct rule *) 0); - return 0; - } - } - } - - matched:; - - if (r == 0) - { - /* There was no rule to replace. */ - if (pattern_rules == 0) - pattern_rules = rule; - else - last_pattern_rule->next = rule; - last_pattern_rule = rule; - } - - return 1; -} - - -/* Install an implicit pattern rule based on the three text strings - in the structure P points to. These strings come from one of - the arrays of default implicit pattern rules. - TERMINAL specifies what the `terminal' field of the rule should be. */ - -void -install_pattern_rule (p, terminal) - struct pspec *p; - int terminal; -{ - register struct rule *r; - char *ptr; - - r = (struct rule *) xmalloc (sizeof (struct rule)); - - r->targets = (char **) xmalloc (2 * sizeof (char *)); - r->suffixes = (char **) xmalloc (2 * sizeof (char *)); - r->lens = (unsigned int *) xmalloc (2 * sizeof (unsigned int)); - - r->targets[1] = 0; - r->suffixes[1] = 0; - r->lens[1] = 0; - - r->lens[0] = strlen (p->target); - /* These will all be string literals, but we malloc space for - them anyway because somebody might want to free them later on. */ - r->targets[0] = savestring (p->target, r->lens[0]); - r->suffixes[0] = find_percent (r->targets[0]); - if (r->suffixes[0] == 0) - /* Programmer-out-to-lunch error. */ - abort (); - else - ++r->suffixes[0]; - - ptr = p->dep; - r->deps = (struct dep *) multi_glob (parse_file_seq (&ptr, '\0', - sizeof (struct dep), 1), - sizeof (struct dep)); - - if (new_pattern_rule (r, 0)) - { - r->terminal = terminal; - r->cmds = (struct commands *) xmalloc (sizeof (struct commands)); - r->cmds->filename = 0; - r->cmds->lineno = 0; - /* These will all be string literals, but we malloc space for them - anyway because somebody might want to free them later. */ - r->cmds->commands = savestring (p->commands, strlen (p->commands)); - r->cmds->command_lines = 0; - } -} - - -/* Free all the storage used in RULE and take it out of the - pattern_rules chain. LASTRULE is the rule whose next pointer - points to RULE. */ - -static void -freerule (rule, lastrule) - register struct rule *rule, *lastrule; -{ - struct rule *next = rule->next; - register unsigned int i; - - for (i = 0; rule->targets[i] != 0; ++i) - free (rule->targets[i]); - - free ((char *) rule->targets); - free ((char *) rule->suffixes); - free ((char *) rule->lens); - - /* We can't free the storage for the commands because there - are ways that they could be in more than one place: - * If the commands came from a suffix rule, they could also be in - the `struct file's for other suffix rules or plain targets given - on the same makefile line. - * If two suffixes that together make a two-suffix rule were each - given twice in the .SUFFIXES list, and in the proper order, two - identical pattern rules would be created and the second one would - be discarded here, but both would contain the same `struct commands' - pointer from the `struct file' for the suffix rule. */ - - free ((char *) rule); - - if (pattern_rules == rule) - if (lastrule != 0) - abort (); - else - pattern_rules = next; - else if (lastrule != 0) - lastrule->next = next; - if (last_pattern_rule == rule) - last_pattern_rule = lastrule; -} - -/* Create a new pattern rule with the targets in the nil-terminated - array TARGETS. If TARGET_PERCENTS is not nil, it is an array of - pointers into the elements of TARGETS, where the `%'s are. - The new rule has dependencies DEPS and commands from COMMANDS. - It is a terminal rule if TERMINAL is nonzero. This rule overrides - identical rules with different commands if OVERRIDE is nonzero. - - The storage for TARGETS and its elements is used and must not be freed - until the rule is destroyed. The storage for TARGET_PERCENTS is not used; - it may be freed. */ - -void -create_pattern_rule (targets, target_percents, - terminal, deps, commands, override) - char **targets, **target_percents; - int terminal; - struct dep *deps; - struct commands *commands; - int override; -{ - register struct rule *r = (struct rule *) xmalloc (sizeof (struct rule)); - register unsigned int max_targets, i; - - r->cmds = commands; - r->deps = deps; - r->targets = targets; - - max_targets = 2; - r->lens = (unsigned int *) xmalloc (2 * sizeof (unsigned int)); - r->suffixes = (char **) xmalloc (2 * sizeof (char *)); - for (i = 0; targets[i] != 0; ++i) - { - if (i == max_targets - 1) - { - max_targets += 5; - r->lens = (unsigned int *) - xrealloc ((char *) r->lens, max_targets * sizeof (unsigned int)); - r->suffixes = (char **) - xrealloc ((char *) r->suffixes, max_targets * sizeof (char *)); - } - r->lens[i] = strlen (targets[i]); - r->suffixes[i] = (target_percents == 0 ? find_percent (targets[i]) - : target_percents[i]) + 1; - if (r->suffixes[i] == 0) - abort (); - } - - if (i < max_targets - 1) - { - r->lens = (unsigned int *) xrealloc ((char *) r->lens, - (i + 1) * sizeof (unsigned int)); - r->suffixes = (char **) xrealloc ((char *) r->suffixes, - (i + 1) * sizeof (char *)); - } - - if (new_pattern_rule (r, override)) - r->terminal = terminal; -} - -/* Print the data base of rules. */ - -static void /* Useful to call from gdb. */ -print_rule (r) - struct rule *r; -{ - register unsigned int i; - register struct dep *d; - - for (i = 0; r->targets[i] != 0; ++i) - { - fputs (r->targets[i], stdout); - if (r->targets[i + 1] != 0) - putchar (' '); - else - putchar (':'); - } - if (r->terminal) - putchar (':'); - - for (d = r->deps; d != 0; d = d->next) - printf (" %s", dep_name (d)); - putchar ('\n'); - - if (r->cmds != 0) - print_commands (r->cmds); -} - -void -print_rule_data_base () -{ - register unsigned int rules, terminal; - register struct rule *r; - - puts ("\n# Implicit Rules"); - - rules = terminal = 0; - for (r = pattern_rules; r != 0; r = r->next) - { - ++rules; - - putchar ('\n'); - print_rule (r); - - if (r->terminal) - ++terminal; - } - - if (rules == 0) - puts ("\n# No implicit rules."); - else - { - printf ("\n# %u implicit rules, %u", rules, terminal); -#ifndef NO_FLOAT - printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0); -#endif - puts (" terminal."); - } - - if (num_pattern_rules != rules) - fatal ("BUG: num_pattern_rules wrong! %u != %u", - num_pattern_rules, rules); -} diff --git a/buildtools/windows/source/make/rule.h b/buildtools/windows/source/make/rule.h deleted file mode 100644 index 75d43d6624c..00000000000 --- a/buildtools/windows/source/make/rule.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Definitions for using pattern rules in GNU Make. -Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Structure used for pattern rules. */ - -struct rule - { - struct rule *next; - char **targets; /* Targets of the rule. */ - unsigned int *lens; /* Lengths of each target. */ - char **suffixes; /* Suffixes (after `%') of each target. */ - struct dep *deps; /* Dependencies of the rule. */ - struct commands *cmds; /* Commands to execute. */ - char terminal; /* If terminal (double-colon). */ - char in_use; /* If in use by a parent pattern_search. */ - }; - -/* For calling install_pattern_rule. */ -struct pspec - { - char *target, *dep, *commands; - }; - - -extern struct rule *pattern_rules; -extern struct rule *last_pattern_rule; -extern unsigned int num_pattern_rules; - -extern unsigned int max_pattern_deps; -extern unsigned int max_pattern_targets; -extern unsigned int max_pattern_dep_length; - -extern struct file *suffix_file; -extern unsigned int maxsuffix; - - -extern void install_pattern_rule (); -int new_pattern_rule (); diff --git a/buildtools/windows/source/make/signame.c b/buildtools/windows/source/make/signame.c deleted file mode 100644 index 96b9c3e238d..00000000000 --- a/buildtools/windows/source/make/signame.c +++ /dev/null @@ -1,304 +0,0 @@ -/* Convert between signal names and numbers. - Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include /* Some systems need this for . */ -#include - -/* Some systems declare `sys_siglist in ; if - configure defined SYS_SIGLIST_DECLARED, it may expect - to find the declaration there. */ -#ifdef HAVE_UNISTD_H -#include -#endif - - -/* Some systems do not define NSIG in . */ -#ifndef NSIG -#ifdef _NSIG -#define NSIG _NSIG -#else -#define NSIG 32 -#endif -#endif - -#if !__STDC__ -#define const -#endif - -#include "signame.h" - -#ifndef HAVE_SYS_SIGLIST -/* There is too much variation in Sys V signal numbers and names, so - we must initialize them at runtime. */ - -static const char undoc[] = "unknown signal"; - -const char *sys_siglist[NSIG]; - -#else /* HAVE_SYS_SIGLIST. */ - -#ifndef SYS_SIGLIST_DECLARED -extern char *sys_siglist[]; -#endif /* Not SYS_SIGLIST_DECLARED. */ - -#endif /* Not HAVE_SYS_SIGLIST. */ - -/* Table of abbreviations for signals. Note: A given number can - appear more than once with different abbreviations. */ -typedef struct - { - int number; - const char *abbrev; - } num_abbrev; -static num_abbrev sig_table[NSIG*2]; -/* Number of elements of sig_table used. */ -static int sig_table_nelts = 0; - -/* Enter signal number NUMBER into the tables with ABBREV and NAME. */ - -static void -init_sig (number, abbrev, name) - int number; - const char *abbrev; - const char *name; -{ -#ifndef HAVE_SYS_SIGLIST - sys_siglist[number] = name; -#endif - sig_table[sig_table_nelts].number = number; - sig_table[sig_table_nelts++].abbrev = abbrev; -} - -void -signame_init () -{ -#ifndef HAVE_SYS_SIGLIST - int i; - /* Initialize signal names. */ - for (i = 0; i < NSIG; i++) - sys_siglist[i] = undoc; -#endif /* !HAVE_SYS_SIGLIST */ - - /* Initialize signal names. */ -#if defined (SIGHUP) - init_sig (SIGHUP, "HUP", "Hangup"); -#endif -#if defined (SIGINT) - init_sig (SIGINT, "INT", "Interrupt"); -#endif -#if defined (SIGQUIT) - init_sig (SIGQUIT, "QUIT", "Quit"); -#endif -#if defined (SIGILL) - init_sig (SIGILL, "ILL", "Illegal Instruction"); -#endif -#if defined (SIGTRAP) - init_sig (SIGTRAP, "TRAP", "Trace/breakpoint trap"); -#endif - /* If SIGIOT == SIGABRT, we want to print it as SIGABRT because - SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */ -#if defined (SIGABRT) - init_sig (SIGABRT, "ABRT", "Aborted"); -#endif -#if defined (SIGIOT) - init_sig (SIGIOT, "IOT", "IOT trap"); -#endif -#if defined (SIGEMT) - init_sig (SIGEMT, "EMT", "EMT trap"); -#endif -#if defined (SIGFPE) - init_sig (SIGFPE, "FPE", "Floating point exception"); -#endif -#if defined (SIGKILL) - init_sig (SIGKILL, "KILL", "Killed"); -#endif -#if defined (SIGBUS) - init_sig (SIGBUS, "BUS", "Bus error"); -#endif -#if defined (SIGSEGV) - init_sig (SIGSEGV, "SEGV", "Segmentation fault"); -#endif -#if defined (SIGSYS) - init_sig (SIGSYS, "SYS", "Bad system call"); -#endif -#if defined (SIGPIPE) - init_sig (SIGPIPE, "PIPE", "Broken pipe"); -#endif -#if defined (SIGALRM) - init_sig (SIGALRM, "ALRM", "Alarm clock"); -#endif -#if defined (SIGTERM) - init_sig (SIGTERM, "TERM", "Terminated"); -#endif -#if defined (SIGUSR1) - init_sig (SIGUSR1, "USR1", "User defined signal 1"); -#endif -#if defined (SIGUSR2) - init_sig (SIGUSR2, "USR2", "User defined signal 2"); -#endif - /* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that - is what is in POSIX.1. */ -#if defined (SIGCHLD) - init_sig (SIGCHLD, "CHLD", "Child exited"); -#endif -#if defined (SIGCLD) - init_sig (SIGCLD, "CLD", "Child exited"); -#endif -#if defined (SIGPWR) - init_sig (SIGPWR, "PWR", "Power failure"); -#endif -#if defined (SIGTSTP) - init_sig (SIGTSTP, "TSTP", "Stopped"); -#endif -#if defined (SIGTTIN) - init_sig (SIGTTIN, "TTIN", "Stopped (tty input)"); -#endif -#if defined (SIGTTOU) - init_sig (SIGTTOU, "TTOU", "Stopped (tty output)"); -#endif -#if defined (SIGSTOP) - init_sig (SIGSTOP, "STOP", "Stopped (signal)"); -#endif -#if defined (SIGXCPU) - init_sig (SIGXCPU, "XCPU", "CPU time limit exceeded"); -#endif -#if defined (SIGXFSZ) - init_sig (SIGXFSZ, "XFSZ", "File size limit exceeded"); -#endif -#if defined (SIGVTALRM) - init_sig (SIGVTALRM, "VTALRM", "Virtual timer expired"); -#endif -#if defined (SIGPROF) - init_sig (SIGPROF, "PROF", "Profiling timer expired"); -#endif -#if defined (SIGWINCH) - /* "Window size changed" might be more accurate, but even if that - is all that it means now, perhaps in the future it will be - extended to cover other kinds of window changes. */ - init_sig (SIGWINCH, "WINCH", "Window changed"); -#endif -#if defined (SIGCONT) - init_sig (SIGCONT, "CONT", "Continued"); -#endif -#if defined (SIGURG) - init_sig (SIGURG, "URG", "Urgent I/O condition"); -#endif -#if defined (SIGIO) - /* "I/O pending" has also been suggested. A disadvantage is - that signal only happens when the process has - asked for it, not everytime I/O is pending. Another disadvantage - is the confusion from giving it a different name than under Unix. */ - init_sig (SIGIO, "IO", "I/O possible"); -#endif -#if defined (SIGWIND) - init_sig (SIGWIND, "WIND", "SIGWIND"); -#endif -#if defined (SIGPHONE) - init_sig (SIGPHONE, "PHONE", "SIGPHONE"); -#endif -#if defined (SIGPOLL) - init_sig (SIGPOLL, "POLL", "I/O possible"); -#endif -#if defined (SIGLOST) - init_sig (SIGLOST, "LOST", "Resource lost"); -#endif -#if defined (SIGDANGER) - init_sig (SIGDANGER, "DANGER", "Danger signal"); -#endif -#if defined (SIGINFO) - init_sig (SIGINFO, "INFO", "Information request"); -#endif -} - -/* Return the abbreviation for signal NUMBER. */ - -char * -sig_abbrev (number) - int number; -{ - int i; - - if (sig_table_nelts == 0) - signame_init (); - - for (i = 0; i < sig_table_nelts; i++) - if (sig_table[i].number == number) - return (char *)sig_table[i].abbrev; - return NULL; -} - -/* Return the signal number for an ABBREV, or -1 if there is no - signal by that name. */ - -int -sig_number (abbrev) - const char *abbrev; -{ - int i; - - if (sig_table_nelts == 0) - signame_init (); - - /* Skip over "SIG" if present. */ - if (abbrev[0] == 'S' && abbrev[1] == 'I' && abbrev[2] == 'G') - abbrev += 3; - - for (i = 0; i < sig_table_nelts; i++) - if (abbrev[0] == sig_table[i].abbrev[0] - && strcmp (abbrev, sig_table[i].abbrev) == 0) - return sig_table[i].number; - return -1; -} - -#ifndef HAVE_PSIGNAL -/* Print to standard error the name of SIGNAL, preceded by MESSAGE and - a colon, and followed by a newline. */ - -void -psignal (signal, message) - int signal; - const char *message; -{ - if (signal <= 0 || signal >= NSIG) - fprintf (stderr, "%s: unknown signal", message); - else - fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]); -} -#endif - -#ifndef HAVE_STRSIGNAL -/* Return the string associated with the signal number. */ - -char * -strsignal (signal) - int signal; -{ - static char buf[] = "Signal 12345678901234567890"; - - if (signal > 0 || signal < NSIG) - return (char *) sys_siglist[signal]; - - sprintf (buf, "Signal %d", signal); - return buf; -} -#endif diff --git a/buildtools/windows/source/make/signame.h b/buildtools/windows/source/make/signame.h deleted file mode 100644 index 18b83cbb890..00000000000 --- a/buildtools/windows/source/make/signame.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Convert between signal names and numbers. - Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#if defined (__STDC__) && __STDC__ - -/* Initialize `sys_siglist'. */ -void signame_init (void); - -/* Return the abbreviation (e.g. ABRT, FPE, etc.) for signal NUMBER. - Do not return this as a const char *. The caller might want to - assign it to a char *. */ -char *sig_abbrev (int number); - -/* Return the signal number for an ABBREV, or -1 if there is no - signal by that name. */ -int sig_number (const char *abbrev); - -/* Avoid conflicts with a system header file that might define these three. */ - -#ifndef HAVE_PSIGNAL -/* Print to standard error the name of SIGNAL, preceded by MESSAGE and - a colon, and followed by a newline. */ -void psignal (int signal, const char *message); -#endif - -#ifndef HAVE_STRSIGNAL -/* Return the name of SIGNAL. */ -char *strsignal (int signal); -#endif - -#if !defined (HAVE_SYS_SIGLIST) -/* Names for signals from 0 to NSIG-1. */ -extern const char *sys_siglist[]; -#endif - -#else - -void signame_init (); -char *sig_abbrev (); -int sig_number (); -#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL) -void psignal (); -#endif -#ifndef HAVE_STRSIGNAL -char *strsignal (); -#endif -#if !defined (HAVE_SYS_SIGLIST) -extern char *sys_siglist[]; -#endif - -#endif diff --git a/buildtools/windows/source/make/texinfo.tex b/buildtools/windows/source/make/texinfo.tex deleted file mode 100644 index 554cc37c52d..00000000000 --- a/buildtools/windows/source/make/texinfo.tex +++ /dev/null @@ -1,4421 +0,0 @@ -%% TeX macros to handle texinfo files - -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. - -%This texinfo.tex file is free software; you can redistribute it and/or -%modify it under the terms of the GNU General Public License as -%published by the Free Software Foundation; either version 2, or (at -%your option) any later version. - -%This texinfo.tex file is distributed in the hope that it will be -%useful, but WITHOUT ANY WARRANTY; without even the implied warranty -%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%General Public License for more details. - -%You should have received a copy of the GNU General Public License -%along with this texinfo.tex file; see the file COPYING. If not, write -%to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, -%USA. - - -%In other words, you are welcome to use, share and improve this program. -%You are forbidden to forbid anyone else to use, share and improve -%what you give them. Help stamp out software-hoarding! - - -% Send bug reports to bug-texinfo@prep.ai.mit.edu. -% Please include a *precise* test case in each bug report. - - -% Make it possible to create a .fmt file just by loading this file: -% if the underlying format is not loaded, start by loading it now. -% Added by gildea November 1993. -\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi - -% This automatically updates the version number based on RCS. -\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 1.1 $ -\message{Loading texinfo package [Version \texinfoversion]:} - -% If in a .fmt file, print the version number -% and turn on active characters that we couldn't do earlier because -% they might have appeared in the input file name. -\everyjob{\message{[Texinfo version \texinfoversion]}\message{} - \catcode`+=\active \catcode`\_=\active} - -% Save some parts of plain tex whose names we will redefine. - -\let\ptextilde=\~ -\let\ptexlbrace=\{ -\let\ptexrbrace=\} -\let\ptexdots=\dots -\let\ptexdot=\. -\let\ptexstar=\* -\let\ptexend=\end -\let\ptexbullet=\bullet -\let\ptexb=\b -\let\ptexc=\c -\let\ptexi=\i -\let\ptext=\t -\let\ptexl=\l -\let\ptexL=\L - -% Be sure we're in horizontal mode when doing a tie, since we make space -% equivalent to this in @example-like environments. Otherwise, a space -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - \gdef\tie{\leavevmode\penalty\@M\ } -} -\let\~ = \tie % And make it available as @~. - -\message{Basics,} -\chardef\other=12 - -% If this character appears in an error message or help string, it -% starts a new line in the output. -\newlinechar = `^^J - -% Set up fixed words for English. -\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% -\def\putwordInfo{Info}% -\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% -\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% -\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% -\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% -\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% -\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% -\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% -\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% -\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% - -% Ignore a token. -% -\def\gobble#1{} - -\hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{eshell} - -% Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset \bindingoffset=0pt -\newdimen \normaloffset \normaloffset=\hoffset -\newdimen\pagewidth \newdimen\pageheight -\pagewidth=\hsize \pageheight=\vsize - -% Sometimes it is convenient to have everything in the transcript file -% and nothing on the terminal. We don't just call \tracingall here, -% since that produces some useless output on the terminal. -% -\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\def\loggingall{\tracingcommands2 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \showboxbreadth\maxdimen\showboxdepth\maxdimen -}% - -%---------------------Begin change----------------------- -% -%%%% For @cropmarks command. -% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 -% -\newdimen\cornerlong \newdimen\cornerthick -\newdimen \topandbottommargin -\newdimen \outerhsize \newdimen \outervsize -\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks -\outerhsize=7in -%\outervsize=9.5in -% Alternative @smallbook page size is 9.25in -\outervsize=9.25in -\topandbottommargin=.75in -% -%---------------------End change----------------------- - -% \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions itself, but you have to call it yourself. -\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} -\def\onepageout#1{\hoffset=\normaloffset -\ifodd\pageno \advance\hoffset by \bindingoffset -\else \advance\hoffset by -\bindingoffset\fi -{\escapechar=`\\\relax % makes sure backslash is used in output files. -\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% -{\let\hsize=\pagewidth \makefootline}}}% -\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} - -%%%% For @cropmarks command %%%% - -% Here is a modification of the main output routine for Near East Publications -% This provides right-angle cropmarks at all four corners. -% The contents of the page are centerlined into the cropmarks, -% and any desired binding offset is added as an \hskip on either -% site of the centerlined box. (P. A. MacKay, 12 November, 1986) -% -\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up -{\escapechar=`\\\relax % makes sure backslash is used in output files. - \shipout - \vbox to \outervsize{\hsize=\outerhsize - \vbox{\line{\ewtop\hfill\ewtop}} - \nointerlineskip - \line{\vbox{\moveleft\cornerthick\nstop} - \hfill - \vbox{\moveright\cornerthick\nstop}} - \vskip \topandbottommargin - \centerline{\ifodd\pageno\hskip\bindingoffset\fi - \vbox{ - {\let\hsize=\pagewidth \makeheadline} - \pagebody{#1} - {\let\hsize=\pagewidth \makefootline}} - \ifodd\pageno\else\hskip\bindingoffset\fi} - \vskip \topandbottommargin plus1fill minus1fill - \boxmaxdepth\cornerthick - \line{\vbox{\moveleft\cornerthick\nsbot} - \hfill - \vbox{\moveright\cornerthick\nsbot}} - \nointerlineskip - \vbox{\line{\ewbot\hfill\ewbot}} - }} - \advancepageno - \ifnum\outputpenalty>-20000 \else\dosupereject\fi} -% -% Do @cropmarks to get crop marks -\def\cropmarks{\let\onepageout=\croppageout } - -\newinsert\margin \dimen\margin=\maxdimen - -\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} -{\catcode`\@ =11 -\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi -% marginal hacks, juha@viisa.uucp (Juha Takala) -\ifvoid\margin\else % marginal info is present - \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi -\dimen@=\dp#1 \unvbox#1 -\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi -\ifr@ggedbottom \kern-\dimen@ \vfil \fi} -} - -% -% Here are the rules for the cropmarks. Note that they are -% offset so that the space between them is truly \outerhsize or \outervsize -% (P. A. MacKay, 12 November, 1986) -% -\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} -\def\nstop{\vbox - {\hrule height\cornerthick depth\cornerlong width\cornerthick}} -\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} -\def\nsbot{\vbox - {\hrule height\cornerlong depth\cornerthick width\cornerthick}} - -% Parse an argument, then pass it to #1. The argument is the rest of -% the input line (except we remove a trailing comment). #1 should be a -% macro which expects an ordinary undelimited TeX argument. -% -\def\parsearg#1{% - \let\next = #1% - \begingroup - \obeylines - \futurelet\temp\parseargx -} - -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi -} - -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - -{\obeylines % - \gdef\parseargline#1^^M{% - \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% - }% -} - -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} - -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., -% @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. -% -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. -% -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup -} - -% Change the active space to expand to nothing. -% -\begingroup - \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup - - -\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} - -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment. Type Return to continue.} -\endgroup\fi} % This is not perfect, but it should reduce lossage - -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Type to continue.} - -\outer\def\begin{\parsearg\beginxxx} - -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} - -% @end foo executes the definition of \Efoo. -% -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi - \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname - \fi -} - -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% - \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% -} - -% Define the control sequence \E#1 to give an unmatched @end error. -% -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% -} - - -% Single-spacing is done by various environments (specifically, in -% \nonfillstart and \quotations). -\newskip\singlespaceskip \singlespaceskip = 12.5pt -\def\singlespace{% - % Why was this kern here? It messes up equalizing space above and below - % environments. --karl, 6may93 - %{\advance \baselineskip by -\singlespaceskip - %\kern \baselineskip}% - \setleading \singlespaceskip -} - -%% Simple single-character @ commands - -% @@ prints an @ -% Kludge this until the fonts are right (grr). -\def\@{{\tt \char '100}} - -% This is turned off because it was never documented -% and you can use @w{...} around a quote to suppress ligatures. -%% Define @` and @' to be the same as ` and ' -%% but suppressing ligatures. -%\def\`{{`}} -%\def\'{{'}} - -% Used to generate quoted braces. - -\def\mylbrace {{\tt \char '173}} -\def\myrbrace {{\tt \char '175}} -\let\{=\mylbrace -\let\}=\myrbrace - -% @: forces normal size whitespace following. -\def\:{\spacefactor=1000 } - -% @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} - -% @. is an end-of-sentence period. -\def\.{.\spacefactor=3000 } - -% @enddots{} is an end-of-sentence ellipsis. -\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000} - -% @! is an end-of-sentence bang. -\gdef\!{!\spacefactor=3000 } - -% @? is an end-of-sentence query. -\gdef\?{?\spacefactor=3000 } - -% @w prevents a word break. Without the \leavevmode, @w at the -% beginning of a paragraph, when TeX is still in vertical mode, would -% produce a whole line of output instead of starting the paragraph. -\def\w#1{\leavevmode\hbox{#1}} - -% @group ... @end group forces ... to be all on one page, by enclosing -% it in a TeX vbox. We use \vtop instead of \vbox to construct the box -% to keep its height that of a normal line. According to the rules for -% \topskip (p.114 of the TeXbook), the glue inserted is -% max (\topskip - \ht (first item), 0). If that height is large, -% therefore, no glue is inserted, and the space between the headline and -% the text is small, which looks bad. -% -\def\group{\begingroup - \ifnum\catcode13=\active \else - \errhelp = \groupinvalidhelp - \errmessage{@group invalid in context where filling is enabled}% - \fi - % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - \endgroup % End the \group. - }% - % - \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % - % Do @comment since we are called inside an environment such as - % @example, where each end-of-line in the input causes an - % end-of-line in the output. We don't want the end-of-line after - % the `@group' to put extra space in the output. Since @group - % should appear on a line by itself (according to the Texinfo - % manual), we don't worry about eating any user text. - \comment -} -% -% TeX puts in an \escapechar (i.e., `@') at the beginning of the help -% message, so this ends up printing `@group can only ...'. -% -\newhelp\groupinvalidhelp{% -group can only be used in environments such as @example,^^J% -where each line of input produces a line of output.} - -% @need space-in-mils -% forces a page break if there is not space-in-mils remaining. - -\newdimen\mil \mil=0.001in - -\def\need{\parsearg\needx} - -% Old definition--didn't work. -%\def\needx #1{\par % -%% This method tries to make TeX break the page naturally -%% if the depth of the box does not fit. -%{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000 -%\prevdepth=-1000pt -%}} - -\def\needx#1{% - % Go into vertical mode, so we don't make a big box in the middle of a - % paragraph. - \par - % - % Don't add any leading before our big empty box, but allow a page - % break, since the best break might be right here. - \allowbreak - \nointerlineskip - \vtop to #1\mil{\vfil}% - % - % TeX does not even consider page breaks if a penalty added to the - % main vertical list is 10000 or more. But in order to see if the - % empty box we just added fits on the page, we must make it consider - % page breaks. On the other hand, we don't want to actually break the - % page after the empty box. So we use a penalty of 9999. - % - % There is an extremely small chance that TeX will actually break the - % page at this \penalty, if there are no other feasible breakpoints in - % sight. (If the user is using lots of big @group commands, which - % almost-but-not-quite fill up a page, TeX will have a hard time doing - % good page breaking, for example.) However, I could not construct an - % example where a page broke at this \penalty; if it happens in a real - % document, then we can reconsider our strategy. - \penalty9999 - % - % Back up by the size of the box, whether we did a page break or not. - \kern -#1\mil - % - % Do not allow a page break right after this kern. - \nobreak -} - -% @br forces paragraph break - -\let\br = \par - -% @dots{} output some dots - -\def\dots{$\ldots$} - -% @page forces the start of a new page - -\def\page{\par\vfill\supereject} - -% @exdent text.... -% outputs text on separate line in roman font, starting at standard page margin - -% This records the amount of indent in the innermost environment. -% That's how much \exdent should take out. -\newskip\exdentamount - -% This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} - -% This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} - -%\hbox{{\rm#1}}\hfil\break}} - -% @include file insert text of that file as input. - -\def\include{\parsearg\includezzz} -%Use \input\thisfile to avoid blank after \input, which may be an active -%char (in which case the blank would become the \input argument). -%The grouping keeps the value of \thisfile correct even when @include -%is nested. -\def\includezzz #1{\begingroup -\def\thisfile{#1}\input\thisfile -\endgroup} - -\def\thisfile{} - -% @center line outputs that line, centered - -\def\center{\parsearg\centerzzz} -\def\centerzzz #1{{\advance\hsize by -\leftskip -\advance\hsize by -\rightskip -\centerline{#1}}} - -% @sp n outputs n lines of vertical space - -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\par \vskip #1\baselineskip} - -% @comment ...line which is ignored... -% @c is the same as @comment -% @ignore ... @end ignore is another way to write a comment - -\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other% -\parsearg \commentxxx} - -\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } - -\let\c=\comment - -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% -\let\chapter=\relax -\let\unnumbered=\relax -\let\top=\relax -\let\unnumberedsec=\relax -\let\unnumberedsection=\relax -\let\unnumberedsubsec=\relax -\let\unnumberedsubsection=\relax -\let\unnumberedsubsubsec=\relax -\let\unnumberedsubsubsection=\relax -\let\section=\relax -\let\subsec=\relax -\let\subsubsec=\relax -\let\subsection=\relax -\let\subsubsection=\relax -\let\appendix=\relax -\let\appendixsec=\relax -\let\appendixsection=\relax -\let\appendixsubsec=\relax -\let\appendixsubsection=\relax -\let\appendixsubsubsec=\relax -\let\appendixsubsubsection=\relax -\let\contents=\relax -\let\smallbook=\relax -\let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -\def\ignoremorecommands{% - \let\defcv = \relax - \let\deffn = \relax - \let\deffnx = \relax - \let\defindex = \relax - \let\defivar = \relax - \let\defmac = \relax - \let\defmethod = \relax - \let\defop = \relax - \let\defopt = \relax - \let\defspec = \relax - \let\deftp = \relax - \let\deftypefn = \relax - \let\deftypefun = \relax - \let\deftypevar = \relax - \let\deftypevr = \relax - \let\defun = \relax - \let\defvar = \relax - \let\defvr = \relax - \let\ref = \relax - \let\xref = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\settitle = \relax - \let\include = \relax - \let\lowersections = \relax - \let\down = \relax - \let\raisesections = \relax - \let\up = \relax - \let\set = \relax - \let\clear = \relax - \let\item = \relax - \let\message = \relax -} - -% Ignore @ignore ... @end ignore. -% -\def\ignore{\doignore{ignore}} - -% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. -% -\def\ifinfo{\doignore{ifinfo}} -\def\ifhtml{\doignore{ifhtml}} -\def\html{\doignore{html}} -\def\menu{\doignore{menu}} -\def\direntry{\doignore{direntry}} - -% Ignore text until a line `@end #1'. -% -\def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - \long\def\doignoretext##1\end #1{\enddoignore}% - % - % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode32 = 10 - % - % And now expand that command. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \warnedobstrue - \fi -} - -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the change of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook: make the current font be a dummy font. - % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because not all sites - % might have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont - \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont - \let\tensf = \nullfont - % Similarly for index fonts (mostly for their use in - % smallexample) - \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont - \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont - \let\indsf = \nullfont - % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex - \def\tex{\doignore{tex}} -} - -% @set VAR sets the variable VAR to an empty value. -% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. -% -% Since we want to separate VAR from REST-OF-LINE (which might be -% empty), we can't just use \parsearg; we have to insert a space of our -% own to delimit the rest of the line, and then take it out again if we -% didn't need it. -% -\def\set{\parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} -\def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi -} -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} - -% @clear VAR clears (i.e., unsets) the variable VAR. -% -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} - -% @value{foo} gets the text saved in variable foo. -% -\def\value#1{\expandafter - \ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}} - \else \csname SET#1\endcsname \fi} - -% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined -% with @set. -% -\def\ifset{\parsearg\ifsetxxx} -\def\ifsetxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifsetfail - \else - \expandafter\ifsetsucceed - \fi -} -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} - -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been -% defined with @set, or has been undefined with @clear. -% -\def\ifclear{\parsearg\ifclearxxx} -\def\ifclearxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifclearsucceed - \else - \expandafter\ifclearfail - \fi -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex always succeeds; we read the text following, through @end -% iftex). But `@end iftex' should be valid only after an @iftex. -% -\def\iftex{\conditionalsucceed{iftex}} -\defineunmatchedend{iftex} - -% We can't just want to start a group at @iftex (for example) and end it -% at @end iftex, since then @set commands inside the conditional have no -% effect (they'd get reverted at the end of the group). So we must -% define \Eiftex to redefine itself to be its previous value. (We can't -% just define it to fail again with an ``unmatched end'' error, since -% the @ifset might be nested.) -% -\def\conditionalsucceed#1{% - \edef\temp{% - % Remember the current value of \E#1. - \let\nece{prevE#1} = \nece{E#1}% - % - % At the `@end #1', redefine \E#1 to be its previous value. - \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% - }% - \temp -} - -% We need to expand lots of \csname's, but we don't want to expand the -% control sequences after we've constructed them. -% -\def\nece#1{\expandafter\noexpand\csname#1\endcsname} - -% @asis just yields its argument. Used with @table, for example. -% -\def\asis#1{#1} - -% @math means output in math mode. -% We don't use $'s directly in the definition of \math because control -% sequences like \math are expanded when the toc file is written. Then, -% we read the toc file back, the $'s will be normal characters (as they -% should be, according to the definition of Texinfo). So we must use a -% control sequence to switch into and out of math mode. -% -% This isn't quite enough for @math to work properly in indices, but it -% seems unlikely it will ever be needed there. -% -\let\implicitmath = $ -\def\math#1{\implicitmath #1\implicitmath} - -% @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} - -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} -\let\nwnode=\node -\let\lastnode=\relax - -\def\donoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\setref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\unnumbnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\def\appendixnoderef{\ifx\lastnode\relax\else -\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi -\global\let\lastnode=\relax} - -\let\refill=\relax - -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. -% This makes it possible to make a .fmt file for texinfo. -\def\setfilename{% - \readauxfile - \opencontents - \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. - \comment % Ignore the actual filename. -} - -\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - -\def\inforef #1{\inforefzzz #1,,,,**} -\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - node \samp{\ignorespaces#1{}}} - -\message{fonts,} - -% Font-change commands. - -% Texinfo supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. -\newfam\sffam -\def\sf{\fam=\sffam \tensf} -\let\li = \sf % Sometimes we call it \li, not \sf. - -%% Try out Computer Modern fonts at \magstephalf -\let\mainmagstep=\magstephalf - -% Set the font macro #1 to the font named #2, adding on the -% specified font prefix (normally `cm'). -\def\setfont#1#2{\font#1=\fontprefix#2} - -% Use cm as the default font prefix. -% To specify the font prefix, you must define \fontprefix -% before you read in texinfo.tex. -\ifx\fontprefix\undefined -\def\fontprefix{cm} -\fi - -\ifx\bigger\relax -\let\mainmagstep=\magstep1 -\setfont\textrm{r12} -\setfont\texttt{tt12} -\else -\setfont\textrm{r10 scaled \mainmagstep} -\setfont\texttt{tt10 scaled \mainmagstep} -\fi -% Instead of cmb10, you many want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10. -\setfont\textbf{b10 scaled \mainmagstep} -\setfont\textit{ti10 scaled \mainmagstep} -\setfont\textsl{sl10 scaled \mainmagstep} -\setfont\textsf{ss10 scaled \mainmagstep} -\setfont\textsc{csc10 scaled \mainmagstep} -\font\texti=cmmi10 scaled \mainmagstep -\font\textsy=cmsy10 scaled \mainmagstep - -% A few fonts for @defun, etc. -\setfont\defbf{bx10 scaled \magstep1} %was 1314 -\setfont\deftt{tt10 scaled \magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} - -% Fonts for indices and small examples. -% We actually use the slanted font rather than the italic, -% because texinfo normally uses the slanted fonts for that. -% Do not make many font distinctions in general in the index, since they -% aren't very useful. -\setfont\ninett{tt9} -\setfont\indrm{r9} -\setfont\indit{sl9} -\let\indsl=\indit -\let\indtt=\ninett -\let\indsf=\indrm -\let\indbf=\indrm -\setfont\indsc{csc10 at 9pt} -\font\indi=cmmi9 -\font\indsy=cmsy9 - -% Fonts for headings -\setfont\chaprm{bx12 scaled \magstep2} -\setfont\chapit{ti12 scaled \magstep2} -\setfont\chapsl{sl12 scaled \magstep2} -\setfont\chaptt{tt12 scaled \magstep2} -\setfont\chapsf{ss12 scaled \magstep2} -\let\chapbf=\chaprm -\setfont\chapsc{csc10 scaled\magstep3} -\font\chapi=cmmi12 scaled \magstep2 -\font\chapsy=cmsy10 scaled \magstep3 - -\setfont\secrm{bx12 scaled \magstep1} -\setfont\secit{ti12 scaled \magstep1} -\setfont\secsl{sl12 scaled \magstep1} -\setfont\sectt{tt12 scaled \magstep1} -\setfont\secsf{ss12 scaled \magstep1} -\setfont\secbf{bx12 scaled \magstep1} -\setfont\secsc{csc10 scaled\magstep2} -\font\seci=cmmi12 scaled \magstep1 -\font\secsy=cmsy10 scaled \magstep2 - -% \setfont\ssecrm{bx10 scaled \magstep1} % This size an font looked bad. -% \setfont\ssecit{cmti10 scaled \magstep1} % The letters were too crowded. -% \setfont\ssecsl{sl10 scaled \magstep1} -% \setfont\ssectt{tt10 scaled \magstep1} -% \setfont\ssecsf{ss10 scaled \magstep1} - -%\setfont\ssecrm{b10 scaled 1315} % Note the use of cmb rather than cmbx. -%\setfont\ssecit{ti10 scaled 1315} % Also, the size is a little larger than -%\setfont\ssecsl{sl10 scaled 1315} % being scaled magstep1. -%\setfont\ssectt{tt10 scaled 1315} -%\setfont\ssecsf{ss10 scaled 1315} - -%\let\ssecbf=\ssecrm - -\setfont\ssecrm{bx12 scaled \magstephalf} -\setfont\ssecit{ti12 scaled \magstephalf} -\setfont\ssecsl{sl12 scaled \magstephalf} -\setfont\ssectt{tt12 scaled \magstephalf} -\setfont\ssecsf{ss12 scaled \magstephalf} -\setfont\ssecbf{bx12 scaled \magstephalf} -\setfont\ssecsc{csc10 scaled \magstep1} -\font\sseci=cmmi12 scaled \magstephalf -\font\ssecsy=cmsy10 scaled \magstep1 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. - -% Fonts for title page: -\setfont\titlerm{bx12 scaled \magstep3} -\let\authorrm = \secrm - -% In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts, we -% don't bother to reset \scriptfont and \scriptscriptfont (which would -% also require loading a lot more fonts). -% -\def\resetmathfonts{% - \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy - \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf - \textfont\ttfam = \tentt \textfont\sffam = \tensf -} - - -% The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current. Plain TeX does, for example, -% \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need -% to redefine \bf itself. -\def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy - \resetmathfonts} -\def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy - \resetmathfonts} -\def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy - \resetmathfonts} -\def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy - \resetmathfonts} -\def\indexfonts{% - \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl - \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy - \resetmathfonts} - -% Set up the default fonts, so we can use them for creating boxes. -% -\textfonts - -% Count depth in font-changes, for error checks -\newcount\fontdepth \fontdepth=0 - -% Fonts for short table of contents. -\setfont\shortcontrm{r12} -\setfont\shortcontbf{bx12} -\setfont\shortcontsl{sl12} - -%% Add scribe-like font environments, plus @l for inline lisp (usually sans -%% serif) and @ii for TeX italic - -% \smartitalic{ARG} outputs arg in italics, followed by an italic correction -% unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx} - -\let\i=\smartitalic -\let\var=\smartitalic -\let\dfn=\smartitalic -\let\emph=\smartitalic -\let\cite=\smartitalic - -\def\b#1{{\bf #1}} -\let\strong=\b - -% We can't just use \exhyphenpenalty, because that only has effect at -% the end of a paragraph. Restore normal hyphenation at the end of the -% group within which \nohyphenation is presumably called. -% -\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} -\def\restorehyphenation{\hyphenchar\font = `- } - -\def\t#1{% - {\tt \nohyphenation \rawbackslash \frenchspacing #1}% - \null -} -\let\ttfont = \t -%\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null} -\def\samp #1{`\tclose{#1}'\null} -\def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - -\let\file=\samp - -% @code is a modification of @t, -% which makes spaces the same size as normal in the surrounding text. -\def\tclose#1{% - {% - % Change normal interword space to be same as for the current font. - \spaceskip = \fontdimen2\font - % - % Switch to typewriter. - \tt - % - % But `\ ' produces the large typewriter interword space. - \def\ {{\spaceskip = 0pt{} }}% - % - % Turn off hyphenation. - \nohyphenation - % - \rawbackslash - \frenchspacing - #1% - }% - \null -} - -% We *must* turn on hyphenation at `-' and `_' in \code. -% Otherwise, it is too hard to avoid overful hboxes -% in the Emacs manual, the Library manual, etc. - -% Unfortunately, TeX uses one parameter (\hyphenchar) to control -% both hyphenation at - and hyphenation within words. -% We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate an a dash. -% -- rms. -{ -\catcode`\-=\active -\catcode`\_=\active -\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} -% The following is used by \doprintindex to insure that long function names -% wrap around. It is necessary for - and _ to be active before the index is -% read from the file, as \entry parses the arguments long before \code is -% ever called. -- mycroft -\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} -} -\def\realdash{-} -\def\realunder{_} -\def\codedash{-\discretionary{}{}{}} -\def\codeunder{\normalunderscore\discretionary{}{}{}} -\def\codex #1{\tclose{#1}\endgroup} - -%\let\exp=\tclose %Was temporary - -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. - -\def\xkey{\key} -\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% -\ifx\one\xkey\ifx\threex\three \key{#2}% -\else\tclose{\look}\fi -\else\tclose{\look}\fi} - -% Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of -% @dmn{}pt. -% -\def\dmn#1{\thinspace #1} - -\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} - -\def\l#1{{\li #1}\null} % - -\def\r#1{{\rm #1}} % roman font -% Use of \lowercase was suggested. -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font - -\message{page headings,} - -\newskip\titlepagetopglue \titlepagetopglue = 1.5in -\newskip\titlepagebottomglue \titlepagebottomglue = 2pc - -% First the title page. Must do @settitle before @titlepage. -\def\titlefont#1{{\titlerm #1}} - -\newif\ifseenauthor -\newif\iffinishedtitlepage - -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - \endgroup\page\hbox{}\page} - -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm -% I deinstalled the following change because \cmr12 is undefined. -% This change was not in the ChangeLog anyway. --rms. -% \let\subtitlerm=\cmr12 - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefont{##1}} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - \oldpage - \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} -} - -\def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - \HEADINGSon -} - -\def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue -} - -%%% Set up page headings and footings. - -\let\thispage=\folio - -\newtoks \evenheadline % Token sequence for heading line of even pages -\newtoks \oddheadline % Token sequence for heading line of odd pages -\newtoks \evenfootline % Token sequence for footing line of even pages -\newtoks \oddfootline % Token sequence for footing line of odd pages - -% Now make Tex use those variables -\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline - \else \the\evenheadline \fi}} -\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline - \else \the\evenfootline \fi}\HEADINGShook} -\let\HEADINGShook=\relax - -% Commands to set those variables. -% For example, this is what @headings on does -% @evenheading @thistitle|@thispage|@thischapter -% @oddheading @thischapter|@thispage|@thistitle -% @evenfooting @thisfile|| -% @oddfooting ||@thisfile - -\def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} - -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} - -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} -\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% -\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} -\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} -\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -% -}% unbind the catcode of @. - -% @headings double turns headings on for double-sided printing. -% @headings single turns headings on for single-sided printing. -% @headings off turns them off. -% @headings on same as @headings double, retained for compatibility. -% @headings after turns on double-sided headings after this page. -% @headings doubleafter turns on double-sided headings after this page. -% @headings singleafter turns on single-sided headings after this page. -% By default, they are off. - -\def\headings #1 {\csname HEADINGS#1\endcsname} - -\def\HEADINGSoff{ -\global\evenheadline={\hfil} \global\evenfootline={\hfil} -\global\oddheadline={\hfil} \global\oddfootline={\hfil}} -\HEADINGSoff -% When we turn headings on, set the page number to 1. -% For double-sided printing, put current file name in lower left corner, -% chapter name on inside top of right hand pages, document -% title on inside top of left hand pages, and page numbers on outside top -% edge of all pages. -\def\HEADINGSdouble{ -%\pagealignmacro -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} -% For single-sided printing, chapter title goes across top left of page, -% page number on top right. -\def\HEADINGSsingle{ -%\pagealignmacro -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} -\def\HEADINGSon{\HEADINGSdouble} - -\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} -\let\HEADINGSdoubleafter=\HEADINGSafter -\def\HEADINGSdoublex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} - -\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} -\def\HEADINGSsinglex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -} - -% Subroutines used in generating headings -% Produces Day Month Year style of output. -\def\today{\number\day\space -\ifcase\month\or -January\or February\or March\or April\or May\or June\or -July\or August\or September\or October\or November\or December\fi -\space\number\year} - -% Use this if you want the Month Day, Year style of output. -%\def\today{\ifcase\month\or -%January\or February\or March\or April\or May\or June\or -%July\or August\or September\or October\or November\or December\fi -%\space\number\day, \number\year} - -% @settitle line... specifies the title of the document, for headings -% It generates no output of its own - -\def\thistitle{No Title} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} - -\message{tables,} - -% @tabs -- simple alignment - -% These don't work. For one thing, \+ is defined as outer. -% So these macros cannot even be defined. - -%\def\tabs{\parsearg\tabszzz} -%\def\tabszzz #1{\settabs\+#1\cr} -%\def\tabline{\parsearg\tablinezzz} -%\def\tablinezzz #1{\+#1\cr} -%\def\&{&} - -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). - -% default indentation of table text -\newdimen\tableindent \tableindent=.8in -% default indentation of @itemize and @enumerate text -\newdimen\itemindent \itemindent=.3in -% margin between end of table item and start of table text. -\newdimen\itemmargin \itemmargin=.1in - -% used internally for \itemindent minus \itemmargin -\newdimen\itemmax - -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with -% these defs. -% They also define \itemindex -% to index the item name in whatever manner is desired (perhaps none). - -\newif\ifitemxneedsnegativevskip - -\def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} - -\def\internalBitem{\smallbreak \parsearg\itemzzz} -\def\internalBitemx{\itemxpar \parsearg\itemzzz} - -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - -\def\itemzzz #1{\begingroup % - \advance\hsize by -\rightskip - \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% - \itemindex{#1}% - \nobreak % This prevents a break before @itemx. - % - % Be sure we are not still in the middle of a paragraph. - %{\parskip = 0in - %\par - %}% - % - % If the item text does not fit in the space we have, put it on a line - % by itself, and do not allow a page break either before or after that - % line. We do not start a paragraph here because then if the next - % command is, e.g., @kindex, the whatsit would get put into the - % horizontal list on a line by itself, resulting in extra blank space. - \ifdim \wd0>\itemmax - % - % Make this a paragraph so we get the \parskip glue and wrapping, - % but leave it ragged-right. - \begingroup - \advance\leftskip by-\tableindent - \advance\hsize by\tableindent - \advance\rightskip by0pt plus1fil - \leavevmode\unhbox0\par - \endgroup - % - % We're going to be starting a paragraph, but we don't want the - % \parskip glue -- logically it's part of the @item we just started. - \nobreak \vskip-\parskip - % - % Stop a page break at the \parskip glue coming up. Unfortunately - % we can't prevent a possible page break at the following - % \baselineskip glue. - \nobreak - \endgroup - \itemxneedsnegativevskipfalse - \else - % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. Since that - % text will be indented by \tableindent, we make the item text be in - % a zero-width box. - \noindent - \rlap{\hskip -\tableindent\box0}\ignorespaces% - \endgroup% - \itemxneedsnegativevskiptrue% - \fi -} - -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -%% Contains a kludge to get @end[description] to work -\def\description{\tablez{\dontindex}{1}{}{}{}{}} - -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Neccessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % -} - -% This is the counter used by @enumerate, which is really @itemize - -\newcount \itemno - -\def\itemize{\parsearg\itemizezzz} - -\def\itemizezzz #1{% - \begingroup % ended by the @end itemsize - \itemizey {#1}{\Eitemize} -} - -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} - -% Set sfcode to normal for the chars that usually have another value. -% These are `.?!:;,' -\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 - \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } - -% \splitoff TOKENS\endmark defines \first to be the first token in -% TOKENS, and \rest to be the remainder. -% -\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% - -% Allow an optional argument of an uppercase letter, lowercase letter, -% or number, to specify the first label in the enumerated list. No -% argument is the same as `1'. -% -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} -\def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % - % If we were given no argument, pretend we were given `1'. - \def\thearg{#1}% - \ifx\thearg\empty \def\thearg{1}\fi - % - % Detect if the argument is a single token. If so, it might be a - % letter. Otherwise, the only valid thing it can be is a number. - % (We will always have one token, because of the test we just made. - % This is a good thing, since \splitoff doesn't work given nothing at - % all -- the first parameter is undelimited.) - \expandafter\splitoff\thearg\endmark - \ifx\rest\empty - % Only one token in the argument. It could still be anything. - % A ``lowercase letter'' is one whose \lccode is nonzero. - % An ``uppercase letter'' is one whose \lccode is both nonzero, and - % not equal to itself. - % Otherwise, we assume it's a number. - % - % We need the \relax at the end of the \ifnum lines to stop TeX from - % continuing to look for a . - % - \ifnum\lccode\expandafter`\thearg=0\relax - \numericenumerate % a number (we hope) - \else - % It's a letter. - \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax - \lowercaseenumerate % lowercase letter - \else - \uppercaseenumerate % uppercase letter - \fi - \fi - \else - % Multiple tokens in the argument. We hope it's a number. - \numericenumerate - \fi -} - -% An @enumerate whose labels are integers. The starting integer is -% given in \thearg. -% -\def\numericenumerate{% - \itemno = \thearg - \startenumeration{\the\itemno}% -} - -% The starting (lowercase) letter is in \thearg. -\def\lowercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more lowercase letters in @enumerate; get a bigger - alphabet}% - \fi - \char\lccode\itemno - }% -} - -% The starting (uppercase) letter is in \thearg. -\def\uppercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more uppercase letters in @enumerate; get a bigger - alphabet} - \fi - \char\uccode\itemno - }% -} - -% Call itemizey, adding a period to the first argument and supplying the -% common last two arguments. Also subtract one from the initial value in -% \itemno, since @item increments \itemno. -% -\def\startenumeration#1{% - \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr -} - -% @alphaenumerate and @capsenumerate are abbreviations for giving an arg -% to @enumerate. -% -\def\alphaenumerate{\enumerate{a}} -\def\capsenumerate{\enumerate{A}} -\def\Ealphaenumerate{\Eenumerate} -\def\Ecapsenumerate{\Eenumerate} - -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{\in hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} - -% @multitable macros -% Amy Hendrickson, 8/18/94 -% -% @multitable ... @endmultitable will make as many columns as desired. -% Contents of each column will wrap at width given in preamble. Width -% can be specified either with sample text given in a template line, -% or in percent of \hsize, the current width of text on page. - -% Table can continue over pages but will only break between lines. - -% To make preamble: -% -% Either define widths of columns in terms of percent of \hsize: -% @multitable @percentofhsize .2 .3 .5 -% @item ... -% -% Numbers following @percentofhsize are the percent of the total -% current hsize to be used for each column. You may use as many -% columns as desired. - -% Or use a template: -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item ... -% using the widest term desired in each column. - - -% Each new table line starts with @item, each subsequent new column -% starts with @tab. Empty columns may be produced by supplying @tab's -% with nothing between them for as many times as empty columns are needed, -% ie, @tab@tab@tab will produce two empty columns. - -% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their -% own lines, but it will not hurt if they are. - -% Sample multitable: - -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item first col stuff @tab second col stuff @tab third col -% @item -% first col stuff -% @tab -% second col stuff -% @tab -% third col -% @item first col stuff @tab second col stuff -% @tab Many paragraphs of text may be used in any column. -% -% They will wrap at the width determined by the template. -% @item@tab@tab This will be in third column. -% @endmultitable - -% Default dimensions may be reset by user. -% @intableparskip will set vertical space between paragraphs in table. -% @intableparindent will set paragraph indent in table. -% @spacebetweencols will set horizontal space to be left between columns. -% @spacebetweenlines will set vertical space to be left between lines. - -%%%% -% Dimensions - -\newdimen\intableparskip -\newdimen\intableparindent -\newdimen\spacebetweencols -\newdimen\spacebetweenlines -\intableparskip=0pt -\intableparindent=6pt -\spacebetweencols=12pt -\spacebetweenlines=12pt - -%%%% -% Macros used to set up halign preamble: -\let\endsetuptable\relax -\def\xendsetuptable{\endsetuptable} -\let\percentofhsize\relax -\def\xpercentofhsize{\percentofhsize} -\newif\ifsetpercent - -\newcount\colcount -\def\setuptable#1{\def\firstarg{#1}% -\ifx\firstarg\xendsetuptable\let\go\relax% -\else - \ifx\firstarg\xpercentofhsize\global\setpercenttrue% - \else - \ifsetpercent - \if#1.\else% - \global\advance\colcount by1 % - \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% - \fi - \else - \global\advance\colcount by1 - \setbox0=\hbox{#1}% - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi% - \fi% - \let\go\setuptable% -\fi\go} -%%%% -% multitable syntax -\def\tab{&} - -%%%% -% @multitable ... @endmultitable definitions: - -\def\multitable#1\item{\bgroup -\let\item\cr -\tolerance=9500 -\hbadness=9500 -\parskip=\intableparskip -\parindent=\intableparindent -\overfullrule=0pt -\global\colcount=0\relax% -\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% - % To parse everything between @multitable and @item : -\def\one{#1}\expandafter\setuptable\one\endsetuptable - % Need to reset this to 0 after \setuptable. -\global\colcount=0\relax% - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. -\halign\bgroup&\global\advance\colcount by 1\relax% -\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % In order to keep entries from bumping into each other - % we will add a \leftskip of \spacebetweencols to all columns after - % the first one. - % If a template has been used, we will add \spacebetweencols - % to the width of each template entry. - % If user has set preamble in terms of percent of \hsize - % we will use that dimension as the width of the column, and - % the \leftskip will keep entries from bumping into each other. - % Table will start at left margin and final column will justify at - % right margin. -\ifnum\colcount=1 -\else - \ifsetpercent - \else - % If user has set preamble in terms of percent of \hsize - % we will advance \hsize by \spacebetweencols - \advance\hsize by \spacebetweencols - \fi - % In either case we will make \leftskip=\spacebetweencols: -\leftskip=\spacebetweencols -\fi -\noindent##}\cr% - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. -\global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines -\filbreak%% keeps underfull box messages off when table breaks over pages. -\global\colcount=0\relax}}} - -\message{indexing,} -% Index generation facilities - -% Define \newwrite to be identical to plain tex's \newwrite -% except not \outer, so it can be used within \newindex. -{\catcode`\@=11 -\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} - -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. -% The name of an index should be no more than 2 characters long -% for the sake of vms. - -\def\newindex #1{ -\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\doindex {#1}} -} - -% @defindex foo == \newindex{foo} - -\def\defindex{\parsearg\newindex} - -% Define @defcodeindex, like @defindex except put all entries in @code. - -\def\newcodeindex #1{ -\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\docodeindex {#1}} -} - -\def\defcodeindex{\parsearg\newcodeindex} - -% @synindex foo bar makes index foo feed into index bar. -% Do this instead of @defindex foo if you don't want it as a separate index. -\def\synindex #1 #2 {% -\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname -\expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\doindex {#2}}% -} - -% @syncodeindex foo bar similar, but put all entries made for index foo -% inside @code. -\def\syncodeindex #1 #2 {% -\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname -\expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex -\noexpand\docodeindex {#2}}% -} - -% Define \doindex, the driver for all \fooindex macros. -% Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. - -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. - -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} - -% like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} - -\def\indexdummies{% -% Take care of the plain tex accent commands. -\def\"{\realbackslash "}% -\def\`{\realbackslash `}% -\def\'{\realbackslash '}% -\def\^{\realbackslash ^}% -\def\~{\realbackslash ~}% -\def\={\realbackslash =}% -\def\b{\realbackslash b}% -\def\c{\realbackslash c}% -\def\d{\realbackslash d}% -\def\u{\realbackslash u}% -\def\v{\realbackslash v}% -\def\H{\realbackslash H}% -% Take care of the plain tex special European modified letters. -\def\oe{\realbackslash oe}% -\def\ae{\realbackslash ae}% -\def\aa{\realbackslash aa}% -\def\OE{\realbackslash OE}% -\def\AE{\realbackslash AE}% -\def\AA{\realbackslash AA}% -\def\o{\realbackslash o}% -\def\O{\realbackslash O}% -\def\l{\realbackslash l}% -\def\L{\realbackslash L}% -\def\ss{\realbackslash ss}% -% Take care of texinfo commands likely to appear in an index entry. -\def\_{{\realbackslash _}}% -\def\w{\realbackslash w }% -\def\bf{\realbackslash bf }% -\def\rm{\realbackslash rm }% -\def\sl{\realbackslash sl }% -\def\sf{\realbackslash sf}% -\def\tt{\realbackslash tt}% -\def\gtr{\realbackslash gtr}% -\def\less{\realbackslash less}% -\def\hat{\realbackslash hat}% -\def\char{\realbackslash char}% -\def\TeX{\realbackslash TeX}% -\def\dots{\realbackslash dots }% -\def\copyright{\realbackslash copyright }% -\def\tclose##1{\realbackslash tclose {##1}}% -\def\code##1{\realbackslash code {##1}}% -\def\samp##1{\realbackslash samp {##1}}% -\def\t##1{\realbackslash r {##1}}% -\def\r##1{\realbackslash r {##1}}% -\def\i##1{\realbackslash i {##1}}% -\def\b##1{\realbackslash b {##1}}% -\def\cite##1{\realbackslash cite {##1}}% -\def\key##1{\realbackslash key {##1}}% -\def\file##1{\realbackslash file {##1}}% -\def\var##1{\realbackslash var {##1}}% -\def\kbd##1{\realbackslash kbd {##1}}% -\def\dfn##1{\realbackslash dfn {##1}}% -\def\emph##1{\realbackslash emph {##1}}% -} - -% \indexnofonts no-ops all font-change commands. -% This is used when outputting the strings to sort the index by. -\def\indexdummyfont#1{#1} -\def\indexdummytex{TeX} -\def\indexdummydots{...} - -\def\indexnofonts{% -% Just ignore accents. -\let\"=\indexdummyfont -\let\`=\indexdummyfont -\let\'=\indexdummyfont -\let\^=\indexdummyfont -\let\~=\indexdummyfont -\let\==\indexdummyfont -\let\b=\indexdummyfont -\let\c=\indexdummyfont -\let\d=\indexdummyfont -\let\u=\indexdummyfont -\let\v=\indexdummyfont -\let\H=\indexdummyfont -% Take care of the plain tex special European modified letters. -\def\oe{oe}% -\def\ae{ae}% -\def\aa{aa}% -\def\OE{OE}% -\def\AE{AE}% -\def\AA{AA}% -\def\o{o}% -\def\O{O}% -\def\l{l}% -\def\L{L}% -\def\ss{ss}% -\let\w=\indexdummyfont -\let\t=\indexdummyfont -\let\r=\indexdummyfont -\let\i=\indexdummyfont -\let\b=\indexdummyfont -\let\emph=\indexdummyfont -\let\strong=\indexdummyfont -\let\cite=\indexdummyfont -\let\sc=\indexdummyfont -%Don't no-op \tt, since it isn't a user-level command -% and is used in the definitions of the active chars like <, >, |... -%\let\tt=\indexdummyfont -\let\tclose=\indexdummyfont -\let\code=\indexdummyfont -\let\file=\indexdummyfont -\let\samp=\indexdummyfont -\let\kbd=\indexdummyfont -\let\key=\indexdummyfont -\let\var=\indexdummyfont -\let\TeX=\indexdummytex -\let\dots=\indexdummydots -} - -% To define \realbackslash, we must make \ not be an escape. -% We must first make another character (@) an escape -% so we do not become unable to do a definition. - -{\catcode`\@=0 \catcode`\\=\other -@gdef@realbackslash{\}} - -\let\indexbackslash=0 %overridden during \printindex. - -\let\SETmarginindex=\relax %initialize! -% workhorse for all \fooindexes -% #1 is name of index, #2 is stuff to put there -\def\doind #1#2{% -% Put the index entry in the margin if desired. -\ifx\SETmarginindex\relax\else% -\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% -\fi% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% Expand all macros now EXCEPT \folio -\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now -% so it will be output as is; and it will print as backslash in the indx. -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}}}% -\temp }% -}\penalty\count10}} - -\def\dosubind #1#2#3{% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% -\def\rawbackslashxx{\indexbackslash}% -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2 #3}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}{#3}}}% -\temp }% -}\penalty\count10}} - -% The index entry written in the file actually looks like -% \entry {sortstring}{page}{topic} -% or -% \entry {sortstring}{page}{topic}{subtopic} -% The texindex program reads in these files and writes files -% containing these kinds of lines: -% \initial {c} -% before the first topic whose initial is c -% \entry {topic}{pagelist} -% for a topic that is used without subtopics -% \primary {topic} -% for the beginning of a topic that is used with subtopics -% \secondary {subtopic}{pagelist} -% for each subtopic. - -% Define the user-accessible indexing commands -% @findex, @vindex, @kindex, @cindex. - -\def\findex {\fnindex} -\def\kindex {\kyindex} -\def\cindex {\cpindex} -\def\vindex {\vrindex} -\def\tindex {\tpindex} -\def\pindex {\pgindex} - -\def\cindexsub {\begingroup\obeylines\cindexsub} -{\obeylines % -\gdef\cindexsub "#1" #2^^M{\endgroup % -\dosubind{cp}{#2}{#1}}} - -% Define the macros used in formatting output of the sorted index material. - -% This is what you call to cause a particular index to get printed. -% Write -% @unnumbered Function Index -% @printindex fn - -\def\printindex{\parsearg\doprintindex} - -\def\doprintindex#1{% - \tex - \dobreak \chapheadingskip {10000} - \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other - \catcode`\$=\other - \catcode`\~=\other - \indexbreaks - % - % The following don't help, since the chars were translated - % when the raw index was written, and their fonts were discarded - % due to \indexnofonts. - %\catcode`\"=\active - %\catcode`\^=\active - %\catcode`\_=\active - %\catcode`\|=\active - %\catcode`\<=\active - %\catcode`\>=\active - % % - \def\indexbackslash{\rawbackslashxx} - \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt - \begindoublecolumns - % - % See if the index file exists and is nonempty. - \openin 1 \jobname.#1s - \ifeof 1 - % \enddoublecolumns gets confused if there is no text in the index, - % and it loses the chapter title and the aux file entries for the - % index. The easiest way to prevent this problem is to make sure - % there is some text. - (Index is nonexistent) - \else - % - % If the index file exists but is empty, then \openin leaves \ifeof - % false. We have to make TeX try to read something from the file, so - % it can discover if there is anything in it. - \read 1 to \temp - \ifeof 1 - (Index is empty) - \else - \input \jobname.#1s - \fi - \fi - \closein 1 - \enddoublecolumns - \Etex -} - -% These macros are used by the sorted index file itself. -% Change them to control the appearance of the index. - -% Same as \bigskipamount except no shrink. -% \balancecolumns gets confused if there is any shrink. -\newskip\initialskipamount \initialskipamount 12pt plus4pt - -\def\initial #1{% -{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt -\ifdim\lastskip<\initialskipamount -\removelastskip \penalty-200 \vskip \initialskipamount\fi -\line{\secbf#1\hfill}\kern 2pt\penalty10000}} - -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. -% -\def\entry #1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent=2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kluged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% - % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. - % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ #2% The page number ends the paragraph. - \fi% - \par -\endgroup} - -% Like \dotfill except takes at least 1 em. -\def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} - -\def\primary #1{\line{#1\hfil}} - -\newskip\secondaryindent \secondaryindent=0.5cm - -\def\secondary #1#2{ -{\parfillskip=0in \parskip=0in -\hangindent =1in \hangafter=1 -\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par -}} - -%% Define two-column mode, which is used in indexes. -%% Adapted from the TeXbook, page 416. -\catcode `\@=11 - -\newbox\partialpage - -\newdimen\doublecolumnhsize - -\def\begindoublecolumns{\begingroup - % Grab any single-column material above us. - \output = {\global\setbox\partialpage - =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% - \eject - % - % Now switch to the double-column output routine. - \output={\doublecolumnout}% - % - % Change the page size parameters. We could do this once outside this - % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 - % format, but then we repeat the same computation. Repeating a couple - % of assignments once per index is clearly meaningless for the - % execution time, so we may as well do it once. - % - % First we halve the line length, less a little for the gutter between - % the columns. We compute the gutter based on the line length, so it - % changes automatically with the paper format. The magic constant - % below is chosen so that the gutter has the same value (well, +- < - % 1pt) as it did when we hard-coded it. - % - % We put the result in a separate register, \doublecolumhsize, so we - % can restore it in \pagesofar, after \hsize itself has (potentially) - % been clobbered. - % - \doublecolumnhsize = \hsize - \advance\doublecolumnhsize by -.04154\hsize - \divide\doublecolumnhsize by 2 - \hsize = \doublecolumnhsize - % - % Double the \vsize as well. (We don't need a separate register here, - % since nobody clobbers \vsize.) - \vsize = 2\vsize - \doublecolumnpagegoal -} - -\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} - -\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth - \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage - \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} - \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} - \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi - \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi -} -\def\doublecolumnpagegoal{% - \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ -} -\def\pagesofar{\unvbox\partialpage % - \hsize=\doublecolumnhsize % have to restore this since output routine - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} -\def\doublecolumnout{% - \setbox5=\copy255 - {\vbadness=10000 \doublecolumnsplit} - \ifvbox255 - \setbox0=\vtop to\dimen@{\unvbox0} - \setbox2=\vtop to\dimen@{\unvbox2} - \onepageout\pagesofar \unvbox255 \penalty\outputpenalty - \else - \setbox0=\vbox{\unvbox5} - \ifvbox0 - \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth - {\vbadness=10000 - \loop \global\setbox5=\copy0 - \setbox1=\vsplit5 to\dimen@ - \setbox3=\vsplit5 to\dimen@ - \ifvbox5 \global\advance\dimen@ by1pt \repeat - \setbox0=\vbox to\dimen@{\unvbox1} - \setbox2=\vbox to\dimen@{\unvbox3} - \global\setbox\partialpage=\vbox{\pagesofar} - \doublecolumnpagegoal - } - \fi - \fi -} - -\catcode `\@=\other -\message{sectioning,} -% Define chapters, sections, etc. - -\newcount \chapno -\newcount \secno \secno=0 -\newcount \subsecno \subsecno=0 -\newcount \subsubsecno \subsubsecno=0 - -% This counter is funny since it counts through charcodes of letters A, B, ... -\newcount \appendixno \appendixno = `\@ -\def\appendixletter{\char\the\appendixno} - -\newwrite \contentsfile -% This is called from \setfilename. -\def\opencontents{\openout \contentsfile = \jobname.toc} - -% Each @chapter defines this as the name of the chapter. -% page headings and footings can use it. @section does likewise - -\def\thischapter{} \def\thissection{} -\def\seccheck#1{\if \pageno<0 % -\errmessage{@#1 not allowed after generating table of contents}\fi -% -} - -\def\chapternofonts{% -\let\rawbackslash=\relax% -\let\frenchspacing=\relax% -\def\result{\realbackslash result} -\def\equiv{\realbackslash equiv} -\def\expansion{\realbackslash expansion} -\def\print{\realbackslash print} -\def\TeX{\realbackslash TeX} -\def\dots{\realbackslash dots} -\def\copyright{\realbackslash copyright} -\def\tt{\realbackslash tt} -\def\bf{\realbackslash bf } -\def\w{\realbackslash w} -\def\less{\realbackslash less} -\def\gtr{\realbackslash gtr} -\def\hat{\realbackslash hat} -\def\char{\realbackslash char} -\def\tclose##1{\realbackslash tclose {##1}} -\def\code##1{\realbackslash code {##1}} -\def\samp##1{\realbackslash samp {##1}} -\def\r##1{\realbackslash r {##1}} -\def\b##1{\realbackslash b {##1}} -\def\key##1{\realbackslash key {##1}} -\def\file##1{\realbackslash file {##1}} -\def\kbd##1{\realbackslash kbd {##1}} -% These are redefined because @smartitalic wouldn't work inside xdef. -\def\i##1{\realbackslash i {##1}} -\def\cite##1{\realbackslash cite {##1}} -\def\var##1{\realbackslash var {##1}} -\def\emph##1{\realbackslash emph {##1}} -\def\dfn##1{\realbackslash dfn {##1}} -} - -\newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raise/lowersections modify this count - -% @raisesections: treat @section as chapter, @subsection as section, etc. -\def\raisesections{\global\advance\secbase by -1} -\let\up=\raisesections % original BFox name - -% @lowersections: treat @chapter as section, @section as subsection, etc. -\def\lowersections{\global\advance\secbase by 1} -\let\down=\lowersections % original BFox name - -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} - \else - \numberedsubsubseczzz{#2} - \fi -\fi -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} - \else - \appendixsubsubseczzz{#2} - \fi -\fi -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} - \else - \unnumberedsubsubseczzz{#2} - \fi -\fi -} - - -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{\seccheck{chapter}% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}% -\chapmacro {#1}{\the\chapno}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -% We don't substitute the actual chapter name into \thischapter -% because we don't want its macros evaluated now. -\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -{\chapternofonts% -\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec -}} - -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{\seccheck{appendix}% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 \message{Appendix \appendixletter}% -\chapmacro {#1}{\putwordAppendix{} \appendixletter}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -{\chapternofonts% -\edef\temp{{\realbackslash chapentry - {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\global\let\section = \appendixsec -\global\let\subsection = \appendixsubsec -\global\let\subsubsection = \appendixsubsubsec -}} - -\outer\def\top{\parsearg\unnumberedyyy} -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{\seccheck{unnumbered}% -\secno=0 \subsecno=0 \subsubsecno=0 -% -% This used to be simply \message{#1}, but TeX fully expands the -% argument to \message. Therefore, if #1 contained @-commands, TeX -% expanded them. For example, in `@unnumbered The @cite{Book}', TeX -% expanded @cite (which turns out to cause errors because \cite is meant -% to be executed, not expanded). -% -% Anyway, we don't want the fully-expanded definition of @cite to appear -% as a result of the \message, we just want `@cite' itself. We use -% \the to achieve this: TeX expands \the only once, -% simply yielding the contents of the . -\toks0 = {#1}\message{(\the\toks0)}% -% -\unnumbchapmacro {#1}% -\gdef\thischapter{#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\global\let\section = \unnumberedsec -\global\let\subsection = \unnumberedsubsec -\global\let\subsubsection = \unnumberedsubsubsec -}} - -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{\seccheck{section}% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% -{\chapternofonts% -\edef\temp{{\realbackslash secentry % -{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} - -\outer\def\appenixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{\seccheck{appendixsection}% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -{\chapternofonts% -\edef\temp{{\realbackslash secentry % -{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{\seccheck{unnumberedsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} - -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{\seccheck{subsection}% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsecentry % -{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{\seccheck{appendixsubsec}% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsecentry % -{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} - -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{\seccheck{subsubsection}% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry % - {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} - {\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\donoderef % -\penalty 10000 % -}} - -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -{\chapternofonts% -\edef\temp{{\realbackslash subsubsecentry{#1}% - {\appendixletter} - {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\appendixnoderef % -\penalty 10000 % -}} - -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% -{\chapternofonts% -\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% -\escapechar=`\\% -\write \contentsfile \temp % -\unnumbnoderef % -\penalty 10000 % -}} - -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} - -% These macros control what the section commands do, according -% to what kind of chapter we are in (ordinary, appendix, or unnumbered). -% Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec - -% Define @majorheading, @heading and @subheading - -% NOTE on use of \vbox for chapter headings, section headings, and -% such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. -% 3) Likewise, headings look best if no \parindent is used, and -% if justification is not attempted. Hence \raggedright. - - -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% -{\advance\chapheadingskip by 10pt \chapbreak }% -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} - -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} - -\def\heading{\parsearg\secheadingi} - -\def\subheading{\parsearg\subsecheadingi} - -\def\subsubheading{\parsearg\subsubsecheadingi} - -% These macros generate a chapter, section, etc. heading only -% (including whitespace, linebreaking, etc. around it), -% given all the information in convenient, parsed form. - -%%% Args are the skip and penalty (usually negative) -\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} - -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - -%%% Define plain chapter starts, and page on/off switching for it -% Parameter controlling skip before chapter headings (if needed) - -\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt - -\def\chapbreak{\dobreak \chapheadingskip {-4000}} -\def\chappager{\par\vfill\supereject} -\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} - -\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} - -\def\CHAPPAGoff{ -\global\let\pchapsepmacro=\chapbreak -\global\let\pagealignmacro=\chappager} - -\def\CHAPPAGon{ -\global\let\pchapsepmacro=\chappager -\global\let\pagealignmacro=\chappager -\global\def\HEADINGSon{\HEADINGSsingle}} - -\def\CHAPPAGodd{ -\global\let\pchapsepmacro=\chapoddpage -\global\let\pagealignmacro=\chapoddpage -\global\def\HEADINGSon{\HEADINGSdouble}} - -\CHAPPAGon - -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain} - -\def\chfplain #1#2{% - \pchapsepmacro - {% - \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #2\enspace #1}% - }% - \bigskip - \penalty5000 -} - -\def\unnchfplain #1{% -\pchapsepmacro % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} -\CHAPFplain % The default - -\def\unnchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} - -\def\chfopen #1#2{\chapoddpage {\chapfonts -\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% -\par\penalty 5000 % -} - -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen} - -% Parameter controlling skip before section headings. - -\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} - -\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} - -% @paragraphindent is defined for the Info formatting commands only. -\let\paragraphindent=\comment - -% Section fonts are the base font at magstep2, which produces -% a size a bit more than 14 points in the default situation. - -\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} -\def\plainsecheading #1{\secheadingi {#1}} -\def\secheadingi #1{{\advance \secheadingskip by \parskip % -\secheadingbreak}% -{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - - -% Subsection fonts are the base font at magstep1, -% which produces a size of 12 points. - -\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} -\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - -\def\subsubsecfonts{\subsecfonts} % Maybe this should change: - % Perhaps make sssec fonts scaled - % magstep half -\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} -\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} - - -\message{toc printing,} - -% Finish up the main text and prepare to read what we've written -% to \contentsfile. - -\newskip\contentsrightmargin \contentsrightmargin=1in -\def\startcontents#1{% - \pagealignmacro - \immediate\closeout \contentsfile - \ifnum \pageno>0 - \pageno = -1 % Request roman numbered pages. - \fi - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. -} - - -% Normal (long) toc. -\outer\def\contents{% - \startcontents{\putwordTableofContents}% - \input \jobname.toc - \endgroup - \vfill \eject -} - -% And just the chapters. -\outer\def\summarycontents{% - \startcontents{\putwordShortContents}% - % - \let\chapentry = \shortchapentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl - \rm - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\unnumbsecentry ##1##2{} - \def\subsecentry ##1##2##3##4##5{} - \def\unnumbsubsecentry ##1##2{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \def\unnumbsubsubsecentry ##1##2{} - \input \jobname.toc - \endgroup - \vfill \eject -} -\let\shortcontents = \summarycontents - -% These macros generate individual entries in the table of contents. -% The first argument is the chapter or section name. -% The last argument is the page number. -% The arguments in between are the chapter number, section number, ... - -% Chapter-level things, for both the long and short contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} - -% See comments in \dochapentry re vbox and related settings -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% -} - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. -\setbox0 = \hbox{\shortcontrm \putwordAppendix } -\newdimen\shortappendixwidth \shortappendixwidth = \wd0 - -\def\shortchaplabel#1{% - % We typeset #1 in a box of constant width, regardless of the text of - % #1, so the chapter titles will come out aligned. - \setbox0 = \hbox{#1}% - \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi - % - % This space should be plenty, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in in \shortchapentry above.) - \advance\dimen0 by 1.1em - \hbox to \dimen0{#1\hfil}% -} - -\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} -\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} - -% Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} - -% Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} - -% And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} - - -% This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc - -% Now for the actual typesetting. In all these, #1 is the text and #2 is the -% page number. -% -% If the toc has to be broken over pages, we would want to be at chapters -% if at all possible; hence the \penalty. -\def\dochapentry#1#2{% - \penalty-300 \vskip\baselineskip - \begingroup - \chapentryfonts - \tocentry{#1}{\dopageno{#2}}% - \endgroup - \nobreak\vskip .25\baselineskip -} - -\def\dosecentry#1#2{\begingroup - \secentryfonts \leftskip=\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -\def\dosubsecentry#1#2{\begingroup - \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -\def\dosubsubsecentry#1#2{\begingroup - \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{\dopageno{#2}}% -\endgroup} - -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -% -\def\tocentry#1#2{\begingroup - \hyphenpenalty = 10000 - \entry{#1}{#2}% -\endgroup} - -% Space between chapter (or whatever) number and the title. -\def\labelspace{\hskip1em \relax} - -\def\dopageno#1{{\rm #1}} -\def\doshortpageno#1{{\rm #1}} - -\def\chapentryfonts{\secfonts \rm} -\def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts - - -\message{environments,} - -% Since these characters are used in examples, it should be an even number of -% \tt widths. Each \tt character is 1en, so two makes it 1em. -% Furthermore, these definitions must come after we define our fonts. -\newbox\dblarrowbox \newbox\longdblarrowbox -\newbox\pushcharbox \newbox\bullbox -\newbox\equivbox \newbox\errorbox - -\let\ptexequiv = \equiv - -%{\tentt -%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} -%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} -%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} -%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} -% Adapted from the manmac format (p.420 of TeXbook) -%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex -% depth .1ex\hfil} -%} - -\def\point{$\star$} - -\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} -\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} - -\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} - -% Adapted from the TeXbook's \boxit. -{\tentt \global\dimen0 = 3em}% Width of the box. -\dimen2 = .55pt % Thickness of rules -% The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} - -\global\setbox\errorbox=\hbox to \dimen0{\hfil - \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. - \advance\hsize by -2\dimen2 % Rules. - \vbox{ - \hrule height\dimen2 - \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. - \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. - \kern3pt\vrule width\dimen2}% Space to right. - \hrule height\dimen2} - \hfil} - -% The @error{} command. -\def\error{\leavevmode\lower.7ex\copy\errorbox} - -% @tex ... @end tex escapes into raw Tex temporarily. -% One exception: @ is still an escape character, so that @end tex works. -% But \@ or @@ will get a plain tex @ character. - -\def\tex{\begingroup -\catcode `\\=0 \catcode `\{=1 \catcode `\}=2 -\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 -\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie -\catcode `\%=14 -\catcode 43=12 -\catcode`\"=12 -\catcode`\==12 -\catcode`\|=12 -\catcode`\<=12 -\catcode`\>=12 -\escapechar=`\\ -% -\let\~=\ptextilde -\let\{=\ptexlbrace -\let\}=\ptexrbrace -\let\.=\ptexdot -\let\*=\ptexstar -\let\dots=\ptexdots -\def\@{@}% -\let\bullet=\ptexbullet -\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl -\let\L=\ptexL -% -\let\Etex=\endgroup} - -% Define @lisp ... @endlisp. -% @lisp does a \begingroup so it can rebind things, -% including the definition of @endlisp (which normally is erroneous). - -% Amount to narrow the margins by for @lisp. -\newskip\lispnarrowing \lispnarrowing=0.4in - -% This is the definition that ^^M gets inside @lisp, @example, and other -% such environments. \null is better than a space, since it doesn't -% have any width. -\def\lisppar{\null\endgraf} - -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - -% This space is always present above and below environments. -\newskip\envskipamount \envskipamount = 0pt - -% Make spacing and below environment symmetrical. We use \parskip here -% to help in doing that, since in @example-like environments \parskip -% is reset to zero; thus the \afterenvbreak inserts no space -- but the -% start of the next paragraph will insert \parskip -% -\def\aboveenvbreak{{\advance\envskipamount by \parskip -\endgraf \ifdim\lastskip<\envskipamount -\removelastskip \penalty-50 \vskip\envskipamount \fi}} - -\let\afterenvbreak = \aboveenvbreak - -% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. -\let\nonarrowing=\relax - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \cartouche: draw rectangle w/rounded corners around argument -\font\circle=lcircle10 -\newdimen\circthick -\newdimen\cartouter\newdimen\cartinner -\newskip\normbskip\newskip\normpskip\newskip\normlskip -\circthick=\fontdimen8\circle -% -\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth -\def\ctr{{\hskip 6pt\circle\char'010}} -\def\cbl{{\circle\char'012\hskip -6pt}} -\def\cbr{{\hskip 6pt\circle\char'011}} -\def\carttop{\hbox to \cartouter{\hskip\lskip - \ctl\leaders\hrule height\circthick\hfil\ctr - \hskip\rskip}} -\def\cartbot{\hbox to \cartouter{\hskip\lskip - \cbl\leaders\hrule height\circthick\hfil\cbr - \hskip\rskip}} -% -\newskip\lskip\newskip\rskip - -\long\def\cartouche{% -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip -\def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} - - -% This macro is called at the beginning of all the @example variants, -% inside a group. -\def\nonfillstart{% - \aboveenvbreak - \inENV % This group ends at the end of the body - \hfuzz = 12pt % Don't be fussy - \sepspaces % Make spaces be word-separators rather than space tokens. - \singlespace - \let\par = \lisppar % don't ignore blank lines - \obeylines % each line of input is a line of output - \parskip = 0pt - \parindent = 0pt - \emergencystretch = 0pt % don't try to avoid overfull boxes - % @cartouche defines \nonarrowing to inhibit narrowing - % at next level down. - \ifx\nonarrowing\relax - \advance \leftskip by \lispnarrowing - \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax - \fi -} - -% To ending an @example-like environment, we first end the paragraph -% (via \afterenvbreak's vertical glue), and then the group. That way we -% keep the zero \parskip that the environments set -- \parskip glue -% will be inserted at the beginning of the next paragraph in the -% document, after the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup}% - -% This macro is -\def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - \rawbackslash % have \ input char produce \ char from current font - \gobble -} - -% Define the \E... control sequence only if we are inside the -% environment, so the error checking in \end will work. -% -% We must call \lisp last in the definition, since it reads the -% return following the @example (or whatever) command. -% -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} -\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp} - -% @smallexample and @smalllisp. This is not used unless the @smallbook -% command is given. Originally contributed by Pavel@xerox. -% -\def\smalllispx{\begingroup - \nonfillstart - \let\Esmalllisp = \nonfillfinish - \let\Esmallexample = \nonfillfinish - % - % Smaller interline space and fonts for small examples. - \setleading{10pt}% - \indexfonts \tt - \rawbackslash % make \ output the \ character from the current font (tt) - \gobble -} - -% This is @display; same as @lisp except use roman font. -% -\def\display{\begingroup - \nonfillstart - \let\Edisplay = \nonfillfinish - \gobble -} - -% This is @format; same as @display except don't narrow margins. -% -\def\format{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eformat = \nonfillfinish - \gobble -} - -% @flushleft (same as @format) and @flushright. -% -\def\flushleft{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushleft = \nonfillfinish - \gobble -} -\def\flushright{\begingroup - \let\nonarrowing = t - \nonfillstart - \let\Eflushright = \nonfillfinish - \advance\leftskip by 0pt plus 1fill - \gobble} - -% @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. -% -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body - {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \singlespace - \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% - % - % @cartouche defines \nonarrowing to inhibit narrowing at next level down. - \ifx\nonarrowing\relax - \advance\leftskip by \lispnarrowing - \advance\rightskip by \lispnarrowing - \exdentamount = \lispnarrowing - \let\nonarrowing = \relax - \fi -} - -\message{defuns,} -% Define formatter for defuns -% First, allow user to change definition object font (\df) internally -\def\setdeffont #1 {\csname DEF#1\endcsname} - -\newskip\defbodyindent \defbodyindent=.4in -\newskip\defargsindent \defargsindent=50pt -\newskip\deftypemargin \deftypemargin=12pt -\newskip\deflastargmargin \deflastargmargin=18pt - -\newcount\parencount -% define \functionparens, which makes ( and ) and & do special things. -% \functionparens affects the group it is contained in. -\def\activeparens{% -\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active -\catcode`\[=\active \catcode`\]=\active} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % -\global\advance\parencount by 1 } -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. -% also in that case restore the outer-level definition of (. -\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi -\global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} -\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} - -% First, defname, which formats the header line itself. -% #1 should be the function name. -% #2 should be the type of definition, such as "Function". - -\def\defname #1#2{% -% Get the values of \leftskip and \rightskip as they were -% outside the @def... -\dimen2=\leftskip -\advance\dimen2 by -\defbodyindent -\dimen3=\rightskip -\advance\dimen3 by -\defbodyindent -\noindent % -\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% -\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line -\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 % -% Now output arg 2 ("Function" or some such) -% ending at \deftypemargin from the right margin, -% but stuck inside a box of width 0 so it does not interfere with linebreaking -{% Adjust \hsize to exclude the ambient margins, -% so that \rightline will obey them. -\advance \hsize by -\dimen2 \advance \hsize by -\dimen3 -\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}% -% Make all lines underfull and no complaints: -\tolerance=10000 \hbadness=10000 -\advance\leftskip by -\defbodyindent -\exdentamount=\defbodyindent -{\df #1}\enskip % Generate function name -} - -% Actually process the body of a definition -% #1 should be the terminating control sequence, such as \Edefun. -% #2 should be the "another name" control sequence, such as \defunx. -% #3 should be the control sequence that actually processes the header, -% such as \defunheader. - -\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % 61 is `=' -\obeylines\activeparens\spacesplit#3} - -\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} - -\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} - -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. - -\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % -\obeylines\spacesplit#3} - -% This is used for \def{tp,vr}parsebody. It could probably be used for -% some of the others, too, with some judicious conditionals. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV % - \medbreak % - % Define the end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% - \parindent=0in - \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines -} - -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{#3{#4}}% -} - -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody -% -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. -% -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{\parsetpheaderline{#3{#4}}}\empty -} - -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does, putting the result in \tptemp. -% -\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% - -% After \spacesplit has done its work, this is called -- #1 is the final -% thing to call, #2 the type name (which starts with \empty), and #3 -% (which might be empty) the arguments. -% -\def\parsetpheaderline#1#2#3{% - \removeemptybraces#2\relax - #1{\tptemp}{#3}% -}% - -\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\spacesplit{#3{#5}}} - -% Split up #2 at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. - -{\obeylines -\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% -\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% -\ifx\relax #3% -#1{#2}{}\else #1{#2}{#3#4}\fi}} - -% So much for the things common to all kinds of definitions. - -% Define @defun. - -% First, define the processing that is wanted for arguments of \defun -% Use this to expand the args and terminate the paragraph they make up - -\def\defunargs #1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -\hyphenchar\tensl=0 -#1% -\hyphenchar\tensl=45 -\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% -} - -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\penalty 10000\vskip -\parskip\penalty 10000% -} - -% Do complete processing of one @defun or @defunx line already parsed. - -% @deffn Command forward-char nchars - -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} - -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defun == @deffn Function - -\def\defun{\defparsebody\Edefun\defunx\defunheader} - -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Function}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefun int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} - -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% -\deftypefunargs {#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} - -% \defheaderxcond#1\relax$$$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} - -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$$$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defmac == @deffn Macro - -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} - -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Macro}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} - -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{Special Form}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% This definition is run if you use @defunx -% anywhere other than immediately after a @defun or @defunx. - -\def\deffnx #1 {\errmessage{@deffnx in invalid context}} -\def\defunx #1 {\errmessage{@defunx in invalid context}} -\def\defmacx #1 {\errmessage{@defmacx in invalid context}} -\def\defspecx #1 {\errmessage{@defspecx in invalid context}} -\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} - -% @defmethod, and so on - -% @defop {Funny Method} foo-class frobnicate argument - -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} - -\def\defopheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index -\begingroup\defname {#2}{\defoptype{} on #1}% -\defunargs {#3}\endgroup % -} - -% @defmethod == @defop Method - -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} - -\def\defmethodheader #1#2#3{% -\dosubind {fn}{\code{#2}}{on #1}% entry in function index -\begingroup\defname {#2}{Method on #1}% -\defunargs {#3}\endgroup % -} - -% @defcv {Class Option} foo-class foo-flag - -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} - -\def\defcvarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index -\begingroup\defname {#2}{\defcvtype{} of #1}% -\defvarargs {#3}\endgroup % -} - -% @defivar == @defcv {Instance Variable} - -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} - -\def\defivarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index -\begingroup\defname {#2}{Instance Variable of #1}% -\defvarargs {#3}\endgroup % -} - -% These definitions are run if you use @defmethodx, etc., -% anywhere other than immediately after a @defmethod, etc. - -\def\defopx #1 {\errmessage{@defopx in invalid context}} -\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} -\def\defcvx #1 {\errmessage{@defcvx in invalid context}} -\def\defivarx #1 {\errmessage{@defivarx in invalid context}} - -% Now @defvar - -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000} - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{Variable}% -\defvarargs {#2}\endgroup % -} - -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{User Option}% -\defvarargs {#2}\endgroup % -} - -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name. -\def\deftypevarheader #1#2{% -\doind {vr}{\code{#2}}% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 -\endgroup} - -% @deftypevr {Global Flag} int enable - -\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - -\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% -\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} -\interlinepenalty=10000 -\endgraf\penalty 10000\vskip -\parskip\penalty 10000 -\endgroup} - -% This definition is run if you use @defvarx -% anywhere other than immediately after a @defvar or @defvarx. - -\def\defvrx #1 {\errmessage{@defvrx in invalid context}} -\def\defvarx #1 {\errmessage{@defvarx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} - -% This definition is run if you use @deftpx, etc -% anywhere other than immediately after a @deftp, etc. - -\def\deftpx #1 {\errmessage{@deftpx in invalid context}} - -\message{cross reference,} -% Define cross-reference macros -\newwrite \auxfile - -\newif\ifhavexrefs % True if xref values are known. -\newif\ifwarnedxrefs % True if we warned once that they aren't known. - -% \setref{foo} defines a cross-reference point named foo. - -\def\setref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ysectionnumberandtype}} - -\def\unnumbsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Ynothing}} - -\def\appendixsetref#1{% -\dosetq{#1-title}{Ytitle}% -\dosetq{#1-pg}{Ypagenumber}% -\dosetq{#1-snt}{Yappendixletterandtype}} - -% \xref, \pxref, and \ref generate cross-references to specified points. -% For \xrefX, #1 is the node name, #2 the name of the Info -% cross-reference, #3 the printed node name, #4 the name of the Info -% file, #5 the name of the printed manual. All but the node name can be -% omitted. -% -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} -\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup - \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% - \ifdim \wd0 = 0pt - % No printed node name was explicitly given. - \ifx\SETxref-automatic-section-title\relax % - % Use the actual chapter/section title appear inside - % the square brackets. Use the real section title if we have it. - \ifdim \wd1>0pt% - % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% - \else - \ifhavexrefs - % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}}% - \else - % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% - \fi% - \fi - \def\printednodename{#1-title}% - \else - % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% - \fi - \fi - % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' in \cite{\printedmanual}% - \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\turnoffactive \refx{#1-snt}{}}% - \space [\printednodename],\space - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - \fi -\endgroup} - -% \dosetq is the interface for calls from other macros - -% Use \turnoffactive so that punctuation chars such as underscore -% work in node names. -\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% -\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% -\next}} - -% \internalsetq {foo}{page} expands into -% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} -% When the aux file is read, ' is the escape character - -\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} - -% Things to be expanded by \internalsetq - -\def\Ypagenumber{\folio} - -\def\Ytitle{\thissection} - -\def\Ynothing{} - -\def\Ysectionnumberandtype{% -\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % -\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\def\Yappendixletterandtype{% -\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% -\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\gdef\xreftie{'tie} - -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. -% -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Non-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi - -% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. -% If its value is nonempty, SUFFIX is output afterward. - -\def\refx#1#2{% - \expandafter\ifx\csname X#1\endcsname\relax - % If not defined, say something at least. - $\langle$un\-de\-fined$\rangle$% - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% - \fi - \fi - \else - % It's defined, so just use it. - \csname X#1\endcsname - \fi - #2% Output the suffix in any case. -} - -% Read the last existing aux file, if any. No error if none exists. - -% This is the macro invoked by entries in the aux file. -\def\xrdef #1#2{ -{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} - -\def\readauxfile{% -\begingroup -\catcode `\^^@=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\^^C=\other -\catcode `\^^D=\other -\catcode `\^^E=\other -\catcode `\^^F=\other -\catcode `\^^G=\other -\catcode `\^^H=\other -\catcode `\ =\other -\catcode `\^^L=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode `\=\other -\catcode 26=\other -\catcode `\^^[=\other -\catcode `\^^\=\other -\catcode `\^^]=\other -\catcode `\^^^=\other -\catcode `\^^_=\other -\catcode `\@=\other -\catcode `\^=\other -\catcode `\~=\other -\catcode `\[=\other -\catcode `\]=\other -\catcode`\"=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode `\$=\other -\catcode `\#=\other -\catcode `\&=\other -% `\+ does not work, so use 43. -\catcode 43=\other -% Make the characters 128-255 be printing characters -{% - \count 1=128 - \def\loop{% - \catcode\count 1=\other - \advance\count 1 by 1 - \ifnum \count 1<256 \loop \fi - }% -}% -% the aux file uses ' as the escape. -% Turn off \ as an escape so we do not lose on -% entries which were dumped with control sequences in their names. -% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ -% Reference to such entries still does not work the way one would wish, -% but at least they do not bomb out when the aux file is read in. -\catcode `\{=1 \catcode `\}=2 -\catcode `\%=\other -\catcode `\'=0 -\catcode`\^=7 % to make ^^e4 etc usable in xref tags -\catcode `\\=\other -\openin 1 \jobname.aux -\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue -\global\warnedobstrue -\fi -% Open the new aux file. Tex will close it automatically at exit. -\openout \auxfile=\jobname.aux -\endgroup} - - -% Footnotes. - -\newcount \footnoteno - -% The trailing space in the following definition for supereject is -% vital for proper filling; pages come out unaligned when you do a -% pagealignmacro call if that space before the closing brace is -% removed. -\def\supereject{\par\penalty -20000\footnoteno =0 } - -% @footnotestyle is meaningful for info output only.. -\let\footnotestyle=\comment - -\let\ptexfootnote=\footnote - -{\catcode `\@=11 -% -% Auto-number footnotes. Otherwise like plain. -\gdef\footnote{% - \global\advance\footnoteno by \@ne - \edef\thisfootno{$^{\the\footnoteno}$}% - % - % In case the footnote comes at the end of a sentence, preserve the - % extra spacing after we do the footnote number. - \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi - % - % Remove inadvertent blank space before typesetting the footnote number. - \unskip - \thisfootno\@sf - \footnotezzz -}% - -% Don't bother with the trickery in plain.tex to not require the -% footnote text as a parameter. Our footnotes don't need to be so general. -% -\long\gdef\footnotezzz#1{\insert\footins{% - % We want to typeset this text as a normal paragraph, even if the - % footnote reference occurs in (for example) a display environment. - % So reset some parameters. - \interlinepenalty\interfootnotelinepenalty - \splittopskip\ht\strutbox % top baseline for broken footnotes - \splitmaxdepth\dp\strutbox - \floatingpenalty\@MM - \leftskip\z@skip - \rightskip\z@skip - \spaceskip\z@skip - \xspaceskip\z@skip - \parindent\defaultparindent - % - % Hang the footnote text off the number. - \hang - \textindent{\thisfootno}% - % - % Don't crash into the line above the footnote text. Since this - % expands into a box, it must come within the paragraph, lest it - % provide a place where TeX can split the footnote. - \footstrut - #1\strut}% -} - -}%end \catcode `\@=11 - -% Set the baselineskip to #1, and the lineskip and strut size -% correspondingly. There is no deep meaning behind these magic numbers -% used as factors; they just match (closely enough) what Knuth defined. -% -\def\lineskipfactor{.08333} -\def\strutheightpercent{.70833} -\def\strutdepthpercent {.29167} -% -\def\setleading#1{% - \normalbaselineskip = #1\relax - \normallineskip = \lineskipfactor\normalbaselineskip - \normalbaselines - \setbox\strutbox =\hbox{% - \vrule width0pt height\strutheightpercent\baselineskip - depth \strutdepthpercent \baselineskip - }% -} - -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% -} - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt} - - -% End of control word definitions. - -\message{and turning on texinfo input format.} - -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - -% Set some numeric style parameters, for 8.5 x 11 format. - -%\hsize = 6.5in -\newdimen\defaultparindent \defaultparindent = 15pt -\parindent = \defaultparindent -\parskip 18pt plus 1pt -\setleading{15pt} -\advance\topskip by 1.2cm - -% Prevent underfull vbox error messages. -\vbadness=10000 - -% Following George Bush, just get rid of widows and orphans. -\widowpenalty=10000 -\clubpenalty=10000 - -% Use TeX 3.0's \emergencystretch to help line breaking, but if we're -% using an old version of TeX, don't do anything. We want the amount of -% stretch added to depend on the line length, hence the dependence on -% \hsize. This makes it come to about 9pt for the 8.5x11 format. -% -\ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% -\else - \emergencystretch = \hsize - \divide\emergencystretch by 45 -\fi - -% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) -\def\smallbook{ - -% These values for secheadingskip and subsecheadingskip are -% experiments. RJC 7 Aug 1992 -\global\secheadingskip = 17pt plus 6pt minus 3pt -\global\subsecheadingskip = 14pt plus 6pt minus 3pt - -\global\lispnarrowing = 0.3in -\setleading{12pt} -\advance\topskip by -1cm -\global\parskip 3pt plus 1pt -\global\hsize = 5in -\global\vsize=7.5in -\global\tolerance=700 -\global\hfuzz=1pt -\global\contentsrightmargin=0pt -\global\deftypemargin=0pt -\global\defbodyindent=.5cm - -\global\pagewidth=\hsize -\global\pageheight=\vsize - -\global\let\smalllisp=\smalllispx -\global\let\smallexample=\smalllispx -\global\def\Esmallexample{\Esmalllisp} -} - -% Use @afourpaper to print on European A4 paper. -\def\afourpaper{ -\global\tolerance=700 -\global\hfuzz=1pt -\setleading{12pt} -\global\parskip 15pt plus 1pt - -\global\vsize= 53\baselineskip -\advance\vsize by \topskip -%\global\hsize= 5.85in % A4 wide 10pt -\global\hsize= 6.5in -\global\outerhsize=\hsize -\global\advance\outerhsize by 0.5in -\global\outervsize=\vsize -\global\advance\outervsize by 0.6in - -\global\pagewidth=\hsize -\global\pageheight=\vsize -} - -% Allow control of the text dimensions. Parameters in order: textheight; -% textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; -% header is additional; added length extends the bottom of the page. - -\def\changepagesizes#1#2#3#4#5{ - \global\vsize= #1 - \advance\vsize by \topskip - \global\voffset= #3 - \global\hsize= #2 - \global\outerhsize=\hsize - \global\advance\outerhsize by 0.5in - \global\outervsize=\vsize - \global\advance\outervsize by 0.6in - \global\pagewidth=\hsize - \global\pageheight=\vsize - \global\normaloffset= #4 - \global\bindingoffset= #5} - -% This layout is compatible with Latex on A4 paper. - -\def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} - -% Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{\afourpaper -\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}} - -% Define macros to output various characters with catcode for normal text. -\catcode`\"=\other -\catcode`\~=\other -\catcode`\^=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode`\+=\other -\def\normaldoublequote{"} -\def\normaltilde{~} -\def\normalcaret{^} -\def\normalunderscore{_} -\def\normalverticalbar{|} -\def\normalless{<} -\def\normalgreater{>} -\def\normalplus{+} - -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, -% where something hairier probably needs to be done. -% -% #1 is what to print if we are indeed using \tt; #2 is what to print -% otherwise. Since all the Computer Modern typewriter fonts have zero -% interword stretch (and shrink), and it is reasonable to expect all -% typewriter fonts to have this, we can check that font parameter. -% -\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} - -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). -% Most of these we simply print from the \tt font, but for some, we can -% use math or other variants that look better in normal text. - -\catcode`\"=\active -\def\activedoublequote{{\tt \char '042}} -\let"=\activedoublequote -\catcode`\~=\active -\def~{{\tt \char '176}} -\chardef\hat=`\^ -\catcode`\^=\active -\def\auxhat{\def^{'hat}} -\def^{{\tt \hat}} - -\catcode`\_=\active -\def_{\ifusingtt\normalunderscore\_} -% Subroutine for the previous macro. -\def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}} - -% \lvvmode is equivalent in function to \leavevmode. -% Using \leavevmode runs into trouble when written out to -% an index file due to the expansion of \leavevmode into ``\unhbox -% \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our -% magic tricks with @. -\def\lvvmode{\vbox to 0pt{}} - -\catcode`\|=\active -\def|{{\tt \char '174}} -\chardef \less=`\< -\catcode`\<=\active -\def<{{\tt \less}} -\chardef \gtr=`\> -\catcode`\>=\active -\def>{{\tt \gtr}} -\catcode`\+=\active -\def+{{\tt \char 43}} -%\catcode 27=\active -%\def^^[{$\diamondsuit$} - -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active - -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} - -\catcode`\@=0 - -% \rawbackslashxx output one backslash character in current font -\global\chardef\rawbackslashxx=`\\ -%{\catcode`\\=\other -%@gdef@rawbackslashxx{\}} - -% \rawbackslash redefines \ as input to do \rawbackslashxx. -{\catcode`\\=\active -@gdef@rawbackslash{@let\=@rawbackslashxx }} - -% \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} - -% Say @foo, not \foo, in error messages. -\escapechar=`\@ - -% \catcode 17=0 % Define control-q -\catcode`\\=\active - -% Used sometimes to turn off (effectively) the active characters -% even after parsing them. -@def@turnoffactive{@let"=@normaldoublequote -@let\=@realbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus} - -@def@normalturnoffactive{@let"=@normaldoublequote -@let\=@normalbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus} - -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive - -% If a .fmt file is being used, we don't want the `\input texinfo' to show up. -% That is what \eatinput is for; after that, the `\' should revert to printing -% a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput - -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\{ in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also back turn on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% -@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi - @catcode`+=@active @catcode`@_=@active} - -%% These look ok in all fonts, so just make them not special. The @rm below -%% makes sure that the current font starts out as the newly loaded cmr10 -@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other - -@textfonts -@rm - -@c Local variables: -@c page-delimiter: "^\\\\message" -@c End: diff --git a/buildtools/windows/source/make/variable.c b/buildtools/windows/source/make/variable.c deleted file mode 100644 index 319826f215b..00000000000 --- a/buildtools/windows/source/make/variable.c +++ /dev/null @@ -1,822 +0,0 @@ -/* Internals of variables for GNU Make. -Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "commands.h" -#include "variable.h" -#include "dep.h" -#include "file.h" - -/* Hash table of all global variable definitions. */ - -#ifndef VARIABLE_BUCKETS -#define VARIABLE_BUCKETS 523 -#endif -#ifndef PERFILE_VARIABLE_BUCKETS -#define PERFILE_VARIABLE_BUCKETS 23 -#endif -#ifndef SMALL_SCOPE_VARIABLE_BUCKETS -#define SMALL_SCOPE_VARIABLE_BUCKETS 13 -#endif -static struct variable *variable_table[VARIABLE_BUCKETS]; -static struct variable_set global_variable_set - = { variable_table, VARIABLE_BUCKETS }; -static struct variable_set_list global_setlist - = { 0, &global_variable_set }; -struct variable_set_list *current_variable_set_list = &global_setlist; - -/* Implement variables. */ - -/* Define variable named NAME with value VALUE in SET. VALUE is copied. - LENGTH is the length of NAME, which does not need to be null-terminated. - ORIGIN specifies the origin of the variable (makefile, command line - or environment). - If RECURSIVE is nonzero a flag is set in the variable saying - that it should be recursively re-expanded. */ - -static struct variable * -define_variable_in_set (name, length, value, origin, recursive, set) - char *name; - unsigned int length; - char *value; - enum variable_origin origin; - int recursive; - struct variable_set *set; -{ - register unsigned int i; - register unsigned int hashval; - register struct variable *v; - - hashval = 0; - for (i = 0; i < length; ++i) - HASH (hashval, name[i]); - hashval %= set->buckets; - - for (v = set->table[hashval]; v != 0; v = v->next) - if (*v->name == *name - && !strncmp (v->name + 1, name + 1, length - 1) - && v->name[length] == '\0') - break; - - if (env_overrides && origin == o_env) - origin = o_env_override; - - if (v != 0) - { - if (env_overrides && v->origin == o_env) - /* V came from in the environment. Since it was defined - before the switches were parsed, it wasn't affected by -e. */ - v->origin = o_env_override; - - /* A variable of this name is already defined. - If the old definition is from a stronger source - than this one, don't redefine it. */ - if ((int) origin >= (int) v->origin) - { - if (v->value != 0) - free (v->value); - v->value = savestring (value, strlen (value)); - v->origin = origin; - v->recursive = recursive; - } - return v; - } - - /* Create a new variable definition and add it to the hash table. */ - - v = (struct variable *) xmalloc (sizeof (struct variable)); - v->name = savestring (name, length); - v->value = savestring (value, strlen (value)); - v->origin = origin; - v->recursive = recursive; - v->expanding = 0; - v->export = v_default; - v->next = set->table[hashval]; - set->table[hashval] = v; - return v; -} - -/* Define a variable in the current variable set. */ - -struct variable * -define_variable (name, length, value, origin, recursive) - char *name; - unsigned int length; - char *value; - enum variable_origin origin; - int recursive; -{ - return define_variable_in_set (name, length, value, origin, recursive, - current_variable_set_list->set); -} - -/* Define a variable in FILE's variable set. */ - -struct variable * -define_variable_for_file (name, length, value, origin, recursive, file) - char *name; - unsigned int length; - char *value; - enum variable_origin origin; - int recursive; - struct file *file; -{ - return define_variable_in_set (name, length, value, origin, recursive, - file->variables->set); -} - -/* Lookup a variable whose name is a string starting at NAME - and with LENGTH chars. NAME need not be null-terminated. - Returns address of the `struct variable' containing all info - on the variable, or nil if no such variable is defined. */ - -struct variable * -lookup_variable (name, length) - char *name; - unsigned int length; -{ - register struct variable_set_list *setlist; - - register unsigned int i; - register unsigned int rawhash = 0; - - for (i = 0; i < length; ++i) - HASH (rawhash, name[i]); - - for (setlist = current_variable_set_list; - setlist != 0; setlist = setlist->next) - { - register struct variable_set *set = setlist->set; - register unsigned int hashval = rawhash % set->buckets; - register struct variable *v; - - for (v = set->table[hashval]; v != 0; v = v->next) - if (*v->name == *name - && !strncmp (v->name + 1, name + 1, length - 1) - && v->name[length] == 0) - return v; - } - - return 0; -} - -/* Initialize FILE's variable set list. If FILE already has a variable set - list, the topmost variable set is left intact, but the the rest of the - chain is replaced with FILE->parent's setlist. */ - -void -initialize_file_variables (file) - struct file *file; -{ - register struct variable_set_list *l = file->variables; - if (l == 0) - { - l = (struct variable_set_list *) - xmalloc (sizeof (struct variable_set_list)); - l->set = (struct variable_set *) xmalloc (sizeof (struct variable_set)); - l->set->buckets = PERFILE_VARIABLE_BUCKETS; - l->set->table = (struct variable **) - xmalloc (l->set->buckets * sizeof (struct variable *)); - bzero ((char *) l->set->table, - l->set->buckets * sizeof (struct variable *)); - file->variables = l; - } - - if (file->parent == 0) - l->next = &global_setlist; - else - { - if (file->parent->variables == 0) - initialize_file_variables (file->parent); - l->next = file->parent->variables; - } -} - -/* Pop the top set off the current variable set list, - and free all its storage. */ - -void -pop_variable_scope () -{ - register struct variable_set_list *setlist = current_variable_set_list; - register struct variable_set *set = setlist->set; - register unsigned int i; - - current_variable_set_list = setlist->next; - free ((char *) setlist); - - for (i = 0; i < set->buckets; ++i) - { - register struct variable *next = set->table[i]; - while (next != 0) - { - register struct variable *v = next; - next = v->next; - - free (v->name); - free ((char *) v); - } - } - free ((char *) set->table); - free ((char *) set); -} - -/* Create a new variable set and push it on the current setlist. */ - -void -push_new_variable_scope () -{ - register struct variable_set_list *setlist; - register struct variable_set *set; - - set = (struct variable_set *) xmalloc (sizeof (struct variable_set)); - set->buckets = SMALL_SCOPE_VARIABLE_BUCKETS; - set->table = (struct variable **) - xmalloc (set->buckets * sizeof (struct variable *)); - bzero ((char *) set->table, set->buckets * sizeof (struct variable *)); - - setlist = (struct variable_set_list *) - xmalloc (sizeof (struct variable_set_list)); - setlist->set = set; - setlist->next = current_variable_set_list; - current_variable_set_list = setlist; -} - -/* Merge SET1 into SET0, freeing unused storage in SET1. */ - -static void -merge_variable_sets (set0, set1) - struct variable_set *set0, *set1; -{ - register unsigned int bucket1; - - for (bucket1 = 0; bucket1 < set1->buckets; ++bucket1) - { - register struct variable *v1 = set1->table[bucket1]; - while (v1 != 0) - { - struct variable *next = v1->next; - unsigned int bucket0; - register struct variable *v0; - - if (set1->buckets >= set0->buckets) - bucket0 = bucket1; - else - { - register char *n; - bucket0 = 0; - for (n = v1->name; *n != '\0'; ++n) - HASH (bucket0, *n); - } - bucket0 %= set0->buckets; - - for (v0 = set0->table[bucket0]; v0 != 0; v0 = v0->next) - if (streq (v0->name, v1->name)) - break; - - if (v0 == 0) - { - /* There is no variable in SET0 with the same name. */ - v1->next = set0->table[bucket0]; - set0->table[bucket0] = v1; - } - else - { - /* The same variable exists in both sets. - SET0 takes precedence. */ - free (v1->value); - free ((char *) v1); - } - - v1 = next; - } - } -} - -/* Merge SETLIST1 into SETLIST0, freeing unused storage in SETLIST1. */ - -void -merge_variable_set_lists (setlist0, setlist1) - struct variable_set_list **setlist0, *setlist1; -{ - register struct variable_set_list *list0 = *setlist0; - struct variable_set_list *last0 = 0; - - while (setlist1 != 0 && list0 != 0) - { - struct variable_set_list *next = setlist1; - setlist1 = setlist1->next; - - merge_variable_sets (list0->set, next->set); - - free ((char *) next); - - last0 = list0; - list0 = list0->next; - } - - if (setlist1 != 0) - { - if (last0 == 0) - *setlist0 = setlist1; - else - last0->next = setlist1; - } -} - -/* Define the automatic variables, and record the addresses - of their structures so we can change their values quickly. */ - -void -define_automatic_variables () -{ - extern char default_shell[]; - register struct variable *v; - char buf[200]; - - sprintf (buf, "%u", makelevel); - (void) define_variable ("MAKELEVEL", 9, buf, o_env, 0); - - sprintf (buf, "%s%s%s", - version_string, - (remote_description == 0 || remote_description[0] == '\0') - ? "" : "-", - (remote_description == 0 || remote_description[0] == '\0') - ? "" : remote_description); - (void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0); - - - /* This won't override any definition, but it - will provide one if there isn't one there. */ - v = define_variable ("SHELL", 5, default_shell, o_default, 0); - v->export = v_export; /* Always export SHELL. */ - - /* Don't let SHELL come from the environment. */ - if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override) - { - free (v->value); - v->origin = o_file; - v->value = savestring (default_shell, strlen (default_shell)); - } - - /* Make sure MAKEFILES gets exported if it is set. */ - v = define_variable ("MAKEFILES", 9, "", o_default, 0); - v->export = v_ifset; - - /* Define the magic D and F variables in terms of - the automatic variables they are variations of. */ - - define_variable ("@D", 2, "$(patsubst %/,%,$(dir $@))", o_automatic, 1); - define_variable ("%D", 2, "$(patsubst %/,%,$(dir $%))", o_automatic, 1); - define_variable ("*D", 2, "$(patsubst %/,%,$(dir $*))", o_automatic, 1); - define_variable ("variables; - - /* Find the lowest number of buckets in any set in the list. */ - s = set_list; - buckets = s->set->buckets; - for (s = s->next; s != 0; s = s->next) - if (s->set->buckets < buckets) - buckets = s->set->buckets; - - /* Find the hash value of the bucket `MAKELEVEL' will fall into. */ - { - char *p = "MAKELEVEL"; - mklev_hash = 0; - while (*p != '\0') - HASH (mklev_hash, *p++); - } - - /* Temporarily allocate a table with that many buckets. */ - table = (struct variable_bucket **) - alloca (buckets * sizeof (struct variable_bucket *)); - bzero ((char *) table, buckets * sizeof (struct variable_bucket *)); - - /* Run through all the variable sets in the list, - accumulating variables in TABLE. */ - nvariables = 0; - for (s = set_list; s != 0; s = s->next) - { - register struct variable_set *set = s->set; - for (i = 0; i < set->buckets; ++i) - { - register struct variable *v; - for (v = set->table[i]; v != 0; v = v->next) - { - unsigned int j = i % buckets; - register struct variable_bucket *ov; - register char *p = v->name; - - if (i == mklev_hash % set->buckets - && streq (v->name, "MAKELEVEL")) - /* Don't include MAKELEVEL because it will be - added specially at the end. */ - continue; - - switch (v->export) - { - case v_default: - if (v->origin == o_default || v->origin == o_automatic) - /* Only export default variables by explicit request. */ - continue; - - if (! export_all_variables - && v->origin != o_command - && v->origin != o_env && v->origin != o_env_override) - continue; - - if (*p != '_' && (*p < 'A' || *p > 'Z') - && (*p < 'a' || *p > 'z')) - continue; - for (++p; *p != '\0'; ++p) - if (*p != '_' && (*p < 'a' || *p > 'z') - && (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9')) - break; - if (*p != '\0') - continue; - - case v_export: - break; - - case v_noexport: - continue; - - case v_ifset: - if (v->origin == o_default) - continue; - break; - } - - for (ov = table[j]; ov != 0; ov = ov->next) - if (streq (v->name, ov->variable->name)) - break; - if (ov == 0) - { - register struct variable_bucket *entry; - entry = (struct variable_bucket *) - alloca (sizeof (struct variable_bucket)); - entry->next = table[j]; - entry->variable = v; - table[j] = entry; - ++nvariables; - } - } - } - } - - result = (char **) xmalloc ((nvariables + 2) * sizeof (char *)); - nvariables = 0; - for (i = 0; i < buckets; ++i) - { - register struct variable_bucket *b; - for (b = table[i]; b != 0; b = b->next) - { - register struct variable *v = b->variable; - /* If V is recursively expanded and didn't come from the environment, - expand its value. If it came from the environment, it should - go back into the environment unchanged. */ - if (v->recursive - && v->origin != o_env && v->origin != o_env_override) - { - char *value = recursively_expand (v); - result[nvariables++] = concat (v->name, "=", value); - free (value); - } - else - result[nvariables++] = concat (v->name, "=", v->value); - } - } - result[nvariables] = (char *) xmalloc (100); - (void) sprintf (result[nvariables], "MAKELEVEL=%u", makelevel + 1); - result[++nvariables] = 0; - - return result; -} - -/* Try to interpret LINE (a null-terminated string) as a variable definition. - - ORIGIN may be o_file, o_override, o_env, o_env_override, - or o_command specifying that the variable definition comes - from a makefile, an override directive, the environment with - or without the -e switch, or the command line. - - A variable definition has the form "name = value" or "name := value". - Any whitespace around the "=" or ":=" is removed. The first form - defines a variable that is recursively re-evaluated. The second form - defines a variable whose value is variable-expanded at the time of - definition and then is evaluated only once at the time of expansion. - - If a variable was defined, a pointer to its `struct variable' is returned. - If not, NULL is returned. */ - -struct variable * -try_variable_definition (filename, lineno, line, origin) - char *filename; - unsigned int lineno; - char *line; - enum variable_origin origin; -{ - register int c; - register char *p = line; - register char *beg; - register char *end; - enum { bogus, simple, recursive, append } flavor = bogus; - char *name, *expanded_name, *value; - struct variable *v; - - while (1) - { - c = *p++; - if (c == '\0' || c == '#') - return 0; - if (c == '=') - { - end = p - 1; - flavor = recursive; - break; - } - else if (c == ':') - if (*p == '=') - { - end = p++ - 1; - flavor = simple; - break; - } - else - /* A colon other than := is a rule line, not a variable defn. */ - return 0; - else if (c == '+' && *p == '=') - { - end = p++ - 1; - flavor = append; - break; - } - } - - beg = next_token (line); - while (end > beg && isblank (end[-1])) - --end; - p = next_token (p); - - /* Expand the name, so "$(foo)bar = baz" works. */ - name = (char *) alloca (end - beg + 1); - bcopy (beg, name, end - beg); - name[end - beg] = '\0'; - expanded_name = allocated_variable_expand (name); - - if (expanded_name[0] == '\0') - { - if (filename == 0) - fatal ("empty variable name"); - else - makefile_fatal (filename, lineno, "empty variable name"); - } - - /* Calculate the variable's new value in VALUE. */ - - switch (flavor) - { - case bogus: - /* Should not be possible. */ - abort (); - return 0; - case simple: - /* A simple variable definition "var := value". Expand the value. */ - value = variable_expand (p); - break; - case recursive: - /* A recursive variable definition "var = value". - The value is used verbatim. */ - value = p; - break; - case append: - /* An appending variable definition "var += value". - Extract the old value and append the new one. */ - v = lookup_variable (expanded_name, strlen (expanded_name)); - if (v == 0) - { - /* There was no old value. - This becomes a normal recursive definition. */ - value = p; - flavor = recursive; - } - else - { - /* Paste the old and new values together in VALUE. */ - - unsigned int oldlen, newlen; - - if (v->recursive) - /* The previous definition of the variable was recursive. - The new value comes from the unexpanded old and new values. */ - flavor = recursive; - else - /* The previous definition of the variable was simple. - The new value comes from the old value, which was expanded - when it was set; and from the expanded new value. */ - p = variable_expand (p); - - oldlen = strlen (v->value); - newlen = strlen (p); - value = (char *) alloca (oldlen + 1 + newlen + 1); - bcopy (v->value, value, oldlen); - value[oldlen] = ' '; - bcopy (p, &value[oldlen + 1], newlen + 1); - } - } - - v = define_variable (expanded_name, strlen (expanded_name), - value, origin, flavor == recursive); - - free (expanded_name); - - return v; -} - -/* Print information for variable V, prefixing it with PREFIX. */ - -static void -print_variable (v, prefix) - register struct variable *v; - char *prefix; -{ - char *origin; - - switch (v->origin) - { - case o_default: - origin = "default"; - break; - case o_env: - origin = "environment"; - break; - case o_file: - origin = "makefile"; - break; - case o_env_override: - origin = "environment under -e"; - break; - case o_command: - origin = "command line"; - break; - case o_override: - origin = "`override' directive"; - break; - case o_automatic: - origin = "automatic"; - break; - case o_invalid: - default: - abort (); - break; - } - printf ("# %s\n", origin); - - fputs (prefix, stdout); - - /* Is this a `define'? */ - if (v->recursive && index (v->value, '\n') != 0) - printf ("define %s\n%s\nendef\n", v->name, v->value); - else - { - register char *p; - - printf ("%s %s= ", v->name, v->recursive ? "" : ":"); - - /* Check if the value is just whitespace. */ - p = next_token (v->value); - if (p != v->value && *p == '\0') - /* All whitespace. */ - printf ("$(subst ,,%s)", v->value); - else if (v->recursive) - fputs (v->value, stdout); - else - /* Double up dollar signs. */ - for (p = v->value; *p != '\0'; ++p) - { - if (*p == '$') - putchar ('$'); - putchar (*p); - } - putchar ('\n'); - } -} - - -/* Print all the variables in SET. PREFIX is printed before - the actual variable definitions (everything else is comments). */ - -static void -print_variable_set (set, prefix) - register struct variable_set *set; - char *prefix; -{ - register unsigned int i, nvariables, per_bucket; - register struct variable *v; - - per_bucket = nvariables = 0; - for (i = 0; i < set->buckets; ++i) - { - register unsigned int this_bucket = 0; - - for (v = set->table[i]; v != 0; v = v->next) - { - ++this_bucket; - print_variable (v, prefix); - } - - nvariables += this_bucket; - if (this_bucket > per_bucket) - per_bucket = this_bucket; - } - - if (nvariables == 0) - puts ("# No variables."); - else - { - printf ("# %u variables in %u hash buckets.\n", - nvariables, set->buckets); -#ifndef NO_FLOAT - printf ("# average of %.1f variables per bucket, \ -max %u in one bucket.\n", - (double) nvariables / (double) set->buckets, - per_bucket); -#endif - } -} - - -/* Print the data base of variables. */ - -void -print_variable_data_base () -{ - puts ("\n# Variables\n"); - - print_variable_set (&global_variable_set, ""); -} - - -/* Print all the local variables of FILE. */ - -void -print_file_variables (file) - struct file *file; -{ - if (file->variables != 0) - print_variable_set (file->variables->set, "# "); -} diff --git a/buildtools/windows/source/make/variable.h b/buildtools/windows/source/make/variable.h deleted file mode 100644 index 80961790703..00000000000 --- a/buildtools/windows/source/make/variable.h +++ /dev/null @@ -1,100 +0,0 @@ -/* Definitions for using variables in GNU Make. -Copyright (C) 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Codes in a variable definition saying where the definition came from. - Increasing numeric values signify less-overridable definitions. */ -enum variable_origin - { - o_default, /* Variable from the default set. */ - o_env, /* Variable from environment. */ - o_file, /* Variable given in a makefile. */ - o_env_override, /* Variable from environment, if -e. */ - o_command, /* Variable given by user. */ - o_override, /* Variable from an `override' directive. */ - o_automatic, /* Automatic variable -- cannot be set. */ - o_invalid /* Core dump time. */ - }; - -/* Structure that represents one variable definition. - Each bucket of the hash table is a chain of these, - chained through `next'. */ - -struct variable - { - struct variable *next; /* Link in the chain. */ - char *name; /* Variable name. */ - char *value; /* Variable value. */ - enum variable_origin - origin ENUM_BITFIELD (3); /* Variable origin. */ - unsigned int recursive:1; /* Gets recursively re-evaluated. */ - unsigned int expanding:1; /* Nonzero if currently being expanded. */ - enum - { - v_export, /* Export this variable. */ - v_noexport, /* Don't export this variable. */ - v_ifset, /* Export it if it has a non-default value. */ - v_default /* Decide in target_environment. */ - } export ENUM_BITFIELD (2); - }; - -/* Structure that represents a variable set. */ - -struct variable_set - { - struct variable **table; /* Hash table of variables. */ - unsigned int buckets; /* Number of hash buckets in `table'. */ - }; - -/* Structure that represents a list of variable sets. */ - -struct variable_set_list - { - struct variable_set_list *next; /* Link in the chain. */ - struct variable_set *set; /* Variable set. */ - }; - -extern struct variable_set_list *current_variable_set_list; - - -extern void push_new_variable_scope (), pop_variable_scope (); - -extern int handle_function (); - -extern char *variable_buffer_output (); -extern char *variable_expand (), *variable_expand_for_file (); -extern char *allocated_variable_expand_for_file (); -#define allocated_variable_expand(line) \ - allocated_variable_expand_for_file (line, (struct file *) 0) -extern char *expand_argument (); - -extern void define_automatic_variables (); -extern void initialize_file_variables (); -extern void print_file_variables (); - -extern void merge_variable_set_lists (); - -extern struct variable *try_variable_definition (); - -extern struct variable *lookup_variable (), *define_variable (); -extern struct variable *define_variable_for_file (); - -extern int pattern_matches (); -extern char *subst_expand (), *patsubst_expand (), *recursively_expand (); - -extern char **target_environment (); -extern int export_all_variables; diff --git a/buildtools/windows/source/make/version.c b/buildtools/windows/source/make/version.c deleted file mode 100644 index 4818dd6b1d3..00000000000 --- a/buildtools/windows/source/make/version.c +++ /dev/null @@ -1,7 +0,0 @@ -char *version_string = "3.74"; - -/* - Local variables: - version-control: never - End: - */ diff --git a/buildtools/windows/source/make/vpath.c b/buildtools/windows/source/make/vpath.c deleted file mode 100644 index 480fcad744d..00000000000 --- a/buildtools/windows/source/make/vpath.c +++ /dev/null @@ -1,487 +0,0 @@ -/* Implementation of pattern-matching file search paths for GNU Make. -Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Make is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Make; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include "make.h" -#include "file.h" -#include "variable.h" - - -/* Structure used to represent a selective VPATH searchpath. */ - -struct vpath - { - struct vpath *next; /* Pointer to next struct in the linked list. */ - char *pattern; /* The pattern to match. */ - char *percent; /* Pointer into `pattern' where the `%' is. */ - unsigned int patlen;/* Length of the pattern. */ - char **searchpath; /* Null-terminated list of directories. */ - unsigned int maxlen;/* Maximum length of any entry in the list. */ - }; - -/* Linked-list of all selective VPATHs. */ - -static struct vpath *vpaths; - -/* Structure for the general VPATH given in the variable. */ - -static struct vpath *general_vpath; - -static int selective_vpath_search (); - -/* Reverse the chain of selective VPATH lists so they - will be searched in the order given in the makefiles - and construct the list from the VPATH variable. */ - -void -build_vpath_lists () -{ - register struct vpath *new = 0; - register struct vpath *old, *nexto; - register char *p; - - /* Reverse the chain. */ - for (old = vpaths; old != 0; old = nexto) - { - nexto = old->next; - old->next = new; - new = old; - } - - vpaths = new; - - /* If there is a VPATH variable with a nonnull value, construct the - general VPATH list from it. We use variable_expand rather than just - calling lookup_variable so that it will be recursively expanded. */ - - { - /* Turn off --warn-undefined-variables while we expand SHELL and IFS. */ - int save = warn_undefined_variables_flag; - warn_undefined_variables_flag = 0; - - p = variable_expand ("$(strip $(VPATH))"); - - warn_undefined_variables_flag = save; - } - - if (*p != '\0') - { - /* Save the list of vpaths. */ - struct vpath *save_vpaths = vpaths; - - /* Empty `vpaths' so the new one will have no next, and `vpaths' - will still be nil if P contains no existing directories. */ - vpaths = 0; - - /* Parse P. */ - construct_vpath_list ("%", p); - - /* Store the created path as the general path, - and restore the old list of vpaths. */ - general_vpath = vpaths; - vpaths = save_vpaths; - } -} - -/* Construct the VPATH listing for the pattern and searchpath given. - - This function is called to generate selective VPATH lists and also for - the general VPATH list (which is in fact just a selective VPATH that - is applied to everything). The returned pointer is either put in the - linked list of all selective VPATH lists or in the GENERAL_VPATH - variable. - - If SEARCHPATH is nil, remove all previous listings with the same - pattern. If PATTERN is nil, remove all VPATH listings. - Existing and readable directories that are not "." given in the - searchpath separated by colons are loaded into the directory hash - table if they are not there already and put in the VPATH searchpath - for the given pattern with trailing slashes stripped off if present - (and if the directory is not the root, "/"). - The length of the longest entry in the list is put in the structure as well. - The new entry will be at the head of the VPATHS chain. */ - -void -construct_vpath_list (pattern, dirpath) - char *pattern, *dirpath; -{ - register unsigned int elem; - register char *p; - register char **vpath; - register unsigned int maxvpath; - unsigned int maxelem; - char *percent; - - if (pattern != 0) - { - pattern = savestring (pattern, strlen (pattern)); - percent = find_percent (pattern); - } - - if (dirpath == 0) - { - /* Remove matching listings. */ - register struct vpath *path, *lastpath; - - lastpath = 0; - path = vpaths; - while (path != 0) - { - struct vpath *next = path->next; - - if (pattern == 0 - || (((percent == 0 && path->percent == 0) - || (percent - pattern == path->percent - path->pattern)) - && streq (pattern, path->pattern))) - { - /* Remove it from the linked list. */ - if (lastpath == 0) - vpaths = path->next; - else - lastpath->next = next; - - /* Free its unused storage. */ - free (path->pattern); - free ((char *) path->searchpath); - free ((char *) path); - } - else - lastpath = path; - - path = next; - } - - if (pattern != 0) - free (pattern); - return; - } - - /* Figure out the maximum number of VPATH entries and - put it in MAXELEM. We start with 2, one before the - first colon and one nil, the list terminator and - increment our estimated number for each colon or blank we find. */ - maxelem = 2; - p = dirpath; - while (*p != '\0') - if (*p++ == PATH_SEPARATOR_CHAR || isblank (*p)) - ++maxelem; - - vpath = (char **) xmalloc (maxelem * sizeof (char *)); - maxvpath = 0; - - /* Skip over any initial colons and blanks. */ - p = dirpath; - while (*p == PATH_SEPARATOR_CHAR || isblank (*p)) - ++p; - - elem = 0; - while (*p != '\0') - { - char *v; - unsigned int len; - - /* Find the end of this entry. */ - v = p; - while (*p != '\0' && *p != PATH_SEPARATOR_CHAR && !isblank (*p)) - ++p; - - len = p - v; - /* Make sure there's no trailing slash, - but still allow "/" as a directory. */ - if (len > 1 && p[-1] == '/') - --len; - - if (len > 1 || *v != '.') - { - v = savestring (v, len); - - /* Verify that the directory actually exists. */ - - if (dir_file_exists_p (v, "")) - { - /* It does. Put it in the list. */ - vpath[elem++] = dir_name (v); - free (v); - if (len > maxvpath) - maxvpath = len; - } - else - /* The directory does not exist. Omit from the list. */ - free (v); - } - - /* Skip over colons and blanks between entries. */ - while (*p == PATH_SEPARATOR_CHAR || isblank (*p)) - ++p; - } - - if (elem > 0) - { - struct vpath *path; - /* ELEM is now incremented one element past the last - entry, to where the nil-pointer terminator goes. - Usually this is maxelem - 1. If not, shrink down. */ - if (elem < (maxelem - 1)) - vpath = (char **) xrealloc ((char *) vpath, - (elem + 1) * sizeof (char *)); - - /* Put the nil-pointer terminator on the end of the VPATH list. */ - vpath[elem] = 0; - - /* Construct the vpath structure and put it into the linked list. */ - path = (struct vpath *) xmalloc (sizeof (struct vpath)); - path->searchpath = vpath; - path->maxlen = maxvpath; - path->next = vpaths; - vpaths = path; - - /* Set up the members. */ - path->pattern = pattern; - path->percent = percent; - path->patlen = strlen (pattern); - } - else - { - /* There were no entries, so free whatever space we allocated. */ - free ((char *) vpath); - if (pattern != 0) - free (pattern); - } -} - -/* Search the VPATH list whose pattern matches *FILE for a directory - where the name pointed to by FILE exists. If it is found, we set *FILE to - the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is - not NULL) to its modtime (or zero if no stat call was done), and return 1. - Otherwise we return 0. */ - -int -vpath_search (file, mtime_ptr) - char **file; - time_t *mtime_ptr; -{ - register struct vpath *v; - - /* If there are no VPATH entries or FILENAME starts at the root, - there is nothing we can do. */ - - if (**file == '/' || (vpaths == 0 && general_vpath == 0)) - return 0; - - for (v = vpaths; v != 0; v = v->next) - if (pattern_matches (v->pattern, v->percent, *file)) - if (selective_vpath_search (v, file, mtime_ptr)) - return 1; - - if (general_vpath != 0 - && selective_vpath_search (general_vpath, file, mtime_ptr)) - return 1; - - return 0; -} - - -/* Search the given VPATH list for a directory where the name pointed - to by FILE exists. If it is found, we set *FILE to the newly malloc'd - name of the existing file, *MTIME_PTR (if MTIME_PTR is not NULL) to - its modtime (or zero if no stat call was done), and we return 1. - Otherwise we return 0. */ - -static int -selective_vpath_search (path, file, mtime_ptr) - struct vpath *path; - char **file; - time_t *mtime_ptr; -{ - int not_target; - char *name, *n; - char *filename; - register char **vpath = path->searchpath; - unsigned int maxvpath = path->maxlen; - register unsigned int i; - unsigned int flen, vlen, name_dplen; - int exists = 0; - - /* Find out if *FILE is a target. - If and only if it is NOT a target, we will accept prospective - files that don't exist but are mentioned in a makefile. */ - { - struct file *f = lookup_file (*file); - not_target = f == 0 || !f->is_target; - } - - flen = strlen (*file); - - /* Split *FILE into a directory prefix and a name-within-directory. - NAME_DPLEN gets the length of the prefix; FILENAME gets the - pointer to the name-within-directory and FLEN is its length. */ - - n = rindex (*file, '/'); - name_dplen = n != 0 ? n - *file : 0; - filename = name_dplen > 0 ? n + 1 : *file; - if (name_dplen > 0) - flen -= name_dplen + 1; - - /* Allocate enough space for the biggest VPATH entry, - a slash, the directory prefix that came with *FILE, - another slash (although this one may not always be - necessary), the filename, and a null terminator. */ - name = (char *) alloca (maxvpath + 1 + name_dplen + 1 + flen + 1); - - /* Try each VPATH entry. */ - for (i = 0; vpath[i] != 0; ++i) - { - int exists_in_cache = 0; - - n = name; - - /* Put the next VPATH entry into NAME at N and increment N past it. */ - vlen = strlen (vpath[i]); - bcopy (vpath[i], n, vlen); - n += vlen; - - /* Add the directory prefix already in *FILE. */ - if (name_dplen > 0) - { - *n++ = '/'; - bcopy (*file, n, name_dplen); - n += name_dplen; - } - - /* Now add the name-within-directory at the end of NAME. */ - if (n != name && n[-1] != '/') - { - *n = '/'; - bcopy (filename, n + 1, flen + 1); - } - else - bcopy (filename, n, flen + 1); - - /* Check if the file is mentioned in a makefile. If *FILE is not - a target, that is enough for us to decide this file exists. - If *FILE is a target, then the file must be mentioned in the - makefile also as a target to be chosen. - - The restriction that *FILE must not be a target for a - makefile-mentioned file to be chosen was added by an - inadequately commented change in July 1990; I am not sure off - hand what problem it fixes. - - In December 1993 I loosened of this restriction to allow a file - to be chosen if it is mentioned as a target in a makefile. This - seem logical. */ - { - struct file *f = lookup_file (name); - if (f != 0) - exists = not_target || f->is_target; - } - - if (!exists) - { - /* That file wasn't mentioned in the makefile. - See if it actually exists. */ - - /* Clobber a null into the name at the last slash. - Now NAME is the name of the directory to look in. */ - *n = '\0'; - - /* We know the directory is in the hash table now because either - construct_vpath_list or the code just above put it there. - Does the file we seek exist in it? */ - exists_in_cache = exists = dir_file_exists_p (name, filename); - } - - if (exists) - { - /* The file is in the directory cache. - Now check that it actually exists in the filesystem. - The cache may be out of date. When vpath thinks a file - exists, but stat fails for it, confusion results in the - higher levels. */ - - struct stat st; - - /* Put the slash back in NAME. */ - *n = '/'; - - if (!exists_in_cache /* Makefile-mentioned file need not exist. */ - || safe_stat (name, &st) == 0) /* Does it really exist? */ - { - /* We have found a file. - Store the name we found into *FILE for the caller. */ - - *file = savestring (name, (n + 1 - name) + flen); - - if (mtime_ptr != 0) - /* Store the modtime into *MTIME_PTR for the caller. - If we have had no need to stat the file here, - we record a zero modtime to indicate this. */ - *mtime_ptr = exists_in_cache ? st.st_mtime : (time_t) 0; - - return 1; - } - else - exists = 0; - } - } - - return 0; -} - -/* Print the data base of VPATH search paths. */ - -void -print_vpath_data_base () -{ - register unsigned int nvpaths; - register struct vpath *v; - - puts ("\n# VPATH Search Paths\n"); - - nvpaths = 0; - for (v = vpaths; v != 0; v = v->next) - { - register unsigned int i; - - ++nvpaths; - - printf ("vpath %s ", v->pattern); - - for (i = 0; v->searchpath[i] != 0; ++i) - printf ("%s%c", v->searchpath[i], - v->searchpath[i + 1] == 0 ? '\n' : PATH_SEPARATOR_CHAR); - } - - if (vpaths == 0) - puts ("# No `vpath' search paths."); - else - printf ("\n# %u `vpath' search paths.\n", nvpaths); - - if (general_vpath == 0) - puts ("\n# No general (`VPATH' variable) search path."); - else - { - register char **path = general_vpath->searchpath; - register unsigned int i; - - fputs ("\n# General (`VPATH' variable) search path:\n# ", stdout); - - for (i = 0; path[i] != 0; ++i) - printf ("%s%c", path[i], - path[i + 1] == 0 ? '\n' : PATH_SEPARATOR_CHAR); - } -} diff --git a/buildtools/windows/source/make/windir.h b/buildtools/windows/source/make/windir.h deleted file mode 100644 index 0ea444e1e0a..00000000000 --- a/buildtools/windows/source/make/windir.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef WINDIR_H -#define WINDIR_H - -#include -#include - -struct dirent { - char *d_name; -}; -typedef struct { - HANDLE dp; - WIN32_FIND_DATA fdata; - struct dirent de; -} dir_s; -typedef dir_s DIR; - -DIR *opendir(char *); -struct dirent *readdir(DIR *); -void closedir(DIR *); - -#endif diff --git a/buildtools/windows/source/shmsdos/README b/buildtools/windows/source/shmsdos/README deleted file mode 100644 index 7acdac02ac0..00000000000 --- a/buildtools/windows/source/shmsdos/README +++ /dev/null @@ -1,27 +0,0 @@ -This directory contains the source files for shmsdos.exe and -nsinstall.exe, which are used in conjunction with gmake.exe -to build some components of the Mozilla client on Win32. - -The tool shmsdos.exe is a very lightweight shell. It is -the default shell for our gmake.exe. shmsdos.exe implements -several common Unix utilities as built-in commands, such as -mv, cp, rm, echo, mkdir, etc. It only implements very -limited shell features. It can do if-then-else and for loops, -but it can't do variables, pipes, standard I/O redicrection, etc. - -It is possible to use a real Bourne shell with our gmake.exe -by defining the SHELL variable in your makefiles. Our gmake.exe -works with the Korn shell (sh.exe) of MKS Toolkit. If you go -this route, you will also need nsinstall.exe. (nsinstall is -a built-in command for shmsdos.exe.) - -To build shmsdos.exe, you need Microsoft Visual C++ and nmake. -Just issue the command: - nmake /f shmsdos.mak -The output is Release\shmsdos.exe. Copy it to a directory on -your Path. - -To build nsinstall.exe, issue the command: - nmake /f nsinstall.mak -The output is Release\nsinstall.exe. Copy it to a directory -on your Path. diff --git a/buildtools/windows/source/shmsdos/nsinstall.c b/buildtools/windows/source/shmsdos/nsinstall.c deleted file mode 100644 index 2a0a11d4bb8..00000000000 --- a/buildtools/windows/source/shmsdos/nsinstall.c +++ /dev/null @@ -1,697 +0,0 @@ -/* - * The nsinstall command for Win32 - * - * Our gmake makefiles use the nsinstall command to create the - * object directories or installing headers and libs to ns/dist. - * The shmsdos shell has nsinstall as a built-in command. However, - * if we use another shell like MKS toolkit's sh, we need to have - * the nsinstall command separately. - * - * This file was generated by just taking the part of shmsdos.c - * needed by nsinstall and deleting the recursive directory copy code. - * - * To build, say - * nmake /f nsinstall.mak - */ - -#include -#include -#include -#include -#include -#pragma hdrstop - -/* - * sh_FileFcn -- - * - * A function that operates on a file. The pathname is either - * absolute or relative to the current directory, and contains - * no wildcard characters such as * and ?. Additional arguments - * can be passed to the function via the arg pointer. - */ - -typedef BOOL (*sh_FileFcn)( - char *pathName, - WIN32_FIND_DATA *fileData, - void *arg); - -static int shellCp (char **pArgv); -static int shellNsinstall (char **pArgv); -static int shellMkdir (char **pArgv); -static BOOL sh_EnumerateFiles(const char *pattern, const char *where, - sh_FileFcn fileFcn, void *arg, int *nFiles); -static const char *sh_GetLastErrorMessage(void); -static BOOL sh_DoCopy(char *srcFileName, DWORD srcFileAttributes, - char *dstFileName, DWORD dstFileAttributes, - int force, int recursive); - -/* changes all forward slashes in token to back slashes */ -void changeForwardSlashesTpBackSlashes ( char *arg ) -{ - if ( arg == NULL ) - return; - - while ( *arg ) { - if ( *arg == '/' ) - *arg = '\\'; - arg++; - } -} - -int main(int argc, char *argv[ ]) -{ - return shellNsinstall ( argv + 1 ); -} - -static int -shellNsinstall (char **pArgv) -{ - int retVal = 0; /* exit status */ - int dirOnly = 0; /* 1 if and only if -D is specified */ - char **pSrc; - char **pDst; - - /* - * Process the command-line options. We ignore the - * options except for -D. Some options, such as -m, - * are followed by an argument. We need to skip the - * argument too. - */ - while ( *pArgv && **pArgv == '-' ) { - char c = (*pArgv)[1]; /* The char after '-' */ - - if ( c == 'D' ) { - dirOnly = 1; - } else if ( c == 'm' ) { - pArgv++; /* skip the next argument */ - } - pArgv++; - } - - if ( !dirOnly ) { - /* There are files to install. Get source files */ - if ( *pArgv ) { - pSrc = pArgv++; - } else { - fprintf( stderr, "nsinstall: not enough arguments\n"); - return 3; - } - } - - /* Get to last token to find destination directory */ - if ( *pArgv ) { - pDst = pArgv++; - if ( dirOnly && *pArgv ) { - fprintf( stderr, "nsinstall: too many arguments with -D\n"); - return 3; - } - } else { - fprintf( stderr, "nsinstall: not enough arguments\n"); - return 3; - } - while ( *pArgv ) - pDst = pArgv++; - - retVal = shellMkdir ( pDst ); - if ( retVal ) - return retVal; - if ( !dirOnly ) - retVal = shellCp ( pSrc ); - return retVal; -} - -static int -shellMkdir (char **pArgv) -{ - int retVal = 0; /* assume valid return */ - char *arg; - char *pArg; - char path[_MAX_PATH]; - char tmpPath[_MAX_PATH]; - char *pTmpPath = tmpPath; - - /* All the options are simply ignored in this implementation */ - while ( *pArgv && **pArgv == '-' ) { - if ( (*pArgv)[1] == 'm' ) { - pArgv++; /* skip the next argument (mode) */ - } - pArgv++; - } - - while ( *pArgv ) { - arg = *pArgv; - changeForwardSlashesTpBackSlashes ( arg ); - pArg = arg; - pTmpPath = tmpPath; - while ( 1 ) { - /* create part of path */ - while ( *pArg ) { - *pTmpPath++ = *pArg++; - if ( *pArg == '\\' ) - break; - } - *pTmpPath = '\0'; - - /* check if directory alreay exists */ - _getcwd ( path, sizeof (path) ); - if ( _chdir ( tmpPath ) != -1 ) { - _chdir ( path ); - } else { - if ( _mkdir ( tmpPath ) == -1 ) { -// while ( waitForDebug ); - printf ( "%s: ", tmpPath ); - perror ( "Could not create the directory" ); - retVal = 3; - break; - } - } - if ( *pArg == '\0' ) /* complete path? */ - break; - /* loop for next directory */ - } - - pArgv++; - } - return retVal; -} - -static const char * -sh_GetLastErrorMessage() -{ - static char buf[128]; - - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* default language */ - buf, - sizeof(buf), - NULL - ); - return buf; -} - -/* - * struct sh_FileData -- - * - * A pointer to the sh_FileData structure is passed into sh_RecordFileData, - * which will fill in the fields. - */ - -struct sh_FileData { - char pathName[_MAX_PATH]; - DWORD dwFileAttributes; -}; - -/* - * sh_RecordFileData -- - * - * Record the pathname and attributes of the file in - * the sh_FileData structure pointed to by arg. - * - * Always return TRUE (successful completion). - * - * This function is intended to be passed into sh_EnumerateFiles - * to see if a certain pattern expands to exactly one file/directory, - * and if so, record its pathname and attributes. - */ - -static BOOL -sh_RecordFileData(char *pathName, WIN32_FIND_DATA *findData, void *arg) -{ - struct sh_FileData *fData = (struct sh_FileData *) arg; - - strcpy(fData->pathName, pathName); - fData->dwFileAttributes = findData->dwFileAttributes; - return TRUE; -} - -static BOOL -sh_DoCopy(char *srcFileName, - DWORD srcFileAttributes, - char *dstFileName, - DWORD dstFileAttributes, - int force, - int recursive -) -{ - if (dstFileAttributes != 0xFFFFFFFF) { - if ((dstFileAttributes & FILE_ATTRIBUTE_READONLY) && force) { - dstFileAttributes &= ~FILE_ATTRIBUTE_READONLY; - SetFileAttributes(dstFileName, dstFileAttributes); - } - } - - if (srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - fprintf(stderr, "nsinstall: %s is a directory\n", - srcFileName); - return FALSE; - } else { - if (!CopyFile(srcFileName, dstFileName, FALSE)) { - fprintf(stderr, "nsinstall: cannot copy %s to %s: %s\n", - srcFileName, dstFileName, sh_GetLastErrorMessage()); - return FALSE; - } - } - return TRUE; -} - -/* - * struct sh_CpCmdArg -- - * - * A pointer to the sh_CpCmdArg structure is passed into sh_CpFileCmd. - * The sh_CpCmdArg contains information about the cp command, and - * provide a buffer for constructing the destination file name. - */ - -struct sh_CpCmdArg { - int force; /* -f option, ok to overwrite an existing - * read-only destination file */ - int recursive; /* -r or -R option, recursively copy - * directories. Note: this field is not used - * by nsinstall and should always be 0. */ - char *dstFileName; /* a buffer for constructing the destination - * file name */ - char *dstFileNameMarker; /* points to where in the dstFileName buffer - * we should write the file component of the - * destination file */ -}; - -/* - * sh_CpFileCmd -- - * - * Copy a file to the destination directory - * - * This function is intended to be passed into sh_EnumerateFiles to - * copy all the files specified by the pattern to the destination - * directory. - * - * Return TRUE if the file is successfully copied, and FALSE otherwise. - */ - -static BOOL -sh_CpFileCmd(char *pathName, WIN32_FIND_DATA *findData, void *cpArg) -{ - BOOL retVal = TRUE; - struct sh_CpCmdArg *arg = (struct sh_CpCmdArg *) cpArg; - - strcpy(arg->dstFileNameMarker, findData->cFileName); - return sh_DoCopy(pathName, findData->dwFileAttributes, - arg->dstFileName, GetFileAttributes(arg->dstFileName), - arg->force, arg->recursive); -} - -static int -shellCp (char **pArgv) -{ - int retVal = 0; - char **pSrc; - char **pDst; - struct sh_CpCmdArg arg; - struct sh_FileData dstData; - int dstIsDir = 0; - int n; - - arg.force = 0; - arg.recursive = 0; - arg.dstFileName = dstData.pathName; - arg.dstFileNameMarker = 0; - - while (*pArgv && **pArgv == '-') { - char *p = *pArgv; - - while (*(++p)) { - if (*p == 'f') { - arg.force = 1; - } - } - pArgv++; - } - - /* the first source file */ - if (*pArgv) { - pSrc = pArgv++; - } else { - fprintf(stderr, "nsinstall: not enough arguments\n"); - return 3; - } - - /* get to the last token to find destination */ - if (*pArgv) { - pDst = pArgv++; - } else { - fprintf(stderr, "nsinstall: not enough arguments\n"); - return 3; - } - while (*pArgv) { - pDst = pArgv++; - } - - /* - * The destination pattern must unambiguously expand to exactly - * one file or directory. - */ - - changeForwardSlashesTpBackSlashes(*pDst); - sh_EnumerateFiles(*pDst, *pDst, sh_RecordFileData, &dstData, &n); - assert(n >= 0); - if (n == 1) { - /* - * Is the destination a file or directory? - */ - - if (dstData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - dstIsDir = 1; - } - } else if (n > 1) { - fprintf(stderr, "nsinstall: %s: ambiguous destination file " - "or directory\n", *pDst); - return 3; - } else { - /* - * n == 0, meaning that destination file or directory does - * not exist. In this case the destination file directory - * name must be fully specified. - */ - - char *p; - - for (p = *pDst; *p; p++) { - if (*p == '*' || *p == '?') { - fprintf(stderr, "nsinstall: %s: No such file or directory\n", - *pDst); - return 3; - } - } - - /* - * Do not include the trailing \, if any, unless it is a root - * directory (\ or X:\). - */ - - if (p > *pDst && p[-1] == '\\' && p != *pDst + 1 && p[-2] != ':') { - p[-1] = '\0'; - } - strcpy(dstData.pathName, *pDst); - dstData.dwFileAttributes = 0xFFFFFFFF; - } - - /* - * If there are two or more source files, the destination has - * to be a directory. - */ - - if (pDst - pSrc > 1 && !dstIsDir) { - fprintf(stderr, "nsinstall: cannot copy more than" - " one file to the same destination file\n"); - return 3; - } - - if (dstIsDir) { - arg.dstFileNameMarker = arg.dstFileName + strlen(arg.dstFileName); - - /* - * Now arg.dstFileNameMarker is pointing to the null byte at the - * end of string. We want to make sure that there is a \ at the - * end of string, and arg.dstFileNameMarker should point right - * after that \. - */ - - if (arg.dstFileNameMarker[-1] != '\\') { - *(arg.dstFileNameMarker++) = '\\'; - } - } - - if (!dstIsDir) { - struct sh_FileData srcData; - - assert(pDst - pSrc == 1); - changeForwardSlashesTpBackSlashes(*pSrc); - sh_EnumerateFiles(*pSrc, *pSrc, sh_RecordFileData, &srcData, &n); - if (n == 0) { - fprintf(stderr, "nsinstall: %s: No such file or directory\n", - *pSrc); - retVal = 3; - } else if (n > 1) { - fprintf(stderr, "nsinstall: cannot copy more than one file or " - "directory to the same destination\n"); - retVal = 3; - } else { - assert(n == 1); - if (sh_DoCopy(srcData.pathName, srcData.dwFileAttributes, - dstData.pathName, dstData.dwFileAttributes, - arg.force, arg.recursive) == FALSE) { - retVal = 3; - } - } - return retVal; - } - - for ( ; *pSrc != *pDst; pSrc++) { - BOOL rv; - - changeForwardSlashesTpBackSlashes(*pSrc); - rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_CpFileCmd, &arg, &n); - if (rv == FALSE) { - retVal = 3; - } else { - if (n == 0) { - fprintf(stderr, "nsinstall: %s: No such file or directory\n", - *pSrc); - retVal = 3; - } - } - } - - return retVal; -} - -/* - * sh_EnumerateFiles -- - * - * Enumerate all the files in the specified pattern, which is a pathname - * containing possibly wildcard characters such as * and ?. fileFcn - * is called on each file, passing the expanded file name, a pointer - * to the file's WIN32_FILE_DATA, and the arg pointer. - * - * It is assumed that there are no wildcard characters before the - * character pointed to by 'where'. - * - * On return, *nFiles stores the number of files enumerated. *nFiles is - * set to this number whether sh_EnumerateFiles or 'fileFcn' succeeds - * or not. - * - * Return TRUE if the files are successfully enumerated and all - * 'fileFcn' invocations succeeded. Return FALSE if something went - * wrong. - */ - -static BOOL sh_EnumerateFiles( - const char *pattern, - const char *where, - sh_FileFcn fileFcn, - void *arg, - int *nFiles - ) -{ - WIN32_FIND_DATA fileData; - HANDLE hSearch; - const char *src; - char *dst; - char fileName[_MAX_PATH]; - char *fileNameMarker = fileName; - char *oldFileNameMarker; - BOOL hasWildcard = FALSE; - BOOL retVal = TRUE; - BOOL patternEndsInDotStar = FALSE; - BOOL patternEndsInDot = FALSE; /* a special case of - * patternEndsInDotStar */ - int numDotsInPattern; - int len; - - /* - * Windows expands patterns ending in ".", ".*", ".**", etc. - * differently from the glob expansion on Unix. For example, - * both "foo." and "foo.*" match "foo", and "*.*" matches - * everything, including filenames with no dots. So we need - * to throw away extra files returned by the FindNextFile() - * function. We require that a matched filename have at least - * the number of dots in the pattern. - */ - len = strlen(pattern); - if (len >= 2) { - /* Start from the end of pattern and go backward */ - const char *p = &pattern[len - 1]; - - /* We can have zero or more *'s */ - while (p >= pattern && *p == '*') { - p--; - } - if (p >= pattern && *p == '.') { - patternEndsInDotStar = TRUE; - if (p == &pattern[len - 1]) { - patternEndsInDot = TRUE; - } - p--; - numDotsInPattern = 1; - while (p >= pattern && *p != '\\') { - if (*p == '.') { - numDotsInPattern++; - } - p--; - } - } - } - - *nFiles = 0; - - /* - * Copy pattern to fileName, but only up to and not including - * the first \ after the first wildcard letter. - * - * Make fileNameMarker point to one of the following: - * - the start of fileName, if fileName does not contain any \. - * - right after the \ before the first wildcard letter, if there is - * a wildcard character. - * - right after the last \, if there is no wildcard character. - */ - - dst = fileName; - src = pattern; - while (src < where) { - if (*src == '\\') { - oldFileNameMarker = fileNameMarker; - fileNameMarker = dst + 1; - } - *(dst++) = *(src++); - } - - while (*src && *src != '*' && *src != '?') { - if (*src == '\\') { - oldFileNameMarker = fileNameMarker; - fileNameMarker = dst + 1; - } - *(dst++) = *(src++); - } - - if (*src) { - /* - * Must have seen the first wildcard letter - */ - - hasWildcard = TRUE; - while (*src && *src != '\\') { - *(dst++) = *(src++); - } - } - - /* Now src points to either null or \ */ - - assert(*src == '\0' || *src == '\\'); - assert(hasWildcard || *src == '\0'); - *dst = '\0'; - - /* - * If the pattern does not contain any wildcard characters, then - * we don't need to go the FindFirstFile route. - */ - - if (!hasWildcard) { - /* - * See if it is the root directory, \, or X:\. - */ - - assert(!strcmp(fileName, pattern)); - assert(strlen(fileName) >= 1); - if (dst[-1] == '\\' && (dst == fileName + 1 || dst[-2] == ':')) { - fileData.cFileName[0] = '\0'; - } else { - /* - * Do not include the trailing \, if any - */ - - if (dst[-1] == '\\') { - assert(*fileNameMarker == '\0'); - dst[-1] = '\0'; - fileNameMarker = oldFileNameMarker; - } - strcpy(fileData.cFileName, fileNameMarker); - } - fileData.dwFileAttributes = GetFileAttributes(fileName); - if (fileData.dwFileAttributes == 0xFFFFFFFF) { - return TRUE; - } - *nFiles = 1; - return (*fileFcn)(fileName, &fileData, arg); - } - - hSearch = FindFirstFile(fileName, &fileData); - if (hSearch == INVALID_HANDLE_VALUE) { - return retVal; - } - - do { - if (!strcmp(fileData.cFileName, ".") - || !strcmp(fileData.cFileName, "..")) { - /* - * Skip over . and .. - */ - - continue; - } - - if (patternEndsInDotStar) { - int nDots = 0; - char *p = fileData.cFileName; - while (*p) { - if (*p == '.') { - nDots++; - } - p++; - } - /* Now p points to the null byte at the end of file name */ - if (patternEndsInDot && (p == fileData.cFileName - || p[-1] != '.')) { - /* - * File name does not end in dot. Skip this file. - * Note: windows file name probably cannot end in dot, - * but we do this check anyway. - */ - continue; - } - if (nDots < numDotsInPattern) { - /* - * Not enough dots in file name. Must be an extra - * file in matching .* pattern. Skip this file. - */ - continue; - } - } - - strcpy(fileNameMarker, fileData.cFileName); - if (*src && *(src + 1)) { - /* - * More to go. Recurse. - */ - - int n; - - assert(*src == '\\'); - where = fileName + strlen(fileName); - strcat(fileName, src); - sh_EnumerateFiles(fileName, where, fileFcn, arg, &n); - *nFiles += n; - } else { - assert(strchr(fileName, '*') == NULL); - assert(strchr(fileName, '?') == NULL); - (*nFiles)++; - if ((*fileFcn)(fileName, &fileData, arg) == FALSE) { - retVal = FALSE; - } - } - } while (FindNextFile(hSearch, &fileData)); - - FindClose(hSearch); - return retVal; -} diff --git a/buildtools/windows/source/shmsdos/nsinstall.mak b/buildtools/windows/source/shmsdos/nsinstall.mak deleted file mode 100644 index b9ff221496a..00000000000 --- a/buildtools/windows/source/shmsdos/nsinstall.mak +++ /dev/null @@ -1,141 +0,0 @@ -# NMAKE file for building nsinstall.exe. -# -# This file is edited from an NMAKE file generated by -# Microsoft Developer Studio, Format Version 4.20 -# -# To build, say -# nmake /f nsinstall.mak CFG=Release -# or -# nmake /f nsinstall.mak CFG=Debug -# If CFG is omitted, a release build is assumed. - -!IF "$(CFG)" == "" -CFG=Release -!MESSAGE No configuration specified. Defaulting Release. -!ENDIF - -!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE on this makefile -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "nsinstall.mak" CFG="Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Release" (based on "Win32 Console Application") -!MESSAGE "Debug" (based on "Win32 Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF -################################################################################ -# Begin Project -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Release" - -OUTDIR=.\Release -INTDIR=.\Release - -ALL : "$(OUTDIR)\nsinstall.exe" - -CLEAN : - -@erase "$(INTDIR)\nsinstall.obj" - -@erase "$(OUTDIR)\nsinstall.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\ - /Fp"$(INTDIR)/nsinstall.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Release/ -CPP_SBRS=.\. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)/nsinstall.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=/nologo\ - /subsystem:console /incremental:no /pdb:"$(OUTDIR)/nsinstall.pdb"\ - /out:"$(OUTDIR)/nsinstall.exe" -LINK32_OBJS= \ - "$(INTDIR)\nsinstall.obj" - -"$(OUTDIR)\nsinstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug - -ALL : "$(OUTDIR)\nsinstall.exe" - -CLEAN : - -@erase "$(INTDIR)\nsinstall.obj" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\nsinstall.exe" - -@erase "$(OUTDIR)\nsinstall.ilk" - -@erase "$(OUTDIR)\nsinstall.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "DEBUG"\ - /D "_CONSOLE" /Fp"$(INTDIR)/nsinstall.pch" /YX /Fo"$(INTDIR)/"\ - /Fd"$(INTDIR)/" /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)/nsinstall.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=/nologo\ - /subsystem:console /incremental:yes /pdb:"$(OUTDIR)/nsinstall.pdb" /debug\ - /out:"$(OUTDIR)/nsinstall.exe" -LINK32_OBJS= \ - "$(INTDIR)\nsinstall.obj" - -"$(OUTDIR)\nsinstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -################################################################################ -# Begin Target - -################################################################################ -# Begin Source File - -SOURCE=.\nsinstall.c -DEP_CPP_SHMSD=\ - {$(INCLUDE)}"\sys\stat.h"\ - {$(INCLUDE)}"\sys\types.h"\ - - -"$(INTDIR)\nsinstall.obj" : $(SOURCE) $(DEP_CPP_SHMSD) "$(INTDIR)" - - -# End Source File -# End Target -# End Project -################################################################################ diff --git a/buildtools/windows/source/shmsdos/shmsdos.c b/buildtools/windows/source/shmsdos/shmsdos.c deleted file mode 100644 index f8274fd74ed..00000000000 --- a/buildtools/windows/source/shmsdos/shmsdos.c +++ /dev/null @@ -1,2573 +0,0 @@ -/*********************************************************** - * shmsdos - unix shell for msdos - **********************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#pragma hdrstop - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE !FALSE -#endif - -#define index(s, c) strchr((s), (c)) -#define streq(a, b) (strcmp ((a), (b)) == 0) - -#define SH_CMD_CD 0 -#define SH_CMD_EVAL 1 -#define SH_CMD_EXEC 2 -#define SH_CMD_EXIT 3 -#define SH_CMD_LOGIN 4 -#define SH_CMD_LOGOUT 5 -#define SH_CMD_SET 6 -#define SH_CMD_UMASK 7 -#define SH_CMD_WAIT 8 -#define SH_CMD_WHILE 9 -#define SH_CMD_FOR 10 -#define SH_CMD_CASE 11 -#define SH_CMD_IF 12 -#define SH_CMD_COLON 13 -#define SH_CMD_PERIOD 14 -#define SH_CMD_BREAK 15 -#define SH_CMD_CONTINUE 16 -#define SH_CMD_EXPORT 17 -#define SH_CMD_READ 18 -#define SH_CMD_READONLY 19 -#define SH_CMD_SHIFT 20 -#define SH_CMD_TIMES 21 -#define SH_CMD_TRAP 22 -#define SH_CMD_SWITCH 23 -#define SH_CMD_MKDIR 24 -#define SH_CMD_ECHO 25 -#define SH_CMD_CP 26 -#define SH_CMD_RM 27 -#define SH_CMD_TOUCH 28 -#define SH_CMD_NSINSTALL 29 -#define SH_CMD_TEST 30 -#define SH_CMD_CAT 31 -#define SH_CMD_TRUE 32 -#define SH_CMD_MV 33 - -#define COND_WHILE 0 -#define COND_FOR 1 -#define COND_CASE 2 -#define COND_IF 3 -#define COND_BREAK 4 -#define COND_CONTINUE 5 -#define COND_SHIFT 6 -#define COND_TIMES 7 -#define COND_SWITCH 8 -#define COND_FI 9 -#define COND_THEN 10 -#define COND_ELSE 11 -#define COND_DONE 12 -#define COND_DO 13 - -/* - * sh_FileFcn -- - * - * A function that operates on a file. The pathname is either - * absolute or relative to the current directory, and contains - * no wildcard characters such as * and ?. Additional arguments - * can be passed to the function via the arg pointer. - */ - -typedef BOOL (*sh_FileFcn)( - char *pathName, - WIN32_FIND_DATA *fileData, - void *arg); - -//static char sh_chars[] = "#;\"*?[]&|<>(){}$`^"; -static char sh_chars[] = ";"; -static char *conditional_cmds[] = { "while", "for", - "case", "if", "break", "continue", - "shift", "times", "switch", "fi", "then", "else", "done", "do", 0 }; - -static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login", - "logout", "set", "umask", "wait", "while", "for", - "case", "if", ":", ".", "break", "continue", - "export", "read", "readonly", "shift", "times", - "trap", "switch", "mkdir", "echo", "cp", "rm", - "touch", "nsinstall", "test", "cat", "true", "mv", 0 }; - -static char ** getNextCommandArgv (char **line, char * pMacro, char * pSubstitution); -static int doBuiltinShellCommand (char *argv[ ], char **envp); -static char ** getlistOfOptions (char **pArgv, char * pOptions); -static int parseShellLine ( char** pointerIntoLine, char *argv[ ], char *envp[ ], - char * pMacro, char * pSubstitution ); -static void freeArgv ( char *argv[ ] ); -static int shellCp (char **pArgv); -static int shellEcho (char **pArgv); -static int shellRm (char **pArgv); -static int shellNsinstall (char **pArgv); -static int shellMkdir (char **pArgv); -static int shellTest (char **pArgv); -static int shellCat (char **pArgv); -static int shellMv (char **pArgv); -static BOOL sh_EnumerateFiles(const char *pattern, const char *where, - sh_FileFcn fileFcn, void *arg, int *nFiles); -static const char *sh_GetLastErrorMessage(void); -static BOOL sh_DoCopy(char *srcFileName, DWORD srcFileAttributes, - char *dstFileName, DWORD dstFileAttributes, - int force, int recursive); - -static int waitForDebug = 1; - -char * next_token( char *p) -{ - while ( *p == ' ' || *p == '\t' ) - ++p; - return p; -} - -static char* convertArgvIntoCommandLine( int argc, char *argv[ ] ) -{ - char *pLine; - char *p; - int argi; - int totalLength = 0; - - /* get total # of characters in command line */ - argi = 2; - while ( argi < argc ) { - if ( argv[argi] ) - totalLength += strlen ( argv[argi] ) + 1; - argi++; - } - - /* allocate memory for the command line */ - pLine = (char *) malloc (totalLength * sizeof (char *)); - if ( pLine == NULL ) { - printf ("Not enough memory in SHMSDOS\n"); - exit(1); - } - /* compress all tokens into single command line */ - argi = 2; - p = pLine; - while ( argi < argc ) { - char *pArgv = argv[argi]; - while ( *pArgv ) - *p++ = *pArgv++; - argi++; - *p++ = ' '; - } - - /* remove trailing blanks */ - while ( (p > pLine) && (*(p-1) == ' ' ) ) - *(--p) = '\0'; - - return pLine; -} - -main( int argc, char *argv[ ], char *envp[ ] ) -{ - int status; - char* pointerIntoLine; - char **newArgv; - - char * pLine = convertArgvIntoCommandLine( argc, argv ); - pointerIntoLine = pLine; - - while ( TRUE ) { - newArgv = getNextCommandArgv ( &pointerIntoLine, NULL, NULL ); - if ( newArgv == 0 ) - break; - - status = parseShellLine ( &pointerIntoLine, newArgv, envp, NULL, NULL ); - freeArgv ( newArgv ); - if ( status != 0 ) - break; - } - - /* process each shell command */ - free ( pLine ); - return status; -} - - /* process each shell command */ -int getConditionalCommand ( char * shellName ) -{ - int shellCommand = -1; - int j; - - /* search for shell name */ - for (j = 0; conditional_cmds[j] != 0; ++j) { - if ( streq (conditional_cmds[j], shellName) ) { - shellCommand = j; - break; - } - } - return shellCommand; -} - -/* - if list then list [ elif list then list ] ... [ else list ] fi - The list following if is executed and, if it returns a zero exit - status, the list following the first then is executed. Otherwise, - the list following elif is executed and, if its value is zero, the - list following the next then is executed. Failing that, the else - list is executed. If no else list or then list is executed, then - the if command returns a zero exit status. - */ -int parseIfCommand ( char** pointerIntoLine, char *argv[ ], char *envp[ ], - char * pMacro, char * pSubstitution ) -{ - int ifTestedTrue; - int status = 0; - int shellCommand; - char **pArgv; - - /* check test condition */ -// while ( waitForDebug ); - ifTestedTrue = doBuiltinShellCommand ( argv, envp ); - if ( (ifTestedTrue != 0) && (ifTestedTrue != 1) ) { - printf ( "Error executing command %s while processing 'if'\n", argv[0] ); - return ifTestedTrue; - } - ifTestedTrue = !ifTestedTrue; - - while ( TRUE ) { - - char **newArgv = getNextCommandArgv ( pointerIntoLine, pMacro, pSubstitution ); - if ( newArgv == 0 ) { - status = -1; - break; - } - pArgv = newArgv; - - /* get next shell command */ - shellCommand = getConditionalCommand ( newArgv[0] ); - if ( shellCommand == COND_FI ) { - status = 0; - freeArgv ( newArgv ); - break; - } else if ( shellCommand == COND_THEN ) { - pArgv++; - } else if ( shellCommand == COND_ELSE ) { - pArgv++; - ifTestedTrue = !ifTestedTrue; - } - if ( ifTestedTrue ) - status = parseShellLine ( pointerIntoLine, pArgv, envp, pMacro, pSubstitution ); - else - status = 0; - freeArgv ( newArgv ); - if ( status != 0 ) - break; - } - - return status; -} -/* - for name [ in word ... ] do list done - Each time a for command is executed, name is set to the next word - taken from the in word list. If in word ... is omitted, then the - for command executes the do list once for each positional parameter - that is set (see Parameter Substitution below). Execution ends when - there are no more words in the list. - */ -int parseForCommand ( char** pointerIntoLine, char *argv[ ], char *envp[ ] ) -{ - int status = 0; - int shellCommand; - char **pArgv = argv; - char * pMacro; - char ** pWord; - char* doPointerIntoLine; - - // get name of macro - pMacro = *pArgv++; - - if ( strcmp ( "in" , *pArgv ) != 0 ) { - exit (1); - } - pArgv++; - pWord = pArgv; - - - - /* check test condition */ -// while ( waitForDebug ); - doPointerIntoLine = *pointerIntoLine; - while ( *pWord ) { - - while ( TRUE ) { - char **newArgv = getNextCommandArgv ( pointerIntoLine, pMacro, *pWord ); - if ( newArgv == 0 ) { - status = -1; - break; - } - pArgv = newArgv; - - shellCommand = getConditionalCommand ( *pArgv ); - if ( shellCommand == COND_DO ) { - pArgv++; - } - - /* get next shell command */ - if ( shellCommand == COND_DONE ) { - status = 0; - freeArgv ( newArgv ); - break; - } - status = parseShellLine ( pointerIntoLine, pArgv, envp, pMacro, *pWord ); - freeArgv ( newArgv ); - if ( status != 0 ) - break; - } - pWord++; - if ( status != 0 ) - break; - - /* if another word exists in list, then repeat */ - if ( *pWord ) - *pointerIntoLine = doPointerIntoLine; - } - - return status; -} -/* process each shell command */ -int parseShellLine ( char** pointerIntoLine, char *argv[ ], char *envp[ ], - char * pMacro, char * pSubstitution ) -{ - int shellCommand; - char **pArgv; - int status; - - /* search for shell name */ - shellCommand = getConditionalCommand ( argv[0] ); - - /* process shell command */ - - if ( shellCommand == -1 ) { - status = doBuiltinShellCommand ( argv, envp ); - } else { - pArgv = &argv[1]; - switch ( shellCommand ) { - case COND_IF: - status = parseIfCommand ( pointerIntoLine, pArgv, envp, pMacro, pSubstitution ); - break; - case COND_FOR: - status = parseForCommand ( pointerIntoLine, pArgv, envp ); - break; - default: - printf ( "Unexpected conditional command: -%s-\n", argv[0] ); - status = -1; - break; - } - } - return status; -} - -/* Figure out the argument list necessary to run LINE as a command. Try to - avoid using a shell. This routine handles only ' quoting, and " quoting - when no backslash, $ or ` characters are seen in the quotes. Starting - quotes may be escaped with a backslash. If any of the characters in - sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[] - is the first word of a line, the shell is used. - - SHELL is the shell to use, or nil to use the default shell. - IFS is the value of $IFS, or nil (meaning the default). */ - -static char ** -getNextCommandArgv (char **pLine, char * pMacro, char * pSubstitution ) -{ - register int i; - register int lineLength; - register char *pp; - register char *p; - register char *ap; - char *line = *pLine; - char *end; - int instring, word_has_equals, seen_nonequals; - char **new_argv = 0; - int foundStartOfLine; - int iSubstitutionLen; - - /* Make sure not to bother processing an empty line. */ - foundStartOfLine = FALSE; - while ( !foundStartOfLine ) { - switch ( *line ) { - case ';': - case '\t': - case ' ': - ++line; - break; - - case '\\': - if ( *(line+1) == 't') { - line += 2; - break; - } - - default: - foundStartOfLine = TRUE; - break; - } - } - - if (*line == '\0') - return 0; - - /* get maximum length of length with arguments substituted */ - i = strlen (line) + 1; - lineLength = i; - - - /* More than 1 arg per character is impossible. */ - new_argv = (char **) malloc (i * sizeof (char *)); - if ( new_argv == NULL ) { - printf ("Not enough memory in SHMSDOS\n"); - exit(1); - } - - /* increase size of parameters by macro substitution */ - pp = line; - if ( pSubstitution ) { - iSubstitutionLen = strlen ( pSubstitution ) - strlen ( pMacro ) - 1; - while ( *pp ) { - if ( *pp++ == '$' ) - lineLength += iSubstitutionLen; - } - } - - /* All the args can fit in a buffer as big as LINE is. */ - ap = new_argv[0] = (char *) malloc (lineLength); - if ( ap == NULL ) { - printf ("Not enough memory in SHMSDOS\n"); - exit(1); - } - end = ap + lineLength; - - /* I is how many complete arguments have been found. */ - i = 0; - instring = word_has_equals = seen_nonequals = 0; - for (p = line; *p != '\0'; ++p) - { - if (ap > end) - { - fprintf(stderr, "Internal error: stepping past the end of buffer, " - "at %s, line %d\n", __FILE__, __LINE__); - abort (); - } - - if (instring) - { - string_char: - /* Inside a string, just copy any char except a closing quote - or a backslash-newline combination. */ - if (*p == instring) - instring = 0; - else if (*p == '\\' && p[1] == '\n') - goto swallow_escaped_newline; - /* Backslash, $, and ` are special inside double quotes. - If we see any of those, punt. */ - else if (instring == '"' && *p == '\\' - && strchr("\\$`\"", p[1]) != NULL) - /* The backslash can be used to escape another special - character inside double quotes. */ - *ap++ = *++p; - else if (instring == '"' && *p == '$') - goto macroSubstitution; - else - *ap++ = *p; - } - else if (index (sh_chars, *p) != 0) - /* Not inside a string, but it's a special char. */ - goto slow; - else - /* Not a special char. */ - switch (*p) - { - case '=': - /* Equals is a special character in leading words before the - first word with no equals sign in it. This is not the case - with sh -k, but we never get here when using nonstandard - shell flags. */ - if (! seen_nonequals) - goto slow; - word_has_equals = 1; - *ap++ = '='; - break; - - case '\\': - /* Backslash-newline combinations are eaten. */ - if (p[1] == '\n') - { - swallow_escaped_newline: - - /* Eat the backslash, the newline, and following whitespace, - replacing it all with a single space. */ - p += 2; - - /* If there is a tab after a backslash-newline, - remove it from the source line which will be echoed, - since it was most likely used to line - up the continued line with the previous one. */ - if (*p == '\t') - strcpy (p, p + 1); - - if (instring) - goto string_char; - else - { - if (ap != new_argv[i]) - /* Treat this as a space, ending the arg. - But if it's at the beginning of the arg, it should - just get eaten, rather than becoming an empty arg. */ - goto end_of_arg; - else - p = next_token (p) - 1; - } - } - else if (p[1] != '\0') - /* Copy and skip the following char. */ - *ap++ = *++p; -// *ap++ = *p; - break; - - case '\'': - case '"': - instring = *p; - break; - - case '\n': - /* Newlines are not special. */ - *ap++ = '\n'; - break; - - case '$': -macroSubstitution: - if ( pMacro ) { - int len = strlen ( pMacro ); - if ( strncmp ( pMacro, p+1, len ) == 0 ) { - p += len; - strcpy ( ap, pSubstitution ); - ap += strlen ( pSubstitution ); - break; - } - } - - /* Newlines are not special. */ - *ap++ = *p; - break; - - case ' ': - case '\t': - end_of_arg: - /* We have the end of an argument. - Terminate the text of the argument. */ - *ap++ = '\0'; - new_argv[++i] = ap; - - /* Update SEEN_NONEQUALS, which tells us if every word - heretofore has contained an `='. */ - seen_nonequals |= ! word_has_equals; - if (word_has_equals && ! seen_nonequals) - /* An `=' in a word before the first - word without one is magical. */ - goto slow; - word_has_equals = 0; /* Prepare for the next word. */ - - /* Ignore multiple whitespace chars. */ - p = next_token (p); - /* Next iteration should examine the first nonwhite char. */ - --p; - break; - - default: - *ap++ = *p; - break; - } - } - - /* Terminate the last argument and the argument list. */ - -slow:; - *ap = '\0'; - if (new_argv[i][0] != '\0') - ++i; - new_argv[i] = 0; - - *pLine = p; /* return pointer into line */ - return new_argv; - -} - -static void -freeArgv ( char *argv[ ] ) -{ - free (argv[0]); - free (argv); -} - -/* changes all forward slashes in token to back slashes */ -void changeForwardSlashesTpBackSlashes ( char *arg ) -{ - if ( arg == NULL ) - return; - - /* get options for command */ - while ( *arg ) { - if ( *arg == '/' ) - *arg = '\\'; - arg++; - } -} - -/* - * The various spawn functions in Microsoft's runtime library - * may fail if the Path environment variable contains nonexistent - * directories. The spawn functions expect to get ENOENT in - * this situation, but on some Compaq PCs I've seen EACCES - * ("Permission denied") being returned. So I wrote our own - * process-spawning function ns_spawn(). My code is inspired - * by Microsoft's implementation of spawnvpe(). - */ - -/* - * Assemble the command line by concatenating the argv array. - * On success, this function returns 0 and the resulting command - * line is returned in *cmdLine. On failure, it returns -1. - */ -static int assembleCmdLine(char **argv, char **cmdLine) -{ - char **arg; - char *p, *q; - int cmdLineSize; - int numBackslashes; - int i; - int argNeedQuotes; - - /* - * Find out how large the command line buffer should be. - */ - cmdLineSize = 0; - for (arg = argv; *arg; arg++) { - /* - * \ and " need to be escaped by a \. In the worst case, - * every character is a \ or ", so the string of length - * may double. If we quote an argument, that needs two ". - * Finally, we need a space between arguments, and - * a null byte at the end of command line. - */ - cmdLineSize += 2 * strlen(*arg) /* \ and " need to be escaped */ - + 2 /* we quote every argument */ - + 1; /* space in between, or final null */ - } - p = *cmdLine = malloc(cmdLineSize); - if (p == NULL) { - return -1; - } - - for (arg = argv; *arg; arg++) { - /* Add a space to separates the arguments */ - if (arg != argv) { - *p++ = ' '; - } - q = *arg; - numBackslashes = 0; - argNeedQuotes = 0; - - /* If the argument contains white space, it needs to be quoted. */ - if (strpbrk(*arg, " \f\n\r\t\v")) { - argNeedQuotes = 1; - } - - if (argNeedQuotes) { - *p++ = '"'; - } - while (*q) { - if (*q == '\\') { - numBackslashes++; - q++; - } else if (*q == '"') { - if (numBackslashes) { - /* - * Double the backslashes since they are followed - * by a quote - */ - for (i = 0; i < 2 * numBackslashes; i++) { - *p++ = '\\'; - } - numBackslashes = 0; - } - /* To escape the quote */ - *p++ = '\\'; - *p++ = *q++; - } else { - if (numBackslashes) { - /* - * Backslashes are not followed by a quote, so - * don't need to double the backslashes. - */ - for (i = 0; i < numBackslashes; i++) { - *p++ = '\\'; - } - numBackslashes = 0; - } - *p++ = *q++; - } - } - - /* Now we are at the end of this argument */ - if (numBackslashes) { - /* - * Double the backslashes if we have a quote string - * delimiter at the end. - */ - if (argNeedQuotes) { - numBackslashes *= 2; - } - for (i = 0; i < numBackslashes; i++) { - *p++ = '\\'; - } - } - if (argNeedQuotes) { - *p++ = '"'; - } - } - - *p = '\0'; - return 0; -} - -/* - * Assemble the environment block by concatenating the envp array - * (preserving the terminating null byte in each array element) - * and adding a null byte at the end. - * - * Returns 0 on success. The resulting environment block is returned - * in *envBlock. Note that if envp is NULL, a NULL pointer is returned - * in *envBlock. Returns -1 on failure. - */ -static int assembleEnvBlock(char **envp, char **envBlock) -{ - char *p; - char *q; - char **env; - char *curEnv; - char *cwdStart, *cwdEnd; - int envBlockSize; - - if (envp == NULL) { - *envBlock = NULL; - return 0; - } - - curEnv = GetEnvironmentStrings(); - - cwdStart = curEnv; - while (*cwdStart) { - if (cwdStart[0] == '=' && cwdStart[1] != '\0' - && cwdStart[2] == ':' && cwdStart[3] == '=') { - break; - } - cwdStart += strlen(cwdStart) + 1; - } - cwdEnd = cwdStart; - if (*cwdEnd) { - cwdEnd += strlen(cwdEnd) + 1; - while (*cwdEnd) { - if (cwdEnd[0] != '=' || cwdEnd[1] == '\0' - || cwdEnd[2] != ':' || cwdEnd[3] != '=') { - break; - } - cwdEnd += strlen(cwdEnd) + 1; - } - } - envBlockSize = cwdEnd - cwdStart; - - for (env = envp; *env; env++) { - envBlockSize += strlen(*env) + 1; - } - envBlockSize++; - - p = *envBlock = malloc(envBlockSize); - if (p == NULL) { - FreeEnvironmentStrings(curEnv); - return -1; - } - - q = cwdStart; - while (q < cwdEnd) { - *p++ = *q++; - } - FreeEnvironmentStrings(curEnv); - - for (env = envp; *env; env++) { - q = *env; - while (*q) { - *p++ = *q++; - } - *p++ = '\0'; - } - *p = '\0'; - return 0; -} - -/* - * For qsort. We sort (case-insensitive) the environment strings - * before generating the environment block. - */ -static int compare(const void *arg1, const void *arg2) -{ - return _stricmp(* (char**)arg1, * (char**)arg2); -} - -/* - * Spawn a new process with arguments argv and environment envp, - * wait until it terminates, and return its exit code in *exitCode. - * Return 0 on success. Return -1 on error. Call GetLastError() - * (note: not errno) to get the error code. - */ -static int ns_spawn(char **argv, char **envp, int *exitCode) -{ - char *cmdLine; - char *envBlock; - char **newEnvp; - BOOL rv; - STARTUPINFO si; - PROCESS_INFORMATION pi; - - changeForwardSlashesTpBackSlashes(argv[0]); - if (assembleCmdLine(argv, &cmdLine) == -1) { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return -1; - } - - if (envp == NULL) { - newEnvp = NULL; - } else { - int i; - int numEnv = 0; - while (envp[numEnv]) { - numEnv++; - } - newEnvp = (char **) malloc((numEnv+1) * sizeof(char *)); - for (i = 0; i <= numEnv; i++) { - newEnvp[i] = envp[i]; - } - qsort((void *) newEnvp, (size_t) numEnv, sizeof(char *), compare); - } - if (assembleEnvBlock(newEnvp, &envBlock) == -1) { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - free(cmdLine); - return -1; - } - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - - rv = CreateProcess( - NULL, - cmdLine, - NULL, - NULL, - TRUE, - 0, - envBlock, - NULL, - &si, - &pi); - free(cmdLine); - free(envBlock); - if (!rv) { - return -1; - } - CloseHandle(pi.hThread); - WaitForSingleObject(pi.hProcess, INFINITE); - if (exitCode) { - GetExitCodeProcess(pi.hProcess, exitCode); - } - CloseHandle(pi.hProcess); - return 0; -} - -static int -doBuiltinShellCommand (char *argv[ ], char **envp) -{ - int retVal = 0; /* assume valid return */ - char path[_MAX_PATH]; - char **pArgv; - char *arg1; -// char options[1024]; -// char *pOptions; - int j; - int fileHandle; - char * shellName = *argv; - int shellCommand = - 1; - - /* search for shell name */ - for (j = 0; sh_cmds[j] != 0; ++j) { - if ( streq (sh_cmds[j], shellName) ) { - shellCommand = j; - break; - } - } - - pArgv = &argv[1]; - switch ( shellCommand ) { - case SH_CMD_CD: - while ( **pArgv == '-' ) - pArgv++; - arg1 = *pArgv; - changeForwardSlashesTpBackSlashes ( arg1 ); - _getcwd ( path, sizeof (path) ); - if ( _chdir ( arg1 ) == -1 ) { - perror ( "Path not found" ); - retVal = 2; - break; - } - _getcwd ( path, sizeof (path) ); - break; - - case SH_CMD_NSINSTALL: -// while ( waitForDebug ); - retVal = shellNsinstall ( pArgv ); - break; - - - case SH_CMD_MKDIR: - retVal = shellMkdir ( pArgv ); - break; - - case SH_CMD_CP: - retVal = shellCp ( pArgv ); - break; - - case SH_CMD_ECHO: - retVal = shellEcho ( pArgv ); - break; - - case SH_CMD_RM: - retVal = shellRm ( pArgv ); - break; - - case SH_CMD_TOUCH: - while ( **pArgv == '-' ) - pArgv++; - arg1 = *pArgv; - changeForwardSlashesTpBackSlashes ( arg1 ); - fileHandle = _open( arg1, _O_CREAT ); - if( fileHandle == -1 ) { - perror( "Open failed on input file" ); - retVal = 5; - } else { - _close( fileHandle ); - } - break; - - /* - * set [ --aefhkntuvx [ arg ... ] ] - * -a Mark variables which are modified or created for export. - * -e Exit immediately if a command exits with a non-zero exit - * status. - * -f Disable file name generation - * -h Locate and remember function commands as functions are defined - * (function commands are normally located when the function is - * executed). - * -k All keyword arguments are placed in the environment for a - * command, not just those that precede the command name. - * -n Read commands but do not execute them. - * -t Exit after reading and executing one command. - * -u Treat unset variables as an error when substituting. - * -v Print shell input lines as they are read. - * -x Print commands and their arguments as they are executed. - * -- Do not change any of the flags; useful in setting $1 to -. - * Using + rather than - causes these flags to be turned off. These - * flags can also be used upon invocation of the shell. The current - * set of flags may be found in $-. The remaining arguments are - * positional parameters and are assigned, in order, to $1, $2, .... - * If no arguments are given the values of all names are printed. - */ - - case SH_CMD_SET: - arg1 = *pArgv++; - //printf ( "set %s\n", arg1 ); - break; - - case SH_CMD_TEST: - retVal = shellTest ( pArgv ); - break; - - case SH_CMD_CAT: - retVal = shellCat ( pArgv ); - break; - - case SH_CMD_TRUE: - break; - - case SH_CMD_MV: - retVal = shellMv ( pArgv ); - break; - - default: -// retVal = spawnvp (P_WAIT, argv[0], argv ); - if ( ns_spawn (argv, envp, &retVal) == -1 ) { - fprintf (stderr, "SHMSDOS: %s: %s\n", argv[0], - sh_GetLastErrorMessage ()); - retVal = -1; - } - break; - } - return retVal; -} - -static char ** -getlistOfOptions (char **pArgv, char * pOptions) -{ - char *pArg; - while ( *pArgv && (**pArgv == '-') ) { - pArg = *pArgv; - pArg++; /* skip over '-' */ - while ( *pArg ) - *pOptions++ = *pArg++; - pArgv++; - } - *pOptions = '\0'; - return pArgv; -} - -static int -shellNsinstall (char **pArgv) -{ - int retVal = 0; /* exit status */ - int dirOnly = 0; /* 1 if and only if -D is specified */ - char **pSrc; - char **pDst; - - /* - * Process the command-line options. We ignore the - * options except for -D. Some options, such as -m, - * are followed by an argument. We need to skip the - * argument too. - */ - while ( *pArgv && **pArgv == '-' ) { - char c = (*pArgv)[1]; /* The char after '-' */ - - if ( c == 'D' ) { - dirOnly = 1; - } else if ( c == 'm' ) { - pArgv++; /* skip the next argument */ - } - pArgv++; - } - - if ( !dirOnly ) { - /* There are files to install. Get source files */ - if ( *pArgv ) { - pSrc = pArgv++; - } else { - fprintf( stderr, "SHMSDOS: nsinstall: not enough arguments\n"); - return 3; - } - } - - /* Get to last token to find destination directory */ - if ( *pArgv ) { - pDst = pArgv++; - if ( dirOnly && *pArgv ) { - fprintf( stderr, "SHMSDOS: nsinstall: too many arguments with -D\n"); - return 3; - } - } else { - fprintf( stderr, "SHMSDOS: nsinstall: not enough arguments\n"); - return 3; - } - while ( *pArgv ) - pDst = pArgv++; - - retVal = shellMkdir ( pDst ); - if ( retVal ) - return retVal; - if ( !dirOnly ) - retVal = shellCp ( pSrc ); - return retVal; -} - -static int -shellMkdir (char **pArgv) -{ - int retVal = 0; /* assume valid return */ - char *arg; - char *pArg; - char path[_MAX_PATH]; - char tmpPath[_MAX_PATH]; - char *pTmpPath = tmpPath; - - /* All the options are simply ignored in this implementation */ - while ( *pArgv && **pArgv == '-' ) { - if ( (*pArgv)[1] == 'm' ) { - pArgv++; /* skip the next argument (mode) */ - } - pArgv++; - } - - while ( *pArgv ) { - arg = *pArgv; - changeForwardSlashesTpBackSlashes ( arg ); - pArg = arg; - pTmpPath = tmpPath; - while ( 1 ) { - /* create part of path */ - while ( *pArg ) { - *pTmpPath++ = *pArg++; - if ( *pArg == '\\' ) - break; - } - *pTmpPath = '\0'; - - /* check if directory alreay exists */ - _getcwd ( path, sizeof (path) ); - if ( _chdir ( tmpPath ) != -1 ) { - _chdir ( path ); - } else { - if ( _mkdir ( tmpPath ) == -1 ) { -// while ( waitForDebug ); - printf ( "%s: ", tmpPath ); - perror ( "Could not create the directory" ); - retVal = 3; - break; - } - } - if ( *pArg == '\0' ) /* complete path? */ - break; - /* loop for next directory */ - } - - pArgv++; - } - return retVal; -} - -static const char * -sh_GetLastErrorMessage() -{ - static char buf[128]; - - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* default language */ - buf, - sizeof(buf), - NULL - ); - return buf; -} - -/* - * struct sh_FileData -- - * - * A pointer to the sh_FileData structure is passed into sh_RecordFileData, - * which will fill in the fields. - */ - -struct sh_FileData { - char pathName[_MAX_PATH]; - DWORD dwFileAttributes; -}; - -/* - * sh_RecordFileData -- - * - * Record the pathname and attributes of the file in - * the sh_FileData structure pointed to by arg. - * - * Always return TRUE (successful completion). - * - * This function is intended to be passed into sh_EnumerateFiles - * to see if a certain pattern expands to exactly one file/directory, - * and if so, record its pathname and attributes. - */ - -static BOOL -sh_RecordFileData(char *pathName, WIN32_FIND_DATA *findData, void *arg) -{ - struct sh_FileData *fData = (struct sh_FileData *) arg; - - strcpy(fData->pathName, pathName); - fData->dwFileAttributes = findData->dwFileAttributes; - return TRUE; -} - -/* - * CopyDirRecursive -- - * - * First create a new directory, then recursively copy - * the contents of the specified directory to the new directory. - * - * This routine is called only by CopyDir and by itself - * (recursion). - */ - -static int -CopyDirRecursive(char *srcDir, char *dstDir, int force) -{ - DWORD dwFileAttributes; - WIN32_FIND_DATA fileData; - HANDLE hSearch; - char *srcDirMarker; - char *dstDirMarker; - int retVal = 0; /* The return value of this routine. 0 means success. - * Nonzero means failure. */ - - dwFileAttributes = GetFileAttributes(dstDir); - if (dwFileAttributes == 0xFFFFFFFF) { - if (_mkdir(dstDir) == -1) { - fprintf(stderr, "SHMSDOS: cp: cannot create directory %s: %s\n", - dstDir, strerror(errno)); - return 8; - } - } else { - if (!(dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - fprintf(stderr, "SHMSDOS: cp: target %s is an existing file\n", - dstDir); - return 8; - } - if (force && (dwFileAttributes & FILE_ATTRIBUTE_READONLY)) { - dwFileAttributes &= ~FILE_ATTRIBUTE_READONLY; - SetFileAttributes(dstDir, dwFileAttributes); - } - } - - dstDirMarker = dstDir + strlen(dstDir); - *(dstDirMarker++) = '\\'; - - srcDirMarker = srcDir + strlen(srcDir); - *(srcDirMarker++) = '\\'; - strcpy(srcDirMarker, "*"); - hSearch = FindFirstFile(srcDir, &fileData); - if (hSearch == INVALID_HANDLE_VALUE) { - /* Directory is empty. We are done. */ - - return 0; - } - - do { - if (!strcmp(fileData.cFileName, ".") - || !strcmp(fileData.cFileName, "..")) { - /* - * Skip over . and .. - */ - - continue; - } - - strcpy(srcDirMarker, fileData.cFileName); - strcpy(dstDirMarker, fileData.cFileName); - if (sh_DoCopy(srcDir, fileData.dwFileAttributes, - dstDir, GetFileAttributes(dstDir), - force, TRUE) == FALSE) { - retVal = 5; - } - } while (FindNextFile(hSearch, &fileData)); - FindClose(hSearch); - return retVal; -} - -static BOOL -sh_DoCopy(char *srcFileName, - DWORD srcFileAttributes, - char *dstFileName, - DWORD dstFileAttributes, - int force, - int recursive -) -{ - if (dstFileAttributes != 0xFFFFFFFF) { - if ((dstFileAttributes & FILE_ATTRIBUTE_READONLY) && force) { - dstFileAttributes &= ~FILE_ATTRIBUTE_READONLY; - SetFileAttributes(dstFileName, dstFileAttributes); - } - } - - if (srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (!recursive) { - fprintf(stderr, "SHMSDOS: cp: %s is a directory\n", - srcFileName); - return FALSE; - } else if (CopyDirRecursive(srcFileName, dstFileName, force) != 0) { - return FALSE; - } - } else { - if (!CopyFile(srcFileName, dstFileName, FALSE)) { - fprintf(stderr, "SHMSDOS: cp: cannot copy %s to %s: %s\n", - srcFileName, dstFileName, sh_GetLastErrorMessage()); - return FALSE; - } - } - return TRUE; -} - -/* - * struct sh_CpCmdArg -- - * - * A pointer to the sh_CpCmdArg structure is passed into sh_CpFileCmd. - * The sh_CpCmdArg contains information about the cp command, and - * provide a buffer for constructing the destination file name. - */ - -struct sh_CpCmdArg { - int force; /* -f option, ok to overwrite an existing - * read-only destination file */ - int recursive; /* -r or -R option, recursively copy - * directories. */ - char *dstFileName; /* a buffer for constructing the destination - * file name */ - char *dstFileNameMarker; /* points to where in the dstFileName buffer - * we should write the file component of the - * destination file */ -}; - -/* - * sh_CpFileCmd -- - * - * Copy a file to the destination directory - * - * This function is intended to be passed into sh_EnumerateFiles to - * copy all the files specified by the pattern to the destination - * directory. - * - * Return TRUE if the file is successfully copied, and FALSE otherwise. - */ - -static BOOL -sh_CpFileCmd(char *pathName, WIN32_FIND_DATA *findData, void *cpArg) -{ - BOOL retVal = TRUE; - struct sh_CpCmdArg *arg = (struct sh_CpCmdArg *) cpArg; - - strcpy(arg->dstFileNameMarker, findData->cFileName); - return sh_DoCopy(pathName, findData->dwFileAttributes, - arg->dstFileName, GetFileAttributes(arg->dstFileName), - arg->force, arg->recursive); -} - -static int -shellCp (char **pArgv) -{ - int retVal = 0; - char **pSrc; - char **pDst; - struct sh_CpCmdArg arg; - struct sh_FileData dstData; - int dstIsDir = 0; - int n; - - arg.force = 0; - arg.recursive = 0; - arg.dstFileName = dstData.pathName; - arg.dstFileNameMarker = 0; - - while (*pArgv && **pArgv == '-') { - char *p = *pArgv; - - while (*(++p)) { - if (*p == 'f') { - arg.force = 1; - } else if (*p == 'r' || *p == 'R') { - arg.recursive = 1; - } - } - pArgv++; - } - - /* the first source file */ - if (*pArgv) { - pSrc = pArgv++; - } else { - fprintf(stderr, "SHMSDOS: cp: not enough arguments\n"); - return 3; - } - - /* get to the last token to find destination */ - if (*pArgv) { - pDst = pArgv++; - } else { - fprintf(stderr, "SHMSDOS: cp: not enough arguments\n"); - return 3; - } - while (*pArgv) { - pDst = pArgv++; - } - - /* - * The destination pattern must unambiguously expand to exactly - * one file or directory. - */ - - changeForwardSlashesTpBackSlashes(*pDst); - sh_EnumerateFiles(*pDst, *pDst, sh_RecordFileData, &dstData, &n); - assert(n >= 0); - if (n == 1) { - /* - * Is the destination a file or directory? - */ - - if (dstData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - dstIsDir = 1; - } - } else if (n > 1) { - fprintf(stderr, "SHMSDOS: cp: %s: ambiguous destination file " - "or directory\n", *pDst); - return 3; - } else { - /* - * n == 0, meaning that destination file or directory does - * not exist. In this case the destination file directory - * name must be fully specified. - */ - - char *p; - - for (p = *pDst; *p; p++) { - if (*p == '*' || *p == '?') { - fprintf(stderr, "SHMSDOS: cp: %s: No such file or directory\n", - *pDst); - return 3; - } - } - - /* - * Do not include the trailing \, if any, unless it is a root - * directory (\ or X:\). - */ - - if (p > *pDst && p[-1] == '\\' && p != *pDst + 1 && p[-2] != ':') { - p[-1] = '\0'; - } - strcpy(dstData.pathName, *pDst); - dstData.dwFileAttributes = 0xFFFFFFFF; - } - - /* - * If there are two or more source files, the destination has - * to be a directory. - */ - - if (pDst - pSrc > 1 && !dstIsDir) { - fprintf(stderr, "SHMSDOS: cp: cannot copy more than" - " one file to the same destination file\n"); - return 3; - } - - if (dstIsDir) { - arg.dstFileNameMarker = arg.dstFileName + strlen(arg.dstFileName); - - /* - * Now arg.dstFileNameMarker is pointing to the null byte at the - * end of string. We want to make sure that there is a \ at the - * end of string, and arg.dstFileNameMarker should point right - * after that \. - */ - - if (arg.dstFileNameMarker[-1] != '\\') { - *(arg.dstFileNameMarker++) = '\\'; - } - } - - if (!dstIsDir) { - struct sh_FileData srcData; - - assert(pDst - pSrc == 1); - changeForwardSlashesTpBackSlashes(*pSrc); - sh_EnumerateFiles(*pSrc, *pSrc, sh_RecordFileData, &srcData, &n); - if (n == 0) { - fprintf(stderr, "SHMSDOS: cp: %s: No such file or directory\n", - *pSrc); - retVal = 3; - } else if (n > 1) { - fprintf(stderr, "SHMSDOS: cp: cannot copy more than one file or " - "directory to the same destination\n"); - retVal = 3; - } else { - assert(n == 1); - if (sh_DoCopy(srcData.pathName, srcData.dwFileAttributes, - dstData.pathName, dstData.dwFileAttributes, - arg.force, arg.recursive) == FALSE) { - retVal = 3; - } - } - return retVal; - } - - for ( ; *pSrc != *pDst; pSrc++) { - BOOL rv; - - changeForwardSlashesTpBackSlashes(*pSrc); - rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_CpFileCmd, &arg, &n); - if (rv == FALSE) { - retVal = 3; - } else { - if (n == 0) { - fprintf(stderr, "SHMSDOS: cp: %s: No such file or directory\n", - *pSrc); - retVal = 3; - } - } - } - - return retVal; -} - -static int -shellEcho(char **pArgv) -{ - int retVal = 0; - FILE *file = stdout; - char *fileName = NULL; - int redirectOutput = 0; - char **argv; - char *arrow = NULL; - int skipTwoArgs = 0; - int firstArg; - const char *mode = "w"; - - if (*pArgv == NULL) { - return 0; - } - - /* - * See if output is redirected to a file - */ - - for (argv = pArgv; *argv; argv++) { - char *p = *argv; - - if (*p == '>') { - if (redirectOutput) { - fprintf(stderr, "SHMSDOS: echo: ambiguous output " - "redirection\n"); - retVal = 8; - goto done; - } - arrow = p; - if (*(p + 1) == '>') { - /* - * append to redirected output file - */ - - mode = "a"; - p++; - } - if (*(p + 1) == '\0') { - /* - * The output file name is the next argument. - * So when we print the arguments later, we have - * one more argument to skip (in addition to the - * arrow ">"). - */ - - fileName = *(argv + 1); - skipTwoArgs = 2; - } else { - fileName = p + 1; - } - if (fileName == NULL || *fileName == '\0') { - fprintf(stderr, "SHMSDOS: echo: missing output file\n"); - assert(file == stdout); - return 8; - } - file = fopen(fileName, mode); - if (file == NULL) { - fprintf(stderr, "SHMSDOS: echo: cannot open output file %s: %s\n", - fileName, strerror(errno)); - assert(file == stdout); - return 8; - } - redirectOutput = 1; - } - } - - argv = pArgv; - firstArg = 1; - while (*argv) { - if (*argv != arrow) { - if (firstArg) { - firstArg = 0; - } else { - fprintf(file, " "); - } - fprintf(file, *argv); - } else if (skipTwoArgs) { - argv++; - } - argv++; - } - fprintf(file, "\n"); - -done: - if (file != stdout) { - fclose(file); - } - return retVal; -} - -/* - **************************************************************** - * - * The following routines implement the 'rm' command. - * - **************************************************************** - */ - -/* - * RemoveDirRecursive -- - * - * First recursively remove the contents of the specified - * directory, then remove the directory itself. - * It is assumed that dirName is just the name of the - * directory itself, i.e., it is not a full or relative - * pathname. - * - * This routine is called only by RemoveDir and by itself - * (recursion). - */ - -static int -RemoveDirRecursive(const char *dirName, int forceRm) -{ - WIN32_FIND_DATA fileData; - HANDLE hSearch; - BOOL rv; - int retVal = 0; /* The return value of this routine. 0 means success. - * Nonzero means failure. */ - - _chdir(dirName); - - hSearch = FindFirstFile("*", &fileData); - if (hSearch == INVALID_HANDLE_VALUE) { - /* Good, it's already empty */ - goto done; - } - - do { - /* - * Skip over . and .. - */ - - if (strcmp(fileData.cFileName, ".") - && strcmp(fileData.cFileName, "..")) { - if (fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (RemoveDirRecursive(fileData.cFileName, forceRm) != 0) { - retVal = 5; - } - } else { - if (fileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - if (forceRm) { - /* - * Change mode to writable, in preparation for - * removal. - */ - - _chmod(fileData.cFileName, _S_IWRITE); - } else { - fprintf(stderr, "SHMSDOS: rm: file %s is read-only\n", - fileData.cFileName); - retVal = 5; - } - } - if (!DeleteFile(fileData.cFileName)) { - fprintf(stderr, "SHMSDOS: rm: cannot delete file %s: %s\n", - fileData.cFileName, sh_GetLastErrorMessage()); - retVal = 5; - } - } - } - rv = FindNextFile(hSearch, &fileData); - } while (rv); - FindClose(hSearch); - - _chdir(".."); -done: - if (!RemoveDirectory(dirName) ) { - fprintf(stderr, "SHMSDOS: rm: cannot remove directory %s: %s\n", - dirName, sh_GetLastErrorMessage()); - retVal = 5; - } - return retVal; -} - -/* - * RemoveDir -- - * Remove the contents of a directory and the directory itself. - * This routine is called only by shellRm. - */ - -static int -RemoveDir(const char *dirName, int forceRm) -{ - char cwd[_MAX_PATH]; - char *cPtr; - int retVal; - - /* - * Before we call RemoveDirRecursive, which actually deletes things, - * we want to find the directory name proper, not including the - * path. - */ - - cPtr = strrchr(dirName, '\\'); - if (cPtr != NULL && *(cPtr + 1) != '\0') { - _getcwd(cwd, sizeof(cwd)); - *cPtr = '\0'; - _chdir(dirName); - retVal = RemoveDirRecursive(cPtr + 1, forceRm); - _chdir(cwd); - } else { - retVal = RemoveDirRecursive(dirName, forceRm); - } - return retVal; -} - -/* - * struct sh_RmCmdArg -- - * - * A pointer to the sh_RmCmdArg structure is passed into sh_RmFileCmd. - */ - -struct sh_RmCmdArg { - int force; /* -f option, ok to remove read-only files and - * directories */ - int recursive; /* -r or -R option, recursively remove directories */ -}; - -/* - * sh_RmFileCmd -- - * - * Remove the file or directory. Return TRUE if the file or directory - * is successfully removed, FALSE otherwise. - */ - -static BOOL -sh_RmFileCmd(char *pathName, WIN32_FIND_DATA *fileData, void *rmArg) -{ - BOOL rv = TRUE; - struct sh_RmCmdArg *arg = (struct sh_RmCmdArg *) rmArg; - - if (fileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (arg->recursive) { - if (RemoveDir(pathName, arg->force) != 0) { - rv = FALSE; - } - } else { - fprintf(stderr, "SHMSDOS: rm: %s is a directory\n", - fileData->cFileName); - rv = FALSE; - } - } else { - if (fileData->dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - if (arg->force) { - /* - * Change mode to writable, in preparation for - * removal. - */ - - _chmod(pathName, _S_IWRITE); - } else { - fprintf(stderr, - "SHMSDOS: rm: file %s is read-only\n", - pathName); - rv = FALSE; - } - } - if (!DeleteFile(pathName)) { - fprintf(stderr, - "SHMSDOS: rm: cannot delete file %s: %s\n", - pathName, sh_GetLastErrorMessage()); - rv = FALSE; - } - } - return rv; -} - -/* - * sh_EnumerateFiles -- - * - * Enumerate all the files in the specified pattern, which is a pathname - * containing possibly wildcard characters such as * and ?. fileFcn - * is called on each file, passing the expanded file name, a pointer - * to the file's WIN32_FILE_DATA, and the arg pointer. - * - * It is assumed that there are no wildcard characters before the - * character pointed to by 'where'. - * - * On return, *nFiles stores the number of files enumerated. *nFiles is - * set to this number whether sh_EnumerateFiles or 'fileFcn' succeeds - * or not. - * - * Return TRUE if the files are successfully enumerated and all - * 'fileFcn' invocations succeeded. Return FALSE if something went - * wrong. - */ - -static BOOL sh_EnumerateFiles( - const char *pattern, - const char *where, - sh_FileFcn fileFcn, - void *arg, - int *nFiles - ) -{ - WIN32_FIND_DATA fileData; - HANDLE hSearch; - const char *src; - char *dst; - char fileName[_MAX_PATH]; - char *fileNameMarker = fileName; - char *oldFileNameMarker; - BOOL hasWildcard = FALSE; - BOOL retVal = TRUE; - BOOL patternEndsInDotStar = FALSE; - BOOL patternEndsInDot = FALSE; /* a special case of - * patternEndsInDotStar */ - int numDotsInPattern; - int len; - - /* - * Windows expands patterns ending in ".", ".*", ".**", etc. - * differently from the glob expansion on Unix. For example, - * both "foo." and "foo.*" match "foo", and "*.*" matches - * everything, including filenames with no dots. So we need - * to throw away extra files returned by the FindNextFile() - * function. We require that a matched filename have at least - * the number of dots in the pattern. - */ - len = strlen(pattern); - if (len >= 2) { - /* Start from the end of pattern and go backward */ - const char *p = &pattern[len - 1]; - - /* We can have zero or more *'s */ - while (p >= pattern && *p == '*') { - p--; - } - if (p >= pattern && *p == '.') { - patternEndsInDotStar = TRUE; - if (p == &pattern[len - 1]) { - patternEndsInDot = TRUE; - } - p--; - numDotsInPattern = 1; - while (p >= pattern && *p != '\\') { - if (*p == '.') { - numDotsInPattern++; - } - p--; - } - } - } - - *nFiles = 0; - - /* - * Copy pattern to fileName, but only up to and not including - * the first \ after the first wildcard letter. - * - * Make fileNameMarker point to one of the following: - * - the start of fileName, if fileName does not contain any \. - * - right after the \ before the first wildcard letter, if there is - * a wildcard character. - * - right after the last \, if there is no wildcard character. - */ - - dst = fileName; - src = pattern; - while (src < where) { - if (*src == '\\') { - oldFileNameMarker = fileNameMarker; - fileNameMarker = dst + 1; - } - *(dst++) = *(src++); - } - - while (*src && *src != '*' && *src != '?') { - if (*src == '\\') { - oldFileNameMarker = fileNameMarker; - fileNameMarker = dst + 1; - } - *(dst++) = *(src++); - } - - if (*src) { - /* - * Must have seen the first wildcard letter - */ - - hasWildcard = TRUE; - while (*src && *src != '\\') { - *(dst++) = *(src++); - } - } - - /* Now src points to either null or \ */ - - assert(*src == '\0' || *src == '\\'); - assert(hasWildcard || *src == '\0'); - *dst = '\0'; - - /* - * If the pattern does not contain any wildcard characters, then - * we don't need to go the FindFirstFile route. - */ - - if (!hasWildcard) { - /* - * See if it is the root directory, \, or X:\. - */ - - assert(!strcmp(fileName, pattern)); - assert(strlen(fileName) >= 1); - if (dst[-1] == '\\' && (dst == fileName + 1 || dst[-2] == ':')) { - fileData.cFileName[0] = '\0'; - } else { - /* - * Do not include the trailing \, if any - */ - - if (dst[-1] == '\\') { - assert(*fileNameMarker == '\0'); - dst[-1] = '\0'; - fileNameMarker = oldFileNameMarker; - } - strcpy(fileData.cFileName, fileNameMarker); - } - fileData.dwFileAttributes = GetFileAttributes(fileName); - if (fileData.dwFileAttributes == 0xFFFFFFFF) { - return TRUE; - } - *nFiles = 1; - return (*fileFcn)(fileName, &fileData, arg); - } - - hSearch = FindFirstFile(fileName, &fileData); - if (hSearch == INVALID_HANDLE_VALUE) { - return retVal; - } - - do { - if (!strcmp(fileData.cFileName, ".") - || !strcmp(fileData.cFileName, "..")) { - /* - * Skip over . and .. - */ - - continue; - } - - if (patternEndsInDotStar) { - int nDots = 0; - char *p = fileData.cFileName; - while (*p) { - if (*p == '.') { - nDots++; - } - p++; - } - /* Now p points to the null byte at the end of file name */ - if (patternEndsInDot && (p == fileData.cFileName - || p[-1] != '.')) { - /* - * File name does not end in dot. Skip this file. - * Note: windows file name probably cannot end in dot, - * but we do this check anyway. - */ - continue; - } - if (nDots < numDotsInPattern) { - /* - * Not enough dots in file name. Must be an extra - * file in matching .* pattern. Skip this file. - */ - continue; - } - } - - strcpy(fileNameMarker, fileData.cFileName); - if (*src && *(src + 1)) { - /* - * More to go. Recurse. - */ - - int n; - - assert(*src == '\\'); - where = fileName + strlen(fileName); - strcat(fileName, src); - sh_EnumerateFiles(fileName, where, fileFcn, arg, &n); - *nFiles += n; - } else { - assert(strchr(fileName, '*') == NULL); - assert(strchr(fileName, '?') == NULL); - (*nFiles)++; - if ((*fileFcn)(fileName, &fileData, arg) == FALSE) { - retVal = FALSE; - } - } - } while (FindNextFile(hSearch, &fileData)); - - FindClose(hSearch); - return retVal; -} - - -/* - * shellRm -- - * - * Implement the Unix 'rm' command. - * - * We require that the option flags of 'rm', if any, - * be the first arguments and precede all the other - * arguments. Right now the -f, -r, and -R flags are - * recognized. We change / to \ in file pathname arguments. - */ - -static int -shellRm (char **pArgv) -{ - int retVal = 0; /* The return value of this function. 0 means - * success. Nonzero means failure. */ - struct sh_RmCmdArg arg; - - arg.force = 0; - arg.recursive = 0; - - /* Convert option flags */ - while (*pArgv && (**pArgv == '-')) { - char *p = *pArgv; - p++; - while (*p) { - if (!arg.recursive && (*p == 'r' || *p == 'R')) { - arg.recursive = 1; - } - if (!arg.force && *p == 'f') { - arg.force = 1; - } - p++; - } - pArgv++; - } - - /* - * If -f is not specified and there are no paths specified, - * we complain. - */ - - if (!arg.force && !*pArgv) { - fprintf(stderr, "SHMSDOS: usage: rm [-fRr] file ...\n"); - retVal = 5; - } - - /* Delete each file/directory */ - for ( ; *pArgv; pArgv++) { - int n; - BOOL rv; - - changeForwardSlashesTpBackSlashes(*pArgv); - rv = sh_EnumerateFiles(*pArgv, *pArgv, sh_RmFileCmd, &arg, &n); - if (rv == FALSE) { - retVal = 5; - } else { - if (n == 0 && !arg.force) { - fprintf(stderr, "SHMSDOS: rm: %s: No such file or directory\n", - *pArgv); - retVal = 5; - } - } - } - return retVal; -} - -static int -shellTest (char **pArgv) -{ - int retVal = 0; /* assume valid return */ - char * arg1 = NULL; - char * arg2 = NULL; - char * arg3 = NULL; - struct _stat buf; - int result; - int true = 0; - int false = 1; - unsigned short fileStatus; - - if ( strcmp ( *pArgv, "!" ) == 0 ) { - pArgv++; - true = !true; - false = !false; - } - arg1 = *pArgv++; - - if ( *arg1 == '-' ) { - arg2 = *pArgv++; - - // process string tests - switch ( *(arg1+1) ) { - case 'z': - return (!arg2 || strlen ( arg2 ) == 0) ? true : false; // return zero if length of string is zero - case 'n': - return (arg2 && strlen ( arg2 ) != 0) ? true : false; // return zero if length of string is nonzero - } - - // process file tests - if ( !arg2 ) - return false; - changeForwardSlashesTpBackSlashes ( arg2 ); - - /* Check if statistics are valid: */ - result = _stat( arg2, &buf ); - if( result != 0 ) - return false; // file or directory does not exist - - fileStatus = buf.st_mode; - if ( (*(arg1+1) != 'd') && (*(arg1+1) != 'r') - && (*(arg1+1) != 'f') ) - printf ("!!!!!! never been tested: test -%c\n", *(arg1+1) ); - - switch ( *(arg1+1) ) { - case 'c': // character special file? - if ( fileStatus & _S_IFCHR ) - return true; // return directory found - return false; // return directory not found - case 'd': // directory? - if ( fileStatus & _S_IFDIR ) - return true; // return directory found - return false; // return directory not found - case 'f': // regular file? - if ( fileStatus & _S_IFREG ) - return true; // return regular file found - return false; // return regular file not found - case 'g': // set group ID bit set? - return false; // return not set - case 'h': // symbolic link? - case 'l': // symbolic link? - case 'L': // symbolic link? - return false; // return symbolic link not found - case 'k': // sticky bit set? - return false; // return not set - case 'p': // named pipe? - if ( fileStatus & _S_IFIFO ) - return true; // return named pipe found - return false; // return named pipe not found - case 'r': // readable file? - if ( fileStatus & _S_IREAD ) - return true; // return read permission found - return false; // return read permission not found - case 's': // size greater than zero? - if ( buf.st_size > 0 ) - return true; // return file has greater than zero size - return false; // return file size is zero - case 't': // set for terminal device? - return -1; // return not implemented - case 'u': // set user ID bit set? - return false; // return not set - case 'w': // writeable file? - if ( fileStatus & _S_IWRITE ) - return true; // return write permission found - return false; // return write permission not found - case 'x': // executable file? - if ( fileStatus & _S_IEXEC ) - return true; // return execute permission found - return false; // return execute permission not found - default: - return -1; // not implemented - } - } else { // string compares - printf ("!!!!!! never been tested: test %s\n", arg1 ); - if ( *pArgv ) - arg2 = *pArgv++; - if ( *pArgv ) - arg3 = *pArgv++; - - // check if strings compare s1 = s2 or not compare s1 != s2 - if ( arg2 && arg3 ) { - if ( strcmp ( arg2, "=" ) == 0 ) - return strcmp ( arg1, arg3 ) ? false : true; - if ( strcmp ( arg2, "!=" ) == 0 ) - return strcmp ( arg1, arg3 ) ? true : false; - if ( strcmp ( arg2, "-eq" ) == 0 ) - return ( atol(arg1) == atol(arg3) ) ? true : false; - if ( strcmp ( arg2, "-ne" ) == 0 ) - return ( atol(arg1) != atol(arg3) ) ? true : false; - if ( strcmp ( arg2, "-gt" ) == 0 ) - return ( atol(arg1) > atol(arg3) ) ? true : false; - if ( strcmp ( arg2, "-ge" ) == 0 ) - return ( atol(arg1) >= atol(arg3) ) ? true : false; - if ( strcmp ( arg2, "-lt" ) == 0 ) - return ( atol(arg1) < atol(arg3) ) ? true : false; - if ( strcmp ( arg2, "-le" ) == 0 ) - return ( atol(arg1) <= atol(arg3) ) ? true : false; - } - // check for empty string - if ( (arg2 == NULL ) && ( arg3 == NULL) ) - return (strlen(arg1) > 0 ) ? true : false; - } - - return -1; // not implemented -} - -#define COPY_BUFFER_SIZE 4096 - -static int -shellCat (char **pArgv) -{ - int retVal = 0; /* assume valid return */ - char **pSrc; - char **pDst; - - int sfd, dfd, len; - struct _stat fi; - char copy_buffer[COPY_BUFFER_SIZE]; - unsigned long read_len; - - while ( **pArgv == '-' ) - pArgv++; - - /* get source files */ - pSrc = pArgv++; - - /* get to last token to find destination */ - pDst = pArgv++; - while ( *pArgv ) - pDst = pArgv++; - - if( (dfd = _open(*pDst, O_RDWR | O_CREAT | O_BINARY, 0666)) == -1) { - perror ( "Could not open the destination file "); - fprintf(stdout, "Destination file %s\n", *pDst); - retVal = (4); - } - - while ( *pSrc != *pDst ) { - - if (!(strcmp(*pSrc, ">"))) { - *pSrc++; - continue; - } - if (!strcmp(*pSrc, *pDst)) { - *pSrc++; - continue; - } - if( (sfd = _open(*pSrc, O_RDONLY | O_BINARY, 0666)) == -1) { - perror ( "Could not open the source file" ); - fprintf(stdout, "Source file %s\n", *pSrc); - retVal = (4); - return retVal; - } - - _stat(*pSrc, &fi); - if(!(_S_IFREG & fi.st_mode)) { - perror ( "Could not stat the source file" ); - fprintf(stdout, "Source file %s\n", *pSrc); - retVal = (4); - return retVal; - } - len = fi.st_size; - - while(len) { - unsigned long result; - read_len = len>COPY_BUFFER_SIZE?COPY_BUFFER_SIZE:len; - - if ( (read_len = _read(sfd, copy_buffer, read_len)) == -1) { - perror ( "Could not read the source file" ); - fprintf(stdout, "Source file %s\n", *pSrc); - retVal = (4); - return retVal; - } - - if ( (result = (unsigned long)_write(dfd, copy_buffer, read_len)) != read_len) { - perror ( "Could not write to the destination file" ); - fprintf(stdout, "Destination file %s\n", *pDst); - retVal = (4); - return retVal; - } - - len -= read_len; - } - close(sfd); - *pSrc++; - } - close(dfd); - - return retVal; -} - -/* - * struct sh_MvCmdArg -- - * - * A pointer to the sh_MvCmdArg structure is passed into sh_MvFileCmd. - * The sh_MvCmdArg contains information about the mv command, and - * provide a buffer for constructing the destination file name. - */ - -struct sh_MvCmdArg { - int force; /* -f option, ok to overwrite an existing - * read-only destination file */ - char *dstFileName; /* a buffer for constructing the destination - * file name */ - char *dstFileNameMarker; /* points to where in the dstFileName buffer - * we should write the file component of the - * destination file */ -}; - -static BOOL -sh_DoMove(const char *srcFileName, - DWORD srcFileAttributes, - const char *dstFileName, - DWORD dstFileAttributes, - int force -) -{ - if (dstFileAttributes != 0xFFFFFFFF) { - /* - * The destination exists. - * - If the destination is a file, then the source must be a file. - * - If the destination is a directory, then it must be empty, - * and the source must be a directory. - * This is really an arbitrary choice. You may have other - * preference of the behavior. - * - * Because we need to remove the existing destination file - * or directory, we also require that either it is writable - * or 'force' is TRUE. - */ - - int srcIsDir = srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY; - int dstIsDir = dstFileAttributes & FILE_ATTRIBUTE_DIRECTORY; - BOOL rv; - - if (!dstIsDir && srcIsDir) { - fprintf(stderr, "SHMSDOS: mv: cannot rename %s (a directory) " - "to %s (a file)\n", srcFileName, dstFileName); - return FALSE; - } - if (dstIsDir && !srcIsDir) { - fprintf(stderr, "SHMSDOS: mv: cannot rename %s (a file) " - "to %s (a directory)\n", srcFileName, dstFileName); - return FALSE; - } - if ((dstFileAttributes & FILE_ATTRIBUTE_READONLY) && force) { - dstFileAttributes &= ~FILE_ATTRIBUTE_READONLY; - SetFileAttributes(dstFileName, dstFileAttributes); - } - if (dstIsDir) { - rv = RemoveDirectory(dstFileName); - } else { - rv = DeleteFile(dstFileName); - } - if (rv == FALSE) { - fprintf(stderr, "SHMSDOS: mv: cannot overwrite %s: %s\n", - dstFileName, sh_GetLastErrorMessage()); - return FALSE; - } - } - - if (MoveFile(srcFileName, dstFileName) == FALSE) { - fprintf(stderr, "SHMSDOS: mv: cannot move %s to %s: %s\n", - srcFileName, dstFileName, sh_GetLastErrorMessage()); - return FALSE; - } - return TRUE; -} - -/* - * sh_MvFileCmd -- - * - * Move a file to the destination directory - * - * This function is intended to be passed into sh_EnumerateFiles to - * move all the files specified by the pattern to the destination - * directory. - * - * Return TRUE if the file is successfully moved, and FALSE otherwise. - */ - -static BOOL -sh_MvFileCmd(char *pathName, WIN32_FIND_DATA *findData, void *mvArg) -{ - struct sh_MvCmdArg *arg = (struct sh_MvCmdArg *) mvArg; - DWORD dwFileAttributes; - - strcpy(arg->dstFileNameMarker, findData->cFileName); - dwFileAttributes = GetFileAttributes(arg->dstFileName); - return sh_DoMove(pathName, findData->dwFileAttributes, - arg->dstFileName, dwFileAttributes, arg->force); -} - -static int -shellMv (char **pArgv) -{ - int retVal = 0; - char **pSrc; - char **pDst; - struct sh_MvCmdArg arg; - struct sh_FileData dstData; - int dstIsDir = 0; - int n; - - arg.force = 0; - arg.dstFileName = dstData.pathName; - arg.dstFileNameMarker = 0; - - while (*pArgv && **pArgv == '-') { - char *p = *pArgv; - - while (*(++p)) { - if (*p == 'f') { - arg.force = 1; - } - } - pArgv++; - } - - /* the first source file */ - if (*pArgv) { - pSrc = pArgv++; - } else { - fprintf(stderr, "SHMSDOS: mv: not enough arguments\n"); - return 3; - } - - /* get to the last token to find destination */ - if (*pArgv) { - pDst = pArgv++; - } else { - fprintf(stderr, "SHMSDOS: mv: not enough arguments\n"); - return 3; - } - while (*pArgv) { - pDst = pArgv++; - } - - /* - * The destination pattern must unambiguously expand to exactly - * one file or directory. - */ - - changeForwardSlashesTpBackSlashes(*pDst); - sh_EnumerateFiles(*pDst, *pDst, sh_RecordFileData, &dstData, &n); - assert(n >= 0); - if (n == 1) { - /* - * Is the destination a file or directory? - */ - - if (dstData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - dstIsDir = 1; - } - } else if (n > 1) { - fprintf(stderr, "SHMSDOS: mv: %s: ambiguous destination file " - "or directory\n", *pDst); - return 3; - } else { - /* - * n == 0, meaning that destination file or directory does - * not exist. In this case the destination file directory - * name must be fully specified. - */ - - char *p; - - for (p = *pDst; *p; p++) { - if (*p == '*' || *p == '?') { - fprintf(stderr, "SHMSDOS: mv: %s: No such file or directory\n", - *pDst); - return 3; - } - } - - /* - * Do not include the trailing \, if any, unless it is a root - * directory (\ or X:\). - */ - - if (p > *pDst && p[-1] == '\\' && p != *pDst + 1 && p[-2] != ':') { - p[-1] = '\0'; - } - strcpy(dstData.pathName, *pDst); - dstData.dwFileAttributes = 0xFFFFFFFF; - } - - /* - * If there are two or more source files, the destination has - * to be a directory. - */ - - if (pDst - pSrc > 1 && !dstIsDir) { - fprintf(stderr, "SHMSDOS: mv: cannot move more than" - " one file to the same destination file\n"); - return 3; - } - - if (dstIsDir) { - arg.dstFileNameMarker = arg.dstFileName + strlen(arg.dstFileName); - - /* - * Now arg.dstFileNameMarker is pointing to the null byte at the - * end of string. We want to make sure that there is a \ at the - * end of string, and arg.dstFileNameMarker should point right - * after that \. - */ - - if (arg.dstFileNameMarker[-1] != '\\') { - *(arg.dstFileNameMarker++) = '\\'; - } - } - - if (!dstIsDir) { - struct sh_FileData srcData; - - assert(pDst - pSrc == 1); - changeForwardSlashesTpBackSlashes(*pSrc); - sh_EnumerateFiles(*pSrc, *pSrc, sh_RecordFileData, &srcData, &n); - if (n == 0) { - fprintf(stderr, "SHMSDOS: mv: %s: No such file or directory\n", - *pSrc); - retVal = 3; - } else if (n > 1) { - fprintf(stderr, "SHMSDOS: mv: cannot move more than one file or " - "directory to the same destination\n"); - retVal = 3; - } else { - assert(n == 1); - if (sh_DoMove(srcData.pathName, srcData.dwFileAttributes, - dstData.pathName, dstData.dwFileAttributes, - arg.force) == FALSE) { - retVal = 3; - } - } - return retVal; - } - - for ( ; *pSrc != *pDst; pSrc++) { - BOOL rv; - - changeForwardSlashesTpBackSlashes(*pSrc); - rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_MvFileCmd, &arg, &n); - if (rv == FALSE) { - retVal = 3; - } else { - if (n == 0) { - fprintf(stderr, "SHMSDOS: mv: %s: No such file or directory\n", - *pSrc); - retVal = 3; - } - } - } - - return retVal; -} diff --git a/buildtools/windows/source/shmsdos/shmsdos.mak b/buildtools/windows/source/shmsdos/shmsdos.mak deleted file mode 100644 index d884e5ed85f..00000000000 --- a/buildtools/windows/source/shmsdos/shmsdos.mak +++ /dev/null @@ -1,141 +0,0 @@ -# NMAKE file for building shmsdos.exe. -# -# This file is edited from an NMAKE file generated by -# Microsoft Developer Studio, Format Version 4.20 -# -# To build, say -# nmake /f shmsdos.mak CFG=Release -# or -# nmake /f shmsdos.mak CFG=Debug -# If CFG is omitted, a release build is assumed. - -!IF "$(CFG)" == "" -CFG=Release -!MESSAGE No configuration specified. Defaulting Release. -!ENDIF - -!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE on this makefile -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "shmsdos.mak" CFG="Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Release" (based on "Win32 Console Application") -!MESSAGE "Debug" (based on "Win32 Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF -################################################################################ -# Begin Project -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Release" - -OUTDIR=.\Release -INTDIR=.\Release - -ALL : "$(OUTDIR)\shmsdos.exe" - -CLEAN : - -@erase "$(INTDIR)\shmsdos.obj" - -@erase "$(OUTDIR)\shmsdos.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\ - /Fp"$(INTDIR)/shmsdos.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Release/ -CPP_SBRS=.\. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)/shmsdos.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=/nologo\ - /subsystem:console /incremental:no /pdb:"$(OUTDIR)/shmsdos.pdb"\ - /out:"$(OUTDIR)/shmsdos.exe" -LINK32_OBJS= \ - "$(INTDIR)\shmsdos.obj" - -"$(OUTDIR)\shmsdos.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug - -ALL : "$(OUTDIR)\shmsdos.exe" - -CLEAN : - -@erase "$(INTDIR)\shmsdos.obj" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\shmsdos.exe" - -@erase "$(OUTDIR)\shmsdos.ilk" - -@erase "$(OUTDIR)\shmsdos.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "DEBUG"\ - /D "_CONSOLE" /Fp"$(INTDIR)/shmsdos.pch" /YX /Fo"$(INTDIR)/"\ - /Fd"$(INTDIR)/" /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)/shmsdos.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=/nologo\ - /subsystem:console /incremental:yes /pdb:"$(OUTDIR)/shmsdos.pdb" /debug\ - /out:"$(OUTDIR)/shmsdos.exe" -LINK32_OBJS= \ - "$(INTDIR)\shmsdos.obj" - -"$(OUTDIR)\shmsdos.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -################################################################################ -# Begin Target - -################################################################################ -# Begin Source File - -SOURCE=.\shmsdos.c -DEP_CPP_SHMSD=\ - {$(INCLUDE)}"\sys\stat.h"\ - {$(INCLUDE)}"\sys\types.h"\ - - -"$(INTDIR)\shmsdos.obj" : $(SOURCE) $(DEP_CPP_SHMSD) "$(INTDIR)" - - -# End Source File -# End Target -# End Project -################################################################################ diff --git a/buildtools/windows/source/uname/README b/buildtools/windows/source/uname/README deleted file mode 100644 index feb43969c8c..00000000000 --- a/buildtools/windows/source/uname/README +++ /dev/null @@ -1,9 +0,0 @@ -This directory contains the source for uname.exe on Win32. -This version of uname.exe returns the string "WINNT" when -you say 'uname -s' on Windows NT. - -To build it, you need Microsoft Visual C++ and nmake. -Issue the command: - nmake /f uname.mak -The output is Release\uname.exe. Copy it to a directory -on your Path. \ No newline at end of file diff --git a/buildtools/windows/source/uname/uname.c b/buildtools/windows/source/uname/uname.c deleted file mode 100644 index eb26c2ac474..00000000000 --- a/buildtools/windows/source/uname/uname.c +++ /dev/null @@ -1,155 +0,0 @@ -/*********************************************************** - * uname - returns name of OS - **********************************************************/ -#include -#include -#include - -#define index(s, c) strchr((s), (c)) -#define streq(a, b) (strcmp ((a), (b)) == 0) - -static char ** getlistOfOptions (char **pArgv, char * pOptions); -static void getUnameOption ( char option ); - -/*********************************************************************** - * -a Print all information. - * - * -m Print the machine hardware name. - * - * -n Print the nodename (the nodename is the name by which - * the system is known to a communications network). - * - * -p Print the current host's processor type. - * - * -r Print the operating system release. - * - * -s Print the name of the operating system. This is the - * default. - * - * -v Print the operating system version. - * - * -S systemname - * The nodename may be changed by specifying a system name - * argument. The system name argument is restricted to - * SYS_NMLN characters. SYS_NMLN is an implementation - * specific value defined in . Only the - * super-user is allowed this capability. - ***********************************************************************/ - -main( int argc, char *argv[ ], char *envp[ ] ) -{ - char options[1024]; - char *pOptions; - char **pArgv; - char c; - - pArgv = &argv[1]; - pArgv = getlistOfOptions (pArgv, options); - - /* if no options specified, then return operating system */ - pOptions = options; - if ( *pOptions == '\0' ) { - options[0] = 's'; - options[1] = '\0'; - } - while (c = *pOptions++ ) { - if ( c == 'a' ) { - getUnameOption ( 's' ); - printf (" " ); - getUnameOption ( 'n' ); - printf (" " ); - getUnameOption ( 'r' ); - printf (" " ); - getUnameOption ( 'v' ); - printf (" " ); - getUnameOption ( 'm' ); - printf (" " ); - getUnameOption ( 'p' ); - } else - getUnameOption ( c ); - } - return 0; -} - -static char ** -getlistOfOptions (char **pArgv, char * pOptions) -{ - char *pArg; - while ( *pArgv && (**pArgv == '-') ) { - pArg = *pArgv; - pArg++; /* skip over '-' */ - while ( *pArg ) - *pOptions++ = *pArg++; - pArgv++; - } - *pOptions = '\0'; - return pArgv; -} -void getUnameOption ( char option ) -{ - char computerName[128]; - SYSTEM_INFO systemInfo; - OSVERSIONINFO versionInfo; - DWORD computerNameLength = sizeof(computerName); - - GetSystemInfo( &systemInfo); - GetComputerName( (LPTSTR)&computerName, &computerNameLength ); - versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx( &versionInfo ); - - switch ( option ) { - case 'a': - printf ( getenv ("OS") ); - break; - case 'm': - printf ( "xx" ); - break; - case 'n': - printf ( computerName ); - break; - case 'p': - switch ( systemInfo.wProcessorArchitecture ) { - case PROCESSOR_ARCHITECTURE_INTEL: - printf("I386"); - break; - case PROCESSOR_ARCHITECTURE_MIPS: - printf("MIPS"); - break; - case PROCESSOR_ARCHITECTURE_ALPHA: - printf("ALPHA"); - break; - case PROCESSOR_ARCHITECTURE_PPC: - printf("PPC"); - break; - default: - printf("UNKNOWN_PROCESSOR"); - break; - } - break; - case 'r': - printf ("%d.%d", versionInfo.dwMajorVersion, versionInfo.dwMinorVersion ); - break; - case 's': - switch ( versionInfo.dwPlatformId ) { - case VER_PLATFORM_WIN32s: - printf("WIN32S"); - break; - case VER_PLATFORM_WIN32_WINDOWS: - printf("WIN95"); - break; - case VER_PLATFORM_WIN32_NT: - printf("WINNT"); - break; - default: - printf("UNKNOWN_OS"); - break; - } - break; - case 'v': - printf ("%d", versionInfo.dwBuildNumber ); - break; - default: - printf ( "uname -%c is unimplemented", option ); - break; - } -} diff --git a/buildtools/windows/source/uname/uname.mak b/buildtools/windows/source/uname/uname.mak deleted file mode 100644 index f92fd4e294c..00000000000 --- a/buildtools/windows/source/uname/uname.mak +++ /dev/null @@ -1,141 +0,0 @@ -# NMAKE file for building uname.exe. -# -# This file is edited from an NMAKE file generated by -# Microsoft Developer Studio, Format Version 4.20 -# -# To build, say -# nmake /f uname.mak CFG=Release -# or -# nmake /f uname.mak CFG=Debug -# If CFG is omitted, a release build is assumed. - -!IF "$(CFG)" == "" -CFG=Release -!MESSAGE No configuration specified. Defaulting Release. -!ENDIF - -!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE on this makefile -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "uname.mak" CFG="Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Release" (based on "Win32 Console Application") -!MESSAGE "Debug" (based on "Win32 Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF -################################################################################ -# Begin Project -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Release" - -OUTDIR=.\Release -INTDIR=.\Release - -ALL : "$(OUTDIR)\uname.exe" - -CLEAN : - -@erase "$(INTDIR)\uname.obj" - -@erase "$(OUTDIR)\uname.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE"\ - /Fp"$(INTDIR)/uname.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Release/ -CPP_SBRS=.\. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)/uname.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=/nologo\ - /subsystem:console /incremental:no /pdb:"$(OUTDIR)/uname.pdb"\ - /out:"$(OUTDIR)/uname.exe" -LINK32_OBJS= \ - "$(INTDIR)\uname.obj" - -"$(OUTDIR)\uname.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug - -ALL : "$(OUTDIR)\uname.exe" - -CLEAN : - -@erase "$(INTDIR)\uname.obj" - -@erase "$(INTDIR)\vc40.idb" - -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\uname.exe" - -@erase "$(OUTDIR)\uname.ilk" - -@erase "$(OUTDIR)\uname.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "DEBUG"\ - /D "_CONSOLE" /Fp"$(INTDIR)/uname.pch" /YX /Fo"$(INTDIR)/"\ - /Fd"$(INTDIR)/" /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)/uname.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=/nologo\ - /subsystem:console /incremental:yes /pdb:"$(OUTDIR)/uname.pdb" /debug\ - /out:"$(OUTDIR)/uname.exe" -LINK32_OBJS= \ - "$(INTDIR)\uname.obj" - -"$(OUTDIR)\uname.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -################################################################################ -# Begin Target - -################################################################################ -# Begin Source File - -SOURCE=.\uname.c -DEP_CPP_SHMSD=\ - {$(INCLUDE)}"\sys\stat.h"\ - {$(INCLUDE)}"\sys\types.h"\ - - -"$(INTDIR)\uname.obj" : $(SOURCE) $(DEP_CPP_SHMSD) "$(INTDIR)" - - -# End Source File -# End Target -# End Project -################################################################################ diff --git a/l10nkits/client/windows/docs/installer/IS1.JPG b/l10nkits/client/windows/docs/installer/IS1.JPG deleted file mode 100644 index 5ca5152c740bc8a77d260cc12123e79638a1deb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8087 zcmeHrXHb*dw|9Wh1tAnc1A+u0v?HBRghT`qq=hD-Nv{cnDj>axNQZzTT|)1@C{217 z5F`W?1Y-eIP*4!KoICe_&fK|Y=DzQT`{BOx?!CS|Ypq%3xAxx8tabYO^euo5rG?Z2 zP*DK@RA(D-x(v7hV4$O;r=w+{r>AFRWMDeS$#RaF`5Z5Z<2)zd#moGB7r|fwh?I!H z6$v3QSX2=zaZOrIPVTY@Oif8fRZ3P)=1(J3jEs!un9uRBu<*zTf(2#%uh(fWfSm#0 zMCD0Cbp=4pPDR5`bvgjJbQUBv&7a}^wSe?Av~<*e3ia6lR5Ucy)U=F1I$B1?KXam{ z0Rm{*=|CKU+!v%xX6ZSvz|Ar;33FUBvi?FwcD{|x5Cl5%rJVdtV+VX%QIqghMJ0R3 zsPu*xXZCo{{QPHM|89`>OeD>I1{W0_5J*cy`yY|~>5HAiC=JBPC3r;|9Z3r>difRK z@J-gPv2X2^1UN@?7CJi(J3t*!P%GbET>q)vOog@*{HlkxZT4l1jXz4zvYumNS3gAE z8m|`k3Ag6>Q+B;}*WkpVxo0!{6hL2ZN2t<+%GHU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/docs/installer/L10NTREE.JPG deleted file mode 100644 index 9ab09c8beb484e66842fa51a4f3e9b84a8a14ce0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4513 zcmbVOX*3(!+D?#0QuEZBhfodW)I1MG%~e9F`KqC%5<*e)JT{0_s?;no)YK|5J2f0y zL!AaCs4A(TrKp;RtLv_F*Z19Tt-IFwp8fvW>v{LH_n-IK&*{|ZJb=yA(8Le`1OfoS zvjsSv0q6r5&z%FG12KZZUGe}my17(`F^i_~HR0O=Wk^gs{@1ZJQ=>j2WxGXOyB9HQqq z<;1{T+}EsN@@{Axj{+igUKMEj!04)R(gq zR@7aXow_nu`N)UzSZh&WHtEH8Pk?-4)NCGUGr19@8^PitWBiQ=#Te`WAm}l zo(}qc1!^E>0(Cr2aw%#bdKBE&#HXLRJ7Y#eln)_e3;}Njxw1|QL#b%Vpiib+ez>ua zJDv4SZyNIShwBl_ zdNFWSO-!8Tcz7h`f|r)B)>&##r%>LmJa--A-(K#oOF-1WNK85PIzuqnrExlPFL_s~)b}wjo>EJl}8zM;W znv|+QJ|My-ZFs#vII#6R#t>Qi(jVKN9JaME1Ig|k>3VWo%0#vj);2&ife2y$K~p|igCIEXgb0TvVDJ^SNIOcOyv4n-U3D29X6)vn9M|L~TZ{ux=jk5S zL3y!wWxR{uq*%pNueHoF64Lv|%Jz*L!#~9LRjHc`alHXgzu7vNF%tuXU6Hl#I38D7 zNgV-9RQLB5)z~h!IoVsu=VeMjg^Gd@Y=lD1#MU?#qxkN9fu*vaib=j3rL(dMAD;TE z7yqbdNRafhNx-ue%9n!2q;+Drh1ci_nfr09KLQU9P64BZ!L+Xmv_Ha53cTDGHwx}t zQgdBvp2{&96CnwpoD@mTdAGq3e~v_ucs4f3F1}E0fHyJX>-mtIM@Dl~`Lq@Tlw;u< zuf-SX@Bau3tY5!?m$t!FNYTS`Lq1ZP+mCQegF@Jxo6lPL z{CAsa*#Ls8Lo)E~vw5au20H!|(f z-Vz!~U2pj==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OhO$X%7i_Wg2@SpX3s9E0IjRp{lm&WFNv>9_G z*vbl7l@ACBHy=n~FgY4nD%;%B%jd$89G^PIr@Ve}7{u8_sj#%Uuq3wA$xV3y(PE~l z3x*w-&`p}2*HJ|ik=R(q+#8K zt#&5*&O3^3{3WFPPMP`xQD$@N9j<7#lwt5KN3;hX7rkuAugvg6UAc}40y5I8c8kl8 zhoX(V9%oni6T*-Jvrtu8fFSfZMY?@#i - - - - - Product Branding Issues - - - -

-Product Branding Instructions

-Under the terms of the Unlimited Localization Program, you must remove -or replace all trademarked Netscape terms, brand names, icons, images, -etc.  These trademarks are listed on the page found at the following -URL: - -

http://home.netscape.com/misc/trademarks.html#trademarks - -

Please refer to that page for details.  You may not release a localized -version of the Netscape Communicator with these trademarks left in the -product. -
  -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -

-1998, Copyright Netscape Communications -Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/gettingStarted.html b/l10nkits/client/windows/docs/installer/gettingStarted.html deleted file mode 100644 index 1159a619a01..00000000000 --- a/l10nkits/client/windows/docs/installer/gettingStarted.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Getting Started - - - -

-2. Getting Started

-Before you can begin using the Windows Installer Localization Kit, you -must install it and setup your working directories. This is a simple matter -of unzipping the compressed kit file(s) into the proper directories. Your -system must also meet certain requirements to run the tools needed to perform -the localization steps described below. - -

-


-

-System Requirements

-There few system requirements for the kit in the strictest sense; however, -your choice of tools will have their own set of requirements.  The -most likely minimum configuration will be as follows: -
    -
  • -100% IBM compatible PC
  • - -
  • -Pentium® processor
  • - -
  • -Microsoft® Windows NT 3.51 or 4.0 (localized -versions will help testing but aren't required)
  • - -
  • -16 MB RAM
  • - -
  • -30 MB available hard disk space
  • - -
  • -InstallShield International version 3.0 or other install builder software
  • - -
  • -A visual resource editor, such as those provided with Microsoft® -Visual C++, Borland® C++, etc.
  • - -
  • -An active Internet connection and the ability to ftp (send and receive) -large files
  • - -
  • -A Web browser (say, for example, Netscape Communicator ;-)
  • -
- -

- -

- -

-Installing the Kit

-It is recommended that you install the Windows Installer Localization Kit -into the same directory as your other Netscape/Mozilla localization kits: -in other words, install this kit into your kitRoot directory.  -Place this localization kit's .ZIP file in that directory and UNZIP it -with the -d parameter: - -

PKUNZIP -d filename -

    Example:  PKUNZIP -d instkit
- -
-

-Configuring Your Tools

-Please refer to your Installshield or other install builder tool's documentation -for set up and usage instructions. -
  -
- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
- -
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/isocodes.htm b/l10nkits/client/windows/docs/installer/isocodes.htm deleted file mode 100644 index c33c7d170f9..00000000000 --- a/l10nkits/client/windows/docs/installer/isocodes.htm +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - ISO Locale codes - - - -
-

-ISO Language and Country Codes

-2 letter language codes are derived from the ISO 639 standard; country -codes are from ISO 3166. Here are the codes for the locales currently supported -by the L10n kits. If an entry also includes the country code then you must -use that as well when creating the locale directory or naming a file. -

-ISO Language and Country Codes table

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Language NameLanguage CodeCountry Code
-
Chinese (Traditional)
-
-
zh
-
-
CN
-
-
Chinese (Simplified)
-
-
zh
-
-
TW
-
-
Danish
-
-
da
-
-
DK
-
-
Dutch
-
-
nl
-
-
NL
-
-
French
-
-
fr
-
-
FR
-
-
German
-
-
de
-
-
DE
-
-
Italian
-
-
it
-
-
IT
-
-
Japanese
-
-
ja
-
-
JP
-
-
Korean
-
-
ko
-
-
KR
-
-
Portuguese
-
-
pt
-
-
BR
-
-
Spanish
-
-
es
-
-
ES
-
-
Swedish
-
-
sv
-
-
SE
-
- -

-1997, Copyright Netscape Communications -Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/kitOverview.html b/l10nkits/client/windows/docs/installer/kitOverview.html deleted file mode 100644 index 45f1f0c67dd..00000000000 --- a/l10nkits/client/windows/docs/installer/kitOverview.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - Kit Overview - - - -

-Kit Overview

-This kit is primarily intended for knowledgeable developers who are familiar -with the localization process, with InstallShield or other installation -programs, and with Windows resource editors.  There are two basic -approaches you can take to create an installer for your localized Communicator, -Navigator or Mozilla derivative product: -
    -
  1. -Use an existing Communicator or Navigator Export product installer as a -base and add your localized files, or
  2. - -
  3. -Create your own install program and use the registry setting information -provided by the kit.
  4. -
- -
    -

    -Overview of Method 1.

    -For this method you will need the following components: -
      -
      -
    • -Your own copy of InstallShield version 3 International
    • - -
    • -The appropriate version of a Netscape Communicator or Navigator installer.
    • - -
    • -This localization kit.
    • - -
    • -A text editor.
    • - -
    • -A resource editor (e.g., MSDEV)
    • -
    - - -

    You will start with an Export version of a Netscape Communicator or -Navigator installer.  Then, you will extract the localizable components -and modify them as desired.  You will localize a number of strings -contained in .INI files using a text editor. You will use a resource editor -or the Netscape Translation Tools to localize STRINGTABLE and DIALOG resource -types contained in two .DLLs. Once the localizable components of the installer -are finished, you will reassemble the installer using the InstallShield -EXE BUILDER tool, including your localized Communicator, Navigator or Mozilla -derivative product.  This process is detailed in the next section.

- -
    -

    -Overview of Method 2.

    -For this method you will need the following components: -
      -
      -
    • -Your own copy of any install builder software
    • - -
    • -This localization kit
    • -
    - - -

    You will create your own installation program in whatever fashion you -wish.  In order for your localized product to function properly, your -installer will need to implement certain Windows -registry settings.

-  -
- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
-  -
 1998, Copyright Netscape Communications Corp. -All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/kitStruct.html b/l10nkits/client/windows/docs/installer/kitStruct.html deleted file mode 100644 index 9c7222da826..00000000000 --- a/l10nkits/client/windows/docs/installer/kitStruct.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - Kit Structure - - - -

-Kit Structure and Organization

-When you install this localization kit you will find a number of new directories -on your hard disk. Each directory is named so as to be fairly self-explanatory, -but the following diagram and description may help avoid any confusion -you may have about what's what. -

-

- -

-Description of Kit Directories

- -
    -
  • -The kitRoot directory is wherever you install the Netscape -Localization Kits.
  • - -
  • -The l10nkits directory contains the tools (if any) and -documentation you need to complete your work.
  • - -
  • -Since this kit concerns the Windows client product (as opposed to our server -products) all the relevant documentation and tools are found under the -client\windows directory.
  • - -
  • -The docs directory contains documentation on the kit, including -the file you are reading now.
  • -
-  -
- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/localizeAim.html b/l10nkits/client/windows/docs/installer/localizeAim.html deleted file mode 100644 index 57882525f20..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeAim.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Localize AIM.INI - - - -

-Localization notes for AIM.INI

- -General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • -
- -Specific Notes: -

-File Copy String=Copying Netscape AOL Instant Messenger Service files... - -

-Installation String=Installing Netscape AOL Instant Messenger Service files... - -

-Configuration String=Configuring Netscape AOL Instant Messenger Service... - -

-

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -

- -

1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/localizeCD.html b/l10nkits/client/windows/docs/installer/localizeCD.html deleted file mode 100644 index 5c7e5d6dd42..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeCD.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Localize CD.INI - - - -

-Localization notes for CD.INI

-General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -Update the product version number as appropriate.
  • - -
  • -Modify the locale code according to the ISO 639 and ISO 3166 standards. -(See the Reference section for details).
  • - -
  • -You may need to move the placement of "%s" variables in your translation.
  • - -
  • -Do not exceed the length of US string for Deinstall Dialog Wait Message.
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • -
-Specific Notes: - -

Product Setup Title1= Deinstaller - -

Product Version=4.03 (en) - -

Deinstall Dialog Message=Are you sure you want to deinstall Netscape -Communicator 4.03 ? - -

Deinstall Dialog Wait Message=Parsing Netscape Communicator -4.03  deinstall log file %s (this will take several minutes)... - -

  -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  -
  - - diff --git a/l10nkits/client/windows/docs/installer/localizeCosmo.html b/l10nkits/client/windows/docs/installer/localizeCosmo.html deleted file mode 100644 index 1d23dc46a5a..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeCosmo.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Localize COSMO.INI - - - -

-Localization notes for COSMO.INI

-General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -Update the product version number as appropriate.
  • - -
  • -Modify the locale code according to the ISO 639 and ISO 3166 standards. -(See the Reference section for details).
  • -
-Specific Notes: -
  -
Installation String=Installing Cosmo Player files... - -

Configuration String=Configuring Cosmo Player... - -

File Copy String=Copying Cosmo Player files...  - -

Description=VRML 2.0 support  - -

[Registry Entries-Reg2] -
HKEY Value=4.03 (en) - -

[Registry Entries-Reg3] -
HKEY Key Path=Software\Netscape\Cosmo\4.03 (en) - -

[Registry Entries-Reg4] -
HKEY Key Path=Software\Netscape\Cosmo\4.03 (en)\Main -
  -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  -
  - - diff --git a/l10nkits/client/windows/docs/installer/localizeIsuser.html b/l10nkits/client/windows/docs/installer/localizeIsuser.html deleted file mode 100644 index ae583f05177..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeIsuser.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Localize _ISUSER.DLL - - - -

-Localization notes for _ISUSER.DLL

-All dialogs in this .DLL can be localized. -
  -
- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/localizeMmedia.html b/l10nkits/client/windows/docs/installer/localizeMmedia.html deleted file mode 100644 index c8390b57676..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeMmedia.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - Localize MMEDIA.INI - - - -

-Localization notes for MMEDIA.INI

-General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
-Specific Notes: - -

Installation String=Installing Audio/Video Playback files... - -

Configuration String=Configuring Audio/Video Playback... - -

File Copy String=Copying Audio/Video Playback files... - -

Description=Support for multi-media web pages -

-

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -

-

1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/localizeMplay.html b/l10nkits/client/windows/docs/installer/localizeMplay.html deleted file mode 100644 index 998b6091787..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeMplay.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - Localizing MPLAY32.INI - - - -

-Localization notes for MPLAY32.INI

-General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -Update the product version number as appropriate.
  • - -
  • -Modify the locale code according to the ISO 639 and ISO 3166 standards. -(See the Reference section for details).
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • -
-Specific Notes: - -

Installation String=Installing Netscape Media Player files... - -

Configuration String=Configuring Netscape Media Player... - -

File Copy String=Copying Netscape Media Player files... - -

Description=Streaming audio support - -

[Default Folder-Icon2] -
ProgramFolder=[Default Folder]\Utilities - -

[Registry Entries-Reg2] -
HKEY Value=4.03 (en) - -

[Registry Entries-Reg3] -
HKEY Key Path=Software\Netscape\Media Player\4.03 (en) - -

[Registry Entries-Reg4] -
HKEY Key Path=Software\Netscape\Media Player\4.03 (en)\Main - -

[Registry Entries-Reg5] -
HKEY Key Path=Software\Netscape\Media Player\4.03 (en)\Main -
  -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
-1998, Copyright Netscape Communications -Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/localizeNav40.html b/l10nkits/client/windows/docs/installer/localizeNav40.html deleted file mode 100644 index 956cd78205b..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeNav40.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Localize NAV40.INI - - - -

-Localization notes for NAV40.INI

-General Notes: -
    -
  • -Do not exceed the length of English string if possible.
  • - -
  • -Modify the locale code according to the ISO 639 and ISO 3166 standards. -(See the Reference section for details).
  • - -
  • -The "Utilities" folder name may be localized.
  • - -
  • -"Item name" is the name that will appear under the associated icon; these -may be localized.
  • - -
  • -You may need to move the placement of "%s" variables in your translation.
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • -
-Specific Notes: - -

Installation String=Installing Netscape Communicator 4.03 files... - -

Configuration String=Configuring Netscape Communicator 4.03... - -

File Copy String=Copying Netscape Communicator 4.03 files... - -

Description=Contains Collabra, Composer, Messenger, and Navigator. - -

Warn Previous Version Message=Setup has detected a previous installation -of %s. If you installed plugins or helper applications with a previous -installation, you will need to reinstall them to this version of Communicator. - -

[Navigator 1] -
Message=Setup has detected that an instance of Navigator is currently -running. Please quit Navigator before running Setup. - -

[Navigator 2] -
Message=Setup has detected that an instance of Navigator is currently -running. Please quit Navigator before running Setup. - -

[Navigator 3] -
Message=Setup has detected that an instance of Navigator is currently -running. Please quit Navigator before running Setup. - -

[NSMail Notifier] -
Message=Installation cannot continue because the Mail Notification -program is currently running. Use your right mouse button to click the -Mail icon next to the task bar clock and select 'Exit' to disable Mail -Notification, then run the installer again. - -

[Navigator 4.05 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.05 (en)\Main - -

[Navigator 4.04 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.04 (en)\Main - -

[Navigator 4.03 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en)\Main - -

[Navigator 4.02 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.02 (en)\Main - -

[Navigator 4.01 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.01 (en)\Main - -

[Navigator 4.0 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.0 (en)\Main - -

[Navigator 4.0b6 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.0b6 (en)\Main - -

[Navigator 4.0b5 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.0b5 (en)\Main - -

[Navigator 4.0b4 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.0b4 (en)\Main - -

[Navigator 4.0b3 32] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.0b3 [en]\Main - -

[Default Folder-Icon11] -
ItemName=User Profile Manager - -

[Default Folder-Icon12] -
ProgramFolder=[Default Folder]\Utilities -
ItemName=User Profile Manager - -

[Default Folder-Icon13] -
ItemName=Netscape Mail Notification - -

[Default Folder-Icon14] -
ProgramFolder=[Default Folder]\Utilities -
ItemName=Netscape Mail Notification - -

[Registry Entries-R14] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en) - -

[Registry Entries-R15] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en)\Main - -

[Registry Entries-R16] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en)\Main - -

[Registry Entries-R17] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en)\Main - -

[Registry Entries-R18] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en)\Main - -

[Registry Entries-R19] -
HKEY Key Path=Software\Netscape\Netscape Navigator\4.03 (en)\Main - -

[Registry Entries-R37] -
HKEY Value=4.03 (en) - -

[Registry Entries-R38] -
HKEY Key Path=Software\Netscape\Netcaster\4.03 (en)\Main - -

[Registry Entries-R39] -
HKEY Key Path=Software\Netscape\Netcaster\4.03 (en)\Main -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/localizeNetcast.html b/l10nkits/client/windows/docs/installer/localizeNetcast.html deleted file mode 100644 index 5f84f8f84b8..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeNetcast.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Localize NETCAST.INI - - - -

-Localization notes for NETCAST.INI

- -General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • -
- -Specific Notes: -

-Installation String=Installing Netscape Netcaster files... -

-Configuration String=Configuring Netscape Netcaster... -

-File Copy String=Copying Netscape Netcaster files... - -

-

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -

- -

1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/localizeNsconf.html b/l10nkits/client/windows/docs/installer/localizeNsconf.html deleted file mode 100644 index 5ef304d097c..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeNsconf.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - Localizing NSCONF.INI - - - -

-Localization notes for NSCONF.INI

-General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -Update the product version number as appropriate.
  • - -
  • -Modify the locale code according to the ISO 639 and ISO 3166 standards. -(See the Reference section for details).
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • -
-Specific Notes: - -

Installation String=Installing Netscape Conference files... - -

Configuration String=Configuring Netscape Conference... - -

File Copy String=Copying Netscape Conference files... - -

Description=Real-time collaboration and audio conferencing - -

[Registry Entries-Reg17] -
HKEY Value=4.03 (en) - -

[Registry Entries-Reg18] -
HKEY Key Path=Software\Netscape\Conference\4.03 (en) - -

[Registry Entries-Reg19] -
HKEY Key Path=Software\Netscape\Conference\4.03 (en)\Main - -

[Registry Entries-Reg20] -
HKEY Key Path=Software\Netscape\Conference\4.03 (en)\Main
-
-

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/localizeRsutil.html b/l10nkits/client/windows/docs/installer/localizeRsutil.html deleted file mode 100644 index 0fdff957a81..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeRsutil.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - Localize RSUTIL.DLL - - - -

-Localization notes for RSUTIL.DLL

-STRINGTABLES - -

Do not translate the following strings: - -

STRING ID: -
-
17 18 19  -
20 21 22 23 24 25 26 27 28 29  -
30 31 32 33 34 35 36 37 38 39  -
40 41 42 43 44 45 46 47 48 49  -
50 51 52 53 54 55 56 57 58 59  -
60 61 62 63 64 65 66 67 68 69  -
70 71 72 73 74 75 76 77 78 79  -
80 81 82 83 85 86 88  -
90 91 92 95 97 98 99 -
100 101 102 103 104 105 106 107 108 109 -
110 111 112 113 114 -
122 123 126 127 129 -
132 133 134 135 136 137 138 139 -
140 145 149 -
151 153 154 155 156 157 158 159 -
162 163 164 165 166 167 169  -
170 171 172 173 174 175 176 177 178 179 -
180 181 182 183 184 185 187 188 -
190 192 193 194 195 196 197 198 199 -
200 201 202 203 204 205 206 207 208 209 -
210 211 212 213 214 215 216 217 218 219 -
220 221 222 226 227 228 229  -
230 232 233 234 235 236 237 238 239 -
240 241 242 243 244 245 246 247 248 249 -
250 251 252 253 254 255 256 257  -
260 261 263 264 265 266 267 269 -
270 271 272 273 274 275 276 277 278 279 -
280 281 282 283 -
  -
-


-
ICONS -
Replace any trademarked icons, as described in the universal localization -program license agreement, with your own icons. -
  -
- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/localizeSetup.html b/l10nkits/client/windows/docs/installer/localizeSetup.html deleted file mode 100644 index cc2ca881bb6..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeSetup.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - Localize SETUP.INI - - - -

-Localization notes for SETUP.INI

-General Notes: -
    -
  • -Only translate the strings which are shown in bold type face below.
  • - -
  • -The "StartCopy Dialog Message" should be less than 256 bytes long.
  • - -
  • -For the "Multiple Components" section, both the key and the value may be -localized (optional).
  • - -
  • -If the key "Multimedia Support" is localized then next section name should -be identical to the localized key.
  • - -
  • -Change Netscape trademarks to your own product name(s).
  • - -
  • -Update the version number as appropriate.
  • - -
  • -Modify the locale code according to the ISO 639 and ISO 3166 standards. -(See the Reference section for details).
  • -
-Specific Notes: - -

Product Setup Title1= Setup - -

Product Version=4.03 (en) - -

Deinstall Version=4.03 (en) - -

License Dialog Title=Software License Agreement - -

License Dialog Message=Please read the following license agreement. -Use the scroll bar to view the rest of this agreement. - -

License Dialog Question=Do you accept all the terms of the preceding -license agreement? If so, click on the Yes button. If you select No, Setup -will close. - -

License Icon Description=License Agreement - -

Welcome Dialog Title=Netscape Communicator 4.03 Setup - -

Welcome Dialog Message=Welcome to Netscape Communicator 4.03 Setup. - -

SetupType Dialog Title=Setup Type - -

SetupType Dialog Message=Select the type of setup you prefer. - -

Insufficient Space Dialog Title=Insufficient Space - -

Insufficient Space Dialog Message=The path below contains insufficient -space. - -

Path Dialog Title=Choose Destination Location - -

Path Dialog Message=Please enter the location where you would like -to install Netscape Communicator 4.03 -
components. You may type a new directory name or click the Browse -button to find a new location. - -

Options Dialog Title=Netscape Communicator 4.03 Options - -

Options Dialog Message=Check the components you would like to install. - -

Associations Dialog Title=Setup Associations - -

Associations Dialog Message=Check the extensions you would like Communicator -to set up. These extensions will be associated with Communicator components. - -

Select Folder Dialog Title=Select Program Folder - -

StartCopy Dialog Title=Start Copying Files - -

StartCopy Dialog Message=Setup has enough information to start copying -the program files. If you want to review or change settings, click Back. -If you are satisfied with the current settings, click Install to begin -copying files. - -

Readme Dialog Prompt=Would you like to view the README file now? - -

Finish Dialog Prompt=Setup is complete. You may run Netscape Communicator -4.03 by double-clicking on one of the icons in the folder. - -

Reboot Dialog Title=Restarting Windows - -

Reboot Dialog Message=Setup has finished copying files to your computer. -Before you can use the program, you must restart Windows or your computer. - -

Exit Dialog Message=Are you sure you want to exit setup? - -

Error Resource Message1=Could not load Resource: %s -
Error Resource Message2=Attempted to fix the problem. Please restart -the setup application. -
Error Resource Message3=Could not get module handle of rsutil.dll. -System memory could be corrupted. Please reboot and try again. - -

[Multiple Components] -
Multimedia Support=Extension modules for Netscape Communicator -4.03 - -

[Multimedia Support] -
Default Path= -
  -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/localizeURL.html b/l10nkits/client/windows/docs/installer/localizeURL.html deleted file mode 100644 index 57718bc00fd..00000000000 --- a/l10nkits/client/windows/docs/installer/localizeURL.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - Localizing URLs - - - -

-Localizing URLs

-Many resources of all types in the Communicator contain Internet addresses -in the form of URLs (Universal Resource Locators). Most of these point -to locations within the Netscape domain; as part of the Unlimited Localization -Program, you can leave these as they are, or you may change them as you -desire. -

-Internal URLs

-There are a number of internal URLs that should not -be changed.  These are the strings that look like about:[some -value].  These point to internally contained resources, such as -the main About Communicator page.  If you localize these strings you -will not be able to load these pages.  The main examples you might -find are: -
    -
  • -about:
  • - -
  • -about:plugins
  • - -
  • -about:fonts
  • -
-For more examples and information on these internal URLs go here. -
  -
  -
- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
-1998, Copyright Netscape Communications -Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/localize_these_files.html b/l10nkits/client/windows/docs/installer/localize_these_files.html deleted file mode 100644 index 17950feab44..00000000000 --- a/l10nkits/client/windows/docs/installer/localize_these_files.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Localize these Files - - - -

-Localize These Files

-This section tells you exactly what files need to be localized. The following -tables contain two columns: -
    -
  • -The file to be localized column gives the specific file name. The path -name temp refers to wherever you have copied the uncompressed installer -files in Step 2 of the Localization -Checklist. If the file or resource name is a hypertext link, further -information can be found by following that link.
  • - -
  • -The purpose column describes the basic purpose of this file.
  • -
-Table 1. Binary files to be localized - - - - - - - - - - - - - - - - - - -
File to be localized Purpose
rsutil.dllInstaller STRINGTABLE and ICON resources. 
_isuser.dllInstaller DIALOG resources.
- -

-Table 2. .INI files to be localized - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
File to be localizedPurpose
aim.iniAOL Instant Messgenger initialization file.*
cd.iniDeinstaller initialization file.
cosmo.iniCosmo player initialization file.*
mmedia.iniMultimedia initialization file.*
mplay32.iniMedia Player initialization file.*
nav40.iniMain product initialization file.
netcast.iniNetcaster initialization file.
nsconf.iniNetscape Conference initialization file.*
setup.iniMain setup initialization file.
-

-* These files come with the Complete installer version. -

-

- - - -
-
[CONTENTS]
-
- -

-

1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/nomenclature.html b/l10nkits/client/windows/docs/installer/nomenclature.html deleted file mode 100644 index 7b3bff64402..00000000000 --- a/l10nkits/client/windows/docs/installer/nomenclature.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Conventions - - - -

-Nomenclature and Typographical Conventions

-Typographical Conventions -
Words in italics typeface represent a variable term or phrase, -meant to be replaced by another value at "runtime."  Example: -
    locale -- replaced by a 2- or 4 letter locale code; e.g. zhtw
-Words in bold typeface, using a proportional font, represent a literal -value in a string that might also contain a variable word or phrase. Example: -
    4.03 [locale] -- 4.03 [ ] are literal values, -while locale is a variable. -
       
    -
-Words in a fixed width font represent file or directory names, -or DOS or Windows commands to be typed as they appear.  Sometimes, -part or all of the path will be in bold, for emphasis. -Examples: -
    Change to the kitRoot\l10nkits\client\windows\tools -directory -
    Execute RTRNKIT
-Nomenclature -
Throughout this document, certain terms and phrases will be used repeatedly: - -

Table 1. Nomenclature and Typographical Conventions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
kitRoot directory indicates the starting or topmost directory of the Windows Front End -Localization Kit.
platformeither 16 or 32 bit, depending on the version you are working on.
localein general, this refers to the language into which you are localizing -the product. The list of valid locale names is defined in the ISO -Language and Country Codes Table.
localization databasea database generated by a leveraging tool from a set of matched binary -resource files. 
localization notesany special instructions, including the "translate/don't translate" -flag, associated with a given resource.  Localization notes are contained -in the localization database for each resource module.
leverageThe process of merging previous localized versions of a file into a -current version. 
forbidden resourceA resource that cannot be changed from the original value without (negatively) -impacting the functionality of the product. These are identified in the -localization databases.
-  -
  -

- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/projectOverview.html b/l10nkits/client/windows/docs/installer/projectOverview.html deleted file mode 100644 index 642b5087fd4..00000000000 --- a/l10nkits/client/windows/docs/installer/projectOverview.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Project Overview - - - -

-1. Project Overview

- -
Welcome to the Communicator/Navigator -Installer Localization Kit!
- - -

Under the universal localization program, you are free to create an -installer for a localized Communicator, Navigator or Mozilla derivative -product in any way you choose. This localization kit will assist you in -creating a your installer for the 32-bit Windows platform. As long as you -follow the terms of the universal localization program license agreement, -you are free to do what you want with the resulting localized product and -installer. - -

The Netscape Communicator and Netscape Navigator 4.x installation programs -were created with InstallShield® version -3.  Because this is the proprietary product of InstallShield Corporation, -Netscape cannot redistribute the complete source for these installers.  -You may, however, modify an existing Communicator or Navigator installer, -or if you choose, you may build your own installer "from scratch". - -

Note: because of the U.S. Government's restrictions on the export -of strong cryptography, you may only distribute the "export" version -of the Netscape binaries.  Please keep this in mind as you work with -the localization kit instructions. -
  -

- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
-  -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/reference.html b/l10nkits/client/windows/docs/installer/reference.html deleted file mode 100644 index b424d42abe8..00000000000 --- a/l10nkits/client/windows/docs/installer/reference.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Reference - - - -

-Reference

-This section summarizes the references used throughout this document.  -In addition, other miscellaneous references may be found here. - -

Table 5. Reference Links - - - - - - - - - - - - - - - - -
Locale Table (local)Locale -Table (remote)Windows Registry Settings Reference
Communicator International -Features
- - -

  -

- - - -
-
[CONTENTS]
-
- -
 
- -
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/registrySettings.html b/l10nkits/client/windows/docs/installer/registrySettings.html deleted file mode 100644 index 7dd697b6524..00000000000 --- a/l10nkits/client/windows/docs/installer/registrySettings.html +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - Windows Registry Settings - - - -

-Windows Registry Settings

-This document is provided as a reference to the Windows registry settings -implemented by Communicator and Navigator.  You may use this as a -guide to the registry settings you must implement if you create your own -installation program (as opposed to localizing an existing Netscape installer). - -

Note that in the Netscape installers, these settings are implemented -only within .INI files.  This simplifies modifying and localizing -the installer. It is recommended that your installer do the same. - -

You may observe the registry changes made by any product with tools -such as Regmon. This -may be a useful addition to your toolset. - -

These notes are applicable to Netscape Communicator version 4.03. -
  - - - - -
MPLAY32.INI  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Media Player  -
Name : CurrentVersion  -
Value: 4.03 (en)  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Media Player\4.03 (en)  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Media Player\4.03 (en)\Main  -
Name : Install Directory  -
Value: [Default Path]\MPlayer  -
Type : REGDB_STRING  - -

Name : Program Folder  -
Value: [Program Folder]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\.LAM  -
Name : (Default)  -
Value: LAMDocument  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\LAMDocument\shell\open\command  -
Name : (Default)  -
Value: [WINSYSDIR]\mplay32.exe %1  -
Type : REGDB_STRING  - -

Name : (Default)  -
Value: [WINDIR]\mplayer.exe %1  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\LAMDocument\DefaultIcon  -
Name : (Default)  -
Value: [Default Path]\MPlayer\npcfg32.exe ,0  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\MCI32  -
Name : LiveAudioFile  -
Value: mcilma32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\MCI  -
Name : LiveAudioFile  -
Value: mcilma.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\MCI32  -
Name : LiveAudioMetafile  -
Value: mcilau32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc  -
Name : mcilau32.dll  -
Value: (MCI) Netscape Media Player  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\MCI  -
Name : LiveAudioMetafile  -
Value: mcilau.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\MCI -Extensions  -
Name : LAM  -
Value: LiveAudioMetafile  -
Type : REGDB_STRING  - -

Name : LMA  -
Value: LiveAudioFile  -
Type : REGDB_STRING  - -

Name : LA  -
Value: LiveAudioFile  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc  -
Name : mcilma32.dll  -
Value: (MCI) Netscape Packetized Audio  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32  -
Name : MSACM.NSPAC  -
Value: NSPAC32.ACM  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc  -
Name : NSPAC32.ACM  -
Value: elemedia(TM) AX24000P Music Codec  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32  -
Name : MSACM.voxacm118  -
Value: vdk32118.acm  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc  -
Name : vdk32118.acm  -
Value: Voxware 32bit Codec  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32  -
Name : MSACM.NSX83  -
Value: NSX83P32.ACM  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc  -
Name : NSX83P32.ACM  -
Value: elemedia(TM) SX8300 Speech Codec  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32  -
Name : MSACM.NSMLAW  -
Value: NSMLAW32.DLL  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\drivers.desc  -
Name : NSMLAW32.DLL  -
Value: Netscape G.711 Decoder  -
Type : REGDB_STRING  -
-


-
NAV40.INI  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App -Paths\Netscape.exe  -
Name : (Default)  -
Value: [Default Path]\Program\Netscape.exe  -
Type : REGDB_STRING  - -

Name : Path  -
Value: [Default Path]\Program  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{7865A9A1-33A8-11d0-BED9-00A02468FAB6}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\brpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{543EC0D0-6AB7-11d0-BF56-00A02468FAB6}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\brpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{543EC0D1-6AB7-11d0-BF56-00A02468FAB6}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\brpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{2D0A7D70-748C-11d0-9705-00805F8AA8B8}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\edpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{E8D6B4F0-8B58-11d0-9B63-00805F8ADDDE}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\mnpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{DDF4AB60-8B84-11d0-9B63-00805F8ADDDE}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\mnpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{CC3E2871-43CA-11d0-B6D8-00805F8ADDDE}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\mnpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{CC3E2872-43CA-11d0-B6D8-00805F8ADDDE}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\mnpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netscape Navigator  -
Name : CurrentVersion  -
Value: 4.03 (en)  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netscape Navigator\Users  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netscape Navigator\4.03 -(en)  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netscape Navigator\4.03 -(en)\Main  -
Name : Install Directory  -
Value: [Default Path]  -
Type : REGDB_STRING  - -

Name : Java Directory  -
Value: [Default Path]\Program\Java  -
Type : REGDB_STRING  - -

Name : NetHelp Directory  -
Value: [Default Path]\Program\NetHelp  -
Type : REGDB_STRING  - -

Name : Plugins Directory  -
Value: [Default Path]\Program\Plugins  -
Type : REGDB_STRING  - -

Name : Program Folder  -
Value: [Program Folder]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CURRENT_USER\Software\Netscape  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\Main  -
Name : Install Directory  -
Value: [Default Path]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\CLSID  -
Name : (Default)  -
Value: {61D8DE20-CA9A-11CE-9EA5-0080C82BE3B6}  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\Insertable  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\protocol\StdFileEditing\server  -
Name : (Default)  -
Value: [Default Path]\Program\Netscape.exe  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\protocol\StdFileEditing\verb\0  -
Name : (Default)  -
Value: &Edit  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\open\command  -
Name : (Default)  -
Value: [Default Path]\Program\Netscape.exe "%1"  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\print\command  -
Name : (Default)  -
Value: [Default Path]\Program\Netscape.exe /print("%1")  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\print\ddeexec  -
Name : (Default)  -
Value: [print("%1")]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\PrintTo\command  -
Name : (Default)  -
Value: [Default Path]\Program\Netscape.exe /printto("%1","%2","%3","%4")  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\PrintTo\ddeexec  -
Name : (Default)  -
Value: [("%1","%2","%3","%4")]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\open\ddeexec  -
Name : (Default)  -
Value: "%1"  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\open\ddeexec\Application  -
Name : (Default)  -
Value: NSShell  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\open\ddeexec\Topic  -
Name : (Default)  -
Value: WWW_OpenURL  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\Edit\command  -
Name : (Default)  -
Value: [Default Path]\Program\Netscape.exe -edit "%1"  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\Edit\ddeexec  -
Name : (Default)  -
Value: [edit("%1")]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netcaster  -
Name : CurrentVersion  -
Value: 4.03 (en)  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netcaster\4.03 (en)\Main  -
Name : Install Directory  -
Value: [Shell Path]\Netcast  -
Type : REGDB_STRING  - -

Name : Program Folder  -
Value: [Program Folder]  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{C98D0190-7D81-11d0-BF8D-00A02468FAB6}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\brpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{37B601C0-8AC8-11d0-83AF-00805F8A274D}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\brpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\CLSID\{913A4A20-8EBF-11d0-BFAB-00A02468FAB6}\InprocServer32  -
Name : (Default)  -
Value: [Default Path]\Program\brpref32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\print\ddeexec\Application  -
Name : (Default)  -
Value: NSShell  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\PrintTo\ddeexec\Application  -
Name : (Default)  -
Value: NSShell  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup\shell\Edit\ddeexec\Application  -
Name : (Default)  -
Value: NSShell  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\NetscapeMarkup  -
Name : (Default)  -
Value: Hypertext Markup Language  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\telnet  -
Name : (Default)  -
Value: URL:Telnet Protocol  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CLASSES_ROOT\telnet\shell\open\command  -
Name : (Default)  -
Value: telnet %1  -
Type : REGDB_STRING  -
-


-
NETCAST.INI  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netcaster  -
Name : CurrentVersion  -
Value: 1.0 (en)  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netcaster\1.0 (en)  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Netcaster\1.0 (en)\Main  -
Name : Install Directory  -
Value: [Default Path]  -
Type : REGDB_STRING  - -

Name : Program Folder  -
Value: [Program Folder]  -
Type : REGDB_STRING  -
-


-
NSCONF.INI  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Conference  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Conference\CurrentVersion  -
Name : Description  -
Value: Conference  -
Type : REGDB_STRING  - -

Name : InstallDate  -
Value: [TIME]  -
Type : REGDB_NUMBER  - -

Name : Installed  -
Value: 1  -
Type : REGDB_NUMBER  - -

Name : PathName  -
Value: [Default Path]  -
Type : REGDB_STRING  - -

Name : SoftwareType  -
Value: application  -
Type : REGDB_STRING  - -

Name : VersionBuild  -
Value: 1213  -
Type : REGDB_NUMBER  - -

Name : VersionMajor  -
Value: 1  -
Type : REGDB_NUMBER  - -

Name : VersionMinor  -
Value: 0  -
Type : REGDB_NUMBER  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32  -
Name : MSACM.VOXACM118  -
Value: vdk32118.acm  -
Type : REGDB_STRING  - -

Name : MSACM.NSX83  -
Value: nsx83p32.acm  -
Type : REGDB_STRING  - -

Name : MSACM.NSX723  -
Value: sx5363s.acm  -
Type : REGDB_STRING  - -

Name : MSACM.NSMLAW  -
Value: nsmlaw32.dll  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_CURRENT_USER\Software\Netscape  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_CLASSES_ROOT\nscfile\shell\open\command  -
Name : (Default)  -
Value: [Default Path]\NSConf32.exe -f "%1"  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Conference  -
Name : CurrentVersion  -
Value: 4.03 (en)  -
Type : REGDB_STRING  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Conference\4.03 (en)  -
Name : (Default)  -
Value:  -
Type :  -
  - -

Key  : HKEY_LOCAL_MACHINE\Software\Netscape\Conference\4.03 (en)\Main  -
Name : Install Directory  -
Value: [Default Path]  -
Type : REGDB_STRING  - -

Name : Program Folder  -
Value: [Program Folder]  -
Type : REGDB_STRING  -
 

-  -
  -

- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/reportingBugs.html b/l10nkits/client/windows/docs/installer/reportingBugs.html deleted file mode 100644 index efa1cb5a045..00000000000 --- a/l10nkits/client/windows/docs/installer/reportingBugs.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Reporting Bugs - - - -

-Reporting Bugs

-Any bugs in the localization kits you find should be reported to mozilla.org -as soon as possible. When you report a bug, try to be as specific as you -can about the exact steps needed to reproduce the bug.  Provide a -complete description of the problem versus the expected results.  -You should let us know if the problem is 100% reproducible (it happens -every time), or if it is intermittant.  If you think that your operating -environment may play some factor, let us know the details of that.  -Finally, before reporting any bug, you should make sure that the problem -doesn't also happen in the US English product (if it does, we still want -to know, but it may not be possible to fix it through the localization -kits or tools as they are now). - -

To report a bug, post a message to the following mozilla.org newsgroup: -
  -

news://news.mozilla.org/netscape.public.mozilla.general
- - -

Be sure to include the information described above. -
  -

- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/returnKit.html b/l10nkits/client/windows/docs/installer/returnKit.html deleted file mode 100644 index 57a3ad67937..00000000000 --- a/l10nkits/client/windows/docs/installer/returnKit.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Returning the Kit - - - -

-5. Publishing the Finished Kit

-Once you are satisfied with the quality of your localization efforts, you -are required by the terms of the universal localization program license -agreement to make your localized product publicly available. The exact -details of how you do this is up to you, the most commonly acceptable method -is to post your localized product to a publicly accessible ftp site. - -

You should post just the localized versions of the files mentioned in -the Localize These Files section of this document. For ease of transfer, -you may create a compressed archive in the .ZIP file format that contains -the localized files. Create one .ZIP file for each language/platform you -do. If you are publishing more than one language or platform, you may combine -multiple .ZIP files into one master .ZIP file if this makes your life easier. - -

If your localized product includes your own trademarks, you should identify -these and any restrictions you are placing on their use. You must also -include a copy of the End User License Agreement (EULA), as well as a notice -stating that Netscape Communications is not required to support your product, -and that you are the Licensor referred to in the EULA. Please refer to -the Universal Localization Agreement for the exact legal requirements. - -

Once your localized product is publicly available, you may inform the -world in any manner you choose, but we encourage you to also post the download -location to the mozilla.org Announcements newsgroup (netscape.public.mozilla.announce). -

 
-Congratulations! You are done!
-  -
- - - - - -
-
[BACK]
-
-
[CONTENTS]
-
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/installer/splash.html b/l10nkits/client/windows/docs/installer/splash.html deleted file mode 100644 index d7aac2266e1..00000000000 --- a/l10nkits/client/windows/docs/installer/splash.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Title Page - - - -
-

-NETSCAPE COMMUNICATOR

- -
- -
-

-Localization Kit

- -
-

-for Microsoft® Windows (32-bit version)

- -
-

-Revision 1.1

- -
Copyright © 1994-1998 Netscape® Communications Corporation, -All rights reserved.
-  -
  -
- - - - - -
-
[NEXT]
-
-
[CONTENTS]
-
- -
 
- - - diff --git a/l10nkits/client/windows/docs/installer/testKit.html b/l10nkits/client/windows/docs/installer/testKit.html deleted file mode 100644 index 5de12261ca9..00000000000 --- a/l10nkits/client/windows/docs/installer/testKit.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Testing the Localized Resources - - - -

-4. Ensuring Quality

-The quality of your localized version will have a large impact on its acceptance -in the marketplace.  You can greatly enhance your chances of producing -a quality product by using experienced and skilled localizers, and by performing -post-translation testing. - -

When performing the actual translation, you should be sensitive to a -number of issues: -

    -
  • -Completeness: you should aim for as thorough a translation as possible.  -Try not to leave portions of the product untranslated. However, be aware -that some terms may best be left in English, depending on local conventions.
  • - -
  • -Suitability: all translations should be suitable and appropriate for product, -the language, the market and the customers you intend to reach.  This -includes using the proper technical terminology for a give platform or -computer operation, as well as using language that is readily understood -by the average user of the product in a given language.  You should, -where possible, try to use terminology which is similar to other products -available on the same platform (without violating copyrights or trademarks, -of course).
  • - -
  • -Accuracy: you should be sure your translation conveys the same meaning -and intention as the original English.
  • - -
  • -Grammar and spelling: you should be sure your translation is grammatically -accurate and free from spelling errors.
  • -
-Keep in mind that engineers do not necessarily make the best localizers! - -

Once localization is complete, there are two basic types of post-translation -testing that should be done: -
  - - - - - - - - - - - - -
Linguistic ReviewChecking all translations for accuracy and appropriateness in the actual -context in which they appear.
Functional TestingEnsuring the product still functions as designed (or at least as well -as the US English product).
-  -
For the linguistic review, you should have an independent reviewer -(i.e. not the person who implemented the translations) check every string -for the items listed above.  In some cases, it may be enough to review -the running product itself; however, it is also valuable to print out your -translations and review them externally from the product. - -

For the functional testing, your best resource are the directions contained -in the localization notes and this document. You should review the completed -product's localization notes with this document in hand, double checking -that you have followed all the instructions contained here. - -

Consider the following general guidelines when testing: -

    -
  • -It is helpful to have a second copy of the product running with the English -version so you can compare them side by side (a second computer might be -helpful or required for this).
  • - -
  • -Walk through every menu in each module you have localized looking for translation -accuracy, pick letter conflicts and other problems.
  • - -
  • -Bring up as many dialogs as you can, looking for translation accuracy, -pick letter conflicts, truncated strings and functionality issues.
  • - -
  • -Exercise the installer in as many ways as possible:
  • - -
      -
    • -Select every installer option
    • - -
    • -Be sure to test the deinstaller
    • - -
    • -Look at the icons and folder names created
    • - -
    • -Use accented or multibyte file and directory names
    • - -
    • -Install to non-existant and read-only directories
    • - -
    • -Install to drives with insufficient disk space
    • - -
    • -etc.
    • -
    - -
  • -If functional problems are found, you should compare the same steps you -took in the localized product to the English product: if the two products -fail in the same way, it is a "core" bug, which can only be fixed by changing -the core product's executable. If the localized product fails while the -English product does not, then it is probably a translation-related bug; -these can be fixed by altering the way you localize the product (perhaps -by not translating a particular item, or by translating it differently).
  • -
-The following section tells you how to report bugs in the localization -kit itself, or in the core product. -
  -
- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
- -
 
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
-  - - diff --git a/l10nkits/client/windows/docs/installer/toc.html b/l10nkits/client/windows/docs/installer/toc.html deleted file mode 100644 index 5503e91c44a..00000000000 --- a/l10nkits/client/windows/docs/installer/toc.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Table of Contents - - - -

-Table of Contents

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
i. Title Page  -
 
1. Project Overview  - -
2. Getting Started  -
3. Using the Kit  -
4. Ensuring Quality  -
5. Publishing the Finished Kit  -
 
6. References 
-  - - diff --git a/l10nkits/client/windows/docs/installer/usingKit.html b/l10nkits/client/windows/docs/installer/usingKit.html deleted file mode 100644 index f8d625beab9..00000000000 --- a/l10nkits/client/windows/docs/installer/usingKit.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - Using the Kit - - -  - - - - -
-
WARNING! Protect yourself from data loss -by making regular backups of your work.
-
- -

-3. Using the Kit

-Once your copy of the Windows Installer Localization Kit is correctly installed, -you may begin your localization work by following the instructions in the -remainder of this document. The next section discusses the contents of -the localization notes provided with this kit. It is important that you -work properly with the instructions contained in these files or the localized -product you create may not function. -

-Understanding the Localization Notes

-Each localized module to be installed has an associated initialization -(.INI) file. The localization notes for these files, and for the localizable -dynamic link libraries used by the InstallShield installer, are provided -as HTML documentation. (There are no localization databases in this kit). -Additionally, a section detailing the required Windows registry settings -is also provided in HTML format. - -

The next section presents the basic localization process as a checklist. -

-
- -

-Localization Checklist

-This checklist applies to the "modifying -an existing Communicator installer" method. If you are creating -your own installer, you will need to adapt this checklist accordingly. -A reference is provided to help you implement the correct Windows -registry settings. - -

1. Download an existing installer -
You will need a matching installer for the product you are localizing. -In other words, if you are localizing Netscape Communicator version 4.03, -you need an installer for the Export version of Netscape Communicator 4.03. -If you are localizing Mozilla Navigator version 5.0, you need an installer -for the Export version (if any) of Mozilla Navigator version 5.0. Latest -versions of Netscape products can be downloaded from the Netscape -homepage. Older versions of Netscape installers, matching the versions -used to generate the localization kits, can be found on the mozilla.org -ftp site. - -

Current Netscape installers come in two forms: base and complete. Complete -installers include plugins and other components besides the basic Communicator -software. You may use either installer as the foundation for your work, -but note that there may not be localization kits for the additional components. -Even if you choose to distribute the English version of these components, -however, you must modify the associated initialization files, listed in -the Localize These Files -page in order for the additional components to be installed properly. - -

2. Uncompress the Installer files -

    -
  • -Run the installer you downloaded in step 1. This will bring up the following -dialog (or something very similar):
  • - -
    -
  • -Click yes. InstallShield will extract all the installation files to your -temporary directory. (Usually, this will be C:\temp or something similar). -Once this process is complete, the blue InstallShield background will display.
  • - -
  • -Without exiting the installer, locate the unpacked installer files in your -temp directory and copy them to a new directory. Call this directory "install" -(or something similar).
  • - -
  • -Exit the installer.
  • -
-3. Uncompress the Deinstaller files -
    -
  • -Change directories to your "install" directory. Locate the file cd32*.exe -(where * equals the version number you are working on. For example, version -4.03 would be represented as cd32403.exe).
  • - -
  • -Execute cd32*.exe. This will bring up a dialog similar to the one shown -is step 2. Click yes and wait until InstallShield has finished unpacking -the deinstaller files (the blue InstallShield background will display).
  • - -
  • -Without exiting the installer, locate the unpacked deinstaller files in -your temp directory and copy them to a new directory. Call this directory -"deinstall" (or something similar).
  • - -
  • -Exit the installer.
  • -
-4. Extract localizable installer .DLLs -
Change directories to your "install" directory. Use the InstallShield -tool ICOMP.EXE to extract RSUTIL.DLL and _ISUSER.DLL from _SETUP.LIB: -
    Example: icomp _setup.lib -d
-4. Localize files -
Consult the Localize These -Files page to learn which files contain localizable resources. - -

For each file to be localized, locate the associated Localization Notes -for that file and follow them carefully. - -

5. Replace original product files contained in nav40.z with localized -product files -
Use the ICOMP tool to replace the original (English language) Communicator -or Navigator files with the ones you have localized using the Windows Front -End Localization Kit. -

    -
  • -Make sure your localized product directory structure matches the structure -inside the compressed file nav40.z. (If necessary, uncompress nav40.z (including -subdirectories), and replace all the localizable files (as identified by -the Windows Front End Localization Kit) with your localized versions).
  • - -
  • -Update nav40.z with your localized files:
  • - -
      Example: icomp \kitRoot\products\client\windows\platform\locale\*.* -nav40.z -i
    -
-6. Rebuild the self-extracting deinstaller program -
Use the InstallShield tool EXE Builder to reassemble the self-extracting -deinstaller archive. -
    -
  • -Specify your "deinstall" directory as the source directory.
  • - -
  • -Set compression on.
  • - -
  • -Specify Setup.exe as the command line program to run when self-extraction -is complete. (No optional parameters are required.)
  • - -
  • -Specify your "install" directory as the target directory.
  • - -
  • -Enter the name of your localized product as the application name.
  • - -
  • -Do not specify a password.
  • - -
  • -Once creation of your localized self-extracting deinstaller is complete, -locate the file Setupex.exe in your "install" directory and rename it to -match the original name of the deinstaller self-extracting program (e.g., -cd32403.exe).
  • -
-7. Rebuild the self-extracting installer program -
Use the InstallShield tool EXE Builder to reassemble the self-extracting -installer archive. -
    -
  • -Specify your "install" directory as the source directory.
  • - -
  • -Set compression on.
  • - -
  • -Specify Setup.exe as the command line program to run when self-extraction -is complete. (No optional parameters are required.)
  • - -
  • -Specify any directory you want as the target directory.
  • - -
  • -Enter the name of your localized product as the application name.
  • - -
  • -Do not specify a password.
  • - -
  • -Once creation of your localized self-extracting installer is complete, -locate the file Setupex.exe in your target directory and rename it to something -meaningful.
  • -
-8. Complete post-translation processing -
After translation is complete, you need to test your work and deal -with any problems: -
    -
  • -Test the localized installer.
  • - -
  • -Fix translation bugs using your localization tools or a resource editor.
  • - -
  • -Fix dialog size bugs using your localization tools or a resource editor.
  • - -
  • -Report core bugs to Netscape.
  • -
-9. Publish your localized product to the Internet -
As the terms of the universal localization program license agreement -state, your localized product - -

"must be made publicly available in executable code form, -
free of charge, for electronic delivery via a mechanism -
generally accepted in the software development -
community." - -

In plain English, this means you should post your localized product -on a publicly accessible http: or ftp: server. You may also want to send -an announcement of your product's availability to mozilla.org (though you -are not required to do so). - -

-


-

-Product Branding Issues

-If you are using this kit under the auspices of the universal localization -program, you must remove or replace Netscape trademarked strings, images -and icons in your localized version. Click here -for instructions. - -

-


-

-How to Localize Different Resource Types

-This section provides you with general information about localizing the -various resource types and files found with this kit. -

-Localizing .INI Files

- -
    Most of the work for the Windows installers is localizing initialization -(.INI) files. You may use the text editor of your choice to do this work. -Be sure the localized files are saved as plain text only. -

    -Localization Notes

    -Individual localization notes for the installer .INI files are contained -in the individual HTML documents linked from the Localize -These Files page.
- -

-Localizing URLs

- -
    You will not likely encounter any URLs (Universal Resource Locators) -in the installers, but if you do, how they are localized depends on whether -you are creating a branded Netscape version or not. The rules for how to -handle URLs are found here.
- -

-Localizing String Tables

- -
    Use the resource editor of your choice to localize STRINGTABLE resources. -These are the most sensitive, potentially problematic resource type you -will be working with. Therefore, you must pay close attention to the instructions -provided in the localization notes. -

    -Localization Notes

    -Individual localization notes for the installer resource .DLLs are contained -in the individual HTML documents linked from the Localize -These Files page. This section gives you some additional general guidelines -to follow when localizing the installer binary files. -
      -
    • -Some strings may contain C++ print format strings, such as %s, %ld, %lu, -etc. Do not modify these while translating the rest of the string.
    • - -
    • -Some strings may contain new line characters: \n. In general, you should -try leave these as you find them.
    • -
    -
- -

-Localizing Menus

- -
    There are no menu resources in the Windows installer
- -

-Localizing Dialogs

- -
    Use the resource editor of your choice to localize and resize DIALOG -resources. Dialog translation is usually not as tricky as localizing string -tables; however, you should take care to assign unique pickletters to dialog -controls. -

    -Localization Notes

    -
- -
    Individual localization notes for the installer resource .DLLs are -contained in the individual HTML documents linked from the Localize -These Files page.
-  -
- - - - - - - -
-
[BACK]
-
-
[NEXT]
-
-
[CONTENTS]
-
- -
1998, Copyright Netscape -Communications Corp. All Rights Reserved
- - - diff --git a/l10nkits/client/windows/docs/nav40/SPLASH.JPG b/l10nkits/client/windows/docs/nav40/SPLASH.JPG deleted file mode 100644 index 37d129cb7e4631c064f485d2408d43089c31eacc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19447 zcmeFXbx>Tb2 zgZ?=0ynF7wRp6)6Vp1oGDwR^Ar`s;q2ef$j|0xKvh08mf>0F;Bf&U z2f)U}#KOeD#=^qF!NJDGBg4mg_6(1jgp`ns?)eLPy63dC3_vbc2Bufcw6ttOpjX^H z{QUecSVbg+dBwT-_<8>^2nr4k4&F07Dtvq@UPf9*-v8_Cu^m8+je>y^iiW}jKqW>& zBSv}b2GBkkiHeH$Wa+;yOe}N^R5a{=XpM*fC}?P?s2G^oxKC?9e+EE7MMDQ*5Mwfu z@L-Y3Xqb|bGeKd$sCeH)tP&9G%mPBPpWFhzSJzK|@8y{15YYPy9pjJl0KBLFpc11I1Ec_H!>OLG8uHb1rus{6v+T)rqfiHbl3Jj@ zCfp*EXKvP`G)rKw<`GbHUV)T4v@0fNMqpD(-C{iWJ)DtCs1##;ng2O5mQTAv@Us?T zB^dO#!q_JZ(NgsYa8(o78%sK`f4a@qJ4H6c9kMK5J3v!A!~*={C_b;rrxZ}HcN z_u0lh=Rw?UTBVI1QN@p$3Q4tz<=IC-V?o-**1(Oy!iy^blZn9AGvgnB#Z*3@h=~> z`A?US&X_V{5wJRII^ql$StSU-+cc~sjeT`(F2J{)qO~Hx_`~bZ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;!Z+S8%twg#&|-8{6Tk4Z!Lifwcd^7Y@&Q|1sEpsrHXKOW99{ zKMmr4#SWZwJsM%^o~>I7+^O^H)aA0z<l>2TI&`Z|f5fDY*Thi2EI| z-B(e@wOGH(IyiHa^v+u;iW|5)OBY@@b1Kt%gfJBRlV+9 zC2&2Yb=q3ZSo^57J#o`7zR~2H*k_)qn00*3=7`73d99{S?dw^an8FYumv15eXV!U} zoAVd*6e{f#&2XAuVscCD(H#p8k5g0pZZqz*o_Fru#jXhvRXW$KRvxvKyR_p>tH{ci z%`1VWLX$=R8s^{^@t36T=RN);%POWXXR)iZ(_PFmo#*|Tzok>5-U!>~bGh#9tmKyw zva(--vo7S$bWKaWd+mqpq=hX@WKuQ!6K>DE^Y7IL2IdJzEB`YG!G{XyA{kL<>9$LrIJczS2JG_uKR5tCY@{y{ek8$1(Y8 zVPQdG>*{t3;C#&-u7J?HwsnRZ>$>*87Y(?&_wx0}(&8^x|N9uqi!!$k>wuFg$iDnP z!<+eDb)E7*M7`>7+D-W@WdA`6c+`x4d{0jNqV>OzhM4A;eEo6k=r7>@$33CW@HPo0 z49A!M8Gfr@n!m{XA8XM3Z~jZ|UHboUEoF**cd;Nid;YS7v(dS2msVyv-(cR|$u4<5 zy{)+G_@}+bpOuck$*JBI)cCY2{h4e3jT_%fMny+dI5e*h$SS+P`B>Z0tt-xK*wS`8 d(^1pOA&kMpgCXB5Xxql*wX1iwrp5oi2>@gPs!0F< diff --git a/l10nkits/client/windows/docs/nav40/allxpstr.h b/l10nkits/client/windows/docs/nav40/allxpstr.h deleted file mode 100644 index 2753cf49937..00000000000 --- a/l10nkits/client/windows/docs/nav40/allxpstr.h +++ /dev/null @@ -1,7878 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#if defined(FEATURE_CUSTOM_BRAND) -#include "xp_brand.h" -#else -#define MOZ_NAME_PRODUCT "Mozilla" -#define MOZ_NAME_BRAND "Mozilla" -#define MOZ_NAME_FULL "Mozilla Navigator" -#define MOZ_NAME_COMPANY "Netscape Communications Corp" -#endif /* FEATURE_CUSTOM_BRAND */ - - -/* -** Cross platform error codes. These are system errors, library errors, -** etc. The ranges of error messages are displayed in the following table: -** -** actual 7000 added category -** low high low high -** -12288 -12276 -5288 -5276 sslerr (Mac, Unix) -** -8192 -8171 -1192 -1171 secerr (Mac, Unix) -** -7000 -5700 0 1300 Win, Mac FE -** -4978 -4978 2022 2022 Mac FE -** -436 -204 6564 6796 merrors -** 0 160 7000 7160 xp_error (Mac, Unix) -** 1000 1048 8000 8048 Unix FE -** 10000 11004 17000 18004 xp_error (Win) -** 14000 14020 21000 21020 Mac FE -** 15000 25000 22000 32000 xp_msg (Win, Mac, Unix) -** 25769 27500 32769 34500 Win FE -** 50000 58000 57000 65000 secerr, sslerr (Win) -** -** Newbie NOTE: allxpstr.c and allxpstr.rc are exactly the same file. -** Edit only one and cvs update the other one. rc is for windows build. -** -*/ -#ifndef _ALLXPSTR_H_ -#define _ALLXPSTR_H_ - -#include "resdef.h" - -#define XP_MSG_BASE 15000 -#define SEC_DIALOG_STRING_BASE (XP_MSG_BASE + 8000) - - -/* WARNING: DO NOT TAKE ERROR CODE -666, it is used internally - by the message lib */ - - -/* from merrors.h */ -RES_START -BEGIN_STR(mcom_include_merrors_i_strings) - -/* #define MK_HTTP_TYPE_CONFLICT -204 */ -ResDef(MK_HTTP_TYPE_CONFLICT, -204, -"A communications error occurred.\n\ - (TCP Error: %s)\n\n\ -Try connecting again.") - -/* #define MK_BAD_CONNECT -205 */ -ResDef(MK_BAD_CONNECT, -205, -MOZ_NAME_BRAND" is unable to connect to the server at\n\ -the location you have specified. The server may\n\ -be down or busy.\n\n\ -Try connecting again later.") - -/* #define MK_TCP_ERROR -206 */ -ResDef(MK_TCP_ERROR, -206, -"A communications error occurred.\n\ - (TCP Error: %s)\n\n\ -Try connecting again.") - -#ifdef XP_MAC -/* #define MK_OUT_OF_MEMORY -207 */ -ResDef(MK_OUT_OF_MEMORY , -207, -MOZ_NAME_BRAND" is out of memory.\n\n\ -Try quitting "MOZ_NAME_PRODUCT" and increasing its minimum memory\n\ -requirements through Get Info.") -#else -ResDef(MK_OUT_OF_MEMORY , -207, -MOZ_NAME_BRAND" is out of memory.\n\n\ -Try quitting some other applications or closing\n\ -some windows.") - -#endif - - -/* #define MK_MALFORMED_URL_ERROR -209 */ -ResDef(MK_MALFORMED_URL_ERROR, -209, -"This Location (URL) is not recognized:\n\ - %.200s\n\n\ -Check the Location and try again.") - -/* #define MK_UNABLE_TO_USE_PASV_FTP -211 */ -ResDef(MK_UNABLE_TO_USE_PASV_FTP, -211, -"Unable to use FTP passive mode") - -/* #define MK_UNABLE_TO_CHANGE_FTP_MODE -212 */ -ResDef(MK_UNABLE_TO_CHANGE_FTP_MODE , -212, -MOZ_NAME_BRAND" is unable to set the FTP transfer mode with\n\ -this server. You will not be able to download files.\n\n\ -You should contact the administrator for this server\n\ -or try again later.") - - -/* #define MK_UNABLE_TO_FTP_CWD -213 */ -ResDef(MK_UNABLE_TO_FTP_CWD, -213, -MOZ_NAME_BRAND" is unable to send the change directory (cd)\n\ -command, to the FTP server. You cannot view another\n\ -directory.\n\n\ -You should contact the administrator for this server\n\ -or try again later.") - - -/* #define MK_UNABLE_TO_SEND_PORT_COMMAND -214 */ -ResDef(MK_UNABLE_TO_SEND_PORT_COMMAND, -214, -MOZ_NAME_BRAND" is unable to send a port command to the FTP\n\ -server to establish a data connection.\n\n\ -You should contact the administrator for this server\n\ -or try again later.") - - -/* #define MK_UNABLE_TO_LOCATE_FILE -215 */ -ResDef(MK_UNABLE_TO_LOCATE_FILE, -215, -MOZ_NAME_BRAND" is unable to find the file or directory named:\n\ - %.200s\n\n\ -Check the name and try again.") - - -/* #define MK_BAD_NNTP_CONNECTION -216 */ -ResDef(MK_BAD_NNTP_CONNECTION, -216, -"A News error occurred: Invalid NNTP connection\n\n\ -Try connecting again.") - -/* #define MK_NNTP_SERVER_ERROR -217 */ -ResDef(MK_NNTP_SERVER_ERROR, -217, -"An error occurred with the News server.\n\n\ -If you are unable to connect again, contact the\n\ -administrator for this server.") - -/* #define MK_SERVER_TIMEOUT -218 */ -ResDef(MK_SERVER_TIMEOUT, -218, -"There was no response. The server could be down\n\ -or is not responding.\n\n\ -If you are unable to connect again later, contact\n\ -the server's administrator.") - - -/* #define MK_UNABLE_TO_LOCATE_HOST -219 */ -ResDef(MK_UNABLE_TO_LOCATE_HOST, -219, -MOZ_NAME_BRAND" is unable to locate the server:\n\ - %.200s\n\ -The server does not have a DNS entry.\n\n\ -Check the server name in the Location (URL)\n\ -and try again.") - -/* #define MK_SERVER_DISCONNECTED -220 */ -ResDef(MK_SERVER_DISCONNECTED, -220, -"The server has disconnected.\n\ -The server may have gone down or there may be a\n\ -network problem.\n\n\ -Try connecting again.") - -/* #define MK_NEWS_ITEM_UNAVAILABLE -221 */ -ResDef(MK_NEWS_ITEM_UNAVAILABLE, -221, -"The Discussion item is unavailable. It may have expired.\n\n\ -Try retrieving another item.") - -/* #define MK_UNABLE_TO_OPEN_NEWSRC -222 */ -ResDef(MK_UNABLE_TO_OPEN_NEWSRC, -222, -MOZ_NAME_BRAND" is unable to open your News file (newsrc).\n\n\ -Please verify that your Mail and Groups preferences are\n\ -correct and try again.") - - -/* #define MK_UNABLE_TO_OPEN_FILE -223 */ -ResDef(MK_UNABLE_TO_OPEN_FILE, -223, -MOZ_NAME_BRAND" is unable to open the file:\n\ - %.200s\n\n\ -Check the file name and try again.") - -/* #define MK_TCP_WRITE_ERROR -236 */ -ResDef(MK_TCP_WRITE_ERROR, -236, -"A network error occurred while "MOZ_NAME_PRODUCT"\n\ -was sending data.\n(Network Error: %s)\n\n\ -Try connecting again.") - -/* #define MK_COULD_NOT_LOGIN_TO_SMTP_SERVER -229 */ -ResDef(MK_COULD_NOT_LOGIN_TO_SMTP_SERVER, -229, -"An error occurred sending mail:\n\ -"MOZ_NAME_PRODUCT" was unable to connect to the SMTP server.\n\ -The server may be down or may be incorrectly configured.\n\n\ -Please verify that your Mail preferences are correct\n\ -and try again.") - - -/* #define MK_ERROR_SENDING_FROM_COMMAND -230 */ -ResDef(MK_ERROR_SENDING_FROM_COMMAND, -230, -"An error occurred sending mail.\n\ -The mail server responded:\n\ - %s\n\ -Please verify that your email address is correct\n\ -in your Mail preferences and try again.") - - -/* #define MK_ERROR_SENDING_RCPT_COMMAND -231 */ -ResDef(MK_ERROR_SENDING_RCPT_COMMAND, -231, -"An error occurred sending mail.\n\ -The mail server responded:\n\ - %s\n\ -Please check the message recipients and try again.") - -/* #define MK_ERROR_SENDING_DATA_COMMAND -232 */ -ResDef(MK_ERROR_SENDING_DATA_COMMAND, -232, -"SMTP Error while sending mail.\nServer responded: %s") - -/* #define MK_ERROR_SENDING_MESSAGE -233 */ -ResDef(MK_ERROR_SENDING_MESSAGE, -233, -"An error occurred sending mail.\n\ -The mail server responded:\n\ - %s\n\ -Please check the message and try again.") - -/* #define MK_SMTP_SERVER_ERROR -234 */ -ResDef(MK_SMTP_SERVER_ERROR, -234, -"An error occurred sending mail: SMTP server error.\n\ -The server responded:\n\ - %s\n\ -Contact your mail administrator for assistance.") - -/* #define MK_UNABLE_TO_CONNECT -240 -- generic error -- */ -ResDef(MK_UNABLE_TO_CONNECT, -240, -"A network error occurred:\n\ -unable to connect to server (TCP Error: %s)\n\ -The server may be down or unreachable.\n\n\ -Try connecting again later.") - -/* #define MK_CONNECTION_TIMED_OUT -241 */ -ResDef(MK_CONNECTION_TIMED_OUT, -241, -"There was no response. The server could be down\n\ -or is not responding.\n\n\ -If you are unable to connect again later, contact\n\ -the server's administrator.") - -/* #define MK_CONNECTION_REFUSED -242 */ -ResDef(MK_CONNECTION_REFUSED, -242, -MOZ_NAME_BRAND"'s network connection was refused by the server:\n\ - %.200s\n\ -The server may not be accepting connections or\n\ -may be busy.\n\n\ -Try connecting again later.") - - -#ifdef XP_WIN -/* #define MK_UNABLE_TO_CREATE_SOCKET -243 */ -ResDef(MK_UNABLE_TO_CREATE_SOCKET , -243, -MOZ_NAME_BRAND" was unable to create a network socket connection.\n\ -There may be insufficient system resources or the network\n\ -may be down. (Reason: %s)\n\n\ -Try connecting again later or try restarting "MOZ_NAME_PRODUCT". You\n\ -can also try restarting Windows.") -#else -ResDef(MK_UNABLE_TO_CREATE_SOCKET , -243, -MOZ_NAME_BRAND" was unable to create a network socket connection.\n\ -There may be insufficient system resources or the network\n\ -may be down. (Reason: %s)\n\n\ -Try connecting again later or try restarting "MOZ_NAME_PRODUCT".") -#endif - - -#ifdef XP_WIN -/* #define MK_UNABLE_TO_ACCEPT_SOCKET -245 */ -ResDef(MK_UNABLE_TO_ACCEPT_SOCKET, -245, -MOZ_NAME_BRAND" is unable to complete a socket connection \n\ -with this server. There may be insufficient system\n\ -resources.\n\n\ -Try restarting "MOZ_NAME_PRODUCT" or restarting Windows.") -#else -/* #define MK_UNABLE_TO_ACCEPT_SOCKET -245 */ -ResDef(MK_UNABLE_TO_ACCEPT_SOCKET, -245, -MOZ_NAME_BRAND" is unable to complete a socket connection\n\ -with this server. There may be insufficient system\n\ -resources.\n\n\ -Try restarting "MOZ_NAME_PRODUCT".") -#endif - - -/* #define MK_UNABLE_TO_CONNECT_TO_PROXY -246 */ -ResDef(MK_UNABLE_TO_CONNECT_TO_PROXY, -246, -MOZ_NAME_BRAND" is unable to connect to your proxy server.\n\ -The server may be down or may be incorrectly configured.\n\n\ -Please verify that your Proxy preferences are correct\n\ -and try again, or contact the server's administrator.") - -/* #define MK_UNABLE_TO_LOCATE_PROXY -247 */ -ResDef(MK_UNABLE_TO_LOCATE_PROXY, -247, -MOZ_NAME_BRAND" is unable to locate your proxy server.\n\ -The server may be down or may be incorrectly configured.\n\n\ -Please verify that your Proxy preferences are correct\n\ -and try again, or contact the server's administrator.") - - - -/* #define MK_ZERO_LENGTH_FILE -251 */ -ResDef(MK_ZERO_LENGTH_FILE, -251, -"Document contains no data") - - -/* #define MK_TCP_READ_ERROR -252 */ -ResDef(MK_TCP_READ_ERROR , -252, -"A network error occurred while "MOZ_NAME_PRODUCT"\n\ -was receiving data.\n(Network Error: %s)\n\n\ -Try connecting again.") - - - -/* #define MK_UNABLE_TO_OPEN_TMP_FILE -253 */ -ResDef(MK_UNABLE_TO_OPEN_TMP_FILE, -253, -MOZ_NAME_BRAND" is unable to open the temporary file:\n\ - %.200s\n\n\ -Check your `Temporary Directory' setting and try again.") - -/* #define MK_COULD_NOT_GET_USERS_MAIL_ADDRESS -235 */ -ResDef(MK_COULD_NOT_GET_USERS_MAIL_ADDRESS, -235, -"An error occurred sending mail:\n\ -the return mail address was invalid.\n\n\ -Please verify that your email address is correct\n\ -in your Mail preferences and try again.") - -/* #define MK_DISK_FULL -250 */ -ResDef(MK_DISK_FULL, -250, -"The disk is full. "MOZ_NAME_PRODUCT" is cancelling the file\n\ -transfer and removing the file.\n\n\ -Please remove some files and try again.") - - -/* #define MK_NNTP_AUTH_FAILED -260 -- NNTP authinfo failure -- */ -ResDef(MK_NNTP_AUTH_FAILED, -260, -"An authorization error occurred:\n\n\ -%s\n\n\ -Please try entering your name and/or password again.") - -/* #define MK_MIME_NO_SENDER -266 */ -ResDef(MK_MIME_NO_SENDER, -266, /* From: empty */ -"No sender was specified.") - -/* #define MK_MIME_NO_RECIPIENTS -267 */ -ResDef(MK_MIME_NO_RECIPIENTS, -267, /* To: and Newsgroups: empty */ -"No recipients were specified.") - -/* #define MK_MIME_NO_SUBJECT -268 */ -ResDef(MK_MIME_NO_SUBJECT, -268, /* Subject: empty */ -"No subject was specified.") - -/* #define MK_MIME_ERROR_WRITING_FILE -269 */ -ResDef(MK_MIME_ERROR_WRITING_FILE, -269, -"Error writing temporary file.") - -/* #define MK_MIME_MULTIPART_BLURB -275 */ -ResDef(MK_MIME_MULTIPART_BLURB, -275, /* text preceding multiparts */ -"This is a multi-part message in MIME format.") - -/* #define MK_PRINT_LOSSAGE -278 */ -ResDef(MK_PRINT_LOSSAGE, -278, -"Printing stopped. A problem occurred while receiving\n\ -the document. Transmission may have been interrupted\n\ -or there may be insufficient space to write the file.\n\n\ -Try again. Check that space is available in the\n\ -temporary directory or restart "MOZ_NAME_PRODUCT".") - -/* #define MK_SIGNATURE_TOO_LONG -279 */ -ResDef(MK_SIGNATURE_TOO_LONG, -279, -"Your signature exceeds the recommended four lines.") - -/* #define MK_SIGNATURE_TOO_WIDE -280 */ -ResDef(MK_SIGNATURE_TOO_WIDE, -280, -"Your signature exceeds the recommended 79 columns.\n\ -For most readers, the lines will appear truncated, or\n\ -will be wrapped unattractively. \n\n\ -Please edit it to keep the lines shorter than 80 characters.") - -ResDef(MK_UNABLE_TO_CONNECT2, -281, -"A network error occurred:\n\ - unable to connect to server\n\ -The server may be down or unreachable.\n\n\ -Try connecting again later.") - -/* #define MK_CANT_LOAD_HELP_TOPIC -282 */ -ResDef(MK_CANT_LOAD_HELP_TOPIC, -282, -"Unable to load the requested help topic") - -/* #define MK_TIMEBOMB_MESSAGE -301 */ -ResDef(MK_TIMEBOMB_MESSAGE, -301, -"This copy of "MOZ_NAME_PRODUCT" has expired.\n\ -This pre-release copy of "MOZ_NAME_FULL" has expired\n\ -and can only be used to download a newer version of "MOZ_NAME_PRODUCT".") - -/* #define MK_TIMEBOMB_URL_PROHIBIT -302 */ -ResDef(MK_TIMEBOMB_URL_PROHIBIT, -302, -"This trial or pre-release copy of "MOZ_NAME_FULL" has expired\n\ -and can only be used to purchase or download a newer version of "MOZ_NAME_PRODUCT".") - -/* #define MK_NO_WAIS_PROXY -303 */ -ResDef(MK_NO_WAIS_PROXY, -303, -"No WAIS proxy is configured.\n\n\ -Check your Proxy preferences and try again.") - -/* #define MK_NNTP_ERROR_MESSAGE -304 */ -ResDef(MK_NNTP_ERROR_MESSAGE, -304, -"A News (NNTP) error occurred:\n\ - %.100s") - -/* #define MK_NNTP_NEWSGROUP_SCAN_ERROR -305 */ -ResDef(MK_NNTP_NEWSGROUP_SCAN_ERROR, -305, -"A News error occurred. The scan of all discussion groups is incomplete.\n\ - \n\ -Try to View All Discussion Groups again.") - -/* #define MK_CREATING_NEWSRC_FILE -306 */ -ResDef(MK_CREATING_NEWSRC_FILE, -306, -MOZ_NAME_BRAND" could not find a News file (newsrc)\n\ -and is creating one for you.") - -/* #define MK_NNTP_SERVER_NOT_CONFIGURED -307 */ -ResDef(MK_NNTP_SERVER_NOT_CONFIGURED,-307, -"No NNTP server is configured.\n\n\ -Check your Mail and Groups preferences and try again.") - -/* #define MK_COMMUNICATIONS_ERROR -308 */ -ResDef(MK_COMMUNICATIONS_ERROR, -308, -"Communications exception (%d).") - - -/* #define MK_SECURE_NEWS_PROXY_ERROR -309 */ -ResDef(MK_SECURE_NEWS_PROXY_ERROR, -309, -MOZ_NAME_BRAND" was unble to connect to the secure news server\n\ -because of a proxy error") - - -/* #define MK_POP3_SERVER_ERROR -311 generic pop3 error code */ -ResDef(MK_POP3_SERVER_ERROR, -311, -"An error occurred with the POP3 server.\n\ -You should contact the administrator for this server\n\ -or try again later.") - -/* #define MK_POP3_USERNAME_UNDEFINED -312 no username defined */ -ResDef(MK_POP3_USERNAME_UNDEFINED, -312, -MOZ_NAME_BRAND" is unable to use the mail server because\n\ -you have not provided a username. Please provide\n\ -one in the preferences and try again") - -/* #define MK_POP3_PASSWORD_UNDEFINED -313 no password defined */ -ResDef(MK_POP3_PASSWORD_UNDEFINED, -313, -"Error getting mail password.") - -/* #define MK_POP3_USERNAME_FAILURE -314 failure in USER step */ -ResDef(MK_POP3_USERNAME_FAILURE, -314, -"An error occurred while sending your user name to the mail server.\n\ -You should contact the administrator for this server\n\ -or try again later.") - -/* #define MK_POP3_PASSWORD_FAILURE -315 failure in PASS step */ -ResDef(MK_POP3_PASSWORD_FAILURE, -315, -"An error occurred while sending your password to the mail server.\n\ -You should contact the administrator for this server\n\ -or try again later.") - -/* #define MK_POP3_NO_MESSAGES -316 no mail messages on pop server */ -ResDef(MK_POP3_NO_MESSAGES, -316, -"No new messages on server") - -/* #define MK_POP3_LIST_FAILURE -317 LIST command failed */ -ResDef(MK_POP3_LIST_FAILURE, -317, -"An error occurred while listing messages on the POP3 server.\n\ -You should contact the administrator for this server\n\ -or try again later.") - -/* #define MK_POP3_LAST_FAILURE -318 LAST command failed */ -ResDef(MK_POP3_LAST_FAILURE, -318, -"An error occurred while querying the POP3 server for\n\ -the last processed message.\n\ -You should contact the administrator for this server\n\ -or try again later.") - - -/* #define MK_POP3_RETR_FAILURE -319 RETR command failed, continues */ -ResDef(MK_POP3_RETR_FAILURE, -319, -"An error occurred while getting messages from the POP3 server.\n\ -You should contact the administrator for this server\n\ -or try again later.") - -/* #define MK_POP3_DELE_FAILURE -320 DELE command failed */ -ResDef(MK_POP3_DELE_FAILURE, -320, -"An error occurred while removing messages from the POP3 server.\n\ -You should contact the administrator for this server\n\ -or try again later.") - -/* #define MK_POP3_OUT_OF_DISK_SPACE -321 */ -ResDef(MK_POP3_OUT_OF_DISK_SPACE, -321, -"There isn't enough room on the local disk to download\n\ -your mail from the POP3 server. Please make room and\n\ -try again. (The `Empty Trash' and `Compress This Folder'\n\ -commands may recover some space.)") - -/* #define MK_POP3_MESSAGE_WRITE_ERROR -322 */ -ResDef(MK_POP3_MESSAGE_WRITE_ERROR, -322, -"An error occurred while saving mail messages.") - - -/* #define MK_COULD_NOT_PUT_FILE -325 FTP could not put file */ -ResDef(MK_COULD_NOT_PUT_FILE, -325, -"Could not post the file: %.80s.\n\ -For reason:\n\ - %.200s\n\n\ -You may not have permission to write to\n\ -this directory.\n\ -Check the permissions and try again.") - -/* #define MK_TIMEBOMB_WARNING_MESSAGE -326 */ -ResDef(MK_TIMEBOMB_WARNING_MESSAGE, -326, -"This is a pre-release copy of "MOZ_NAME_FULL" that\n\ -will expire at %s.\n\ -To obtain a newer pre-release version or the latest full\n\ -release of "MOZ_NAME_FULL" (which will not expire) \n\ -choose Software from the Help menu.") - -/* #define MK_UNABLE_TO_DELETE_FILE */ -ResDef(MK_UNABLE_TO_DELETE_FILE, -327, -"Could not delete file:\n\ - %s") - -/* #define MK_UNABLE_TO_DELETE_DIRECTORY */ -ResDef(MK_UNABLE_TO_DELETE_DIRECTORY, -328, -"Could not remove directory:\n\ - %s") - -/* #define MK_MKDIR_FILE_ALREADY_EXISTS */ -ResDef(MK_MKDIR_FILE_ALREADY_EXISTS, -329, -"Cannot create directory because a file or\n\ -directory of that name already exists: \n\ - %s") - -/* #define MK_COULD_NOT_CREATE_DIRECTORY */ -ResDef(MK_COULD_NOT_CREATE_DIRECTORY, -330, -"Could not create directory:\n\ - %s") - -/* #define MK_NOT_A_DIRECTORY */ -ResDef(MK_NOT_A_DIRECTORY, -331, -"Object is not a directory:\n\ - %s") - -/* define MK_COMPUSERVE_AUTH_FAILED -332 */ -ResDef(MK_COMPUSERVE_AUTH_FAILED, -332, -"Authorization failed") - -/* #define MK_RELATIVE_TIMEBOMB_MESSAGE -333 */ -ResDef(MK_RELATIVE_TIMEBOMB_MESSAGE, -333, -"This trial copy of "MOZ_NAME_PRODUCT" has expired.\n\n\ -To purchase a regular copy of "MOZ_NAME_FULL"\n(\ -which will not expire) choose Software from the Help menu.") - -/* #define MK_RELATIVE_TIMEBOMB_WARNING_MESSAGE -334 */ -ResDef(MK_RELATIVE_TIMEBOMB_WARNING_MESSAGE, -334, -"This trial copy of "MOZ_NAME_FULL" \n\ -will expire at %s.\n\n\ -To purchase a regular copy of "MOZ_NAME_FULL"\n(\ -which will not expire) choose Software from the Help menu.") - -/* #define MK_REDIRECT_ATTEMPT_NOT_ALLOWED -335 */ -ResDef(MK_REDIRECT_ATTEMPT_NOT_ALLOWED, -335, -"There was an attempt to redirect a url request,\n\ -but the attempt was not allowed by the client.") - -/* #define MK_BAD_GZIP_HEADER -336 */ -ResDef(MK_BAD_GZIP_HEADER, -336, -"Corruption was detected in the compressed GZip file that was requested") - -/* Mail/News errors */ - -ResDef(MK_MSG_CANT_COPY_TO_SAME_FOLDER, -401, - "Can't move or copy messages to the folder they're already in.") - -#ifdef XP_WIN16 -ResDef(MK_MSG_CANT_COPY_TO_QUEUE_FOLDER, -402, - "Cannot copy messages into the 'Unsent' folder:\n\ -That folder is only for holding messages which\n\ -have been deferred for later delivery.") -#else -ResDef(MK_MSG_CANT_COPY_TO_QUEUE_FOLDER, -402, - "Cannot copy messages into the 'Unsent Messages' folder:\n\ -That folder is only for holding messages which\n\ -have been deferred for later delivery.") -#endif - -ResDef(MK_MSG_CANT_COPY_TO_DRAFTS_FOLDER, -403, - "Cannot copy messages into the `unsent drafts' folder:\n\ -That folder is only for holding messages which have\n\ -have not yet been queued delivery.") - -ResDef(MK_MSG_CANT_CREATE_FOLDER, -404, - "Couldn't create the folder!") - -ResDef(MK_MSG_FOLDER_ALREADY_EXISTS, -405, - "The folder already exists.") - -ResDef(MK_MSG_FOLDER_NOT_EMPTY, -406, - "Can't delete a folder without first deleting the messages in it.") - -ResDef(MK_MSG_CANT_DELETE_FOLDER, -407, - "Can't delete a folder without first deleting the messages in it.") - -ResDef(MK_MSG_CANT_CREATE_INBOX, -408, - "Couldn't create default inbox folder!") - -ResDef(MK_MSG_CANT_CREATE_MAIL_DIR, -409, - "Couldn't create a mail folder directory. Mail will not work!") - -ResDef(MK_MSG_NO_POP_HOST, -410, - "No mail server has been specified in preferences.") - -ResDef(MK_MSG_MESSAGE_CANCELLED, -414, - "Message cancelled.") - -ResDef(MK_MSG_COULDNT_OPEN_FCC_FILE, -415, - "Couldn't open Sent Mail file. \n\ - Please verify that your Mail preferences are correct.") - -ResDef(MK_MSG_FOLDER_UNREADABLE, -416, - "Folder no longer exists?") - -ResDef(MK_MSG_FOLDER_SUMMARY_UNREADABLE, -417, - "Folder summary file no longer exists?") - -ResDef(MK_MSG_TMP_FOLDER_UNWRITABLE, -418, - "Couldn't open temporary folder file for output.") - -ResDef(MK_MSG_ID_NOT_IN_FOLDER, -419, - "The specified message doesn't exist in that folder.\n\ -It may have been deleted or moved into another folder.") - -ResDef(MK_MSG_NEWSRC_UNPARSABLE, -420, - "A newsrc file exists but is unparsable.") - -ResDef(MK_MSG_NO_RETURN_ADDRESS, -421, - "Your email address has not been specified.\n\ -Before sending mail or discussion messages, you must specify a\n\ -return address in Mail and Groups Preferences.") - -#if 0 -/* Windows and Mac resource only understand 254 chars per string */ -ResDef(MK_MSG_NO_RETURN_ADDRESS_AT, -421, - "The return email address set in Preferences is: %s\n\ -\n\ -This does not appear to be complete (it contains no `@' and host name.)\n\ -A valid email address will be of the form `USER@HOST', where USER is\n\ -usually your login ID, and HOST is the fully-specified name of the\n\ -machine to which your mail should be delivered. A fully-specified host\n\ -name will have at least one `.' in it, and will usually end in `.com',\n\ -`.edu', `.net', or a two-letter country code. If you are unsure what\n\ -your full email address is, please consult your system administrator.") - -/* Windows and Mac resource only understand 254 chars per string */ -ResDef(MK_MSG_NO_RETURN_ADDRESS_DOT, -422, - "The return email address set in Preferences is: %s\n\ -\n\ -This does not appear to be complete (it contains no `.' in the host name.)\n\ -A valid email address will be of the form `USER@HOST', where USER is\n\ -usually your login ID, and HOST is the fully-specified name of the\n\ -machine to which your mail should be delivered. A fully-specified host\n\ -name will have at least one `.' in it, and will usually end in `.com',\n\ -`.edu', `.net', or a two-letter country code. If you are unsure what\n\ -your full email address is, please consult your system administrator.") -#else -ResDef(MK_MSG_NO_RETURN_ADDRESS_AT, -423, - "The return email address set in Preferences is: %s\n\ -\n\ -This appears to be incomplete (it contains no `@'). Examples of\n\ -correct email addresses are `fred@xyz.com' and `sue@xyz.gov.au'.") - -ResDef(MK_MSG_NO_RETURN_ADDRESS_DOT, -424, - "The return email address set in Preferences is: %s\n\ -\n\ -This appears to be incomplete (it contains no `.'). Examples of\n\ -correct email addresses are `fred@xyz.com' and `sue@xyz.gov.au'.") -#endif - -ResDef(MK_MSG_NO_SMTP_HOST,-425, - "No SMTP server has been specified in Mail and Groups Preferences.") - -ResDef(MK_NNTP_CANCEL_CONFIRM, -426, - "Are you sure you want to cancel this message?") - -ResDef(MK_NNTP_CANCEL_DISALLOWED, -427, - "This message does not appear to be from you.\n\ -You may only cancel your own posts, not those made by others.") - -ResDef(MK_NNTP_CANCEL_ERROR, -428, - "Unable to cancel message!") - -ResDef(MK_NNTP_NOT_CANCELLED, -429, - "Message not cancelled.") - -ResDef(MK_NEWS_ERROR_FMT, -430, - "Error!\nDiscussion group server responded: %.512s\n") - - -ResDef(MK_MSG_NON_MAIL_FILE_READ_QUESTION, -431, - "%.300s does not appear to be a mail file.\n\ -Attempt to read it anyway?") - -ResDef(MK_MSG_NON_MAIL_FILE_WRITE_QUESTION, -432, - "%.300s does not appear to be a mail file.\n\ -Attempt to write it anyway?") - -ResDef(MK_MSG_ERROR_WRITING_NEWSRC, -433, - "Error saving newsrc file!") - -ResDef(MK_MSG_ERROR_WRITING_MAIL_FOLDER, -434, - "Error writing mail file!") - -ResDef(MK_MSG_OFFER_COMPRESS, -435, - "At least one of your mail folders is wasting a lot\n\ -of disk space. If you compress your Mail folders now,\n\ -you can recover %ld Kbytes of disk space. Compressing\n\ -folders might take a while.\n\ -\n\ -Compress folders now?") - -ResDef(MK_MSG_SEARCH_FAILED, -436, - "Not found.") - -ResDef(MK_MSG_EMPTY_MESSAGE, -437, - "You haven't typed anything, and there is no attachment.\n\ -Send anyway?") - -ResDef(MK_MSG_DOUBLE_INCLUDE, -438, - "You have included the same document twice: first as a quoted\n\ -document (meaning: with '>' at the beginning of each line), and\n\ -then as an attachment (meaning: as a second part of the message,\n\ -included after your new text).\n\ -\n\ -Send it anyway?") - -#ifdef XP_WIN16 -ResDef(MK_MSG_DELIVERY_FAILURE_1, -439, - "Delivery failed for 1 message.\n\n\ -This message has been left in the Unsent folder.\n\ -Before it can be delivered, the error must be\n\ -corrected.") - -ResDef(MK_MSG_DELIVERY_FAILURE_N, -440, - "Delivery failed for %d messages.\n\n\ -These messages have been left in the Unsent folder.\n\ -Before they can be delivered, the errors must be\n\ -corrected.") -#else -ResDef(MK_MSG_DELIVERY_FAILURE_1, -439, - "Delivery failed for 1 message.\n\n\ -This message has been left in the Unsent Messages folder.\n\ -Before it can be delivered, the error must be\n\ -corrected.") - -ResDef(MK_MSG_DELIVERY_FAILURE_N, -440, - "Delivery failed for %d messages.\n\n\ -These messages have been left in the Unsent Messages folder.\n\ -Before they can be delivered, the errors must be\n\ -corrected.") -#endif - - -ResDef(MK_MSG_MISSING_SUBJECT, -441, - "This message has no subject. Send anyway?") - -ResDef(MK_MSG_MIXED_SECURITY, -442, - "It will not be possible to send this message encrypted to all of the\n\ -addressees. Send it anyway?") - -ResDef (MK_MSG_CAN_ONLY_DELETE_MAIL_FOLDERS, -443, - "Can only delete mail folders.") - -ResDef(MK_MSG_FOLDER_BUSY, -444, -"Can't copy messages because the mail folder is in use.\n\ -Please wait until other copy operations are \n\ -complete and try again.\n" ) - -ResDef(MK_MSG_PANES_OPEN_ON_FOLDER, -445, -"Can't delete message folder '%s\' because you are viewing\n\ -its contents. Please close those windows and try again.") - -ResDef(MK_MSG_INCOMPLETE_NEWSGROUP_LIST, -446, -"The complete list of discussion groups was not retrieved for\n\ -this discussion group server. Operations will not proceed normally\n\ -until all discussion groups have been retrieved.\n\ -\n\ -Click on the 'All Groups' tab to continue retrieving\n\ -discussion groups.") - -ResDef(MK_MSG_ONLINE_IMAP_WITH_NO_BODY, -447, -"This IMAP message cannot be moved while offline. It has no attached body.") - -ResDef(MK_MSG_ONLINE_COPY_FAILED, -448, -"The IMAP message copy failed. A source message was not found.") - -ResDef(MK_MSG_ONLINE_MOVE_FAILED, -449, -"The IMAP message move failed.\n\ -The copy succeeded but a source message was not deleted.") - -ResDef(MK_MSG_CONFIRM_CONTINUE_IMAP_SYNC, -450, -"A playback operation failed. Continue?\n") - -ResDef(MK_MSG_CANT_MOVE_INBOX, -451, -"You cannot move your Inbox Folder.") - -ResDef(MK_MSG_CANT_FIND_SNM, -452, -"Could not find the summary information\n\ - for the %s IMAP folder.") - -ResDef(MK_MSG_NO_UNDO_DURING_IMAP_FOLDER_LOAD, -453, -"You cannot undo or redo a folder action while\n\ - the folder is loading.") - -ResDef(MK_MSG_MOVE_TARGET_NO_INFERIORS, -454, -"The targeted destination folder does not allow subfolders.") - -ResDef(MK_MSG_PARENT_TARGET_NO_INFERIORS, -455, -"The selected parent folder does not allow subfolders.\n\ - Try selecting the server folder and typing\n\ - 'parent/newFolder' to create a new hierarchy.") - -ResDef(MK_MSG_COPY_TARGET_NO_SELECT, -456, -"The targeted destination folder cannot hold messages.") - -ResDef(MK_MSG_TRASH_NO_INFERIORS, -457, -"This mail server cannot undo folder deletes, delete anyway?") - -ResDef(MK_MSG_CANT_COPY_TO_QUEUE_FOLDER_OLD, -458, - "Cannot copy messages into the 'Outbox' folder:\n\ -That folder is only for holding messages which\n\ -have been deferred for later delivery.") - -ResDef(MK_MSG_DELIVERY_FAILURE_1_OLD, -459, - "Delivery failed for 1 message.\n\n\ -This message has been left in the Outbox folder.\n\ -Before it can be delivered, the error must be\n\ -corrected.") - -ResDef(MK_MSG_DELIVERY_FAILURE_N_OLD, -460, - "Delivery failed for %d messages.\n\n\ -These messages have been left in the Outbox folder.\n\ -Before they can be delivered, the errors must be\n\ -corrected.") - -ResDef(MK_MSG_NO_MAIL_TO_NEWS, -461, - "You can't move a mail folder into a discussion group.") - -ResDef(MK_MSG_NO_NEWS_TO_MAIL, -462, - "You can't move a discussion group into a mail folder.") - -ResDef(MK_MSG_BOGUS_SERVER_MAILBOX_UID_STATE, -463, - "Mail Server Problem: The UID's for the messages in this\n\ - folder are not increasing. Contact your sysadmin.") - -ResDef(MK_MSG_IMAP_SERVER_NOT_IMAP4, -464, - "This mail server is not an IMAP4 mail server.") - -ResDef(MK_MSG_HTML_IMAP_NO_CACHED_BODY, -465, -"IMAP Go Online!\n\ -The body of this message has not been downloaded from \n\ -the server for reading offline. To read this message \n\ -you must first go online using the 'Go Online' menu item \n\ -in the File menu and view the message again.") - -ResDef(MK_MSG_COMPRESS_FAILED, -466, - "Compress failed.") - -ResDef(MK_MSG_LOTS_NEW_IMAP_FOLDERS, -467, -"At least 30 new IMAP folders have been found.\n\ -\n\ -Press to continue or to change\n\ -the IMAP server directory.") - -ResDef(MK_MSG_IMAP_DIR_PROMPT, -468, - "Enter IMAP server directory name.") - -ResDef(MK_MSG_NO_POST_TO_DIFFERENT_HOSTS_ALLOWED, -469, -"Posting to discussion groups on different hosts is not supported.") - -ResDef(MK_MSG_CANT_MOVE_OFFLINE_MOVE_RESULT, -470, -"This message was moved here while offline. You have to \n\ -go online to move it again.") - -ResDef(MK_MSG_SEARCH_HITS_NOT_IN_DB, -471, -"This IMAP folder is out of date. Open it again for a more complete search.") - -ResDef(MK_MSG_MAIL_DIRECTORY_CHANGED, -472, -"Your new mail directory preference\n\ -will take effect the next time\n\ -you restart Communicator.") - -END_STR(mcom_include_merrors_i_strings) - -/* WARNING: DO NOT TAKE ERROR CODE -666, it is used internally - by the message lib */ - - -/* General security error codes */ - -#define NO_SECURITY_ERROR_ENUM -#include "secerr.h" - -RES_START -BEGIN_STR(mcom_include_secerr_i_strings) - -ResDef(SEC_ERROR_IO, SEC_ERROR_BASE + 0, -"An I/O error occurred during security authorization.\n\ -Please try your connection again") - -ResDef(SEC_ERROR_LIBRARY_FAILURE, SEC_ERROR_BASE + 1, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_BAD_DATA, SEC_ERROR_BASE + 2, -"The security library has received bad data.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_OUTPUT_LEN, SEC_ERROR_BASE + 3, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_INPUT_LEN, SEC_ERROR_BASE + 4, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_INVALID_ARGS, SEC_ERROR_BASE + 5, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_INVALID_ALGORITHM, SEC_ERROR_BASE + 6, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_INVALID_AVA, SEC_ERROR_BASE + 7, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_INVALID_TIME, SEC_ERROR_BASE + 8, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_BAD_DER, SEC_ERROR_BASE + 9, -"The security library has encountered an improperly formatted\n\ -DER-encoded message.") - -ResDef(SEC_ERROR_BAD_SIGNATURE, SEC_ERROR_BASE + 10, -"The server's certificate has an invalid signature.\n\ -You will not be able to connect to this site securely.") - -ResDef(SEC_ERROR_EXPIRED_CERTIFICATE, SEC_ERROR_BASE + 11, -"This operation cannot be performed because a required\n\ -certificate has expired. Click on the `Security' icon\n\ -for more information about certificates.") - -ResDef(SEC_ERROR_REVOKED_CERTIFICATE, SEC_ERROR_BASE + 12, -"This operation cannot be performed because a required\n\ -certificate has been revoked. Click on the `Security'\n\ -icon for more information about certificates.") - -ResDef(SEC_ERROR_UNKNOWN_ISSUER, SEC_ERROR_BASE + 13, -"The certificate issuer for this server is not recognized by\n\ -"MOZ_NAME_PRODUCT". The security certificate may or may not be valid.\n\n\ -"MOZ_NAME_PRODUCT" refuses to connect to this server.") - -ResDef(SEC_ERROR_BAD_KEY, SEC_ERROR_BASE + 14, -"The server's public key is invalid.\n\ -You will not be able to connect to this site securely.") - -ResDef(SEC_ERROR_BAD_PASSWORD, SEC_ERROR_BASE + 15, -"The security password entered is incorrect.") - -ResDef(SEC_ERROR_RETRY_PASSWORD, SEC_ERROR_BASE + 16, -"You did not enter your new password correctly. Please try again.") - -ResDef(SEC_ERROR_NO_NODELOCK, SEC_ERROR_BASE + 17, -"The security library has experienced an error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_BAD_DATABASE, SEC_ERROR_BASE + 18, -"The security library has experienced a database error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_NO_MEMORY, SEC_ERROR_BASE + 19, -"The security library has experienced an out of memory error.\n\ -Please try to reconnect.") - -ResDef(SEC_ERROR_UNTRUSTED_ISSUER, SEC_ERROR_BASE + 20, -"The certificate issuer for this server has been marked as\n\ -not trusted by the user. "MOZ_NAME_PRODUCT" refuses to connect to this\n\ -server.") - -ResDef(SEC_ERROR_UNTRUSTED_CERT, SEC_ERROR_BASE + 21, -"The certificate for this server has been marked as not\n\ -trusted by the user. "MOZ_NAME_PRODUCT" refuses to connect to this\n\ -server.") - -ResDef(SEC_ERROR_DUPLICATE_CERT, (SEC_ERROR_BASE + 22), -"The Certificate that you are trying to download\n\ -already exists in your database.") - -ResDef(SEC_ERROR_DUPLICATE_CERT_NAME, (SEC_ERROR_BASE + 23), -"You are trying to download a certificate whose name\n\ -is the same as one that already exists in your database.\n\ -If you want to download the new certificate you should\n\ -delete the old one first.") - -ResDef(SEC_ERROR_ADDING_CERT, (SEC_ERROR_BASE + 24), -"Error adding certificate to your database") - -ResDef(SEC_ERROR_FILING_KEY, (SEC_ERROR_BASE + 25), -"Error refiling the key for this certificate") - -ResDef(SEC_ERROR_NO_KEY, (SEC_ERROR_BASE + 26), -"The Private Key for this certificate can\n\ -not be found in your key database") - -ResDef(SEC_ERROR_CERT_VALID, (SEC_ERROR_BASE + 27), -"This certificate is valid.") - -ResDef(SEC_ERROR_CERT_NOT_VALID, (SEC_ERROR_BASE + 28), -"This certificate is not valid.") - -ResDef(SEC_ERROR_CERT_NO_RESPONSE, (SEC_ERROR_BASE + 29), -"No Response") - -ResDef(SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE, (SEC_ERROR_BASE + 30), -"The certificate authority that issued this site's\n\ -certificate has expired.\n\ -Check your system date and time.") - -ResDef(SEC_ERROR_CRL_EXPIRED, (SEC_ERROR_BASE + 31), -"The certificate revocation list for this certificate authority\n\ -that issued this site's certificate has expired.\n\ -Reload a new certificate revocation list or check your system data and time.") - -ResDef(SEC_ERROR_CRL_BAD_SIGNATURE, (SEC_ERROR_BASE + 32), -"The certificate revocation list for this certificate authority\n\ -that issued this site's certificate has an invalid signature.\n\ -Reload a new certificate revocation list.") - -ResDef(SEC_ERROR_CRL_INVALID, (SEC_ERROR_BASE + 33), -"The certificate revocation list you are trying to load has\n\ -an invalid format.") - -ResDef(SEC_ERROR_EXTENSION_VALUE_INVALID,(SEC_ERROR_BASE + 34), -"Extension value is invalid.") - -ResDef(SEC_ERROR_EXTENSION_NOT_FOUND,(SEC_ERROR_BASE + 35), -"Extension not found.") - -ResDef(SEC_ERROR_CA_CERT_INVALID,(SEC_ERROR_BASE + 36), -"Issuer certificate is invalid.") - - -ResDef(SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID,(SEC_ERROR_BASE + 37), -"Certificate path length constraint is invalid.") - -ResDef(SEC_ERROR_CERT_USAGES_INVALID,(SEC_ERROR_BASE + 38), -"Certificate usages is invalid.") - -ResDef(SEC_INTERNAL_ONLY, (SEC_ERROR_BASE + 39), -"**Internal ONLY module**") - -ResDef(SEC_ERROR_INVALID_KEY, (SEC_ERROR_BASE + 40), -"The system tried to use a key which does not support\n\ -the requested operation.") - -ResDef(SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION,(SEC_ERROR_BASE + 41), -"Certificate contains unknown critical extension.") - -ResDef(SEC_ERROR_OLD_CRL, (SEC_ERROR_BASE + 42), -"The certificate revocation list you are trying to load is not\n\ -later than the current one.") - -ResDef(SEC_ERROR_NO_EMAIL_CERT, (SEC_ERROR_BASE + 43), -"This message cannot be encrypted or signed because you do not\n\ -yet have an email certificate. Click on the `Security' icon for more\n\ -information about certificates.") - -ResDef(SEC_ERROR_NO_RECIPIENT_CERTS_QUERY, (SEC_ERROR_BASE + 44), -"This message cannot be encrypted because you do not have\n\ -certificates for each of the recipients. Clicking on the\n\ -`Security' icon will give you more information.\n\ -\n\ -Turn off encryption and send the message anyway?") - -ResDef(SEC_ERROR_NOT_A_RECIPIENT, (SEC_ERROR_BASE + 45), -"The data cannot be decrypted because you are not a recipient;\n\ -either it was not intended for you, or a matching certificate or\n\ -Private Key cannot be found in your local database.") - -ResDef(SEC_ERROR_PKCS7_KEYALG_MISMATCH, (SEC_ERROR_BASE + 46), -"The data cannot be decrypted because the key encryption\n\ -algorithm it used does not match that of your certificate.") - -ResDef(SEC_ERROR_PKCS7_BAD_SIGNATURE, (SEC_ERROR_BASE + 47), -"Signature verification failed due to no signer found,\n\ -too many signers found, or improper or corrupted data.") - -ResDef(SEC_ERROR_UNSUPPORTED_KEYALG, (SEC_ERROR_BASE + 48), -"An unsupported or unknown key algorithm was encountered;\n\ -the current operation cannot be completed.") - -ResDef(SEC_ERROR_DECRYPTION_DISALLOWED, (SEC_ERROR_BASE + 49), -"The data cannot be decrypted because it was encrypted using an\n\ -algorithm or key size which is not allowed by this configuration.") - - -#ifdef FORTEZZA -/* Fortezza Alerts */ -ResDef(XP_SEC_FORTEZZA_BAD_CARD, (SEC_ERROR_BASE + 50), -"The Fortezza Card in Socket %d has not been properly initialized.\ - Please remove it and return it to your issuer.") - -ResDef(XP_SEC_FORTEZZA_NO_CARD, (SEC_ERROR_BASE + 51), -"No cards Found") - -ResDef(XP_SEC_FORTEZZA_NONE_SELECTED, (SEC_ERROR_BASE + 52), -"No Card Selected") - -ResDef(XP_SEC_FORTEZZA_MORE_INFO, (SEC_ERROR_BASE + 53), -"Please Select a personality to get more info on") - -ResDef(XP_SEC_FORTEZZA_PERSON_NOT_FOUND, (SEC_ERROR_BASE + 54), -"Personality not found") - -ResDef(XP_SEC_FORTEZZA_NO_MORE_INFO, (SEC_ERROR_BASE + 55), -"No more information on that Personality") - -ResDef(XP_SEC_FORTEZZA_BAD_PIN, (SEC_ERROR_BASE + 56), -"Invalid Pin") - -ResDef(XP_SEC_FORTEZZA_PERSON_ERROR, (SEC_ERROR_BASE + 57), -"Couldn't initialize personalities") -#endif /* FORTEZZA */ - -ResDef(SEC_ERROR_NO_KRL, (SEC_ERROR_BASE + 58), -"No key revocation list for this site's certificate has been found.\n\ -You must load the key revocation list before continuing.") - -ResDef(SEC_ERROR_KRL_EXPIRED, (SEC_ERROR_BASE + 59), -"The key revocation list for this site's certificate has expired.\n\ -Reload a new key revocation list.") - -ResDef(SEC_ERROR_KRL_BAD_SIGNATURE, (SEC_ERROR_BASE + 60), -"The key revocation list for this site's certificate has an invalid signature.\n\ -Reload a new key revocation list.") - -ResDef(SEC_ERROR_REVOKED_KEY, (SEC_ERROR_BASE + 61), -"The key for this site's certificate has been revoked.\n\ -You will be unable to access this site securely.") - -ResDef(SEC_ERROR_KRL_INVALID, (SEC_ERROR_BASE + 62), -"The key revocation list you are trying to load has\n\ -an invalid format.") - -ResDef(SEC_ERROR_NEED_RANDOM, (SEC_ERROR_BASE + 63), -"The security library is out of random data.") - -ResDef(SEC_ERROR_NO_MODULE, (SEC_ERROR_BASE + 64), -"The security library could not find a security module which can\n\ -perform the requested operation.") - -ResDef(SEC_ERROR_NO_TOKEN, (SEC_ERROR_BASE + 65), -"The security card or token does not exist, needs to be initialized\n\ -or has been removed.") - -ResDef(SEC_ERROR_READ_ONLY, (SEC_ERROR_BASE + 66), -"The security library has experienced a database error.\n\ -You will probably be unable to connect to this site securely.") - -ResDef(SEC_ERROR_NO_SLOT_SELECTED, (SEC_ERROR_BASE + 67), -"No slot or token was selected.") - -ResDef(SEC_ERROR_CERT_NICKNAME_COLLISION, (SEC_ERROR_BASE + 68), -"A certificate with the same name already exists.") - -ResDef(SEC_ERROR_KEY_NICKNAME_COLLISION, (SEC_ERROR_BASE + 69), -"A key with the same name already exists.") - -ResDef(SEC_ERROR_SAFE_NOT_CREATED, (SEC_ERROR_BASE + 70), -"An error occurred while creating safe object") - -ResDef(SEC_ERROR_BAGGAGE_NOT_CREATED, (SEC_ERROR_BASE + 71), -"An error occurred while creating safe object") - -ResDef(XP_JAVA_REMOVE_PRINCIPAL_ERROR, (SEC_ERROR_BASE + 72), -"Couldn't remove the principal") - -ResDef(XP_JAVA_DELETE_PRIVILEGE_ERROR, (SEC_ERROR_BASE + 73), -"Couldn't delete the privilege") - -ResDef(XP_JAVA_CERT_NOT_EXISTS_ERROR, (SEC_ERROR_BASE + 74), -"This principal doesn't have a certificate") - -ResDef(SEC_ERROR_BAD_EXPORT_ALGORITHM, (SEC_ERROR_BASE + 75), -"The operation cannot be performed because the required\n\ -algorithm is not allowed by this configuration.") - -ResDef(SEC_ERROR_EXPORTING_CERTIFICATES, (SEC_ERROR_BASE + 76), -"Unable to export certificates. An error occurred attempting to\n\ -export the certificates.") - -ResDef(SEC_ERROR_IMPORTING_CERTIFICATES, (SEC_ERROR_BASE + 77), -"An error occurred attempting to import the certificates.") - -ResDef(SEC_ERROR_PKCS12_DECODING_PFX, (SEC_ERROR_BASE + 78), -"Unable to import certificates. The file specified is either\n\ -corrupt or is not a valid file.") - -ResDef(SEC_ERROR_PKCS12_INVALID_MAC, (SEC_ERROR_BASE + 79), -"Unable to import certificates. Either the integrity password\n\ -is incorrect or the data in the file specified has been tampered\n\ -with or corrupted in some manner.") - -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM, (SEC_ERROR_BASE + 80), -"Unable to import certificates. The algorithm used to generate the\n\ -integrity information for this file is not supported in the application.") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE, (SEC_ERROR_BASE + 81), -"Unable to import certificates. "MOZ_NAME_PRODUCT" only supports password\n\ -integrity and password privacy modes for importing certificates.") -#else -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE, (SEC_ERROR_BASE + 81), -"Unable to import certificates. Communicator only supports password\n\ -integrity and password privacy modes for importing certificates.") -#endif - -ResDef(SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE, (SEC_ERROR_BASE + 82), -"Unable to import certificates. The file containing the certificates\n\ -is corrupt. Required information is either missing or invalid.") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM, (SEC_ERROR_BASE + 83), -"Unable to import certificates. The algorithm used to encrypt the\n\ -contents is not supported by "MOZ_NAME_PRODUCT".") -#else -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM, (SEC_ERROR_BASE + 83), -"Unable to import certificates. The algorithm used to encrypt the\n\ -contents is not supported by Communicator.") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_VERSION, (SEC_ERROR_BASE + 84), -"Unable to import certificates. The file is a version not supported by\n\ -"MOZ_NAME_PRODUCT".") -#else -ResDef(SEC_ERROR_PKCS12_UNSUPPORTED_VERSION, (SEC_ERROR_BASE + 84), -"Unable to import certificates. The file is a version not supported by\n\ -Communicator.") -#endif - -ResDef(SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT, (SEC_ERROR_BASE + 85), -"Unable to import certificates. The privacy password specified is\n\ -incorrect.") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_ERROR_PKCS12_CERT_COLLISION, (SEC_ERROR_BASE + 86), -"Unable to import certificates. A certificate with the same nickname,\n\ -as one being imported already exists in your "MOZ_NAME_PRODUCT" database.") -#else -ResDef(SEC_ERROR_PKCS12_CERT_COLLISION, (SEC_ERROR_BASE + 86), -"Unable to import certificates. A certificate with the same nickname,\n\ -as one being imported already exists in your Communicator database.") -#endif - -ResDef(SEC_ERROR_USER_CANCELLED, (SEC_ERROR_BASE + 87), -"The user pressed cancel.") - -ResDef(SEC_ERROR_PKCS12_DUPLICATE_DATA, (SEC_ERROR_BASE + 88), -"Certificates could not be imported since they already exist on \ -the machine.") - -ResDef(SEC_ERROR_MESSAGE_SEND_ABORTED, (SEC_ERROR_BASE + 89), -"Message not sent.") - -ResDef(SEC_ERROR_INADEQUATE_KEY_USAGE, (SEC_ERROR_BASE + 90), -"The certificate is not approved for the attempted operation.") - -ResDef(SEC_ERROR_INADEQUATE_CERT_TYPE, (SEC_ERROR_BASE + 91), -"The certificate is not approved for the attempted application.") - -ResDef(SEC_ERROR_CERT_ADDR_MISMATCH, (SEC_ERROR_BASE + 92), -"The email address in the signing certificate does not match\n\ -the email address in the message headers. If these two\n\ -addresses do not belong to the same person, then this could\n\ -be an attempt at forgery.") - -ResDef(SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY, (SEC_ERROR_BASE + 93), -"Unable to import certificates. An error occurred while attempting\n\ -to import the Private Key associated with the certificate being imported.") - -ResDef(SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN, (SEC_ERROR_BASE + 94), -"Unable to import certificates. An error occurred while attempting\n\ -to import the certificate chain associated with the certificate\n\ -being imported.") - -ResDef(SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME, (SEC_ERROR_BASE + 95), -"Unable to export certificates. An error occurred while trying to locate\n\ -a certificate or a key by its nickname.") - -ResDef(SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY, (SEC_ERROR_BASE + 96), -"Unable to export certificates. The Private Key associated with a\n\ -certificate could not be located or could not be exported from the\n\ -key database.") - -ResDef(SEC_ERROR_PKCS12_UNABLE_TO_WRITE, (SEC_ERROR_BASE + 97), -"Unable to export certificates. An error occurred while trying to write\n\ -the export file. Make sure the destination drive is not full and try\n\ -exporting again.") - -ResDef(SEC_ERROR_PKCS12_UNABLE_TO_READ, (SEC_ERROR_BASE + 98), -"Unable to import certificates. An error occurred while reading the\n\ -import file. Please make sure the file exists and is not corrupt and\n\ -then try importing the file again.") - -ResDef(SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED, (SEC_ERROR_BASE + 99), -"Unable to export certificates. The database which contains\n\ -Private Keys has not been initialized. Either your key database\n\ -is corrupt or has been deleted. There is no key associated with\n\ -this certificate.") - -ResDef(SEC_ERROR_KEYGEN_FAIL, (SEC_ERROR_BASE + 100), -"Unable to generate Public/Private Key Pair.") - -ResDef(SEC_ERROR_INVALID_PASSWORD, (SEC_ERROR_BASE + 101), -"The password you entered is invalid. Please pick a different one.") - -ResDef(SEC_ERROR_RETRY_OLD_PASSWORD, (SEC_ERROR_BASE + 102), -"You did not enter your old password correctly. Please try again.") - -ResDef(SEC_ERROR_BAD_NICKNAME, (SEC_ERROR_BASE + 103), -"The Certificate Name you entered is already in use by another certificate.") - -ResDef(SEC_ERROR_NOT_FORTEZZA_ISSUER, (SEC_ERROR_BASE + 104), -"Server FORTEZZA chain has a non-FORTEZZA Certificate. \n\ -You will probably be unable to connect to this site securely.") - - -/* used in pk11dlgs.c */ -ResDef(SEC_ERROR_UNKNOWN, (SEC_ERROR_BASE + 105), - "Unknown") - -/* define some error messages for lm_pkcs11.c */ -ResDef(SEC_ERROR_JS_INVALID_MODULE_NAME, (SEC_ERROR_BASE + 106), -"Invalid module name.") - -ResDef(SEC_ERROR_JS_INVALID_DLL, (SEC_ERROR_BASE + 107), -"Invalid module path/filename") - -ResDef(SEC_ERROR_JS_ADD_MOD_FAILURE, (SEC_ERROR_BASE + 108), -"Unable to add module") - -ResDef(SEC_ERROR_JS_DEL_MOD_FAILURE, (SEC_ERROR_BASE + 109), - "Unable to delete module") - -ResDef(SEC_ERROR_OLD_KRL, (SEC_ERROR_BASE + 110), -"The key revocation list you are trying to load is not\n\ -later than the current one.") - -ResDef(SEC_ERROR_CKL_CONFLICT, (SEC_ERROR_BASE + 111), -"The CKL you are trying to load has a different issuer\n\ -than your current CKL. You must first delete your\n\ -current CKL.") - -ResDef(SEC_ERROR_CERT_NOT_IN_NAME_SPACE, (SEC_ERROR_BASE + 112), -"The Certifying Authority for this certifcate is not\n\ -permited to issue a certifcate with this name.") - -ResDef(SEC_ERROR_KRL_NOT_YET_VALID, (SEC_ERROR_BASE + 113), -"The key revocation list for this site's certificate\n\ -is not yet valid. Reload a new key revocation list.") - -ResDef(SEC_ERROR_CRL_NOT_YET_VALID, (SEC_ERROR_BASE + 114), -"The certificate revocation list for this site's\n\ -certificate is not yet valid. Reload a new certificate\n\ -revocation list.") - -END_STR(mcom_include_secerr_i_strings) - -/* HTML Dialog Box stuff. Moved from secerr #'s to xp_msg #'s */ -RES_START -BEGIN_STR(mcom_include_sec_dialog_strings) -/* NOTE - you can't use backslash-quote to get a quote in the html below. - * you must use \042. This is due to windows resource compiler hosage - */ -ResDef(XP_DIALOG_HEADER_STRINGS, (SEC_DIALOG_STRING_BASE + 0), "\ -%-styleinfo-%\ -
") - -/* NOTE - dialogs and panels share the same footer strings !! */ -ResDef(XP_DIALOG_FOOTER_STRINGS, (SEC_DIALOG_STRING_BASE + 2), "\ -
%0%") - -ResDef(XP_DIALOG_JS_HEADER_STRINGS, (SEC_DIALOG_STRING_BASE + 3), "\ -%-styleinfo-%%0%\n%-cont-%") - -ResDef(XP_DIALOG_JS_FOOTER_STRINGS4, (SEC_DIALOG_STRING_BASE + 8), "\ -\n\ -\n\ -\n") - -ResDef(XP_DIALOG_CANCEL_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 9), "\ -
") - -ResDef(XP_DIALOG_OK_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 10), "\ -
") - -ResDef(XP_DIALOG_CONTINUE_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 11), "\ -
\ -
") - -ResDef(XP_DIALOG_CANCEL_OK_BUTTON_STRINGS, - (SEC_DIALOG_STRING_BASE + 12), "\ -
  \ -
") - -ResDef(XP_DIALOG_CANCEL_CONTINUE_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 13), "\ -
  \ -
") - -ResDef(XP_PANEL_HEADER_STRINGS, (SEC_DIALOG_STRING_BASE + 14), "\ -%-styleinfo-%
\ -") - -#ifdef XP_OS2_FIX -ResDef(XP_PANEL_FIRST_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 16), "\ -
\ -value=\042%cancel%\042 onclick=\042parent.clicker(this,window.parent)\042>  
%0%") -#else -ResDef(XP_PANEL_FIRST_BUTTON_STRINGS_1, (SEC_DIALOG_STRING_BASE + 17), "\ -type=\042button\042 name=\042button\042 value=\042%cancel%\042 \ -onclick=\042parent.clicker(this,window.parent)\042 width=80>%0%") -#endif - -#ifdef XP_OS2_FIX -ResDef(XP_PANEL_MIDDLE_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 18), "\ -
\ -\ -
%0%") -#else -ResDef(XP_PANEL_MIDDLE_BUTTON_STRINGS_1, (SEC_DIALOG_STRING_BASE + 19), "\ -onclick=\042parent.clicker(this,window.parent)\042 width=80>  \ -%0%") -#endif - -#ifdef XP_OS2_FIX -ResDef(XP_PANEL_LAST_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 20), "\ -
\ -%-cont-%") -#endif - -#ifdef XP_OS2_FIX -ResDef(XP_PANEL_LAST_BUTTON_STRINGS_1, (SEC_DIALOG_STRING_BASE + 21), "\ -type=\042button\042 name=\042button\042 value=\042%back%\042 onclick=\042parent.clicker(this,window.parent)\042>
%0%") -#else -ResDef(XP_PANEL_LAST_BUTTON_STRINGS_1, (SEC_DIALOG_STRING_BASE + 21), "\ -  \ -%0%") -#endif - -ResDef(XP_PLAIN_CERT_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 22), "\ -%0%") - -ResDef(XP_CERT_CONFIRM_STRINGS, (SEC_DIALOG_STRING_BASE + 23), "\ -%0%%1%
%2%
%3%") - -ResDef(XP_CERT_PAGE_STRINGS, (SEC_DIALOG_STRING_BASE + 24), "\ -%0%%1%%2%") - -ResDef(XP_SSL_SERVER_CERT1_STRINGS, (SEC_DIALOG_STRING_BASE + 25), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -\ -%1% is a site that uses encryption to protect transmitted information. \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT1_STRINGS_1, (SEC_DIALOG_STRING_BASE + 26), "\ -However, "MOZ_NAME_PRODUCT" does not recognize the authority who signed its \ -Certificate.

Although "MOZ_NAME_PRODUCT" does not recognize the \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT1_STRINGS_2, (SEC_DIALOG_STRING_BASE + 27), "\ -signer of this Certificate, you may decide to accept it anyway so that \ -you can connect to and exchange information with this site.

This \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT1_STRINGS_3, (SEC_DIALOG_STRING_BASE + 28), "\ -assistant will help you decide whether or not you wish to accept this \ -Certificate and to what extent.%2%") - -ResDef(XP_SSL_SERVER_CERT2_STRINGS, (SEC_DIALOG_STRING_BASE + 29), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Here is the \ -Certificate that is being presented:


Certificate for:
Signed by:
Encryption:
%1%
%2%
%3% Grade (%4% with %5%-bit secret \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT2_STRINGS_2, (SEC_DIALOG_STRING_BASE + 31), "\ -key)

The signer of the \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT2_STRINGS_3, (SEC_DIALOG_STRING_BASE + 32), "\ -Certificate promises you that the holder of this Certificate is who they \ -say they are. The encryption level is an indication of how difficult it \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT2_STRINGS_4, (SEC_DIALOG_STRING_BASE + 33), "\ -would be for someone to eavesdrop on any information exchanged between \ -you and this web site.%6%") - -ResDef(XP_SSL_SERVER_CERT3_STRINGS, (SEC_DIALOG_STRING_BASE + 34), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Are you willing \ -to accept this certificate for the purposes of receiving encrypted \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT3_STRINGS_1, (SEC_DIALOG_STRING_BASE + 35), "\ -information from this web site?

This means that you will be able to \ -browse through the site and receive documents from it and that all of \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT3_STRINGS_2, (SEC_DIALOG_STRING_BASE + 36), "\ -these documents are protected from observation by a third party by \ -encryption.

Accept this \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT3_STRINGS_3, (SEC_DIALOG_STRING_BASE + 37), "\ -certificate for this session
\ -Do not accept this certificate and do not connect\ -
Accept this certificate forever (until it expires)
\ -%4%") - -ResDef(XP_SSL_SERVER_CERT4_STRINGS, (SEC_DIALOG_STRING_BASE + 39), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -By accepting this \ -certificate you are ensuring that all information you exchange with this site \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT4_STRINGS_1, (SEC_DIALOG_STRING_BASE + 40), "\ -will be encrypted. However, encryption will not protect you from \ -fraud.

To protect yourself from fraud, do not send information \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT4_STRINGS_2, (SEC_DIALOG_STRING_BASE + 41), "(\ -especially personal information, credit card numbers, or passwords) to \ -this site if you have any doubt about the site's integrity.

For your \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT4_STRINGS_3, (SEC_DIALOG_STRING_BASE + 42), "\ -own protection, "MOZ_NAME_PRODUCT" can remind you of this at the appropriate \ -time.

Warn me \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT4_STRINGS_4, (SEC_DIALOG_STRING_BASE + 43), "\ -before I send information to this site

%2%") - -ResDef(XP_SSL_SERVER_CERT5A_STRINGS, (SEC_DIALOG_STRING_BASE + 44), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have \ -finished examining the certificate presented by:
%1%

You have \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT5A_STRINGS_1, (SEC_DIALOG_STRING_BASE + 45), "\ -decided to refuse this ID. If, in the future, you change your mind about \ -this decision, just visit this site again and this assistant will \ -%-cont-%") - -ResDef(XP_SSL_SERVER_CERT5A_STRINGS_2, (SEC_DIALOG_STRING_BASE + 46), "\ -reappear.

Click on the Finish button to return to the document you were\ -viewing before you attempted to connect to this site.%2%") - -ResDef(XP_SSL_SERVER_CERT5B_STRINGS, (SEC_DIALOG_STRING_BASE + 47), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have \ -finished examining the certificate presented by:
%1%

You have \ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_SSL_SERVER_CERT5B_STRINGS_1, (SEC_DIALOG_STRING_BASE + 48), "\ -decided to accept this certificate and have asked that "MOZ_NAME_FULL" warn \ -you before you send information to this site.

If you \ -%-cont-%") -#else -ResDef(XP_SSL_SERVER_CERT5B_STRINGS_1, (SEC_DIALOG_STRING_BASE + 48), "\ -decided to accept this certificate and have asked that "MOZ_NAME_PRODUCT" Communicator warn \ -you before you send information to this site.

If you \ -%-cont-%") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_SSL_SERVER_CERT5B_STRINGS_2, (SEC_DIALOG_STRING_BASE + 49), "\ -change your mind, open Security Info from the "MOZ_NAME_PRODUCT" menu and edit \ -Site Certificates.

Click on the Finish button to begin receiving\ -documents.%2%") -#else -ResDef(XP_SSL_SERVER_CERT5B_STRINGS_2, (SEC_DIALOG_STRING_BASE + 49), "\ -change your mind, open Security Info from the Communicator menu and edit \ -Site Certificates.

Click on the Finish button to begin receiving\ -documents.%2%") -#endif - -ResDef(XP_SSL_SERVER_CERT5C_STRINGS, (SEC_DIALOG_STRING_BASE + 50), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have \ -finished examining the certificate presented by:
%1%

You have \ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_SSL_SERVER_CERT5C_STRINGS_1, (SEC_DIALOG_STRING_BASE + 51), "\ -decided to accept this certificate and have decided not to have "MOZ_NAME_PRODUCT" \ -"MOZ_NAME_PRODUCT" warn you before you send information to this site.

If \ -%-cont-%") -#else -ResDef(XP_SSL_SERVER_CERT5C_STRINGS_1, (SEC_DIALOG_STRING_BASE + 51), "\ -decided to accept this certificate and have decided not to have "MOZ_NAME_PRODUCT" \ -Communicator warn you before you send information to this site.

If \ -%-cont-%") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_SSL_SERVER_CERT5C_STRINGS_2, (SEC_DIALOG_STRING_BASE + 52), "\ -you change your mind, open Security Info from the "MOZ_NAME_PRODUCT" Menu \ -edit Site Certificates.

Click on the Finish button\ -to begin %-cont-%") -#else -ResDef(XP_SSL_SERVER_CERT5C_STRINGS_2, (SEC_DIALOG_STRING_BASE + 52), "\ -you change your mind, open Security Info from the Communicator Menu \ -edit Site Certificates.

Click on the Finish button\ -to begin %-cont-%") -#endif - -ResDef(XP_SSL_SERVER_CERT5C_STRINGS_3, (SEC_DIALOG_STRING_BASE + 53), "\ -receiving documents.%2%") - -ResDef(XP_SSL_CERT_DOMAIN_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 54), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The certificate \ -that the site '%1%' has presented does not contain the correct site \ -%-cont-%") - -ResDef(XP_SSL_CERT_DOMAIN_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 55), "\ -name. It is possible, though unlikely, that someone may be trying to \ -intercept your communication with this site. If you suspect the \ -%-cont-%") - -ResDef(XP_SSL_CERT_DOMAIN_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 56), "\ -certificate shown below does not belong to the site you are connecting \ -with, please cancel the connection and notify the site administrator.

\ -%-cont-%") - -ResDef(XP_SSL_CERT_DOMAIN_DIALOG_STRINGS_3, (SEC_DIALOG_STRING_BASE + 57), "\ -Here is the Certificate that is being presented:


Certificate for:
Signed by:
Encryption: \ -%-cont-%") - -ResDef(XP_SSL_CERT_DOMAIN_DIALOG_STRINGS_4, (SEC_DIALOG_STRING_BASE + 58), "\ -
%2%
%3%
%4% Grade (%5% \ -with %6%-bit secret key)
\ -
%7%") - -ResDef(XP_PW_ENTER_NEW_STRINGS, (SEC_DIALOG_STRING_BASE + 60), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Please enter your new password. The safest passwords are a combination \ -of letters \ -%-cont-%") - -ResDef(XP_PW_ENTER_NEW_STRINGS_1, (SEC_DIALOG_STRING_BASE + 61), "\ -and numbers, are at least 8 characters long, and contain no words from a \ -dictionary.

Password:

Type in \ -%-cont-%") - -ResDef(XP_PW_ENTER_NEW_STRINGS_2, (SEC_DIALOG_STRING_BASE + 62), "\ -your password, again, for verification:

Retype Password:

Do not forget your password! Your \ -%-cont-%") - -ResDef(XP_PW_ENTER_NEW_STRINGS_3, (SEC_DIALOG_STRING_BASE + 63), "\ -password cannot be recovered. If you forget it, you will have to obtain \ -new Certificates.") - -ResDef(XP_PW_RETRY_NEW_STRINGS, (SEC_DIALOG_STRING_BASE + 64), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You did not \ -enter your password correctly. Please try again:

Password:

Type in your password, again, for \ -verification:

Retype Password:

\ -%-cont-%") - -ResDef(XP_PW_RETRY_NEW_STRINGS_2, (SEC_DIALOG_STRING_BASE + 66), "\ -Do not forget your password! Your password cannot be recovered. If \ -you forget it, you will have to obtain new Certificates. ") - -ResDef(XP_PW_SETUP_STRINGS, (SEC_DIALOG_STRING_BASE + 67), "\ -%sec-banner-being%%0%%sec-banner-end%\ -%1%%2%%3%%4%\ -%-cont-%") - -ResDef(XP_PW_SETUP_STRINGS_1, (SEC_DIALOG_STRING_BASE + 68), "\ -\ -
Password:
Type it again to confirm:
Important: \ -%-cont-%") - -ResDef(XP_PW_SETUP_STRINGS_3, (SEC_DIALOG_STRING_BASE + 70), "\ -Your password cannot be recovered. If you forget it, you will lose all of your \ -certificates.

%-cont-%") - -ResDef(XP_PW_SETUP_STRINGS_4, (SEC_DIALOG_STRING_BASE + 71), "\ -The safest passwords are at least 8 characters long, include \ -both letters and numbers, and contain no words from a dictionary.

\ -If you wish to change your password or other security \ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_PW_SETUP_STRINGS_5, (SEC_DIALOG_STRING_BASE + 72), "\ -preferences, choose Security Info from the "MOZ_NAME_PRODUCT" menu.") -#else -ResDef(XP_PW_SETUP_STRINGS_5, (SEC_DIALOG_STRING_BASE + 72), "\ -preferences, choose Security Info from the Communicator menu.") -#endif - -/* unused (SEC_DIALOG_STRING_BASE + 73) */ - -/* unused (SEC_DIALOG_STRING_BASE + 74) */ - -/* unused (SEC_DIALOG_STRING_BASE + 75) */ - -/* unused (SEC_DIALOG_STRING_BASE + 76) */ - -/* unused (SEC_DIALOG_STRING_BASE + 77) */ - -/* unused (SEC_DIALOG_STRING_BASE + 78) */ - -/* unused (SEC_DIALOG_STRING_BASE + 79) */ - -/* unused (SEC_DIALOG_STRING_BASE + 80) */ - -/* unused (SEC_DIALOG_STRING_BASE + 81) */ - -/* unused (SEC_DIALOG_STRING_BASE + 82) */ - -ResDef(XP_PW_SETUP_REFUSED_STRINGS, (SEC_DIALOG_STRING_BASE + 83), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have elected to operate without a password.

If you decide that you \ -%-cont-%") - -ResDef(XP_PW_SETUP_REFUSED_STRINGS_1, (SEC_DIALOG_STRING_BASE + 84), "\ -would like to have a password to protect your Private Keys and Certificates, \ -you can set up a password in Security Preferences.") - -ResDef(XP_PW_CHANGE_STRINGS, (SEC_DIALOG_STRING_BASE + 85), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Change the password for the %1%.

Enter your old password:

Enter your new password. Leave \ -the password fields blank if you don't want a password.

\ -
\ -%-cont-%") - -ResDef(XP_PW_CHANGE_STRINGS_2, (SEC_DIALOG_STRING_BASE + 87), "\ -New Password:
Type it again to confirm:\ -%-cont-%") - -ResDef(XP_PW_CHANGE_STRINGS_3, (SEC_DIALOG_STRING_BASE + 88), "\ -

Important: Your password cannot be recovered. If \ -you forget it, you will lose all of your certificates.") - -/* unused (SEC_DIALOG_STRING_BASE + 89) */ - -ResDef(XP_PW_CHANGE_FAILURE_STRINGS, (SEC_DIALOG_STRING_BASE + 90), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Your attempt to change your password failed.

This may be because your \ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_PW_CHANGE_FAILURE_STRINGS_1, (SEC_DIALOG_STRING_BASE + 91), "\ -key database is inaccessible (which can happen if you were already \ -running a "MOZ_NAME_PRODUCT" when you started this one), or because of some other \ -%-cont-%") -#else -ResDef(XP_PW_CHANGE_FAILURE_STRINGS_1, (SEC_DIALOG_STRING_BASE + 91), "\ -key database is inaccessible (which can happen if you were already \ -running a Communicator when you started this one), or because of some other \ -%-cont-%") -#endif - -ResDef(XP_PW_CHANGE_FAILURE_STRINGS_2, (SEC_DIALOG_STRING_BASE + 92), "\ -error.

It may indicate that your key database file has been corrupted, \ -in which case you should try to get it from of a backup, if possible. As \ -%-cont-%") - -ResDef(XP_PW_CHANGE_FAILURE_STRINGS_3, (SEC_DIALOG_STRING_BASE + 93), "\ -a last resort, you may need to delete your key database, after which you \ -will have to obtain new personal Certificates.") - -ResDef(XP_DIALOG_CANCEL_OK_MOREINFO_BUTTON_STRINGS, - (SEC_DIALOG_STRING_BASE + 94), "\ -\ -%-cont-%") - -ResDef(XP_DIALOG_CANCEL_OK_MOREINFO_BUTTON_STRINGS_1, - (SEC_DIALOG_STRING_BASE + 95), "\ -
\ -  \ -%-cont-%") - -ResDef(XP_DIALOG_CANCEL_OK_MOREINFO_BUTTON_STRINGS_2, - (SEC_DIALOG_STRING_BASE + 96),"\ -
") - -/* unused (SEC_DIALOG_STRING_BASE + 97) */ - -/* unused (SEC_DIALOG_STRING_BASE + 98) */ - -ResDef(XP_PANEL_ONLY_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 99), "\ -

  \ -%-cont-%") - -ResDef(XP_PANEL_ONLY_BUTTON_STRINGS_1, (SEC_DIALOG_STRING_BASE + 100), "\ -
%0%") - -ResDef(XP_NOT_IMPLEMENTED_STRINGS, (SEC_DIALOG_STRING_BASE + 101), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -This function is \ -not implemented:
%1%
Certificate name:
%2%") - -ResDef(XP_CERT_VIEW_STRINGS, (SEC_DIALOG_STRING_BASE + 102), "\ -%0%%1%") - -ResDef(XP_DELETE_USER_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 103), "\ -WARNING: If you delete this Certificate you will not \ -be able to read any E-mail that has been encrypted with it.

\ -Are you sure that you want to delete this Personal Certificate?

%0%") - -ResDef(XP_DELETE_SITE_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 104), "\ -Are you sure that you want to delete this Site Certificate?

%0%") - -ResDef(XP_DELETE_CA_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 105), "\ -Are you sure that you want to delete this Certificate Authority?

%0%") - -ResDef(XP_EDIT_SITE_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 106), "\ -%0%


This Certificate belongs to an SSL server site.
Allow connections to this site
\ -%-cont-%") - -ResDef(XP_EDIT_SITE_CERT_STRINGS_1, (SEC_DIALOG_STRING_BASE + 107), "\ -Do not allow connections to \ -this site
Warn \ -%-cont-%") - -ResDef(XP_EDIT_SITE_CERT_STRINGS_2, (SEC_DIALOG_STRING_BASE + 108), "\ -before sending data to this site") - -ResDef(XP_EDIT_CA_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 109), "\ -%0%
This Certificate belongs to a Certifying Authority
\ -%-cont-%") - -ResDef(XP_EDIT_CA_CERT_STRINGS_1, (SEC_DIALOG_STRING_BASE + 110), "\ -%1%
%2%
%3%
Warn before sending data to \ -sites certified by this authority") - -ResDef(XP_SSL_CERT_POST_WARN_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 112), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Warning: You \ -%-cont-%") - -ResDef(XP_SSL_CERT_POST_WARN_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 113), "\ -are about to send encrypted information to the site %1%.

It is \ -card numbers, or passwords) to this site if you are in doubt about its \ -%-cont-%") - -ResDef(XP_SSL_CERT_POST_WARN_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 114), "\ -safer not to send information (particularly personal information, credit \ -Certificate or integrity.
Here is the Certificate for this site:


\ -%-cont-%") - -ResDef(XP_SSL_CERT_POST_WARN_DIALOG_STRINGS_3, (SEC_DIALOG_STRING_BASE + 115), "\ -
Certificate for:
Signed by: \ -
Encryption:
%2%
%3%
\ -%-cont-%") - -ResDef(XP_SSL_CERT_POST_WARN_DIALOG_STRINGS_4, (SEC_DIALOG_STRING_BASE + 116), "\ -%4% Grade (%5% with %6%-bit secret key)
\ -

Send this information and warn again next \ -%-cont-%") - -ResDef(XP_SSL_CERT_POST_WARN_DIALOG_STRINGS_6, (SEC_DIALOG_STRING_BASE + 118), "\ -time
Send this information \ -and do not warn again
Do \ -not send information
%7%") - -ResDef(XP_CA_CERT_DOWNLOAD1_STRINGS, (SEC_DIALOG_STRING_BASE + 119), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You are about to \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD1_STRINGS_1, (SEC_DIALOG_STRING_BASE + 120), "\ -go through the process of accepting a Certificate Authority. This has \ -serious implications on the security of future encryptions using \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD1_STRINGS_2, (SEC_DIALOG_STRING_BASE + 121), "\ -"MOZ_NAME_PRODUCT". This assistant will help you decide whether or not you wish to \ -accept this Certificate Authority.") - -ResDef(XP_CA_CERT_DOWNLOAD2_STRINGS, (SEC_DIALOG_STRING_BASE + 122), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -A Certificate \ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_CA_CERT_DOWNLOAD2_STRINGS_1, (SEC_DIALOG_STRING_BASE + 123), "\ -Authority certifies the identity of sites on the internet. By accepting \ -this Certificate Authority, you will allow "MOZ_NAME_FULL" to connect \ -%-cont-%") -#else -ResDef(XP_CA_CERT_DOWNLOAD2_STRINGS_1, (SEC_DIALOG_STRING_BASE + 123), "\ -Authority certifies the identity of sites on the internet. By accepting \ -this Certificate Authority, you will allow "MOZ_NAME_PRODUCT" Communicator to connect \ -%-cont-%") -#endif - -ResDef(XP_CA_CERT_DOWNLOAD2_STRINGS_2, (SEC_DIALOG_STRING_BASE + 124), "\ -to and receive information from any site that this authority certifies \ -without prompting or warning you.

If you choose to refuse this \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD2_STRINGS_3, (SEC_DIALOG_STRING_BASE + 125), "\ -Certificate Authority, you will be prompted before you connect to or \ -receive information from any site that this authority certifies. ") - -ResDef(XP_CA_CERT_DOWNLOAD3_STRINGS, (SEC_DIALOG_STRING_BASE + 126), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Here is the \ -certificate for this Certificate Authority. Examine it carefully. The \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD3_STRINGS_1, (SEC_DIALOG_STRING_BASE + 127), "\ -Certificate Fingerprint can be used to verify that this Authority is who \ -they say they are. To do this, compare the Fingerprint against the \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD3_STRINGS_2, (SEC_DIALOG_STRING_BASE + 128), "\ -Fingerprint published by this authority in other places.


\ -\ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD3_STRINGS_3, (SEC_DIALOG_STRING_BASE + 129), "\ -
Certificate for:
Signed by:
%1%
%2%
\ -

") - -ResDef(XP_CA_CERT_DOWNLOAD4_STRINGS, (SEC_DIALOG_STRING_BASE + 131), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Are you willing \ -to accept this Certificate Authority for the purposes of certifying \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD4_STRINGS_1, (SEC_DIALOG_STRING_BASE + 132), "\ -other internet sites, email users, or software developers?

\ -%1%%2%%3%") - -/* 133, 134 NOT USED */ - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_CA_CERT_DOWNLOAD5_STRINGS, (SEC_DIALOG_STRING_BASE + 135), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -By accepting this \ -Certificate Authority, you have told "MOZ_NAME_FULL" \ -%-cont-%") -#else -ResDef(XP_CA_CERT_DOWNLOAD5_STRINGS, (SEC_DIALOG_STRING_BASE + 135), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -By accepting this \ -Certificate Authority, you have told "MOZ_NAME_PRODUCT" Communicator to connect to \ -%-cont-%") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_CA_CERT_DOWNLOAD5_STRINGS_1, (SEC_DIALOG_STRING_BASE + 136), "\ -to connect to and receive information from any site that it certifies \ -without warning you or prompting you.

"MOZ_NAME_FULL" can, however, \ -warn you before \ -%-cont-%") -#else -ResDef(XP_CA_CERT_DOWNLOAD5_STRINGS_1, (SEC_DIALOG_STRING_BASE + 136), "\ -to connect to and receive information from any site that it certifies \ -without warning you or prompting you.

"MOZ_NAME_PRODUCT" Communicator can, however, \ -warn you before \ -%-cont-%") -#endif - -ResDef(XP_CA_CERT_DOWNLOAD5_STRINGS_2, (SEC_DIALOG_STRING_BASE + 137), "\ -you send information to such a site.

Warn me before sending information to sites \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD5_STRINGS_3, (SEC_DIALOG_STRING_BASE + 138), "\ -certified by this Certificate Authority") - -ResDef(XP_CA_CERT_DOWNLOAD6_STRINGS, (SEC_DIALOG_STRING_BASE + 139), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have accepted \ -this Certificate Authority. You must now select a nickname that will be \ -%-cont-%") - -ResDef(XP_CA_CERT_DOWNLOAD6_STRINGS_1, (SEC_DIALOG_STRING_BASE + 140), "\ -used to identify this Certificate Authority, for example Mozilla's \ -Certificate Shack.

Nickname: ") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_CA_CERT_DOWNLOAD7_STRINGS, (SEC_DIALOG_STRING_BASE + 142), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -By rejecting this \ -Certificate Authority, you have told "MOZ_NAME_FULL" not to connect \ -%-cont-%") -#else -ResDef(XP_CA_CERT_DOWNLOAD7_STRINGS, (SEC_DIALOG_STRING_BASE + 142), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -By rejecting this \ -Certificate Authority, you have told "MOZ_NAME_BRAND" Communicator not to connect \ -%-cont-%") -#endif - -ResDef(XP_CA_CERT_DOWNLOAD7_STRINGS_1, (SEC_DIALOG_STRING_BASE + 143), "\ -to and receive information from any site that it certifies without \ -prompting you.") - -ResDef(XP_EMPTY_STRINGS, (SEC_DIALOG_STRING_BASE + 144), "\ -%0%") - -ResDef(XP_WHICH_CERT_CLIENT_AUTH_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 145), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The site '%1%' \ -has requested client authentication.

Here is the \ -%-cont-%") - -ResDef(XP_WHICH_CERT_CLIENT_AUTH_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 146), "\ -site's certificate:


\ -
Certificate \ -for:
Signed by:
Encryption:
%2%
%3%
%4% Grade (%5% with %6%-bit secret key)

Select Your Certificate:%8%") - -ResDef(XP_NO_CERT_CLIENT_AUTH_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 149), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The site '%1%' \ -has requested client authentication, but you do not have a Personal \ -%-cont-%") - -ResDef(XP_NO_CERT_CLIENT_AUTH_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 150), "\ -Certificate to authenticate yourself. The site may choose not to give \ -you access without one.%2%") - -ResDef(XP_BROWSER_SEC_INFO_ENCRYPTED_STRINGS, (SEC_DIALOG_STRING_BASE + 151), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -All of the \ -files that you have requested were encrypted.

This means that the \ -%-cont-%") - -ResDef(XP_BROWSER_SEC_INFO_ENCRYPTED_STRINGS_1, (SEC_DIALOG_STRING_BASE + 152), "\ -files that make up the document are sent to you encrypted for privacy \ -while in transit.

For more details on the encryption of this \ -%-cont-%") - -ResDef(XP_BROWSER_SEC_INFO_ENCRYPTED_STRINGS_2, (SEC_DIALOG_STRING_BASE + 153), "\ -document, open Document Information.

%1%") - -ResDef(XP_BROWSER_SEC_INFO_MIXED_STRINGS, (SEC_DIALOG_STRING_BASE + 155), "\ -%0%

Some of the \ -files that you have requested were encrypted.

Some of these files \ -%-cont-%") - -ResDef(XP_BROWSER_SEC_INFO_MIXED_STRINGS_1, (SEC_DIALOG_STRING_BASE + 156), "\ -are sent to you encrypted for privacy while in transit. Others are not \ -encrypted and can be observed by a third party while in transit.

To \ -%-cont-%") - -ResDef(XP_BROWSER_SEC_INFO_MIXED_STRINGS_2, (SEC_DIALOG_STRING_BASE + 157), "\ -find out exactly which files were encrypted and which were not, open \ -Document Information.

%1%") - -ResDef(XP_BROWSER_SEC_INFO_CLEAR_STRINGS, (SEC_DIALOG_STRING_BASE + 159), "\ -%0%

None of the \ -files that you have requested are encrypted.

Unencrypted files can \ -%-cont-%") - -ResDef(XP_BROWSER_SEC_INFO_CLEAR_STRINGS_1, (SEC_DIALOG_STRING_BASE + 160), "\ -be observed by a third party while in transit.

%1%") - -ResDef( XP_SMIME_RC2_CBC_40, (SEC_DIALOG_STRING_BASE + 161), \ -"RC2 encryption in CBC mode with a 40-bit key") - -ResDef( XP_SMIME_RC2_CBC_64, (SEC_DIALOG_STRING_BASE + 162), \ -"RC2 encryption in CBC mode with a 64-bit key") - -ResDef( XP_SMIME_RC2_CBC_128, (SEC_DIALOG_STRING_BASE + 163), \ -"RC2 encryption in CBC mode with a 128-bit key") - -ResDef( XP_SMIME_DES_CBC, (SEC_DIALOG_STRING_BASE + 164), \ -"DES encryption in CBC mode with a 56-bit key") - -ResDef( XP_SMIME_DES_EDE3, (SEC_DIALOG_STRING_BASE + 165), \ -"DES EDE3 encryption in CBC mode with a 168-bit key") - -ResDef( XP_SMIME_RC5PAD_64_16_40, (SEC_DIALOG_STRING_BASE + 166), \ -"RC5 encryption in CBC mode with a 40-bit key") - -ResDef( XP_SMIME_RC5PAD_64_16_64, (SEC_DIALOG_STRING_BASE + 167), \ -"RC5 encryption in CBC mode with a 64-bit key") - -ResDef( XP_SMIME_RC5PAD_64_16_128, (SEC_DIALOG_STRING_BASE + 168), \ -"RC5 encryption in CBC mode with a 128-bit key") - - -/* SEC_DIALOG_STRING_BASE + 169 thru SEC_DIALOG_STRING_BASE + 175 unused */ -/* (They used to be strings for payment stuff.) */ - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_CONFIG_NO_POLICY_STRINGS, (SEC_DIALOG_STRING_BASE + 176), \ -"No valid encryption policy file was found for this English language \n\ -version of "MOZ_NAME_PRODUCT". All encryption and decryption will be disabled.") -#else -ResDef(XP_CONFIG_NO_POLICY_STRINGS, (SEC_DIALOG_STRING_BASE + 176), \ -"No valid encryption policy file was found for this English language \n\ -version of Communicator. All encryption and decryption will be disabled.") -#endif - -ResDef(XP_CONFIG_NO_CIPHERS_STRINGS, (SEC_DIALOG_STRING_BASE + 177), \ -" (No ciphers are permitted)") - -ResDef(XP_CONFIG_MAYBE_CIPHERS_STRINGS, (SEC_DIALOG_STRING_BASE + 178), \ -" (When permitted)") - -ResDef(XP_CONFIG_SMIME_CIPHERS_STRINGS, (SEC_DIALOG_STRING_BASE + 179), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -

Select ciphers to enable for S/MIME %1%

    %2%
%3%") - -ResDef(XP_CONFIG_SSL2_CIPHERS_STRINGS, (SEC_DIALOG_STRING_BASE + 180), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -

Select ciphers to enable for SSL v2 %1%

    %2%
%3%") - -ResDef(XP_CONFIG_SSL3_CIPHERS_STRINGS, (SEC_DIALOG_STRING_BASE + 181), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -

Select ciphers to enable for SSL v3 %1%

    %2%
%3%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_USER_CERT_DOWNLOAD_STRINGS, (SEC_DIALOG_STRING_BASE + 182), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have received a new Certificate. "MOZ_NAME_PRODUCT" will refer to this \ -%-cont-%") -#else -ResDef(XP_USER_CERT_DOWNLOAD_STRINGS, (SEC_DIALOG_STRING_BASE + 182), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You have received a new Certificate. Communicator will refer to this \ -%-cont-%") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_USER_CERT_DOWNLOAD_STRINGS_1, (SEC_DIALOG_STRING_BASE + 183), "\ -Certificate by the name shown below. %1%

Click OK to install the \ -certificate into "MOZ_NAME_PRODUCT" or click Cancel to refuse your new \ -%-cont-%") -#else -ResDef(XP_USER_CERT_DOWNLOAD_STRINGS_1, (SEC_DIALOG_STRING_BASE + 183), "\ -Certificate by the name shown below. %1%

Click OK to install the \ -certificate into Communicator or click Cancel to refuse your new \ -%-cont-%") -#endif - -ResDef(XP_USER_CERT_DOWNLOAD_STRINGS_2, (SEC_DIALOG_STRING_BASE + 184), "\ -Certificate.


Certificate Name: %2%

Certificate \ -for: %3%
Signed by: %4%


%5%") - -ResDef(XP_USER_CERT_NICKNAME_STRINGS, (SEC_DIALOG_STRING_BASE + 186), "\ -You can use the name provided or enter a new one.") - -ResDef(XP_USER_CERT_DL_MOREINFO_STRINGS, (SEC_DIALOG_STRING_BASE + 187), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -A Certificate is arriving from %1%.

This Certificate works in conjunction \ -%-cont-%") - -ResDef(XP_USER_CERT_DL_MOREINFO_STRINGS_1, (SEC_DIALOG_STRING_BASE + 188), "\ -with the corresponding Private Key that was generated for you when you \ -requested the Certificate. Together they can identify you to Web sites and \ -via Email.

Certificates and Private Keys are much more secure than \ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_USER_CERT_DL_MOREINFO_STRINGS_2, (SEC_DIALOG_STRING_BASE + 189), "\ -traditional username and password security methods. For more information \ -about Certificates, choose Security Info from the "MOZ_NAME_PRODUCT" menu.") -#else -ResDef(XP_USER_CERT_DL_MOREINFO_STRINGS_2, (SEC_DIALOG_STRING_BASE + 189), "\ -traditional username and password security methods. For more information \ -about Certificates, choose Security Info from the Communicator menu.") -#endif - -ResDef(XP_USER_CERT_SAVE_STRINGS, (SEC_DIALOG_STRING_BASE + 190), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You should make a copy of your new Certificate.

If you lose your Certificate \ -%-cont-%") - -ResDef(XP_USER_CERT_SAVE_STRINGS_1, (SEC_DIALOG_STRING_BASE + 191), "\ -it cannot be recovered. Only you hold your Private Key. Without it \ -you will not be able to read any email that you received using that \ -%-cont-%") - -ResDef(XP_USER_CERT_SAVE_STRINGS_2, (SEC_DIALOG_STRING_BASE + 192), "\ -Certificate.

To make a copy, click Save As and decide where you \ -would like to save your Certificate. If possible, you should save it on a \ -%-cont-%") - -ResDef(XP_USER_CERT_SAVE_STRINGS_3, (SEC_DIALOG_STRING_BASE + 193), "\ -floppy disk that you keep in a safe location.

") - -ResDef(XP_USER_CERT_SAVE_TITLE, (SEC_DIALOG_STRING_BASE + 194), "\ -Save User Certificate") - -/* unused (SEC_DIALOG_STRING_BASE + 195) */ - -/* unused (SEC_DIALOG_STRING_BASE + 196) */ - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_KEY_GEN_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 197), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -When you click OK, "MOZ_NAME_PRODUCT" will generate a Private Key for your \ -%-cont-%") -#else -ResDef(XP_KEY_GEN_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 197), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -When you click OK, Communicator will generate a Private Key for your \ -%-cont-%") -#endif - -ResDef(XP_KEY_GEN_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 198), "\ -Certificate. This may take a few minutes.

Important: If you \ -interrupt this process, you will have to reapply for the Certificate.\ -%1% %2% %3%

") - -ResDef(XP_KEY_GEN_MOREINFO_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 199), "\ -Key Generation Info") - -ResDef(XP_CERT_DL_MOREINFO_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 200), "\ -Certificate Download Info") - - -ResDef(XP_CERT_EXPIRED_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 201), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -%1% is a site \ -that uses encryption to protect transmitted information. However the \ -%-cont-%") - -ResDef(XP_CERT_EXPIRED_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 202), "\ -digital Certificate that identifies this site has expired. This may be \ -because the certificate has actually expired, or because the date on \ -%-cont-%") - -ResDef(XP_CERT_EXPIRED_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 203), "\ -your computer is wrong.

The certificate expires on %2%.

Your \ -computer's date is set to %3%. If this date is incorrect, then you \ -%-cont-%") - -ResDef(XP_CERT_EXPIRED_DIALOG_STRINGS_3, (SEC_DIALOG_STRING_BASE + 204), "\ -should reset the date on your computer.

You may continue or cancel \ -this connection.%4%") - -ResDef(XP_CERT_NOT_YET_GOOD_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 205), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -%1% is a site \ -that uses encryption to protect transmitted information. However the \ -%-cont-%") - -ResDef(XP_CERT_NOT_YET_GOOD_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 206), "\ -digital Certificate that identifies this site is not yet valid. This \ -may be because the certificate was installed too soon by the site \ -%-cont-%") - -ResDef(XP_CERT_NOT_YET_GOOD_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 207), "\ -administrator, or because the date on your computer is wrong.

The \ -certificate is valid beginning %2%.

Your computer's date is set to \ -%-cont-%") - -ResDef(XP_CERT_NOT_YET_GOOD_DIALOG_STRINGS_3, (SEC_DIALOG_STRING_BASE + 208), "\ -%3%. If this date is incorrect, then you should reset the date on your \ -computer.

You may continue or cancel this connection.%4%") - -ResDef(XP_CA_EXPIRED_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 209), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -%1% is a site \ -that uses encryption to protect transmitted information. However one of \ -%-cont-%") - -ResDef(XP_CA_EXPIRED_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 210), "\ -the Certificate Authorities that identifies this site has expired. This \ -may be because a certificate has actually expired, or because the date \ -%-cont-%") - -ResDef(XP_CA_EXPIRED_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 211), "\ -on your computer is wrong. Press the More Info button to see details of \ -the expired certificate.


Certificate Authority:
Expiration Date: \ -
%2%
%3%

Your computer's date is set \ -%-cont-%") - -ResDef(XP_CA_EXPIRED_DIALOG_STRINGS_5, (SEC_DIALOG_STRING_BASE + 214), "\ -to %4%. If this date is incorrect, then you should reset the date on \ -your computer.

You may continue or cancel this connection.") - -ResDef(XP_CA_NOT_YET_GOOD_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 215), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -%1% is a site \ -that uses encryption to protect transmitted information. However one of \ -%-cont-%") - -ResDef(XP_CA_NOT_YET_GOOD_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 216), "\ -the Certificate Authorities that identifies this site is not yet valid. \ -This may be because a certificate was install too soon by the site \ -%-cont-%") - -ResDef(XP_CA_NOT_YET_GOOD_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 217), "\ -administrator, or because the date on your computer is wrong. Press the \ -More Info button to see details of the expired certificate.


Certificate \ -Authority:
Certificate Valid On:
%2%
%3%
\ -%-cont-%") - -ResDef(XP_CA_NOT_YET_GOOD_DIALOG_STRINGS_5, (SEC_DIALOG_STRING_BASE + 220), "\ -
Your computer's date is set to %4%. If this date is incorrect, then \ -you should reset the date on your computer.

You may continue or cancel \ -%-cont-%") - -ResDef(XP_CA_NOT_YET_GOOD_DIALOG_STRINGS_6, (SEC_DIALOG_STRING_BASE + 221), "\ -this connection.") - -ResDef(XP_SEC_CANCEL, (SEC_DIALOG_STRING_BASE + 222), "\ -Cancel") - -ResDef(XP_SEC_OK, (SEC_DIALOG_STRING_BASE + 223), "\ -OK") - -ResDef(XP_SEC_CONTINUE, (SEC_DIALOG_STRING_BASE + 224), "\ -Continue") - -/* These must match the kludge versions below */ - -ResDef(XP_SEC_NEXT, (SEC_DIALOG_STRING_BASE + 225), "\ -Next>") - -ResDef(XP_SEC_BACK, (SEC_DIALOG_STRING_BASE + 226), "\ -<Back") - -ResDef(XP_SEC_FINISHED, (SEC_DIALOG_STRING_BASE + 227), "\ -Finish") - -ResDef(XP_SEC_MOREINFO, (SEC_DIALOG_STRING_BASE + 228), "\ -More Info...") - -ResDef(XP_SEC_SHOWCERT, (SEC_DIALOG_STRING_BASE + 229), "\ -Show Certificate") - -ResDef(XP_SEC_SHOWORDER, (SEC_DIALOG_STRING_BASE + 230), "\ -Show Order") - -ResDef(XP_SEC_SHOWDOCINFO, (SEC_DIALOG_STRING_BASE + 231), "\ -Show Document Info") - -/* These must match the original versions above */ - -ResDef(XP_SEC_NEXT_KLUDGE, (SEC_DIALOG_STRING_BASE + 232), "\ -Next>") - -ResDef(XP_SEC_BACK_KLUDGE, (SEC_DIALOG_STRING_BASE + 233), "\ -The certificate that you have selected has expired and may \ -%-cont-%") - -ResDef(XP_CLIENT_CERT_EXPIRED_RENEWAL_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 265), "\ -be rejected by the server. You may press %continue% to send it \ -anyway, or %cancel% to abort this connection. To renew your \ -%-cont-%") - -ResDef(XP_CLIENT_CERT_EXPIRED_RENEWAL_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 266), "\ -certificate press the %renew% button.") - -ResDef(XP_SEC_RENEW, (SEC_DIALOG_STRING_BASE + 267), "\ -Renew") - -ResDef(XP_CLIENT_CERT_NOT_YET_GOOD_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 268), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The certificate that you have selected is not yet valid and may \ -be rejected by the server. You may press Continue to send it \ -anyway, or Cancel to abort this connection.") - -ResDef(XP_CLCERTEXP_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 269), "\ -Your Certificate Is Expired") - -ResDef(XP_ASKUSER, (SEC_DIALOG_STRING_BASE + 270), "\ -Ask every time") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_PICKAUTO, (SEC_DIALOG_STRING_BASE + 271), "\ -Let "MOZ_NAME_PRODUCT" choose automatically") -#else -ResDef(XP_PICKAUTO, (SEC_DIALOG_STRING_BASE + 271), "\ -Let Communicator choose automatically") -#endif - -ResDef(XP_HIGH_GRADE, (SEC_DIALOG_STRING_BASE + 272), "\ -1024 (High Grade)") - -ResDef(XP_MEDIUM_GRADE, (SEC_DIALOG_STRING_BASE + 273), "\ - 768 (Medium Grade)") - -ResDef(XP_LOW_GRADE, (SEC_DIALOG_STRING_BASE + 274), "\ - 512 (Low Grade)") - -ResDef(XP_VIEW_CERT_POLICY, (SEC_DIALOG_STRING_BASE + 275), "\ -View Certificate Policy") - -ResDef(XP_CHECK_CERT_STATUS, (SEC_DIALOG_STRING_BASE + 276), "\ -Check Certificate Status") - -ResDef(XP_SSL2_RC4_128, (SEC_DIALOG_STRING_BASE + 277), "\ -RC4 encryption with a 128-bit key") - -ResDef(XP_SSL2_RC2_128, (SEC_DIALOG_STRING_BASE + 278), "\ -RC2 encryption with a 128-bit key") - -ResDef(XP_SSL2_DES_192_EDE3, (SEC_DIALOG_STRING_BASE + 279), "\ -Triple DES encryption with a 168-bit key") - -ResDef(XP_SSL2_DES_64, (SEC_DIALOG_STRING_BASE + 280), "\ -DES encryption with a 56-bit key") - -ResDef(XP_SSL2_RC4_40, (SEC_DIALOG_STRING_BASE + 281), "\ -RC4 encryption with a 40-bit key") - -ResDef(XP_SSL2_RC2_40, (SEC_DIALOG_STRING_BASE + 282), "\ -RC2 encryption with a 40-bit key") - -ResDef(XP_SSL3_RSA_RC4_128_MD5, (SEC_DIALOG_STRING_BASE + 283), "\ -RC4 encryption with a 128-bit key and an MD5 MAC") - -ResDef(XP_SSL3_RSA_3DES_SHA, (SEC_DIALOG_STRING_BASE + 284), "\ -Triple DES encryption with a 168-bit key and a SHA-1 MAC") - -ResDef(XP_SSL3_RSA_DES_SHA, (SEC_DIALOG_STRING_BASE + 285), "\ -DES encryption with a 56-bit key and a SHA-1 MAC") - -ResDef(XP_SSL3_RSA_RC4_40_MD5, (SEC_DIALOG_STRING_BASE + 286), "\ -RC4 encryption with a 40-bit key and an MD5 MAC") - -ResDef(XP_SSL3_RSA_RC2_40_MD5, (SEC_DIALOG_STRING_BASE + 287), "\ -RC2 encryption with a 40-bit key and an MD5 MAC") - -ResDef(XP_SSL3_RSA_NULL_MD5, (SEC_DIALOG_STRING_BASE + 288), "\ -No encryption with an MD5 MAC") - -ResDef(XP_DIALOG_SHOW_CRLS, (SEC_DIALOG_STRING_BASE + 289), "\ -

CRL List:

\ -
\ -%-cont-%") - -ResDef(XP_DIALOG_SHOW_CRLS_1, (SEC_DIALOG_STRING_BASE + 290), "\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_SHOW_CRLS_2, (SEC_DIALOG_STRING_BASE + 291), "\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_SHOW_CRLS_3, (SEC_DIALOG_STRING_BASE + 292), "\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_SHOW_CRLS_4, (SEC_DIALOG_STRING_BASE + 293), "\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_SHOW_CRLS_5, (SEC_DIALOG_STRING_BASE + 294), "\ -
") - -ResDef(XP_SEC_NEW, (SEC_DIALOG_STRING_BASE + 295), "New/Edit ...") - -ResDef(XP_SEC_RELOAD, (SEC_DIALOG_STRING_BASE + 296), "\ -Reload") - -ResDef(XP_SEC_DELETE, (SEC_DIALOG_STRING_BASE + 297), "\ -Delete") - -ResDef(XP_SSL3_RSA_FIPS_3DES_SHA, (SEC_DIALOG_STRING_BASE + 298), "\ -FIPS 140-1 compliant triple DES encryption and SHA-1 MAC") - -ResDef(XP_SSL3_RSA_FIPS_DES_SHA, (SEC_DIALOG_STRING_BASE + 299), "\ -FIPS 140-1 compliant DES encryption and SHA-1 MAC") - -ResDef(XP_DIALOG_EDIT_MODULE_TITLE, (SEC_DIALOG_STRING_BASE + 307), "\ -Edit Security Module") - -ResDef(XP_DIALOG_NEW_MODULE_TITLE, (SEC_DIALOG_STRING_BASE + 308), "\ -Create a New Security Module") - -/* Ciphers */ -ResDef(XP_SSL3_FORTEZZA_SHA, (SEC_DIALOG_STRING_BASE + 309), "\ -FORTEZZA encryption with a 80-bit key and an SHA-1 MAC") - -ResDef(XP_SSL3_FORTEZZA_RC4_SHA, (SEC_DIALOG_STRING_BASE + 310), "\ -FORTEZZA authentication with RC4 128-bit key and an SHA-1 MAC") - -ResDef(XP_SSL3_FORTEZZA_NULL_SHA, (SEC_DIALOG_STRING_BASE + 311), "\ -No encryption with FORTEZZA authentication and an SHA-1 MAC") - - -ResDef(XP_SEC_ENTER_PWD, (SEC_DIALOG_STRING_BASE + 312), "\ -Please enter the password or the pin for\n\ -%s.") - -ResDef(XP_SSO_GET_PW_STRINGS, (SEC_DIALOG_STRING_BASE + 313), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The %1% has not been initialized with a User PIN or Password. In order \ -%-cont-%") - -ResDef(XP_SSO_GET_PW_STRINGS_1, (SEC_DIALOG_STRING_BASE + 314), "\ -to initialize this card, you must enter the Administration or Site Security \ -Password. If you do not know this password, please hit cancel, and \ -%-cont-%") - -ResDef(XP_SSO_GET_PW_STRINGS_2, (SEC_DIALOG_STRING_BASE + 315), "\ -take this card back to your issuer to be initialized.

Enter adminstration \ -Password for the %2%:.") - -ResDef(XP_PW_RETRY_SSO_STRINGS, (SEC_DIALOG_STRING_BASE + 316), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The administration password you entered for the %1% was incorrect. \ -%-cont-%") - -ResDef(XP_PW_RETRY_SSO_STRINGS_1, (SEC_DIALOG_STRING_BASE + 317), "\ -Many cards disable themselves after too many incorrect password attempts. \ -If you do not know this password, please hit cancel, and take this card \ -%-cont-%") - -ResDef(XP_PW_RETRY_SSO_STRINGS_2, (SEC_DIALOG_STRING_BASE + 318), "\ -back to your issuer to be initialized.

Enter adminstration Password for \ -the %2%:.") - -ResDef(XP_PW_SETUP_SSO_FAIL_STRINGS, (SEC_DIALOG_STRING_BASE + 319), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -The %1% could not be initialized because of the following error:

\ -%2%") - -ResDef(XP_SEC_EDIT, (SEC_DIALOG_STRING_BASE + 320), "\ -Edit Defaults...") - -ResDef(XP_SEC_LOGIN, (SEC_DIALOG_STRING_BASE + 321), "\ -Login") - -ResDef(XP_SEC_LOGOUT, (SEC_DIALOG_STRING_BASE + 322), "\ -Logout") - -ResDef(XP_SECURITY_ADVISOR, (SEC_DIALOG_STRING_BASE + 323), "\ -%0%%1%%2%%3%%4%%5%") - -ResDef(XP_SECURITY_ADVISOR_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 324), "\ -Security Info") - -ResDef(XP_SEC_SETPASSWORD, (SEC_DIALOG_STRING_BASE + 325), "\ -Set Password...") - -ResDef(XP_SEC_NO_LOGIN_NEEDED, (SEC_DIALOG_STRING_BASE + 326), "\ -Slot or Token does not require a login.") - -ResDef(XP_SEC_ALREADY_LOGGED_IN, (SEC_DIALOG_STRING_BASE + 327), "\ -Slot or Token is already logged in.") - -ResDef(XP_KEY_GEN_TOKEN_SELECT, (SEC_DIALOG_STRING_BASE + 328), "\ -

Select the card or database you wish to generate your key in:\ - %1% \ -%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_2, (SEC_DIALOG_STRING_BASE + 341), "\ - %-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_3, (SEC_DIALOG_STRING_BASE + 342), "\ -\ -%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_4, (SEC_DIALOG_STRING_BASE + 343), "\ - \ - \ -%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_5, (SEC_DIALOG_STRING_BASE + 344), "\ -
For this session only:
%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_6, (SEC_DIALOG_STRING_BASE + 345), "\ -\ -
%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_7, (SEC_DIALOG_STRING_BASE + 346), "\ - \ - \ -%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_8, (SEC_DIALOG_STRING_BASE + 347), "\ -
Never:
%-cont-%") - -ResDef(XP_EDIT_JAVA_PRIVILEGES_STRINGS_9, (SEC_DIALOG_STRING_BASE + 348), "\ -\ -
") - -ResDef(XP_DELETE_JAVA_PRIV_STRINGS, (SEC_DIALOG_STRING_BASE + 349), "\ -Are you sure that you want to delete the %0% privileges for \ -all applets and scripts from %1%?") - -ResDef(XP_MOREINFO_JAVA_PRIV_STRINGS, (SEC_DIALOG_STRING_BASE + 350), "\ - %0% is a %1% access.
\ -

    It consists of:
") - -/* 0 is cert name, 1 risk, 2 targets, 3 view cert button - */ -ResDef(XP_SIGNED_CERT_PRIV_STRINGS, (SEC_DIALOG_STRING_BASE + 351), "\ - \ -%-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_1, (SEC_DIALOG_STRING_BASE + 352), "\ - \ - \ -%-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_4, (SEC_DIALOG_STRING_BASE + 355), "\ -
Danger \ -
A Java applet or JavaScript script from \ -%0% is requesting unusual access to your computer or network. \ -%-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_2, (SEC_DIALOG_STRING_BASE + 353), "\ -You should not grant this access unless you trust that vendor or \ -distributor.
\ - \ -%-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_3, (SEC_DIALOG_STRING_BASE + 354), "\ -
The access requested is %1% \ -and consists of:
\ - \ -
\ -
\ -%-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_5, (SEC_DIALOG_STRING_BASE + 356), "\ -
Do you wish to grant the requested access? \ -
\ -Yes, grant this access to all applets and scripts from %0% for this \ -session %-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_6, (SEC_DIALOG_STRING_BASE + 357), "\ -
No, deny this access (This may mean the applet \ -or script cannot work properly) \ -%-cont-%") - -ResDef(XP_SIGNED_CERT_PRIV_STRINGS_7, (SEC_DIALOG_STRING_BASE + 358), "\ -
\ -Remember this decision for all applets and scripts from %0%
\ -") - -/* 0 is cert name, 1 risk, 2 targets. - */ -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS, (SEC_DIALOG_STRING_BASE + 359), "\ - \ -%-cont-%") - -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS_1, (SEC_DIALOG_STRING_BASE + 360), "\ - \ - \ -%-cont-%") - -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS_3, (SEC_DIALOG_STRING_BASE + 362), "\ -
Danger \ -
A Java applet or JavaScript script on the \ -server \042%0%\042 is requesting unusual access to your computer \ -or network. %-cont-%") - -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS_2, (SEC_DIALOG_STRING_BASE + 361), "\ -It is not digitally signed. Be aware that it may have been \ -tampered with and may cause harm to your computer.
The access requested is %1% \ -and consists of:
\ - \ -
\ -
\ -%-cont-%") - -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS_4, (SEC_DIALOG_STRING_BASE + 363), "\ -
Do you wish to grant the requested access? \ -
\ -Yes, grant this access to all applets and scripts on the \042%0%\042 \ -server for this session \ -%-cont-%") - -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS_5, (SEC_DIALOG_STRING_BASE + 364), "\ -
No, deny this access (This may mean the applet \ -or script cannot work properly) \ -%-cont-%") - -ResDef(XP_SIGNED_APPLET_PRIV_STRINGS_6, (SEC_DIALOG_STRING_BASE + 365), "\ -
\ -Remember this decision for all applets and scripts on the \042%0%\042 \ -server
") - -ResDef(XP_DIALOG_NEW_MODULE, (SEC_DIALOG_STRING_BASE + 366), "\ -Security Module Name:
\ -Security Module File:
") - -ResDef(XP_SEC_MODULE_NO_LIB, (SEC_DIALOG_STRING_BASE + 367), "\ -You must specify a PKCS #11 Version 2.0 library to load\n") - -ResDef(XP_DIALOG_SLOT_INFO, (SEC_DIALOG_STRING_BASE + 368), "\ -Slot Description: %0%
Manufacturer: %1%
\ -Version Number: %2%
Firmware Version: %3%
\ -%-cont-%") - -ResDef(XP_DIALOG_SLOT_INFO_1, (SEC_DIALOG_STRING_BASE + 369), "\ -%4%Token Name: %5%
Token Manufacturer:%6%
\ -Token Model: %7%
Token Serial Number:%8%
\ -%-cont-%") - -ResDef(XP_DIALOG_SLOT_INFO_2, (SEC_DIALOG_STRING_BASE + 370), "\ -Token Version: %9%
Token Firmware Version: %10%
\ -Login Type: %11%
State:%12%%13%%14%") - -ResDef(XP_DIALOG_SLOT_INFO_TITLE, (SEC_DIALOG_STRING_BASE + 371), "\ -Token/Slot Information") - -ResDef(XP_SLOT_LOGIN_REQUIRED, (SEC_DIALOG_STRING_BASE + 372), "\ -Login Required") - -ResDef(XP_SLOT_NO_LOGIN_REQUIRED, (SEC_DIALOG_STRING_BASE + 373), "\ -Public (no login required)") - -ResDef(XP_SLOT_READY, (SEC_DIALOG_STRING_BASE + 374), "\ -Ready") - -ResDef(XP_SLOT_NOT_LOGGED_IN, (SEC_DIALOG_STRING_BASE + 375), "\ -Not Logged In") - -ResDef(XP_SLOT_UNITIALIZED, (SEC_DIALOG_STRING_BASE + 376), "\ -Uninitialized") - -ResDef(XP_SLOT_NOT_PRESENT, (SEC_DIALOG_STRING_BASE + 377), "\ -Not Present") - -ResDef(XP_SLOT_DISABLED, (SEC_DIALOG_STRING_BASE + 378), "\ -Disabled(") - -ResDef(XP_SLOT_DISABLED_2, (SEC_DIALOG_STRING_BASE + 379), "\ -)") - -ResDef(XP_SLOT_PASSWORD_INIT, (SEC_DIALOG_STRING_BASE + 380), "\ - Initialize Token") - -ResDef(XP_SLOT_PASSWORD_CHANGE, (SEC_DIALOG_STRING_BASE + 381), "\ - Change Password ") - -ResDef(XP_SLOT_PASSWORD_SET, (SEC_DIALOG_STRING_BASE + 382), "\ - Set Password ") - -ResDef(XP_SLOT_PASSWORD_NO, (SEC_DIALOG_STRING_BASE + 383), "\ - No Password ") - -ResDef(XP_DOWNLOAD_EMAIL_CERT_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 384), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -You are downloading the e-mail certificate of another user. After accepting \ -%-cont-%") - -ResDef(XP_DOWNLOAD_EMAIL_CERT_DIALOG_STRINGS_1, (SEC_DIALOG_STRING_BASE + 385), "\ -this certificate you will be able to send encrypted e-mail to this user. \ -Press the More Info button to see details of the e-mail certificate. \ -%-cont-%") - -ResDef(XP_DOWNLOAD_EMAIL_CERT_DIALOG_STRINGS_2, (SEC_DIALOG_STRING_BASE + 386), "\ -
\ -\ -
Certificate For:\ -%-cont-%") - -ResDef(XP_DOWNLOAD_EMAIL_CERT_DIALOG_STRINGS_3, (SEC_DIALOG_STRING_BASE + 387), "\ -%1%
\ -Email Address:%2%
\ -%-cont-%") - -ResDef(XP_DOWNLOAD_EMAIL_CERT_DIALOG_STRINGS_4, (SEC_DIALOG_STRING_BASE + 388), "\ -Certified By:%3%
\ -\ -

") - -ResDef(XP_EMAIL_CERT_DOWNLOAD_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 389), "\ -Download an E-Mail Certificate") - -ResDef(XP_CA_CERT_SSL_OK_STRING, (SEC_DIALOG_STRING_BASE + 390), "\ -Accept this Certificate Authority for Certifying network sites") - -ResDef(XP_CA_CERT_EMAIL_OK_STRING, (SEC_DIALOG_STRING_BASE + 391), "\ -Accept this Certificate Authority for Certifying e-mail users") - -ResDef(XP_CA_CERT_OBJECT_SIGNING_OK_STRING, (SEC_DIALOG_STRING_BASE + 392), "\ -Accept this Certificate Authority for Certifying software developers") - -ResDef(XP_CERT_MULTI_SUBJECT_SELECT_STRING, (SEC_DIALOG_STRING_BASE + 393), "\ -%0%

%1%") - -ResDef(XP_CERT_MULTI_SUBJECT_SELECT_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 394), "\ -Select A Certificate") - -ResDef(XP_CERT_SELECT_EDIT_STRING, (SEC_DIALOG_STRING_BASE + 395), "\ -Please select a certificate to edit:

") - -ResDef(XP_CERT_SELECT_DEL_STRING, (SEC_DIALOG_STRING_BASE + 396), "\ -Please select a certificate to delete:

") - -ResDef(XP_CERT_SELECT_VIEW_STRING, (SEC_DIALOG_STRING_BASE + 397), "\ -Please select a certificate to view:

") - -ResDef(XP_CERT_SELECT_VERIFY_STRING, (SEC_DIALOG_STRING_BASE + 398), "\ -Please select a certificate to verify:

") - -ResDef(XP_DEL_EMAIL_CERT_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 399), "\ -Delete An E-mail Certificate") - -ResDef(XP_DELETE_EMAIL_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 400), "\ -Are you sure that you want to delete this E-mail Certificate?

%0%") - -ResDef(XP_SET_EMAIL_CERT_STRING, (SEC_DIALOG_STRING_BASE + 401), "\ - \ -Make this the default Certificate for signed and encrypted e-mail") - -/* - * NOTE to Translators: The following strings are part of a PKCS #11 standard - * they must be exactly 32 bytes long (space padded). If they are not, - * Communicator will revert to it's old strings */ -ResDef(SEC_PK11_MANUFACTURER, (SEC_DIALOG_STRING_BASE + 402), "\ -"MOZ_NAME_COMPANY" ") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_PK11_LIBARARY, (SEC_DIALOG_STRING_BASE + 403), "\ -"MOZ_NAME_PRODUCT" Internal Crypto Svc ") -#else -ResDef(SEC_PK11_LIBARARY, (SEC_DIALOG_STRING_BASE + 403), "\ -Communicator Internal Crypto Svc") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_PK11_TOKEN, (SEC_DIALOG_STRING_BASE + 404), "\ -"MOZ_NAME_PRODUCT" Generic Crypto Svcs ") -#else -ResDef(SEC_PK11_TOKEN, (SEC_DIALOG_STRING_BASE + 404), "\ -Communicator Generic Crypto Svcs") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_PK11_PRIV_TOKEN, (SEC_DIALOG_STRING_BASE + 405), "\ -"MOZ_NAME_PRODUCT" Certificate DB ") -#else -ResDef(SEC_PK11_PRIV_TOKEN, (SEC_DIALOG_STRING_BASE + 405), "\ -Communicator Certificate DB ") -#endif - -/* - * NOTE to Translators: The following strings are part of a PKCS #11 standard - * they must be exactly 64 bytes long (space padded). If they are not, - * Communicator will revert to it's old strings */ -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_PK11_SLOT, (SEC_DIALOG_STRING_BASE + 406), "\ -"MOZ_NAME_PRODUCT" Internal Cryptographic Services Version 4.0 ") -#else -ResDef(SEC_PK11_SLOT, (SEC_DIALOG_STRING_BASE + 406), "\ -Communicator Internal Cryptographic Services Version 4.0 ") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(SEC_PK11_PRIV_SLOT, (SEC_DIALOG_STRING_BASE + 407), "\ -"MOZ_NAME_PRODUCT" User Private Key and Certificate Services ") -#else -ResDef(SEC_PK11_PRIV_SLOT, (SEC_DIALOG_STRING_BASE + 407), "\ -Communicator User Private Key and Certificate Services ") -#endif - -ResDef(SEC_PK11_FIPS_SLOT, (SEC_DIALOG_STRING_BASE + 408), "\ -"MOZ_NAME_BRAND" Internal FIPS-140-1 Cryptographic Services ") - -ResDef(SEC_PK11_FIPS_PRIV_SLOT, (SEC_DIALOG_STRING_BASE + 409), "\ -"MOZ_NAME_BRAND" FIPS-140-1 User Private Key Services ") - -ResDef(XP_VERIFY_CERT_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 410), "\ -Verification of the selected certificate failed for the following \ -reasons:

%0%") - -ResDef(XP_VERIFYCERT_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 411), "\ -Verify A Certificate") - -ResDef(XP_VERIFY_CERT_OK_DIALOG_STRING, (SEC_DIALOG_STRING_BASE + 412), "\ -The Certificate has been successfully verified.") - -ResDef(XP_VERIFY_ERROR_EXPIRED, (SEC_DIALOG_STRING_BASE + 413), "\ -Certificate has expired") - -ResDef(XP_VERIFY_ERROR_NOT_CERTIFIED, (SEC_DIALOG_STRING_BASE + 414), "\ -Not certified for %s") - -ResDef(XP_VERIFY_ERROR_NOT_TRUSTED, (SEC_DIALOG_STRING_BASE + 415), "\ -Certificate not trusted") - -ResDef(XP_VERIFY_ERROR_NO_CA, (SEC_DIALOG_STRING_BASE + 416), "\ -Unable to find Certificate Authority") - -ResDef(XP_VERIFY_ERROR_BAD_SIG, (SEC_DIALOG_STRING_BASE + 417), "\ -Certificate signature is invalid") - -ResDef(XP_VERIFY_ERROR_BAD_CRL, (SEC_DIALOG_STRING_BASE + 418), "\ -Certificate Revocation List is invalid") - -ResDef(XP_VERIFY_ERROR_REVOKED, (SEC_DIALOG_STRING_BASE + 419), "\ -Certificate has been revoked") - -ResDef(XP_VERIFY_ERROR_NOT_CA, (SEC_DIALOG_STRING_BASE + 420), "\ -Not a valid Certificate Authority") - -ResDef(XP_VERIFY_ERROR_INTERNAL_ERROR, (SEC_DIALOG_STRING_BASE + 421), "\ -Internal Error") - -ResDef(XP_VERIFY_ERROR_SIGNING, (SEC_DIALOG_STRING_BASE + 422), "\ -Digital Signing") - -ResDef(XP_VERIFY_ERROR_ENCRYPTION, (SEC_DIALOG_STRING_BASE + 423), "\ -Encryption") - -ResDef(XP_VERIFY_ERROR_CERT_SIGNING, (SEC_DIALOG_STRING_BASE + 424), "\ -Certificate Signing") - -ResDef(XP_VERIFY_ERROR_CERT_UNKNOWN_USAGE, (SEC_DIALOG_STRING_BASE + 425), "\ -Unknown Usage") - -ResDef(XP_VERIFY_ERROR_EMAIL_CA, (SEC_DIALOG_STRING_BASE + 426), "\ -E-Mail Certification") - -ResDef(XP_VERIFY_ERROR_SSL_CA, (SEC_DIALOG_STRING_BASE + 427), "\ -Internet Site Certification") - -ResDef(XP_VERIFY_ERROR_OBJECT_SIGNING_CA, (SEC_DIALOG_STRING_BASE + 428), "\ -Software Developer Certification") - -ResDef(XP_VERIFY_ERROR_EMAIL, (SEC_DIALOG_STRING_BASE + 429), "\ -E-Mail") - -ResDef(XP_VERIFY_ERROR_SSL, (SEC_DIALOG_STRING_BASE + 430), "\ -Internet Site") - -ResDef(XP_VERIFY_ERROR_OBJECT_SIGNING, (SEC_DIALOG_STRING_BASE + 431), "\ -Software Developer") - -ResDef(XP_DIALOG_NULL_STRINGS, (SEC_DIALOG_STRING_BASE + 432), "\ -%0%") - -ResDef(XP_FIPS_MESSAGE_1, (SEC_DIALOG_STRING_BASE + 433), "\ -This will replace the "MOZ_NAME_PRODUCT" internal module with the "MOZ_NAME_PRODUCT" FIPS-140-1 \ -cryptographic module.\n\nThe FIPS-140-1 cryptographic module limits security ") - -ResDef(XP_FIPS_MESSAGE_2, (SEC_DIALOG_STRING_BASE + 434), "\ -functions to those approved by the United States Federal Government's internal \ -standards.\n\nDo you wish to delete the internal module, anyway?") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_INT_MODULE_MESSAGE_1, (SEC_DIALOG_STRING_BASE + 435), "\ -This will replace the FIPS-140-1 cryptographic module with the "MOZ_NAME_PRODUCT" \ -internal module.\n\nThis means that "MOZ_NAME_PRODUCT" will no longer be FIPS-140-1 \ -compliant (security ") -#else -ResDef(XP_INT_MODULE_MESSAGE_1, (SEC_DIALOG_STRING_BASE + 435), "\ -This will replace the FIPS-140-1 cryptographic module with the "MOZ_NAME_PRODUCT" \ -internal module.\n\nThis means that Communicator will no longer be FIPS-140-1 \ -compliant (security ") -#endif - -ResDef(XP_INT_MODULE_MESSAGE_2, (SEC_DIALOG_STRING_BASE + 436), "\ -functions to those approved by the United States Federal Government's internal \ -standards).\n\nDo you wish to delete the FIPS-140-1 module, anyway?") - -ResDef(XP_SEC_FETCH, (SEC_DIALOG_STRING_BASE + 437), "\ -Search") - -ResDef(XP_DIALOG_FETCH_TITLE, (SEC_DIALOG_STRING_BASE + 438), "\ -Search Directory for Certificates") - -ResDef(XP_DIALOG_FETCH_CANCEL_BUTTON_STRINGS, (SEC_DIALOG_STRING_BASE + 439), "\ -

  %0%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_DIALOG_FETCH_STRINGS, (SEC_DIALOG_STRING_BASE + 440), "\ -"MOZ_NAME_PRODUCT" will search network Directories for the Security Certificates \ -that are used to send other people encrypted mail messages.

Enter the exact E-mail \ -%-cont-%") -#else -ResDef(XP_DIALOG_FETCH_STRINGS, (SEC_DIALOG_STRING_BASE + 440), "\ -Communicator will search network Directories for the Security Certificates \ -that are used to send other people encrypted mail messages.

Enter the exact E-mail \ -%-cont-%") -#endif - -ResDef(XP_DIALOG_FETCH_STRINGS2, (SEC_DIALOG_STRING_BASE + 441), "\ -addresses of the people you are looking for and press Search. \ -\ -\ -\ -\ -%-cont-%") - -ResDef(XP_DIALOG_FETCH_STRINGS4, (SEC_DIALOG_STRING_BASE + 443), "\ -\ -\ -\ -\ -
Directory:
E-mail Addresses:
") - -ResDef(XP_DIALOG_ALL_DIRECTORIES, (SEC_DIALOG_STRING_BASE + 444), "\ -All Directories") - -ResDef(XP_DIALOG_FETCH_RESULTS_TITLE, (SEC_DIALOG_STRING_BASE + 445), "\ -Search Results") - -ResDef(XP_DIALOG_FETCH_RESULTS_STRINGS, (SEC_DIALOG_STRING_BASE + 446), "\ -Press the %ok% button to save the Certificates that were found, or \ -%cancel% to discard them.

\ -Certificates for the following E-Mail users were found in the \ -directory:
\ -%0%

%1%%2%") - -ResDef(XP_DIALOG_FETCH_NOT_FOUND_STRINGS, (SEC_DIALOG_STRING_BASE + 447), "\ -Certificates for the following E-Mail users were not found in the \ -directory:
") - -ResDef(XP_DIALOG_PUBLISH_CERT_TITLE, (SEC_DIALOG_STRING_BASE + 448), "\ -Send Your E-Mail Certificate To A Directory") - -ResDef(XP_DIALOG_PUBLISH_CERT_STRINGS, (SEC_DIALOG_STRING_BASE + 449), "\ -Select the Directory to send your \ -Certificate to:

\ -
\ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_DIALOG_PUBLISH_CERT_STRINGS2, (SEC_DIALOG_STRING_BASE + 450), "\ -"MOZ_NAME_PRODUCT" will send your Security Certificate to a network Directory \ -so that other user's can easily find it to send you \ -encrypted messages.") -#else -ResDef(XP_DIALOG_PUBLISH_CERT_STRINGS2, (SEC_DIALOG_STRING_BASE + 450), "\ -Communicator will send your Security Certificate to a network Directory \ -so that other user's can easily find it to send you \ -encrypted messages.") -#endif - -ResDef(XP_STATUS_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 451), "\ -%0%%1%%2%%3%%4%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_DIALOG_FETCH2_STRINGS, (SEC_DIALOG_STRING_BASE + 452), "\ -"MOZ_NAME_PRODUCT" will search a Directory for the Security \ -Certificates that are needed to send this encrypted message. \ -%-cont-%") -#else -ResDef(XP_DIALOG_FETCH2_STRINGS, (SEC_DIALOG_STRING_BASE + 452), "\ -Communicator will search a Directory for the Security \ -Certificates that are needed to send this encrypted message. \ -%-cont-%") -#endif - -ResDef(XP_DIALOG_FETCH2_STRINGS2, (SEC_DIALOG_STRING_BASE + 453), "\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -
Select a Directory:
Searching For:%2%
") - -ResDef(XP_SENDING_TO_DIRECTORY, (SEC_DIALOG_STRING_BASE + 455), "\ -Sending to Directory") - -ResDef(XP_SEARCHING_DIRECTORY, (SEC_DIALOG_STRING_BASE + 456), "\ -Searching Directory") - -ResDef(XP_DIRECTORY_PASSWORD, (SEC_DIALOG_STRING_BASE + 457), "\ -Enter Password for Directory") - -ResDef(XP_DIRECTORY_ERROR, (SEC_DIALOG_STRING_BASE + 458), "\ -An error occurred when communicating with the Directory") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_KEY_GEN_MOREINFO_STRINGS, (SEC_DIALOG_STRING_BASE + 459), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -"MOZ_NAME_PRODUCT" is about to generate a Private Key for you. It will be used \ -along with the Certificate you are now \ -%-cont-%") -#else -ResDef(XP_KEY_GEN_MOREINFO_STRINGS, (SEC_DIALOG_STRING_BASE + 459), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Communicator is about to generate a Private Key for you. It will be used \ -along with the Certificate you are now \ -%-cont-%") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_1, (SEC_DIALOG_STRING_BASE + 460), "\ -requesting to identify you to Web\ -Sites and via Email. You Private Key never leaves your computer, and if you \ -choose, will be protected by a "MOZ_NAME_PRODUCT" password.

\ -%-cont-%") -#else -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_1, (SEC_DIALOG_STRING_BASE + 460), "\ -requesting to identify you to Web\ -Sites and via Email. You Private Key never leaves your computer, and if you \ -choose, will be protected by a Communicator password.

\ -%-cont-%") -#endif - -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_2, (SEC_DIALOG_STRING_BASE + 461), "\ -Passwords are particularly important if you are in an environment where other \ -people have access to your computer, either physically or over a network. \ -%-cont-%") - -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_3, (SEC_DIALOG_STRING_BASE + 462), "\ -Do not give others your password, because that would allow them to use your \ -Certificate to impersonate you.

\ -%-cont-%") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_4, (SEC_DIALOG_STRING_BASE + 463), "\ -"MOZ_NAME_PRODUCT" uses a complex mathematical operation to generate your private \ -key. It may take up to severeal minutes to complete. If you interrupt \ -%-cont-%") -#else -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_4, (SEC_DIALOG_STRING_BASE + 463), "\ -Communicator uses a complex mathematical operation to generate your private \ -key. It may take up to severeal minutes to complete. If you interrupt \ -%-cont-%") -#endif - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_5, (SEC_DIALOG_STRING_BASE + 464), "\ -"MOZ_NAME_PRODUCT" during this process, it will not create your key, and you will \ -have to reapply for your Certificate.") -#else -ResDef(XP_KEY_GEN_MOREINFO_STRINGS_5, (SEC_DIALOG_STRING_BASE + 464), "\ -Communicator during this process, it will not create your key, and you will \ -have to reapply for your Certificate.") -#endif - -ResDef(XP_PW_MOREINFO_STRINGS, (SEC_DIALOG_STRING_BASE + 465), "\ -%sec-banner-begin%%0%%sec-banner-end%\ -Passwords are particularly important if you are in an environment where other \ -%-cont-%") - -ResDef(XP_PW_MOREINFO_STRINGS_1, (SEC_DIALOG_STRING_BASE + 466), "\ -people have access to your computer, either physically or over a network. \ -Do not give others your password, because that would allow them to use your \ -%-cont-%") - -ResDef(XP_PW_MOREINFO_STRINGS_2, (SEC_DIALOG_STRING_BASE + 467), "\ -Certificate to impersonate you.

The safest passwords are at least 8 \ -characters long, include both letters, and number or symbols, and contain \ -no words found in a dictionary.") - -ResDef(XP_PKCS12_TITLE_STRING, (SEC_DIALOG_STRING_BASE + 468), "\ -Select a Card or Database") - -ResDef(XP_PKCS12_SELECT_DIALOG_STRINGS, (SEC_DIALOG_STRING_BASE + 469), "\ -Select the card or database you wish to import certificates to:
\ -") - -ResDef(XP_VERIFY_NOT_FORTEZZA_CA, (SEC_DIALOG_STRING_BASE + 470), "\ -Not a valid FORTEZZA Certificate Authority") - -ResDef(XP_VERIFY_NO_PUBLIC_KEY, (SEC_DIALOG_STRING_BASE + 471), "\ -Certificate does not have a Recognized Public Key") - -#ifdef XP_MAC -ResDef(XP_PREENC_SAVE_PROMPT, (SEC_DIALOG_STRING_BASE + 472), "\ -Save this file encrypted [yes] or unencrypted [no]") -#else -ResDef(XP_PREENC_SAVE_PROMPT, (SEC_DIALOG_STRING_BASE + 472), "\ -Save this file encrypted [ok] or unencrypted [cancel]") -#endif - -ResDef(XP_SEC_ERROR_PWD, (SEC_DIALOG_STRING_BASE + 473), "\ -Successive login failures may disable this card or database. \ -Password is invalid. Retry?\n\ - %s\n") - -ResDef(XP_VERIFY_NO_KRL, (SEC_DIALOG_STRING_BASE + 474), -"No key revocation list for the certificate has been found.\n\ -You must load the key revocation list before continuing.") - -ResDef(XP_VERIFY_KRL_EXPIRED, (SEC_DIALOG_STRING_BASE + 475), -"The key revocation list for the certificate has expired.\n\ -Reload a new key revocation list.") - -ResDef(XP_VERIFY_KRL_BAD_SIGNATURE, (SEC_DIALOG_STRING_BASE + 476), -"The key revocation list for the certificate has an invalid signature.\n\ -Reload a new key revocation list.") - -ResDef(XP_VERIFY_REVOKED_KEY, (SEC_DIALOG_STRING_BASE + 477), -"The key for the certificate has been revoked.") - -ResDef(XP_VERIFY_KRL_INVALID, (SEC_DIALOG_STRING_BASE + 478), -"The key revocation list has an invalid format.") - -ResDef(XP_VERIFY_BAD_CERT_DOMAIN, (SEC_DIALOG_STRING_BASE + 479), -MOZ_NAME_BRAND" is unable to communicate securely with this site\n\ -because the domain to which you are attempting to connect\n\ -does not match the domain name in the server's certificate.") - -/* Fortezza SMIME strings */ -ResDef(XP_SMIME_SKIPJACK, (SEC_DIALOG_STRING_BASE + 480), "\ -FORTEZZA SKIPJACK encryption with an 80-bit key") - -/* New Security Advisor->Crypto Modules->Edit menu */ -ResDef(XP_DIALOG_EDIT_MODULE, (SEC_DIALOG_STRING_BASE + 481), "\ -Security Module Name: %0%\ -
\ -Security Module File: %3%\ -
\ -%-cont-%") - -ResDef(XP_DIALOG_EDIT_MODULE_0, (SEC_DIALOG_STRING_BASE + 482), "\ -Manufacturer: %6%
Description:%8%
\ -PKCS #11 Version: %7%
\ -Library Version: %9%
%-cont-%") - -ResDef(XP_DIALOG_EDIT_MODULE_1, (SEC_DIALOG_STRING_BASE + 483), "\ -

\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_EDIT_MODULE_2, (SEC_DIALOG_STRING_BASE + 484), "\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_EDIT_MODULE_3, (SEC_DIALOG_STRING_BASE + 485), "\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_EDIT_MODULE_4, (SEC_DIALOG_STRING_BASE + 486), "\ -\ -
\ -\ -
%-cont-%") - -ResDef(XP_DIALOG_EDIT_MODULE_5, (SEC_DIALOG_STRING_BASE + 487), "\ -
") - - ResDef(XP_SEC_CONFIG, (SEC_DIALOG_STRING_BASE + 491), "\ - Config") - - /* Config Slot/Token */ - - ResDef(XP_DIALOG_CONFIG_SLOT, (SEC_DIALOG_STRING_BASE + 492), "\ -

Module Name: %0%\ -
Slot Description: %1%\ -
Token Name: %2%\ -
Remarks: %3%


\ - %-cont-%") - - ResDef(XP_DIALOG_CONFIG_SLOT_0, (SEC_DIALOG_STRING_BASE + 493), "\ -

\ -

\ - Disable this token. \ - %-cont-%") - - ResDef(XP_DIALOG_CONFIG_SLOT_1, (SEC_DIALOG_STRING_BASE + 494), "\ -

\ -

\ -
\ - Enable this token and turn on the following functions: \ - %6%\ -
") - - - /* display this if try to configure a slot w/o token */ - ResDef(XP_DIALOG_CONFIG_SLOT_NO_SLOT, (SEC_DIALOG_STRING_BASE + 495), "\ -

Module Name: %0%\ -
Slot Description: %1%\ -
Token Name: %2%\ -


\ - %-cont-%") - - ResDef(XP_DIALOG_CONFIG_SLOT_NO_SLOT_0, (SEC_DIALOG_STRING_BASE + 496), "\ -

\ - %3%
%4%
%5%\ -

") - - ResDef(XP_DIALOG_CONFIG_SLOT_TITLE, (SEC_DIALOG_STRING_BASE + 497), "\ - Configure Slot") - - /* define prompts for lm_pkcs11.c */ - /* squeezed in this space */ - ResDef(XP_JS_PKCS11_MOD_PROMPT, (SEC_DIALOG_STRING_BASE + 498), "Module Name: ") - ResDef(XP_JS_PKCS11_DLL_PROMPT, (SEC_DIALOG_STRING_BASE + 499), "File: ") - - - /* some Mechanism Type labels */ - ResDef(XP_CKM_RSA_PKCS_LABEL, (SEC_DIALOG_STRING_BASE + 500),\ - "RSA PKCS encryption") - - - /* define some messages for lm_pkcs11.c */ - ResDef(XP_JS_PKCS11_EXTERNAL_DELETED, (SEC_DIALOG_STRING_BASE + 501), - "External security module successfully deleted") - ResDef(XP_JS_PKCS11_INTERNAL_DELETED, (SEC_DIALOG_STRING_BASE + 502), - "Internal security module successfully deleted") - ResDef(XP_JS_PKCS11_ADD_MOD_SUCCESS, (SEC_DIALOG_STRING_BASE + 503), - "A new security module has been installed") - ResDef(XP_JS_PKCS11_ADD_MOD_WARN, (SEC_DIALOG_STRING_BASE + 504), - "Are you sure you want to install this security module?") - ResDef(XP_JS_PKCS11_DEL_MOD_WARN, (SEC_DIALOG_STRING_BASE + 505), - "Are you sure you want to delete this security module?") - -ResDef(XP_SEC_PROMPT_FOR_NICKNAME, (SEC_DIALOG_STRING_BASE + 506), -"Enter a nickname for the certificate:") - - /* Security Advisor->Signers->CRL's */ - -ResDef(XP_DIALOG_SHOW_CRLS_TITLE, (SEC_DIALOG_STRING_BASE + 507), "\ -View/Edit CRL's") - -ResDef(XP_DIALOG_SHOW_CRL, (SEC_DIALOG_STRING_BASE + 508), "\ -

%0%

\ -URL:%1%
Last Update:%2%
Next Update:%3% %4%
\ -Signed by:
    %5%

\ -
") - -ResDef(XP_DIALOG_NEW_CRL, (SEC_DIALOG_STRING_BASE + 509), "\ -Enter the URL of the new CRL/CKL to load:") - -ResDef(XP_DIALOG_EDIT_CRL, (SEC_DIALOG_STRING_BASE + 510), "\ -

%0%

\ -Enter the URL of the Certificate Revocation List.

\ -URL:") - -ResDef(XP_DIALOG_NO_CRL_SELECTED, (SEC_DIALOG_STRING_BASE + 511), "\ -No CRL was selected. Please select a CRL from the list.") - -ResDef(XP_DIALOG_NO_URL_FOR_CRL, (SEC_DIALOG_STRING_BASE + 512), "\ -Selected CRL does not have a valid URL to load from.\n\ -Use 'New/Edit...' to set the URL.") - -ResDef(XP_DIALOG_CRL_EXPIRED_TAG, (SEC_DIALOG_STRING_BASE + 513), "\ -Expired") - -ResDef(XP_DIALOG_NO_URL_GIVEN, (SEC_DIALOG_STRING_BASE + 514), "\ -You did not enter a URL: No new CRL loaded.") - -ResDef(XP_DIALOG_CRL_EDIT_TITLE, (SEC_DIALOG_STRING_BASE + 515), "\ -Edit CRL") - -ResDef(XP_DIALOG_CRLS_TITLE, (SEC_DIALOG_STRING_BASE + 516), "\ -CRL") - -ResDef(XP_DIALOG_JS_HEADER_STRINGS_WITH_UTF8_CHARSET, (SEC_DIALOG_STRING_BASE + 517), "\ -\ -%0%\n\ -\n\ -%-cont-%") - -ResDef (MK_MSG_ASK_HTML_MAIL_4, XP_MSG_BASE + 947, "\ -\n\ -\n\ -\n\ -%-cont-%") - -ResDef (MK_MSG_ASK_HTML_MAIL_5, XP_MSG_BASE + 948, "\ -\n\ -\n\ -\n\ -") - - -/* Reserve a bunch extra, just in case. */ - -ResDef (MK_MSG_ASK_HTML_MAIL_6, XP_MSG_BASE + 949, "") -ResDef (MK_MSG_ASK_HTML_MAIL_7, XP_MSG_BASE + 950, "") -ResDef (MK_MSG_ASK_HTML_MAIL_8, XP_MSG_BASE + 951, "") -ResDef (MK_MSG_ASK_HTML_MAIL_9, XP_MSG_BASE + 952, "") -ResDef (MK_MSG_ASK_HTML_MAIL_10, XP_MSG_BASE + 953, "") - -/* String to use to indicate everyone at a given domain. Used as - in "@netscape.com". */ -ResDef (MK_MSG_EVERYONE, XP_MSG_BASE + 954, "") - -ResDef (MK_MSG_HTML_RECIPIENTS_TITLE, XP_MSG_BASE + 955, "HTML Recipients") - -ResDef (MK_MSG_HTML_RECIPIENTS, XP_MSG_BASE + 956, "\ -The recipients and domains below are not listed as being able to read\n\ -HTML messages. If this listing is incorrect, you may change it below.\n\ -%-cont-%") - -ResDef (MK_MSG_HTML_RECIPIENTS_1, XP_MSG_BASE + 957, "\ -

\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -
Does not prefer HTMLPrefers HTML
\n\ -\n\ -\n\ -
\n\ -\n\ -%-cont-%") - -ResDef (MK_MSG_HTML_RECIPIENTS_3, XP_MSG_BASE + 959, "\ -

\n\ -\n\ -

\n\ -
\n\ -\n\ -
\n\ -

\n\ -

\n\ -%-cont-%") - -ResDef (MK_MSG_HTML_RECIPIENTS_5, XP_MSG_BASE + 961, "\ -\n\ -\n\ -\n\ -%-cont-%") - -ResDef (MK_MSG_HTML_RECIPIENTS_6, XP_MSG_BASE + 962, "\ -\n\ -\n\ -
\n\ -\n\ -") - - -/* Reserve a bunch extra, just in case. */ - -ResDef (MK_MSG_HTML_RECIPIENTS_7, XP_MSG_BASE + 963, "") -ResDef (MK_MSG_HTML_RECIPIENTS_8, XP_MSG_BASE + 964, "") -ResDef (MK_MSG_HTML_RECIPIENTS_9, XP_MSG_BASE + 965, "") -ResDef (MK_MSG_HTML_RECIPIENTS_10, XP_MSG_BASE + 966, "") -ResDef (MK_MSG_HTML_RECIPIENTS_11, XP_MSG_BASE + 967, "") - -ResDef (MK_ADDR_ENTRY_ALREADY_EXISTS, XP_MSG_BASE + 968, - "An Address Book entry with this name and email address already exists.") - -ResDef (MK_ADDR_ENTRY_ALREADY_IN_LIST, XP_MSG_BASE + 969, - "This Address Book entry is already a member of this list.") - -ResDef (MK_LDAP_CUSTOM1, XP_MSG_BASE + 970, "Custom 1") -ResDef (MK_LDAP_CUSTOM2, XP_MSG_BASE + 971, "Custom 2") -ResDef (MK_LDAP_CUSTOM3, XP_MSG_BASE + 972, "Custom 3") -ResDef (MK_LDAP_CUSTOM4, XP_MSG_BASE + 973, "Custom 4") -ResDef (MK_LDAP_CUSTOM5, XP_MSG_BASE + 974, "Custom 5") - -ResDef (MK_ADDR_ADD_PERSON_TO_ABOOK, XP_MSG_BASE + 975, -"Mailing lists can only contain entries from the Personal Address Book.\n\ -Would you like to add %s to the address book?") - -ResDef (MK_ADDR_ENTRY_IS_LIST, XP_MSG_BASE + 976, -"A mailing list cannot have itself as a member") -ResDef (MK_ADDR_NEW_CARD, XP_MSG_BASE + 977, -"New Card") -ResDef (MK_ADDR_NEW_PERCARD, XP_MSG_BASE + 978, -"New Personal Card") -ResDef (MK_ADDR_PERCARD, XP_MSG_BASE + 979, -"Personal Card for %s") -ResDef (MK_ADDR_CCNAME, XP_MSG_BASE + 980, "CC: %s") -ResDef (MK_ADDR_BCCNAME, XP_MSG_BASE + 981, "Bcc: %s") -ResDef (MK_ADDR_TONAME, XP_MSG_BASE + 982, "To: %s") - -ResDef (XP_EDT_ERR_SAVE_WRITING_ROOT, XP_MSG_BASE + 983, - "%s can't be saved. Either the disk is full\n\ -or the file is locked.\n\n\ -Try saving on a different disk or try saving\n\ -%s with a different name.") -ResDef (XP_EDT_HEAD_FAILED, XP_MSG_BASE + 984, - "HEAD call to server failed.\nUpload aborted.") - -ResDef (MK_UNABLE_TO_OPEN_ADDR_FILE, XP_MSG_BASE + 985, - "Unable to open address book database file.") -ResDef (MK_ADDR_LIST_ALREADY_EXISTS, XP_MSG_BASE + 986, - "A mailing list with this name already exists.") -#ifndef MOZ_COMMUNICATOR_NAME -ResDef (MK_ADDR_UNABLE_TO_IMPORT, XP_MSG_BASE + 987, - MOZ_NAME_PRODUCT" is unable to import this file into the address book.") -#else -ResDef (MK_ADDR_UNABLE_TO_IMPORT, XP_MSG_BASE + 987, - "Communicator is unable to import this file into the address book.") -#endif - -ResDef(MK_MSG_PURGING_NEWSGROUP_ETC, XP_MSG_BASE + 988, - "Mail: Purging discussion group %s...") - - ResDef(MK_MSG_PURGING_NEWSGROUP_HEADER, XP_MSG_BASE + 989, - "Mail: Purging discussion group %s...header %ld") - -ResDef(MK_MSG_PURGING_NEWSGROUP_ARTICLE, XP_MSG_BASE + 990, -"Purging discussion group %s...article %ld") - -ResDef(MK_MSG_PURGING_NEWSGROUP_DONE, XP_MSG_BASE + 991, - "Mail: Purging discussion group %s...Done") - -ResDef (XP_EDT_PUBLISH_ERROR_BODY, XP_MSG_BASE + 992, - "Make sure you specify the entire destination URL.\n\ -e.g. http://somemachine/somedirectory/somefile.html\n\n\ -Try to publish to this URL anyway?") -ResDef (XP_EDT_PUBLISH_BAD_URL, XP_MSG_BASE + 993, - "Publish destination is invalid.") -ResDef (XP_EDT_PUBLISH_BAD_CHAR, XP_MSG_BASE + 994, - "Publish destination contains at least one illegal character.") -ResDef (XP_EDT_PUBLISH_BAD_PROTOCOL, XP_MSG_BASE + 995, - "Publish destination must begin with ftp:// or http://") -ResDef (XP_EDT_PUBLISH_NO_FILE, XP_MSG_BASE + 996, - "Publish destination ends in a slash.") -ResDef (XP_EDT_PUBLISH_NO_EXTENSION, XP_MSG_BASE + 997, - "Publish destination has no file extension.") - -ResDef (MK_CVCOLOR_SOURCE_OF, XP_MSG_BASE + 998, - "Source of: ") -ResDef (MK_ACCESS_COOKIES_THE_SERVER, XP_MSG_BASE + 999, - "The server ") -ResDef (MK_ACCESS_COOKIES_WISHES, XP_MSG_BASE + 1000, - "\nwishes to set a cookie that will be sent ") -ResDef (MK_ACCESS_COOKIES_TOANYSERV, XP_MSG_BASE + 1001, - "\nto any server in the domain ") -ResDef (MK_ACCESS_COOKIES_TOSELF, XP_MSG_BASE + 1002, - "only back to itself") -ResDef (MK_ACCESS_COOKIES_NAME_AND_VAL, XP_MSG_BASE + 1003, - "\nThe name and value of the cookie are:\n") -ResDef (MK_ACCESS_COOKIES_COOKIE_WILL_PERSIST, XP_MSG_BASE + 1004, - "\nThis cookie will persist until ") -ResDef (MK_ACCESS_COOKIES_SET_IT, XP_MSG_BASE + 1005, - "\nDo you wish to allow the cookie to be set?") - -ResDef (MK_CACHE_CONTENT_LENGTH, XP_MSG_BASE + 1006, - "Content Length:") -ResDef (MK_CACHE_REAL_CONTENT_LENGTH, XP_MSG_BASE + 1007, - "Real Content Length:") -ResDef (MK_CACHE_CONTENT_TYPE, XP_MSG_BASE + 1008, - "Content type:") -ResDef (MK_CACHE_LOCAL_FILENAME, XP_MSG_BASE + 1009, - "Local filename:") -ResDef (MK_CACHE_LAST_MODIFIED, XP_MSG_BASE + 1010, - "Last Modified:") -ResDef (MK_CACHE_EXPIRES, XP_MSG_BASE + 1011, - "Expires:") -ResDef (MK_CACHE_LAST_ACCESSED, XP_MSG_BASE + 1012, - "Last accessed:") -ResDef (MK_CACHE_CHARSET, XP_MSG_BASE + 1013, - "Character set:") -ResDef (MK_CACHE_SECURE, XP_MSG_BASE + 1014, - "Secure:") -ResDef (MK_CACHE_USES_RELATIVE_PATH, XP_MSG_BASE + 1015, - "Uses relative path:") -ResDef (MK_CACHE_FROM_NETSITE_SERVER, XP_MSG_BASE + 1016, - "From Netsite Server:") - -ResDef (XP_EDT_I18N_HAS_CHARSET, XP_MSG_BASE + 1017, - "Changing the character encoding may alter some\n\ -of the characters in your document.\n\ -This change is not undoable.\n\ -Are you sure you want to proceed?") - -ResDef (XP_EDT_BREAKING_LINKS, XP_MSG_BASE + 1018, - "The following links could become invalid because\n\ -they refer to files on your local hard disk(s).\n\n\ -%s\nIf you're sure you set up the links properly, click\n\ -OK to continue publishing.") -ResDef (XP_EDT_ERR_SAVE_FILE_WRITE, XP_MSG_BASE + 1019, - "%s can't be saved because the disk is full or the\n\ -file is locked. Try saving on a different disk or try saving\n\ -%s with a different name.") -ResDef (XP_EDT_ERR_SAVE_CONTINUE, XP_MSG_BASE + 1020, - "\n\n\ -If you continue saving, %s won't be saved with\n\ -this page.") -ResDef (XP_EDT_ERR_SAVE_SRC_NOT_FOUND, XP_MSG_BASE + 1021, - "The file %s associated with this page can't be\n\ -saved. Make sure the file is in the correct location.") -ResDef (XP_EDT_ERR_SAVE_FILE_READ, XP_MSG_BASE + 1022, - "The file %s associated with this page can't be\n\ -saved because there is a problem with the file.") -ResDef (XP_EDT_ERR_PUBLISH_PREPARING_ROOT, XP_MSG_BASE + 1023, - "There was a problem preparing %s for\n\ -publishing. "MOZ_NAME_PRODUCT" couldn't create a temporary file.") -ResDef (XP_EDT_ERR_CHECK_DISK, XP_MSG_BASE + 1024, - "\n\n\ -Check to see if your hard disk is full.") -ResDef (XP_EDT_ERR_PUBLISH_FILE_WRITE, XP_MSG_BASE + 1025, - "There was a problem preparing %s for publishing.\n\ -"MOZ_NAME_PRODUCT" couldn't create a temporary file.") -ResDef (XP_EDT_ERR_PUBLISH_CONTINUE, XP_MSG_BASE + 1026, - "\n\n\ -If you continue, %s won't be published with\n\ -this page.") -ResDef (XP_EDT_ERR_PUBLISH_SRC_NOT_FOUND, XP_MSG_BASE + 1027, -MOZ_NAME_BRAND" couldn't prepare the file %s for\n\ -publishing. Make sure the file is in the correct location.") -ResDef (XP_EDT_ERR_PUBLISH_FILE_READ, XP_MSG_BASE + 1028, - "The file %s associated with this page can't\n\ -be published because there is a problem with the file.") -ResDef (XP_EDT_ERR_MAIL_PREPARING_ROOT, XP_MSG_BASE + 1029, - "There was a problem preparing the message for sending.\n\ -"MOZ_NAME_PRODUCT" couldn't create a temporary file.") -ResDef (XP_EDT_ERR_MAIL_FILE_WRITE, XP_MSG_BASE + 1030, - "There was a problem preparing %s for sending.\n\ -"MOZ_NAME_PRODUCT" couldn't create a temporary file.") -ResDef (XP_EDT_ERR_MAIL_SRC_NOT_FOUND, XP_MSG_BASE + 1031, -MOZ_NAME_BRAND" couldn't prepare the file %s for\n\ -sending. Make sure the file is in the correct location.") -ResDef (XP_EDT_ERR_MAIL_FILE_READ, XP_MSG_BASE + 1032, - "The file %s associated with this page can't be\n\ -sent because there is a problem with the file.") -ResDef (XP_EDT_ERR_MAIL_CONTINUE, XP_MSG_BASE + 1033, - "\n\n\ -If you continue, %s won't be sent with\n\ -this page.") - -ResDef (MK_ADDR_VIEW_COMPLETE_VCARD, XP_MSG_BASE + 1034, - "View Complete Card") -ResDef (MK_ADDR_VIEW_CONDENSED_VCARD, XP_MSG_BASE + 1035, - "View Condensed Card") - -ResDef(MK_MSG_BY_FLAG, XP_MSG_BASE + 1036, - "By Flag") - -ResDef(MK_MSG_BY_UNREAD, XP_MSG_BASE + 1037, - "By Unread") - -ResDef(MK_MSG_BY_SIZE, XP_MSG_BASE + 1038, - "By Size") - -ResDef(XP_ALERT_OFFLINE_MODE_SELECTED, XP_MSG_BASE + 1039, -MOZ_NAME_BRAND" was unable to connect to the network because\n\ -you are in offline mode.\n\ -Choose Go Online from the File Menu and try again.") - -ResDef(MK_ADDR_FIRST_LAST_SEP, XP_MSG_BASE + 1040, - " ") - -ResDef(MK_ADDR_LAST_FIRST_SEP, XP_MSG_BASE + 1041, - ", ") - -ResDef(MK_MSG_CANT_MOVE_FOLDER, XP_MSG_BASE + 1042, - "That item can not be moved to the requested location.") - -ResDef(XP_SEC_ENTER_EXPORT_PWD, XP_MSG_BASE + 1043, - "Enter password to protect data being exported:") - -ResDef(MK_SEARCH_SCOPE_ONE, XP_MSG_BASE + 1044, "in %s") -ResDef(MK_SEARCH_SCOPE_SELECTED, XP_MSG_BASE + 1045, "in selected items") -ResDef(MK_SEARCH_SCOPE_OFFLINE_MAIL, XP_MSG_BASE + 1046, "in offline mail folders") -ResDef(MK_SEARCH_SCOPE_ONLINE_MAIL, XP_MSG_BASE + 1047, "in online mail folders") -ResDef(MK_SEARCH_SCOPE_SUBSCRIBED_NEWS, XP_MSG_BASE + 1048, "in subscribed discussion groups") -ResDef(MK_SEARCH_SCOPE_ALL_NEWS, XP_MSG_BASE + 1049, "in searchable discussion groups") - -ResDef(MK_ADDR_DEFAULT_DLS, XP_MSG_BASE + 1050, "Default Directory Server") -ResDef(MK_ADDR_SPECIFIC_DLS, XP_MSG_BASE + 1051, "Specific Directory Server") -ResDef(MK_ADDR_HOSTNAMEIP, XP_MSG_BASE + 1052, "Hostname or IP Address") -ResDef(MK_ADDR_CONFINFO, XP_MSG_BASE + 1053,MOZ_NAME_BRAND" Conference Address") -ResDef(MK_ADDR_ADDINFO, XP_MSG_BASE + 1054, "Additional Information:") - -ResDef(MK_MSG_HTML_DOMAINS_DIALOG_TITLE, XP_MSG_BASE + 1055, "HTML Domains") - -ResDef(MK_MSG_HTML_DOMAINS_DIALOG, XP_MSG_BASE + 1056, "\ -\n\ -This is a list of domains that can accept HTML mail. Anyone whose\n\ -%-cont-%") - -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_3, XP_MSG_BASE + 1059, "\ -e-mail address ends in one of these domains is considered to use a\n\ -mail reader which understands HTML, such as "MOZ_NAME_PRODUCT".

\n\ -You may remove a domain from this list by clicking on it and\n\ -%-cont-%") - -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_4, XP_MSG_BASE + 1060, "\ -choosing Delete.

\n\ -\n\ -\n\ -\n\ -") - -/* Reserve a bunch extra, just in case. */ - -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_5, XP_MSG_BASE + 1061, "") -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_6, XP_MSG_BASE + 1062, "") -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_7, XP_MSG_BASE + 1063, "") -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_8, XP_MSG_BASE + 1064, "") -ResDef (MK_MSG_HTML_DOMAINS_DIALOG_9, XP_MSG_BASE + 1065, "") - - -ResDef (MK_MSG_SET_HTML_NEWSGROUP_HEIRARCHY_CONFIRM, XP_MSG_BASE + 1066, -"The discussion group %s was accepting HTML because all groups whose name\n\ -started with \042%s\042 were marked to accept HTML. This action will\n\ -reverse that; groups whose name start with \042%s\042 will no longer\n\ -accept HTML.") - -ResDef (MK_MSG_NEXT_CATEGORY, XP_MSG_BASE + 1067, "Next Category") - -ResDef (MK_MSG_GROUP_NOT_ON_SERVER, XP_MSG_BASE + 1068, -"The discussion group %s does not appear to exist on the host %s.\n\ -Would you like to unsubscribe from it?") - -ResDef(MK_MIMEHTML_SHOW_SECURITY_ADVISOR, XP_MSG_BASE + 1079, - "Show Security Information") - -ResDef(MK_MIMEHTML_ENC_AND_SIGNED, XP_MSG_BASE + 1080, - "Encrypted
and Signed") -ResDef(MK_MIMEHTML_SIGNED, XP_MSG_BASE + 1081, "Signed") -ResDef(MK_MIMEHTML_ENCRYPTED, XP_MSG_BASE + 1082, "Encrypted") -ResDef(MK_MIMEHTML_CERTIFICATES, XP_MSG_BASE + 1083, "Certificates") -ResDef(MK_MIMEHTML_ENC_SIGNED_BAD, XP_MSG_BASE + 1084, - "Invalid Signature") -ResDef(MK_MIMEHTML_SIGNED_BAD, XP_MSG_BASE + 1085, - "Invalid Signature") -ResDef(MK_MIMEHTML_ENCRYPTED_BAD, XP_MSG_BASE + 1086, - "Invalid Encryption") -ResDef(MK_MIMEHTML_CERTIFICATES_BAD, XP_MSG_BASE + 1087, - "Invalid Certificates") - -ResDef (MK_MSG_NEW_NEWSGROUP, XP_MSG_BASE + 1088, -"New Discussion Group") -ResDef (MK_MSG_NEW_CATEGORY, XP_MSG_BASE + 1089, -"Creates a new category in this discussion group") - -ResDef(MK_ADDR_NO_EMAIL_ADDRESS, XP_MSG_BASE + 1090, - "There is no email address for %s.") - -ResDef (MK_MSG_EXPIRE_COUNT, XP_MSG_BASE + 1091, "Expired %ld messages") - -ResDef (MK_MSG_DONE_EXPIRE_COUNT, XP_MSG_BASE + 1092, "Expired %ld messages...Done") - -/* Localized names of mail folders */ -ResDef (MK_MSG_TRASH_L10N_NAME, XP_MSG_BASE + 1093, "Trash") -ResDef (MK_MSG_INBOX_L10N_NAME, XP_MSG_BASE + 1094, "Inbox") -#ifdef XP_WIN16 -ResDef (MK_MSG_OUTBOX_L10N_NAME, XP_MSG_BASE + 1095, "Unsent") -#else -ResDef (MK_MSG_OUTBOX_L10N_NAME, XP_MSG_BASE + 1095, "Unsent Messages") -#endif -ResDef (MK_MSG_DRAFTS_L10N_NAME, XP_MSG_BASE + 1096, "Drafts") -ResDef (MK_MSG_SENT_L10N_NAME, XP_MSG_BASE + 1097, "Sent") - -/* Caption text for FE_PromptWithCaption */ -ResDef (MK_MSG_NEW_FOLDER_CAPTION, XP_MSG_BASE + 1098, "New Folder") -ResDef (MK_MSG_RENAME_FOLDER_CAPTION, XP_MSG_BASE + 1099, "Rename Folder") - -ResDef (MK_MSG_MANAGE_MAIL_ACCOUNT, XP_MSG_BASE + 1100, "Manage Mail Account") - -ResDef (MK_MSG_UNABLE_MANAGE_MAIL_ACCOUNT, XP_MSG_BASE+1101, -MOZ_NAME_BRAND" is unable to manage your mail account.\n\ -Please contact your mail account administrator\n\ -or try again later.") - -ResDef (MK_MSG_MODERATE_NEWSGROUP, XP_MSG_BASE + 1102, -"Manage Discussion Group") - -ResDef(MK_UNABLE_TO_LOCATE_SOCKS_HOST, XP_MSG_BASE + 1103, -MOZ_NAME_BRAND" is unable to locate the socks server:\n\ - %.200s\n\ -The server does not have a DNS entry.\n\n\ -Check the socks server name in the proxy\n\ -configuration and try again.") - -ResDef (XP_SEC_PROMPT_NICKNAME_COLLISION, (XP_MSG_BASE + 1104), - "An object with that nickname exists. Please enter a new nickname.") - -ResDef(MK_MSG_GET_NEW_DISCUSSION_MSGS, XP_MSG_BASE + 1105, "Get New Discussion Messages") - -ResDef(MK_MSG_LOCAL_MAIL, XP_MSG_BASE + 1106, "Local Mail") -ResDef(MK_NEWS_DISCUSSIONS_ON, XP_MSG_BASE + 1107, "%s Discussions") - -ResDef( XP_RECEIVING_MESSAGE_HEADERS_OF, XP_MSG_BASE + 1108, -"%s Receiving: message headers %lu of %lu" ) - -ResDef( XP_RECEIVING_MESSAGE_FLAGS_OF, XP_MSG_BASE + 1109, -"%s Receiving: message flags %lu of %lu" ) - -ResDef( XP_IMAP_DELETING_MESSAGES, XP_MSG_BASE + 1110, "Deleting messages...") -ResDef( XP_IMAP_DELETING_MESSAGE, XP_MSG_BASE + 1111, "Deleting message...") -ResDef( XP_IMAP_MOVING_MESSAGES_TO, XP_MSG_BASE + 1112, "Moving messages to %s...") -ResDef( XP_IMAP_MOVING_MESSAGE_TO, XP_MSG_BASE + 1113, "Moving message to %s...") -ResDef( XP_IMAP_COPYING_MESSAGES_TO, XP_MSG_BASE + 1114, "Copying messages %s...") -ResDef( XP_IMAP_COPYING_MESSAGE_TO, XP_MSG_BASE + 1115, "Copying message %s...") -ResDef( XP_IMAP_SELECTING_MAILBOX, XP_MSG_BASE + 1116, "Opening folder %s...") - -#ifndef MOZ_COMMUNICATOR_NAME -ResDef(MK_MSG_CONFIRM_MOVE_MAGIC_FOLDER, XP_MSG_BASE + 1117, -"Are you sure you want to move %s away from its default \n\ -location? Next time "MOZ_NAME_PRODUCT" runs, a new %s folder \n\ -will be created in the default location") -#else -ResDef(MK_MSG_CONFIRM_MOVE_MAGIC_FOLDER, XP_MSG_BASE + 1117, -"Are you sure you want to move %s away from its default \n\ -location? Next time Communicator runs, a new %s folder \n\ -will be created in the default location") -#endif - -ResDef(MK_MSG_UPDATE_MSG_COUNTS, XP_MSG_BASE + 1118, "Update Message Counts") - -ResDef(MK_MSG_DELETING_MSGS_STATUS, XP_MSG_BASE + 1119, "Deleting %lu of %lu messages") -ResDef(MK_MSG_COPYING_MSGS_STATUS, XP_MSG_BASE + 1120, "Copying %lu of %lu messages to %s") -ResDef(MK_MSG_MOVING_MSGS_STATUS, XP_MSG_BASE + 1121, "Moving %lu of %lu messages to %s") - -ResDef(XP_EDT_PUBLISH_REPORT_ONE_FILE, XP_MSG_BASE + 1122, -"Your file was uploaded successfully.") -ResDef(XP_EDT_PUBLISH_REPORT_MSG, XP_MSG_BASE + 1123, -"%d files were uploaded successfully.") - -ResDef(MK_MSG_DELIVERING_MESSAGE_TO, XP_MSG_BASE + 1124, "Mail: delivering message %ld to %s...") -ResDef(MK_MSG_DELIVERING_MESSAGE, XP_MSG_BASE + 1125, "Mail: delivering message %ld...") - -ResDef(MK_MSG_FORWARDING_ENCRYPTED_WARNING, XP_MSG_BASE + 1126, - "You are doing an unencrypted Forward of a message which was\n\ -encrypted when you received it. Sending this message unencrypted\n\ -may reduce the level of privacy of the attached message.\n\ -\n\ -Send unencrypted anyway?") - -ResDef(XP_EDT_BROWSE_TO_DEFAULT, XP_MSG_BASE + 1127, -"\n\nBrowse to your default publishing location now?") - -ResDef (XP_EDT_BAD_CLIPBOARD_VERSION, XP_MSG_BASE + 1128, - "You can not copy and paste between different\n\ -versions of "MOZ_NAME_PRODUCT" Composer or "MOZ_NAME_PRODUCT" Gold.") -ResDef (XP_EDT_BAD_CLIPBOARD_ENCODING, XP_MSG_BASE + 1129, - "You can not copy and paste between windows with\n\ -different character set encodings.") - -ResDef(XP_ALERT_NFS_USEHTTP, XP_MSG_BASE+1130, -"NFS URLs not internally supported, use an HTTP proxy server: ") - -ResDef(MK_MSG_MARK_CATEGORY_READ, XP_MSG_BASE+1131, "Mark Category Read") - -ResDef(MK_MSG_TRACK_FOLDER_MOVE, XP_MSG_BASE + 1132, -"Change rule to reflect new folder location?") -ResDef(MK_MSG_TRACK_FOLDER_DEL, XP_MSG_BASE + 1133, -"Disable filter rule for this folder?") - -/* Webfonts strings from modules/libfont */ - -ResDef(WF_MSG_ABOUT_TITLE, XP_MSG_BASE + 1134, -"Dynamic Fonts") -ResDef(WF_MSG_ABOUT_BEGIN_1, XP_MSG_BASE + 1135, -"

Installed Font Displayers

\n\ - \n\ - The font displayers that you have installed and the font formats\n\ - supported by each, are listed below.") - ResDef(WF_MSG_ABOUT_BEGIN_2, XP_MSG_BASE + 1136, - "Use the radioboxes to enable or disable a particular format for a\n\ - particular displayer.

") - ResDef(WF_MSG_ABOUT_BEGIN_3, XP_MSG_BASE + 1137, - "For more information on "MOZ_NAME_PRODUCT" Dynamic Fonts, click\ - here


") -ResDef(WF_MSG_ABOUT_END, XP_MSG_BASE + 1138, -"
") -ResDef(WF_MSG_ABOUT_DISPLAYER_DYNAMIC, XP_MSG_BASE + 1139, -"\n\ - \n\ - ") -ResDef(WF_MSG_ABOUT_DISPLAYER_STATIC, XP_MSG_BASE + 1140, -"
%s
%s
Located at: %s

\n\ - \n\ - ") -ResDef(WF_MSG_ABOUT_DISPLAYER_MIME, XP_MSG_BASE + 1141, -"\n\ - \n\ - \n\ - \n\ - ") -ResDef(WF_MSG_ABOUT_DISPLAYER_END, XP_MSG_BASE + 1142, -"
%s
%s

%s%s%s
\n\ -
\n\ -
") -ResDef(WF_MSG_ABOUT_NO_DISPLAYER, XP_MSG_BASE + 1143, -"No Displayers Installed") -ResDef(WF_MSG_NATIVE_DISPLAYER_NAME, XP_MSG_BASE + 1144, -MOZ_NAME_BRAND" Default Font Displayer") -ResDef(WF_MSG_NATIVE_DISPLAYER_DESCRIPTION, XP_MSG_BASE + 1145, -"This font displayer handles fonts that are installed on the system.") - -/* More messenger strings */ -ResDef (MK_MSG_OUTBOX_L10N_NAME_OLD, XP_MSG_BASE + 1146, "Outbox") -ResDef(MK_MSG_BOGUS_QUEUE_MSG_1_OLD, XP_MSG_BASE + 1147, - "The `Outbox' folder contains a message which is not\n\ -scheduled for delivery!") -ResDef(MK_MSG_BOGUS_QUEUE_MSG_N_OLD, XP_MSG_BASE + 1148, - "The `Outbox' folder contains %d messages which are not\n\ -scheduled for delivery!") -ResDef(MK_MSG_BOGUS_QUEUE_REASON_OLD, XP_MSG_BASE + 1149, - "\n\nThis probably means that some program other than\n\ -"MOZ_NAME_PRODUCT" has added messages to this folder.\n") -ResDef(MK_MSG_WHY_QUEUE_SPECIAL_OLD, XP_MSG_BASE + 1150, - "The `Outbox' folder is special; it is only for holding\n\ -messages which have been deferred for later delivery.") - -ResDef(XP_AUTOADMIN_MISSING, XP_MSG_BASE + 1151, - "The local configuration file specified a configuration URL but the AutoAdmin component could not \ - be loaded. AutoAdmin is required to support remote configuration URLs. You will be unable to load\ - any remote documents." ) - - ResDef(MK_MSG_ADDING_LDAP_TO_AB, XP_MSG_BASE + 1152, - "Adding to Address Book: %ld of %ld") - - ResDef(MK_MSG_XSENDER_INTERNAL, XP_MSG_BASE + 1153, - "      Internal") - -ResDef(XP_PKCS12_IMPORT_FILE_PROMPT, (XP_MSG_BASE + 1154), -"File Name to Import") - -ResDef(XP_PKCS12_EXPORT_FILE_PROMPT, (XP_MSG_BASE + 1155), -"File Name to Export") - -ResDef(XP_EDT_CP_DOCUMENT_TOO_LARGE_READ, XP_MSG_BASE + 1156, - "This document is %ld bytes long. That is too large to be read by a Composer Plug-in. \ -The maximum allowed size is %ld bytes.") - -ResDef(XP_EDT_CP_DOCUMENT_TOO_LARGE_WRITE, XP_MSG_BASE + 1157, - "The Composer Plug-in tried to create a document that is %ld bytes long. \ -The maximum allowed size is %ld bytes.") - -ResDef(MK_MIME_SMIME_ENCRYPTED_CONTENT_DESCRIPTION, XP_MSG_BASE + 1158, - "S/MIME Encrypted Message") - -ResDef(MK_MIME_SMIME_SIGNATURE_CONTENT_DESCRIPTION, XP_MSG_BASE + 1159, - "S/MIME Cryptographic Signature") - -/* Netcaster Strings */ - -ResDef(XP_ALERT_CANT_RUN_NETCASTER, XP_MSG_BASE + 1160, -MOZ_NAME_BRAND" was unable to start Netcaster.\n\ -Make sure Netcaster is installed correctly.") - - -ResDef(XP_EDT_CANT_EDIT_URL, XP_MSG_BASE + 1161, - "Composer can't open the URL '%s'.\n\n\ -You must enter an absolute URL or an absolute pathname.\n\ -e.g. 'http://mysystem.com/mydoc.html'") - -ResDef(XP_SA_ALG_AND_BITS_FORMAT, XP_MSG_BASE + 1162, "%d-bit %s") - -ResDef(MK_MSG_IMAP_MULTIPLE_SELECT_FAILED, XP_MSG_BASE + 1163, -"Only one operation at a time on this folder is permitted. \ -\nPlease wait until the other operation completes and try again.") - -ResDef(MK_MSG_CONFIRM_MOVE_FOLDER_TO_TRASH, XP_MSG_BASE + 1164, -"Are you sure you want to move the selected folders into the Trash?") - -ResDef(XP_ALERT_NETCASTER_NO_JS, XP_MSG_BASE + 1165, -MOZ_NAME_BRAND" is unable to start Netcaster because Java and/or JavaScript are not enabled. \n\ -Please verify that your Advanced Preferences are set correctly and try again.") - - -ResDef(XP_EDT_ADD_COLUMNS, XP_MSG_BASE + 1170, - "Add %d column(s) to the table") - -ResDef(XP_EDT_ADD_ROWS, XP_MSG_BASE + 1171, - "Add %d rows(s) to the table") - -ResDef(XP_EDT_PERCENT_CELL, XP_MSG_BASE + 1172, - "% of parent cell ") - -ResDef(XP_EDT_PERCENT_TABLE, XP_MSG_BASE + 1173, - "% of table ") - -/* XP_NSCOLOR_BASE and the 70 color strings removed - * We would like to reserve this range (1174 - 1250) for Editor -*/ - -/* please reserve strings to here for future colors */ -ResDef(SU_NOT_A_JAR_FILE, XP_MSG_BASE + 1262, - "SmartUpdate failed: Downloaded archive is not a JAR file.") - -ResDef(SU_SECURITY_CHECK, XP_MSG_BASE + 1263, - "SmartUpdate failed: JAR archive failed security check. %s.") - -ResDef(SU_INSTALL_FILE_HEADER, XP_MSG_BASE + 1264, - "SmartUpdate failed: JAR archive has no installer file information.") - -ResDef(SU_INSTALL_FILE_MISSING, XP_MSG_BASE + 1265, - "SmartUpdate failed: JAR archive is missing an installer file %s.") - -ResDef(XP_GLOBAL_NO_CONFIG_RECEIVED_NO_FAILOVER, XP_MSG_BASE + 1266, -"No automatic configuration file was received.\n\n\ -You will be unable to load and documents from the network.\n\ -See your local system administrator for help." ) - -ResDef(XP_GLOBAL_BAD_TYPE_CONFIG_IGNORED, XP_MSG_BASE + 1267, - "The automatic configuration file is not of the correct type:\n\n\ - %s\n\n\ -Expected the MIME type of application/x-javascript-config." ) - -ResDef(XP_GLOBAL_CONF_LOAD_FAILED_NO_FAILOVER, XP_MSG_BASE + 1268, -"The automatic configuration file could not be loaded.\n\n\ -You will be unable to load any documents from the network.\n\ -See your local system administrator for help." ) - -ResDef(XP_GLOBAL_NO_CONFIG_RECIEVED, XP_MSG_BASE + 1269, - "No automatic configuration file was received.\n\n\ -Will default based on the last configuration." ) - -ResDef(XP_GLOBAL_EVEN_SAVED_IS_BAD, XP_MSG_BASE + 1270, - "The backup automatic configuration file had errors.\n\n\ -We will default to the standard configuration." ) - -ResDef(XP_GLOBAL_BAD_CONFIG_IGNORED, XP_MSG_BASE + 1271, - "The automatic configuration file has errors:\n\n %s\n\n\ -We will default to the standard configuration." ) - -ResDef(XP_GLOBAL_CONFIG_LOAD_ABORTED, XP_MSG_BASE + 1272, - "Automatic configuration load was cancelled.\n\n\ -We will default to the standard configuration." ) - -ResDef(XP_PKCS12_SUCCESSFUL_EXPORT, (XP_MSG_BASE + 1273), -"Your certificates have been successfully exported.") - -ResDef(XP_PKCS12_SUCCESSFUL_IMPORT, (XP_MSG_BASE + 1274), -"Your certificates have been successfully imported.") - -ResDef(XP_SEC_ENTER_IMPORT_PWD, (XP_MSG_BASE + 1275), -"Enter password protecting data to be imported:") - -ResDef(MK_MSG_CONTINUE_ADDING, (XP_MSG_BASE + 1276), -"Would you like to add the remaining addresses to the personal address book?") - -ResDef(MK_LDAP_USER_CERTIFICATE, XP_MSG_BASE + 1277, "User Certificate") - -ResDef(MK_LDAP_SMIME_USER_CERTIFICATE, XP_MSG_BASE + 1278, "User E-mail Certificate") - -ResDef(MK_MSG_UNIQUE_TRASH_RENAME_FAILED, XP_MSG_BASE + 1279, -"The Trash already contains a folder named '%s.'\n\ -Please either empty the trash or rename this folder.") - -ResDef(MK_MSG_NEEDED_UNIQUE_TRASH_NAME, XP_MSG_BASE + 1280, -"The Trash already contained a folder named '%s.'\n\ -The folder which you just deleted can be found in the Trash\n\ -under the new name '%s.'") - -ResDef(MK_MSG_IMAP_SERVER_SAID, XP_MSG_BASE + 1281, -"The current command did not succeed. The IMAP server responded:\n%s") - -ResDef(SU_INSTALL_ASK_FOR_DIRECTORY, XP_MSG_BASE + 1282, - "Where would you like to install %s?") - -ResDef(EDT_VIEW_SOURCE_WINDOW_TITLE, XP_MSG_BASE + 1283, -"View Document Source") - -ResDef(LAY_PAGEINFO_NOINFO, XP_MSG_BASE + 1284, -"

No info while document is loading

\n") -ResDef(LAY_PAGEINFO_FRAME, XP_MSG_BASE + 1285, -"
  • Frame: ") -ResDef(LAY_PAGEINFO_IMAGE, XP_MSG_BASE + 1286, -"Image:") -ResDef(LAY_PAGEINFO_EMBED, XP_MSG_BASE + 1287, -"Embed:") -ResDef(LAY_PAGEINFO_APPLET, XP_MSG_BASE + 1288, -"Applet:") -ResDef(LAY_PAGEINFO_BACKGROUND_IMAGE, XP_MSG_BASE + 1289, -"Background Image: ") -ResDef(LAY_PAGEINFO_ACTIONURL, XP_MSG_BASE + 1290, -"
  • Action URL: ") -ResDef(LAY_PAGEINFO_ENCODING, XP_MSG_BASE + 1291, -"
  • Encoding: ") -ResDef(LAY_PAGEINFO_METHOD, XP_MSG_BASE + 1292, -"
  • Method: ") -ResDef(LAY_PAGEINFO_LAYER, XP_MSG_BASE + 1293, -"
  • Layer: ") - -ResDef(MK_MSG_MAC_PROMPT_UUENCODE, XP_MSG_BASE + 1294, -"Some of these attachments contain Macintosh specific information. \ -Using UUENCODE will cause this information to be lost. \ -Continue sending?") - -ResDef(XP_SEC_REENTER_TO_CONFIRM_PWD, XP_MSG_BASE + 1295, -"Re-enter the password to confirm it:") - -ResDef(XP_SEC_BAD_CONFIRM_EXPORT_PWD, XP_MSG_BASE + 1296, -"The passwords entered did not match. Enter\n\ -the password to protect data being exported:") - -ResDef(MK_IMAP_STATUS_CREATING_MAILBOX, XP_MSG_BASE + 1297, -"Creating folder...") - -ResDef(MK_IMAP_STATUS_SELECTING_MAILBOX, XP_MSG_BASE + 1298, -"Opening folder...") - -ResDef(MK_IMAP_STATUS_DELETING_MAILBOX, XP_MSG_BASE + 1299, -"Deleting folder %s...") - -ResDef(MK_IMAP_STATUS_RENAMING_MAILBOX, XP_MSG_BASE + 1300, -"Renaming folder %s...") - -ResDef(MK_IMAP_STATUS_LOOKING_FOR_MAILBOX, XP_MSG_BASE + 1301, -"Looking for folders...") - -ResDef(MK_IMAP_STATUS_SUBSCRIBE_TO_MAILBOX, XP_MSG_BASE + 1302, -"Subscribing to folder %s...") - -ResDef(MK_IMAP_STATUS_UNSUBSCRIBE_MAILBOX, XP_MSG_BASE + 1303, -"Unsubscribing from folder %s...") - -ResDef(MK_IMAP_STATUS_SEARCH_MAILBOX, XP_MSG_BASE + 1304, -"Searching folder...") - -ResDef(MK_IMAP_STATUS_MSG_INFO, XP_MSG_BASE + 1305, -"Getting message info...") - -ResDef(MK_IMAP_STATUS_CLOSE_MAILBOX, XP_MSG_BASE + 1306, -"Closing folder...") - -ResDef(MK_IMAP_STATUS_EXPUNGING_MAILBOX, XP_MSG_BASE + 1307, -"Compacting folder...") - -ResDef(MK_IMAP_STATUS_LOGGING_OUT, XP_MSG_BASE + 1308, -"Logging out...") - -ResDef(MK_IMAP_STATUS_CHECK_COMPAT, XP_MSG_BASE + 1309, -"Checking IMAP server capability...") - -ResDef(MK_IMAP_STATUS_SENDING_LOGIN, XP_MSG_BASE + 1310, -"Sending login information...") - -ResDef(MK_IMAP_STATUS_SENDING_AUTH_LOGIN, XP_MSG_BASE + 1311, -"Sending authenticate login information...") - -ResDef(SU_NEED_TO_REBOOT, XP_MSG_BASE + 1312, - "SmartUpdate is not complete until you reboot Windows") - -ResDef(MK_MSG_REPLY_TO_SENDER, XP_MSG_BASE + 1313, - "to Sender") - -ResDef(MK_ADDR_DEFAULT_EXPORT_FILENAME, XP_MSG_BASE + 1314, - "untitled") - -ResDef(MK_MSG_ADVANCE_TO_NEXT_FOLDER, XP_MSG_BASE + 1315, - "Advance to next unread message in %s?") - -ResDef(MK_PORT_ACCESS_NOT_ALLOWED, XP_MSG_BASE + 1316, - "Sorry, access to the port number given\n\ -has been disabled for security reasons") - -ResDef(XP_PRIORITY_LOWEST, XP_MSG_BASE + 1317, "Lowest") -ResDef(XP_PRIORITY_LOW, XP_MSG_BASE + 1318, "Low") -ResDef(XP_PRIORITY_NORMAL, XP_MSG_BASE + 1319, "Normal") -ResDef(XP_PRIORITY_HIGH, XP_MSG_BASE + 1320, "High") -ResDef(XP_PRIORITY_HIGHEST, XP_MSG_BASE + 1321, "Highest") -ResDef(XP_PRIORITY_NONE, XP_MSG_BASE + 1322, "NONE") - -ResDef(XP_PROGRESS_READ_NEWSGROUP_COUNTS, XP_MSG_BASE + 1323, - "Receiving: message totals: %lu of %lu") - -ResDef(MK_LDAP_AUTH_PROMPT, XP_MSG_BASE + 1324, - "Please enter your %s and password for access to %s") - -ResDef( XP_FOLDER_RECEIVING_MESSAGE_OF, XP_MSG_BASE + 1325, -"%s - Receiving: message %lu of %lu" ) - -ResDef(MK_MSG_COLLABRA_DISABLED, XP_MSG_BASE + 1326, - "Sorry, Collabra has been disabled; newsgroup functionality \ -has been turned off.") - -ResDef(MK_IMAP_DOWNLOADING_MESSAGE, XP_MSG_BASE + 1327, - "Downloading message...") - -ResDef(MK_IMAP_CREATE_FOLDER_BUT_NO_SUBSCRIBE, XP_MSG_BASE + 1328, - "Folder creation succeeded, but "MOZ_NAME_PRODUCT" was unable to subscribe \ -the new folder.") - -ResDef(MK_IMAP_DELETE_FOLDER_BUT_NO_UNSUBSCRIBE, XP_MSG_BASE + 1329, - "Folder deletion succeeded, but "MOZ_NAME_PRODUCT" was unable to unubscribe \ -from the folder.") - -ResDef(MK_IMAP_RENAME_FOLDER_BUT_NO_SUBSCRIBE, XP_MSG_BASE + 1330, - "Folder move succeeded, but "MOZ_NAME_PRODUCT" was unable to subscribe \ -to the new folder name.") - -ResDef(MK_IMAP_RENAME_FOLDER_BUT_NO_UNSUBSCRIBE, XP_MSG_BASE + 1331, - "Folder move succeeded, but "MOZ_NAME_PRODUCT" was unable to unsubscribe \ -from the old folder name.") - -ResDef(XP_MSG_JS_CLOSE_WINDOW, XP_MSG_BASE + 1332, "Close Window?") - -ResDef(XP_MSG_JS_CLOSE_WINDOW_NAME, XP_MSG_BASE + 1333, "Close Window %s?") - -ResDef(MK_ACCESS_YOUR_COOKIES, XP_MSG_BASE + 1334, - "Your Cookies") -ResDef(MK_ACCESS_MAXIMUM_COOKS, XP_MSG_BASE + 1335, - "Maximum number of cookies allowed:") -ResDef(MK_ACCESS_COOK_COUNT, XP_MSG_BASE + 1336, - "The number of cookies you have:") -ResDef(MK_ACCESS_MAXIMUM_COOKS_PER_SERV, XP_MSG_BASE + 1337, - "Maximum number of cookies per server:") -ResDef(MK_ACCESS_MAXIMUM_COOK_SIZE, XP_MSG_BASE + 1338, - "Maximum size of each cookie:") -ResDef(MK_ACCESS_NO_COOKIES, XP_MSG_BASE + 1339, - "You have no cookies.") -ResDef(MK_ACCESS_NAME, XP_MSG_BASE + 1340, - "Name:") -ResDef(MK_ACCESS_VALUE, XP_MSG_BASE + 1341, - "Value:") -ResDef(MK_ACCESS_HOST, XP_MSG_BASE + 1342, - "Host:") -ResDef(MK_ACCESS_SEND_TO_HOST, XP_MSG_BASE + 1343, - "Send to host:") -ResDef(MK_ACCESS_IS_DOMAIN, XP_MSG_BASE + 1344, - "any host in the domain from the host above") -ResDef(MK_ACCESS_IS_NOT_DOMAIN, XP_MSG_BASE + 1345, - "the above fully qualified host only") -ResDef(MK_ACCESS_SEND_TO_PATH, XP_MSG_BASE + 1346, - "Send to path:") -ResDef(MK_ACCESS_AND_BELOW, XP_MSG_BASE + 1347, - " (and below)") -ResDef(MK_ACCESS_SECURE, XP_MSG_BASE + 1348, - "Secure:") -ResDef(MK_ACCESS_EXPIRES, XP_MSG_BASE + 1349, - "Expires:") -ResDef(MK_ACCESS_END_OF_SESSION, XP_MSG_BASE + 1350, - "at end of session") -ResDef(MK_LDAP_HTML_TITLE, XP_MSG_BASE + 1351, - "LDAP Search Results") -ResDef(MK_ACCESS_JAVASCRIPT_COOKIE_FILTER, XP_MSG_BASE + 1352, - "Javascript Cookie Filter Message:\n") -ResDef(MK_JSFILTERDIALOG_EDIT_TITLE, XP_MSG_BASE + 1353, - "Edit JavaScript Message Filter") -ResDef(MK_JSFILTERDIALOG_NEW_TITLE, XP_MSG_BASE + 1354, - "New JavaScript Message Filter") -ResDef(MK_JSFILTERDIALOG_STRING, XP_MSG_BASE + 1355, -"
    \ - \ -
    \ - JavaScript Message Filter \ -%-cont-%") -ResDef(MK_JSFILTERDIALOG_STRING_2, XP_MSG_BASE + 1356, -"
    Filter Name: \n\ - \ -%-cont-%") -ResDef(MK_JSFILTERDIALOG_STRING_3, XP_MSG_BASE + 1357, -"
    JavaScript Function: \n\ - \ -%-cont-%") -ResDef(MK_JSFILTER_DIALOG_STRING_4, XP_MSG_BASE + 1358, -"
    Description: \n\ - \ -%-cont-%") -ResDef(MK_JSFILTER_DIALOG_STRING_5, XP_MSG_BASE + 1359, -"
    Filter is \n\ - onoff \ -
    ") -ResDef(MK_JSFILTER_DIALOG_STRING_6, XP_MSG_BASE + 1360, "") -ResDef(MK_JSFILTER_DIALOG_STRING_7, XP_MSG_BASE + 1361, "") -ResDef(MK_JSFILTER_DIALOG_STRING_8, XP_MSG_BASE + 1362, "") -ResDef(MK_JSFILTER_DIALOG_STRING_9, XP_MSG_BASE + 1363, "") -ResDef(MK_JSFILTER_DIALOG_STRING_10, XP_MSG_BASE + 1364, "") -ResDef(MK_MSG_RETRIEVE_SELECTED, XP_MSG_BASE + 1365, - "Retrieve selected messages") -ResDef(MK_MSG_RETRIEVE_FLAGGED, XP_MSG_BASE + 1366, - "Retrieve flagged messages") - -ResDef(MK_IMAP_STATUS_GETTING_NAMESPACE, XP_MSG_BASE + 1367, - "Checking IMAP Namespace...") - -ResDef(MK_LDAP_REPL_CHANGELOG_BOGUS, XP_MSG_BASE + 1368, - "Can't replicate because the server's change log appears incomplete.") -ResDef(MK_LDAP_REPL_DSE_BOGUS, XP_MSG_BASE + 1369, - "Can't replicate because the server's replication information appears incomplete.") -ResDef(MK_LDAP_REPL_CANT_SYNC_REPLICA, XP_MSG_BASE + 1370, - "Can't replicate because the replica is too far out of date with the server.") -ResDef(MK_ADD_ADDRESSBOOK, XP_MSG_BASE + 1371, - "New Address Book...") -ResDef(MK_ADD_LDAPDIRECTORY, XP_MSG_BASE + 1372, - "New Directory...") -#ifdef XP_WIN16 -ResDef (MK_MSG_TEMPLATES_L10N_NAME, XP_MSG_BASE + 1373, "Template") -#else -ResDef (MK_MSG_TEMPLATES_L10N_NAME, XP_MSG_BASE + 1373, "Templates") -#endif -ResDef (MK_MSG_SAVING_AS_DRAFT, XP_MSG_BASE + 1374, "Saving as draft ...") -ResDef (MK_MSG_SAVING_AS_TEMPLATE, XP_MSG_BASE + 1375, "Saving as template ...") - -ResDef(MK_MSG_ADDBOOK_MOUSEOVER_TEXT, XP_MSG_BASE + 1376, - "Add %s to your Address Book") -ResDef(MK_MSG_ENTER_NAME_FOR_TEMPLATE, XP_MSG_BASE + 1377, - "Enter a name for your new message template.") - -ResDef(MK_MSG_MDN_DISPLAYED, XP_MSG_BASE + 1378, -MOZ_NAME_BRAND" Messenger has displayed the message. There is no guarantee \ -that the content has been read or understood.") - -ResDef(MK_MSG_MDN_DISPATCHED, XP_MSG_BASE + 1379, -"The message has been sent somewhere in some manner (e.g., printed, faxed, forwarded) \ -without being displayed to the person you sent it to. They may or may not \ -see it later.") - -ResDef(MK_MSG_MDN_PROCESSED, XP_MSG_BASE + 1380, -"The message has been processed in some manner (i.e., by some sort of rules or \ -server) without being displayed to the person you sent it to. They may or may not see it \ -later. There may not even be a human user associated the mailbox.") - -ResDef(MK_MSG_MDN_DELETED, XP_MSG_BASE + 1381, -"The message has been deleted. The person you sent it to may or may not have seen it. \ -They might \042undelete\042 it at a later time and read it.") - -ResDef(MK_MSG_MDN_DENIED, XP_MSG_BASE + 1382, -"The recipient of the message does not wish to send a return receipt back to \ -you.") - -ResDef(MK_MSG_MDN_FAILED, XP_MSG_BASE + 1383, -"A failure occurred. A proper return receipt could not be generated or sent to \ -you.") - -ResDef(MK_MSG_MDN_WISH_TO_SEND, XP_MSG_BASE + 1384, -"The sender of the message requested a receipt to be returned. \n\ -Do you wish to send one?") - -ResDef(MK_MSG_DELIV_IMAP, XP_MSG_BASE + 1385, - "Delivering message...") -ResDef(MK_MSG_DELIV_IMAP_DONE, XP_MSG_BASE + 1386, - "Delivering message... Done") -ResDef(MK_MSG_IMAP_DISCOVERING_MAILBOX, XP_MSG_BASE + 1387, -"Found folder: %s") - -ResDef(MK_MSG_UNABLE_TO_SAVE_DRAFT, XP_MSG_BASE + 1388, -MOZ_NAME_BRAND" is unable to save your message as a draft. Please make sure \n\ -that your Drafts mail folder is correctly chosen in your Mail and \n\ -Newsgroups preferences.") -ResDef(MK_MSG_UNABLE_TO_SAVE_TEMPLATE, XP_MSG_BASE + 1389, -MOZ_NAME_BRAND" is unable to save your message as a template. Please make \n\ -sure that your Templates mail folder is correctly chosen in your Mail \n\ -and Newsgroups preferences.") - -ResDef(MK_MSG_IMAP_INBOX_NAME, XP_MSG_BASE + 1390, "Inbox") - -ResDef(MK_IMAP_UPGRADE_NO_PERSONAL_NAMESPACE, XP_MSG_BASE + 1391, "The IMAP server indicates that \ -you have may not have any personal mail folders.\nPlease verify your subscriptions.") - -ResDef(MK_IMAP_UPGRADE_TOO_MANY_FOLDERS, XP_MSG_BASE + 1392, "While trying to automatically subscribe, \ -"MOZ_NAME_PRODUCT" has found a large number of IMAP folders.\nPlease select which folders you would like subscribed.") - -ResDef(MK_IMAP_UPGRADE_PROMPT_USER, XP_MSG_BASE + 1393, -MOZ_NAME_PRODUCT" has detected that you have upgraded from a previous version of Communicator.\n\ -You will need to choose which IMAP folders you want subscribed.") - -ResDef(MK_IMAP_UPGRADE_PROMPT_USER_2, XP_MSG_BASE + 1394, -"Any folders which are left unsubscribed will not appear in your folder lists,\n\ -but can be subscribed to later by choosing File / Subscribe.") - -ResDef(MK_IMAP_UPGRADE_PROMPT_QUESTION, XP_MSG_BASE + 1395, -"Would you like "MOZ_NAME_PRODUCT" to try to automatically subscribe to all your folders?") - -ResDef(MK_IMAP_UPGRADE_CUSTOM, XP_MSG_BASE + 1396, -"Please choose which folders you want subscribed in the Subscribe window...") - -ResDef(MK_IMAP_UPGRADE_WAIT_WHILE_UPGRADE, XP_MSG_BASE + 1397, -"Please wait while "MOZ_NAME_PRODUCT" upgrades you to use IMAP subscriptions...") - -ResDef(MK_IMAP_UPGRADE_SUCCESSFUL, XP_MSG_BASE + 1398, -"Upgrade to IMAP subscription successful.") - -ResDef(MK_POP3_ONLY_ONE, XP_MSG_BASE + 1399, -"You cannot add another server, because you are using POP.") - -ResDef(MK_MSG_REMOVE_MAILHOST_CONFIRM, XP_MSG_BASE + 1400, -"Are you sure you want to delete this server?\n\ -All mail downloaded from this server will be erased from your hard drive, and you cannot undo.") - -ResDef(MK_IMAP_GETTING_ACL_FOR_FOLDER, XP_MSG_BASE + 1401, -"Getting folder ACL...") - -ResDef(MK_MSG_EXPIRE_NEWS_ARTICLES, XP_MSG_BASE + 1402, -"Click here to remove all expired articles") - -ResDef(MK_MDN_DISPLAYED_RECEIPT, XP_MSG_BASE + 1403, -"Return Receipt (displayed)") - -ResDef(MK_MDN_DISPATCHED_RECEIPT, XP_MSG_BASE + 1404, -"Return Receipt (dispatched)") - -ResDef(MK_MDN_PROCESSED_RECEIPT, XP_MSG_BASE + 1405, -"Return Receipt (processed)") - -ResDef(MK_MDN_DELETED_RECEIPT, XP_MSG_BASE + 1406, -"Return Receipt (deleted)") - -ResDef(MK_MDN_DENIED_RECEIPT, XP_MSG_BASE + 1407, -"Return Receipt (denied)") - -ResDef(MK_MDN_FAILED_RECEIPT, XP_MSG_BASE + 1408, -"Return Receipt (failed)") - -ResDef(MK_IMAP_GETTING_SERVER_INFO, XP_MSG_BASE + 1409, -"Getting Server Configuration Info...") - -ResDef(MK_IMAP_GETTING_MAILBOX_INFO, XP_MSG_BASE + 1410, -"Getting Mailbox Configuration Info...") - -ResDef(MK_IMAP_EMPTY_MIME_PART, XP_MSG_BASE + 1411, -"This body part will be downloaded on demand.") - - -#define LI_MSG_BASE XP_MSG_BASE + 1500 -ResDef(LI_DOWN_CONFLICT_1, LI_MSG_BASE+1, "\ -Local and server copies of %0% are in conflict. What would you like to do:

    \ -%-cont-%") - -ResDef(LI_DOWN_CONFLICT_2, LI_MSG_BASE+2, "\ -\ -%-cont-%") - -ResDef(LI_DOWN_CONFLICT_3, LI_MSG_BASE+3, "\ -\ -\ -

    \ -%-cont-%") - -ResDef(LI_DOWN_CONFLICT_4, LI_MSG_BASE+4, "\ -

    \ -%-cont-%") - -ResDef(LI_DOWN_CONFLICT_5, LI_MSG_BASE+5, "\ -\ -%-cont-%") - -ResDef(LI_DOWN_CONFLICT_6, LI_MSG_BASE+6, "\ -Do this for all the remaining files \ -") - -ResDef(LI_DOWN_TITLE, LI_MSG_BASE+7, "\ -Download conflict") - -ResDef(LI_UP_CONFLICT_1, LI_MSG_BASE+8, "\ -Local and server copies of %0% are in conflict. What would you like to do:

    \ -%-cont-%") - -ResDef(LI_UP_CONFLICT_2, LI_MSG_BASE+9, "\ -\ -%-cont-%") - -ResDef(LI_UP_CONFLICT_3, LI_MSG_BASE+10, "\ -\ -\ -

    \ -%-cont-%") - -ResDef(LI_UP_CONFLICT_4, LI_MSG_BASE+11, "\ -

    \ -%-cont-%") - -ResDef(LI_UP_CONFLICT_5, LI_MSG_BASE+12, "\ -\ -Do this for all the remaining files \ -") - -ResDef(LI_UP_TITLE, LI_MSG_BASE+13, "\ -Upload conflict") - -ResDef(LI_INIT_LATER, LI_MSG_BASE+14, -"Your new location independence preference\n\ -will take effect the next time\n\ -you restart Communicator.") - - -#define RDF_MSG_BASE XP_MSG_BASE + 2000 - -ResDef(RDF_HTML_STR, RDF_MSG_BASE+1, "\ -

    %0%

    %1%") - -ResDef(RDF_HTML_STR_1, RDF_MSG_BASE+2, "\ -%s:\n") - -ResDef(RDF_HTML_STR_2, RDF_MSG_BASE+3, "\ -%s:\n") - -ResDef(RDF_HTML_STR_3, RDF_MSG_BASE+4, "\ -%s:%s\n") - -ResDef(RDF_HTML_STR_4, RDF_MSG_BASE+5, "\ - %s
    \n") - -ResDef(RDF_HTML_STR_5, RDF_MSG_BASE+6, "\ -%s:\n") - -ResDef(RDF_HTML_WINDATE, RDF_MSG_BASE+7, "%#m/%#d/%Y %#I:%M %p") -ResDef(RDF_HTML_MACDATE, RDF_MSG_BASE+8, "%m/%d/%Y %I:%M %p") - -ResDef(RDF_DATA_1, RDF_MSG_BASE+9, "Untitled URL") -ResDef(RDF_DATA_2, RDF_MSG_BASE+10, "Untitled Folder") -ResDef(RDF_DELETEFILE, RDF_MSG_BASE+11, "Delete file '%s' ?") -ResDef(RDF_UNABLETODELETEFILE, RDF_MSG_BASE+12, "File: '%s' could not be deleted.") -ResDef(RDF_DELETEFOLDER, RDF_MSG_BASE+13, "Delete folder '%s' and its contents?") -ResDef(RDF_UNABLETODELETEFOLDER, RDF_MSG_BASE+14, "Folder: '%s' could not be deleted.") -ResDef(RDF_NEWPASSWORD, RDF_MSG_BASE+15, "New Password:") -ResDef(RDF_CONFIRMPASSWORD, RDF_MSG_BASE+16, "Confirm New Password:") -ResDef(RDF_MISMATCHPASSWORD, RDF_MSG_BASE+17, "Passwords did not match.") -ResDef(RDF_ENTERPASSWORD, RDF_MSG_BASE+18, "Enter Password for '%s' ?") -ResDef(RDF_SITEMAPNAME, RDF_MSG_BASE+19, "Sitemap") -ResDef(RDF_RELATEDLINKSNAME, RDF_MSG_BASE+20, "Related Links") -ResDef(RDF_DEFAULTCOLUMNNAME, RDF_MSG_BASE+21, "Name") -ResDef(RDF_NEWWORKSPACEPROMPT, RDF_MSG_BASE+22, "New workspace name:") -ResDef(RDF_DELETEWORKSPACE, RDF_MSG_BASE+23, "Delete workspace '%s' and its contents?") - -ResDef(RDF_ADDITIONS_ALLOWED, RDF_MSG_BASE+24, "Additions allowed") -ResDef(RDF_DELETION_ALLOWED, RDF_MSG_BASE+25, "Deletion allowed") -ResDef(RDF_ICON_URL_LOCKED, RDF_MSG_BASE+26, "Icon URL locked") -ResDef(RDF_NAME_LOCKED, RDF_MSG_BASE+27, "Name locked") -ResDef(RDF_COPY_ALLOWED, RDF_MSG_BASE+28, "Copies allowed") -ResDef(RDF_MOVE_ALLOWED, RDF_MSG_BASE+29, "Moves allowed") -ResDef(RDF_WORKSPACE_POS_LOCKED, RDF_MSG_BASE+30, "Workspace position locked") - -ResDef(RDF_WEEKOF, RDF_MSG_BASE+31, "Week of %d/%d/%d") -ResDef(RDF_WITHINLASTHOUR, RDF_MSG_BASE+32, "Within the last hour") -ResDef(RDF_TODAY, RDF_MSG_BASE+33, "Today") - -#define RDF_DAY_BASE RDF_MSG_BASE + 34 -ResDef(RDF_DAY_0, RDF_DAY_BASE+0, "Sunday") -ResDef(RDF_DAY_1, RDF_DAY_BASE+1, "Monday") -ResDef(RDF_DAY_2, RDF_DAY_BASE+2, "Tuesday") -ResDef(RDF_DAY_3, RDF_DAY_BASE+3, "Wednesday") -ResDef(RDF_DAY_4, RDF_DAY_BASE+4, "Thursday") -ResDef(RDF_DAY_5, RDF_DAY_BASE+5, "Friday") -ResDef(RDF_DAY_6, RDF_DAY_BASE+6, "Saturday") - -#define RDF_CMD_BASE RDF_MSG_BASE + 41 -ResDef(RDF_CMD_0, RDF_CMD_BASE+0, " ") -ResDef(RDF_CMD_1, RDF_CMD_BASE+1, "Open or Close") -ResDef(RDF_CMD_2, RDF_CMD_BASE+2, "Open File") -ResDef(RDF_CMD_3, RDF_CMD_BASE+3, "Print") -ResDef(RDF_CMD_4, RDF_CMD_BASE+4, "Open URL In New Window") -ResDef(RDF_CMD_5, RDF_CMD_BASE+5, "Open URL in Composer") -ResDef(RDF_CMD_6, RDF_CMD_BASE+6, "Open As Workspace") -ResDef(RDF_CMD_7, RDF_CMD_BASE+7, "New Bookmark") -ResDef(RDF_CMD_8, RDF_CMD_BASE+8, "New Folder") -ResDef(RDF_CMD_9, RDF_CMD_BASE+9, "New Separator") -ResDef(RDF_CMD_10, RDF_CMD_BASE+10, "Make Alias") -ResDef(RDF_CMD_11, RDF_CMD_BASE+11, "Add To Bookmarks") -ResDef(RDF_CMD_12, RDF_CMD_BASE+12, "Save As...") -ResDef(RDF_CMD_13, RDF_CMD_BASE+13, "Create Shortcut") -ResDef(RDF_CMD_14, RDF_CMD_BASE+14, "Set Personal Toolbar Folder") -ResDef(RDF_CMD_15, RDF_CMD_BASE+15, "Set Bookmark Menu") -ResDef(RDF_CMD_16, RDF_CMD_BASE+16, "Set New Bookmark Folder") -ResDef(RDF_CMD_17, RDF_CMD_BASE+17, "Cut") -ResDef(RDF_CMD_18, RDF_CMD_BASE+18, "Copy") -ResDef(RDF_CMD_19, RDF_CMD_BASE+19, "Paste") -ResDef(RDF_CMD_20, RDF_CMD_BASE+20, "Delete File...") -ResDef(RDF_CMD_21, RDF_CMD_BASE+21, "Delete Folder...") -ResDef(RDF_CMD_22, RDF_CMD_BASE+22, "Reveal in Finder") -ResDef(RDF_CMD_23, RDF_CMD_BASE+23, "Properties...") -ResDef(RDF_CMD_24, RDF_CMD_BASE+24, "Rename Workspace") -ResDef(RDF_CMD_25, RDF_CMD_BASE+25, "Delete Workspace...") -ResDef(RDF_CMD_26, RDF_CMD_BASE+26, "Move Workspace Up") -ResDef(RDF_CMD_27, RDF_CMD_BASE+27, "Move Workspace Down") -ResDef(RDF_CMD_28, RDF_CMD_BASE+28, "Refresh") -ResDef(RDF_CMD_29, RDF_CMD_BASE+29, "Export...") -ResDef(RDF_CMD_30, RDF_CMD_BASE+30, "Remove as Bookmark Menu") -ResDef(RDF_CMD_31, RDF_CMD_BASE+31, "Remove as New Bookmark Folder") -ResDef(RDF_CMD_32, RDF_CMD_BASE+32, "Set Password...") -ResDef(RDF_CMD_33, RDF_CMD_BASE+33, "Remove Password...") -ResDef(RDF_CMD_34, RDF_CMD_BASE+34, "Export All...") -ResDef(RDF_CMD_35, RDF_CMD_BASE+35, "Undo") -ResDef(RDF_CMD_36, RDF_CMD_BASE+36, "New Workspace...") -ResDef(RDF_CMD_37, RDF_CMD_BASE+37, "Rename") - - -END_STR(mcom_include_xp_msg_i_strings) - -/* WARNING: DO NOT TAKE ERROR CODE -666, it is used internally - by the message lib */ - - -#endif /* _ALLXPSTR_H_ */ - diff --git a/l10nkits/client/windows/docs/nav40/branding.html b/l10nkits/client/windows/docs/nav40/branding.html deleted file mode 100644 index a19cfc0cb08..00000000000 --- a/l10nkits/client/windows/docs/nav40/branding.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Product Branding Issues - - - -

    -Product Branding Instructions

    -Under the terms of the Unlimited Localization Program, you must remove -or replace all trademarked Netscape terms, brand names, icons, images, -etc.  These trademarks are listed on the page found at the following -URL: - -

    http://home.netscape.com/misc/trademarks.html#trademarks - -

    Please refer to that page for details.  You may not release a localized -version of the Netscape Communicator with these trademarks left in the -product. -
      -

    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -

    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/charsets.htm b/l10nkits/client/windows/docs/nav40/charsets.htm deleted file mode 100644 index 95e254dc806..00000000000 --- a/l10nkits/client/windows/docs/nav40/charsets.htm +++ /dev/null @@ -1,383 +0,0 @@ - - - - - HTML Output of: C:\TEMP\CHARSET.DBF - - - -

    -CSID REFERENCE TABLE

    -Use this table to determine the Character Set ID (CSID) for the character -set you wish to use, for example, for setting the value of  pref("intl.character_set") -in ALL_PREFS. -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CSIDCHARSET
    0CS_DEFAULT
    1CS_ASCII
    2CS_LATIN1
    6CS_MAC_ROMAN
    10CS_LATIN2
    11CS_MAC_CE
    14CS_8859_3
    15CS_8859_4
    16CS_8859_5
    17CS_8859_6
    18CS_8859_7
    19CS_8859_8
    20CS_8859_9
    21CS_SYMBOL
    22CS_DINGBATS
    23CS_DECTECH
    27CS_JISX0201
    29CS_TIS620
    35CS_UTF7
    38CS_USRDEF2
    39CS_KOI8_R
    40CS_MAC_CYRILLIC
    41CS_CP_1251
    42CS_MAC_GREEK
    43CS_CP_1253
    44CS_CP_1250
    45CS_CP_1254
    46CS_MAC_TURKISH
    53INTL_CHAR_SET_MAX
    254CS_USER_DEFINED_ENCODING
    255CS_UNKNOWN
    260CS_SJIS
    261CS_EUCJP
    263CS_BIG5
    264CS_GB_8BIT
    265CS_CNS_8BIT
    280CS_CNS11643_1
    281CS_CNS11643_2
    282CS_JISX0208
    284CS_KSC5601
    286CS_JISX0212
    287CS_GB2312
    290CS_UTF8
    292CS_NPC
    293CS_X_BIG5
    303CS_GB2312_11
    304CS_JISX0208_11
    305CS_KSC5601_11
    306CS_CNS11643_1110
    515CS_JIS
    525CS_2022_KR
    564CS_IMAP4_UTF7
    810CS_UCS2
    811CS_UCS4
    819CS_UCS2_SWAP
    1292CS_KSC_8BIT
    2308CS_SJIS_AUTO
    2309CS_EUCJP_AUTO
    2563CS_JIS_AUTO
    -@author: relliott -
    @source: ftang -
    @last updated: Mar. 19, 1998 -
    1997, Copyright Netscape -Communications Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/gettingStarted.html b/l10nkits/client/windows/docs/nav40/gettingStarted.html deleted file mode 100644 index 1d8fe51202d..00000000000 --- a/l10nkits/client/windows/docs/nav40/gettingStarted.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Getting Started - - - -

    -2. Getting Started

    -Before you can begin using the Windows Front End Localization Kit, you -must install it and setup your working directories. This is a simple matter -of unzipping the compressed kit file(s) into the proper directories. Your -system must also meet certain requirements to run the tools needed to perform -the localization steps described below. - -

    -


    -

    -System Requirements

    -There a few system requirements for the kit in the strictest sense; however, -your choice of tools will have their own set of requirements.  The -most likely minimum configuration will be as follows: -
      -
    • -100% IBM compatible PC
    • - -
    • -Pentium® processor
    • - -
    • -Microsoft® Windows NT 3.51 or 4.0 (localized -versions will help testing but aren't required)
    • - -
    • -16 MB RAM
    • - -
    • -30 MB available hard disk space
    • - -
    • -A visual resource editor, such as those provided with Microsoft® -Visual C++, Borland® C++, etc.
    • - -
    • -An active Internet connection and the ability to ftp (send and receive) -large files
    • - -
    • -A Web browser (say, for example, Netscape Communicator ;-)
    • -
    - -

    - -

    - -

    -Installing the Kit

    -It is recommended that you install the Windows Front End Localization Kit -in a brand new directory on your development machine. For example, you -can create a \Netscape_L10N_Kits directory on your hard drive. This becomes -your kitRoot directory.  Place the L10n Kit's .ZIP file in -that directory and UNZIP it with the -d parameter: - -

    PKUNZIP -d filename -

      Example:  PKUNZIP -d winfekit
    - -
    -

    -Configuring Your Tools

    -If you intend to use the Netscape Translation Tools, please refer to the -Translation Tools User Guide for -instructions on setting up and using those tools.  If you intend to -use a different localization tool, please refer to that tool's documentation -for set up and usage instructions. -
      -
    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/idBuild.jpg b/l10nkits/client/windows/docs/nav40/idBuild.jpg deleted file mode 100644 index 3082e454d8c781027f054840ba9136ee242b577a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57205 zcmeFYcT`i|_AVTHM+i--1QH-1D7~t5Naz6qga9fay*DW;9i)a3Km`;qp-4xnC<4+^ zdMETIy(yqrKF;|0zUSU^&b{BbW86Q!`;D9AkGZq=n)8{@oNKR@xo3V){ayqx!L?!9 z01^@afaKy0_&p2I08mp>Qc+S+Q&CaT&`{ITvog@r(b01PSuU~ia$Vu$<>KMt2TKU^ z3tScC;SrICUcD|UBO`M~Sn-B}l!}D3jMP7rkkHW3(9_XhW?;B11>ylo{V%_Mw*r`{ zNjypO$w&kMq|78_%p|`%06Z5UNy$k5f%mT$1tl3d6)6ez#aU}600|ixDH$mhEiEMl zE#<|9q-5j(3T7aPl0}kLfJ)883_mi;#vv$We#a*Qm%%PAr;hMXORpXVB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ru5-vj`p?X)KV diff --git a/l10nkits/client/windows/docs/nav40/imageEJR.JPG b/l10nkits/client/windows/docs/nav40/imageEJR.JPG deleted file mode 100644 index 1d1f02f7ef0ac80ff7e36763f9f016c4e4a61d7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21513 zcmeFYbyQrz)+gEoX)L&V0trrVhem=+;{ z5aH((X5-@K{6`}QXlQ7d7?>olUz2dYp?Jgje|$Z+18`9hkP$)=5#9n`;UXa7B0P5k zs9(m3jPM^9;J;r8uMm-tQGlpu=ol|I)ZhSKAs`~YLPA7FMnZbI+yCW%01_@T-Wv{a z6ns?^;9F+`&Y;*VR9cCO4nno@Q#vkFmtZt>B4QF!vUl(485o(kd3gEw1q3BON=eJe z%E_y1XliMH($O_Dx3ILbwy||}bNBG{^7aY&`Ykl<`;YLr_=LoyzmuVf8as@ zApSR4FW>(S*uUYzeZln#2?-Gi_zzqNuRLD_5f=&h4F?LIxGK=Z8UHP35GsL0Y*s}F z8ZDRFDWR#$I64s>_xd~dKcM{wvi};e;QuRR|1YrriE9CXiHPvBc!;lD0rTt6*Okr2$Zl!~nxEsFJr2D~0_L8Co&lNEm;q~_p8*e+MO}2UehL-V zKT!l(HsgQ~wV_S*HE5c_!wsxy#%5GGnP4Nc%Q87rn@+zt0uy)Fn5RBC?BV9d>=}S) z^$ghL4luhpfAaI=cm@PjJpU0GIT<5q(EDdki6(|}6>+7Pv zAqPDJNOSI~`!dfr*P|a^XFdZWXS2pN%_$1cp@#uf0nq4B&?#@g6PL`tK2t849YM1# zlkx98isyPAJ_CmS$5Vzs6hA|x(T-A-`w3KG&w#ln;eQ4k{V!b@JaEwsH2Cg^1m{RQZX($P*BB#_cK6Ll;j!EKK~538KM5SF|=TXvxFp4dH?H(t^W--&#s&5 z|MjB$r!n|Y66pN@llI?sf4O9t)dp5UK+X-VO4}rxDAXG_!n}#FHiQXfJ%|#GlCf}k z?w3n18#wFR|7M9g_cG{j694EaITswfcKRDU@m9u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pc820HOBIJoD;rJX0>`A>c9p?-J%V9}g*%G@Bov->nW9RzbHs{y!$1vm#o sI=eDXv-&!wGw0#qDMI1hedhbpzq>#HzNQE-QDn - - - - - ISO Locale codes - - - -
    -

    -ISO Language and Country Codes

    -2 letter language codes are derived from the ISO 639 standard; country -codes are from ISO 3166. Here are the codes for the locales currently supported -by the L10n kits. If an entry also includes the country code then you must -use that as well when creating the locale directory or naming a file. -

    -ISO Language and Country Codes table

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Language NameLanguage CodeCountry Code
    -
    Chinese (Traditional)
    -
    -
    zh
    -
    -
    CN
    -
    -
    Chinese (Simplified)
    -
    -
    zh
    -
    -
    TW
    -
    -
    Danish
    -
    -
    da
    -
    -
    DK
    -
    -
    Dutch
    -
    -
    nl
    -
    -
    NL
    -
    -
    French
    -
    -
    fr
    -
    -
    FR
    -
    -
    German
    -
    -
    de
    -
    -
    DE
    -
    -
    Italian
    -
    -
    it
    -
    -
    IT
    -
    -
    Japanese
    -
    -
    ja
    -
    -
    JP
    -
    -
    Korean
    -
    -
    ko
    -
    -
    KR
    -
    -
    Portuguese
    -
    -
    pt
    -
    -
    BR
    -
    -
    Spanish
    -
    -
    es
    -
    -
    ES
    -
    -
    Swedish
    -
    -
    sv
    -
    -
    SE
    -
    - -

    -1997, Copyright Netscape Communications -Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/isonames.htm b/l10nkits/client/windows/docs/nav40/isonames.htm deleted file mode 100644 index f3603451c68..00000000000 --- a/l10nkits/client/windows/docs/nav40/isonames.htm +++ /dev/null @@ -1,1029 +0,0 @@ - - - - - Named Entities and Numeric Character References - - - -

    -Named Entities and Numeric Character References

    -The following table lists all of the named entities found in the -official HTML 2.0 RFC. - -

    1st column shows the HTML source of the named entity -
    2nd column shows the result of using that named entity -
    3rd column shows the HTML source of the equivalent numeric character -reference -
    4th column shows the result of using that numeric character reference - -

    The 2nd and 4th columns should look identical. -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    &quot;"&#34;"
    &amp;&&#38;&
    &lt;<&#60;<
    &gt;>&#62;>
    &nbsp; &#160; 
    &iexcl;¡&#161;¡
    &cent;¢&#162;¢
    &pound;£&#163;£
    &curren;¤&#164;¤
    &yen;¥&#165;¥
    &brvbar;¦&#166;¦
    &sect;§&#167;§
    &uml;¨&#168;¨
    &copy;©&#169;©
    &ordf;ª&#170;ª
    &laquo;«&#171;«
    &not;¬&#172;¬
    &shy;­&#173;­
    &reg;®&#174;®
    &macr;¯&#175;¯
    &deg;°&#176;°
    &plusmn;±&#177;±
    &sup2;²&#178;²
    &sup3;³&#179;³
    &acute;´&#180;´
    &micro;µ&#181;µ
    &para;&#182;
    &middot;·&#183;·
    &cedil;¸&#184;¸
    &sup1;¹&#185;¹
    &ordm;º&#186;º
    &raquo;»&#187;»
    &frac14;¼&#188;¼
    &frac12;½&#189;½
    &frac34;¾&#190;¾
    &iquest;¿&#191;¿
    &Agrave;À&#192;À
    &Aacute;Á&#193;Á
    &Acirc;Â&#194;Â
    &Atilde;Ã&#195;Ã
    &Auml;Ä&#196;Ä
    &Aring;Å&#197;Å
    &AElig;Æ&#198;Æ
    &Ccedil;Ç&#199;Ç
    &Egrave;È&#200;È
    &Eacute;É&#201;É
    &Ecirc;Ê&#202;Ê
    &Euml;Ë&#203;Ë
    &Igrave;Ì&#204;Ì
    &Iacute;Í&#205;Í
    &Icirc;Î&#206;Î
    &Iuml;Ï&#207;Ï
    &ETH;Ð&#208;Ð
    &Ntilde;Ñ&#209;Ñ
    &Ograve;Ò&#210;Ò
    &Oacute;Ó&#211;Ó
    &Ocirc;Ô&#212;Ô
    &Otilde;Õ&#213;Õ
    &Ouml;Ö&#214;Ö
    &times;×&#215;×
    &Oslash;Ø&#216;Ø
    &Ugrave;Ù&#217;Ù
    &Uacute;Ú&#218;Ú
    &Ucirc;Û&#219;Û
    &Uuml;Ü&#220;Ü
    &Yacute;Ý&#221;Ý
    &THORN;Þ&#222;Þ
    &szlig;ß&#223;ß
    &agrave;à&#224;à
    &aacute;á&#225;á
    &acirc;â&#226;â
    &atilde;ã&#227;ã
    &auml;ä&#228;ä
    &aring;å&#229;å
    &aelig;æ&#230;æ
    &ccedil;ç&#231;ç
    &egrave;è&#232;è
    &eacute;é&#233;é
    &ecirc;ê&#234;ê
    &euml;ë&#235;ë
    &igrave;ì&#236;ì
    &iacute;í&#237;í
    &icirc;î&#238;î
    &iuml;ï&#239;ï
    &eth;ð&#240;ð
    &ntilde;ñ&#241;ñ
    &ograve;ò&#242;ò
    &oacute;ó&#243;ó
    &ocirc;ô&#244;ô
    &otilde;õ&#245;õ
    &ouml;ö&#246;ö
    &divide;÷&#247;÷
    &oslash;ø&#248;ø
    &ugrave;ù&#249;ù
    &uacute;ú&#250;ú
    &ucirc;û&#251;û
    &uuml;ü&#252;ü
    &yacute;ý&#253;ý
    &thorn;þ&#254;þ
    &yuml;ÿ&#255;ÿ
    - -


    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/kitOverview.html b/l10nkits/client/windows/docs/nav40/kitOverview.html deleted file mode 100644 index d3fa4b99683..00000000000 --- a/l10nkits/client/windows/docs/nav40/kitOverview.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - Kit Overview - - - -

    -Kit Overview

    -This kit is primarily intended for knowledgeable 3rd parties, familiar -with the localization process and with commonly available localization -and resource editing tools.  Using this kit, you will localize the -components that make up the Windows front end (the Windows-specific, -user visible portions) of the Netscape Communicator or Navigator. You may -use the Netscape-developed translation tools (DogLev and ToolCool) or another -tool set of your choice to leverage and localize STRING TABLE, MENU, DIALOG -and certain DATA resource types. You will need to use a Windows compatible -resource editor to localize the remaining DATA resources and to resize -DIALOGs. -
      -
    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/kitStruct.html b/l10nkits/client/windows/docs/nav40/kitStruct.html deleted file mode 100644 index 6106dce9ec7..00000000000 --- a/l10nkits/client/windows/docs/nav40/kitStruct.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - Kit Structure - - - -

    -Kit Structure and Organization

    -When you install this Localization Kit you will find a number of new directories -on your hard disk. Each directory is named so as to be fairly self-explanatory, -but the following diagram and description may help avoid any confusion -you may have about what's what. -

    -

    - -

    -Description of Kit Directories

    - -
      -
    • -The kitRoot directory is wherever you install the Netscape -Localization Kits.
    • - -
    • -The l10nkits directory contains the tools and documentation -you need to complete your work (see below)
    • - -
    • -The products directory contains the English language version -of the files you will be translating. This kit concerns the files contained -in the 32 bit Windows client product.
    • -
    -The l10nkit directory tree has the following structure: - -

    -

      -
    • -Since this kit concerns the Windows client Communicator product (as opposed -to our server products) all the relevant documentation and tools are found -under the client\windows directory.
    • - -
    • -The docs directory contains documentation on the Kit, including -the file you are reading now.
    • - -
    • -The tools directory contains any tools provided with the -Kit, such as the Netscape Translation Tool.
    • -
    -  -
    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    - - - diff --git a/l10nkits/client/windows/docs/nav40/l10ntree.jpg b/l10nkits/client/windows/docs/nav40/l10ntree.jpg deleted file mode 100644 index b05ad158ffdb092b7e2a3f4eec12d77cbaa93275..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5947 zcmbtYcTm&Yw*El~0RbtZ(p$no>0N4QN)Zr<(#t`5hkzix3IYP5BOL|lQlvzR0tX== zO{9|uC?ygI61vpKdGF1gd*|JM?!2{U%{P0kJ>OolXU|@1?TguqC4k|+rj8~+Mg{<6 zmjk%K0vZ4nB_)IsOa*~JsHv&0&@$7}($LVdGF_u*=49jM;$-9C;DLz>@bC#kIXG_J zxh*U%AuTPipufZYhfsjYK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pc(cln+5i^@8G1_E_8(PzF^=s=Kvos)klJFRVS4yM3!$C#)_SX~Y-Jk=!9^K1Bt>!)mahh8TQp*Smsb;1)DgXdT3xMYnYiOi2t z>-82prQ8wTcK#dx+r#}6u+{cYn5IjI(-Ks@;a8PU86w`toceFl$KcsqOZNZuGwuJ( IR4(TJ3-U=!XaE2J diff --git a/l10nkits/client/windows/docs/nav40/localizeAboutplg.html b/l10nkits/client/windows/docs/nav40/localizeAboutplg.html deleted file mode 100644 index a06206ad25d..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeAboutplg.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - Localizing ABOUTPLG - - - -

    -Localization Notes for ABOUTPLG

    -This resource contains the HTML and JavaScript source of the about:plugins -page. You only need to translate the user-visible portions of this file, -as indicated below. DO NOT translate tags or JavaScript language elements. -Unless you plan to create and support your own plugins, you probably should -not localize the URL contained in this page. - -

    Note: this is a cross platform resource; you may be able to reuse this -localization work for Macintosh and/or Unix versions. - -

    Just translate the items in magenta: -

      -
    • -<TITLE>About Plug-ins</TITLE>
    • - -
    • -document.writeln("<b><font size=+3>Installed -plug-ins</font></b><br>");
    • - -
    • -document.writeln("<b><font size=+2>No plug-ins -are installed.</font></b><br>");
    • - -
    • -document.writeln("For more information on Netscape -plug-ins,
    • - -
      <A REF=http://home.netscape.com/comprod/products/navigator/version_2.0/plugins/index.html> -
      click here</A>.<p><hr>"); -
    • -document.writeln("<dl><dd>File name:");
    • - -
    • -document.writeln("<tr><th width=20%><font size=-1>Mime -Type</font></th>");
    • - -
    • -document.writeln("<th width=50%><font size=-1>Description</font></th>");
    • - -
    • -document.writeln("<th width=20%><font size=-1>Suffixes</font></th>");
    • - -
    • -document.writeln("<th><font size=-1>Enabled</th></tr>");
    • - -
    • -enabled = "No";
    • - -
    • -enabled = "Yes";
    • -
    -  -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/localizeAllPref.html b/l10nkits/client/windows/docs/nav40/localizeAllPref.html deleted file mode 100644 index a26a94d00d2..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeAllPref.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Localizing ALL_PREFS - - - -

    -Localization Notes for ALL_PREFS

    -These preferences are identified in the localization notes as "ALL_PREFSRCDATA" -followed by the Javascript function name for that preference.  For -example: -
      ALL_PREFSRCDATAnetwork.search.url
    -The localizable portion of this preference will appear in the XL_STR field.  -If this value is a string, it will be surrounded with quotes.  If -it is a number, it will not.  Do not delete quotes if they are present -and do not add them if they are absent!  Many entries also begin with -tab characters or initial spaces; it is best not to alter these, as well. - -

    NOTE: the following section is for reference, -showing the way the complete Javascript syntax looks.  The entries -contained in the translation databases separate the Javascript function -from the data that function returns. Comments are reproduced in the COMMENT -field of the translation database where appropriate. - -

    You only need to localize the following entries. The parts you need -to change are highlighted in majenta. Comments -are in green. Localize URLs according to the -rules. -

      -
    • -pref("network.search.url", "http://cgi.netscape.com/cgi-bin/url_search.cgi?search=");
    • - -
        This URL is connected to the Navigator's Search -button. -
         
      - -
    • -pref("browser.startup.homepage", "http://home.netscape.com/");
    • - -
        This is the default home page value that is attached -to the Home button and the Home menu item.
      -
    - -
      -
    • -pref("browser.personal_toolbar_button.max_chars", 15);
    • - -
        This determines the maximum number of characters -a personal toolbar button title can contain.  You may not need to -change this, but it's there if you do. -
         
      - -
    • -pref("intl.accept_languages",    "en");
    • - -
        This determines the default value of the ACCEPT_LANG -property of the META tag. You can see this value by choosing Edit | Preferences, -select Navigator | Language; the default value will be the 2 letter ISO -Language code value you supply here. -
         
      - -
    • -pref("intl.accept_charsets",  "iso-8859-1,*,utf-8");
    • - -
        Replace iso-8859-1 with sjis for Japanese, euc-kr -for Korean, gb for Simplified Chinese, Big5 for Traditional Chinese, iso8859-2 -for Latin 2 languages. -
         
      - -
    • -pref("intl.character_set",  2);
    • - -
        You only need to change this for non-LATIN1 languages.  -Use the CSID Reference table to look up the -appropriate value for other languages. -
         
      - -
    • -pref("intl.font_encoding", 6);
    • - -
        maybe not used, 6 = CS_MAC_ROMAN, 1292 = ko, -263 = trad. chinese, 264 = simp. chinese
      -  -
    • -pref("editor.template_location", http://home.netscape.com/home/gold3.0_templates.html");
    • - -
    • -pref("editor.default_template_location", "http://home.netscape.com/home/gold3.0_templates.html");
    • - -
        Localize these URL according to the rules.
      - -
    • -pref("editor.html_directory",       "C:\\My -Documents");
    • - -
    • -pref("editor.image_directory",       "C:\\My -Documents");
    • - -
        If the My Documents directory is translated on -the localized version of Windows you working on, then match this preference -with the localized value. -
         
      - -
    • -pref("editor.color_scheme",     "Netscape -Default Colors");
    • - -
        This string should match the value used to translate -STRINGTABLE42169 (but it's not critical if it doesn't). -
         
      - -
    • -pref("ldap.directory1.description", "Personal Address -Book");
    • - -
    • -pref("ldap_1.directory1.description", "Personal Address -Book");
    • - -
        These entries appears as the description for -searching the personal address book in a mail directory search.  Translate -them the way you do all the other instances of this string. -
         
      - -
    • - pref("netcaster.containers.container1", "-3;'Channel_Finder'; 'http://netcaster.netscape.com/finder/container/index.html'; -1440;0");
    • - -
        Localize this URL according to the rules.
      -
    -  -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/localizeBookmarks.html b/l10nkits/client/windows/docs/nav40/localizeBookmarks.html deleted file mode 100644 index a5a2533efe3..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeBookmarks.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Localizing Bookmarks - - - -

    -Localization Notes for  BOOKMARKS.HTM

    -As part of the Unlimited Localization Program, you may choose to include -the default set of bookmarks that came with this kit, or you may create -your own bookmarks file.  Assuming you include a bookmarks file, you -should save it to  kitRoot\products\client\windows\platform\locale\nav40\program\defaults\bookmark.htm. -
      -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  -
      - - diff --git a/l10nkits/client/windows/docs/nav40/localizeConfigPref.html b/l10nkits/client/windows/docs/nav40/localizeConfigPref.html deleted file mode 100644 index 074d6b9b871..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeConfigPref.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - Localizing CONFIG_PREFS - - - -

    -Localization Notes for CONFIG_PREFS

    -These entries make up the configurable Guide Toolbar and Help menu items -and their functions. As part of the Unlimited Localization Program, you -may define your own set of Guide Toolbar and Help Menu items.  You -MUST remove or replace with your own links the following Help Menu items: -
      -
    • -Release Notes
    • - -
    • -Product Information and Support
    • - -
    • -Software Updates
    • - -
    • -Register Now
    • - -
    • -Member Services
    • -
    -CONFIG_PREF items are identified in the localization notes as "CONFIG_PREFSRCDATA" -followed by the Javascript function name.  For example, -
      CONFIG_PREFSRCDATAtoolbar.places.default_url
    -Most items in this list of preferences consist of two related components: -a label and a URL.  To localize a label, only edit the portion of -the preference that are within the second set of quotes.  For example, -
      -
    • -config("toolbar.places.item_0.label","The Internet");
    • -
    -The words, "The Internet" are contained in the second set of quotes; that -is the part you localize.  Because these are button labels, you should -try to keep them as short as possible.  If you find that you must -use a long word or phrase in your translation, you may discover that the -buttons no longer display the entire text.  You can increase the maximum -number of characters the Toolbar buttons will display by increasing the -value of the browser.personal_toolbar_button.max_chars preference. - -

    You can use the "-" character in a label to create a separator. - -

    You can specify a sub-folder in the Guide Toolbar by specifying the -URL to be the word "FOLDER".  For example: -

      -
    • -config("personal_toolbar.item_1.url","FOLDER");
    • -
    -This lets the code that lays out the toolbar know that the current item -is a folder with sub-folders.  DO NOT localize -the word "FOLDER". -

    -Forbidden CONFIG_PREFS Resources

    -There are some URLs in CONFIG_PREFS which must not be changed in any way.  -The first kind is the about: page URLs: -
      -
    • -config("menu.help.item_12.url","about:plugins");
    • - -
    • -config("menu.help.item_13.url","about:fonts");
    • -
    -You may translate the associated labels but not these URLs. (You can, of -course, delete them entirely, but then you won't have access to these "about" -pages via the menus.)  Refer to the Localizing -URLs section for more information. -
    Finally, some items in CONFIG_PREFS are non-localizable Javascript -preference values.  For example, -
      -
    • -config("toolbar.logo.frames",-1);
    • - -
    • -config("personal_toolbar.CreateNewToolbar", false);
    • - -
    • -config("personal_toolbar.NewToolbarFolderName", "");
    • -
    -Don't alter these. -
      -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    -  -
      - - diff --git a/l10nkits/client/windows/docs/nav40/localizeLicense.html b/l10nkits/client/windows/docs/nav40/localizeLicense.html deleted file mode 100644 index b9e69023df5..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeLicense.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - Localizing the License - - - -

    -Localization notes for LICENSE

    -You must include the Netscape End User License Agreement included with -this kit in your localized product.  The license file may be found -at: products\client\windows\platform\en\license\export\eula\license.txt. -The Localization Kit gives no information on the nature of this license -agreement; it only tells you how to put a localized license into the software. -Whether or not you localize this license (this may depend on your desires -or upon the laws of your country), you must include this in your localized -binaries by following this procedure. (This example uses Microsoft® -MSDEV; if you prefer a different resource editor you may need to execute -slightly different steps): -
      -
    • -Open license.txt in a text editor window.
    • - -
    • -Choose Edit | Select All.
    • - -
    • -Choose Edit | Copy.
    • - -
    • -Open resdll.dll (make sure you have the right one!).
    • - -
    • -Expand the DATA section, open the LICENSE entry.
    • - -
    • -Choose Edit | Select All.
    • - -
    • -Choose Edit | Paste to paste the new text over the old:
    • - -
    • -Terminate the entry with a null character: type "0"
    • - -
      Save and exit.
    -  -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/localizeNpnul.html b/l10nkits/client/windows/docs/nav40/localizeNpnul.html deleted file mode 100644 index 316a882bff4..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeNpnul.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - Localizing NPNUL - - - -

    -Localizing the NULL Plugin

    -The so-called "NULL" plugin is the default plugin that ships with all versions -of the Communicator.  It's job is to list the plugins that you have -installed, and if you don't have a requested plugin, to help you get it. - -

    The NULL plugin consists of a single file, npnul32.dll, located in the -kitRoot\products\client\windows\platform\locale\nav40\program\plugins\ -directory.  Localization notes have been provided for you to use when -localizing the resources for this file.  Instructions for individual -resources can be found in the COMMENT field of the matching DOG file, npnul32.dog -(or npnul16.dog for Windows 3.1) -

     
    -  -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/localizeURL.html b/l10nkits/client/windows/docs/nav40/localizeURL.html deleted file mode 100644 index 57718bc00fd..00000000000 --- a/l10nkits/client/windows/docs/nav40/localizeURL.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - Localizing URLs - - - -

    -Localizing URLs

    -Many resources of all types in the Communicator contain Internet addresses -in the form of URLs (Universal Resource Locators). Most of these point -to locations within the Netscape domain; as part of the Unlimited Localization -Program, you can leave these as they are, or you may change them as you -desire. -

    -Internal URLs

    -There are a number of internal URLs that should not -be changed.  These are the strings that look like about:[some -value].  These point to internally contained resources, such as -the main About Communicator page.  If you localize these strings you -will not be able to load these pages.  The main examples you might -find are: -
      -
    • -about:
    • - -
    • -about:plugins
    • - -
    • -about:fonts
    • -
    -For more examples and information on these internal URLs go here. -
      -
      -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/localize_these_files.html b/l10nkits/client/windows/docs/nav40/localize_these_files.html deleted file mode 100644 index e4a11446b20..00000000000 --- a/l10nkits/client/windows/docs/nav40/localize_these_files.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - Localize these Files - - - -

    -Localize These Files

    -This section tells you exactly what files need to be localized. The following -tables contain two columns: -
      -
    • -The file to be localized column gives the specific file name. The path -name given for each file is relative to the Windows Front End Localization -Kit's starting point; e.g. \kitRoot\products\client\windows\platform\de -(German in this example).  If the file or resource name is a hypertext -link, further information can be found by following that link.
    • - -
    • -The purpose column describes the basic purpose of this file.
    • -
    -Table 1. Binary files to be localized - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    File to be localized Purpose
    nav40\program\brpref32.dllBrowser preferences
    nav40\program\editor32.dllComposer User Interface
    nav40\program\edpref32.dllComposer preferences
    nav40\program\mnpref32.dllMail and News preferences
    nav40\program\nsmailui.dllMail User Interface
    nav40\program\nsnotify.exeMail notification User Interface
    nav40\program\prefui32.dllPreference User Interface 
    nav40\program\resdll.dllMain Browser User Interface
    nav40\program\plugins\npnul32.dllNULL plugin
    - - -

    Table 2. External files to be localized - - - - - - - - - - - - -
    File to be localizedPurpose
    nav40\program\defaults\bookmark.htmDefault bookmarks file.
    -
    -Table 3. DATA resources requiring localization - - - - - - - - - - - - - - - - - - -
    Resource Name Purpose
    ABOUTPLGHTML source of about:plugins page
    LICENSEInternal software license agreement
    - -

     
    -  -
    - - - -
    -
    [CONTENTS]
    -
    - -
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/nomenclature.html b/l10nkits/client/windows/docs/nav40/nomenclature.html deleted file mode 100644 index 0c9415cf4de..00000000000 --- a/l10nkits/client/windows/docs/nav40/nomenclature.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - Conventions - - - -

    -Nomenclature and Typographical Conventions

    -Typographical Conventions -
    Words in italics typeface represent a variable term or phrase, -meant to be replaced by another value at "runtime."  Example: -
      locale -- replaced by a 2- or 4 letter locale code; e.g. zhtw
    -Words in bold typeface, using a proportional font, represent a literal -value in a string that might also contain a variable word or phrase. Example: -
      4.03 [locale] -- 4.03 [ ] are literal values, -while locale is a variable. -
         
      -
    -Words in a fixed width font represent file or directory names, -or DOS or Windows commands to be typed as they appear.  Sometimes, -part or all of the path will be in bold, for emphasis. -Examples: -
      Change to the kitRoot\l10nkits\client\windows\tools -directory -
      Execute RTRNKIT
    -Nomenclature -
    Throughout this document, certain terms and phrases will be used repeatedly: - -

    Table 1. Nomenclature and Typographical Conventions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    kitRoot directory indicates the starting or topmost directory of the Windows Front End -Localization Kit.
    platformeither 16 or 32 bit, depending on the version you are working on.
    localein general, this refers to the language into which you are localizing -the product. The list of valid locale names is defined in the ISO -Language and Country Codes Table.
    localization databasea database generated by a leveraging tool from a set of matched binary -resource files. 
    localization notesany special instructions, including the "translate/don't translate" -flag, associated with a given resource.  Localization notes are contained -in the localization database for each resource module.
    leverageThe process of merging previous localized versions of a file into a -current version. 
    forbidden resourceA resource that cannot be changed from the original value without (negatively) -impacting the functionality of the product. These are identified in the -localization databases.
    -  -
      -

    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/pixel.gif b/l10nkits/client/windows/docs/nav40/pixel.gif deleted file mode 100644 index 094fcbaee5b5171b30a7a7a90b312f9c2712281e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41 pcmZ?wbh9u|WMp7un8?8J|NsA)XU{T#fewfSi8C-U`7knA0|46Z2qXXi diff --git a/l10nkits/client/windows/docs/nav40/projectOverview.html b/l10nkits/client/windows/docs/nav40/projectOverview.html deleted file mode 100644 index 1b11879cd02..00000000000 --- a/l10nkits/client/windows/docs/nav40/projectOverview.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - Project Overview - - - -

    -1. Project Overview

    - -
    Welcome to the Netscape Communicator/Navigator -Localization Kit!
    - - -

    This localization kit will assist you in creating a localized version -of Netscape Communicator or Navigator for the 32-bit Windows platform. -Using the instructions and optionally, the tools provided in this kit, -you can translate the product's menus, dialogs and error messages to the -language of your choice. As long as you follow the terms of the license -agreement under which this kit is distributed, you are free to do what -you want with the resulting localized product. - -

    Localizing the Netscape client is based on "binary" or "no-compile"localization -model. Instead of localizing resource script (.RC) files, which must be -recompiled to produce a working localized version, you work directly on -the binary resource module (.DLL or .EXE) files. You have access to localization -notes to assist and guide you through some of the trickier areas of -the product.  Finally, this kit contains several tools developed by -Netscape to expedited the localization process; however, you may, if you -prefer, work with the localization tools of your choice. - -

    The no-compile localization model offers a number of key benefits over -source file translation: -

      -
    • -A simpler kit environment - no make files or bulky source trees are required.
    • - -
    • -Leveraging previous translations is simpler when resources can be stored -in a database, decreasing translation time.
    • - -
    • -"Forbidden" resources can be locked from over-translation, improving the -quality of translated products.
    • - -
      Localization notes and instructions can be displayed along side the -actual resource being localized, allowing the translator immediate access -to this information.
    -  -
    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/reference.html b/l10nkits/client/windows/docs/nav40/reference.html deleted file mode 100644 index b04f14751da..00000000000 --- a/l10nkits/client/windows/docs/nav40/reference.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - Reference - - - -

    -Reference

    -This section summarizes the references used throughout this document.  -In addition, other miscellaneous references may be found here. - -

    Table 5. Reference Links - - - - - - - - - - - - - - - - - - - - - - - - -
    Locale Table (local)Locale -Table (remote)Communicator -Data Sheet
    Communicator International -Features"about:" -URLs and easter eggsCSID Reference table 
    Cross-Product Encoding -UI Names
    -
    -Following are links to the two main header files used in the Communicator -project, resource.h and allxpstr.h. Resource.h contains the resource IDs -for the Windows Front End resources, while allxpstr.h contains both the -ID and the actual strings of the cross platform messages. These are provided -for reference only, as the resource name is -sometimes more descriptive than the numeric ID used in the translation -databases. You do not need to localize these files! -

    -  -
    - - - -
    -
    [CONTENTS]
    -
    - -
     
    - -

    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/reportingBugs.html b/l10nkits/client/windows/docs/nav40/reportingBugs.html deleted file mode 100644 index ddf085d774a..00000000000 --- a/l10nkits/client/windows/docs/nav40/reportingBugs.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Reporting Bugs - - - -

    -Reporting Bugs

    -Any bugs in the localization kits you find should be reported to mozilla.org -as soon as possible. When you report a bug, try to be as specific as you -can about the exact steps needed to reproduce the bug.  Provide a -complete description of the problem versus the expected results.  -You should let us know if the problem is 100% reproducible (it happens -every time), or if it is intermittant.  If you think that your operating -environment may play some factor, let us know the details of that.  -Finally, before reporting any bug, you should make sure that the problem -doesn't also happen in the US English product (if it does, we still want -to know, but it may not be possible to fix it through the localization -kits or tools as they are now). - -

    To report a bug, post a message to the following mozilla.org newsgroup: -

    - -
    news://secnews.netscape.com/netscape.mozilla.public.general
    - - -

    Be sure to include the information described above. -
      -

    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/resource.h b/l10nkits/client/windows/docs/nav40/resource.h deleted file mode 100644 index ad41d803971..00000000000 --- a/l10nkits/client/windows/docs/nav40/resource.h +++ /dev/null @@ -1,3949 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by netscape.rc -// -#define IDI_COMMUNICATOR 1 -#define IDR_MAINFRAME 2 -#define ID_CONFIGUREVIEWER 3 -#define IDC_REMOVE 3 -#define IDC_ADVANCED 3 -#define IDR_DOCUMENT 4 -#define IDR_NETSCAPETYPE_CNTR_IP 6 -#define IDC_VERIFY_HTML 7 -#define IDC_ADD_NEW_TAG 8 -#define IDM_MAINFRAMEFILEMENU 50 -#define IDM_MAINFRAMEEDITMENU 51 -#define IDM_MAINFRAMEVIEWMENU 52 -#define IDM_MAINFRAMEGOMENU 53 -#define IDM_MAILTHREADFILEMENU 54 -#define IDM_MAILTHREADEDITMENU 55 -#define IDM_MAILTHREADVIEWMENU 56 -#define IDM_MAILTHREADGOMENU 57 -#define IDM_MAILTHREADMESSAGEMENU 58 -#define IDM_COMPOSER_TABLE_SELECTMENU 70 -#define IDM_COMPOSER_TABLE_INSERTMENU 71 -#define IDM_COMPOSER_TABLE_DELETEMENU 72 -#define VK_APPS 0x5D -#define IDD_ABOUTBOX 100 -#define HOTLIST1_DIALOG 101 -#define IDD_ADDRESS_LIST 101 -#define IDR_EDITFRAME 101 -#define IDC_BUTTON_BACK 101 -#define IDD_NEWSGROUP_SERVERTYPE 101 -#define IDD_OPENURL_BOX 102 -#define IDS_COMPOSECOMPOSE 103 -#define IDC_BUTTON_ATTACH 103 -#define IDD_HISTORYBAR 103 -#define IDD_LOCATION_DLG 104 -#define IDS_COMPOSE_PRIORITY 104 -#define IDD_PAGE_TITLE 105 -#define IDS_WARN_REMOVE_SERVER 105 -#define IDD_ALERTBOX 106 -#define IDS_USERNAME 106 -#define IDD_PP_FOLDER_DISKSPACE 106 -#define IDS_NICKNAME 107 -#define IDD_CONFIRMBOX 108 -#define IDS_SPECIAL_FOLDER 108 -#define IDD_PROMPT 109 -#define IDD_PROMPT_PASSWD 110 -#define IDR_SEARCHFRAME 111 -#define IDC_URL 112 -#define IDD_URLTITLEBAR 112 -#define IDC_TITLE 113 -#define IDC_NUMLOADS 114 -#define IDS_ATTACHFILE 115 -#define IDB_MAINFRAME_MIXED 116 -#define IDS_COMPOSEOPEN 116 -#define IDS_COMPOSECLOSE 117 -#define IDS_WHITEBOX_MENU 117 -#define IDD_STYLEOG 118 -#define IDS_CANCEL_BUTTON 118 -#define IDD_PREF_CHOOSE_FOLDER 118 -#define IDC_ALERT 119 -#define IDD_JUST_HOME 119 -#define IDS_SENDLATER 119 -#define IDC_CONFIRM 120 -#define IDD_JUST_TOOLS 120 -#define IDR_HISTORY_MENU 120 -#define IDS_EXAMPLESPECIFICDLS 120 -#define IDR_HISTORYSEARCH_MENU 121 -#define IDR_HISTORY_ICON 121 -#define IDS_COMPOSEOPTIONS 121 -#define IDC_OVERANCHOR 122 -#define IDC_OVERANCHOR_OLD 122 -#define IDS_GO_OFFLINE 122 -#define IDC_PROMPT_ASK 123 -#define IDC_OVERANCHOR2 123 -#define IDC_SELECTANCHOR 123 -#define IDS_GO_ONLINE 123 -#define IDC_PROMPT_ANS 124 -#define IDD_ExternalViewerConfig 124 -#define IDS_ADD_LDAP_SERVER 124 -#define IDC_TITLETEXT 125 -#define IDR_MAINFRAME1 125 -#define IDS_LDAP_SERVER_PROPERTY 125 -#define IDI_MAIL 126 -#define IDS_ADD_NEWS_SERVER 126 -#define IDC_URLTEXT 127 -#define IDD_DIALOG1 127 -#define IDR_MAINFRAME2 127 -#define IDD_ADDRESS_USER 127 -#define IDS_NEWS_SERVER_PROPERTY 127 -#define IDC_SOURCE 128 -#define IDI_ICON1 128 -#define IDS_ADD_MAIL_SERVER 128 -#define IDC_STYL_TOOLS 129 -#define IDS_MAIL_SERVER_PROPERTY 129 -#define IDC_STYL_HOME 130 -#define IDD_HISTORY 130 -#define IDS_SERVER_POP3 130 -#define IDC_STYL_WINDOW 131 -#define IDD_APPEARANCE 131 -#define IDS_SERVER_IMAP 131 -#define IDS_SERVER_POP3_STATIC 131 -#define IDC_STYL_NETWORK 132 -#define IDD_STARTUP 132 -#define IDS_SERVER_IMAP_STATIC 132 -#define IDD_USERINFO 133 -#define IDS_POP3_ONLY_ONE 133 -#define IDD_HOTLIST 134 -#define IDS_REMOVE_MAILHOST_CONFIRM 134 -#define IDD_NETWORK 135 -#define IDS_MAIL_SERVER 135 -#define IDD_USERPASS 140 -#define IDS_HELP_BUTTON 140 -#define IDD_MAILURL 141 -#define IDS_BROWSE_BUTTON 141 -#define IDD_UNKNOWNTYPE 142 -#define IDD_HELPER_DIALOG 143 -#define IDD_NEWMIMETYPE 144 -#define IDD_CONFIGUREVIEWER_SMALL 145 -#define IDC_FileName 148 -#define IDD_SPLASH 148 -#define IDC_FileSize 149 -#define IDD_PRINTING_STATUS 149 -#define IDC_TransferTime 150 -#define IDS_PREF_REGULAR 150 -#define IDS_PREF_BOLD 151 -#define IDC_BytesTransferred 152 -#define IDS_PREF_ITALIC 152 -#define IDC_StatusRect 153 -#define IDS_PREF_BOLDITALIC 153 -#define IDS_NUMBERS_ONLY 154 -#define IDC_USE_EXCHANGE 155 -#define IDS_EMPTY_STRING 155 -#define IDS_PORT_RANGE 156 -#define IDD_LICENSE 157 -#define IDS_WIZARD_SENDMAIL 157 -#define IDD_SECURITY 158 -#define IDB_MCI1 158 -#define IDS_WIZARD_READMAIL 158 -#define IDB_MCI2 159 -#define IDS_WIZARD_READNEWS 159 -#define IDS_SENDMAIL_STATIC1 160 -#define IDS_READMAIL_STATIC1 161 -#define IDS_READMAIL_STATIC2 162 -#define IDS_READMAIL_STATIC3 163 -#define IDS_READMAIL_EG1 164 -#define IDS_FINISH 165 -#define IDS_NEXT 166 -#define IDS_WIZARD_COVER 167 -#define IDS_COVER_STATIC1 168 -#define IDB_PICTURES 169 -#define IDS_SENDMAIL_STATIC2 169 -#define IDB_NPOST 170 -#define IDD_ATTACH_DLG 170 -#define IDS_SENDMAIL_EG1 170 -#define IDS_SENDMAIL_EG2 171 -#define IDB_NPOSTR 172 -#define IDC_ACTIVATE_EMBED 172 -#define IDS_SENDMAIL_STATIC3 172 -#define IDS_READNEWS_STATIC1 173 -#define IDS_SENDMAIL_STATIC4 174 -#define IDS_SENDREADMAIL_STATIC5 175 -#define IDS_READNEWS_STATIC5 176 -#define IDB_IMAGE 177 -#define IDS_SERVER_EXISTS 177 -#define IDB_FILE 178 -#define IDS_INVALID_EMAIL 178 -#define IDS_READNEWS_STATIC2 179 -#define IDS_PE_ACCT_SETUP 180 -#define IDB_IMAGE_DELAYED 184 -#define IDB_IMAGE_BAD 185 -#define IDB_IMAGE_NOTFOUND 186 -#define IDB_GOPHER_AUDIO 187 -#define IDB_GOPHER_BINARY 188 -#define IDB_GOPHER_FIND 189 -#define IDB_GOPHER_FOLDER 190 -#define IDB_GOPHER_GENERIC 191 -#define IDB_GOPHER_IMAGE 192 -#define IDB_GOPHER_MOVIE 193 -#define IDB_GOPHER_TELNET 194 -#define IDB_GOPHER_TEXT 195 -#define IDB_SINGLE_NEWS_GROUP 196 -#define IDD_VIEWER_SECURITY 198 -#define IDD_CONTEXT_SAVE 199 -#define IDD_BOOKMARKS_PROPERTIES 200 -#define IDC_MIMESUBTYPE 202 -#define IDD_DOCI_GENERAL 202 -#define IDC_MIMETYPE 203 -#define IDD_PREF_STYLES 203 -#define IDC_SaveToDisk 204 -#define IDD_CONTEXT_PRINT_STATUS 204 -#define IDC_LaunchExtViewer 205 -#define IDI_DOCUMENT_ICON 205 -#define IDD_BOOKMARK_PREFERENCES 205 -#define IDC_ExternalViewer 206 -#define IDB_GOPHER_TELNET_MASK 206 -#define IDD_INTERNETSHORTCUT 206 -#define IDC_ViewerBrowse 207 -#define IDB_GOPHER_AUDIO_MASK 207 -#define IDC_Description 208 -#define IDB_GOPHER_FIND_MASK 208 -#define IDC_Extensions 209 -#define IDB_GOPHER_FOLDER_MASK 209 -#define IDC_AddSubType 210 -#define IDC_DeleteSubType2 211 -#define IDC_STYL_WINDOW_T1 211 -#define IDC_STYL_WINDOW_T3 212 -#define IDB_IMAGE_MASK 212 -#define IDC_COMBO1 213 -#define IDB_IMAGE_BAD_MASK 213 -#define IDC_FONTFACE_COMBO 213 -#define IDC_EDIT1 214 -#define IDC_STRT_EDIT1 214 -#define IDR_SRVR_INPLACE 214 -#define IDC_AUTO_SAVE_MINUTES 214 -#define IDC_PAGE_TITLE 214 -#define IDC_HISTORY_HELP 215 -#define IDC_EDIT3 215 -#define IDD_PREF_COLORS 215 -#define IDC_HISTORY_GOTO 216 -#define IDC_EDIT6 216 -#define IDC_EDIT_MAIL_TOADDRESS 216 -#define IDC_HISTORY_ADD_HOT 217 -#define IDC_PUBLISH_USER_NAME 217 -#define IDC_EDIT7 217 -#define IDC_EDIT_NEWS_TOADDRESS 217 -#define IDR_SRVR_EMBEDDED 218 -#define IDC_STYL_COMBO 219 -#define IDC_STYL_DEFAULTS 220 -#define ID_STYL_HELP 221 -#define ID_SYNC 221 -#define IDR_MAILFRAME 221 -#define IDD_DIALOG_ENCODING 222 -#define IDD_ENCODING 222 -#define IDD_PAGESETUP 223 -#define IDD_PAGESETUP16 224 -#define IDR_COMPOSEFRAME 224 -#define IDR_NEWSFRAME 225 -#define IDI_IBMHOD 226 -#define IDI_NETCASTER 228 -#define IDI_PROFILEMANAGER 229 -#define IDC_APP_STATIC1 230 -#define IDD_ADDRESSBOOK 230 -#define IDC_APP_STATIC2 231 -#define IDR_ADDRESS_MENU 231 -#define IDC_APP_STATIC4 232 -#define IDD_ADDRESS_NEWUSER 232 -#define IDC_APP_STATIC5 233 -#define IDC_APP_STATIC6 234 -#define IDC_APP_STATIC7 235 -#define IDC_APP_STATIC8 236 -#define IDC_APP_STATIC9 237 -#define IDC_APP_STATIC10 238 -#define IDC_APP_RADIO1 239 -#define IDC_APP_RADIO2 240 -#define IDC_APP_RADIO3 241 -#define IDC_COMBO_FOLDERS 241 -#define IDC_APP_RADIO4 242 -#define IDC_COMBO_SERVERS 242 -#define IDC_APP_RADIO5 243 -#define IDC_APP_RADIO6 244 -#define IDC_APP_RADIO7 245 -#define IDC_APP_RADIO8 246 -#define IDC_APP_RADIO9 247 -#define IDC_APP_RADIO10 248 -#define IDC_APP_BUTTON1 249 -#define IDC_APP_EDIT1 250 -#define IDC_APP_EDIT2 251 -#define IDC_APP_CHECK1 252 -#define IDS_ADDRESSMESSAGE 254 -#define ID_STATBAR_SIMPLE 255 -#define IDR_TASKBAR 256 -#define IDC_NET_STATIC1 260 -#define IDC_NET_STATIC2 261 -#define IDC_NET_STATIC3 262 -#define IDC_NET_STATIC4 263 -#define IDC_NET_STATIC5 264 -#define IDC_NET_STATIC6 265 -#define IDC_NET_STATIC7 266 -#define IDC_NET_STATIC8 267 -#define IDC_NET_STATIC9 268 -#define IDC_NET_STATIC10 269 -#define IDC_NET_STATIC11 270 -#define IDC_EDIT 270 -#define IDC_NET_STATIC12 271 -#define IDC_ADD_CURRENT_URL 271 -#define IDC_NET_STATIC13 272 -#define IDC_NET_STATIC14 273 -#define IDC_FIND 273 -#define IDC_NET_STATIC15 274 -#define IDC_FIND_TEXT 274 -#define IDC_NET_STATIC16 275 -#define IDC_DOWN 275 -#define IDC_UP 276 -#define IDC_NET_STATIC21 276 -#define IDC_NET_EDIT1 277 -#define IDC_PLUSPLUS 277 -#define IDC_NET_STATIC22 277 -#define IDC_NET_EDIT2 278 -#define IDC_MINUS 278 -#define IDC_NET_EDIT3 279 -#define IDC_PLUS 279 -#define IDC_NET_EDIT4 280 -#define IDC_URL_AREA 280 -#define IDC_NET_EDIT5 281 -#define IDC_UPPERLEFT 281 -#define IDC_NET_EDIT6 282 -#define IDC_HOTLIST_MAINAREA 282 -#define IDC_NET_EDIT7 283 -#define IDC_HOTLIST_AREA 283 -#define IDC_NET_EDIT8 284 -#define IDC_NAME 284 -#define IDC_NET_EDIT9 285 -#define IDC_LASTVISITED 285 -#define IDC_NET_EDIT10 286 -#define IDC_ADDEDON 286 -#define IDC_NET_EDIT11 287 -#define IDC_TYPE 287 -#define IDC_NET_EDIT12 288 -#define IDC_NEWITEM 288 -#define IDC_NEWURL 288 -#define IDC_NET_EDIT13 289 -#define IDC_COPYITEM 289 -#define IDC_NET_EDIT14 290 -#define IDC_REMOVEITEM 290 -#define IDC_DONE_EDITING 291 -#define IDC_NET_EDIT17 291 -#define IDC_PUT_URLS_UNDER 292 -#define IDC_PUT_HOTLIST_MENU_UNDER 293 -#define IDC_GENERATE_HTML 294 -#define IDC_EXPORT 295 -#define IDC_BUTTON_TO 295 -#define IDD_MUCWIZARD_WIN16 295 -#define IDC_IMPORT 296 -#define IDC_ITEMIS_URL 297 -#define IDC_NEWHEADER 297 -#define IDC_ITEMIS_HEADER 298 -#define IDC_NEWSEPARATOR 298 -#define IDC_ITEMIS_SEPARATOR 299 -#define IDC_HELPER_LIST 300 -#define IDC_HELPER_STATIC1 301 -#define IDC_HELPER_STATIC2 302 -#define IDC_HELPER_STATIC3 303 -#define IDC_HELPER_NEW 304 -#define IDC_HELPER_USENETSCAPE 305 -#define IDC_HELPER_SAVE 306 -#define IDC_HELPER_USEAPP 307 -#define IDC_HELPER_STATIC5 308 -#define IDC_HELPER_EXTENSIONS 309 -#define IDC_HELPER_STATIC6 310 -#define IDC_HELPER_STATIC7 311 -#define IDC_HELPER_STATIC8 312 -#define IDC_HELPER_STATIC9 313 -#define IDC_HELPER_STATIC10 314 -#define IDC_HELPER_UNKNOWN 315 -#define IDC_HELPER_STATIC4 316 -#define IDC_HELPER_PATH 317 -#define IDC_HELPER_BROWSE 318 -#define IDC_STRT_STATIC1 320 -#define IDC_STRT_STATIC2 321 -#define IDC_STRT_STATIC3 323 -#define IDC_STRT_STATIC4 324 -#define IDC_STRT_STATIC5 325 -#define IDC_STRT_STATIC6 326 -#define IDC_STRT_STATIC7 327 -#define IDC_STRT_STATIC8 328 -#define IDC_STRT_STATIC9 329 -#define IDC_STRT_STATIC10 330 -#define IDC_EDIT2 330 -#define IDC_STRT_BUTTON1 331 -#define IDC_PROMPT 331 -#define IDC_STRT_BUTTON2 332 -#define IDC_TO_EDIT 332 -#define IDC_STRT_BUTTON3 333 -#define IDC_FROM_EDIT 333 -#define IDC_STRT_BUTTON4 334 -#define IDC_SUBJECT_EDIT 334 -#define IDC_COMPOSE_SUBJECT 334 -#define IDC_STATIC_TITLE 334 -#define IDC_STRT_BUTTON5 335 -#define IDC_STATIC1 335 -#define IDC_STRT_EDIT2 336 -#define IDC_STATIC2 336 -#define IDC_STRT_EDIT3 337 -#define IDC_STATIC3 337 -#define IDC_STRT_EDIT4 338 -#define IDC_BODY_EDIT 338 -#define IDC_STATIC6 338 -#define IDC_STRT_EDIT5 339 -#define IDC_FILETYPE 339 -#define IDC_STRT_EDIT6 340 -#define ID_SAVETODISK 340 -#define IDC_STRT_EDIT9 341 -#define IDC_IN 341 -#define IDC_STRT_EDIT10 342 -#define IDC_OUT 342 -#define IDC_STRT_BUTTON6 343 -#define IDC_CLOSE_HOTLIST 343 -#define IDC_STRT_CHECK1 344 -#define IDC_STRT_EDIT7 345 -#define IDC_MISC_STATIC1 350 -#define IDC_MISC_STATIC2 351 -#define IDC_MISC_STATIC3 352 -#define IDC_MISC_STATIC4 353 -#define IDC_MISC_STATIC5 354 -#define IDC_MISC_STATIC6 355 -#define IDC_MISC_EDIT2 357 -#define IDC_MISC_EDIT1 358 -#define IDC_MISC_BUTTON7 359 -#define IDC_MISC_RADIO1 360 -#define IDC_MISC_RADIO2 361 -#define IDC_MISC_RADIO3 362 -#define IDC_MISC_RADIO4 363 -#define IDC_MISC_STATIC7 364 -#define IDC_MIMETYPE_EDIT 365 -#define IDC_MIMESUBTYPE_EDIT 366 -#define IDC_MAILTO_EDIT 367 -#define IDC_FROM_STATIC 368 -#define IDC_TOOLBARICON 370 -#define IDC_VERSION 371 -#define IDC_VERSION2 372 -#define IDC_BUTTON1 373 -#define IDC_SHORTCUT1 373 -#define IDC_USE_EXTERNAL_CHANGES 373 -#define IDC_ALT_TEXT_LOWRES 373 -#define IDC_USE_INTERNAL_CHANGES 374 -#define IDC_SHORTCUT2 374 -#define IDC_EXTRA_HTML 374 -#define IDC_ADD_HEADER 374 -#define IDC_BUTTON3 375 -#define IDC_SHORTCUT3 375 -#define IDC_BCC 375 -#define IDC_DELETE 375 -#define IDC_EDIT_HEADER_NAME 375 -#define IDC_REPLACE 375 -#define IDC_BUTTON4 376 -#define IDC_SHORTCUT4 376 -#define IDC_MOVEDOWN 376 -#define IDC_BUTTON5 377 -#define IDC_SHORTCUT5 377 -#define IDC_JAVA 377 -#define IDC_BUTTON6 378 -#define IDC_SHORTCUT6 378 -#define IDC_CUSTHELP 378 -#define IDC_APP_BUTTON2 379 -#define IDC_APP_BUTTON3 380 -#define IDC_CANCEL 381 -#define IDC_GET_DELETE 382 -#define IDC_ADD_SERVER 383 -#define IDD_COLOR_LIST 390 -#define IDD_COLOR_DLG 391 -#define IDC_PRINTING_STATUS_TEXT 418 -#define IDC_PRINTER_STATUS 420 -#define IDD_FONT_SELECT_DIALOG 421 -#define IDC_MISC_EDIT3 422 -#define IDD_PROPS_FONTDEF 423 -#define IDD_DOCINFO 430 -#define IDC_DISECURITY 431 -#define IDD_BOOKMRK 431 -#define IDB_BOOKMARK_ITEM 432 -#define IDC_DIKEY 432 -#define IDD_DOCI_SECURITY 432 -#define IDB_BOOKMARK_FOLDER 433 -#define IDC_DITITLE 433 -#define IDD_PREF_FONTS 433 -#define IDC_DIURL 434 -#define IDD_PREF_APPS 434 -#define IDC_DIMODIFIED 435 -#define IDD_PREF_MAIL 435 -#define IDD_PREF_MAILDIRS 435 -#define IDC_DISERVER 436 -#define IDD_PREF_CACHE 436 -#define IDC_DICERTIFIER 437 -#define IDD_PREF_PROXIES 437 -#define IDD_PREF_PROXY_MANUAL 437 -#define IDC_SECURESHOWAGAIN 438 -#define IDD_PREF_PROXIES1 438 -#define IDD_PREF_IMAGES 438 -#define IDD_PREF_HELPERS 439 -#define IDC_SECUREALERTEDIT 439 -#define IDD_PREF_NETWORK 440 -#define IDD_PREF_DIRS 441 -#define IDD_PREF_IDENTITY 442 -#define IDD_PREF_NEWS 443 -#define IDS_SENDNOW 444 -#define IDS_DEFAULTSENDNOW 445 -#define IDS_DEFAULTSENDLATER 446 -#define IDC_MISC_STATIC8 451 -#define IDC_MISC_STATIC9 452 -#define IDC_MISC_CHECK1 453 -#define IDC_MISC_CHECK2 454 -#define IDC_MISC_CHECK3 455 -#define IDC_MISC_CHECK4 456 -#define IDC_STATIC4 457 -#define IDB_IMAGE_SEC_REPLACE 458 -#define IDB_SECURE_STATUS 459 -#define IDB_NONSECURE_STATUS 460 -#define IDC_MISC_BUTTON1 461 -#define IDC_MISC_BUTTON2 462 -#define IDC_MISC_STATIC10 463 -#define IDC_MISC_STATIC11 464 -#define IDB_HISECURE_STATUS 465 -#define IDB_LITTLE_N 466 -#define IDD_COMPOSEBAR 470 -#define IDD_FONT_SELECT_DIALOG95 471 -#define IDD_PREF_BOOKMARKS 472 -#define IDD_PREF_ORGANIZATION 473 -#define IDD_PREF_SECALERTS 474 -#define IDD_PREF_DIRS1 475 -#define IDD_PREF_ALERTS 476 -#define IDD_PREF_MAILSTYLE 477 -#define IDD_PREF_COMPOSITION 478 -#define IDD_PREF_PASSWORDS 479 -#define IDD_PREF_LANG 480 -#define IDD_PLUGIN_SPLASH 490 -#define IDC_POST_EDIT 500 -#define IDC_ATTACH_EDIT 501 -#define IDC_COMPOSE_ATTACHMENT 501 -#define IDC_STATIC5 502 -#define IDC_APP_STATIC11 503 -#define IDC_NET_STATIC17 504 -#define IDC_NET_EDIT15 505 -#define IDC_NET_STATIC18 506 -#define IDC_NET_EDIT16 507 -#define IDC_STRT_STATIC11 508 -#define IDC_STRT_EDIT11 509 -#define IDC_STRT_STATIC12 510 -#define IDC_STRT_BUTTON7 511 -#define IDC_MISC_STATIC12 512 -#define IDC_NET_STATIC19 514 -#define IDC_MISC_STATIC13 515 -#define IDC_NET_EDIT18 518 -#define IDC_MISC_STATIC14 519 -#define IDC_MISC_STATIC15 520 -#define IDC_MISC_STATIC16 521 -#define IDC_MISC_STATIC17 522 -#define IDC_MISC_EDIT4 523 -#define IDC_MISC_EDIT5 524 -#define IDC_NET_EDIT19 525 -#define IDC_NET_STATIC20 526 -#define IDC_IMG_RADIO1 527 -#define IDC_IMG_RADIO2 528 -#define IDC_IMG_RADIO3 529 -#define IDC_IMG_RADIO4 530 -#define IDC_SEND 531 -#define IDC_RADIO1 540 -#define IDC_OPEN_IN_BROWSER 540 -#define IDC_RADIO2 541 -#define IDC_OPEN_IN_EDITOR 541 -#define IDC_RADIO3 542 -#define IDC_RADIO4 543 -#define IDC_MUCINTRO_ACCT_ADD 543 -#define IDC_ATTACH 544 -#define IDC_MUCINTRO_ACCT_EXIST 544 -#define IDC_STATIC_proxy 545 -#define IDC_MUCINTRO_ACCT_SYS 545 -#define IDC_FONT_PROPOR 546 -#define IDC_FONT_FIXED 547 -#define IDC_PFONT_STATIC1 548 -#define IDC_COLCHOOSE 550 -#define IDC_EDT_SELECT_BKGRND_COLOR 550 -#define IDC_COLCHOOSE2 551 -#define IDC_COLCHOOSE3 552 -#define IDC_BKGRND_COLOR_CHOOSE 552 -#define IDC_CHOOSE_BKGRND_COLOR 552 -#define IDC_COLCHOOSE4 553 -#define IDC_PFONT_STATIC2 554 -#define IDC_PFONT_STATIC4 555 -#define IDC_PFONT_STATIC5 556 -#define IDC_PFONT_STATIC3 557 -#define IDC_FONT_COMBO1 558 -#define IDC_FONT_PROPFONT 559 -#define IDC_FONT_FIXFONT2 560 -#define IDC_FONT_COMBO2 561 -#define IDC_COLOR_RADIO1 562 -#define IDC_EDT_BGRND_COLOR_DEF 562 -#define IDC_COLOR_RADIO2 563 -#define IDC_EDT_BGRND_FILE 563 -#define IDC_BKGRND_USE_IMAGE 563 -#define IDC_COLOR_EDIT1 564 -#define IDC_EDIT_BGRND_FILE 564 -#define IDC_COLOR_RADIO10 565 -#define IDC_COLOR_RADIO11 567 -#define IDC_COLOR_STATIC5 568 -#define IDC_COL_CHECK2 569 -#define IDC_COL_CHECK3 570 -#define IDC_COL_CHECK4 571 -#define IDC_COLBROWSE 572 -#define IDC_EDT_SELECT_BGRND_FILE 572 -#define IDC_BKGRND_IMAGE_BROWSE 572 -#define IDC_COLOR_STATIC6 573 -#define IDC_COLOR_STATIC7 574 -#define IDC_COLOR_STATIC8 575 -#define IDC_COLOR_STATIC9 576 -#define IDC_COLOR_RADIO3 577 -#define IDC_EDT_BGRND_COLOR_USR 577 -#define IDC_DOCINFO_STATIC1 578 -#define IDC_DOCINFO_STATIC2 579 -#define IDC_DOCINFO_STATIC3 580 -#define IDC_DIENCODING 581 -#define IDC_COL_STATIC2 582 -#define IDC_COLOR_LINK 583 -#define IDC_COLOR_FLINK 584 -#define IDC_COLOR_TEXT 585 -#define IDC_COLOR_BACK 586 -#define IDC_EDT_BGRND_COLOR 586 -#define IDC_COL_CHECK5 587 -#define IDS_APP_LANGUAGE 588 -#define IDS_APP_VERSION 589 -#define IDS_APP_NAME 590 -#define IDS_APP_CODE_NAME 591 -#define IDS_DEF_HOMEPAGE 592 -#define IDS_CHANGE_HOMEPAGE 593 -#define IDS_WIN_INI_SECTION 594 -#define IDS_INI_FILE_NAME 595 -#define IDS_NETSCAPE_TOOLBAR 596 -#define IDC_MISC_MIME 600 -#define IDC_MISC_8BIT 601 -#define IDC_MISC_MIMETXT 602 -#define IDC_MISC_CODE 602 -#define IDC_GENERIC1 603 -#define IDC_MISC_MIMETXT2 603 -#define IDC_DONTASKAGAIN 608 -#define IDC_DONTASKTEXT 609 -#define IDC_HANDLEBYOLE 610 -#define IDC_ASKHOWHANDLE 611 -#define IDC_MESSAGE 612 -#define IDC_PROGRESS 613 -#define IDC_ACTION 615 -#define IDC_LOCATION 616 -#define IDC_DESTINATION 617 -#define IDC_PROGRESS_BAR 619 -#define IDC_STATIC_LOC 620 -#define IDS_SHORTCUT1 621 -#define IDC_STATIC_DESC 621 -#define IDS_SHORTCUT2 622 -#define IDS_SHORTCUT3 623 -#define IDS_SHORTCUT4 624 -#define IDS_SHORTCUT5 625 -#define IDS_SHORTCUT6 626 -#define IDC_RADIO5 627 -#define IDC_CHECK2 627 -#define IDC_CHECK_DEFAULT 627 -#define IDC_CHECK_DOWNLOAD_DISC 627 -#define IDC_DIALER_FLAG 627 -#define IDC_RADIO6 628 -#define IDC_CHECK6 628 -#define IDC_CHECK_NEWS_SELF 628 -#define IDC_CK_KEEP_UNREAD 628 -#define IDC_RADIO7 629 -#define IDC_CHECK7 629 -#define IDC_CHECK_MAIL_OTHERS 629 -#define IDC_CHECK1 630 -#define IDC_RADIO8 630 -#define IDC_AUTO_SAVE 630 -#define IDC_LOCK_ASPECT 630 -#define IDC_HR_SAVE_DEFAULT 630 -#define IDS_SHORTCUTNAME1 631 -#define IDC_RADIO9 631 -#define IDC_HTMLCOMPOSE 631 -#define IDC_CHECK11 631 -#define IDS_SHORTCUTNAME2 632 -#define IDC_EDIT4 632 -#define IDS_SHORTCUTNAME3 633 -#define IDC_NICKNAME 633 -#define IDC_CHECK8 633 -#define IDC_CHECK12 633 -#define IDC_CHECK_NEWS_OTHERS 633 -#define IDS_SHORTCUTNAME4 634 -#define IDE_ADDRESS 634 -#define IDC_ADDRESS 634 -#define IDC_CHECK9 634 -#define IDC_CHECK_MAIL_FOLDER 634 -#define IDS_SHORTCUTNAME5 635 -#define IDC_CHECK10 635 -#define IDC_CHECK_NEWS_FOLDER 635 -#define IDS_SHORTCUTNAME6 636 -#define IDC_CHECK13 637 -#define IDC_INSERT_AFTER 638 -#define IDC_BEGIN_MENU 639 -#define IDC_INTERNETSHORTCUTLINK 640 -#define ID_LIST_FONTCOLOR 640 -#define IDC_INTERNETSHORTCUTDESCRIPTION 641 -#define IDC_PLACEONDESKTOP 642 -#define IDC_PAGESETUP_MBOTTOM 643 -#define IDC_PAGESETUP_MLEFT 644 -#define IDC_PAGESETUP_MRIGHT 645 -#define IDC_PAGESETUP_TITLE 646 -#define IDC_PAGESETUP_PAGENUMBERS 647 -#define IDC_PAGESETUP_SAMPLE 648 -#define IDC_PAGESETUP_MTOP 649 -#define IDC_PAGESETUP_PRINTBITMAPS 650 -#define IDC_PAGESETUP_ALLTEXTBLACK 651 -#define IDC_PAGESETUP_ALLLINESBLACK 652 -#define IDC_PAGESETUP_SOLIDLINES 653 -#define IDC_PAGESETUP_REVERSEORDER 654 -#define IDC_PAGESETUP_URL 655 -#define IDC_PAGESETUP_DATE 656 -#define IDC_PAGESETUP_TOTAL 657 -#define IDC_PAGESETUP_MARGINBOX 658 -#define IDC_PERCENTCOMPLETE 659 -#define IDC_PRINTBKIMAGE 659 -#define IDC_PROGRESSMETER 660 -#define IDC_TIMELEFT 661 -#define IDC_CHECK4 662 -#define IDC_CHECK4_BY_DATE 662 -#define IDB_TREEITEM 700 -#define IDB_TREEFOLDERCLOSED 701 -#define IDB_TREEFOLDEROPEN 702 -#define IDB_MAILMESSAGE 703 -#define ID_HIST_MORE 704 -#define ID_HIST_FEWER 705 -#define IDC_MENUBORDER 706 -#define IDB_OPENBOTTOMPARENT 708 -#define IDB_OPENMIDDLEPARENT 709 -#define IDB_OPENTOPPARENT 710 -#define IDB_OPENSINGLEPARENT 711 -#define IDB_MIDDLEITEM 713 -#define IDB_TOPITEM 714 -#define IDB_VERTPIPE 715 -#define IDB_HORZPIPE 716 -#define IDB_POSTOFFICE 717 -#define IDB_NEWSARTICLE 718 -#define IDB_NEWSREPLY 718 -#define IDB_UNREAD 721 -#define IDB_NEWSGROUP 723 -#define IDB_READ 724 -#define IDB_MARKED 725 -#define IDB_THREAD 726 -#define IDB_SORTINDICATORUP 739 -#define IDB_SORTINDICATORDOWN 740 -#define IDB_PUSHLEFT 741 -#define IDB_PUSHRIGHT 742 -#define IDB_PUSHLEFTRIGHT 743 -#define IDB_OPENTREENODE 745 -#define IDB_COMPOSETOOLBARP 755 -#define IDB_COMPOSETOOLBARPT 756 -#define IDB_COMPOSETOOLBART 757 -#define IDS_FILETOATTACH 758 -#define IDS_ADDRESSTO 759 -#define IDS_ADDRESSCC 760 -#define IDS_ADDRESSBCC 761 -#define IDS_ADDRESSREPLYTO 762 -#define IDS_ADDRESSNEWSGROUP 763 -#define IDS_ADDRESSFOLLOWUPTO 764 -#define IDS_RETURNRECEIPT 770 -#define IDS_ENCRYPTED 771 -#define IDS_SIGNED 772 -#define IDS_TOOLATTACH 773 -#define IDS_TOOLATTACHFILES 774 -#define IDS_TOOLATTACHALL 775 -#define IDS_COMPOSITION 776 -#define IDS_CANTWRITETOFILE 777 -#define IDS_TOOLATTACHFILE 778 -#define IDS_ATTACHWEBPAGE 779 -#define IDS_ATTACHADDRESS 781 -#define IDS_CONVERTWARN 782 -#define IDS_TOPMARGINERROR 783 -#define IDS_BOTTOMMARGINERROR 784 -#define IDS_RIGHTMARGINERROR 785 -#define IDS_LEFTMARGINERROR 786 -#define IDS_VIRTUALNEWSGROUP 787 -#define IDS_COMINGSOON 789 -#define IDS_PHONE 790 -#define IDS_CHECKING 791 -#define IDS_DEFAULTSAVEAS 792 -#define IDS_CONVERTTITLE 793 -#define IDS_ENCODING 795 -#define IDS_CHARSET 796 -#define IDS_ATTACHMYCARD 797 -#define IDS_USE8BIT 798 -#define IDS_USEUUENCODE 799 -#define IDC_COMPOSE_FROM 800 -#define IDS_VIRTUALNEWSGROUPDESC 800 -#define IDC_COMPOSE_REPLYTO 801 -#define IDC_COMPOSE_TO 802 -#define IDC_COMPOSE_CC 803 -#define IDC_COMPOSE_FCC 804 -#define IDC_COMPOSE_BCC 805 -#define IDC_COMPOSE_NEWSGROUPS 807 -#define IDC_COMPOSE_FOLLOWUP 809 -#define IDC_COMPOSE_SUBJECT_TEXT 826 -#define IDS_MESSAGEFORMAT 827 -#define IDS_FORMAT_ASKME 828 -#define IDS_FORMAT_PLAIN 829 -#define IDS_FORMAT_HTML 830 -#define IDS_FORMAT_BOTH 831 -#define IDC_BIGSPLASH 900 -#define IDB_NSSPLASH 901 -#define IDB_EDIT_NAMED_ANCHOR 905 -#define IDB_EDIT_NAMED_ANCHOR_MASK 906 -#define IDB_EDIT_FORM_ELEMENT 907 -#define IDB_EDIT_FORM_ELEMENT_MASK 908 -#define IDB_EDIT_UNSUPPORTED_TAG 909 -#define IDB_EDIT_UNSUPPORTED_TAG_MASK 910 -#define IDB_EDIT_UNSUPPORTED_END_TAG 911 -#define IDB_EDIT_UNSUPPORTED_END_TAG_MASK 912 -#define IDB_EDIT_JAVA 913 -#define IDB_EDIT_JAVA_MASK 914 -#define IDB_EDIT_PLUGIN 915 -#define IDB_EDIT_PLUGIN_MASK 916 -#define IDD_ADDRESS_SECURITY 917 -#define IDS_EMAILADDRESS 917 -#define IDD_ADDRESS_COOLTALK 918 -#define IDS_COMPANYNAME 918 -#define IDS_COMPOSE_REMOVE 920 -#define IDS_LOCALITY 921 -#define IDB_PERSON 922 -#define IDS_REMOVE_ATTACHMENT 922 -#define IDB_ARROW3D 923 -#define IDB_ARROW3D_PRESS 924 -#define IDB_NEWSART 925 -#define IDB_COMPOSETOOLBAR 926 -#define ID_SETFOCUS_PARA_STYLE 927 -#define ID_SETFOCUS_FONTFACE 928 -#define ID_SETFOCUS_FONTSIZE 929 -#define IDS_BUTTON_TEXT_CONNECT 930 -#define IDS_BUTTON_TEXT_DISCONNECT 931 -#define IDS_GO_ONLINE_NOW 932 -#define IDS_GO_OFFLINE_NOW 933 -#define IDS_ACTION_ONLINE 934 -#define IDS_ACTION_OFFLINE 935 -#define IDS_JSAPP 938 -#define IDS_IS_ENCRYPTED 939 -#define IDS_NOT_ENCRYPTED 940 -#define IDS_NOTHING_SUBSCRIBED 941 -#define IDS_NO_TEMP_DIRECTORY 942 -#define IDS_STUB_PREFIX 943 -#define IDS_TEXT_FOLDERS_SELECTED 944 -#define IDS_TEXT_DISCUSSIONS_SELECTED 945 -#define IDS_NO_RUN_WHILE_PROFILING 946 -#define IDS_SENDINGMESSAGE 947 -#define ID_GET_COLOR 950 -#define IDI_GIF 951 -#define IDI_JPEG 952 -#define IDI_JAVASCRIPT 953 -#define IDS_ANIMSMALL_X 1000 -#define IDB_ANIMSMALL_0 1000 -#define IDC_EDIT_HOST 1000 -#define IDC_ONLINE_MODE 1000 -#define IDC_LIST 1000 -#define IDC_RADIO_SENT 1000 -#define IDS_ANIMSMALL_Y 1001 -#define IDC_EDIT_PORT 1001 -#define IDC_OFFLINE_MODE 1001 -#define IDC_RADIO_OTHER 1001 -#define IDC_RADIO_NNTP 1001 -#define IDC_ENTRIES 1002 -#define IDC_EDIT_NEWS_SERVER 1002 -#define IDC_EDIT_USER_NAME 1002 -#define IDC_NEW_WORD 1002 -#define IDC_ASK_ME 1002 -#define IDC_EDIT_MAIL_SERVER 1003 -#define IDC_EDIT_ADDRESS 1003 -#define IDC_USE_AS_DEFAULT 1003 -#define IDC_EDIT_SMTP_SERVER 1004 -#define IDC_IP_ADDRESS 1005 -#define IDC_FIRSTNAME 1005 -#define IDC_MIDDLENAME 1006 -#define IDC_CHANGE 1006 -#define IDC_LASTNAME 1007 -#define IDC_ROWSPAN 1007 -#define IDC_COLSPAN 1008 -#define IDC_EDIT_MSG_DAYS 1008 -#define IDC_IGNORE_ALL 1009 -#define IDC_PREF_STRING_MSG 1009 -#define IDC_EDIT_MSG_NO 1009 -#define IDC_DESC 1009 -#define IDC_LOCALITY 1010 -#define IDC_CHANGE_ALL 1010 -#define IDC_CHECK_MSG_SIZE 1010 -#define IDC_ID 1010 -#define IDC_REGION 1011 -#define IDC_USE_PAGE_LOCATION 1011 -#define IDC_WIDTH 1011 -#define IDC_ERROR_PROMPT 1011 -#define IDC_KEEP_MSG_DAYS 1011 -#define IDC_CHECK_MSG_DAYS 1011 -#define IDC_KEEP_UNREAD 1012 -#define IDC_COMPANY_NAME 1013 -#define IDC_EDIT_MSG_SIZE 1013 -#define IDC_EDIT_DICTIONARY 1013 -#define IDC_STREET2 1013 -#define IDC_RUN 1013 -#define IDC_PIXELS_WIDTH 1014 -#define IDC_CHECK_COMAPCT_SIZE 1014 -#define IDC_CHECK_COMPACT_SIZE 1014 -#define IDC_PERCENT_WIDTH 1015 -#define IDC_EDIT_COMPACT_SIZE 1015 -#define IDC_PIXELS_HEIGHT 1016 -#define IDC_KEEP_MSG_NO 1016 -#define IDC_NEW_FOLDER 1016 -#define IDC_HEIGHT 1017 -#define IDC_KEEP_ALL 1017 -#define IDC_PERCENT_HEIGHT 1018 -#define IDC_SECURE 1018 -#define IDC_LIST3 1019 -#define IDC_CHECK_SAVE_PASSWORD 1019 -#define IDC_SAVE_PASSWORD 1019 -#define IDC_USE_NAME 1019 -#define IDC_LOGIN_LDAP 1020 -#define IDC_COLOR_WELL 1021 -#define IDC_CHOOSE_BACKGROUND 1022 -#define IDC_COMBO2 1023 -#define IDC_FONT_SIZE 1023 -#define IDC_CONNECTCOOLTALK 1024 -#define IDC_WRAP 1025 -#define IDC_HEADER 1026 -#define IDC_NOSAVE_FONTDEF 1026 -#define IDC_ALIGN_TOP 1027 -#define IDC_FONTFACE_MSG 1027 -#define IDC_ALIGN_V_CENTER 1028 -#define IDC_ALIGN_BOTTOM 1029 -#define IDC_USE_DEFAULT_LOCATION 1029 -#define IDC_ALIGN_BASELINE 1030 -#define IDC_ROW_HEADER 1031 -#define IDC_FONT_SIZE_MSG 1031 -#define IDC_COLUMN_HEADER 1032 -#define IDC_LANGUAGE 1032 -#define IDC_MAKE_IMAGE_BACKGROUND 1032 -#define IDC_SUGGESTIONS 1033 -#define IDC_WIDTH_PIXELS 1033 -#define IDC_CHECK_WORD 1034 -#define IDS_STATBAR_SECURITY 1050 -#define IDS_ANIM_X 1100 -#define IDC_DEFAULT_COLOR 1100 -#define IDB_ANIM_0 1100 -#define IDC_COLOR_HELP 1101 -#define IDS_ANIM_Y 1101 -#define IDC_LAST_USED_COLOR 1102 -#define IDC_BUTTON_MAIL_CHOOSE 1124 -#define IDC_FRAME_BOX 1178 -#define IDC_TOP_TAG 1179 -#define IDC_BOTTOM_TAG 1180 -#define IDC_HELP_TEXT 1181 -#define IDC_INTRO_TEXT 1183 -#define IDC_VIEW_TEXT1 1184 -#define IDC_EDIT_TEXT 1185 -#define IDC_CHECK3 1200 -#define IDD_ADDRESSDLG 1200 -#define IDC_CHECK_BY_ARTICLES 1200 -#define IDC_CHECK_SEND_MESSAGES 1200 -#define IDC_RADIO10 1201 -#define IDD_MULTIATTACH 1201 -#define IDC_OPEN_WINDOW 1201 -#define IDC_SHOW_IN_THREAD 1201 -#define IDC_RADIO11 1202 -#define IDD_ATTACHLOCATION 1202 -#define IDC_ADDRESSLIST 1203 -#define IDD_PREF_PCERTS 1203 -#define IDR_BOOKMARK_MENU 1203 -#define IDC_TO 1204 -#define IDD_PREF_SCERTS 1204 -#define IDC_CC 1205 -#define IDD_PREF_PROXY 1205 -#define IDC_LANG_LIST1 1206 -#define IDD_SEARCHEADERS 1206 -#define IDC_LANG_LIST2 1207 -#define IDD_DIALOG2 1207 -#define IDC_LANG_ADD 1208 -#define IDD_FINDBOOKMARK 1208 -#define IDC_LANG_REMOVE 1209 -#define IDC_LANG_EDIT 1210 -#define IDD_SEARCHMESSAGES 1210 -#define IDC_LANG_ADDTEXT 1211 -#define IDC_ATTACHURL 1211 -#define IDC_ATTACHFILE 1212 -#define IDD_DEFAULT_BROWSER 1212 -#define IDC_ATTACHMENTS 1213 -#define IDC_ASIS 1214 -#define IDC_CONVERT 1215 -#define IDC_LIST1 1216 -#define IDC_WORD_LIST 1216 -#define IDC_LANGUAGE_LIST 1216 -#define IDC_HEADER_LIST 1216 -#define IDC_EDIT5 1217 -#define ID_SELECT_NEXT_NONTEXT 1217 -#define IDB_SMALLANIMATION 1218 -#define IDC_MATCHCASE 1218 -#define IDB_COMPOSETOOLBARPD 1219 -#define IDD_WHATSNEW 1220 -#define IDC_WHOLEWORD 1221 -#define IDB_COMPOSETOOLBARPTD 1222 -#define IDC_ALLBOOKMARKS 1223 -#define IDC_FINDTEXT 1224 -#define IDC_SELECTEDBOOKMARKS 1225 -#define ID_NO 1226 -#define IDD_UPDATEWHATSNEW 1227 -#define IDC_IGNORE 1228 -#define IDD_PREF_SEC_ADVANCED 1228 -#define IDC_QUESTION_ICON 1229 -#define IDD_PREF_HELPERS1 1229 -#define IDC_WARNING_ICON 1229 -#define IDC_FINDINHEADER 1230 -#define IDD_PREF_PROTOCOLS 1230 -#define IDC_FINDINBODY 1231 -#define IDD_PREF_NET_LANG 1231 -#define IDC_SEARCHUP 1232 -#define IDC_SEARCHDOWN 1233 -#define IDC_DIRECTION 1234 -#define IDC_MORE_INFO 1235 -#define IDR_ACCELERATOR1 1237 -#define IDB_DRAG_URL 1239 -#define IDC_STARTBROWSER 1240 -#define IDC_STARTMAIL 1241 -#define IDC_STARTNEWS 1242 -#define IDD_PREFMAILPANES 1243 -#define IDC_RADIO12 1244 -#define IDC_RADIO13 1245 -#define IDC_RADIO14 1246 -#define IDC_RADIO15 1247 -#define IDC_STATIC_ISALIAS 1247 -#define IDC_RADIO16 1248 -#define IDC_STATIC_ALIASCOUNT 1248 -#define IDC_RADIO17 1249 -#define IDC_BUTTON_SELECTALIASES 1249 -#define IDS_ENTERPRISE_KEY 1250 -#define IDC_DISABLE_JAVA 1250 -#define IDC_DISABLE_SSL2 1251 -#define IDS_LOCKED_PREFERENCES 1252 -#define IDC_CONFIGURE_SSL2 1252 -#define IDC_FTP_ANON 1253 -#define IDI_IMAGE_DELAYED 1253 -#define IDB_SMIMAGE_DELAYED 1254 -#define IDC_DISABLE_SSL3 1254 -#define IDC_AUTO_PROXY_RELOAD 1254 -#define IDC_HELPER_MIME_TYPE 1254 -#define IDB_SMIMAGE_MASK 1255 -#define IDC_CONFIGURE_SSL3 1255 -#define IDR_MESSAGEFRAME 1255 -#define IDC_FEWER 1255 -#define IDC_FTP_EMAIL 1256 -#define IDC_HELPER_HANDLER 1256 -#define IDC_WEB_ANON 1257 -#define IDB_NOTIFY_MAIL1 1257 -#define IDC_COMBO_SCOPE 1257 -#define IDC_WEB_EMAIL 1258 -#define IDC_STATIC_WHERE 1258 -#define IDC_EDIT_IBEAM_LARGE 1259 -#define IDC_COMBO_FIELDS1 1259 -#define IDC_COMBO_FIELDS2 1260 -#define IDC_EDIT_IBEAM 1260 -#define IDC_LINK_COPY 1261 -#define IDC_COMBO_CRITERIA1 1261 -#define IDC_EDIT_MATCH1 1262 -#define IDC_HTML_COPY 1262 -#define IDC_LINK_MOVE 1263 -#define IDC_COMBO_CRITERIA2 1263 -#define IDC_HTML_MOVE 1264 -#define IDC_EDIT_MATCH2 1264 -#define IDC_IMAGE_COPY 1265 -#define IDC_COMBO_FIELDS3 1265 -#define IDC_IMAGE_MOVE 1266 -#define IDC_COMBO_CRITERIA3 1266 -#define IDC_TEXT_MOVE 1267 -#define IDC_EDIT_MATCH3 1267 -#define IDD_MAILFILTER 1267 -#define IDC_TEXT_COPY 1268 -#define IDC_COMBO_FIELDS4 1268 -#define IDC_COMBO_CRITERIA4 1269 -#define IDB_DRAG_URL_MASK 1270 -#define IDC_EDIT_MATCH4 1270 -#define IDB_NOTIFY_NEWS 1271 -#define IDC_OPEN_URL_BROWSER 1271 -#define IDB_NOTIFY_WEB 1272 -#define IDC_OPEN_URL_EDITOR 1272 -#define IDD_SAVE_DOCUMENT 1273 -#define IDC_SAVE_FILE_LABEL 1274 -#define IDC_COMBO_FIELDS5 1274 -#define IDC_COMBO_CRITERIA5 1275 -#define IDD_FILTER_PICKER 1275 -#define IDC_FILE_COUNT_MSG 1275 -#define IDC_SAVE_FILENAME 1276 -#define IDC_EDIT_MATCH5 1276 -#define IDC_SPIN5 1278 -#define IDB_MAILNEWSTABS 1280 -#define IDB_GRANITE 1281 -#define IDB_OUTLINER 1282 -#define IDC_RADIO_OFF 1283 -#define IDB_ADDRESSBOOK 1283 -#define IDC_RADIO_ON 1284 -#define IDB_BOOKMARKS 1284 -#define IDC_COMBO_ATTRIB1 1285 -#define IDB_COLUMN 1285 -#define IDC_COMBO_ATTRIB2 1286 -#define IDB_MAILCOL 1286 -#define IDC_COMBO_ATTRIB3 1287 -#define IDC_COMBO_ATTRIB4 1288 -#define IDC_COMBO_ATTRIB5 1289 -#define IDC_COMBO_OP1 1290 -#define IDC_COMBO_OP2 1291 -#define IDC_COMBO_OP3 1292 -#define IDC_COMBO_OP5 1293 -#define IDC_COMBO_OP4 1294 -#define IDC_EDIT_VALUE1 1296 -#define IDC_EDIT_VALUE2 1297 -#define IDC_EDIT_VALUE3 1298 -#define IDC_EDIT_VALUE4 1299 -#define IDC_EDIT_VALUE5 1300 -#define IDC_COMBO_DEST 1302 -#define IDC_EDIT_DESC 1303 -#define IDC_EDIT_NAME 1304 -#define IDC_COMBO_ACTION 1305 -#define IDC_STATIC_THE2 1306 -#define IDC_STATIC_THE3 1307 -#define IDC_STATIC_THE4 1308 -#define IDC_STATIC_THE5 1309 -#define IDC_STATIC_OF1 1310 -#define IDC_STATIC_OF2 1311 -#define IDC_STATIC_OF3 1312 -#define IDC_STATIC_OF4 1313 -#define IDC_STATIC_OF5 1314 -#define IDC_STATIC_THE1 1315 -#define IDC_STATIC_OF6 1316 -#define IDC_NEW 1319 -#define IDC_SAVE 1321 -#define IDC_CHECK_LOG 1322 -#define IDC_LIST_FILTERS 1323 -#define IDC_MNWIZ_READNEWS_FINISH 1324 -#define IDC_STATIC_DESCRIPTION 1326 -#define IDC_STATIC_ORDER 1327 -#define IDC_STATIC_NAME 1328 -#define IDC_STATIC_ON 1329 -#define IDC_QF_BTN 1330 -#define IDB_BOOKMARK_QF 1330 -#define IDB_MAILNEWS 1331 -#define IDC_ADDRNAME 1332 -#define IDC_LABEL 1332 -#define IDC_EXPLANATION2 1332 -#define IDC_ADD 1333 -#define IDC_MORE 1334 -#define IDB_COMPOSETABS 1334 -#define IDC_STATIC_FINDITEMS 1335 -#define IDB_ADDRESSTOOLBARP 1336 -#define IDB_DOCK_BTN 1337 -#define IDC_BC_BTN 1338 -#define IDB_NOTIFY_MAIL3 1340 -#define IDB_NOTIFY_MAIL2 1341 -#define IDR_NEWSMSGFRAME 1344 -#define IDB_SHADING 1345 -#define IDC_STOP 1345 -#define IDD_NEWS_BAR 1346 -#define IDC_COMBO_NEWS 1346 -#define IDC_OUTLINER_FOLDER 1347 -#define IDC_OUTLINER_MESSAGE 1348 -#define IDD_LDAPSEARCH 1348 -#define IDC_IN_STATIC 1349 -#define IDR_MAILTHREAD 1349 -#define IDC_DIRECTORIES 1350 -#define IDR_NEWSTHREAD 1350 -#define IDC_DIRSEARCH 1351 -#define IDD_MARKREADDATE 1351 -#define IDC_CREATE 1352 -#define IDC_COPY 1353 -#define IDC_ADD_LINK_BUTTON 1354 -#define IDC_STREET 1354 -#define IDC_POBOX 1354 -#define IDC_DELETE_LINK_BUTTON 1355 -#define IDC_ZIP 1355 -#define IDC_CHANGE_LINK_BUTTON 1356 -#define IDC_PHONE1 1356 -#define IDC_IMPORT_LINK_BUTTON 1357 -#define IDC_HOME 1357 -#define IDC_IMPORT_BITMAP 1357 -#define IDC_COUNTRY 1357 -#define IDB_VFLIPPY 1358 -#define IDC_BUTTON_NAME_EDIT 1358 -#define IDC_FAX 1358 -#define IDB_FOLDERTOOLBAR 1359 -#define IDC_BUTTON_PAGE_EDIT 1359 -#define IDC_HOME1 1359 -#define IDR_TASKBAR_POPUP 1360 -#define IDB_GRIPH 1361 -#define IDB_BANNER 1362 -#define IDD_ADDRESSPICKER 1363 -#define IDR_ONEKEYMESSAGE 1364 -#define IDB_BITMAP1 1366 -#define IDC_EXPLANATION 1366 -#define IDC_EXPLANATION3 1366 -#define IDB_LINKBUTTON 1367 -#define IDC_CoolServer 1367 -#define IDC_CoolHost 1368 -#define IDB_BITMAP2 1368 -#define IDC_EXPIRE 1369 -#define IDD_LINK_TOOLBAR 1370 -#define IDC_RADIO_POP 1370 -#define IDC_READMAIL_POP1 1370 -#define IDB_BOOKMARK_FOLDER2 1371 -#define IDC_RADIO_IMAP 1371 -#define IDD_ADDRESS_CONTACT 1372 -#define IDB_SUBMENU1 1373 -#define IDI_ICON2 1373 -#define IDC_STYLE_PLAIN 1373 -#define IDB_SUBMENU2 1374 -#define IDI_ICON3 1374 -#define IDC_STYLE_BOLD 1374 -#define IDB_TASKBARL 1375 -#define IDI_ICON4 1375 -#define IDC_STYLE_ITALIC 1375 -#define IDB_TASKBARS 1376 -#define IDC_STYLE_BOLDITALIC 1376 -#define IDB_NAVBUTTON 1377 -#define IDC_EDIT_NEWSGROUP 1377 -#define IDR_COMPOSEPLAIN 1377 -#define IDC_SIZE_PLAIN 1377 -#define IDC_SUBSCRIBE 1378 -#define IDB_EXPANDO 1378 -#define IDC_SIZE_BIGGER 1378 -#define IDC_EXPAND_ALL 1379 -#define IDC_SIZE_SMALLER 1379 -#define IDC_COLLAPSE_ALL 1380 -#define IDC_REUSE_WINDOW 1380 -#define IDC_REUSE_THREAD_WINDOW 1380 -#define IDD_NEWSGROUP_ALL 1381 -#define IDC_GET_NEW 1381 -#define IDC_EDIT_EMAIL 1381 -#define IDD_NEWSGROUP_SEARCH 1382 -#define IDC_CLEAR_NEW 1382 -#define IDB_MAILQF 1382 -#define IDC_EDIT_REPLYTO 1382 -#define IDD_NEWSGROUP_NEW 1383 -#define IDC_COMBO_SERVER 1383 -#define IDB_MAILINGLIST 1383 -#define IDC_EDIT_ORGANIZATION 1383 -#define IDC_SEARCH_NOW 1384 -#define IDB_BOOKMARK_FOLDER_OPEN 1384 -#define IDC_EDIT_SIGFILE 1384 -#define IDD_NEWSGROUP_ADDSERVER 1385 -#define IDC_BUTTON_BROWSE 1385 -#define IDC_NEWSGROUPS 1386 -#define IDD_PREF_MNMORE 1386 -#define IDC_EDIT_NEWS_DIR 1386 -#define IDC_BUTTON_CREATE 1386 -#define IDD_PREF_MORE_MAIL_SERVER 1386 -#define IDD_WIZARD_RECEIVEMAIL 1387 -#define IDC_CHECK_MAIL_SELF 1387 -#define IDC_SEARCHHELP 1387 -#define IDC_EDIT_MAIL_FOLDER 1388 -#define IDD_WIZARD_SENDMAIL 1389 -#define IDC_EDIT_NEWS_FOLDER 1389 -#define IDD_WIZARD_READNEWS 1390 -#define IDD_WIZARD_COVERPAGE 1391 -#define IDC_BUTTON_NEWS_CHOOSE 1391 -#define IDD_PREF_MNMAILNEWS 1392 -#define IDC_CHECK_AUTO_QUOTE 1392 -#define IDD_PREF_MNIDENTITY 1393 -#define IDC_EDIT_IN_SERVER 1393 -#define IDD_PREF_MNCOMPOSITION 1394 -#define IDC_EDIT_MAIL_DIR 1394 -#define IDD_PREF_MNNEWSSERVER 1395 -#define IDC_BUTTON_MORE 1395 -#define IDC_EDIT_IMAP_DIR 1395 -#define IDD_PREF_MNMAILSERVER 1396 -#define IDC_RADIO_REMOVE 1396 -#define IDC_EDIT_PUBLIC_DIR 1396 -#define IDD_PREF_MNADDRESSBOOK 1397 -#define IDC_RADIO_LEFT 1397 -#define IDC_EDIT_OTHERS_DIR 1397 -#define IDC_RADIO_REMOTE 1398 -#define IDC_RADIO_LOCAL 1399 -#define IDC_CHECK_MAIL 1400 -#define IDD_PREF_MNCHOOSEFOLDER 1400 -#define IDC_CHECK_MESSAGE 1401 -#define IDD_PREF_MNDIRECTORIES 1401 -#define IDC_EDIT_CHECK_MAIL 1402 -#define IDD_RESOLVE_EDIT_CHANGES 1402 -#define IDC_EDIT_MESSAGE_SIZE 1403 -#define IDD_PREF_LDAP_SERVER 1404 -#define IDC_CHOOSE_COLOR 1405 -#define IDC_COLOR 1406 -#define IDB_INSERT_LINK 1406 -#define IDD_DROPDOWN_TOOLBAR 1407 -#define IDC_COMBO_FOLDER 1407 -#define IDB_INSERT_TARGET 1407 -#define IDC_CHOOSE_FONT 1407 -#define IDB_HALIGN_LEFT 1408 -#define IDC_MOVEUP 1409 -#define IDB_HALIGN_CENTER 1409 -#define IDC_EDIT_NO_HITS 1410 -#define IDB_HALIGN_RIGHT 1411 -#define IDB_INSERT_IMAGE 1412 -#define IDB_INSERT_HRULE 1413 -#define IDB_INSERT_TABLE 1414 -#define IDC_STATIC_SERVER 1414 -#define IDC_EDIT_MAX_HITS 1415 -#define IDC_EDIT_PORT_NO 1416 -#define IDC_COMBO_MAIL_FOLDER 1417 -#define IDC_STATIC_ROOT 1417 -#define IDC_EDIT_ROOT 1418 -#define IDC_COMBO_NEWS_FOLDER 1419 -#define IDC_STATIC_PORT 1419 -#define IDC_CHECK_ENCRYPTED 1420 -#define IDC_STATIC_MAX_HITS 1420 -#define IDC_EDIT_SERVE 1421 -#define IDC_FIRSTNAME_FIRST 1421 -#define IDC_CHECK_PASSWORD 1421 -#define IDC_LASTNAME_FIRST 1422 -#define IDC_EDIT_SERVER 1423 -#define IDC_SERVERS_LIST 1423 -#define IDC_EDIT_DESCRIPTION 1424 -#define IDC_STATIC_FONT 1424 -#define IDC_BOOKMARKS 1424 -#define IDB_ADDRESSBOOKSELECT 1425 -#define IDC_STATIC_STYLE 1425 -#define IDC_CUSTPREVIEW 1425 -#define IDC_COOKIES 1425 -#define IDC_STATIC_SIZE 1426 -#define IDC_INSERT 1426 -#define IDC_HANDOPEN 1426 -#define IDC_ADDBOOK 1426 -#define IDB_LARGE_HTAB 1427 -#define IDC_HANDCLOSED 1427 -#define IDC_FILTERS 1427 -#define IDB_LARGE_HFTAB 1428 -#define IDC_MOVEBUTTON 1428 -#define IDB_SMALL_HTAB 1429 -#define IDB_SMALL_HFTAB 1430 -#define IDM_NEWMAILMESSAGE 1430 -#define IDB_OPTIONSSELECT 1433 -#define IDB_BUTTON_FOLDER 1434 -#define IDC_ATTACH_VCARD 1435 -#define IDC_RADIO_FIXED 1435 -#define IDC_BITMAPLIST 1436 -#define IDC_RADIO_VARIABLE 1436 -#define IDB_THREAD_BACK 1436 -#define IDD_WIZARD_MAILNEWS_WIN16 1436 -#define IDC_DELETEPROFILE 1437 -#define IDB_MESSAGE_BACK 1437 -#define IDB_BACK 1437 -#define IDD_NEWMAIL 1438 -#define IDC_ADDRESSBKT 1438 -#define IDC_EDITPROFILE 1438 -#define IDC_STATIC_EG1 1439 -#define IDB_ATTACHBUTTON 1439 -#define IDC_STATIC_EG2 1440 -#define IDC_OPTION 1440 -#define IDC_READMAIL_POP 1441 -#define IDB_MAILREPLY 1441 -#define IDC_READMAIL_IMAP 1442 -#define IDC_READNEWS_STATIC4 1443 -#define IDD_IMAGE_ALT 1443 -#define IDC_BUTTON_HELP 1444 -#define IDD_EXTRA_HTML 1444 -#define IDC_EXTRA_HTML_TEXT 1445 -#define IDC_HISTBAR_FINDTEXT 1445 -#define IDD_NEWFOLDER 1445 -#define IDB_USERBTN 1445 -#define IDC_READMAIL_POP2 1445 -#define IDC_HISTBAR_FIELD 1446 -#define IDD_SPELL_CHECKER 1446 -#define IDC_EXTRA_HTML_MSG 1446 -#define IDC_HISTBAR_FIND 1447 -#define IDC_LOCAL_FONT_MSG 1447 -#define IDD_PREF_MNCREATECARD 1447 -#define IDC_FONT_COLOR_FRAME 1448 -#define IDC_FILENAME_AREA 1449 -#define IDC_FONT_STYLE 1449 -#define IDC_CATEGORY 1450 -#define IDC_COPYFILES 1450 -#define IDC_TEXT1 1451 -#define IDC_IGNOREFILES 1451 -#define IDC_MOVEFILES 1452 -#define IDC_VIEW 1452 -#define IDC_FILTER_HELP 1453 -#define IDC_EDIT_MAXNEWSART 1454 -#define IDC_REUSE_MESSAGE_WINDOW 1456 -#define IDC_CHECK_NOTIFY 1457 -#define IDC_CHECK_POP_REMOTE 1458 -#define IDC_CHECK_IMAP_LOCAL 1459 -#define IDC_CHECK2_DEFAULT 1460 -#define IDC_CHECK_IMAP_SSL 1460 -#define IDC_RD_KEEP_DAYS 1461 -#define IDC_RADIO_ONLINE 1461 -#define IDC_CHECK_IMAP_TRASH 1461 -#define IDC_RD_KEEPALL 1462 -#define IDC_RADIO_OFFLINE 1462 -#define IDC_RD_KEEP_NEW 1463 -#define IDC_CHECK_ASKME_DEFAULT 1463 -#define IDC_ARROW_HAND 1464 -#define IDC_EDIT_DAYS 1464 -#define IDC_INSTALL 1464 -#define IDC_BNT_MORE 1465 -#define IDC_NETHELP 1465 -#define IDC_IBEAM_HAND 1466 -#define IDC_COLOR_LIST_FRAME 1466 -#define IDC_EDIT_NEWEST 1466 -#define IDC_CHECK_DOWNLOAD 1466 -#define IDC_EXPLANATION1 1466 -#define IDC_RADIO_FROM 1467 -#define IDC_RADIO_KEEP1 1468 -#define IDC_RADIO_ALWAYS 1468 -#define IDC_RADIO_SINCE 1468 -#define IDD_NEWSMAXHEADERS 1469 -#define IDC_RADIO_KEEP2 1469 -#define IDC_RADIO_NEVER 1469 -#define IDC_EDIT_DAYS_AGO 1469 -#define IDC_TEXT_ACTION 1469 -#define IDC_RADIO_KEEP3 1470 -#define IDD_PREF_MNOFFLINE 1470 -#define IDC_TEXT_ACTION2 1470 -#define IDC_CHECK_KEEP4 1471 -#define IDD_MORE_DISK_CHOICES 1471 -#define IDC_BUTTON_SELECT 1471 -#define IDD_PREF_MORE_DISKSPACE 1472 -#define IDD_ASKME_DIALOG 1473 -#define IDC_CHECK_DOWNLOAD_MAIL 1473 -#define IDB_PREVIEWSPLASH 1474 -#define IDD_NO_SPELL_CHECKER 1474 -#define IDC_TEXT_SELECTION_COUNT 1474 -#define IDC_TEXT_DISCUSSIONS_SELECTED 1474 -#define IDB_PROPREVIEWSPLASH 1475 -#define IDB_FILEATTACHMENT 1475 -#define IDC_LIST_DISCUSSIONS 1475 -#define IDD_PP_DOWNLOAD_DISCUS 1476 -#define IDD_CUSTOM_DICTIONARY 1476 -#define IDC_BUTTON_SELECT_ALL 1476 -#define IDD_PP_DOWNLOAD_MAIL 1477 -#define IDB_WEBATTACHMENT 1477 -#define IDC_ACCTADD_TEXT 1477 -#define IDC_STATIC_UNREAD 1477 -#define IDC_CTRL 1477 -#define IDD_GO_ONOROFF_LINE 1478 -#define IDC_MUCWIZARD_MODEMLIST 1478 -#define IDC_ACCTSYS_TEXT 1478 -#define IDC_STATIC_TOTAL 1478 -#define IDC_EMAIL_TEXT1 1478 -#define IDC_BTN_RECIPIENTS 1478 -#define IDB_MAIL 1479 -#define IDC_ACCTEXIST_TEXT 1479 -#define IDC_MUCWIZARD_OK 1479 -#define IDC_STATIC_SPACE 1479 -#define IDC_EMAIL_TEXT2 1479 -#define IDC_LIST2 1479 -#define IDB_DISCUSSIONS_1 1480 -#define IDC_MUCEDIT_TEXT1 1480 -#define IDC_MUCWIZARD_CANCEL 1480 -#define IDC_CHECK_RECEIVE_HTML 1480 -#define IDC_EMAIL_ADDRTEXT 1480 -#define ID_BTN_ADD 1480 -#define IDB_MESSAGE 1481 -#define IDC_MAIL_SERVER_NAME 1481 -#define IDC_EMAIL_TEXT4 1481 -#define ID_BTN_REMOVE 1481 -#define IDD_SELECT_DISCUSSIONS 1482 -#define IDI_FILE 1482 -#define IDB_BOOKMARKOUTLINER 1482 -#define IDC_MUCWIZARD_ACCTLIST 1482 -#define IDC_PERCENT_WASTED 1482 -#define IDC_EMAIL_TEXT_PATCH 1482 -#define IDC_STATIC_HTML1 1482 -#define IDC_MUCEDIT_TEXT2 1483 -#define IDC_MUCWIZARD_MODEMVIEW 1483 -#define IDC_USED_SPACE 1483 -#define IDC_STATIC_HTML2 1483 -#define IDB_COMPOSEVTAB 1484 -#define IDC_MUCEDIT_TEXT3 1484 -#define IDC_MUCWIZARD_ACCTVIEW 1484 -#define IDC_DOWNLOAD_NOW 1484 -#define IDC_HELP_RECIPIENTS 1484 -#define IDB_VERTICALTAB 1485 -#define IDC_MUCEDIT_TEXT4 1485 -#define IDC_PRETTY_NAME 1485 -#define IDC_HELP_HTMLOK 1485 -#define IDS_INVALID_PROFILE_NAME 1486 -#define IDC_CHECK 1486 -#define IDB_MSGENCRYPTED 1486 -#define IDC_UGLY_NAME 1486 -#define IDC_ICON1 1486 -#define IDS_UNABLE_CREATE_DIR 1487 -#define IDC_TEXT2 1487 -#define IDB_MSGSIGNEDENCRYPTED 1487 -#define IDC_NEWS_SERVER 1487 -#define IDS_PROFILE_EMPTY 1488 -#define IDC_SERVER_NAME 1488 -#define IDC_ADVANCED_ACCTNAME 1488 -#define IDS_PROFILE_DELETED 1489 -#define IDB_MSGSIGNED 1489 -#define IDC_PORT_NUMBER 1489 -#define IDC_LISTBOX_TAG 1489 -#define IDS_CONFIRM_DELETE 1490 -#define IDC_SECURITY_TYPE 1490 -#define IDC_EMAIL_NAMEEG 1490 -#define IDB_MSGENCRYPTEDBAD 1491 -#define IDC_DESCRIPTION_STR 1491 -#define IDC_EMAIL_ADDREG 1491 -#define IDC_VIEW_TEXT2 1492 -#define IDB_MSGSIGNEDBAD 1493 -#define IDC_TEXT_FOLDERS_SELECTED 1493 -#define IDC_USE_MAPI 1493 -#define IDS_BAD_DIRECTORY2 1494 -#define IDC_MAPI_GROUP 1494 -#define IDB_MSGSIGNEDENCRYPTEDBAD 1495 -#define IDC_STATIC_LABEL_SELECTED 1495 -#define IDB_MSGSTAMPMASK 1496 -#define IDC_HELP_SELECT_FOR_DOWNLOAD 1496 -#define IDB_MSGATTACHED 1497 -#define IDC_HELP_GO_OFFLINE 1497 -#define IDS_INSUFFICIENT_DISKSPACE_MOVE 1498 -#define IDC_DIALER_TEXT 1498 -#define IDS_INSUFFICIENT_DISKSPACE_COPY 1499 -#define IDC_LOGINNAME 1499 -#define IDD_SPELLING_LANGUAGE 1500 -#define IDC_ADVANCED_SEARCH 1500 -#define IDC_PASSWORD 1500 -#define IDS_PROFDIR_EXISTS 1501 -#define IDC_LDAP_SEARCHBASE 1501 -#define IDS_PROFILE_SELECTOR_TITLE 1502 -#define IDC_LDAP_ADDRESS 1502 -#define IDS_PE_INTROPAGE_TEXT 1503 -#define IDC_COMBO_AND_OR 1503 -#define IDC_LDAP_SERVER 1503 -#define IDD_PP_NEWS_GENERAL 1504 -#define IDB_SAENCRYPTEDBAD 1504 -#define IDS_PEMUC_NEWSPAGE 1504 -#define IDC_HTTP_SERVER 1504 -#define IDD_PP_NEWSHOST_GENERAL 1505 -#define IDB_SAENCRYPTED 1505 -#define IDC_CHECK_SUBFOLDERS 1505 -#define IDC_HTTP_ADDRESS 1505 -#define IDB_SAUNENCRYPTED 1506 -#define IDC_RADIO_SERVER 1506 -#define IDB_SASIGNED 1507 -#define IDC_REMOVE_HEADER 1507 -#define IDB_SASIGNEDBAD 1508 -#define IDS_PEMUCWIZ_TITLE 1508 -#define IDC_EDIT_HEADERS 1508 -#define IDB_SAENCRYPTED_MASK 1509 -#define IDS_PEMUCWIZ_BUTTON 1509 -#define IDC_CLEAR_SEARCH 1509 -#define IDC_ADVANCED_SEARCH_HELP 1510 -#define IDB_SAENCRYPTEDBAD_MASK 1510 -#define IDS_PEMUC_READNEWS_FINISH 1510 -#define IDS_CLICK_FINISH 1511 -#define IDB_SASIGNED_MASK 1512 -#define IDS_PEMUC_NAMEPAGE_TEXT 1512 -#define IDB_SAUNENCRYPTED_MASK 1513 -#define IDS_MUP_NAMEPAGE_TEXT 1513 -#define IDB_SASIGNEDBAD_MASK 1514 -#define IDS_PEMUCVIEW_TEXT1 1514 -#define IDD_HTML_MAIL_QUESTION 1515 -#define IDS_PEMUCVIEW_TEXT2 1515 -#define IDD_HTML_RECIPIENTS 1516 -#define IDS_PEMUCEDIT_UPGRADE 1516 -#define IDS_PEMUCEDIT_NORMAL 1517 -#define IDB_OLDCHARTB 1521 -#define IDB_NEW_FORMAT_TOOLBAR 1522 -#define IDD_LAUNCH_HELPER 1523 -#define IDB_MSGATTACHBUTTON 1524 -#define IDB_MSGATTACHBUTTONMASK 1525 -#define IDB_MAILFOLDER 1526 -#define IDB_MAILFOLDEROPEN 1527 -#define IDD_PP_ATTACHMENT_GENERAL 1528 -#define IDB_ED_DRAG 1529 -#define IDD_QA_DIALOG 1529 -#define IDC_TABLE_SIZE 1530 -#define IDC_TABLE_VSIZE 1531 -#define IDD_ADVANCED_SEARCH 1532 -#define IDC_ROW_SIZE 1532 -#define IDC_COL_SIZE 1533 -#define IDD_BASIC_SEARCH 1533 -#define IDC_TABLE_SEL 1534 -#define IDD_NOTIFY 1534 -#define IDC_COL_SEL 1535 -#define IDD_ADVANCED_LDAP_SEARCH 1535 -#define IDC_ROW_SEL 1536 -#define IDD_PP_FOLDER 1537 -#define IDC_CELL_SEL 1537 -#define IDD_PP_MULTISEL 1538 -#define IDC_ADD_ROWS 1538 -#define IDS_PROFILE_RENAME 1539 -#define IDC_ADD_COLS 1539 -#define IDS_PROFILE_RENAME2 1540 -#define IDS_MISSING_CFG 1541 -#define IDS_INVALID_CFG 1542 -#define IDS_INVALID_WIN16_DIR 1543 -#define IDB_DIRLIST 1543 -#define IDS_UNABLE_WRITE_REG 1544 -#define IDB_MAILHCLOSEPANE_H 1545 -#define IDB_MAILHCLOSEPANE_N 1546 -#define IDB_MAILVCLOSEPANE_H 1547 -#define IDB_MAILVCLOSEPANE_N 1548 -#define IDB_MAILHSHOWPANE_H 1549 -#define IDB_MAILHSHOWPANE_N 1550 -#define IDB_MAILVSHOWPANE_H 1551 -#define IDB_MAILVSHOWPANE_N 1552 -#define IDC_UNSUBSCRIBE 1553 -#define IDD_PREF_LDAP_OFFLINE_SETTINGS 1553 -#define IDC_BUTTON_FILE_MESSAGE 1553 -#define IDC_UPDATE_NOW 1553 -#define IDC_EDIT_USERNAME 1554 -#define IDC_CHECK_OVERRIDE 1555 -#define IDC_BUTTON_NEW_FOLDER 1555 -#define IDD_XPPROGRESS 1556 -#define IDC_LINE1 1557 -#define IDC_LINE2 1558 -#define IDC_STATIC_HOST 1558 -#define IDB_NAV_BAR 1559 -#define IDD_MAILSERVER_GENERAL 1559 -#define IDB_NAV_BAR1 1560 -#define IDD_MAILSERVER_POP 1560 -#define IDC_STATIC_TYPE 1560 -#define IDD_MAILSERVER_IMAP 1561 -#define IDC_RADIO_POP3 1561 -#define IDD_MAILSERVER_ADVANCED 1562 -#define IDC_COMBO_TYPE 1562 -#define IDC_STATIC_MAIL_SERVER 1563 -#define IDC_RADIO_SEARCH_LOCAL 1570 -#define IDC_RADIO_SEARCH_SERVER 1571 -#define IDC_COPY_STYLE 1580 -#define IDC_TABLE_COPY 1581 -#define IDC_TABLE_MOVE 1582 -#define IDS_MERGE_NEXT_CELL 1583 -#define IDD_NETPROFILE_LOGIN 1599 -#define IDC_CONFIRM1 1600 -#define IDC_CONFIRM2 1601 -#define IDC_CONFIRM3 1602 -#define IDC_CONFIRM4 1603 -#define IDC_INTRO1 1604 -#define IDC_INTRO2 1605 -#define IDC_INTRO3 1606 -#define IDC_NAME1 1607 -#define IDC_NAME2 1608 -#define IDC_NAME3 1609 -#define IDC_NAME4 1610 -#define IDC_PROFILE1 1611 -#define IDC_PROFILE2 1612 -#define IDC_PROFILE3 1613 -#define IDC_PROFILE4 1614 -#define IDS_UNABLETRANSFER_SUBDIR 1615 -#define IDS_ANDTHE 1616 -#define IDS_ORTHE 1617 -#define IDS_EDIT_CUSTOM 1618 -#define IDS_HEADER_DELETED_WARN 1620 -#define IDS_HEADER_TEXT_WARN 1621 -#define IDS_CUSTOM_HEADER_ERROR 1622 -#define IDS_EDIT_HEADER_IN_USE 1623 -#define IDD_SEARCH 1650 -#define IDD_HEADER_LIST 1670 -#define IDC_DRAG_COLOR 1675 -#define IDC_DROP_COLOR 1676 -#define IDC_DRAG_ARROW 1677 -#define IDC_NO_DROP 1678 -#define ID_MERGE_TABLE_CELLS 1679 -#define IDC_ALL_CELLS_SEL 1680 -#define ID_SPLIT_TABLE_CELL 1681 -#define IDS_MERGE_SELECTED_CELLS 1682 -#define IDS_SPLIT_TABLE_CELL 1684 -#define IDS_COPY_STYLE 1685 -#define ID_COPY_STYLE 1686 -#define IDD_EDIT_HEADER 1700 -#define IDC_SHORTCUT_BASE 1800 -#define IDC_EMAIL_ADDR 1996 -#define IDC_PROFILE_NAME 1997 -#define IDC_PROFILE_DIR 1998 -#define IDC_USER_NAME 1999 -#define IDB_FILE_PICT_TOOLBAR 2001 -#define IDB_FILE_TEXT_TOOLBAR 2002 -#define IDB_FILE_MIXED_TOOLBAR 2003 -#define IDB_CHAR_FORMAT_TOOLBAR 2004 -#define IDB_PARA_FORMAT_TOOLBAR 2005 -#define IDB_FORMS_TOOLBAR 2006 -#define IDB_PICTURES_EDT 2007 -#define IDS_FONTNAME_SANS_SERIF 2007 -#define IDB_MAINFRAME_MIXED_EDT 2008 -#define IDD_PREF_EDITOR 2008 -#define IDB_MAINFRAME_TEXT_EDT 2009 -#define IDB_GOLD_SPLASH 2010 -#define IDW_FORMAT_TOOLBAR 2011 -#define IDW_EDIT_TOOLBAR 2012 -#define IDW_PARA_TOOLBAR 2013 -#define IDW_FORMS_TOOLBAR 2014 -#define IDC_CONFIG_EDITBAR 2014 -#define IDC_CONFIG_FORMATBAR 2015 -#define IDC_CONFIG_CHARBAR 2016 -#define IDS_SAVE_DOC_PROMPT 2018 -#define IDS_SAVE_HTTP_PROMPT 2019 -#define IDB_COMBOBOX 2019 -#define IDD_HREF_BOOKMARK 2021 -#define IDD_HINT_DLG 2022 -#define IDC_HREF_FILE 2023 -#define IDD_PROPS_HRULE 2024 -#define IDB_IMAGE_PREVIEW 2025 -#define IDC_ANCHOR_EDIT 2026 -#define IDD_PROPS_IMAGE 2027 -#define IDB_ALIGN_TOP 2029 -#define IDB_ALIGN_MIDDLE_BASELINE 2030 -#define IDB_ALIGN_ABSMIDDLE 2031 -#define IDB_ALIGN_BOTTOM_BASELINE 2032 -#define IDB_ALIGN_LEFT 2033 -#define IDB_ALIGN_RIGHT 2034 -#define IDB_ALIGN_ABSBOTTOM 2035 -#define IDC_HREF_UNLINK 2036 -#define IDD_LIST_DLG 2039 -#define IDC_HREF_URL 2040 -#define IDC_TARGET_LIST 2041 -#define IDC_ANCHOR_LABEL 2050 -#define IDC_ANCHOR 2051 -#define IDC_ANCHOR_FRAME 2052 -#define IDC_LINK_FRAME 2053 -#define IDC_TARGET_LABEL 2054 -#define IDC_SHOW_HINT_AGAIN 2055 -#define IDC_EDIT_HINT 2056 -#define IDC_HINT_ICON 2057 -#define IDC_HREF_LABEL 2058 -#define IDC_OVERWRITE_ICON 2059 -#define IDC_IMAGE_LINK_TO 2060 -#define IDC_HR_ALIGN_LEFT 2066 -#define IDC_HR_ALIGN_CENTER 2067 -#define IDC_HR_ALIGN_RIGHT 2068 -#define IDC_HR_WIDTH 2069 -#define IDC_HR_WIDTH_PIXELS 2070 -#define IDC_HR_WIDTH_PERCENT 2071 -#define IDC_HR_SHADOW 2073 -#define IDC_IMAGE_BORDER 2073 -#define IDC_HR_HEIGHT 2074 -#define IDC_IMAGE_SPACE_HORIZ 2074 -#define IDC_PREVIEW_FRAME 2075 -#define IDC_IMAGE_SPACE_VERT 2076 -#define IDC_IMAGE_ALT_TEXT 2077 -#define IDC_IMAGE_ALIGN_STYLES 2078 -#define IDC_IMAGE_FILE 2079 -#define IDC_LOWRES_FILE 2080 -#define IDC_NOWRAP_MSG 2092 -#define IDC_LIST_CONTAINER 2096 -#define IDC_LOWRES_URL 2096 -#define IDC_LIST_TYPE 2097 -#define IDC_COMPACT_LIST 2098 -#define IDC_KEEP_IMAGE_WITH_DOC 2099 -#define IDC_IMAGE_URL 2101 -#define IDD_LOADING_IMAGES 2102 -#define IDC_LOADING_IMAGES 2102 -#define IDD_PROPS_DOCUMENT 2103 -#define IDC_DOC_TITLE 2104 -#define IDD_PROPS_CHARACTER 2104 -#define IDC_DOC_URL 2105 -#define IDC_DOC_AUTHOR 2106 -#define IDC_DOC_CREATE_DATE 2107 -#define IDC_FONTDEF_LOCATION 2107 -#define IDC_DOC_CREATION_DATE 2107 -#define IDC_DOC_CREATE_DATE2 2108 -#define IDC_DOC_UPDATE_DATE 2108 -#define IDC_DOC_META_LIST 2109 -#define IDC_DOC_DESCRIPTION 2109 -#define IDC_META_NAME 2110 -#define IDC_META_CONTENT 2111 -#define IDC_ADD_META_TAG 2112 -#define IDC_NAV_OPENS_NEW_WINDOW 2113 -#define IDC_EDITOR_OPENS_NEW 2114 -#define IDC_CHECK_BOLD 2115 -#define IDC_CHECK_ITALIC 2116 -#define IDC_CHECK_STRIKETHROUGH 2117 -#define IDC_CHECK_SUPERSCRIPT 2118 -#define IDD_SAVE_REMOTE_DOCUMENT 2118 -#define IDC_CHECK_SUBSCRIPT 2119 -#define IDD_PROPS_META 2119 -#define IDC_FONT_PROPORTIONAL 2120 -#define IDC_CHECK_UNDERLINE 2120 -#define IDC_FONT_FIXED_WIDTH 2121 -#define IDD_PAGE_DOC_COLORS 2121 -#define IDC_FONT_SIZE_COMBO 2124 -#define IDD_SAVE_IMAGE 2124 -#define IDC_FONT_COLOR_COMBO 2125 -#define IDD_SAVE_IMAGE_OVERWRITE 2125 -#define IDC_CHANGE_COLOR 2126 -#define IDC_FONT_SIZE_COMBO2 2126 -#define IDC_CHECK_BLINK 2127 -#define IDC_COPY_IMAGES 2128 -#define IDC_CHECK_NOBREAK 2128 -#define IDC_ADJUSTLINKS 2129 -#define IDC_DONT_ADJUSTLINKS 2130 -#define IDC_EDIT_AUTHOR 2132 -#define IDC_DOC_COLOR_PREVIEW 2134 -#define IDC_EQUIV_LIST 2135 -#define IDC_META_LIST 2136 -#define IDC_VAR_NAME 2137 -#define IDC_VAR_VALUE 2138 -#define IDC_VAR_SET 2139 -#define IDC_VAR_DELETE 2140 -#define IDC_VAR_NEW 2141 -#define IDC_SAVEAS_MSG 2142 -#define IDC_SAVEAS_NEW_DOC 2143 -#define IDC_SCHEME_LIST 2146 -#define IDC_SAVE_SCHEME 2147 -#define IDC_REMOVE_SCHEME 2148 -#define IDC_COLOR_ITEMS_LIST 2149 -#define IDC_BKRND_COLOR_DEF 2156 -#define IDC_OVERWRITE_ONE 2160 -#define IDC_OVERWRITE_ALL 2161 -#define IDC_DONT_OVERWRITE_ONE 2162 -#define IDC_DONT_OVERWRITE_ALL 2163 -#define IDD_PAGE_IMAGE 2163 -#define IDD_PAGE_LINK 2164 -#define IDD_PAGE_CHARACTER 2165 -#define IDC_CHOOSE_TEXT_COLOR 2166 -#define IDC_CHOOSE_LINK_COLOR 2167 -#define IDD_PAGE_PARAGRAPH 2167 -#define IDC_CHOOSE_ACTIVELINK_COLOR 2168 -#define IDC_CHOOSE_FOLLOWEDLINK_COLOR 2169 -#define IDD_PAGE_DOC_ADVANCED 2169 -#define IDC_SWATCH_TEXT 2170 -#define IDD_CREATE_TARGET 2170 -#define IDD_PROPS_TARGET 2170 -#define IDC_SWATCH_LINK 2171 -#define IDC_SWATCH_ACTIVELINK 2172 -#define IDC_SWATCH_FOLLOWEDLINK 2173 -#define IDC_SWATCH_FOLLOWEDLINK2 2174 -#define IDC_SWATCH_BKGRND 2174 -#define IDD_PUBLISH 2175 -#define IDC_APPLY_TO_CURRENT_DOC 2176 -#define IDC_APPLY_SETTINGS_MSG 2177 -#define IDD_PAGE_PARAMETERS 2177 -#define IDC_COLOR_SCHEME_GROUP 2178 -#define IDD_PAGE_JAVA_APPLET 2178 -#define IDC_COLOR_TEXT_GROUP 2179 -#define IDD_PAGE_PLUGIN 2179 -#define IDC_COLOR_BKGRND_GROUP 2180 -#define IDD_PAGE_DOC_INFO 2180 -#define IDC_SET_DOC_COLORS 2183 -#define IDC_USE_BROWSER_COLORS 2184 -#define IDD_SAVE_NEW_DOCUMENT 2184 -#define IDD_PAGE_PLUG_IN 2185 -#define IDC_TEXT_COLOR_DEFAULT 2186 -#define IDC_TEXT_COLOR_CUSTOM 2187 -#define IDC_CHECK_FIXED_WIDTH 2188 -#define IDD_PREF_PUBLISH 2189 -#define IDC_CLEAR_ALL_STYLES 2190 -#define IDC_PARAGRAPH_COMBO 2191 -#define IDC_CLEAR_TEXT_STYLES 2191 -#define IDB_PLUGIN 2191 -#define IDC_PARAGRAPH_STYLES 2191 -#define IDB_TARGET 2192 -#define IDC_ALIGN_CENTER 2193 -#define IDB_PLUGIN_SMALL 2193 -#define IDC_ALIGN_RIGHT 2194 -#define IDD_PROPS_HTML_TAG 2194 -#define IDC_CONTAINER_COMBO 2195 -#define IDC_LISTSTYLES 2195 -#define IDC_LIST_STYLES 2195 -#define IDD_PREF_TAG_TEMPLATES 2195 -#define IDC_LIST_ITEM_LABEL 2196 -#define IDD_PROPS_JAVA_HEADER 2196 -#define IDC_LIST_ITEM_COMBO 2197 -#define IDC_LIST_ITEM_STYLES 2197 -#define IDD_OPEN_TEMPLATE 2198 -#define IDC_NETSCAPE_TEMPLATES 2198 -#define IDC_INDENT_LEVEL 2198 -#define IDC_LIST_START_NUMBER 2201 -#define IDC_HR_WIDTH_TYPE 2202 -#define IDC_TARGET_NAME 2204 -#define IDC_TARGETS_IN_CURRENT_DOC 2205 -#define IDC_TARGETS_IN_FILE 2206 -#define DC_TARGET_LIST 2208 -#define IDC_JAVA_SCRIPT_NONE 2210 -#define IDC_JAVA_SCRIPT_CLIENT 2211 -#define IDC_CONTAINER_TYPE 2211 -#define IDC_CONTAINER_STYLES 2211 -#define IDC_JAVA_SCRIPT_SERVER 2212 -#define IDC_HTML_EDITOR 2212 -#define IDC_IMAGE_EDITOR 2213 -#define IDC_IMAGE_ORIGINAL_SIZE 2213 -#define IDC_ALIGN_STYLE_FRAME 2214 -#define IDC_SELECT_HTML_EDITOR 2214 -#define IDC_IMAGE_HEIGHT 2215 -#define IDC_SELECT_IMAGE_EDITOR 2215 -#define IDC_PUBLISH_FILE_COUNT 2215 -#define IDC_IMAGE_WIDTH 2216 -#define IDC_PUBLISH_CURRENT_FILE 2216 -#define IDC_PUBLISH_TO_URL 2217 -#define IDC_TIME_REMAINING 2218 -#define IDC_PUBLISH_RATE 2219 -#define IDC_PUBLISH_DIRECTORY 2220 -#define IDC_EDIT_IMAGE 2220 -#define IDC_PUBLISH_FILE 2221 -#define IDC_AUTOADJUST_LINKS 2221 -#define IDC_PUBLISH_USER 2222 -#define IDC_NO_ADJUST_LINKS 2222 -#define IDC_ALT_TEXT 2223 -#define IDC_INFO_ICON 2223 -#define IDC_KEYWORDS 2224 -#define IDC_PLUGIN_IS_VISIBLE 2224 -#define IDC_PUBLISH_FILENAME 2225 -#define IDC_FULL_WINDOW_SIZE 2225 -#define IDC_SELECT_DIRECTORY 2226 -#define IDC_REMOVE_ISMAP 2227 -#define IDC_SAVE_INTL_CHARSET 2227 -#define IDC_SELECT_FILE 2228 -#define IDC_PLUGIN_PAL_FOREGROUND 2228 -#define IDC_PUBLISH_DIRNAME 2229 -#define IDC_PLUGIN_PAL_BACKGROUND 2229 -#define IDC_PUBLISH_LOCATION_LIST 2230 -#define IDC_BROWSE_FILE 2230 -#define IDC_APPLET_LOCATION 2231 -#define IDC_PUBLISH_FTP 2231 -#define IDC_DOC_CLASIFICATION 2232 -#define IDC_PUBLISH_HTTP 2232 -#define IDC_PUBLISH_PASSWORD 2233 -#define IDC_APPLET_CLASS_NAME 2234 -#define IDC_PUBLISH_SAVE_PASSWORD 2234 -#define IDC_PUBLISH_REMEMBER_PASSWORD 2235 -#define IDC_NEW_DOC_TEMPLATE 2236 -#define IDC_RESTORE_DEFAULT_TEMPLATE 2237 -#define IDC_EDAL_A 2238 -#define IDC_EDIT_TAG 2238 -#define IDC_EDAL_B 2239 -#define IDC_EDALCB 2240 -#define IDC_EDIT_TAG_MSG 2240 -#define IDC_EDAL_C 2241 -#define IDC_VERIFY_TAG 2241 -#define IDC_EDAL_T 2242 -#define IDC_TAG_LIST 2242 -#define IDC_EDAL_L 2243 -#define IDC_SAVE_DOC_ENCODE 2243 -#define IDC_EDAL_R 2244 -#define IDC_CLEAR_LINK 2244 -#define IDC_LINKED_TEX 2244 -#define IDC_COLOR_LABEL 2245 -#define IDC_MIXED_COLOR_LABEL 2246 -#define IDC_BROWSE_TO_LOCATION 2248 -#define IDC_NEW_DOC_BLANK 2249 -#define IDC_NEW_DOC_WIZARD 2251 -#define IDC_PUBLISH_OTHER_FILES 2252 -#define IDC_SELECT_ALL 2254 -#define IDC_SELECT_NONE 2255 -#define IDC_INCLUDE_IMAGE_FILES 2257 -#define IDC_INCLUDE_ALL_FILES 2258 -#define IDC_PUBLISH_DEFAULT_LOCATION 2259 -#define IDD_CREATE_TABLE 2266 -#define IDD_PAGE_TABLE 2267 -#define IDD_PAGE_TABLE_ROW 2268 -#define IDD_PAGE_TABLE_CELL 2269 -#define IDR_EDIT_INSERT_TABLE 2270 -#define IDR_EDIT_DELETE_TABLE 2271 -#define IDC_APPLY 2272 -#define IDR_CATEGORYFRAME 2273 -#define IDD_LOGIN_DIALOG 2274 -#define IDC_LOGIN_LIST 2275 -#define IDD_SETUPWIZARD_INTRO 2275 -#define IDC_CREATENEWPROFILE 2276 -#define IDD_SETUPWIZARD_PROFILENAME 2277 -#define IDD_SETUPWIZARD_NAMEEMAIL 2278 -#define IDD_UPDATE_STATUS 2279 -#define IDD_SETUPWIZARD_CONFIRMTYPE 2280 -#define IDD_SEARCHLDAP 2282 -#define IDD_PREF_MNDISKSPACE 2283 -#define IDD_SETUPWIZARD_WIN16 2284 -#define IDD_MUCWIZARD_INTRO 2290 -#define IDD_MUCWIZARD_VIEW 2291 -#define IDD_MUCWIZARD_ASWREADY 2292 -#define IDC_RADIO_KEEP4 2293 -#define IDD_MUCWIZARD_MUCREADY 2293 -#define IDD_MUCWIZARD_EDIT 2294 -#define IDD_MSGSRCHACTION 2295 -#define IDD_EXPORTRDF 2296 -#define IDD_NETPROFILE_ADVANCED 2297 -#define IDD_MAILSERVER_TYPE 2298 -#define IDC_COMBO_AND_OR2 2300 -#define IDC_COMBO_AND_OR3 2301 -#define IDC_COMBO_AND_OR4 2302 -#define IDC_COMBO_AND_OR5 2303 -#define IDC_PROFILENAME_TEXT 2400 -#define IDC_HEADER_HELP 2500 -#define FIRST_HISTORY_MENU_ID 16384 -#define LAST_HISTORY_MENU_ID 16600 -#define FIRST_HT_MENU_ID 16601 -#define LAST_HT_MENU_ID 16639 -#define FIRST_BOOKMARK_MENU_ID 16640 -#define LAST_BOOKMARK_MENU_ID 18687 -#define FIRST_FILE_BOOKMARK_MENU_ID 18688 -#define LAST_FILE_BOOKMARK_MENU_ID 20735 -#define FIRST_MOVE_MENU_ID 20736 -#define LAST_MOVE_MENU_ID 21759 -#define FIRST_COPY_MENU_ID 21760 -#define LAST_COPY_MENU_ID 22783 -#define FIRST_ATTACH_MENU_ID 22784 -#define LAST_ATTACH_MENU_ID 22847 -#define FIRST_SAVEATTACH_MENU_ID 22848 -#define LAST_SAVEATTACH_MENU_ID 22911 -#define FIRST_ATTACHPROP_MENU_ID 22912 -#define LAST_ATTACHPROP_MENU_ID 22975 -#define FIRST_ADDSENDER_MENU_ID 22976 -#define LAST_ADDSENDER_MENU_ID 24000 -#define FIRST_ADDALL_MENU_ID 24001 -#define LAST_ADDALL_MENU_ID 25025 -#define IDB_NEWTABS 30990 -#define IDB_DIRECTORYBUTTON 30991 -#define ID_TBAR_ALWAYSONTOP 32700 -#define ID_TBAR_SHOWTEXT 32701 -#define ID_TBAR_POSITION 32702 -#define ID_FILE_OPENURL 32769 -#define ID_NEW_FRAME 32770 -#define ID_NETSCAPE_SAVE_AS 32771 -#define ID_NETSCAPE_SAVEFRAME_AS 32772 -#define ID_FONT_10 32773 -#define ID_FONT_12 32774 -#define ID_FONT_14 32775 -#define ID_FONT_16 32776 -#define ID_FONT_24 32777 -#define ID_FONT_36 32778 -#define ID_FONT_48 32779 -#define ID_NAVIGATE_BACK 32780 -#define ID_NAVIGATE_FORWARD 32781 -#define ID_NAVIGATE_RELOAD 32782 -#define ID_NAVIGATE_REPAINT 32783 -#define ID_ENTERKEY 32784 -#define IDS_TASKBAR 32784 -#define ID_OPTIONS_BUTTONS 32785 -#define IDS_NOTIFY_MAIL1_TIP 32785 -#define ID_OPTIONS_TITLEURLBAR 32786 -#define IDS_NOTIFY_NEWS_TIP 32786 -#define ID_FILE_SAVECONFIGURATION 32787 -#define IDS_NOTIFY_WEB_TIP 32787 -#define ID_OPTIONS_TITLELOCATION_BAR 32788 -#define ID_FILE_VIEWSOURCE 32789 -#define ID_OPTIONS_STEVENSONBOX 32790 -#define ID_OPTIONS_STYLES 32791 -#define ID_OPTIONS_FANCYFTP 32792 -#define ID_OPTIONS_FANCYNEWS 32793 -#define ID_OPTIONS_FLUSHCACHE 32794 -#define IDS_TBAR_NAME 32794 -#define ID_NAVIGATE_INTERRUPT 32795 -#define IDS_NOTIFY_FOLDERS_TIP 32796 -#define ID_FONT_SMALL 32797 -#define IDS_NOTIFY_COMPOSE_TIP 32797 -#define ID_FONT_MEDIUM 32798 -#define IDS_NOTIFY_ADDRESSBOOK_TIP 32798 -#define ID_FONT_LARGE 32799 -#define IDS_NOTIFY_CALENDAR_TIP 32799 -#define IDS_NOTIFY_CALLPOINT_TIP 32800 -#define ID_OPTIONS_TOGGLENETDEBUG 32801 -#define ID_CONFIGURE_EXT_VIEWERS 32802 -#define ID_VIEW_LOADIMAGES 32804 -#define ID_VIEW_REFRESH 32805 -#define ID_GO_HOME 32807 -#define ID_GO_HISTORY 32808 -#define ID_FILE_MAILTO 32809 -#define ID_HOTLIST_ADDCURRENTTOHOTLIST 32810 -#define ID_HOTLIST_VIEW 32811 -#define ID_HOTLIST_MCOM 32812 -#define ID_HOTLIST_FISHCAM 32815 -#define IDS_DRAGURLTIP 32815 -#define ID_OPTIONS_LOADINLINEDIMAGES 32816 -#define ID_EDIT_FINDINCURRENT 32818 -#define ID_STARTERS_WELCOME 32820 -#define ID_STARTERS_WHATSNEW 32821 -#define ID_STARTERS_READNEWSGROUPS 32822 -#define ID_STARTERS_INTERNETINDEX 32823 -#define ID_STARTERS_INTERNETSEARCH 32824 -#define ID_STARTERS_INTERNETWHITEPAGES 32825 -#define ID_STARTERS_ABOUTTHEINTERNET 32826 -#define ID_STARTERS_HOWTOCREATEWEBSERVERS 32827 -#define ID_STARTERS_MCOM 32828 -#define ID_HELP_VERSION 32829 -#define ID_HELP_GUIDEDTOUR 32830 -#define ID_HELP_MANUAL 32831 -#define ID_HELP_FREQUENTLYASKEDQUESTIONS 32832 -#define ID_HELP_HOWTOGIVEFEEDBACK 32833 -#define ID_HELP_HOWTOGETSUPPORT 32834 -#define ID_OPTIONS_SAVE 32835 -#define ID_SAVE_OPTIONS 32836 -#define ID_OPTIONS_SHOWSTARTERBUTTONS 32837 -#define ID_OPTIONS_SHOWFTPFILEINFORMATION 32838 -#define ID_BASE_PROPORTIONAL_FONT 32839 -#define ID_BASE_FIXED_FONT 32840 -#define ID_HELP_LICENSE 32841 -#define ID_FILE_DOCINFO 32842 -#define ID_OPTIONS_SHOWSEC_BAR 32843 -#define ID_DOCUMENT_TOP 32844 -#define ID_FILE_PREFERENCES 32845 -#define ID_POPUP_GOTOLINK 32846 -#define IDS_POPUP_LOADLINK 32847 -#define ID_POPUP_PROPERTIES 32848 -#define ID_POPUP_FOLDUNFOLD 32850 -#define ID_POPUP_INTERNETSHORTCUT 32852 -#define IDS_POPUP_BREADCRUMBS 32853 -#define IDS_POPUP_BOOKMARKS 32854 -#define IDS_POPUP_ADDLINK2BOOKMARKS 32855 -#define IDS_POPUP_LOADLINKNEWWINDOW 32856 -#define IDS_POPUP_SAVELINKCONTENTS 32857 -#define IDS_POPUP_COPYLINKCLIPBOARD 32858 -#define IDS_POPUP_SAVEIMAGEAS 32859 -#define IDS_POPUP_COPYIMGLOC2CLIPBOARD 32860 -#define IDS_POPUP_LOAD_IMAGE 32862 -#define IDS_POPUP_LOADEMBED 32864 -#define IDS_POPUP_NOEMBED 32865 -#define IDS_POPUP_SAVEEMBEDAS 32866 -#define IDS_POPUP_ACTIVATE_EMBED 32867 -#define IDS_POPUP_COPYEMBEDLOC 32868 -#define IDS_POPUP_FRAMEBACK 32869 -#define IDS_POPUP_SAVEATTACHMENTAS 32869 -#define IDS_POPUP_FRAMEFORWARD 32870 -#define ID_EDIT_DELETE 32871 -#define ID_LOCATION_FOCUS 32872 -#define IDS_POPUP_BACK 32873 -#define ID_FILE_SAVEAS 32874 -#define IDS_POPUP_COPYEMBEDDATA 32875 -#define ID_DOCUMENT_BOTTOM 32876 -#define IDD_JAVACONSOLE 32877 -#define ID_OPTIONS_SHOWJAVACONSOLE 32878 -#define IDD_COMPLETION_PICKER 32878 -#define ID_FILE_MAILNEW 32879 -#define ID_EDIT_FINDAGAIN 32880 -#define ID_NAVIGATE_RELOADCELL 32881 -#define ID_OPTIONS_MAILANDNEWS 32882 -#define ID_OPTIONS_SECURITY 32883 -#define ID_OPTIONS_NETWORK 32884 -#define ID_WINDOW_ADDRESSBOOK 32885 -#define ID_POPUP_MAILNEW 32887 -#define ID_POPUP_CUT 32888 -#define ID_POPUP_COPY 32889 -#define ID_POPUP_PASTE 32890 -#define ID_POPUP_DELETE 32891 -#define ID_POPUP_DELETEBOOKMARK 32891 -#define ID_POPUP_MAKEALIAS 32892 -#define ID_POPUP_SETTOMENU 32893 -#define ID_POPUP_SETTOFOLDER 32894 -#define ID_POPUP_INSERTFOLDER 32895 -#define ID_POPUP_INSERTSEPARATOR 32896 -#define ID_POPUP_INSERTBOOKMARK 32897 -#define IDS_POPUP_FORWARD 32898 -#define IDS_TITLE_NOTITLE 32899 -#define IDS_TITLE_NOSUBJECT 32900 -#define IDS_TITLE_ADDRESSBOOK 32901 -#define IDS_TITLE_BOOKMARKS 32902 -#define IDS_TITLE_WEB 32903 -#define IDS_TITLE_COMPOSE_MESSAGE 32904 -#define IDS_TITLE_MESSAGE 32905 -#define IDS_TITLE_ARTICLE 32906 -#define IDS_TITLE_COLLECTIONS 32907 -#define ID_PLACES 32908 -#define ID_SECURITY 32909 -#define ID_NETSEARCH 32910 -#define ID_HISTORY_TITLE 32911 -#define ID_HISTORY_LOCATION 32912 -#define ID_HISTORY_FIRSTVISIT 32913 -#define ID_HISTORY_LASTVISIT 32914 -#define ID_HISTORY_EXPIRES 32915 -#define ID_HISTORY_VISITCOUNT 32916 -#define ID_HISTORY_LOGAND 32917 -#define ID_HISTORY_LOGOR 32918 -#define ID_POPUP_LOADFRAMENEWWINDOW 32919 -#define ID_POPUP_MAILTO 32920 -#define ID_NEXT_WINDOW 33013 -#define ID_HELP_SECURITY 33014 -#define ID_HELP_REGISTRATION 33015 -#define ID_CANCEL_EDIT 33016 -#define ID_POPUP_LOADLINK 33102 -#define ID_POPUP_ADDLINK2BOOKMARKS 33103 -#define ID_POPUP_LOADLINKNEWWINDOW 33104 -#define ID_POPUP_SAVELINKCONTENTS 33105 -#define ID_POPUP_COPYLINKCLIPBOARD 33106 -#define ID_POPUP_LOADIMAGE 33107 -#define ID_POPUP_SAVEIMAGEAS 33108 -#define ID_POPUP_COPYIMGLOC2CLIPBOARD 33109 -#define ID_POPUP_LOADIMAGEINLINE 33110 -#define ID_POPUP_ACTIVATEEMBED 33111 -#define ID_POPUP_SAVEEMBEDAS 33112 -#define ID_POPUP_COPYEMBEDLOC 33113 -#define ID_POPUP_COPYEMBEDDATA 33114 -#define ID_OPTIONS_TIPS 33125 -#define ID_REMOVE_FONTFACE 33126 -#define ID_FILE_OPENFOLDER 34000 -#define ID_FILE_OPENFOLDERNEW 34001 -#define ID_FILE_OPENFOLDERREUSE 34002 -#define ID_OPEN_MAIL_WINDOW 34003 -#define ID_MESSAGE_GETNEWMAIL 34004 -#define ID_OPEN_NEWS_WINDOW 34005 -#define ID_FILE_GETNEWMAIL 34006 -#define ID_FILE_DELIVERMAILNOW 34007 -#define ID_FILE_NEWFOLDER 34008 -#define ID_FILE_COMPRESSTHISFOLDER 34009 -#define ID_FILE_COMPRESSALLFOLDERS 34010 -#define ID_FILE_EMPTYTRASHFOLDER 34011 -#define ID_EDIT_DELETEMESSAGE 34022 -#define ID_POPUP_DELETEFOLDER 34023 -#define ID_EDIT_SELECTTHREAD 34024 -#define ID_EDIT_SELECTMARKEDMESSAGES 34025 -#define ID_EDIT_SELECTALLMESSAGES 34026 -#define ID_MESSAGE_REPLY 34029 -#define ID_MESSAGE_FORWARD 34031 -#define ID_MESSAGE_MOVE_TOFILE 34032 -#define ID_MESSAGE_MOVE_INBOXFOLDER 34033 -#define ID_MESSAGE_MOVE_TRASHFOLDER 34034 -#define ID_MESSAGE_OPEN 34035 -#define ID_POUP_COPYLINKCLIPBOARD 34035 -#define ID_WINDOW_NEWWINDOW 34036 -#define ID_UNROT13 34037 -#define ID_SORT_SORTMENUGOESHERE 34039 -#define ID_GO_FIRSTUNREAD 34043 -#define ID_VIEW_SHOWALLHEADERS 34044 -#define ID_SORT_THREADMESSAGES 34047 -#define ID_MAIL_THREAD 34048 -#define ID_SORT_ASCENDING 34049 -#define ID_SORT_BYDATE 34050 -#define ID_SORT_BYSUBJECT 34051 -#define ID_SORT_BYSENDER 34052 -#define ID_MAIL_ALLHEADERS 34054 -#define ID_MAIL_UNROT13 34055 -#define ID_WINDOW_BOOKMARKWINDOW 34056 -#define ID_VIEW_PAGESERVICES 34057 -#define ID_WINDOW_WINDOW_0 34060 -#define ID_WINDOW_WINDOW_1 34061 -#define ID_WINDOW_WINDOW_2 34062 -#define ID_WINDOW_WINDOW_3 34063 -#define ID_WINDOW_WINDOW_4 34064 -#define ID_WINDOW_WINDOW_5 34065 -#define ID_WINDOW_WINDOW_6 34066 -#define ID_WINDOW_WINDOW_7 34067 -#define ID_WINDOW_WINDOW_8 34068 -#define ID_WINDOW_WINDOW_9 34069 -#define ID_WINDOW_NEWBROWSER 34079 -#define ID_WINDOW_MAIL 34080 -#define ID_WINDOW_NEWS 34081 -#define ID_FILE_SEND 34084 -#define ID_FILE_ATTACH 34085 -#define ID_FILE_QUOTE 34086 -#define ID_FILE_OPENNEWSHOST 34087 -#define ID_FILE_REMOVENEWSHOST 34088 -#define ID_OPTIONS 34090 -#define ID_OPTIONS_SHOWACTIVENEWSGROUPS 34091 -#define ID_SHOWALLNEWSGROUPS 34092 -#define ID_OPTIONS_SHOWNEWNEWSGROUPS 34093 -#define ID_FILE_SENDLATER 34094 -#define IDS_FILE_SEND 34095 -#define IDS_FILE_SENDLATER 34096 -#define ID_OPTIONS_SHOWSUBSCRIBEDNEWSGROUPS 34098 -#define ID_MAIL_READTOPIC 34105 -#define ID_MAIL_READALL 34106 -#define ID_MAIL_SORTAGAIN 34111 -#define ID_OPTIONS_SAVEOPTIONS 34112 -#define ID_NEWS_POSTNEW 34116 -#define ID_MAIL_SHOWREAD 34119 -#define ID_MESSAGE_MARKASREAD 34120 -#define ID_MESSAGE_MARKASUNREAD 34121 -#define ID_MESSAGE_MARK 34125 -#define ID_MESSAGE_UNMARK 34126 -#define ID_MESSAGE_MOVE_SENT 34127 -#define ID_ITEM_MAILNEW 34134 -#define ID_ITEM_ADDUSER 34135 -#define ID_ITEM_ADDLIST 34136 -#define ID_ITEM_PROPERTIES 34137 -#define ID_FILE_IMPORT 34138 -#define ID_EDIT_PASTEASQUOTE 34139 -#define ID_ITEM_FOLD 34140 -#define ID_FOLDERINFO_ICON 34141 -#define ID_FOLDERINFO_NAME 34142 -#define ID_FOLDERINFO_UNREAD 34143 -#define ID_FOLDERINFO_COUNT 34144 -#define ID_FILE_NEWAB 34145 -#define ID_FILE_NEWDIR 34156 -#define ID_COMPOSE_QUOTE 34201 -#define ID_VIEW_SHOWALLFIELDS 34300 -#define ID_VIEW_SHOWREPLYTO 34301 -#define ID_VIEW_SHOWMAILTO 34302 -#define ID_VIEW_SHOWCC 34303 -#define ID_VIEW_SHOWBCC 34304 -#define ID_VIEW_SHOWPOSTTO 34305 -#define ID_VIEW_SHOWFOLLOWUPSTO 34306 -#define ID_VIEW_SHOWSUBJECT 34307 -#define ID_VIEW_SHOWATTACHMENT 34308 -#define ID_FILE_ADDNEWSGROUP 34312 -#define ID_FILE_GETMOREMESSAGES 34313 -#define ID_EDIT_CANCELMESSAGE 34315 -#define ID_MESSAGE_FORWARDQUOTED 34319 -#define ID_OPTIONS_SHOWONLYUNREADMESSAGES 34326 -#define ID_OPTIONS_SHOWUNREAD 34335 -#define ID_OLE_UPDATE 34336 -#define ID_FILE_WHATSNEW 34337 -#define ID_EDIT_SELECTALL 34338 -#define ID_ITEM_MAKEALIAS 34340 -#define ID_ITEM_SETTOFOLDER 34341 -#define ID_ITEM_SETTOMENU 34342 -#define ID_ITEM_INSERTBOOKMARK 34343 -#define ID_ITEM_INSERTFOLDER 34344 -#define ID_ITEM_INSERTSEPARATOR 34345 -#define ID_ITEM_GOTOBOOKMARK 34346 -#define ID_EDIT_SEARCH 34352 -#define ID_EDIT_SEARCHAGAIN 34353 -#define ID_VIEW_ATTACHINLINE 34355 -#define ID_VIEW_ATTACHLINKS 34356 -#define ID_FILE_PRINTPREVIEW 34357 -#define ID_OPTIONS_IMMEDIATEDELIVERY 34358 -#define ID_OPTIONS_DEFERREDDELIVERY 34359 -#define ID_SORT_BYMESSAGENUMBER 34364 -#define ID_VIEW_SHOWFROM 34365 -#define ID_FILE_UPLOADFILE 34366 -#define ID_MAIL_NORMALHEADERS 34367 -#define ID_MAIL_COMPRESSEDHEADERS 34368 -#define ID_FILE_NEWMESSAGE 34369 -#define ID_FILE_OPENMESSAGE 34370 -#define ID_FILE_OPENMESSAGENEW 34371 -#define ID_FILE_OPENMESSAGEREUSE 34372 -#define ID_EDIT_FILTERRULES 34378 -#define ID_EDIT_MAILPREFERENCES 34379 -#define ID_VIEW_NEXT 34380 -#define ID_EDIT_FILTER 34380 -#define ID_VIEW_PREVIOUS 34381 -#define ID_VIEW_REUSE 34384 -#define ID_MESSAGE_SEND 34390 -#define ID_MESSAGE_SENDLATER 34391 -#define ID_VIEW_ROT13 34394 -#define ID_TOOLS_BOOKMARKS 34398 -#define ID_TOOLS_ADDRESSBOOK 34399 -#define IDS_COMPRESSINGFOLDERS 34400 -#define ID_EDIT_DELETEFOLDER 34406 -#define ID_MESSAGE_NEXT 34410 -#define ID_MESSAGE_PREVIOUS 34411 -#define ID_MESSAGE_NEXTUNREAD 34412 -#define ID_MESSAGE_REUSE 34413 -#define ID_MESSAGE_REPLYALL 34415 -#define ID_TOOLS_MAIL 34420 -#define ID_TOOLS_NEWS 34421 -#define IF_FILE_EMPTYTRASH 34434 -#define ID_FILE_EMPTYTRASH 34434 -#define ID_MESSAGE_POSTREPLY 34435 -#define ID_MESSAGE_POSTANDREPLY 34436 -#define ID_FILE_SAVEMESSAGES 34437 -#define ID_MESSAGE_STOP 34438 -#define ID_MESSAGE_PREVIOUSUNREAD 34441 -#define ID_VIEW_FOLDER 34442 -#define ID_SORT_BYPRIORITY 34448 -#define ID_SORT_BYTHREAD 34449 -#define ID_VIEW_ADVANCEDTOOLBARS 34451 -#define ID_MESSAGE_SENDUNSENT 34452 -#define ID_MESSAGE_ADDSENDER 34453 -#define ID_MESSAGE_ADDALL 34454 -#define ID_FOLDER_RENAME 34455 -#define ID_FOLDER_MOVETO 34456 -#define ID_FOLDER_COPYTO 34457 -#define ID_TOOLS_WEB 34458 -#define ID_FOLDER_SELECT 34459 -#define ID_CATEGORY_SELECT 34460 -#define ID_TOOLS_EDITOR 34461 -#define ID_EDIT_FINDNEXT 34464 -#define ID_VIEW_HEADERS_MICRO 34467 -#define ID_VIEW_HEADERS_SHORT 34468 -#define ID_VIEW_HEADERS_ALL 34469 -#define ID_BLEH_DOUBLEBLEH 34473 -#define ID_DRAG_THIS_URL 34482 -#define ID_EDT_NEW_DOC_FROM_TEMPLATE 34483 -#define ID_GO_PUBLISH_LOCATION 34484 -#define IDS_DEF_PUB_LOC_NOT_SET 34485 -#define ID_VIEW_FRAME_SOURCE 34486 -#define ID_VIEW_FRAME_INFO 34487 -#define ID_MAIL_WRAPLONGLINES 34496 -#define ID_HOTLIST_ADDCURRENTTOHOTLIST2 34497 -#define IDS_PUBLISH_FILES 34503 -#define IDS_FILE_COUNT_FORMAT 34504 -#define IDS_UPLOADING_FILE 34505 -#define IDS_SAVING_FILE 34506 -#define IDS_PREPARING_PUBLISH 34507 -#define IDS_PUBLISH_REPORT_MSG 34508 -#define IDS_PUBLISH_REPORT_ONE_FILE 34509 -#define ID_LOCAL_POPUP 34512 -#define ID_ANIMATION_BONK 34513 -#define ID_VIEW_TWOPANE 34514 -#define ID_VIEW_ONEPANE 34515 -#define ID_DIRECTORY 34516 -#define ID_SWITCH_SORT 34517 -#define ID_FILE_NEWNEWSGROUP 34518 -#define ID_OPEN_NEWSGROUP 34519 -#define ID_FILE_DELETENEWSGROUP 34520 -#define ID_FILE_SUBSCRIBE 34521 -#define ID_FILE_UNSUBSCRIBE 34522 -#define ID_EDIT_SEARCHNEWSGROUPS 34523 -#define ID_MESSAGE_MARKALLREAD 34526 -#define ID_FILE_OPENNEWSGROUP 34527 -#define ID_SECURITY_ADVISOR 34528 -#define ID_FILE_OPENDRAFT 34529 -#define ID_MESSAGE_GETNEWNEWS 34535 -#define ID_SORT_TYPE 34547 -#define ID_SORT_TITLE 34547 -#define ID_SORT_NAME 34548 -#define ID_SORT_LOCATION 34548 -#define ID_SORT_NICKNAME 34549 -#define ID_SORT_FIRSTVISIT 34549 -#define ID_SORT_EMAILADDRESS 34550 -#define ID_SORT_LASTVISIT 34550 -#define ID_SORT_COMPANY 34551 -#define ID_SORT_EXPIREDATE 34551 -#define ID_SORT_LOCALITY 34552 -#define ID_SORT_VISITCOUNT 34552 -#define ID_ASCENDING 34553 -#define ID_DECENDING 34554 -#define ID_DESCENDING 34554 -#define ID_FILE_COMPOSE 34558 -#define ID_ITEM_MESSAGECC 34559 -#define ID_ITEM_MESSAGEBCC 34560 -#define ID_MESSAGE_CONTINUE 34561 -#define ID_MESSAGE_NEXTUNREADTHREAD 34563 -#define ID_MESSAGE_KILL 34564 -#define ID_MESSAGE_WATCH 34565 -#define ID_VIEW_ALLTHREADS 34566 -#define ID_VIEW_WATCHEDTHREADS 34567 -#define ID_VIEW_NEWTHREADS 34568 -#define ID_VIEW_KILLEDTHREADS 34569 -#define ID_EDIT_LDAPSEARCH 34570 -#define ID_MESSAGE_KILLCATEGORY 34574 -#define ID_MESSAGE_CATCHUP 34576 -#define ID_MESSAGE_MARKTHREADREAD 34579 -#define ID_MESSAGE_SELECT 34582 -#define ID_NAVIGATE_MSGCONTAINER 34582 -#define ID_NAVIGATE_CONTAINER 34583 -#define ID_MESSAGE_MARKASLATER 34584 -#define ID_MESSAGE_FILE 34585 -#define ID_BUTTON_CONTAINER 34586 -#define ID_APP_SUPER_EXIT 34593 -#define ID_MESSAGE_REPLYBUTTON 34594 -#define ID_MESSAGE_MARKBUTTON 34595 -#define ID_WINDOW_NETCASTER 34596 -#define ID_WINDOW_AIM 34597 -#define IDS_AIM_MENU 34598 -#define IDS_AIM_REGISTRY 34599 -#define ID_DELETE_BUTTON 34600 -#define IDS_DELETE_BUTTON 34601 -#define ID_RENAME_BUTTON 34602 -#define IDS_RENAME_BUTTON 34603 -#define ID_BUTTON_PROPERTIES 34604 -#define IDS_BUTTON_PROPERTIES 34605 -#define IDS_NETSCAPE_TIP 34606 -#define ID_OPTIONS_ENCODING_1 35001 -#define ID_OPTIONS_ENCODING_2 35002 -#define ID_OPTIONS_ENCODING_3 35003 -#define ID_OPTIONS_ENCODING_4 35004 -#define ID_OPTIONS_ENCODING_5 35005 -#define ID_OPTIONS_ENCODING_6 35006 -#define ID_OPTIONS_ENCODING_7 35007 -#define ID_OPTIONS_ENCODING_8 35008 -#define ID_OPTIONS_ENCODING_9 35009 -#define ID_OPTIONS_ENCODING_10 35010 -#define ID_OPTIONS_ENCODING_11 35011 -#define ID_OPTIONS_ENCODING_12 35012 -#define ID_OPTIONS_ENCODING_13 35013 -#define ID_OPTIONS_ENCODING_14 35014 -#define ID_OPTIONS_ENCODING_15 35015 -#define ID_OPTIONS_ENCODING_16 35016 -#define ID_OPTIONS_ENCODING_17 35017 -#define ID_OPTIONS_ENCODING_18 35018 -#define ID_OPTIONS_ENCODING_19 35019 -#define ID_OPTIONS_ENCODING_20 35020 -#define ID_OPTIONS_ENCODING_21 35021 -#define ID_OPTIONS_ENCODING_22 35022 -#define ID_OPTIONS_ENCODING_23 35023 -#define ID_OPTIONS_ENCODING_24 35024 -#define ID_OPTIONS_ENCODING_25 35025 -#define ID_OPTIONS_ENCODING_26 35026 -#define ID_OPTIONS_ENCODING_27 35027 -#define ID_OPTIONS_ENCODING_28 35028 -#define ID_OPTIONS_ENCODING_29 35029 -#define ID_OPTIONS_ENCODING_30 35030 -#define ID_OPTIONS_ENCODING_31 35031 -#define ID_OPTIONS_ENCODING_32 35032 -#define ID_OPTIONS_ENCODING_33 35033 -#define ID_OPTIONS_ENCODING_34 35034 -#define ID_OPTIONS_ENCODING_35 35035 -#define ID_OPTIONS_ENCODING_36 35036 -#define ID_OPTIONS_ENCODING_37 35037 -#define ID_OPTIONS_ENCODING_38 35038 -#define ID_OPTIONS_ENCODING_39 35039 -#define ID_OPTIONS_ENCODING_40 35040 -#define ID_OPTIONS_ENCODING_41 35041 -#define ID_OPTIONS_ENCODING_42 35042 -#define ID_OPTIONS_ENCODING_43 35043 -#define ID_OPTIONS_ENCODING_44 35044 -#define ID_OPTIONS_ENCODING_45 35045 -#define ID_OPTIONS_ENCODING_46 35046 -#define ID_OPTIONS_ENCODING_47 35047 -#define ID_OPTIONS_ENCODING_48 35048 -#define ID_OPTIONS_ENCODING_49 35049 -#define ID_OPTIONS_ENCODING_50 35050 -#define ID_OPTIONS_ENCODING_51 35051 -#define ID_OPTIONS_ENCODING_52 35052 -#define ID_OPTIONS_ENCODING_53 35053 -#define ID_OPTIONS_ENCODING_54 35054 -#define ID_OPTIONS_ENCODING_55 35055 -#define ID_OPTIONS_ENCODING_56 35056 -#define ID_OPTIONS_ENCODING_57 35057 -#define ID_OPTIONS_ENCODING_58 35058 -#define ID_OPTIONS_ENCODING_59 35059 -#define ID_OPTIONS_ENCODING_60 35060 -#define ID_OPTIONS_ENCODING_61 35061 -#define ID_OPTIONS_ENCODING_62 35062 -#define ID_OPTIONS_ENCODING_63 35063 -#define ID_OPTIONS_ENCODING_64 35064 -#define ID_OPTIONS_ENCODING_65 35065 -#define ID_OPTIONS_ENCODING_66 35066 -#define ID_OPTIONS_ENCODING_67 35067 -#define ID_OPTIONS_ENCODING_68 35068 -#define ID_OPTIONS_ENCODING_69 35069 -#define ID_OPTIONS_ENCODING_70 35070 -#define ID_EDT_FILE_SAVE 42001 -#define ID_EDT_FILE_SAVEAS 42002 -#define ID_EDIT_DOCUMENT 42003 -#define ID_OPT_EDITBAR_TOGGLE 42004 -#define ID_OPT_CHARBAR_TOGGLE 42005 -#define IDM_OPT_MESSAGEBAR_TOGGLE 42006 -#define ID_MAKE_LINK 42008 -#define ID_FORMAT_CHAR_BOLD 42010 -#define ID_FORMAT_CHAR_ITALIC 42011 -#define ID_FORMAT_CHAR_NOBREAKS 42012 -#define ID_FORMAT_CHAR_SUPER 42013 -#define ID_FORMAT_CHAR_SUB 42014 -#define ID_FORMAT_CHAR_STRIKEOUT 42015 -#define ID_FORMAT_CHAR_BLINK 42016 -#define ID_FORMAT_CHAR_NONE 42017 -#define ID_COMBO_FONTSIZE 42018 -#define ID_COMBO_FONTFACE 42019 -#define ID_COMBO_FONTCOLOR 42020 -#define ID_COMBO_PARA 42021 -#define ID_OPEN_NAV_WINDOW 42022 -#define ID_NEXT_WORD 42024 -#define ID_PREVIOUS_WORD 42025 -#define ID_NEXT_PARAGRAPH 42026 -#define IDS_LINK_TO_FILE 42026 -#define ID_PREVIOUS_PARAGRAPH 42027 -#define IDS_ANCHOR_IMAGE_FILE 42027 -#define IDS_ANCHOR_TEXT 42028 -#define IDS_ANCHOR_IMAGE 42029 -#define IDS_DRAG_SITEMAN_HINT 42030 -#define IDS_DRAG_BOOKMARK_HINT 42031 -#define ID_OPEN_EDITOR_WINDOW 42032 -#define ID_EDT_FINDREPLACE 42034 -#define IDS_TYPE_URL_OR_TARGET 42035 -#define IDS_TYPE_URL 42036 -#define IDS_NEW_EDITOR 42037 -#define IDS_NETSCAPE_COMPOSER 42037 -#define ID_ACTIVATE_SITE_MANAGER 42038 -#define ID_VIEW_NEWONLY 42039 -#define IDS_SITE_MANAGER 42041 -#define IDS_ANCHOR_SELECTED_TEXT 42042 -#define IDS_NEW_ANCHOR_TEXT 42043 -#define ID_EDITOR_UP 42044 -#define ID_EDITOR_DOWN 42045 -#define ID_EDITOR_NEXTCHAR 42046 -#define ID_EDITOR_PREVIOUSCHAR 42047 -#define ID_EDITOR_BEGINOFLINE 42048 -#define ID_EDITOR_ENDOFLINE 42049 -#define ID_EDITOR_PAGEUP 42050 -#define ID_EDITOR_PAGEDOWN 42051 -#define ID_EDITOR_BEGINOFDOCUMENT 42052 -#define ID_EDITOR_ENDOFDOCUMENT 42053 -#define ID_EDITOR_NEXTWORD 42054 -#define ID_EDITOR_PREVIOUSWORD 42055 -#define ID_EDITOR_SELECTUP 42056 -#define ID_EDITOR_SELECTDOWN 42057 -#define ID_EDITOR_SELECTNEXTCHAR 42058 -#define ID_EDITOR_SELECTPREVIOUSCHAR 42059 -#define ID_EDITOR_SELECTBEGINOFLINE 42060 -#define ID_EDITOR_SELECTENDOFLINE 42061 -#define ID_EDITOR_SELECTPAGEUP 42062 -#define ID_EDITOR_SELECTPAGEDOWN 42063 -#define ID_EDITOR_SELECTBEGINOFDOCUMENT 42064 -#define ID_EDITOR_SELECTENDOFDOCUMENT 42065 -#define ID_EDITOR_SELECTNEXTWORD 42066 -#define ID_EDITOR_SELECTPREVIOUSWORD 42067 -#define IDS_LEFT 42068 -#define IDS_CENTER 42069 -#define IDS_RIGHT 42070 -#define IDS_TOP 42071 -#define IDS_BOTTOM 42072 -#define IDS_BASELINE 42073 -#define IDS_SELECT_LOWRES_IMAGE 42074 -#define ID_PROPS_LOCAL 42075 -#define ID_PROPS_FONTDEF 42076 -#define ID_PROPS_IMAGE 42077 -#define ID_PROPS_HRULE 42078 -#define ID_PROPS_LINK 42079 -#define ID_PROPS_PARAGRAPH 42080 -#define ID_PROPS_CHARACTER 42081 -#define ID_PROPS_DOCUMENT 42082 -#define ID_PROPS_TEXT 42083 -#define ID_PROPS_JAVA 42084 -#define ID_PROPS_PLUGIN 42085 -#define ID_PROPS_TARGET 42086 -#define ID_PROPS_TAG 42087 -#define ID_PROPS_DOC_COLOR 42088 -#define ID_FORMAT_INDENT 42097 -#define ID_FORMAT_OUTDENT 42098 -#define ID_INSERT_IMAGE 42100 -#define ID_INSERT_HRULE 42101 -#define ID_INSERT_LINE_BREAK 42102 -#define ID_INSERT_BREAK_LEFT 42103 -#define ID_INSERT_BREAK_RIGHT 42104 -#define ID_INSERT_BREAK_BOTH 42105 -#define ID_INSERT_TARGET 42108 -#define ID_INSERT_TAG 42109 -#define IDS_CREATE_LINK 42110 -#define IDS_POPUP_CREATE_LINK 42111 -#define IDS_POPUP_INSERT_LINK 42112 -#define IDS_CAPTION_NONE 42113 -#define IDS_CAPTION_ABOVE 42114 -#define IDS_CAPTION_BELOW 42115 -#define IDS_PROPS_LINK 42116 -#define IDS_POPUP_PROPS_PAGE 42117 -#define IDS_POPUP_MAKE_IMAGE_BACKGROUND 42118 -#define ID_MAKE_IMAGE_BACKGROUND 42119 -#define IDS_EDIT_CUT 42121 -#define IDS_EDIT_COPY 42122 -#define IDS_EDIT_PASTE 42123 -#define IDS_EDIT_PASTE_LINK 42124 -#define IDS_EDIT_COPY_LINK 42125 -#define IDS_EDIT_SAVE_IMAGE 42126 -#define IDS_EDIT_ADD_LINK2BOOKMARKS 42127 -#define IDS_ERR_DIF_LOCAL_DEVICE_LINK 42128 -#define IDS_ERR_DIF_LOCAL_DEVICE_IMG 42129 -#define ID_INSERT_LINK 42134 -#define ID_EDIT_WINDOW_BOOKMARKS 42135 -#define IDS_INSERT_IMAGE 42136 -#define IDS_INSERT_HRULE 42137 -#define IDS_ERR_SRC_NOT_FOUND 42138 -#define IDS_ERR_COPY_FILE 42139 -#define IDS_WARN_REPLACE_FILE 42140 -#define IDS_COPY_FILE 42141 -#define IDS_RESOLVE_IMAGE_URL 42142 -#define IDS_RESOLVE_LINK_URL 42143 -#define IDS_EDIT_LINK 42144 -#define IDS_BROWSE_LINK 42145 -#define IDS_SAVE_AS_CAPTION 42146 -#define IDS_OVERWRITE_ACTIVE_FILE 42147 -#define IDS_DOC_PROPS_CAPTION 42150 -#define ID_FILE_OPEN_TO_EDIT 42151 -#define IDS_SAVEAS_REMOTE_MSG 42152 -#define IDS_SAVEAS_NEWDOC_MSG 42153 -#define IDS_SAVEAS_REMOTE_OR_NEWDOC_MSG 42154 -#define IDS_POPUP_LOAD_LINK_EDT 42155 -#define ID_POPUP_EDIT_IMAGE 42156 -#define IDS_POPUP_LOADLINKNEWWINDOW_EDT 42157 -#define IDS_POPUP_COPYLINKCLIPBOARD_EDT 42158 -#define IDS_POPUP_EDIT_LINK 42159 -#define IDS_POPUP_SAVELINKCONTENTS_EDT 42160 -#define IDS_POPUP_ADDLINK2BOOKMARKS_EDT 42162 -#define IDS_TEXT 42163 -#define IDS_LINK_TEXT 42164 -#define IDS_ACTIVE_LINK_TEXT 42165 -#define IDS_FOLLOWED_LINK 42166 -#define IDS_VALIDATE_IMAGE_FILE 42167 -#define IDS_COLOR_SCHEME_NS_DEFAULT 42169 -#define IDS_FILE_PRINT 42172 -#define IDS_FILE_PAGE_SETUP 42173 -#define IDS_FILE_PRINT_PREVIEW 42174 -#define ID_WEB_PAGE_STARTER 42177 -#define IDS_UNLINK_WARNING 42178 -#define IDS_CLEAR_CHAR_STYLES_CAPTION 42179 -#define ID_UNUM_LIST 42180 -#define ID_NUM_LIST 42181 -#define ID_INSERT_NONBREAK_SPACE 42182 -#define IDS_EDIT_TOOLBAR_CAPTION 42183 -#define IDS_CHAR_TOOLBAR_CAPTION 42185 -#define IDS_FORMS_TOOLBAR_CAPTION 42186 -#define IDS_EDIT_DOC_SOURCE 42187 -#define ID_FORMAT_CHAR_NO_TEXT_STYLES 42188 -#define ID_EDIT_HELP 42189 -#define IDS_TEXT_PROPS_CAPTION 42190 -#define IDS_IMAGE_PROPS_CAPTION 42191 -#define IDS_LINK_PROPS_CAPTION 42192 -#define IDS_REMOVE_LINKS_CAPTION 42192 -#define IDS_JAVA_PROPS_CAPTION 42193 -#define IDS_ERROR_READ_ONLY 42206 -#define IDS_FILE_ERROR_CAPTION 42207 -#define IDS_ERROR_BLOCKED 42208 -#define IDS_ERROR_BAD_URL 42209 -#define IDS_ERROR_FILE_OPEN 42210 -#define IDS_ERROR_FILE_WRITE 42211 -#define IDS_ERROR_CREATE_BAKNAME 42212 -#define IDS_ERROR_DELETE_BAKFILE 42213 -#define IDS_ERROR_WRITING_FILE 42214 -#define ID_FILE_PUBLISH 42216 -#define ID_FILE_EDITSOURCE 42217 -#define IDS_PROPS_IMAGE 42218 -#define IDS_PROPS_HRULE 42219 -#define IDS_PROPS_PARAGRAPH 42220 -#define IDS_PROPS_CHARACTER 42221 -#define IDS_PROPS_DOCUMENT 42222 -#define IDS_PROPS_IMAGE_LINK 42222 -#define IDS_PROPS_TAG 42223 -#define IDS_SELECT_IMAGE 42224 -#define IDS_PROPS_CAPTION 42226 -#define IDS_PERCENT_WINDOW 42227 -#define IDS_UNUM_LIST 42228 -#define IDS_NUM_LIST 42229 -#define IDS_BLOCK_QUOTE 42230 -#define IDS_DIRECTORY_LIST 42231 -#define IDS_MENU_LIST 42232 -#define IDS_DESCRIPTION_LIST 42233 -#define IDS_DEFAULT 42234 -#define IDS_LIST 42235 -#define IDS_DIGIT 42236 -#define IDS_BIG_ROMAN 42237 -#define IDS_SMALL_LETTERS 42238 -#define IDS_BIG_LETTERS 42239 -#define IDS_SOLID_CIRCLE 42240 -#define IDS_OPEN_CIRCLE 42241 -#define IDS_SOLID_SQUARE 42242 -#define IDS_NUMBER_STYLE 42243 -#define IDS_BULLET_STYLE 42244 -#define IDS_AUTOMATIC 42245 -#define IDS_PROPS_TARGET 42246 -#define IDS_EDIT_IMAGE 42247 -#define IDS_EDIT_TEMPLATE_PROMPT 42249 -#define IDS_SELECT_TEMPLATE_CAPTION 42250 -#define IDS_DEF_PUB_LOC_PROMPT 42251 -#define IDS_BROWSETO_PROMPT 42251 -#define IDS_SELECT_IMAGE_EDITOR 42255 -#define IDS_SELECT_HTML_EDITOR 42256 -#define IDS_OTHER_HREF_ATTRIBUTES 42257 -#define IDS_EDIT_HTML_ATTRIB_CAPTION 42258 -#define IDS_BAD_PUBLISH_URL 42261 -#define IDS_TARGETS_IN_CURRENT_DOC 42263 -#define IDS_TARGETS_IN_FILE 42264 -#define IDS_NO_TARGETS 42265 -#define IDS_REMOVE_OTHER_LINKS 42266 -#define IDS_REMOVE_LINK 42267 -#define IDS_REMOVE_LINKS 42268 -#define IDS_REMOVE_ALL_LINKS 42269 -#define ID_REMOVE_LINKS 42270 -#define IDS_UNABLE_TO_LAUNCH_EDITOR 42273 -#define IDS_IMAGE_IS_REMOTE 42274 -#define IDS_EDIT_IMAGE_CAPTION 42275 -#define IDS_SELECTION_MIXED_COLORS 42276 -#define IDS_DONT_CHANGE_COLORS 42277 -#define ID_EDT_NEW_DOC_BLANK 42279 -#define ID_EDT_NEW_DOC_TEMPLATE 42280 -#define ID_EDT_NEW_DOC_WIZARD 42281 -#define IDS_FILE_IS_MODIFIED 42282 -#define IDS_FILE_MODIFIED_CAPTION 42283 -#define IDS_PUBLISHING_DOCUMENT 42287 -#define IDS_COPYRIGHT_WARNING_HINT 42290 -#define ID_EDIT_DISPLAY_PARAGRAPH_MARKS 42291 -#define IDS_PIXELS 42292 -#define ID_POPUP_PROPS_LINK 42295 -#define IDS_BROWSE_AFTER_PUBLISH 42295 -#define IDS_ERROR_HTML_CAPTION 42296 -#define IDS_TAG_UNOPENED 42297 -#define IDS_TAG_UNCLOSED 42298 -#define IDS_TAG_PREMATURE_CLOSE 42299 -#define IDS_TAG_TAGNAME_EXPECTED 42300 -#define IDS_TAG_UNTERMINATED_STRING 42301 -#define IDS_TAG_ERROR 42302 -#define IDS_DOCUMENT_BUSY 42303 -#define IDS_SELECTION_CROSSES_TABLE_DATA_CELL 42304 -#define IDS_COPY_ERROR_CAPTION 42305 -#define IDS_SELECTION_EMPTY 42306 -#define IDS_WHITE_ON_BLACK 42307 -#define IDS_WHITE_ON_BLUE 42308 -#define IDS_BLUE_ON_ORANGE 42309 -#define IDS_BLACK_ON_YELLOW 42310 -#define IDS_BLACK_ON_LTYELLOW 42311 -#define IDS_BLACK_ON_OFFWHITE 42312 -#define IDS_BLACK_ON_LTBLUE 42313 -#define IDS_BLACK_ON_MEDBLUE 42314 -#define IDS_WHITE_ON_GREEN 42315 -#define IDS_WHITE_ON_VIOLET 42316 -#define IDS_BLACK_ON_WHITE 42317 -#define IDS_INTEGER_RANGE_ERROR 42318 -#define ID_POPUP_SETASWALLPAPER 42319 -#define IDS_SINGLE_CELL_CAPTION 42320 -#define IDS_SELECTED_CELLS_CAPTION 42321 -#define IDS_SELECTED_ROW_CAPTION 42322 -#define IDS_SELECTED_COLUMN_CAPTION 42323 -#define IDS_CHANGE_SEL_CAPTION 42324 -#define ID_PROPS_TABLE 42330 -#define ID_PROPS_TABLE_ROW 42331 -#define ID_PROPS_TABLE_COLUMN 42332 -#define ID_PROPS_TABLE_CELL 42333 -#define IDC_WIDTH_PERCENT 42334 -#define IDC_HEIGHT_PIXELS 42335 -#define IDC_HEIGHT_PERCENT 42336 -#define IDC_TABLE_CELL_ALIGN 42339 -#define IDS_PERCENT_PARENT_CELL 42339 -#define IDC_TABLE_CELL_VALIGN 42340 -#define ID_POPUP_DELETE_TABLE 42340 -#define ID_POPUP_INSERT_TABLE 42341 -#define IDS_POPUP_DELETE_TABLE 42342 -#define IDS_POPUP_INSERT_TABLE 42343 -#define IDS_DELETE_ROW 42344 -#define IDS_PROPS_TABLE_CAPTION 42345 -#define IDS_POPUP_TABLE_PROPS 42346 -#define IDS_POPUP_TABLE_CELL_PROPS 42347 -#define IDS_SUBMENU_SELECT_TABLE 42348 -#define IDS_SUBMENU_INSERT_TABLE 42349 -#define IDS_SUBMENU_DELETE_TABLE 42350 -#define IDS_CHANGE_SELECTED_CELL 42351 -#define IDS_CHANGE_SELECTED_ROW 42352 -#define IDS_CHANGE_SELECTED_COL 42353 -#define IDS_ROW 42355 -#define IDS_COLUMN 42356 -#define IDS_CELL 42357 -#define IDS_TABLE 42358 -#define IDS_PERCENT_TABLE 42359 -#define IDS_APPLY_CELL_MSG 42360 -#define IDS_SMALL_ROMAN 42363 -#define ID_FORMAT_CHAR_UNDERLINE 42364 -#define ID_NAVIGATE_CONTINUE 42365 -#define ID_DISPLAY_TABLES 42366 -#define IDS_PARAGRAPH_STYLE 42367 -#define IDS_CHECK_DISK_SPACE 42368 -#define IDS_AUTOSAVE_CAPTION 42369 -#define IDS_AUTOSAVE_OFF_MSG 42370 -#define ID_TOOLS_INBOX 42371 -#define ID_VIEW_PROPERTIES 42372 -#define ID_MESSAGE_RETRIEVEOFFLINE 42376 -#define ID_EDIT 42377 -#define ID_LIVE_CALL 42378 -#define ID_FILE_NEW_MAIL_MESSAGE 42379 -#define ID_FILE_OPEN_DRAF 42380 -#define ID_FILE_SAVE_DRAFT 42381 -#define ID_EDIT_FIND_IN_MESSAGE 42382 -#define ID_EDIT_FIND_AGAIN 42383 -#define ID_VIEW_ADDRESSES 42384 -#define ID_VIEW_ATTACHMENTS 42385 -#define ID_VIEW_MESSAGE_BODY_ONLY 42386 -#define ID_NAVIGATE_PLUGINS 42387 -#define ID_MESSAGE_SEND_NOW 42388 -#define ID_PRIORITY_HIGHEST 42390 -#define ID_PRIORITY_HIGH 42391 -#define ID_PRIORITY_NORMAL 42392 -#define ID_PRIORITY_LOW 42393 -#define ID_PRIORITY_LOWEST 42394 -#define ID_MESSAGE_ATTACH_FILE 42395 -#define ID_MESSAGE_ATTACH_WEB_PAGE 42396 -#define ID_MESSAGE_CONVERT2HTML 42397 -#define ID_EDIT_MAIL_WIZARD 42399 -#define IDS_DONT_CHANGE 42400 -#define IDS_FONTSIZE_NEG_2 42401 -#define IDS_FONTSIZE_NEG_1 42402 -#define IDS_FONTSIZE_0 42403 -#define IDS_FONTSIZE_1 42404 -#define IDS_FONTSIZE_2 42405 -#define IDS_FONTSIZE_3 42406 -#define IDS_FONTSIZE_4 42407 -#define ID_EDIT_BACKGROUND_IMAGE 42408 -#define ID_EDIT_PAGE_TITLE 42409 -#define ID_BLOCK_QUOTE 42410 -#define ID_NAVIGATE_MSG_BACK 42411 -#define ID_NAVIGATE_MSG_FORWARD 42412 -#define ID_MESSAGE_UNFLAGMESSAGE 42413 -#define ID_MESSAGE_PREVIOUSFLAGGED 42414 -#define ID_MESSAGE_NEXTFLAGGED 42415 -#define ID_MESSAGE_FIRSTFLAGGED 42416 -#define ID_MESSAGE_NEXTNEWSGROUP 42417 -#define ID_MESSAGE_NEXTUNREADNEWSGROUP 42418 -#define ID_VIEW_TASKBAR 42420 -#define ID_FILE_EDITMESSAGE 42422 -#define ID_VIEW_MESSAGE 42423 -#define IDM_CLOSE 42424 -#define IDM_SAVE 42425 -#define IDM_SAVEAS 42426 -#define IDM_SAVEASDRAFT 42427 -#define IDM_PRINTSETUP 42428 -#define IDM_PRINTPREVIEW 42429 -#define IDM_PRINT 42430 -#define IDM_EXIT 42431 -#define IDM_FINDINMESSAGE 42432 -#define IDM_FINDAGAIN 42433 -#define IDM_SEARCHADDRESSES 42434 -#define IDM_PREFERENCES 42435 -#define idm_redo 42436 -#define IDM_UNDO 42437 -#define IDM_CUT 42438 -#define IDM_COPY 42439 -#define IDM_PASTE 42440 -#define IDM_PASTEASQUOTE 42441 -#define IDM_SELECTALL 42442 -#define IDM_HIDETOOLBAR 42443 -#define IDM_HIDETASKBAR 42444 -#define IDM_ADDRESSES 42445 -#define IDM_ATTACHMENTS 42446 -#define IDM_MESSAGEBODYONLY 42447 -#define IDM_SENDNOW 42448 -#define IDM_SENDLATER 42449 -#define IDM_PRIORITY_HIGHEST 42450 -#define IDM_PRIORITYHIGH 42451 -#define IDM_PRIORITYNORMAL 42452 -#define IDM_PRIORITYLOW 42453 -#define IDM_PRIORITYLOWEST 42454 -#define IDM_ATTACHFILE 42455 -#define IDM_ATTACHWEBPAGE 42456 -#define IDM_ATTACHVCARD 42457 -#define IDM_QUOTEORIGINAL 42458 -#define IDM_BROWSER 42459 -#define IDM_INBOX 42460 -#define IDM_NEWSGROUPS 42461 -#define IDM_FOLDERS 42462 -#define IDM_EDITOR 42463 -#define IDM_CALENDAR 42464 -#define IDM_CALLPOINT 42465 -#define IDM_ADDRESSBOOK 42466 -#define IDM_HISTORY 42468 -#define IDM_JAVACONSOLE 42469 -#define IDM_HELP 42470 -#define IDM_DELETELAYER 42471 -#define IDM_REMOVELINK 42472 -#define IDM_SELECTTABLE 42473 -#define IDM_PARAGRAPHMARKS 42474 -#define IDM_TABLEBORDERS 42475 -#define IDM_CONVERTTOPLAINTEXT 42476 -#define IDM_SEND 42477 -#define IDM_SELECTEDOBJECT 42487 -#define IDM_CHARACTER 42488 -#define IDM_PARAGRAPH 42489 -#define IDM_FORMATLINK 42490 -#define IDM_FORMATLIST 42491 -#define IDM_FORMATTABLE 42492 -#define IDM_BACKGROUND 42493 -#define IDM_LINKCOLORS 42494 -#define IDM_PAGETITLE 42495 -#define IDM_STYLESHEET 42496 -#define IDM_MESSAGEPROPERTIES 42497 -#define ID_CREATE_CARD 42499 -#define ID_ITEM_SETTOTOOLBAR 42500 -#define ID_TOOLS_CHECK_SPELLING 42501 -#define IDM_ATTACHPERSONALCARD 42502 -#define ID_WINDOW_CALENDAR 42503 -#define ID_VIEW_CATEGORIES 42505 -#define ID_MESSAGE_IGNORECATEGORY 42506 -#define ID_MESSAGE_ADDCARD 42507 -#define ID_FILE_SELECTCATEGORY 42508 -#define ID_BIG_SWITCH 42509 -#define ID_EDIT_SERVER 42510 -#define ID_STOP_ANIMATION 42511 -#define ID_FILE_NEWCATEGORY 42512 -#define ID_NEW_DOC_BLANK 42513 -#define ID_DELETE_LAYER 42514 -#define ID_EDIT_REALLYDELETEMESSAGE 42515 -#define IDM_OFFLINE 42516 -#define IDM_DELETE 42517 -#define IDM_OPTIONS 42518 -#define IDM_CONVERT 42519 -#define IDM_EDITPLUGINS 42521 -#define ID_FILE_GETNEXT 42522 -#define ID_FILE_SYNCHRONIZE 42523 -#define ID_SORT_DESCENDING 42524 -#define ID_SORT_BYFLAG 42525 -#define ID_OPTIONS_PREFERENCES 42526 -#define ID_REMOVE_LIST 42527 -#define ID_SORT_BYSTATUS 42528 -#define ID_FILE_NEWNEWSHOST 42529 -#define ID_SORT_BYSIZE 42530 -#define ID_MESSAGE_RETRIEVESELECTED 42532 -#define ID_NEWS_MODERATE 42533 -#define IDM_ATTACHMYCARD 42534 -#define ID_SORT_BYUNREAD 42535 -#define ID_BOOKMARKS_FILE_ADDTOTOOLBAR 42536 -#define ID_BOOKMARKS_FILE_INTERNETSHORTCUT 42537 -#define ID_BOOKMARKS_FILE_GOOFFLINE 42538 -#define ID_EDIT_MANAGEMAILACCOUNT 42539 -#define ID_POPUP_SAVEAS 42540 -#define ID_INCREASE_FONT 42541 -#define ID_DECREASE_FONT 42542 -#define ID_EDIT_DOMAINS 42543 -#define ID_POPUP_EDIT_LINK 42544 -#define ID_FILE_UPDATECOUNTS 42545 -#define ID_VIEW_ABTOOLBAR 42545 -#define ID_POPUP_SETTOTOOLBAR 42546 -#define ID_DONEGETTINGMAIL 42547 -#define ID_DONEGOINGOFFLINE 42548 -#define IDS_CONVERT_TEXT_TO_TABLE 42700 -#define IDS_CONVERT_TABLE_TO_TEXT 42701 -#define IDS_ALIGN 42702 -#define IDS_ALIGN_TABLE 42703 -#define IDS_ALIGN_LEFT 42704 -#define IDS_ALIGN_RIGHT 42705 -#define IDS_ALIGN_CENTER 42706 -#define ID_ALIGN_LEFT 42710 -#define ID_ALIGN_RIGHT 42711 -#define ID_ALIGN_CENTER 42712 -#define ID_ALIGN_TABLE_LEFT 42713 -#define ID_ALIGN_TABLE_CENTER 42714 -#define ID_ALIGN_TABLE_RIGHT 42715 -#define ID_INSERT_TABLE_OR_PROPS 42719 -#define ID_INSERT_TABLE 42720 -#define ID_INSERT_TABLE_CAPTION 42721 -#define ID_INSERT_TABLE_ROW 42722 -#define ID_INSERT_TABLE_COLUMN 42723 -#define ID_INSERT_TABLE_CELL 42724 -#define ID_INSERT_TABLE_ROW_ABOVE 42725 -#define ID_INSERT_TABLE_COLUMN_BEFORE 42726 -#define ID_INSERT_TABLE_CELL_BEFORE 42727 -#define ID_INSERT_TABLE_MORE 42728 -#define ID_DELETE_TABLE 42729 -#define ID_DELETE_TABLE_CAPTION 42730 -#define ID_DELETE_TABLE_ROW 42731 -#define ID_DELETE_TABLE_COLUMN 42732 -#define ID_DELETE_TABLE_CELL 42733 -#define ID_DELETE_TABLE_MORE 42734 -#define ID_TOGGLE_TABLE_BORDER 42735 -#define ID_TOGGLE_HEADER_CELL 42736 -#define ID_TABLE_TEXT_CONVERT 42737 -#define ID_SELECT_TABLE 42740 -#define ID_SELECT_TABLE_ROW 42741 -#define ID_SELECT_TABLE_COLUMN 42742 -#define ID_SELECT_TABLE_CELL 42743 -#define ID_SELECT_TABLE_ALL_CELLS 42744 -#define IDS_CURRENT_COLOR 42750 -#define IDS_CURRENT_BKGRND_COLOR 42751 -#define IDS_DEFAULT_BKGRND_COLOR 42752 -#define IDS_CUSTOM_COLORS_LABEL 42753 -#define IDS_LAST_USED_COLOR 42754 -#define IDS_OTHER 42755 -#define IDS_OTHER_BUTTON 42756 -#define IDS_DEFAULT_BUTTON 42757 -#define ID_HISTORY_LOPCONTAINS 43000 -#define ID_HISTORY_LOPNOTCONTAINS 43001 -#define ID_HISTORY_LOPIS 43002 -#define ID_HISTORY_LOPNOTIS 43003 -#define ID_HISTORY_LOPISBEFORE 43004 -#define ID_HISTORY_LOPISAFTER 43005 -#define ID_HISTORY_LOPISLESSTHAN 43006 -#define ID_HISTORY_LOPISGREATERTHAN 43007 -#define ID_HISTORY_LOPAND 43008 -#define ID_HISTORY_LOPOR 43009 -#define ID_HISTORY_WINTITLE 43010 -#define ID_HISTORY_MENUUNDO 43011 -#define ID_HISTORY_MENUREDO 43012 -#define ID_HISTORY_URCUT 43013 -#define ID_HISTORY_URCOPY 43014 -#define ID_HISTORY_URDELETE 43015 -#define ID_HISTORY_MENUAND 43016 -#define ID_HISTORY_MENUOR 43017 -#define ID_HISTORY_SEARCH_WINTITLE 43018 -#define ID_INCREASE_INDENT 43019 -#define ID_HIST_FILE_ADDTOTOOLBAR 43020 -#define ID_HIST_FILE_INTERNETSHORTCUT 43021 -#define ID_OTHER_FONTFACE 43022 -#define IDS_TRANSFER_STATUS 59142 -#define IDS_SECURITY_STATUS 59143 -#define IDS_SIGNED_STATUS 59144 -#define ID_FORMAT_INCREASE_FONTSIZE 59395 -#define ID_FORMAT_DECREASE_FONTSIZE 59396 -#define ID_ALIGN_POPUP 59397 -#define ID_INSERT_POPUP 59398 -#define IDS_SHOW_EDITBAR 59400 -#define IDS_HIDE_EDITBAR 59401 -#define IDS_SHOW_FORMATBAR 59402 -#define IDS_HIDE_FORMATBAR 59403 -#define IDS_TOOLS_MENU 59404 -#define IDM_ADDRESSPICKER 59405 -#define IDS_PROPS_SELECTION 59406 -#define IDS_ALT_ENTER 59407 -#define IDS_EXTRA_HTML_MSG 59408 -#define IDS_IMG_TAG 59409 -#define IDS_HREF_TAG 59410 -#define IDS_HRULE_TAG 59411 -#define IDS_TABLE_TAG 59412 -#define IDS_TR_TAG 59413 -#define IDS_TD_TAG 59414 -#define IDS_CUSTOM_COLOR 59415 -#define IDS_MIXED_COLORS 59416 -#define IDS_MIXED_FONTS 59417 -#define IDS_MIXED_DONT_CHANGE 59418 -#define IDS_MIXED_STYLE 59419 -#define IDS_INVALID_WORD 59423 -#define IDS_ERR_ADD_WORD 59424 -#define IDS_CONFIRM_STOP_PLUGIN 59425 -#define IDS_ERR_LAUNCH_EDITOR_PLUGIN 59426 -#define IDS_CONVERR5 59428 -#define IDS_CONVERR6 59429 -#define IDS_CONVERR7 59430 -#define IDS_CONVERR8 59431 -#define IDS_CONVERR9 59432 -#define IDS_CONVERR10 59433 -#define IDS_CONVERR11 59434 -#define IDS_CONVERR12 59435 -#define IDS_CONVERR13 59436 -#define IDS_CONVERR14 59437 -#define IDS_CONVERR0 59438 -#define IDS_CONVERR1 59439 -#define IDS_CONVERR2 59440 -#define IDS_CONVERR3 59441 -#define IDS_CONVERR4 59442 -#define IDS_CMD_MAIL_STUB 59599 -#define IDS_CMDLINE_ERROR6 59600 -#define IDS_CMDLINE_ERROR1 59601 -#define IDS_CMDLINE_ERROR3 59603 -#define IDS_CMDLINE_ERROR4 59604 -#define IDS_HIDDEN_FRAME_STRING 59605 -#define IDS_CMDLINE_ERROR7 59606 -#define IDS_CMDLINE_ERROR8 59607 -#define IDS_COPYRIGHT_0 60010 -#define IDS_COPYRIGHT_1 60011 -#define IDS_COPYRIGHT_2 60012 -#define IDS_COPYRIGHT_3 60013 -#define IDS_COPYRIGHT_4 60014 -#define IDS_COPYRIGHT_5 60015 -#define IDS_COPYRIGHT_6 60016 -#define IDS_COPYRIGHT_7 60017 -#define IDS_COPYRIGHT_8 60018 -#define IDS_COPYRIGHT_9 60019 -#define IDS_COPYRIGHT_A 60020 -#define IDS_COPYRIGHT_B 60021 -#define IDS_COPYRIGHT_C 60022 -#define IDS_COPYRIGHT_D 60023 -#define IDS_AUTHORS_0 60030 -#define IDS_MAIL_0 60090 -#define IDS_MAIL_1 60091 -#define IDS_MAIL_2 60092 -#define IDS_MAIL_3 60093 -#define IDS_MAIL_4 60094 -#define IDS_MAIL_5 60095 -#define IDS_MAIL_6 60096 -#define IDS_MAIL_7 60097 -#define IDS_MAIL_8 60098 -#define IDS_MAIL_9 60099 -#define IDS_MAIL_A 60100 -#define IDS_MAIL_B 60101 -#define IDS_MAIL_C 60102 -#define IDS_MAIL_D 60103 -#define IDS_MAIL_E 60104 -#define IDS_MAIL_F 60105 -#define IDS_MAIL_G 60106 -#define IDS_MAIL_H 60107 -#define IDS_LICENSE_CLICKER 60109 -#define IDS_NONSEC_POST_FR_SEC_0 60110 -#define IDS_NONSEC_INLINES_0 60120 -#define IDS_NONSEC_INLINES_1 60121 -#define IDS_NONSEC_REDIRECT_0 60130 -#define IDS_NONSEC_UNKNOWN 60132 -#define IDS_DOCINFO_SECURE_0 60140 -#define IDS_DOCINFO_SECURE_1 60141 -#define IDS_DOCINFO_SECURE_2 60142 -#define IDS_DOCINFO_NONSECURE_0 60150 -#define IDS_DOCINFO_NONSECURE_1 60151 -#define IDS_DOCINFO_NONSECURE_2 60152 -#define IDS_ENTER_SECURE_0 60160 -#define IDS_ENTER_SECURE_1 60161 -#define IDS_LEAVE_SECURE_0 60170 -#define IDS_LEAVE_SECURE_1 60171 -#define IDS_NONSEC_POST_FR_NONSEC_0 60180 -#define IDS_MOZILLA_0 60190 -#define IDS_MOZILLA_1 60191 -#define IDS_MOZILLA_2 60192 -#define IDS_MOZILLA_3 60193 -#define IDS_MOZILLA_4 60194 -#define IDS_ABOUT_0 60200 -#define IDS_ABOUT_1 60201 -#define IDS_ABOUT_2 60202 -#define IDS_ABOUT_3 60203 -#define IDS_ABOUT_4 60204 -#define IDS_ABOUT_5 60205 -#define IDS_ABOUT_6 60206 -#define IDS_ABOUT_7 60207 -#define IDS_ABOUT_8 60208 -#define IDS_ABOUT_9 60209 -#define IDS_ABOUT_A 60210 -#define IDS_ABOUT_B 60211 -#define IDS_ABOUT_C 60212 -#define IDS_ABOUT_D 60213 -#define IDS_ABOUT_E 60214 -#define IDS_ABOUT_F 60215 -#define IDS_ABOUT_10 60216 -#define IDS_ABOUT_11 60217 -#define IDS_ABOUT_12 60218 -#define IDS_ABOUT_13 60219 -#define IDS_ABOUT_14 60220 -#define IDS_ABOUT_15 60221 -#define IDS_ABOUT_16 60222 -#define IDS_ABOUT_17 60223 -#define IDS_ABOUT_18 60224 -#define IDS_ABOUT_19 60225 -#define IDS_ABOUT_1A 60226 -#define IDS_ABOUT_1B 60227 -#define IDS_ABOUT_1C 60228 -#define IDS_ABOUT_1D 60229 -#define IDS_ABOUT_1E 60230 -#define IDS_ABOUT_1F 60231 -#define IDS_ABOUT_20 60232 -#define IDS_ABOUT_21 60233 -#define IDS_ABOUT_22 60234 -#define IDS_ABOUT_23 60235 -#define IDS_ABOUT_24 60236 -#define IDS_ABOUT_25 60237 -#define IDS_ABOUT_CUSTOM_0 60300 -#define IDS_ABOUT_CUSTOM_1 60301 -#define IDS_ABOUT_CUSTOM_2 60302 -#define IDS_ABOUT_CUSTOM_3 60303 -#define IDS_ABOUT_CUSTOM_4 60304 -#define IDS_MAIL_INVALID_EMAIL 61204 -#define IDS_MAIL_NORETURN 61205 -#define IDS_MAIL_INVALID_BUILD 61206 -#define IDS_MAIL_TOO_LONG 61207 -#define IDS_FIND_NOT_FOUND 61208 -#define IDS_AUTH_DEFAULT 61209 -#define IDS_NOLDAPSERVERS 61210 -#define IDS_DIRECT_WELCOME 61211 -#define IDS_DIRECT_WHATNEW 61212 -#define IDS_DIRECT_FAQ 61213 -#define IDS_DIRECT_TOUR 61214 -#define IDS_DIRECT_SUPPORT 61215 -#define IDS_DIRECT_FEEDBACK 61216 -#define IDS_DIRECT_MANUAL 61217 -#define IDS_DIRECT_VERSION 61218 -#define IDS_DIRECT_HOME 61219 -#define IDS_DIRECT_INTERNET_ABOUT 61220 -#define IDS_DIRECT_INTERNET_INDEX 61221 -#define IDS_DIRECT_INTERNET_SEARCH 61222 -#define IDS_DIRECT_INTERNET_WHITEPG 61223 -#define IDS_DIRECT_WEB_SERVICES 61224 -#define IDS_OPEN_CLIPBOARD 61226 -#define IDS_EMPTY_CLIPBOARD 61227 -#define IDS_EVIL 61228 -#define IDS_NET_INIT_FAILED 61229 -#define IDS_DIRECT_NETSCAPE_WHATSCOOL 61230 -#define IDS_DIRECT_LICENSE 61233 -#define IDS_LOCAL_HELP 61234 -#define IDP_OLE_INIT_FAILED 61234 -#define IDS_ABOUT_PAGE 61235 -#define IDS_HELP_SECURITY 61236 -#define IDS_DIRECT_MARKETPLACE 61237 -#define IDS_DDE_PROCESS_CMDLINE 61239 -#define IDS_DDE_SERVICE_NAME 61240 -#define IDS_DDE_OPENURL 61241 -#define IDS_DDE_SHOWFILE 61242 -#define IDS_DDE_ACTIVATE 61243 -#define IDS_DDE_LISTWINDOWS 61244 -#define IDS_DDE_GETWINDOWINFO 61245 -#define IDS_DDE_PARSEANCHOR 61246 -#define IDS_DDE_EXIT 61247 -#define IDS_DDE_REGISTERPROTOCOL 61248 -#define IDS_DDE_UNREGISTERPROTOCOL 61249 -#define IDS_DDE_REGISTERVIEWER 61250 -#define IDS_DDE_QUERYVIEWER 61251 -#define IDS_DDE_VIEWDOCCACHE 61252 -#define IDS_DDE_CMDLINE_SERVICE_NAME 61252 -#define IDS_DDE_VIEWDOCDATA 61253 -#define IDS_DDE_VIEWDOCFILE 61254 -#define IDS_DDE_UNREGISTERVIEWER 61255 -#define IDS_DDE_REGISTERURLECHO 61256 -#define IDS_DDE_URLECHO 61257 -#define IDS_DDE_UNREGISTERURLECHO 61258 -#define IDS_DDE_REGISTERWINDOWCLOSE 61259 -#define IDS_DDE_REGISTERWINDOWCHANGE 61259 -#define IDS_DDE_WINDOWCLOSE 61260 -#define IDS_DDE_WINDOWCHANGE 61260 -#define IDS_DDE_UNREGISTERWINDOWCLOSE 61261 -#define IDS_DDE_UNREGISTERWINDOWCHANGE 61261 -#define IDS_DDE_BEGINPROGRESS 61262 -#define IDS_DDE_SETPROGRESSRANGE 61263 -#define IDS_DDE_MAKINGPROGRESS 61264 -#define IDS_DDE_ENDPROGRESS 61265 -#define IDS_DDE_ALERT 61266 -#define IDS_DDE_VERSION 61270 -#define IDS_DDE_CANCELPROGRESS 61271 -#define IDS_DDE_QUERYURLFILE 61272 -#define IDS_DDE_LISTFRAMECHILDREN 61273 -#define IDS_DDE_GETFRAMEPARENT 61274 -#define IDS_HELP_REGISTRATION 61299 -#define IDS_WINEXEC_XX 61300 -#define IDS_WINEXEC_0_8 61301 -#define IDS_WINEXEC_2_3 61302 -#define IDS_WINEXEC_10_THRU_15 61303 -#define IDS_WINEXEC_16 61304 -#define IDS_WINEXEC_21 61305 -#define IDS_NO_NSMAPI32 61306 -#define IDS_MAPI_BACKUP_FAILED 61307 -#define IDS_NSMAPI32_COPY_FAILED 61308 -#define IDS_MAPI_BACKUP_MISSING 61309 -#define IDS_NSMAPI32_COPY_FAILED2 61310 -#define IDS_DDE_REGISTERSTATUSBARCHANGE 61311 -#define IDS_DDE_STATUSBARCHANGE 61312 -#define IDS_DDE_UNREGISTERSTATUSBARCHANGE 61313 -#define IDS_DDE_NAVIGATEBACK 61314 -#define IDS_DDE_NAVIGATEFORWARD 61315 -#define IDS_DDE_RELOAD 61316 -#define IDS_DDE_STOP 61317 -#define IDS_DDE_GETDOCWIDTH 61318 -#define IDS_DDE_GETDOCHEIGHT 61319 -#define IDS_DDE_USERAGENT 61320 -#define IDS_DDE_CACHE_CLEARCACHE 61321 -#define IDS_DDE_CACHE_FILENAME 61322 -#define IDS_DDE_CACHE_INCACHE 61323 -#define IDS_DDE_CACHE_REMOVEURL 61324 -#define IDS_DDE_CACHE_ADDURL 61325 -#define IDS_DDE_HISTORY_CLEARHISTORY 61326 -#define IDS_DDE_HISTORY_INHISTORY 61327 -#define IDS_DDE_HISTORY_ADDURL 61328 -#define IDS_DDE_HISTORY_REMOVEURL 61329 -#define IDS_DDE_HISTORY_NUMENTRIES 61330 -#define IDS_DDE_HISTORY_GETENTRY 61331 -#define IDS_DDE_GETWINDOWID 61332 -#define IDS_DDE_SUPPORTSMIMETYPE 61333 -#define IDS_DDE_EXECUTEJAVASCRIPT 61334 -#define IDS_DDE_PRINTWINDOW 61335 -#define IDS_DDE_PRINTURL 61336 -#define IDS_SELECT_APPROPRIATE_VIEWER 62000 -#define IDS_DOC_LOAD_COMPLETE 62001 -#define IDS_SPAWNING_EXTERNAL_VIEWER 62004 -#define IDS_SAVE_AS 62005 -#define IDS_FAILED_CREATE_TEMP_FILE 62006 -#define IDS_LOADING 62007 -#define IDS_NO_VIEWER_CONFIGD 62010 -#define IDS_UNABLE_FIND_APP 62011 -#define IDS_UNABLE_TO_LAUNCH_APP 62012 -#define IDS_SPAWNING_APP 62013 -#define IDS_LOGIN_AS 62014 -#define IDS_DOC_DONE 62015 -#define IDS_NOT_A_URL 62020 -#define IDS_REMOVE_CATEGORY 62021 -#define IDS_NO_ITEMS_TO_REMOVE 62022 -#define IDS_NEW_ITEM 62023 -#define IDS_NEW_HEADER 62024 -#define IDS_NO_SOURCE_LOADED 62026 -#define IDS_UNABLE_TO_LOAD_SOURCE 62027 -#define IDS_COULDNT_SELECT_PAL 62028 -#define IDS_ERR_CACHE_DIR_NOT_EXIST 62032 -#define IDS_ERR_TMP_DIR_NOT_EXIST 62033 -#define IDS_CURRENT_URL 62034 -#define IDS_NO_DOC_CURRENTLY_LOADED 62035 -#define IDS_THIS_IS_BOTTOM_LEDGE 62036 -#define IDS_CANNOT_PRINT_WHILE_LOADING 62037 -#define IDS_CANT_PREVIEW_WHILE_LOADING 62038 -#define IDS_SAVE_IN_PROGRESS 62039 -#define IDS_LAYING_OUT_DOC 62041 -#define IDS_LAYOUT_DOC_PERCENT_DONE 62042 -#define IDS_STYLES 62043 -#define IDS_MAIL_AND_NEWS 62044 -#define IDS_APPS_AND_DIRS 62046 -#define IDS_IMGS_AND_SECTY 62047 -#define IDS_PROXIES 62048 -#define IDS_HELPER_APPS 62049 -#define IDS_MARK_ALL_AS_UNVISITED 62050 -#define IDS_COMPLETE_BOTH 62051 -#define IDS_SELECT_VIEWER 62052 -#define IDS_SELECT_TELNET_APP 62053 -#define IDS_SELECT_HTML_VIEWER 62054 -#define IDS_SELECT_3270_APP 62055 -#define IDS_SELECT_NEWSRC_FILE 62056 -#define IDS_SIG_FILE 62057 -#define IDS_CONTINUE_CLEAR_CACHE 62060 -#define IDS_CONTINUE_CLEAR_MEM_CACHE 62061 -#define IDS_LOCATION 62062 -#define IDS_GOTO 62063 -#define IDS_SERVER_ERR_NUM 62064 -#define IDS_NETSITE 62065 -#define IDS_ACTIVATE_EMBED_STATUS 62069 -#define IDS_VIEWER_SEC_MESSAGE 62073 -#define IDS_VIEWER_SEC_DONTASK 62074 -#define IDS_DIRECT_CONTEST 62075 -#define IDS_PAGESETUP_INCHES 62076 -#define IDS_PAGESETUP_CENTIMETERS 62077 -#define IDS_PAGESETUP_CM 62078 -#define IDS_INTERRUPT_ONGOING 62080 -#define IDS_INVALID_INIFILE 62083 -#define IDS_DOCINFO_SECHIGH 62088 -#define IDS_DOCINFO_SECLOW 62089 -#define IDS_DOCINFO_SECDEF 62090 -#define IDS_ABOUT_SECURITY 62092 -#define IDS_RESOURCE_CHARSET 62093 -#define IDS_SOURCE_FILETYPE 62094 -#define IDS_OLE_CANTUSE_VIEWER 62095 -#define IDS_OLE_CANTUSE_HANDLER 62096 -#define IDS_OLE_CANTUSE_VIEWER2 62110 -#define IDS_LANGUAGE_USRDEF2 62120 -#define IDS_LANGUAGE_USRDEF3 62121 -#define IDS_LANGUAGE_USRDEF4 62122 -#define IDS_LANGUAGE_USRDEF5 62123 -#define IDS_LANGUAGE_USRDEF6 62124 -#define IDS_LANGUAGE_USRDEF7 62125 -#define IDS_LANGUAGE_LATIN1 62130 -#define IDS_LANGUAGE_JAPANESE 62131 -#define IDS_LANGUAGE_LATIN2 62132 -#define IDS_LANGUAGE_TAIWANESE 62133 -#define IDS_LANGUAGE_KOREAN 62134 -#define IDS_LANGUAGE_CHINESE 62135 -#define IDS_ACCEPTLANG_EN 62137 -#define IDS_ACCEPTLANG_ENUS 62138 -#define IDS_ACCEPTLANG_ENGB 62139 -#define IDS_ACCEPTLANG_FR 62140 -#define IDS_ACCEPTLANG_FRFR 62141 -#define IDS_ACCEPTLANG_FRCA 62142 -#define IDS_ACCEPTLANG_DE 62143 -#define IDS_ACCEPTLANG_JA 62144 -#define IDS_ACCEPTLANG_ZH 62145 -#define IDS_ACCEPTLANG_ZHCN 62146 -#define IDS_ACCEPTLANG_ZHTW 62147 -#define IDS_ACCEPTLANG_KO 62148 -#define IDS_ACCEPTLANG_ES 62149 -#define IDS_ACCEPTLANG_ESES 62150 -#define IDS_ACCEPTLANG_ESBR 62151 -#define IDS_ACCEPTLANG_IT 62152 -#define IDS_ACCEPTLANG_NL 62153 -#define IDS_ACCEPTLANG_SV 62154 -#define IDS_FILE_UPLOAD 62155 -#define IDS_MENU_MAIL 62156 -#define IDS_MENU_NEWS 62157 -#define IDS_MENU_BOOKMARK 62158 -#define IDS_MENU_HISTORY 62159 -#define IDS_MENU_POSTREPLY 62160 -#define IDS_MENU_POSTMAILREPLY 62161 -#define IDS_MENU_MAILREPLY 62162 -#define IDS_MENU_FORWARD 62163 -#define IDS_MENU_FORWARDQUOTED 62164 -#define IDS_MENU_TOADDRESS 62165 -#define IDS_MENU_UNSCRAMBLE 62166 -#define IDS_MENU_REPLY 62167 -#define IDS_MENU_REPLYALL 62168 -#define IDS_MENU_DELMSG 62169 -#define IDS_CLOSEWINDOWS_EXIT 62172 -#define IDS_EXIT_CONFIRMATION 62173 -#define IDS_REDIRECT_TO_SECURE 62177 -#define IDS_CONFIRM_DISK_SPACE 62178 -#define IDS_MAIL_FRAME 62179 -#define IDS_MAIL_NOFRAME 62181 -#define IDS_PRINT_NOFRAME 62183 -#define IDS_PRINT_FRAME 62184 -#define IDS_ABOUT_PLUGINS 62200 -#define IDS_LANGUAGE_USERDEFINED 62201 -#define IDS_MESSAGENOTSENT 62202 -#define IDS_MESSAGECOMPOSITION 62203 -#define IDS_COMPOSE_FROM 62204 -#define IDS_COMPOSE_REPLYTO 62205 -#define IDS_COMPOSE_MAILTO 62206 -#define IDS_COMPOSE_CC 62207 -#define IDS_COMPOSE_BLINDCC 62208 -#define IDS_COMPOSE_FILECC 62209 -#define IDS_COMPOSE_NEWSGROUPS 62210 -#define IDS_COMPOSE_FOLLOWUPTO 62211 -#define IDS_COMPOSE_SUBJECT 62212 -#define IDS_COMPOSE_ATTACHMENT 62213 -#define IDS_COMPOSE_NOSUBJECT 62214 -#define IDS_COMPOSE_DEFAULTNOSUBJECT 62215 -#define IDS_BOOKMARK_GOTO 62216 -#define IDS_POPUP_SHORTCUT 62217 -#define IDS_BOOKMARK_OPENFOLDER 62220 -#define IDS_BOOKMARK_CLOSEFOLDER 62221 -#define IDS_BOOKMARK_PROPERTIES 62222 -#define IDS_BOOKMARK_HEADER 62223 -#define IDS_BOOKMARK_SEPARATOR 62224 -#define IDS_BOOKMARK_NAME 62225 -#define IDS_BOOKMARK_CHANGED 62226 -#define IDS_BOOKMARK_UNCHANGED 62227 -#define IDS_BOOKMARK_DONE 62228 -#define IDS_BOOKMARK_BOOKMARK 62229 -#define IDS_BOOKMARK_ADDRESSPROPERTIES 62231 -#define IDS_BOOKMARK_BOOKMARKPROPERTIES 62232 -#define IDS_MAIL_COMPRESSFOLDER 62233 -#define IDS_MAIL_DELETEFOLDER 62234 -#define IDS_MAIL_UNSUBSCRIBE 62235 -#define IDS_MAIL_SUBSCRIBE 62236 -#define IDS_MAIL_GETMOREMESSAGES 62237 -#define IDS_MAIL_GETALLMESSAGES 62238 -#define IDS_MAIL_MARKNEWSGROUPREAD 62239 -#define IDS_MAIL_ADDNEWSGROUP 62240 -#define IDS_MAIL_SHOWALLNEWSGROUPS 62241 -#define IDS_MAIL_REMOVENEWSHOST 62242 -#define IDS_MAIL_REPLY 62244 -#define IDS_MAIL_REPLYALL 62245 -#define IDS_MAIL_FILETO 62245 -#define IDS_NEWSGROUPCOLON 62245 -#define IDS_MAIL_FORWARD 62246 -#define IDS_FOLDERCOLON 62246 -#define IDS_MAIL_FORWARDQUOTED 62247 -#define IDS_MAIL_SELECTTHREAD 62248 -#define IDS_NOTITLE 62248 -#define IDS_MAIL_DELETEMESSAGE 62249 -#define IDS_MAIL_BYRECIPIENT 62249 -#define IDS_MAIL_POSTREPLY 62250 -#define IDS_MAIL_POSTANDMAILREPLY 62251 -#define IDS_MAIL_NAME 62251 -#define IDS_MAIL_RE 62253 -#define IDS_MAIL_TOTAL 62255 -#define IDS_MAIL_SENDER 62256 -#define IDS_MAIL_SUBJECT 62257 -#define IDS_MAIL_DATE 62258 -#define IDS_MAIL_UNREAD 62259 -#define IDS_MAIL_RECIPIENT 62260 -#define IDS_BOOKMARK_ISALIAS 62261 -#define IDS_MAIL_PRIORITY 62262 -#define IDS_MAIL_STATUS 62263 -#define IDS_MAIL_LENGTH 62264 -#define IDS_MAIL_LOCATION 62265 -#define IDS_MESSAGESENTANYWAY 62266 -#define IDS_MAIL_CONTAINERS 62267 -#define IDS_MAIL_MYCONTAINERS 62268 -#define IDS_UNTITLED 62271 -#define IDS_FONT_FIXNAME 62272 -#define IDS_FONT_PROPNAME 62273 -#define IDS_FILTER_ALLFILES 62276 -#define IDS_SAVE_SAVING 62280 -#define IDS_SAVE_SAVINGLOCATION 62281 -#define IDS_SAVE_VIEWLOCATION 62282 -#define IDS_FRAME_NETPREF 62284 -#define IDS_FRAME_SECPREF 62285 -#define IDS_FRAME_GENPREF 62286 -#define IDS_FRAME_MAILPREF 62287 -#define IDS_FRAME_EDITORPREF 62288 -#define IDS_USER_PROMPT 62289 -#define IDS_LOAD_PREFS 62292 -#define IDS_LOAD_BOOKMARKS 62293 -#define IDS_LOAD_PLUGINS 62294 -#define IDS_DRAG_THIS_URL_TIP 62295 -#define IDS_OPEN 62296 -#define IDS_PROXIE_FOLDERS 62297 -#define IDS_BROWSE_TO_PUB_LOC_CAPTION 62298 -#define IDS_LOAD_JAVA 62298 -#define IDS_LANGUAGE_GREEK 62300 -#define IDS_LANGUAGE_TURKISH 62301 -#define IDS_SOURCE_SAMEAS_DEST 62302 -#define IDS_SAVING_LOCATION 62303 -#define IDS_VIEWING_LOCATION 62304 -#define IDS_LANGUAGE_WIN1251 62308 -#define IDS_CLOSE_BUTTON 62310 -#define IDS_LANGUAGE_UTF8 62311 -#define IDS_RES_VERSION 62312 -#define IDS_TITLE_ERROR 62313 -#define IDS_URL_INVALID 62314 -#define IDS_URL_UNREGISTERED 62315 -#define IDS_URL_SAVEFAILED 62316 -#define IDS_GETPATH_FAILED 62317 -#define IDS_CANT_WRITEFILE 62318 -#define IDS_NONAME 62319 -#define IDS_NOADDRESS 62320 -#define IDS_FILTER_HTM16 62323 -#define IDS_FILTER_HTM32 62324 -#define IDS_FILTERNT_HTM 62325 -#define IDS_FILTERNT 62326 -#define IDS_FILTER16 62327 -#define IDS_FILTER32 62328 -#define IDS_HTM_FILTER16 62329 -#define IDS_HTM_FILTER32 62330 -#define IDS_JPG_FILTER16 62331 -#define IDS_JPG_FILTER32 62332 -#define IDS_GIF_FILTER 62333 -#define IDS_XBM_FILTER 62334 -#define IDS_ALL_FILTER 62335 -#define IDS_IMAGE_FILTER16 62336 -#define IDS_IMAGE_FILTER32 62337 -#define IDS_POPUP_SETASWALLPAPER 62338 -#define IDS_POPUP_SAVEBACKGROUNDAS 62339 -#define IDS_PRINTING_PAGE 62341 -#define IDS_PAGE_N_OF_COUNT 62342 -#define IDS_SHORTCUT_TO 62343 -#define IDS_MORE_BOOKMARKS 62344 -#define IDS_UNSENT_MESSAGES 62345 -#define IDS_UPLOAD_FILES 62346 -#define IDS_NETSCAPE_MAIL_TITLE 62347 -#define IDS_CHARSET_LIST_FOR_UNICODE 62348 -#define IDS_BOOKMARK_QF_TIP 62351 -#define IDS_BREADCRUMB_QF_TIP 62352 -#define ID_CUSTOMIZE_TOOLBAR 62353 -#define IDS_NEWSGROUP_NAME 62354 -#define IDS_SUBSCRIBE 62355 -#define IDS_POSTINGS 62356 -#define IDS_SUBSCRIBE_GROUP 62357 -#define IDS_SCOPE_INSTR 62358 -#define IDS_SCOPE_ALLMAIL 62359 -#define IDS_SCOPE_SUBNEWS 62360 -#define IDS_SCOPE_ALLNEWS 62361 -#define IDS_SCOPE_SELECTED 62362 -#define IDS_MAIL_THISFOLDER 62363 -#define IDS_HIDE_TOOLBARS 62365 -#define IDS_HIDE_COMMANDTOOLBAR 62365 -#define IDS_SHOW_TOOLBARS 62366 -#define IDS_SHOW_COMMANDTOOLBAR 62366 -#define IDS_EXPANDO 62367 -#define IDS_ADDBOOKMARK 62368 -#define IDS_EDITBOOKMARK 62369 -#define IDS_PRIORITY_NONE 62370 -#define IDS_ADDBREADCRUMB 62370 -#define IDS_PRIORITY_LOWEST 62371 -#define IDS_EDITBREADCRUMB 62371 -#define IDS_PRIORITY_LOW 62372 -#define IDS_PRIORITY_NORMAL 62373 -#define IDS_PRIORITY_HIGH 62374 -#define IDS_PRIORITY_HIGHEST 62375 -#define ID_VIEW_COMMANDTOOLBAR 62376 -#define ID_VIEW_LOCATIONTOOLBAR 62377 -#define ID_VIEW_CUSTOMTOOLBAR 62378 -#define IDS_ACCEPTLANG_AF 62380 -#define IDS_ACCEPTLANG_SQ 62381 -#define IDS_ACCEPTLANG_EU 62382 -#define IDS_ACCEPTLANG_CA 62383 -#define IDS_ACCEPTLANG_DA 62384 -#define IDS_ACCEPTLANG_NLBE 62385 -#define IDS_ACCEPTLANG_FO 62386 -#define IDS_ACCEPTLANG_FI 62387 -#define IDS_ACCEPTLANG_FRBE 62388 -#define IDS_ACCEPTLANG_FRCH 62389 -#define IDS_ACCEPTLANG_DEDE 62390 -#define IDS_ACCEPTLANG_DEAU 62391 -#define IDS_ACCEPTLANG_DECH 62392 -#define IDS_ACCEPTLANG_GL 62393 -#define IDS_ACCEPTLANG_IS 62394 -#define IDS_ACCEPTLANG_IN 62395 -#define IDS_ACCEPTLANG_GA 62396 -#define IDS_ACCEPTLANG_GD 62397 -#define IDS_ACCEPTLANG_NO 62398 -#define IDS_ACCEPTLANG_HR 62399 -#define IDS_ACCEPTLANG_CS 62400 -#define IDS_ACCEPTLANG_HU 62401 -#define IDS_ACCEPTLANG_PL 62402 -#define IDS_ACCEPTLANG_RO 62403 -#define IDS_ACCEPTLANG_SK 62404 -#define IDS_ACCEPTLANG_SL 62405 -#define IDS_ACCEPTLANG_BG 62406 -#define IDS_ACCEPTLANG_BE 62407 -#define IDS_ACCEPTLANG_MK 62408 -#define IDS_ACCEPTLANG_RU 62409 -#define IDS_ACCEPTLANG_SR 62410 -#define IDS_ACCEPTLANG_UK 62411 -#define IDS_ACCEPTLANG_EL 62412 -#define IDS_ACCEPTLANG_TR 62413 -#define ID_WINDOW_TASKBAR 62414 -#define ID_BOOKMARKS_FILEROOT 62415 -#define IDS_HIDE_LOCATIONTOOLBAR 62416 -#define IDS_SHOW_LOCATIONTOOLBAR 62417 -#define IDS_MESSAGE_POSTREPLY 62418 -#define IDS_MESSAGE_POSTANDREPLY 62419 -#define IDS_MESSAGE_REPLY 62420 -#define IDS_MESSAGE_REPLYALL 62421 -#define IDS_HIDE_CUSTOMTOOLBAR 62424 -#define IDS_SHOW_CUSTOMTOOLBAR 62425 -#define IDS_HIDE 62426 -#define IDS_DOCK_TASKBAR 62427 -#define IDS_SHOW_TASKBAR 62428 -#define ID_WINDOW_LIVECALL 62429 -#define ID_FILE_SAVEFRAME_AS 62431 -#define ID_EDIT_FRAME 62432 -#define ID_HOTLIST_TOOLBAR 62433 -#define IDS_SPELL_CHECK_DONE 62433 -#define IDS_VIEWSOURCE 62434 -#define IDS_VIEWINFO 62435 -#define IDS_VIEWFRAMESOURCE 62436 -#define IDS_VIEWFRAMEINFO 62437 -#define IDS_MENU_CANCELMESSAGE 62438 -#define IDS_STATUS_CANCELMESSAGE 62439 -#define IDS_MENU_DELETEMESSAGE 62440 -#define IDS_POPUP_OPENFOLDER 62441 -#define IDS_POPUP_OPENFOLDERNEWWINDOW 62442 -#define IDS_POPUP_NEWSUBFOLDER 62443 -#define IDS_POPUP_DELETEFOLDER 62444 -#define IDS_POPUP_RENAMEFOLDER 62445 -#define IDS_POPUP_COMPRESSFOLDER 62446 -#define IDS_POPUP_NEWMESSAGE 62447 -#define IDS_POPUP_SEARCH 62448 -#define IDS_POPUP_OPENNEWSGROUP 62450 -#define IDS_POPUP_OPENNEWSGROUPNEWWINDOW 62451 -#define IDS_POPUP_REMOVENEWSGROUP 62452 -#define IDS_POPUP_INVITETONEWSGROUP 62453 -#define IDS_OPENACCEL 62453 -#define IDS_POPUP_MARKNEWSGROUPREAD 62454 -#define IDS_POPUP_UPDATEMESSAGECOUNT 62455 -#define IDS_POPUP_JOINNEWSGROUP 62456 -#define IDS_POPUP_REMOVENEWSHOST 62457 -#define IDS_POPUP_NEWFOLDER 62458 -#define IDS_POPUP_OPENMESSAGE 62459 -#define IDS_POPUP_OPENMESSAGENEWWINDOW 62460 -#define IDS_POPUP_ADDTOADDRESSBOOK 62461 -#define IDS_POPUP_IGNORETHREAD 62462 -#define IDS_POPUP_WATCHTHREAD 62463 -#define IDS_POPUP_FILE 62465 -#define IDS_POPUP_DELETEMESSAGE 62466 -#define IDS_POPUP_SAVEMESSAGE 62467 -#define IDS_POPUP_PRINTMESSAGE 62468 -#define IDS_POPUP_CANCELMESSAGE 62469 -#define IDS_POPUP_ADDSENDER 62470 -#define IDS_POPUP_ADDALL 62471 -#define IDS_NAVIGATION_TIP 62475 -#define ID_NAVIGATION_TOOLBAR 62475 -#define IDS_PERSONAL_TIP 62476 -#define ID_PERSONAL_TOOLBAR 62476 -#define IDS_LOCATION_TIP 62477 -#define ID_LOCATION_TOOLBAR 62477 -#define IDS_TOOLBARFOLDER 62478 -#define IDS_MENU_DELETENEWSGROUP 62479 -#define IDS_MENU_DELETENEWSHOST 62480 -#define IDS_MENU_DELETESELECTION 62481 -#define IDS_STATUS_DELETENEWSGROUP 62482 -#define IDS_STATUS_DELETENEWSHOST 62483 -#define IDS_STATUS_DELETESELECTION 62484 -#define IDS_CREATEDON 62485 -#define IDS_SEARCHING 62486 -#define IDS_SEARCHHITS 62487 -#define IDS_SEARCHNOHITS 62488 -#define IDS_SEARCH 62489 -#define IDS_STOP 62490 -#define IDS_SEARCHONEHIT 62491 -#define IDS_POPUP_PRIORITY 62492 -#define IDS_POPUP_LOWEST 62493 -#define IDS_POPUP_LOW 62494 -#define IDS_POPUP_NORMAL 62495 -#define IDS_POPUP_HIGH 62496 -#define IDS_POPUP_HIGHEST 62497 -#define IDS_MSGSTODOWNLOAD 62498 -#define IDS_PROGRESS 62499 -#define IDS_SET_PERSONALTOOLBAR 62500 -#define IDS_TURNOFF_PERSONALTOOLBAR 62501 -#define ID_COMPOSE_MESSAGE_TOOLBAR 62502 -#define ID_ADDRESS_BOOK_TOOLBAR 62503 -#define ID_MESSENGER_INFOBAR 62505 -#define ID_MESSENGER 62513 -#define ID_BROWSER 62514 -#define ID_MESSAGES 62515 -#define ID_FOLDERS 62516 -#define ID_ADDRESS_BOOK 62517 -#define IDS_MENU_HIDECATEGORIES 62519 -#define IDS_MENU_SHOWCATEGORIES 62520 -#define IDS_MENU_HIDEMESSAGE 62521 -#define IDS_MENU_SHOWMESSAGE 62522 -#define IDS_CALENDAR_MENU 62527 -#define IDS_HORIZONTAL 62528 -#define IDS_VERTICAL 62529 -#define IDS_CALENDAR_REGISTRY 62530 -#define IDS_INSTALL_DIRECTORY 62531 -#define ID_WINDOW_IBMHOSTONDEMAND 62532 -#define IDS_3270_REGISTRY 62533 -#define IDS_IBMHOSTONDEMAND_MENU 62534 -#define ID_VIEW_INCREASEFONT 62537 -#define ID_VIEW_DECREASEFONT 62538 -#define IDS_CURRENTVERSION 62539 -#define IDS_NSCPINI 62540 -#define IDS_CALENDAR32EXE 62541 -#define IDS_CALENDAR16EXE 62542 -#define IDS_POPUP_COPY 62543 -#define IDS_STATUS_MOVEMESSAGE 62543 -#define IDS_3270HTML 62544 -#define IDS_IBMHOSTONDEMAND 62545 -#define IDS_CALENDAR 62546 -#define IDS_3270 62547 -#define IDS_CANT3270 62548 -#define IDS_CANTCALENDAR 62549 -#define IDS_NETHELP_REGISTRY 62550 -#define IDS_NETHELP_DIRECTORY 62552 -#define IDS_COPYRIGHT 62553 -#define IDS_NETSCAPE_REGISTRY 62554 -#define IDS_YOUHAVENEWMAIL 62555 -#define IDS_FOLDERPROPS 62556 -#define IDS_STATUS_COPYMESSAGE 62556 -#define IDS_NEWSGROUPPROPS 62557 -#define IDS_STATUS_MOVEFOLDER 62557 -#define IDS_MAILHOSTPROPS 62558 -#define IDS_NEWSHOSTPROPS 62559 -#define IDS_FOLDERCOUNTS 62560 -#define IDS_FOLDERUNKNOWNCOUNTS 62561 -#define IDS_OPEN_STRING 62562 -#define IDS_CREATIONFAILED 62563 -#define IDS_WHYCREATIONFAILED 62564 -#define IDS_NOPRINTERFONT 62565 -#define IDS_NOPAGETOPRINT 62566 -#define IDS_NOPRINTJOB 62567 -#define IDS_FORMATTING 62568 -#define IDS_MAILSOUND 62569 -#define IDS_POPUP_MARKTHREADREAD 62570 -#define IDS_POPUP_MARKALLREAD 62571 -#define IDS_POPUP_CATCHUP 62572 -#define IDS_MAILSOUND16 62573 -#define IDS_CONFERENCE_REGISTRY 62574 -#define IDS_CONFERENCE 62575 -#define IDS_PATHNAME 62576 -#define IDS_SIZE 62577 -#define IDS_MENU_GETNEXT 62578 -#define IDS_ALTMAIL_MISSING_DLL 62579 -#define IDS_ALTMAIL_OLD_DLL 62580 -#define IDS_ALTMAIL_MISSING_FUNCTIONS 62581 -#define IDS_ALTMAIL_REGISTER_FAILED 62582 -#define IDS_UNKNOWN_DOCTYPE 62583 -#define IDS_SAVE_VIEWER 62584 -#define IDS_UNKNOWN_TIMELEFT 62585 -#define IDS_NO_OPEN_WRITE 62586 -#define IDS_CANT_WRITE 62587 -#define IDS_CANT_CLOSE 62588 -#define IDS_CANT_CLEANUP 62589 -#define IDS_FOLDERPROP 62590 -#define IDS_NEWSGROUPPROP 62591 -#define IDS_MAILSERVERPROP 62592 -#define IDS_NEWSHOSTPROP 62593 -#define IDS_CATEGORYPROP 62594 -#define IDS_SEARCHMESSAGES 62595 -#define IDS_SEARCHLDAP 62596 -#define IDS_MENU_ALL 62597 -#define IDS_MENU_ALLMESSAGES 62598 -#define IDS_MENU_ALLCATEGORIES 62599 -#define IDS_POPUP_FOLDERPROP 62600 -#define IDS_POPUP_MAILSERVERPROP 62601 -#define IDS_POPUP_NEWSHOSTPROP 62602 -#define IDS_POPUP_NEWSGROUPPROP 62603 -#define IDS_POPUP_SETTOTOOLBAR 62604 -#define IDS_POPUP_UNSETTOOLBAR 62605 -#define IDS_POPUP_SAVEAS 62606 -#define IDS_POPUP_LOADFRAMENEWWINDOW 62607 -#define IDS_POPUP_SENDPAGE 62608 -#define IDS_POPUP_RELOADFRAME 62609 -#define IDS_POPUP_RELOAD 62610 -#define IDS_POPUP_SHOWIMAGE 62611 -#define IDS_POPUP_STOP 62612 -#define IDS_QUICKFILE_FILEBOOKMARK 62613 -#define IDS_CANTPRINT_LOGIN 62614 -#define IDS_POPUP_CATEGORYPROP 62615 -#define IDS_SHOWHIDECOLUMNS 62616 -#define IDS_EMPTYINGTRASH 62617 -#define IDS_POPUP_ATTACHMENTPROP 62618 -#define IDS_ATTACHMENTPROP 62619 -#define IDS_TITLE_COMPOSE_PAGE 62620 -#define IDS_POPUP_LOADLINKNAVIGATOR 62621 -#define IDS_MENU_NEWFOLDER 62622 -#define IDS_MENU_NEWCATEGORY 62623 -#define IDS_POPUP_NEXTMESSAGE 62624 -#define IDS_POPUP_NEXTUNREADMSG 62625 -#define IDS_POPUP_NEXTFLAGGEDMSG 62626 -#define IDS_POPUP_NEXTUNREADTHREAD 62627 -#define IDS_POPUP_NEXTFOLDER 62630 -#define IDS_POPUP_NEXTGROUP 62631 -#define IDS_POPUP_NEXTUNREADFOLDER 62632 -#define IDS_POPUP_MARKASREAD 62634 -#define IDS_POPUP_MARKASUNREAD 62635 -#define IDS_POPUP_MARKFORLATER 62638 -#define IDS_MAIN 62639 -#define ID_EDIT_WITHFRAME_FINDINCURRENT 62640 -#define IDS_FINDINPAGE 62641 -#define IDS_FINDINFRAME 62642 -#define IDS_BROWSER_STOP_TIP 62643 -#define IDS_MENU_NEWNEWSGROUP 62644 -#define IDS_POPUP_OPENSELECTION 62647 -#define IDS_POPUP_OPENMESSAGEREUSEWINDOW 62648 -#define IDS_MENU_IGNORETHREAD 62648 -#define IDS_MENU_IGNORECATEGORY 62649 -#define IDS_MENU_NEXTFOLDER 62651 -#define IDS_MENU_NEXTNEWSGROUP 62652 -#define IDS_MENU_NEXTUNREADFOLDER 62653 -#define IDS_MENU_NEXTUNREADNEWSGROUP 62654 -#define IDS_NOATTACHMENTS 62655 -#define IDS_MENU_COMPRESSFOLDERS 62656 -#define IDS_MENU_COMPRESSFOLDER 62657 -#define IDC_FIRST_PLACES_MENU_ID 65000 -#define ID_COMMAND_PAGE_FROM_WIZARD 65197 -#define ID_COMMAND_HELPINDEX 65198 -#define IDS_COMMAND_HELPINDEX 65198 -#define ID_COMMAND_ABOUT 65199 -#define IDS_COMMAND_ABOUT 65199 -#define IDC_FIRST_HELP_MENU_ID 65200 -#define IDURL_COMMAND_ABOUT 65399 -#define IDS_BROWSETO_CAPTION 65400 -#define IDS_SELECT_BROWSETO_CAPTION 65401 -#define IDS_NEW_PAGE_TEMPLATE 65402 -#define IDS_EDITING_TEMPLATE 65403 -#define IDS_EXAMPLEHOSTNAME 65404 -#define IDS_DOWNLOADINGARTICLES 65406 -#define IDS_PUBLISH_CAPTION 65407 -#define IDS_PUBLISH_PAGE 65408 -#define IDS_ENTER_PUBLISH_FILENAME 65409 -#define IDS_TASKBAR_NEWS_HTEXT 65410 -#define IDS_TASKBAR_NEWS_VTEXT 65411 -#define IDS_TASKBAR_FLOAT_NAVTIP 65412 -#define IDS_TASKBAR_FLOAT_MAILTIP 65413 -#define IDS_TASKBAR_FLOAT_NEWSTIP 65414 -#define IDS_TASKBAR_FLOAT_COMPOSETIP 65415 -#define IDS_TASKBAR_ONTOP 65416 -#define IDS_TASKBAR_SHOWTEXT 65417 -#define IDS_TASKBAR_HIDETEXT 65418 -#define IDS_BOOKMARK_LASTVISITED 65419 -#define IDS_HELPCONTENTS 65420 -#define IDS_ABOUTNETSCAPE 65421 -#define IDS_ABOUTCOMMUNICATOR 65421 -#define ID_PRINT_PAGE 65422 -#define ID_PRINT_FRAME_NOSELECTION 65423 -#define ID_PRINT_FRAME_SELECTED 65424 -#define IDS_FILESAVEFAILED 65425 -#define IDS_POPUP_OPENATTACHMENT 65426 -#define IDS_STRING_FILE 65427 -#define IDS_SHOW_MESSAGE_TOOLBAR 65428 -#define IDS_HIDE_MESSAGE_TOOLBAR 65429 -#define IDS_SHOW_ADDRESS_AREA 65430 -#define IDS_HIDE_ADDRESS_AREA 65431 -#define IDS_CANT_LOAD_PREFS 65432 -#define IDS_HIDE_ABTOOLBAR 65433 -#define IDS_SHOW_ABTOOLBAR 65434 -#define IDS_AB_NEW_LIST 65435 -#define IDS_AB_PROPERTIES 65436 -#define IDS_AB_NEW_USER 65437 -#define IDS_STATUS_OFFLINE 65438 -#define IDS_MSGTOBIG 65439 -#define IDS_PTS 65440 -#define IDS_DEFAULT_NOCOLOR 65441 -#define IDS_CHOOSE_TEXT_COLOR 65442 -#define IDS_CHOOSE_LINK_COLOR 65443 -#define IDS_CHOOSE_ACTIVELINK_COLOR 65444 -#define IDS_CHOOSE_FOLLOWED_LINK_COLOR 65445 -#define IDS_CHOOSE_BACKGROUND_COLOR 65446 -#define IDS_DEFAULT_VARIABLE 65447 -#define IDS_DEFAULT_FIXED_WIDTH 65448 -#define IDS_XP_FONT 65449 -#define IDS_TRUE_TYPE 65450 -#define IDS_VECTOR_FONT 65450 -#define IDS_DYNAMIC_FONT 65450 -#define IDS_LOCAL_FONT 65451 -#define IDS_DEFAULT_SHORT 65452 -#define IDS_ADVANCED_FONTSIZE_MSG 65453 -#define IDS_SHOW_PARA_MARKS 65454 -#define IDS_HIDE_PARA_MARKS 65455 -#define IDS_SHOW_TABLE_BORDERS 65456 -#define IDS_HIDE_TABLE_BORDERS 65457 -#define ID_COMPOSER 65458 -#define IDS_NETCASTER_MENU 65460 -#define IDS_OPENING_FILE 65463 -#define IDS_ASK_HANDLEBYOLE 65464 -#define IDS_UNDO 65470 -#define IDS_REDO 65471 -#define IDS_COLOR_TIP_FORMAT 65472 -#define IDS_COLOR_TIP_RGB 65472 -#define IDS_COLOR_TIP_HTML 65473 -#define IDS_PKCS12_FILTER 65474 -#define IDS_UNTITLED_FOLDER 65476 -#define IDS_MULTIPLE_FONTS 65477 -#define IDS_NEW_DOC_BLANK 65490 -#define IDS_NEW_DOC_FROM_TEMPLATE 65491 -#define IDS_NEW_DOC_FROM_WIZARD 65492 -#define IDS_FILE_OPEN 65496 -#define IDS_FILE_OPENURL 65497 -#define IDS_EDIT_FINDINCURRENT 65498 -#define IDS_EDIT_FINDAGAIN 65499 -#define IDC_EMAIL_TEXT 65500 -#define IDS_EDIT_REPLACE 65500 -#define IDS_ADVSEARCH 65501 -#define IDS_BASICSEARCH 65502 -#define ID_FILE_NEW_NAVCENTER 65503 -#define IDS_SEARCH_PROMPT 65503 -#define ID_VIEW_NAV_CENTER 65504 -#define IDS_ADRSEARCH 65504 -#define IDM_SAVEASTEMPLATE 65504 -#define IDS_ADVSEARCH_TITLE 65505 -#define IDS_BASICSEARCH_TITLE 65506 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 1568 -#define _APS_NEXT_COMMAND_VALUE 42549 -#define _APS_NEXT_CONTROL_VALUE 1564 -#define _APS_NEXT_SYMED_VALUE 118 -#endif -#endif diff --git a/l10nkits/client/windows/docs/nav40/returnKit.html b/l10nkits/client/windows/docs/nav40/returnKit.html deleted file mode 100644 index bdda2ede2e0..00000000000 --- a/l10nkits/client/windows/docs/nav40/returnKit.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Returning the Kit - - - -

    -6. Returning the Finished Kit

    - -

    Once you are satisfied with the quality of your localization efforts, -you are required by the terms of the Unlimited Localization Program -license to make your localized product publicly available. The exact details of -how you do this is up to you, the most commonly acceptable method is to post -your localized product to a publicly accessible ftp site. -

    -You should post just the localized versions of the files mentioned in the Localize These -Files section of this document. For ease of transfer, you may create a compressed archive -in the .ZIP file format that contains the localized files. Create one .ZIP file for each -language/platform you do. If you are publishing more than one language or platform, you -may combine multiple .ZIP files into one master .ZIP file if this makes your life easier. -

    -If your localized product includes your own trademarks, you should identify these and any -restrictions you are placing on their use. You must also include a copy of the End User -License Agreement (EULA), as well as a notice stating that Netscape Communications -is not required to support your product, and that you are the Licensor referred to in the EULA. -Please refer to the Universal Localization Agreement for the exact legal requirements. -

    -Once your localized product is publicly available, you may inform the world in any manner you -choose, but we encourage you to also post the download location to the mozilla.org -Announcements newsgroup (netscape.public.mozilla.announce). -

    - -

    Congratulations! You are done!
    - -
    -
    - - - - - -
    -
    [BACK]
    -
    -
    [CONTENTS]
    -
    - -

    -

    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    - -
    - - - diff --git a/l10nkits/client/windows/docs/nav40/splash.html b/l10nkits/client/windows/docs/nav40/splash.html deleted file mode 100644 index dc57a775544..00000000000 --- a/l10nkits/client/windows/docs/nav40/splash.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Title Page - - - -
    -

    -NETSCAPE COMMUNICATOR

    - -
    - -
    -

    -Localization Kit

    - -
    -

    -for Microsoft® Windows (32-bit version)

    - -
    -

    -Revision 1.2

    - -
    Copyright © 1994-1998 Netscape® Communications Corporation, -All rights reserved.
    -  -
      -
    - - - - - -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    - - - diff --git a/l10nkits/client/windows/docs/nav40/testKit.html b/l10nkits/client/windows/docs/nav40/testKit.html deleted file mode 100644 index 68b8f6111b5..00000000000 --- a/l10nkits/client/windows/docs/nav40/testKit.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - Testing the Localized Resources - - - -

    -4. Ensuring Quality

    -The quality of your localized version will have a large impact on its acceptance -in the marketplace.  You can greatly enhance your chances of producing -a quality product by using experienced and skilled localizers, and by performing -post-translation testing. - -

    When performing the actual translation, you should be sensitive to a -number of issues: -

      -
    • -Completeness: you should aim for as thorough a translation as possible.  -Try not to leave portions of the product untranslated. However, be aware -that some terms may best be left in English, depending on local conventions.
    • - -
    • -Suitability: all translations should be suitable and appropriate for product, -the language, the market and the customers you intend to reach.  This -includes using the proper technical terminology for a give platform or -computer operation, as well as using language that is readily understood -by the average user of the product in a given language.  You should, -where possible, try to use terminology which is similar to other products -available on the same platform (without violating copyrights or trademarks, -of course).
    • - -
    • -Accuracy: you should be sure your translation conveys the same meaning -and intention as the original English.
    • - -
    • -Grammar and spelling: you should be sure your translation is grammatically -accurate and free from spelling errors.
    • -
    -Keep in mind that engineers do not necessarily make the best localizers! - -

    Once localization is complete, there are two basic types of post-translation -testing that should be done: -
      - - - - - - - - - - - - -
    Linguistic ReviewChecking all translations for accuracy and appropriateness in the actual -context in which they appear.
    Functional TestingEnsuring the product still functions as designed (or at least as well -as the US English product).
    - - -

    For the linguistic review, you should have an independent reviewer (i.e. -not the person who implemented the translations) check every string for -the items listed above.  In some cases, it may be enough to review -the running product itself; however, it is also valuable to print out your -translations (using ToolCool or your own translation tools) and review -them externally from the product. - -

    For the functional testing, your best resource are the directions contained -in the localization notes and this document. You should review the completed -product's localization notes with this document in hand, double checking -that you have followed all the instructions contained here and in the appropriate -.DOG file's COMMENT field. - -

    Consider the following general guidelines when testing: -

      -
    • -It is helpful to have a second copy of the product running with the English -version so you can compare them side by side (a second computer might be -helpful or required for this).
    • - -
    • -Walk through every menu in each module you have localized looking for translation -accuracy, pick letter conflicts and other problems.
    • - -
    • -Bring up as many dialogs as you can, looking for translation accuracy, -pick letter conflicts, truncated strings and functionality issues.
    • - -
    • -Use as many of the features of the product as possible: read web pages, -read and send mail and discussion group messages, set mail filters, search -mail and discussion groups, create web pages using the Composer, etc. If -functional problems are found, you should compare the same steps you took -in the localized product to the English product: if the two products fail -in the same way, it is a "core" bug, which can only be fixed by changing -the core product's executable. If the localized product fails while the -English product does not, then it is probably a translation-related bug; -these can be fixed by altering the way you localize the product (perhaps -by not translating a particular item, or by translating it differently).
    • -
    -The following section tells you how to report bugs in the localization -kit itself, or in the core product. -
      -
    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/toc.html b/l10nkits/client/windows/docs/nav40/toc.html deleted file mode 100644 index 9c8e6ca4024..00000000000 --- a/l10nkits/client/windows/docs/nav40/toc.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - Table of Contents - - - -

    -Table of Contents

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    i. Title Page
    -
    1. Project Overview  - -
    2. Getting Started  -
    3. Using the Kit  -
    4. Ensuring Quality -
    5. Troubleshooting  -
    6. Returning the Finished Kit  -
     
    7. References 
    - -
     
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/troubleshooting.html b/l10nkits/client/windows/docs/nav40/troubleshooting.html deleted file mode 100644 index 16c1d28d42f..00000000000 --- a/l10nkits/client/windows/docs/nav40/troubleshooting.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Troubleshooting - - - -

    -5. Troubleshooting

    -This section discusses tools and tips for diagnosing, correcting or avoiding -problems encountered using this localization kit. -

    -Using the idBuild

    -A special build of the US English product is provided with this kit, called -the idBuild.  This version of the product is designed to help you -locate where specific strings are coming from within the resources.  -It does this by prepending to the resource string (putting in front) a -token representing the resource ID.  The token will be in the following -form: -
      -
    • -an initial letter, either M, D or S, which stands for MENU, DIALOG or STRINGTABLE.  -(RCDATA is ignored.)
    • - -
    • -the resource's numeric id
    • - -
    • -for Menus and Dialogs, a dash followed by the Item number
    • - - -

      Example: D2298-3 = DIALOG2298Item3

    -This knowledge can help expand upon the information provided in the localization -notes by giving you the actual context in which a specific string appears.  -It can also help you locate problematic issues, such as STRINGTABLE resources -being used in menus, concatenated strings, etc. - -

    NOTE: the idBuild is provided "AS IS" with no guarantees as to functionality, -stability or fitness for any purpose.  It may crash, or some features -may not work due to the unexpected way in which the resources have been -modified.  Use it at your own risk. - -

    To use the idBuild: -
      -

      -
    • -Install the current version of Communicator (4.03 as of this writing)
    • - -
    • -Make backup copies of the 8 resource binaries listed in the -table above.  Store these copies somewhere safe.
    • - -
    • -Copy the 8 resource binaries provided in the kitRoot\products\client\windows\32bit\en\nav40\program\idBuild -directory to the installed version's Program directory -(replacing the originals).
    • - -
    • -Start the program as usual.
    • -
    -What you will see will be the modified Communicator, with resource IDs -visible next to the actual English strings.  In some cases, you might -not be able to see the entire string because of the increased string length.  -If absolutely necessary, you can modify the idBuild's binaries using MSDEV -to produce a more useful version, or you may simply inspect the strings -you can't fully see at runtime. - -

    idBuild Main Menu -
    - -

    In the image above, you can see the Communicator's main menu and the -toolbar buttons displayed with attached resource IDs. Note how most of -the menu items begin with "M", telling you they are standard menu resources.  -However, a few begin "S", indicating they come from the STRINGTABLE resources.  -These require special attention when assigning pickletters. - -

    If you see a string in the product itself (not a web page being displayed) -that does not have a resource ID attached, there are 4 possibilities as -it's origin: - -

    1. It is part of a multipart string.  For example, the toolbar -buttons are made up of strings with 3 components, each separated by newline -characters (\n ).  The first part is the status bar message; -this will have the resource ID.  The second and third components are -the ToolTip (pop-up help message) and the button label itself.  These -won't show the resource ID because it is prepended to the first part. - -

    2. The string comes from an RCDATA resource.  For example, the -Help menu contains a number of entries that come from CONFIG_PREFS.  -These are not touched by the idBuild generation process. - -

    3. The string comes from an external source.  For example, the -idBuild doesn't contain the MFC resources, so any strings coming from MFC42.dll -will be in there original form. - -

    4. The string is hard coded in the Netscape binary.  There are -still several strings that have not been resourced (for example, the Java -Console is entirely hard coded).  You will not be able to localize -these for this version. -
      -
      -

    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
     
    -1998, Copyright Netscape Communications -Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/usingKit.html b/l10nkits/client/windows/docs/nav40/usingKit.html deleted file mode 100644 index 863d38a5b47..00000000000 --- a/l10nkits/client/windows/docs/nav40/usingKit.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - Using the Kit - - - -
     
    -  - - - - -
    -
    WARNING! Protect yourself from data loss -by making regular backups of your work.
    -
    - -

    -3. Using the Kit

    -Once your copy of the Windows Front End Localization Kit is correctly installed, -you may begin your localization work by following the instructions in the -remainder of this document. The next section discusses the contents of -the localization notes provided with this kit.  It is important that -you work properly with the instructions contained in these files or the -localized product you create may not function. -

    -Understanding the Localization Notes

    -Each binary file to be localized has an associated localization notes file, -called a "DOG" file.  These files are created by the Netscape translation -tool, ToolCool. For a complete description of the process used to create -these files, please consult the Netscape Translation Tool User's Guide -that comes with those tools. It is very important that you work properly -with these localization notes, as they contain the bulk of the instructions -for this project. Most importantly, the .DOG files identify the "forbidden" -resources - those resources that you must not change. - -

    Each DOG file associated with a. dll or .exe has the same name as the -binary file, but will have the extension .DOG. -

      E.g. RESDLL.DLL has an associated RESDLL.DOG
    -The .DOG file lists certain information about each resource contained in -the associated binary file; : -
    Field Name      Purpose
    -FILENAME        Not used.
    -IDENTIFIER      Resource ID.
    -US_STR          Original English string.
    -XL_STR          Target translated string.
    -COMMENT         Localization notes for translator.
    -REASON          Explanation of leveraging results.
    -TRANSLATE       Resource is forbidden from translation if this is "FALSE"
    -Resource IDs are made up of a combination of the resource type and a unique -identifier, depending on the type of resource.  See the individual -sections dealing with each resource type for a description of how resources -are identified. You must not change the contents of this field. - -

    The original English string is what you need to translate; however, -your translation must go in the XL_STR field. It is not useful to change -the contents of the US_STR field. - -

    Your translation will be done in the XL_STR field. If there is no leveraged -translation from a prior version, this string will originally match the -US_STR value. - -

    If a resource requires some extra explanation, this can be found in -the COMMENT field. - -

    The REASON field indicates the results of the leveraging process which -created the database, which in turn was used to generate the .DOG file. -Unless you are using the Netscape translation tools, this field is not -useful to you. - -

    The TRANSLATE field dictates whether or not you can change the value -of the XL_STR field. If this field is blank, the resource is OK to translate; -if the value is "FALSE", you must not translate it. (When viewed through -ToolCool, this field appears as a check box. When checked, you may translate -this resource; when unchecked, you may not.) - -

    The next section presents the basic localization process as a checklist. -

    -
    - -

    -Localization Checklist

    -The basic localization process is this: - -

    1. Create your working directories -
    Copy the English directory (kitRoot\products\client\windows\platform\en) -to a new directory at the same level.  Be sure to use the appropriate -naming convention for your new directory.  This is the ISO 639:1988 -standard (Code for the representation of names of languages).  -A sub-set of these codes can be found in the accompanying table.  -You can go here -for a complete listing of the standard. - -

    2. Identify files to localize -
    Consult the Localize These -Files page to learn which binary files contain localizable resources. - -

    For each file to be localized, follow these steps using the tool of -your choice, being careful to follow all instructions contained in the -Localization Notes for that resource.: -

      -
    • -Localize the STRINGTABLE resources
    • - -
    • -Localize the MENU resources
    • - -
    • -Localize the DIALOG resources
    • - -
    • -Localize the Javascript preferences stored in DATA resources (RESDLL.DLL -only)
    • - -
    • -Localize the remaining DATA resources (RESDLL.DLL only)
    • -
    -3. Localize external files -
    In addition to the binary resource modules requiring localization, -there are a number of external files which may need to be localized1: -these are listed in the Localize -These Files page. Further instructions can be found there. - -

    4. Complete post-translation processing -
    After translation is complete, you need to test your work and deal -with any problems: -

      -
    • -Test the localized product.
    • - -
    • -Fix translation bugs using your localization tools or a resource editor.
    • - -
    • -Fix dialog size bugs using your localization tools or a resource editor.
    • - -
    • -Report core bugs to Netscape.
    • -
    -5. Return kits (optional) -
    Finally, you may be required to deliver files back to Netscape: -
      -
    • -Return the necessary files to Netscape (if required).
    • - -
    • -Inform us that the localized files have been returned (if required).
    • -
    - -
    -

    -Product Branding Issues

    -If you are using this kit under the auspices of the Unlimited Localization -Program, you must remove or replace Netscape trademarked strings, images -and icons in your localized version. Click here -for instructions. - -

    -


    -

    -How to Localize Different Resource Types

    -This section provides you with general information about localizing the -various resource types and files found with this kit.  (Remember, -specific localization notes for binary resources is found in the associated -.DOG file.) -

    -Localizing URLs

    - -
      Many resources of all types in the Communicator contain Internet addresses -in the form of URLs (Universal Resource Locators). Because many of these -URLs originally point to locations within the Netscape domain, how they -are localized depends on whether you are creating a branded Netscape version -or not.  The rules for how to handle URLs are found here.
    - -

    -Localizing String Tables

    - -
      STRINGTABLE resources are the most sensitive, potentially problematic -resource type you will be working with. Therefore, you must pay close attention -to the instructions provided in the localization notes. -

      -Localization Notes

      -String table resources are identified by the word STRINGTABLE, followed -by the numeric resource ID generated from the project's header files.  -For example, in the file BRPREF32.DLL, STRINGTABLE109 contains the label -and explanatory text for the Languages pane of the preference dialog.  -Localization notes for string table resources are provided in the comments -field for each resource contained in the associated .DOG file. Please pay -special attention to these notes and to the TRANSLATE field. In general, -be aware of the following: -
        -
        -
      • -Many strings contain C++ print format strings, such as %s, %ld, %lu, etc.  -Do not modify these while translating the rest of the string.
      • - -
      • -Many strings contain new line characters: \n.  In general, you should -try leave these as you find them.  In some cases, the new line is -used to delimit a matched set of strings used to build a button label, -a ToolTip and a status bar message all relating to single control. In these -cases, you must preserve the new line characters.
      • - -
      • -Many strings actually show up as part of an HTML or Javascript document -or dialog.  Be careful not to break format tags, like <TITLE>, -<FONT>, etc. by translating these.
      • -
      -
    - -

    -Localizing Menus

    - -
      Menu translation is usually not as tricky as localizing string tables; -however, you should take care to assign unique pickletters to menu choices.  -This process can be made difficult by the fact that some strings that appear -in menus at runtime actually come from string tables.  The special -ID Build provided in this kit can help you find these. -

      -Localization Notes

      -Menu resources are identified first by the word MENU, then by a resource -number, then by a sequential Item number. For example, in RESDLL.DLL, MENU2ITEM0 -contains the word "&File". This resource is the first item in menu -structure structure #2 (the File menu).  The ampersand character (&) -denotes the pickletter is the letter "F".  Localization notes for -individual MENU resource items are provided in the comments field for that -item in the localization databases. Not all MENU resource items need to -be translated so again, please pay special attention to these notes and -to the TRANSLATE field!
    - -

    -Localizing Dialogs

    - -
      Dialog translation is usually not as tricky as localizing string tables; -however, you should take care to assign unique pickletters to dialog controls.  -This process can be made difficult by the fact that some strings that appear -in menus and dialogs at runtime actually come from string tables.  -The special ID Build provided in this kit can help you find these. Once -a DIALOG resource has been translated, the dialog may need to be resized -using a visual resource editor, such as MSDEV (Microsoft® -Visual C++ 4.0 or greater) or Borland® -Resource Workshop. -

      -Localization Notes

      -Dialog resources are identified first by the word DIALOG , then by a resource -number, then by a sequential Item number. For example, in NSMAILUI.DLL, -DIALOG129Item0 contains the word "Password". This resource is the first -item (the dialog title) in DIALOG129. Localization notes for individual -DIALOG resource items are provided in the comments field for that item -in the localization databases. Not all DIALOG resource items need to be -translated so again, please pay special attention to these notes and to -the TRANSLATE field!
    - -
      A special note on Dialog fonts: -
      The second item in each dialog definition (e.g. DIALOGnnnITEM1) is -the font information for that dialog.  If you find it necessary to -change the font name or size, be aware of the following fact: the font -size is represented in the translation database by the ASCII character -corresponding to that size.  In the US product the default font size -is 9, which appears as a Horizontal Tab (Font size = 9 = ASCII character -9 = tab).  In the database, this will appear as an unprintable character, -such as a black box.  There are two concerns here: first, if you change -the font name, be careful not to accidentally delete the tab character.  -Second, if you decide to change the font size, you can do so by substituting -the appropriate ASCII character which matches the new size you want.  -For example, to change the font size to 10, replace the tab with a Line -Feed character (ASCII 10).  This is rather confusing, so it is probably -best to avoid changing the fonts if possible.
    - -

    -Localizing Javascript Preferences

    - -
      Javascript is used to define default preference information for the -Communicator and it's components.  These preferences end up stored -in the DATA section of RESDLL.DLL. You can use the ToolCool to edit these -just as you would STRINGTABLE resources, or use your preferred localization -tools. - -

      There are two groups of localizable Javascript preferences: ALL_PREFS -and CONFIG_PREFS.  Most of these preference settings are not localizable; -these are marked as forbidden in the localization notes.  Those that -are localizable should be treated very carefully, as Javascript is rather -particular about the format of the data it receives.  Pay special -attention not to unbalance quotes, delete the preceding tab characters, -etc.

    - -
      -

      -Localization Notes for ALL_PREFS

      -The entries in the ALL_PREFS section contain the default values for certain -cross-platform preferences, including some crucial for the correct operation -of localized versions.  The rules for how to handle this section are -found here. -

      -Localization Notes for CONFIG_PREFS

      -The entries in the CONFIG_PREFS section make up the configurable Toolbar -and Help menu items and their functions.  How they are localized depends -on whether you are creating a branded Netscape version or not.  The -rules for how to handle this section are found here.
    - -

    -Localizing DATA

    - -
      There are several additional resources stored as DATA that cannot be -edited using ToolCool.  Therefore, you must use a resource editor -and a text editor to localize these by following this procedure.  -(This example uses Microsoft® MSDEV; -if you prefer a different resource editor you may need to execute slightly -different steps).
    - -
      -
        -
      • -Open the file containing the DATA resources (usually RESDLL.DLL)
      • - -
      • -Expand the DATA resource type.
      • - -
      • -Select the resource you want to localize
      • - -
      • -Choose Edit | Select All.
      • - -
      • -Choose Edit | Copy.
      • - -
      • -Open a text editor window by clicking on the new document icon (or if you -prefer, you may use any other text editor).
      • - -
      • -Choose Edit | Paste.
      • - -
      • -You should now have the text representation of the DATA resource in your -text editor window. You may localize it according to the instructions in -the Localization Notes section for each DATA resource.
      • - -
      • -When done, save your work, then select ALL the text (use Edit | Select -All if your editor supports this).
      • - -
      • -Choose Edit | Copy.
      • - -
      • -Go back to the RESDLL.DLL in MSDEV and select the DATA resource you have -translated.
      • - -
      • -Choose Edit | Select All.
      • - -
      • -Choose Edit | Paste.
      • - -
      • -You should now see the original English DATA resource replaced by your -translated version.
      • - -
      • -IMPORTANT: Go to the end of -the resource and insert a NULL value by typing the number zero (0) in the -first empty byte position.
      • - -
      • -Close the resource and save your work.
      • -
      -
    - - - -

    -Localizing External Files

    - -
      As mentioned above, you may choose (or be required) to translate several -external files.  If this is the case, the links contained in the text -file section of Localize These -Files will tell you what to do. (Note: this may be nothing at all).
    - -

    -Localizing the NULL Plugin

    - -
      The so-called "NULL" plugin is the default plugin that ships with all -versions of the Communicator.  It's job is to list the plugins that -you have installed, and if you don't have a requested plugin, to help you -get it. - -

      The name and location of the NULL plugin is given in the Localize -These Files binary file section. Localization notes have been provided -for you to use when localizing the resources for this file.  Instructions -for individual resources can be found in the COMMENT field of the matching -.DOG file. - -

      -


    - -

    -Notes

    - -
      1. Whether or not you have to incorporate or create -localized version of these files depends on your agreement with Netscape, -if any; or if localization is occurring as part of the Universal Localization -Program, upon your desire to perform this work.[BACK]
    -  -
    - - - - - - - -
    -
    [BACK]
    -
    -
    [NEXT]
    -
    -
    [CONTENTS]
    -
    - -
    - -
    1998, Copyright Netscape -Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/windows/docs/nav40/winfekit.jpg b/l10nkits/client/windows/docs/nav40/winfekit.jpg deleted file mode 100644 index 099ecfed62677189d7c5b1dfa926d46ff93a5362..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4486 zcmb7HcQoAHy8fBLs8NFG1|w>MA))FrR`&sXP_vOsxcYsz$Lt6tNA_4%Ss{vfj z1F8TSDJg`MgbV_Kkdu>9P%%(bQBqQ|&|jxv;9%wAf?@!!d>7)Xf0R}eSdU)U8t2>jnW zUy;)hi_>#o=TSEFxts&2z*pMnz;u8T@H=(be`QK|x(dwaie^gjEvhExPttwS$g;a7 z=Itkx(DeIEN1sAng#N^XUS%^(-6P64d~)w#Qe$;|d&`VJc%E~tspsoSGFzill6XNi z&^I$m^!*UOH?jD^LuUh;nXQ#R@sL>Tnl^=yMtMb=m2KZO03W&c#jITpxvP&{a2STU zptT0d%Xp#N-7p+1>yURI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ia>+;g^tHcR6=nHSGpl^}^$I@HD&Jd$diO;0s(;BGzHZ0QCyiCniw)G6*pc$K4 zd&v0hu#Sg{pFML14x@eAudjXfp4EVgb~9+0p2ni1u4zVH3wjQ?&&V?V(Ot+Gs(c??Qlpf2NUjZPK=P;gG!v@DgF{bX&t$ za|k8CFCvG4>8(83V_j`7(fGDlka?>Fp__vGIY#08QM}Uk&i&+%t9DLS;yJ`H$I)vz z3i6+OM$)CGiL8%_U(uIO{U{s*{2y=&&-Wve^1tZ)yAk@UEt#s-I>#7AaddTCBzDmo(;?PE9%PN*VkSqe zzgnlzz*y&(WJb4I(q_!{Miu4zTpTKN-S3;kBK*-6pUzd% z`n};qb~&@1vIlZ_h7?%ZTJ&VHy+#f>kEzqSF!mqU)DFN{X-=HQs&!uqesA)mGC9!In~cL!F7=t-&cJ(npouywq#ab}-^d0tJoNE?4+T?e@+=nEQKN;F4c3 z3Risn60kdUMc+}MbZ@+?J7-<4nTUPXE$=cibfdJbjN-Wr5Bwbcf`1R)<8C^OshT^$ zY19vo28C99ZCscXdAKHF7A2mdkri@LLy~Q^9C6k*Tv}L|4#t8HW!)-@OPZYD9lUAa zOU12}P|ne-cRqhdWcPJ;En9IkA{) zBHUB*ivf1*T*58TV`gKxz;!i{Q`_Mkn?!>sEDfs^YWp<&f$?j$JD;Ao#6ByE!@ZUj s7v_D!(MgF8J8> - - - - - Cross-Product Encoding UI Names - - - -
    -

    -Cross-Product Encoding UI Names

    - -
    Uppercase and lowercase are treated distinctly
    - -
     
    - - - - - - - - - - - - - - - - - -
    UNIXWindowsMacintosh
    Western (ISO-8859-1)  -
    Western (Windows-1252)  -
    Central European (ISO-8859-2)  -
    Central European (Windows-1250)  -
    Japanese (Auto-Detect)  -
    Japanese (Shift_JIS)  -
    Japanese (EUC-JP)  -
    Japanese (ISO-2022-JP)  -
    Traditional Chinese (Big5)  -
    Traditional Chinese (EUC-TW)  -
    Simplified Chinese (GB2312)  -
    Simplified Chinese (HZ)  -
    Korean (Auto-Detect)  -
    Korean (EUC-KR)  -
    Korean (ISO-2022-KR)  -
    Cyrillic (KOI8-R)  -
    Cyrillic (ISO-8859-5)  -
    Cyrillic (Windows-1251)  -
    Greek (ISO-8859-7)  -
    Greek (Windows-1253)  -
    Turkish (ISO-8859-9)  -
    Unicode (UTF-8)  -
    Unicode (UCS-2)  -
    Unicode (UTF-7)  -
    User-Defined  -
    Western (ISO-8859-1)  -
    Western (Windows-1252)  -
    Central European (ISO-8859-2)  -
    Central European (Windows-1250)  -
    Japanese (Auto-Detect)  -
    Japanese (Shift_JIS)  -
    Japanese (EUC-JP)  -
    Japanese (ISO-2022-JP)  -
    Traditional Chinese (Big5)  -
    Traditional Chinese (EUC-TW)  -
    Simplified Chinese (GB2312)  -
    Simplified Chinese (HZ)  -
    Korean (Auto-Detect)  -
    Korean (EUC-KR)  -
    Korean (ISO-2022-KR)  -
    Cyrillic (KOI8-R)  -
    Cyrillic (ISO-8859-5)  -
    Cyrillic (Windows-1251)  -
    Greek (ISO-8859-7)  -
    Greek (Windows-1253)  -
    Turkish (ISO-8859-9)  -
    Unicode (UTF-8)  -
    Unicode (UCS-2)  -
    Unicode (UTF-7)  -
    User-Defined  -
    Western (ISO-8859-1)  -
    Western (MacRoman)  -
    Western (Windows-1252)  -
    Central European (ISO-8859-2)  -
    Central European (Windows -1250)  -
    Central European (MacCE)  -
    Japanese (Auto-Detect)  -
    Japanese (Shift_JIS)  -
    Japanese (EUC-JP)  -
    Japanese (ISO-2022-JP)  -
    Traditional Chinese (Big5)  -
    Traditional Chinese (EUC-TW)  -
    Simplified Chinese (GB2312)  -
    Simplified Chinese (HZ)  -
    Korean (Auto-Detect)  -
    Korean (EUC-KR)  -
    Korean (ISO-2022-KR)  -
    Cyrillic (KOI8-R)  -
    Cyrillic (ISO-8859-5)  -
    Cyrillic (Windows-1251)  -
    Cyrillic (MacCyrillic)  -
    Greek (ISO-8859-7)  -
    Greek (Windows-1253)  -
    Greek (MacGreek)  -
    Turkish (ISO-8859-9)  -
    Turkish (MacTurkish)  -
    Unicode (UTF-8)  -
    Unicode (UCS-2)  -
    Unicode (UTF-7)  -
    User-Defined  -
    - -
    -
    -

    -Cross-Product Encoding Names to be Transmitted

    - -
    Uppercase and lowercase are not distinct
    - -
     
    - - - - - - - - - - - - - - - - - -
    UNIXWindowsMacintosh
    Western (ISO-8859-1)  -
    Central European (ISO-8859-2)  -
    Central European (Windows-1250)  -
    Japanese (Shift_JIS)  -
    Japanese (EUC-JP)  -
    Japanese (ISO-2022-JP)  -
    Traditional Chinese (Big5)  -
    Traditional Chinese (x-EUC-TW)  -
    Simplified Chinese (GB2312)  -
    Simplified Chinese (HZ-GB-2312)  -
    Korean (EUC-KR)  -
    Korean (ISO-2022-KR)  -
    Cyrillic (KOI8-R)  -
    Cyrillic (ISO-8859-5)  -
    Cyrillic (Windows-1251)  -
    Greek (ISO-8859-7)  -
    Greek (Windows-1253)  -
    Turkish (ISO-8859-9)  -
    Unicode (UTF-8)  -
    Unicode (ISO-10646-UCS-2)  -
    Unicode (UNICODE-1-1-UTF-7)  -
    Western (ISO-8859-1)  -
    Central European (ISO-8859-2)  -
    Central European (Windows-1250)  -
    Japanese (Shift_JIS)  -
    Japanese (EUC-JP)  -
    Japanese (ISO-2022-JP)  -
    Traditional Chinese (Big5)  -
    Traditional Chinese (x-EUC-TW)  -
    Simplified Chinese (GB2312)  -
    Simplified Chinese (HZ-GB-2312)  -
    Korean (EUC-KR)  -
    Korean (ISO-2022-KR)  -
    Cyrillic (KOI8-R)  -
    Cyrillic (ISO-8859-5)  -
    Cyrillic (Windows-1251)  -
    Greek (ISO-8859-7)  -
    Greek (Windows-1253)  -
    Turkish (ISO-8859-9)  -
    Unicode (UTF-8)  -
    Unicode (ISO-10646-UCS-2)  -
    Unicode (UNICODE-1-1-UTF-7)  -
    Western (ISO-8859-1)  -
    Western (x-MacRoman)  -
    Central European (ISO-8859-2)  -
    Central European (Windows-1250)  -
    Central European (x-MacCE)  -
    Japanese (Shift_JIS)  -
    Japanese (EUC-JP)  -
    Japanese (ISO-2022-JP)  -
    Traditional Chinese (Big5)  -
    Traditional Chinese (x-EUC-TW)  -
    Simplified Chinese (GB2312)  -
    Simplified Chinese (HZ-GB-2312)  -
    Korean (EUC-KR)  -
    Korean (ISO-2022-KR)  -
    Cyrillic (KOI8-R)  -
    Cyrillic (ISO-8859-5)  -
    Cyrillic (Windows-1251)  -
    Cyrillic (x-MacCyrillic)  -
    Greek (ISO-8859-7)  -
    Greek (Windows-1253)  -
    Greek (x-MacGreek)  -
    Turkish (ISO-8859-9)  -
    Turkish (x-MacTurkish)  -
    Unicode (UTF-8)  -
    Unicode (ISO-10646-UCS-2)  -
    Unicode (UNICODE-1-1-UTF-7)  -
    -  -
     1998, Copyright -Netscape Communications Corp. All Rights Reserved
    -  - - diff --git a/l10nkits/client/xp/docs/mozilla.org/kitDownload.html b/l10nkits/client/xp/docs/mozilla.org/kitDownload.html deleted file mode 100644 index 6dee6ba1700..00000000000 --- a/l10nkits/client/xp/docs/mozilla.org/kitDownload.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - Download L10n Kits - - -Download Your Localization Kit - -

    Make your selections from the links below. If the Localization kit for -the product or operating system you need is not shown list, we aren't supporting -freely downloadable localization kits for that product or platform (yet). -Kits have been broken into separate components for faster downloads. - -

    Before downloading any localization kit, please read the License -Agreement! By downloading and using any of the information, -software or tools linked from this page, you affirm that you have read -this Agreement and agree to abide by the terms and conditions contained -therein. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Windows (NT)
    Description
    win32Kit.zip32 bit Localization Notes - version 4.03. Contains translation databases -in binary (.dbf) and text (.dog) format.
    winDocs.zipWindows Localization Kit Documentation. Contains .HTML documentation -(identical to the on-line -version).
    nstools.exeWindows Translation Tools. A self-extracting installer for ToolCool -and DogLev. Includes documentation.
    win32Bits.zip32 bit English export binaries - version 4.03. Contains the localizable -resources matching the most recent localization notes.
    Installer
    Description
    winInstDocs.zipWindows Installer Localization Kit Documentation. Contains .HTML documentation -(identical to the on-line -version).
    C32E403.EXEWindows 32 bit English export installer, complete version.
    - -

    -

    -
    - -
    - - - - - - - - - - - - - - - - - -
    ADDITIONAL INFORMATION
    Program Terms:Universal Localization -Program License
    Product Info:Overview of -Localization Kits | FAQ
    - -
    - - - -
    -
    -
    - -
    Copyright -© 1998 Netscape -Communications Corporation
    -
    - - - diff --git a/l10nkits/client/xp/docs/mozilla.org/l10nLibrary.html b/l10nkits/client/xp/docs/mozilla.org/l10nLibrary.html deleted file mode 100644 index a946b79c2ad..00000000000 --- a/l10nkits/client/xp/docs/mozilla.org/l10nLibrary.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - L10n Library - - - -

    -L10n Library

    -This is where you will find localization kit documentation on-line.  -Documentation will also be provided within the localization kits themselves.  -Theoretically, the on-line docs and the in-kit docs should be the same; -however, if there is a discrepancy, you should: -
      a) believe the in-kit docs over the on-line docs, and -
      b) inform us that there is a mismatch between the two versions.  -We'll fix it as soon as possible.
    - -
    - -

    Documentation is grouped into "pods" of related HTML pages. Select the -pod you wish to read from the links below. -
      -

    - - - - - - - - - - - - - - - - - - - - - - - - -
    Documentation PodDescription
    Windows -32 bit Front EndInstructions for localizing the client for Windows NT and Windows -'95.
    Netscape -Translation ToolsInstructions for using the freely available Netscape Translation Tools: -ToolCool and DogLev (note: DogLev docs are under -construction.)
    Windows -InstallerInstructions for localizing the Windows installer program.
    -  - - diff --git a/l10nkits/client/xp/docs/mozilla.org/l10nkitintro.html b/l10nkits/client/xp/docs/mozilla.org/l10nkitintro.html deleted file mode 100644 index ae1426ef812..00000000000 --- a/l10nkits/client/xp/docs/mozilla.org/l10nkitintro.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - universal localization kits - - - -
    -

    -they're here!

    - -
    -

    -localization kits

    - -

    -purpose

    -This page details the localization kits that are being made publicly available -as part of the universal localization program. As the program's FAQ -stated, there are two dimensions to this program: what is permitted versus -what is facilitated. Localization kits are the primary way in which the -universal localization program facilitates translation of the branded Netscape -Communicator Standard Edition and Netscape Navigator products, as well -as the Mozilla product and its derivatives. - -

    A localization kit contains the tools, instructions and resources necessary -to produce a localized version of the target software. Currently, these -kits are derived from the Netscape Communicator Standard Edition and Netscape -Navigator version 4.x products. By following the instructions in the kits, -you will be able to produce a localized client product in any supported -language. By extension, you may be able to apply the tools and information -provided in the localization kits to localize the Mozilla client. Finally, -following this model, we anticipate developers publishing their own localization -kits based on their derivatives of the mozilla.org source code. - -

    -kit contents

    -While the exact contents of each localization kit differs according to -the platform and product it is intended for, each kit is composed of the -following general pieces: -
      -
    • -The English language resources (in exportable, binary form)
    • - -
    • -Localization notes
    • - -
    • -Kit documentation
    • - -
    • -Tools
    • -
    - -
    -Resources
    - -
    -The English language resources are provided as the base for your localization -work. These resources will match the version used to generate the localization -notes. For Microsoft Windows and Apple Macintosh platforms, the English -language resources are provided as binaries. (You may also download a later -version of the product by visiting Netscape's download -pages. Be sure you only localize the export version! -Otherwise, you will not be able to legally distribute your localized product.) -Netscape's experience with localization has convinced us that localizing -resource binaries is more efficient than working on source files (at least -on Windows and Macintosh).
    - -

    -

    -Localization notes
    - -
    -Localization notes are the heart of the kits: this is where you will find -detailed information on the exact way in which particularly sensitive resources -must be handled. For example, the localization notes tell you which resources -must not be changed from their original values; they will also identify -resources that appear as HTML or Javascript, or that must match other resources -in order for the product to function properly.
    - -

    -

    -Documentation
    - -
    -The localization kit documentation is a series of HTML files which give -you an overview of the localization process, as well as generic instructions -on localizing the different data types found in the product.
    - -

    -

    -Tools
    - -
    -We have attempted to make our Localization Kits "tools agnostic," meaning -you are free to use whichever localization tools you desire to accomplish -your aims. At the same time, we have chosen to release some of our internally -developed localization tools; these are provided "as is", with no support -(but we use them daily with great success).
    - - -

    -


    -

    -next steps

    -If you have questions about the universal localization program, try the -FAQ. - -

    Read the Press -Release announcing the universal localization program. - -

    To download any of the localization kits, proceed to the -download pages. - -

    To read the localization kit documentation on-line, visit the L10n -Library. - -

    If you're looking for more information about localization, internationalization -or links to related subjects, visit the Links & Resources page. [coming -soon!] -
    -


    -
    - - - - - - - - - -
    -
    [Download]
    -
    -
    [L10n Library]
    -
    -
    [FAQ]
    -
    [Links & Resources]
    - -
    Copyright 1998, Netscape Communications Corp., All -Rights Reserved.
    - - - diff --git a/l10nkits/client/xp/docs/mozilla.org/ulpFAQ.html b/l10nkits/client/xp/docs/mozilla.org/ulpFAQ.html deleted file mode 100644 index 6158a5801ae..00000000000 --- a/l10nkits/client/xp/docs/mozilla.org/ulpFAQ.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - universal localization program FAQ - - - -

    -universal localization program FAQ

    - -Last Updated: 23 Mar. 1998 3:40 pm -
    -
    - -

    -OVERVIEW

    - -

    Netscape's universal localization program furthers the goals of mozilla.org by -publishing tools and documentation to aid developers who wish to localize Mozilla. In addition, -participants in the universal localization program may freely translate the Netscape Navigator -and Netscape Communicator Standard Edition version 4.x. These localized products may be freely distributed under -the participant's branding. -

    -This document answers some frequently asked questions about the universal localization program. -

    -

      -

      -GENERAL

      - -
    1. -What is localization?
    2. - -
    3. -How does the universal localization program relate to mozilla.org?
    4. - -
    5. -How does the universal localization program relate to the unlimited distribution program?
    6. - -
    7. -What are the terms of the universal localization program's License?
    8. - -
    9. -What products may I localize?
    10. - -
    11. -Who should participate in the universal localization program?
    12. - -

      -DISTRIBUTION

      - -
    13. -Where can I distribute the localized version?
    14. - -
    15. -How much does this cost?
    16. - -
    17. -Am I allowed to use the Netscape brand, trademarks and logo?
    18. - -
    19. -Will there be any end user support from Netscape for my finished -product?
    20. - -
    21. -Am I required to give my localization back to the Net?
    22. - -
    23. -Can I download software from the general download page on -the Netscape web site and localize it?
    24. - -

      -TECHNICAL INFORMATION

      - -
    25. -What is a localization kit?
    26. - -
    27. -Why do I need a localization kit?
    28. - -
    29. -What platforms does this Program support?
    30. - -
    31. -Into what languages can I translate the software?
    32. - -
    33. -How can I get technical assistance?
    34. - -
    35. -I understand that the source code distributed by mozilla.org will not -include certain 3rd-party components, and cryptography. If I localize -Netscape Navigator 4.x, will I lose the ability to use those components?
    36. - -
    37. -Will this work for Communicator Professional Edition components?
    38. - -
    39. -What about products in France?
    40. - -
    41. -What spell checkers can I use?
    42. - -
    43. -What about installers?
    44. -
    - -
    - -
      - -

      -GENERAL

      - - -
    1. -What is Localization?
    2. - -
      Localization is the process of adapting software for a specific international market; -this process includes translating the user interface, resizing dialog boxes, replacing icons -and other culturally sensitive graphics (if necessary), customizing features (if necessary), -and testing the localized product to ensure that the program still works. - -

      -

    3. -How does the universal localization program relate to mozilla.org?
    4. - -
      The universal localization program is an extension of the philosophy -behind mozilla.org. The goal of the program is to enable developers on the -Internet to freely localize and distribute products based on the Netscape -client and on derivatives based on the mozilla.org source. mozilla.org -will host the content for this program, and provide a forum for developers -to correspond on their work. - -

      -

    5. -How does the universal localization program relate to the unlimited distribution program?
    6. - -
      Whereas the unlimited distribution program allows you to -freely distribute Netscape Navigator and Netscape Communicator -Standard Edition client binaries, and to make slight modifications to these products, -the universal localization program allows you to create localized, -independently branded versions of these products. You may then distribute these localized -products according to the terms of the License. -

      -For more information on the -unlimited distribution program, please visit -http://home.netscape.com/comprod/netscape_partner_programs/browser_distrib/index.html. - -

      -

    7. -What are the terms of the universal localization program's License?
    8. - -
      We are still working out some of the details of the License Agreement -under which this program will be administered. References to the License Agreement in -this document are, therefore, regrettably vague. We hope to have this ironed out soon. - -

      -

    9. -What products may I localize?
    10. - -
      You may localize the Netscape Navigator, Netscape Communicator Standard -Edition, or any client based on the Mozilla source code available from mozilla.org (or its -mirror sites). -Note that localizing products not directly documented in the localization -kits probably will be more difficult than localizing those that are directly documented. - - -

      -

    11. -Who should participate in the universal localization program?
    12. - -
      This program is intended for professional software localizers, localization engineers, -or others who are knowledgeable in software localization concepts and techniques. -However, if you are familiar with common tools, such as resource editors, and if you -are fluent in a particular language, you could use the tools and information provided by -this program to localize Navigator or Communicator in your language. - -

      -DISTRIBUTION

      - -

      -

    13. -Where can I distribute the localized version?
    14. - -
      The terms of the License do not change due to translation of the software: -you may distribute localized versions of the Netscape branded binaries anywhere -allowed by the export license. (A copy of this license comes with every Netscape product). -For localized Mozilla product derivatives, you may distribute them anywhere allowable under -the final free source License (whatever that turns out to be). - -

      -

    15. -How much does this cost?
    16. - -
      There is no cost to participate in the universal localization program. - -

      -

    17. -Am I allowed to use the Netscape brand, trademarks and logo?
    18. - -
      You may not use the name "Netscape" nor the "N" logo -in your localized product. However, you may use the trademarks "Navigator," -"Communicator," "Messenger," "Collabra", and the "Ship's Wheel icon". The universal -localization program License will give you the exact legal details. - -

      -

    19. -Will there be any end user support from Netscape for my finished product?
    20. - -
      No. The products derived from the mozilla.org source and Netscape binaries -are not entitled to Netscape end user support. The level of support you provide -your end users is up to you to decide. - -

      -

    21. -Am I required to give my localization back to the Net?
    22. - -
      The terms of the License are not yet set on this issue. - -

      -

    23. -Can I download software from the general download page on the Netscape -web site and localize it?
    24. - -
      Yes. You may download, localize and distribute any Netscape Navigator -and Netscape Communicator Standard Edition product. However, we may not produce a -localization kit for all versions and platforms. You may try -to use the instructions and tools in the kits we do release for these other versions -and platforms, but successful localization could be quite difficult under these circumstances. - -

      -TECHNICAL INFORMATION

      - -

      -

    25. -What is a localization kit?
    26. - -
      A localization kit contains the tools, instructions and resources necessary -to produce a localized version of a specific software product. The -detailed instructions contained in a given localization kit are usually -specific to a single platform and/or version of a product. These instructions -may, however, be broadly applicable to more than one version or platform. -Therefore, when we say a localization kit "supports" a given platform, -version or language, what we mean is that kit contains detailed instructions -that directly apply to that platform or version or language. It may -be possible to use a localization kit for one platform to successfully -localize another. On the other hand, it may be quite difficult. - -

      -

    27. -Why do I need a localization kit?
    28. - -
      The primary goal of a localization kit is to convey information about -the product being localized so that the over-translation of restricted -resources does not occur. Over-translation occurs when a resource changes -that must not be changed. It can also occur when a resource must be changed -in a particular way, but is not done so. In both cases, the product may -not function properly or may cease to function at all (e.g. crash). The -information contained in the localization kits is designed to help -avoid these situations and to help you correctly localize the product. -Attempting to translate the source files directly without such a kit could -be a frustrating and error-prone operation. - -

      -

    29. -What platforms does this program support?
    30. - -
      This question has two dimensions: what platforms are permissible versus what platforms -are made easy for me to localize onto. The first issue is addressed by the program, the second, -by the localization kits. -

      -The universal localization program allows you to create and distribute localized -products for any platform, except Caldera Linux. Netscape has an exclusive agreement -with Caldera, so this platform is off the list. -

      -Localization kits are currently planned for Windows (32 bit) and Macintosh platforms. -Windows 16 bit and Unix localization kits are not available at this time. You are welcome to -try to localize the software for any platform (except Caldera Linux), with or without the benefit of -a localization kit (but doing so without will be harder than with). - -

      -

    31. -Into what languages can I translate the software?
    32. - -
      This is the same issue as above: under the universal localization program, you are free -to localize the product into any language you desire. On the other hand, not every language -is fully supported by current (version 4.x) client software. In general, if the target language you desire -is supported by one of the encodings listed in the Navigator's View | Encoding menu, -localization into that language should be successful. This is because parts of the product's -user interface is HTML, which depends on the encoding support built into the HTML rendering -engine to display properly. -

      -You will need an operating system that also supports that language. This is because the fonts -necessary to display the standard (non-HTML) localized resources, as well as the input methods, -keyboard mappings, etc., required to input your language's characters, are provided by the -OS. -

      -Please note that at this time, Communicator does not support bidirectional languages, such -as Arabic and Hebrew, nor languages with complex scripts, such as Devanagari. Languages -with contextual line breaking algorithms, such as Thai, are also not supported (although -partial localization and display of web pages may still be possible through various means). -

      -To provide support for additional languages, you will be able modify the 5.x source -code which will be distributed by mozilla.org. - -

      -

    33. -How can I get technical assistance?
    34. - -
      There is no formal technical support; you are on your own. However, -we expect that you will find the newsgroups and mailing lists hosted on -mozilla.org to be a valuable resource. You can find the list of newsgroups -by going to the mozilla.org Community pages: - http://www.mozilla.org/community.html - -

      -

    35. -I understand that the source code distributed by mozilla.org will not -include certain 3rd-party components or cryptography. If I localize -Netscape Navigator 4.x, will I lose the ability to use those components?
    36. - -
      No. Since the localization process does not depend on having -the source code to the program available (all you are doing, really, is -changing strings in an existing executable) you will retain all of the -functionality present in the executable you started with. It will -just be in a different language. - -

      -

    37. -Will this work for Communicator Professional Edition components?
    38. - -
      No. The Professional Edition includes 3rd Party components that are -not covered by the Unlimited Distribution or NPL programs. These -components cannot be modified under this program. - -

      -

    39. -What about products in France?
    40. - -
      You are free to create French versions. However, to comply with French law, -if you distribute a product which has cryptographic -capabilities, that product must use the special encryption level for France. -Compliant versions of Communicator and Navigator are available from Netscape's -download page. The English Export version of Netscape Navigator -and Netscape Communicator Standard Edition are not authorized for import -into France. -

      -Netscape's download page can be found -here: -http://home.netscape.com/download/client_download.html - -

      -

    41. -What Spell Checkers can I use?
    42. - -
      The spell checker module built into Composer is licensed from Inso -Software. Inso permits you to bundle two spell checkers with -your product. For additional spell check dictionaries, contact Inso Corporation. -

      -Visit Inso Corp.'s web site at: http://www.inso.com/ - -

      -

    43. -What about Installers?
    44. - -
      Currently, Netscape's installer programs are built using 3rd party -modules, for which we do not have redistribution rights. Therefore, -we are not releasing a complete installer kit; however, guidelines for -creating your own installer will be available. You may use any commercially -available installer software to package your localized product and obtain -authorization for distribution directly from the provider of the installer -software.
    - - - diff --git a/l10nkits/client/xp/docs/mozilla.org/ulpLicense.html b/l10nkits/client/xp/docs/mozilla.org/ulpLicense.html deleted file mode 100644 index a704fd622db..00000000000 --- a/l10nkits/client/xp/docs/mozilla.org/ulpLicense.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - Universal Localization Program License Agreement - - - -

    -Universal Localization Program License Agreement

    - -
    1.  Definitions.
    -
    -(a) "Agreement" shall mean this Universal Localization
    -Agreement.
    -
    -(b) "Netscape Products" shall mean the Netscape
    -Navigator 4.x and / or Netscape Communicator Standard
    -Edition 4.x on all platforms made generally available
    -by Netscape (excluding Linux).
    -
    -(c) "Licensee" shall mean the person or entity who may
    -avail itself of the rights granted in this Agreement by
    -agreeing to the terms and conditions set forth in this
    -Agreement.
    -
    -(d) "Localized Product" shall mean the version of the
    -Netscape Product that Licensee localizes pursuant to
    -the provisions set forth in the localization kit and
    -Section 3 of this Agreement.
    -
    -(e) "EULA" shall mean the end user license agreement
    -that is provided with the Netscape Product
    -
    -2.  License Grant.  (a) Netscape grants to Licensee,
    -subject to these terms and conditions, a nonexclusive,
    -royalty free and nontransferable right to (i) create a
    -Localized Product; (ii) reproduce the Localized Product
    -in executable code form only on any media and (iii)
    -distribute by sublicense such Localized Product copies
    -to end users, directly or through
    -distributors. Licensee may electronically distribute
    -the Localized Product, in exportable version only,
    -pursuant to the terms and conditions set forth herein.
    -
    -(b) Except as expressly permitted herein or by
    -applicable law, Licensee shall not and, shall not
    -permit any distributor or other person to,
    -re-configure, modify, decompile, reverse engineer,
    -disassemble, or otherwise determine or attempt to
    -determine source code from the Netscape Product or
    -Localized Products or to create any derivative works
    -based upon the Netscape Product or Localized Products
    -including the Netscape user interface.  If Licensee or
    -any distributor fails to comply with this Section 2(b),
    -the Agreement shall immediately terminate (in addition
    -to all other remedies it may have and except for end
    -user licenses), and all licenses granted hereunder
    -shall be revoked.
    -
    -(c) Licensee is not granted any right in this Agreement
    -to use any Netscape trademark, even if provided with
    -the Netscape Product.  A current list of Netscape’s
    -trademarks may be found at
    -http://home.netscape.com/misc/trademarks.html.
    -
    -3. Localization Requirements and Guidelines.  (a)
    -Licensee agrees to use all reasonable efforts to
    -complete the localization in accordance with the
    -following requirements: (i) the localization process
    -shall consist of Licensee translating and localizing
    -the Netscape Products, to the extent practical without
    -having access to the source code of such products; (ii)
    -Licensee may localize the EULA for the convenience of
    -the end users, however, the English language version of
    -the EULA shall be controlling in the event of any
    -inconsistency between the translated end user license
    -agreement and EULA; and (iii) Licensee must localize
    -the content behind the following links, making
    -appropriate URL changes to reflect the Maintenance and
    -Technical Support available by Licensee, How to Give
    -Feedback and How to Get Support.  For notices, updates
    -and changes to this Agreement, Licensee shall regularly
    -check the URL where this Agreement was viewed and
    -agreed to.
    -
    -(b) Licensee should use reasonable efforts to complete
    -the localization in accordance with the following
    -guidelines: (a) In the About Box of the Localized
    -Product, Licensee should identify itself as the company
    -or individual that localized the Netscape Product(s);
    -and (b) the guidelines set forth in the localization
    -kit.
    -
    -4.  Support.  Netscape shall not provide any support to
    -Licensee for the Netscape Products, Localized Products
    -or services called for by this Agreement.  Netscape
    -shall not provide any support to end users for the
    -Netscape Products or Localized Products.
    -
    -5.  Distribution.  (a) Licensee shall and shall cause
    -its distributors to comply with all then-current
    -applicable laws, regulations and other legal
    -requirements in its performance of this Agreement,
    -including without limitation, all applicable export
    -laws, rules and regulations of any agency of the
    -U.S. Government or other applicable agencies.  Licensee
    -shall ensure the inclusion of appropriate notices
    -required by the U.S. Government agencies or other
    -applicable agencies.
    -
    -(b) Licensee shall use commercially reasonable best
    -efforts to ensure that its distributors and
    -sub-distributors comply with all of the relevant terms
    -contained in this Agreement. The Localized Products
    -distributed pursuant to this Agreement must be
    -distributed with the EULA.
    -
    -(c) This is a nonexclusive relationship, and each party
    -agrees that the other may enter into similar
    -arrangements with third parties.  Licensee shall and
    -shall cause its distributors to treat all Localized
    -Products at least as favorably as it treats any
    -competitive products it distributes.
    -
    -(d) Licensee agrees to distribute documentation or
    -packaging relating to the Localized Product that shall
    -conspicuously state that, notwithstanding anything in
    -the EULA to the contrary, (i) Netscape will not supply,
    -and end users are not entitled to, any support,
    -warranty or documentation associated with the Localized
    -Product; and (ii) that Licensee is the Licensor
    -referred to in the EULA.
    -
    -(e) During the term of this Agreement, Licensee agrees
    -that each Localized Product created by Licensee must be
    -made publicly available in executable code form, free
    -of charge, for electronic delivery via a mechanism
    -generally accepted in the software development
    -community.
    -
    -6.  Proprietary Rights.  Title to and ownership of all
    -copies of the Netscape Products, including all
    -copyrights thereto, whether in machine-readable or
    -printed form, and including without limitation
    -derivative works, compilations, or collective works
    -thereof and all related technical know-how and all
    -rights therein are and shall remain the exclusive
    -property of Netscape or its suppliers.  Licensee
    -acknowledges that Netscape is the owner of the
    -Netscape, Navigator and Communicator trademarks, and
    -any trademark applications and/or registrations
    -thereto, agrees that it will do nothing inconsistent
    -with such ownership. Licensee and distributor shall not
    -take any action to jeopardize, limit or interfere in
    -any manner with Netscape’s ownership rights set
    -forth herein.  Further, Licensee or its distributors
    -shall not remove or alter any copyright or other
    -proprietary notices, legends, symbols, or labels
    -appearing on the Netscape Products and/or Localized
    -Products delivered to Licensee and Licensee shall
    -reproduce such notices on all copies of the Localized
    -Products made hereunder.
    -
    -7.  Warranty. THE NETSCAPE PRODUCTS ARE PROVIDED UNDER
    -THIS LICENSE ON AN ``AS IS'' BASIS, WITHOUT WARRANTY OF
    -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
    -WITHOUT LIMITATION, WARRANTIES THAT THE NETSCAPE
    -PRODUCTS OR LOCALIZED PRODUCTS ARE FREE OF DEFECTS,
    -MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR
    -NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
    -PERFORMANCE OF THE NETSCAPE PRODUCTS OR LOCALIZED
    -PRODUCTS ARE WITH LICENSEE. SHOULD A NETSCAPE PRODUCT
    -OR LOCALIZED PRODUCT PROVE DEFECTIVE IN ANY RESPECT,
    -LICENSE (NOT NETSCAPE OR ITS SUPPLIERS) ASSUME THE COST
    -OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS
    -DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF
    -THIS LICENSE. NO USE OF ANY NETSCAPE PRODUCT OR
    -LOCALIZED PRODUCT IS AUTHORIZED HEREUNDER EXCEPT UNDER
    -THIS DISCLAIMER.
    -
    -       Licensee warrants that Licensee’s performance
    -of the services called for by this Agreement and its
    -resulting work product does not and shall not violate
    -any applicable law, rule or regulation; any contracts
    -with third parties; or any third-party rights in any
    -patent, trademark, copyright, trade secret or other
    -intellectual property right.
    -
    -8.  Indemnity. Netscape shall have no obligation or
    -liability for, and Licensee shall defend, indemnify and
    -hold Netscape harmless from and against any claim
    -(including reasonable attorneys' fees and costs)
    -arising from Licensee's localization and/or
    -distribution of the Localized Products under, and/or
    -
    -compliance with the terms and conditions set forth in,
    -this Agreement.
    -
    -9.  Limitation of Liability.  (a) TO THE EXTENT ALLOWED
    -BY APPLICABLE LAW, IN NO EVENT SHALL NETSCAPE OR ITS
    -SUPPLIERS BE LIABLE (UNDER ANY LEGAL THEORY, WHETER
    -TORT, CONTRACT OR OTHERWISE) FOR ANY DAMAGES
    -WHATSOEVER, INCLUDING WITHOUT LIMITATION, ANY LOSS OF
    -PROFITS, LOSS OF BUSINESS, LOSS OF USE OR DATA,
    -INTERRUPTION OF BUSINESS, DAMAGES FOR LOSS OF GOODWILL,
    -COMPUTER FAILURE OR MALFUNCTION OR FOR DIRECT,
    -INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
    -OF ANY KIND, EVEN IF NETSCAPE HAS BEEN ADVISED OF THE
    -POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING ANY
    -FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
    -(b) IN NO EVENT WILL NETSCAPE OR ITS SUPPLIERS BE
    -LIABLE FOR ANY CLAIM AGAINST LICENSEE BY ANY THIRD
    -PARTY.  (c) IN NO EVENT SHALL NETSCAPE OR ITS SUPPLIERS
    -BE LIABLE FOR (I) ANY REPRESENTATION OR WARRANTY MADE
    -TO ANY THIRD PARTY BY LICENSEE, ANY DISTRIBUTOR OR
    -THEIR RESPECTIVE AGENTS; (II) FAILURE OF THE PRODUCTS
    -TO PERFORM; (III) FAILURE OF THE PRODUCTS TO PROVIDE
    -SECURITY; OR (IV) THE RESULTS OR INFORMATION OBTAINED
    -OR DECISIONS MADE BY END USERS OF THE PRODUCTS OR THE
    -DOCUMENTATION.  THIS LIMITATION OF LIABILITY IS AN
    -ESSENTIAL PART OF THE BARGAIN UNDER THIS AGREEMENT.
    -
    -10. Term and Termination.  This Agreement shall remain
    -in effect until terminated pursuant to the terms and
    -conditions set forth in this Agreement.
    -Notwithstanding anything in this Agreement to the
    -contrary, in the event Microsoft Corporation ceases to
    -distribute free of charge products with features
    -comparable to the Netscape Products, Netscape reserves
    -the right to terminate this Agreement upon 90 days
    -notice to Licensee.
    -
    -This Agreement shall be terminated: (a) automatically
    -in the event Licensee or a distributor of Licensee
    -attempts to derive the source code of the Netscape
    -Product and/or the Localized Products; or (b) upon 60
    -days prior notice by either party.  Immediately upon
    -termination or expiration hereof, all licenses granted
    -hereunder (except for validly granted end user licenses
    -for Localized Products) shall terminate, and Licensee
    -shall deliver to Netscape or destroy all copies of the
    -Localized Products and/or Netscape Products in its
    -possession or control, and shall furnish to Netscape an
    -affidavit signed by an officer of Licensee certifying
    -such delivery or destruction. Termination by either
    -party shall not act as a waiver or release of any
    -breach hereof or any liability hereunder. Sections
    -2(b), 4, 5, 6, 7, 8, 9, 10, 11 and 12 shall survive any
    -expiration or termination of this Agreement.
    -
    -11.  Notice.  Any notice required or permitted
    -hereunder shall be in English, in writing and shall be
    -deemed to be properly given by Netscape upon posting of
    -such notice to a URL which corresponds to the URL where
    -this Agreement was viewed and agreed to or where the
    -details of this program are generally made available by
    -Netscape.  Notices to Netscape shall be to the
    -attention of the Legal Department, Netscape
    -Communications Corporation, 501 East Middlefield Road,
    -Mountain View, California 94043.
    -
    -12.  Miscellaneous.  (a) Neither party’s waiver of a
    -breach or delay or omission to exercise any right or
    -remedy shall be construed as a waiver of any subsequent
    -breach or as a waiver of such right or remedy.  (b)
    -This Agreement shall be governed by and construed under
    -the laws of the State of California, U.S.A., without
    -reference to its conflicts of law provisions.  (c)
    -Unless otherwise agreed in writing, all disputes
    -relating to this Agreement (except any dispute relating
    -to intellectual property rights) shall be subject to
    -final and binding arbitration in Santa Clara County,
    -California under the auspices of JAMS/End Dispute, with
    -the losing party bearing all costs of such arbitration.
    -Notwithstanding the foregoing, Netscape reserves the
    -right to invoke the jurisdiction of any competent court
    -to remedy or prevent violation of any provision under
    -this Agreement relating to Netscape Confidential
    -Information.  (d) This Agreement will not be governed
    -by the United Nations Convention of Contracts for the
    -International Sale of Goods. (e) This Agreement creates
    -no agency, partnership, joint venture, or employment
    -relationship and neither Licensee nor its agents have
    -any authority to bind Netscape in any respect
    -whatsoever. (f) If the application of any provision
    -hereof to any particular facts shall be held to be
    -unenforceable by any competent court, then (x) the
    -enforceability of such provision as applied to any
    -other facts and the validity of other provisions hereof
    -shall not be affected and (y) such provision shall be
    -reformed without further action by the parties hereto
    -only to the extent necessary to make such provision
    -valid and enforceable when applied to the particular
    -facts.  (g) This Agreement constitutes the entire
    -agreement between the parties concerning the subject
    -matter hereof and supersedes all prior and
    -contemporaneous agreements, and communications, whether
    -oral or written, between the parties relating to the
    -subject matter of this Agreement and all past courses
    -of dealing or industry custom. (h) If Licensee has an
    -effective agreement with Netscape ("Prior Agreement")
    -covering only the distribution of the Localized
    -Products set forth herein, then this Agreement shall
    -supersede the Prior Agreement.  If any Prior Agreement
    -covers any Netscape products in addition to the
    -Localized Products, for example Netscape server
    -products, then this Agreement shall supersede only
    -those portions of the Prior Agreement covering the
    -Localized Products. (i) This Agreement is written in
    -the English language only, which language shall be
    -controlling in all respects. (j) Netscape reserves the
    -right to amend the terms contained in this Agreement
    -provided Licensee is given 30 days notice as set forth
    -in Section 11. (k) If any dispute arises under this
    -Agreement, the prevailing party shall be reimbursed by
    -the other party for any and all legal fees and costs
    -associated therewith. ((l) Les parties aux
    -présentés confirment leur volonté que cette
    -convention de même que tous les documents y compris
    -tout avis qui s'y rattaché, soient redigés en
    -langue anglaise (translation: The parties confirm that
    -this Agreement and all related documentation will be in
    -the English language").
    -
    -
    -
    -Universal Localization Agreement Rev. 032798
    - - - diff --git a/mozilla/base/Makefile b/mozilla/base/Makefile deleted file mode 100644 index b8eb68125f7..00000000000 --- a/mozilla/base/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = .. - -DIRS = src tests - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/base/makefile.win b/mozilla/base/makefile.win deleted file mode 100644 index 077ce4c1185..00000000000 --- a/mozilla/base/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=.. -IGNORE_MANIFEST=1 - -DIRS=src tests - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/base/src/Makefile b/mozilla/base/src/Makefile deleted file mode 100644 index 1b294cf53ad..00000000000 --- a/mozilla/base/src/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../.. - -DEFINES =-D_IMPL_NS_BASE - -LIBRARY_NAME = raptorbase - -CPPSRCS = \ - nsArena.cpp \ - nsAtomTable.cpp \ - nsBTree.cpp \ - nsByteBuffer.cpp \ - nsCRT.cpp \ - nsDeque.cpp \ - nsInputStream.cpp \ - nsRBTree.cpp \ - nsString.cpp \ - nsUnicharBuffer.cpp \ - nsUnicharInputStream.cpp \ - nsURL.cpp \ - nsVoidArray.cpp \ - $(NULL) - -EXPORTS = \ - nscore.h \ - nsBTree.h \ - nsCRT.h \ - nsDeque.h \ - nsIArena.h \ - nsIAtom.h \ - nsIByteBuffer.h \ - nsIInputStream.h \ - nsITimer.h \ - nsITimerCallback.h \ - nsIUnicharBuffer.h \ - nsIUnicharInputStream.h \ - nsIURL.h \ - nsRBTree.h \ - nsString.h \ - nsVoidArray.h \ - nsUnitConversion.h \ - $(NULL) - -MODULE = raptor - -REQUIRES = xpcom netlib raptor - -include $(DEPTH)/config/config.mk - -TARGET = $(LIBARY) - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/base/src/makefile.win b/mozilla/base/src/makefile.win deleted file mode 100644 index 2781c33247b..00000000000 --- a/mozilla/base/src/makefile.win +++ /dev/null @@ -1,77 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS = windows - -DEFINES=-D_IMPL_NS_BASE -DWIN32_LEAN_AND_MEAN -LIBRARY_NAME=raptorbase - -CPPSRCS=nsArena.cpp nsAtomTable.cpp nsBTree.cpp nsByteBuffer.cpp nsCRT.cpp \ - nsDeque.cpp nsInputStream.cpp nsRBTree.cpp nsString.cpp nsUnicharBuffer.cpp \ - nsUnicharInputStream.cpp nsURL.cpp nsVoidArray.cpp - -CPP_OBJS=.\$(OBJDIR)\nsArena.obj .\$(OBJDIR)\nsAtomTable.obj \ - .\$(OBJDIR)\nsBTree.obj .\$(OBJDIR)\nsByteBuffer.obj \ - .\$(OBJDIR)\nsCRT.obj .\$(OBJDIR)\nsDeque.obj \ - .\$(OBJDIR)\nsInputStream.obj .\$(OBJDIR)\nsRBTree.obj \ - .\$(OBJDIR)\nsString.obj \ - .\$(OBJDIR)\nsUnicharBuffer.obj .\$(OBJDIR)\nsUnicharInputStream.obj \ - .\$(OBJDIR)\nsURL.obj .\$(OBJDIR)\nsVoidArray.obj - -EXPORTS=nscore.h nsIArena.h nsIAtom.h nsIByteBuffer.h \ - nsBTree.h nsCRT.h nsDeque.h nsIInputStream.h nsITimer.h \ - nsITimerCallback.h nsIUnicharBuffer.h nsRBTree.h \ - nsIUnicharInputStream.h nsIURL.h nsString.h nsVoidArray.h \ - nsUnitConversion.h - -MODULE=raptor - -REQUIRES=xpcom netlib raptor - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\netlib \ - -I$(XPDIST)\public\raptor - -MAKE_OBJ_TYPE = DLL -DLLNAME = raptorbase -DLL=.\$(OBJDIR)\$(DLLNAME).dll - -OBJS = $(OBJS) .\$(OBJDIR)\nsTimer.obj - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -# These are the libraries we need to link with to create the dll -LLIBS= \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\libplc21.lib \ - $(DIST)\lib\netlib.lib \ - $(LIBNSPR) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib - -clobber:: - rm -f $(DIST)\bin\$(DLLNAME).dll - rm -f $(DIST)\lib\$(DLLNAME).lib diff --git a/mozilla/base/src/nsArena.cpp b/mozilla/base/src/nsArena.cpp deleted file mode 100644 index a38ef687f58..00000000000 --- a/mozilla/base/src/nsArena.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIArena.h" -#include "nsCRT.h" - -#define PL_ARENA_CONST_ALIGN_MASK 7 -#include "plarena.h" - -static NS_DEFINE_IID(kArenaIID, NS_IARENA_IID); - -// Simple arena implementation layered on plarena -class ArenaImpl : public nsIArena { -public: - ArenaImpl(PRInt32 aBlockSize); - - NS_DECL_ISUPPORTS - - virtual void* Alloc(PRInt32 aSize); - -protected: - ~ArenaImpl(); - - PLArenaPool mPool; - PRInt32 mBlockSize; -}; - -ArenaImpl::ArenaImpl(PRInt32 aBlockSize) -{ - NS_INIT_REFCNT(); - if (aBlockSize < NS_MIN_ARENA_BLOCK_SIZE) { - aBlockSize = NS_DEFAULT_ARENA_BLOCK_SIZE; - } - PL_INIT_ARENA_POOL(&mPool, "nsIArena", aBlockSize); - mBlockSize = aBlockSize; -} - -NS_IMPL_ISUPPORTS(ArenaImpl,kArenaIID) - -ArenaImpl::~ArenaImpl() -{ - PL_FinishArenaPool(&mPool); -} - -void* ArenaImpl::Alloc(PRInt32 size) -{ - // Adjust size so that it's a multiple of sizeof(double) - PRInt32 align = size & (sizeof(double) - 1); - if (0 != align) { - size += sizeof(double) - align; - } - - void* p; - PL_ARENA_ALLOCATE(p, &mPool, size); - return p; -} - -NS_BASE nsresult NS_NewHeapArena(nsIArena** aInstancePtrResult, - PRInt32 aArenaBlockSize) -{ - ArenaImpl* it = new ArenaImpl(aArenaBlockSize); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kArenaIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/base/src/nsAtomTable.cpp b/mozilla/base/src/nsAtomTable.cpp deleted file mode 100644 index 75998008cb5..00000000000 --- a/mozilla/base/src/nsAtomTable.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIAtom.h" -#include "nsString.h" -#include "nsCRT.h" -#include "plhash.h" - -/** - * The shared hash table for atom lookups. - */ -static nsrefcnt gAtoms; -static struct PLHashTable* gAtomHashTable; - -class AtomImpl : public nsIAtom { -public: - AtomImpl(); - ~AtomImpl(); - - NS_DECL_ISUPPORTS - - void* operator new(size_t size, const PRUnichar* us, PRInt32 uslen); - - virtual void ToString(nsString& aBuf) const; - - virtual const PRUnichar* GetUnicode() const; - - // Actually more; 0 terminated. This slot is reserved for the - // terminating zero. - PRUnichar mString[1]; -}; - -AtomImpl::AtomImpl() -{ - NS_INIT_REFCNT(); - // Every live atom holds a reference on the atom hashtable - gAtoms++; -} - -AtomImpl::~AtomImpl() -{ - NS_PRECONDITION(nsnull != gAtomHashTable, "null atom hashtable"); - if (nsnull != gAtomHashTable) { - PL_HashTableRemove(gAtomHashTable, mString); - nsrefcnt cnt = --gAtoms; - if (0 == cnt) { - // When the last atom is destroyed, the atom arena is destroyed - NS_ASSERTION(0 == gAtomHashTable->nentries, "bad atom table"); - PL_HashTableDestroy(gAtomHashTable); - gAtomHashTable = nsnull; - } - } -} - -static NS_DEFINE_IID(kIAtomIID, NS_IATOM_IID); -NS_IMPL_ISUPPORTS(AtomImpl, kIAtomIID); - -void* AtomImpl::operator new(size_t size, const PRUnichar* us, PRInt32 uslen) -{ - size = size + uslen * sizeof(PRUnichar); - AtomImpl* ii = (AtomImpl*) new char[size]; - nsCRT::memcpy(ii->mString, us, uslen * sizeof(PRUnichar)); - ii->mString[uslen] = 0; - return ii; -} - -void AtomImpl::ToString(nsString& aBuf) const -{ - aBuf.SetLength(0); - aBuf.Append(mString, nsCRT::strlen(mString)); -} - -const PRUnichar* AtomImpl::GetUnicode() const -{ - return mString; -} - -//---------------------------------------------------------------------- - -static PLHashNumber HashKey(const PRUnichar* k) -{ - return (PLHashNumber) nsCRT::HashCode(k); -} - -static PRIntn CompareKeys(const PRUnichar* k1, const PRUnichar* k2) -{ - return nsCRT::strcmp(k1, k2) == 0; -} - -NS_BASE nsIAtom* NS_NewAtom(const char* isolatin1) -{ - nsAutoString tmp(isolatin1); - return NS_NewAtom(tmp.GetUnicode()); -} - -NS_BASE nsIAtom* NS_NewAtom(const nsString& aString) -{ - return NS_NewAtom(aString.GetUnicode()); -} - -NS_BASE nsIAtom* NS_NewAtom(const PRUnichar* us) -{ - if (nsnull == gAtomHashTable) { - gAtomHashTable = PL_NewHashTable(8, (PLHashFunction) HashKey, - (PLHashComparator) CompareKeys, - (PLHashComparator) nsnull, - nsnull, nsnull); - } - PRInt32 uslen; - PRInt32 hashCode = nsCRT::HashCode(us, &uslen); - PLHashEntry** hep = PL_HashTableRawLookup(gAtomHashTable, hashCode, us); - PLHashEntry* he = *hep; - if (nsnull != he) { - nsIAtom* id = (nsIAtom*) he->value; - NS_ADDREF(id); - return id; - } - AtomImpl* id = new(us, uslen) AtomImpl(); - PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id); - NS_ADDREF(id); - return id; -} - -NS_BASE nsrefcnt NS_GetNumberOfAtoms(void) -{ - if (nsnull != gAtomHashTable) { - NS_PRECONDITION(nsrefcnt(gAtomHashTable->nentries) == gAtoms, "bad atom table"); - } - return gAtoms; -} diff --git a/mozilla/base/src/nsBTree.cpp b/mozilla/base/src/nsBTree.cpp deleted file mode 100644 index a771d94aaac..00000000000 --- a/mozilla/base/src/nsBTree.cpp +++ /dev/null @@ -1,403 +0,0 @@ - -/** - * This file defines the binary tree class and it - * nsNode child class. - * - * This simple version stores nodes, and the - * nodes store void* ptrs. - * - * @update gess 4/11/98 - * @param - * @return - */ - -#include "nsBTree.h" - -/** - * default constructor - * - * @update gess 4/11/98 - */ -nsNode::nsNode(){ - mLeft=0; - mRight=0; - mParent=0; - mColor=eBlack; -} - - -/** - * Copy constructor - * - * @update gess 4/11/98 - * @param - * @return - */ -nsNode::nsNode(const nsNode& aNode){ - mLeft=aNode.mLeft; - mRight=aNode.mRight; - mParent=aNode.mParent; - mColor=aNode.mColor; -} - -/** - * destructor - * - * @update gess 4/11/98 - */ -nsNode::~nsNode(){ -} - -/** - * Retrive ptr to parent node - * - * @update gess 4/11/98 - * @return ptr to parent node - */ -nsNode* nsNode::GetParentNode(void) const{ - return mParent; -} - -/** - * Retrieve ptr to left (less) node - * - * @update gess 4/11/98 - * @return ptr to left (may be NULL) - */ -nsNode* nsNode::GetLeftNode(void) const{ - return mLeft; -} - -/** - * Retrieve ptr to right (more) node - * - * @update gess 4/11/98 - * @return ptr to right node (may be NULL) - */ -nsNode* nsNode::GetRightNode(void) const{ - return mRight; -} - - -/** - * - * - * @update gess 4/11/98 - * @param - * @return - */ -nsNode& nsNode::operator=(const nsNode& aNode){ - if(this!=&aNode){ - mLeft=aNode.mLeft; - mRight=aNode.mRight; - mParent=aNode.mParent; - mColor=aNode.mColor; - } - return *this; -} - -/******************************************************** - * Here comes the BTREE class... - ********************************************************/ - -/** - * nsBTree constructor - * - * @update gess 4/11/98 - */ -nsBTree::nsBTree(){ - mRoot=0; -} - - -/** - * destructor - * - * @update gess 4/11/98 - */ -nsBTree::~nsBTree(){ - if(mRoot){ - //walk the tree and destroy the children. - } -} - -/** - * Given a node, we're supposed to add it into - * our tree. - * - * @update gess 4/11/98 - * @param aNode to be added to tree - * @return ptr to added node or NULL - */ -nsNode* nsBTree::Add(nsNode& aNode){ - PRBool result=PR_TRUE; - - nsNode* node1=mRoot; //x - nsNode* node2=0; //y - while(node1) { - node2=node1; - if(aNode<*node1) - node1=node1->mLeft; - else node1=node1->mRight; - } - aNode.mParent=node2; - if(!node2){ - mRoot=&aNode; - } - else{ - if(aNode<*node2) - node2->mLeft=&aNode; - else node2->mRight=&aNode; - } - - return &aNode; -} - - -/** - * Removes given node from tree if present. - * - * @update gess 4/11/98 - * @param aNode to be found and removed - * @return ptr to remove node, or NULL - */ -nsNode* nsBTree::Remove(nsNode& aNode){ - nsNode* result=0; - nsNode* node3=Find(aNode); - - if(node3) { - nsNode* node1; - nsNode* node2; - - if((!node3->mLeft) || (!node3->mRight)) - node2=node3; - else node2=After(*node3); - - if(node2->mLeft) - node1=node2->mLeft; - else node1=node2->mRight; - - if(node1) - node1->mParent=node2->mParent; - - if(node2->mParent) { - if(node2==node2->mParent->mLeft) - node2->mParent->mLeft=node1; - else node2->mParent->mRight=node1; - } - else mRoot=node1; - - if(node2!=node3) - (*node3)==(*node2); - - if(node2->mColor == nsNode::eBlack) - ReBalance(*node1); - - delete node2; - result=&aNode; - } - return result; -} - -/** - * Clears the tree of any data. - * Be careful here if your objects are heap based! - * This method doesn't free the objects, so if you - * don't have your own pointers, they will become - * orphaned. - * - * @update gess 4/11/98 - * @param - * @return this - */ -nsBTree& nsBTree::Empty(nsNode* aNode) { - mRoot=0; - return *this; -} - -/** - * This method destroys all the objects in the tree. - * WARNING: Never call this method on stored objects - * that are stack-based! - * - * @update gess 4/11/98 - * @param - * @return this - */ -nsBTree& nsBTree::Erase(nsNode* aNode){ - nsNode* node1 =(aNode) ? aNode : mRoot; - - if(aNode) { - Erase(aNode->mLeft); //begin by walking left side - Erase(aNode->mRight); //then search right side - delete aNode; //until a leaf, then delete - } - return *this; -} - -/** - * Retrieve ptr to first node in tree - * - * @update gess 4/11/98 - * @return - */ -nsNode* nsBTree::First(void) const{ - if(mRoot) - return First(*mRoot); - return 0; -} - -/** - * Retrive ptr to first node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to first node from given node or NULL - */ -nsNode* nsBTree::First(const nsNode& aNode) const{ - nsNode* result=0; - - if(mRoot) { - result=mRoot; - while(result->GetLeftNode()) { - result=result->GetLeftNode(); - } - } - return result; -} - -/** - * Retrive ptr to last node - * - * @update gess 4/11/98 - * @return ptr to last node rel to root or NULL - */ -nsNode* nsBTree::Last(void) const{ - if(mRoot) - return Last(*mRoot); - return 0; -} - -/** - * Retrive ptr to last node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to first node from given node or NULL - */ -nsNode* nsBTree::Last(const nsNode& aNode) const{ - nsNode* result=0; - - if(mRoot) { - result=mRoot; - while(result->GetRightNode()) { - result=result->GetRightNode(); - } - } - return result; -} - - -/** - * Retrive ptr to prior node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to prior node from given node or NULL - */ -nsNode* nsBTree::Before(const nsNode& aNode) const{ - - if(aNode.GetLeftNode()) - return Last(*aNode.GetLeftNode()); - - //otherwise... - - nsNode* node1=(nsNode*)&aNode; - nsNode* node2=aNode.GetParentNode(); - - while((node2) && (node1==node2->GetLeftNode())) { - node1=node2; - node2=node2->GetParentNode(); - } - return node2; -} - - -/** - * Retrive ptr to next node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to next node from given node or NULL - */ -nsNode* nsBTree::After(const nsNode& aNode) const{ - - if(aNode.GetRightNode()) - return First(*aNode.GetRightNode()); - - //otherwise... - - nsNode* node1=(nsNode*)&aNode; - nsNode* node2=aNode.GetParentNode(); - - while((node2) && (node1==node2->GetRightNode())) { - node1=node2; - node2=node2->GetParentNode(); - } - - return node2; -} - -/** - * Scan for given node - * - * @update gess 4/11/98 - * @param node to find - * @return ptr to given node, or NULL - */ -nsNode* nsBTree::Find(const nsNode& aNode) const{ - nsNode* result=mRoot; - - while((result) && (!(aNode==(*result)))) { - if(aNode<*result) - result=result->mLeft; - else result=result->mRight; - } - return (nsNode*)result; -} - -/** - * Rebalances tree around the given node. This only - * needs to be called after a node is deleted. - * This method does nothing for btrees, but is - * needed for RBTrees. - * - * @update gess 4/11/98 - * @param aNode -- node to balance around - * @return this - */ -nsBTree& nsBTree::ReBalance(nsNode& aNode){ - return *this; -} - - -/** - * - * - * @update gess 4/11/98 - * @param - * @return - */ -const nsBTree& nsBTree::ForEach(nsNodeFunctor& aFunctor,nsNode* aNode) const{ - nsNode* node1 =(aNode) ? aNode : mRoot; - - if(node1) { - if(node1->mLeft) - ForEach(aFunctor,node1->mLeft); //begin by walking left side - aFunctor(*node1); - if(node1->mRight) - ForEach(aFunctor,node1->mRight); //then search right side - } - return *this; -} - diff --git a/mozilla/base/src/nsBTree.h b/mozilla/base/src/nsBTree.h deleted file mode 100644 index 62b79b8b654..00000000000 --- a/mozilla/base/src/nsBTree.h +++ /dev/null @@ -1,283 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/** - * This file defines the binary tree class and it - * nsNode child class. Note that like all nsBTree - * containers, this one does not automatically balance. - * (Find for random data, bad for pre-ordered data). - * - * This simple version stores nodes, and the - * nodes store void* ptrs. - * - * @update gess 4/11/98 - */ - - -/** - * nsNode - * - * @update gess 4/11/98 - * @param - * @return - */ - -#ifndef _BTREE_H -#define _BTREE_H - -#include "nscore.h" - -struct NS_BASE nsNode { - - /** - * - * @update gess4/20/98 - * @param - * @return - */ - nsNode(); - - /** - * Copy constructor - * @update gess 4/11/98 - */ - nsNode(const nsNode& aNode); - - /** - * destructor - * @update gess 4/11/98 - */ - virtual ~nsNode(); - - /** - * Retrieve parent node - * - * @update gess 4/11/98 - * @return - */ - nsNode* GetParentNode(void) const; - - /** - * - * @update gess 4/11/98 - * @param - * @return - */ - nsNode* GetLeftNode() const; - - /** - * - * @update gess 4/11/98 - * @param - * @return - */ - nsNode* GetRightNode() const; - - /** - * - * @update gess 4/11/98 - * @param - * @return - */ - virtual nsNode& operator=(const nsNode& aNode); - - - /** - * This method gets called to determine which of - * two nodes is less. When you create your own - * subclass of nsNode, this is the most important - * method for you to overload. - * - * @update gess 4/11/98 - * @param - * @return - */ - virtual PRBool operator<(const nsNode& aNode) const=0; - - /** - * This method gets called to determine which of - * two nodes is less. When you create your own - * subclass of nsNode, this is the most important - * method for you to overload. - * - * @update gess 4/11/98 - * @param - * @return - */ - virtual PRBool operator==(const nsNode& aNode) const=0; - - enum eRBColor {eRed,eBlack}; - - nsNode* mParent; - nsNode* mLeft; - nsNode* mRight; - eRBColor mColor; -}; - -/** - * The Nodefunctor class is used when you want to create - * callbacks between the nsRBTree and your generic code. - * - * @update gess4/20/98 - */ -class NS_BASE nsNodeFunctor { -public: - virtual nsNodeFunctor& operator()(nsNode& aNode)=0; -}; - - -/**************************************************** - * Here comes the nsBTree class... - ****************************************************/ - -class NS_BASE nsBTree { -public: -friend class nsBTreeIterator; - - nsBTree(); - ~nsBTree(); - - /** - * Add given node reference into our tree. - * - * @update gess 4/11/98 - * @param aNode is a ref to a node to be added - * @return newly added node - */ - nsNode* Add(nsNode& aNode); - - /** - * Remove given node reference into our tree. - * - * @update gess 4/11/98 - * @param aNode is a ref to a node to be removed - * @return Ptr to node if found (and removed) or NULL - */ - nsNode* Remove(nsNode& aNode); - - /** - * Clears the tree of any data. - * Be careful here if your objects are heap based! - * This method doesn't free the objects, so if you - * don't have your own pointers, they will become - * orphaned. - * - * @update gess 4/11/98 - * @param - * @return this - */ - nsBTree& Empty(nsNode* aNode=0); - - /** - * This method destroys all the objects in the tree. - * WARNING: Never call this method on stored objects - * that are stack-based! - * - * @update gess 4/11/98 - * @param - * @return this - */ - nsBTree& Erase(nsNode* aNode=0); - - /** - * Retrieve ptr to 1st node in tree (starting at root) - * - * @update gess 4/11/98 - * @return ptr to 1st node, possible to be NULL - */ - nsNode* First(void) const; - - /** - * Find first node in tree starting at given node - * - * @update gess 4/11/98 - * @param aNode node to begin 1st search from - * @return ptr to 1st node below given node - */ - nsNode* First(const nsNode& aNode) const; - - /** - * Retrieve ptr to last node in tree relative to root. - * - * @update gess 4/11/98 - * @return ptr to last node or NULL - */ - nsNode* Last(void) const; - - /** - * Retrieve ptr to last node in tree relative to given node. - * - * @update gess 4/11/98 - * @param node to find last node from - * @return ptr to last node or NULL - */ - nsNode* Last(const nsNode& aNode) const; - - /** - * Retrieve a ptr to the node that preceeds given node - * - * @update gess 4/11/98 - * @param aNode used as reference to find prev. - * @return ptr to prev node or NULL - */ - nsNode* Before(const nsNode& aNode) const; - - /** - * Retrieve a ptr to the node after given node - * - * @update gess 4/11/98 - * @param aNode used as reference to find next. - * @return ptr to next node or NULL - */ - nsNode* After(const nsNode& aNode) const; - - /** - * Find given node in tree. - * (Why would you want to find a node you already have?) - * - * @update gess 4/11/98 - * @param aNode is the node you're searching for - * @return ptr to node if found, or NULL - */ - nsNode* Find(const nsNode& aNode) const; - - /** - * Walks the tree, starting with root. - * - * @update gess 4/11/98 - */ - virtual const nsBTree& ForEach(nsNodeFunctor& aFunctor,nsNode* aNode=0) const; - -protected: - - /** - * Rebalances tree around the given node. This only - * needs to be called after a node is deleted. - * - * @update gess 4/11/98 - * @param aNode -- node to balance around - * @return this - */ - virtual nsBTree& ReBalance(nsNode& aNode); - - - nsNode* mRoot; -}; - -#endif - diff --git a/mozilla/base/src/nsByteBuffer.cpp b/mozilla/base/src/nsByteBuffer.cpp deleted file mode 100644 index a27f8cbf2c9..00000000000 --- a/mozilla/base/src/nsByteBuffer.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIByteBuffer.h" -#include "nsIInputStream.h" -#include "nsCRT.h" - -#define MIN_BUFFER_SIZE 32 - -class ByteBufferImpl : public nsIByteBuffer { -public: - ByteBufferImpl(PRInt32 aBufferSize); - ~ByteBufferImpl(); - - NS_DECL_ISUPPORTS - virtual PRInt32 GetLength() const; - virtual PRInt32 GetBufferSize() const; - virtual char* GetBuffer() const; - virtual PRBool Grow(PRInt32 aNewSize); - virtual PRInt32 Fill(PRInt32* aErrorCode, nsIInputStream* aStream, - PRInt32 aKeep); - - char* mBuffer; - PRInt32 mSpace; - PRInt32 mLength; -}; - -ByteBufferImpl::ByteBufferImpl(PRInt32 aBufferSize) -{ - if (PRUint32(aBufferSize) < MIN_BUFFER_SIZE) { - aBufferSize = MIN_BUFFER_SIZE; - } - mSpace = aBufferSize; - mBuffer = new char[aBufferSize]; - mLength = 0; - NS_INIT_REFCNT(); -} - -NS_DEFINE_IID(kByteBufferIID,NS_IBYTE_BUFFER_IID); -NS_IMPL_ISUPPORTS(ByteBufferImpl,kByteBufferIID) - -ByteBufferImpl::~ByteBufferImpl() -{ - if (nsnull != mBuffer) { - delete mBuffer; - mBuffer = nsnull; - } - mLength = 0; -} - -PRInt32 ByteBufferImpl::GetLength() const -{ - return mLength; -} - -PRInt32 ByteBufferImpl::GetBufferSize() const -{ - return mSpace; -} - -char* ByteBufferImpl::GetBuffer() const -{ - return mBuffer; -} - -PRBool ByteBufferImpl::Grow(PRInt32 aNewSize) -{ - if (PRUint32(aNewSize) < MIN_BUFFER_SIZE) { - aNewSize = MIN_BUFFER_SIZE; - } - char* newbuf = new char[aNewSize]; - if (nsnull != newbuf) { - if (0 != mLength) { - nsCRT::memcpy(newbuf, mBuffer, mLength); - } - delete mBuffer; - mBuffer = newbuf; - return PR_TRUE; - } - return PR_FALSE; -} - -PRInt32 ByteBufferImpl::Fill(PRInt32* aErrorCode, nsIInputStream* aStream, - PRInt32 aKeep) -{ - NS_PRECONDITION(nsnull != aStream, "null stream"); - NS_PRECONDITION(PRUint32(aKeep) <= PRUint32(mLength), "illegal keep count"); - if ((nsnull == aStream) || (PRUint32(aKeep) > PRUint32(mLength))) { - // whoops - *aErrorCode = NS_INPUTSTREAM_ILLEGAL_ARGS; - return -1; - } - - if (0 != aKeep) { - // Slide over kept data - nsCRT::memmove(mBuffer, mBuffer + (mLength - aKeep), aKeep); - } - - // Read in some new data - mLength = aKeep; - PRInt32 amount = mSpace - aKeep; - PRInt32 nb = aStream->Read(aErrorCode, mBuffer, aKeep, amount); - if (nb > 0) { - mLength += nb; - } - return nb; -} - -NS_BASE nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult, - nsISupports* aOuter, - PRInt32 aBufferSize) -{ - if (nsnull != aOuter) { - return NS_ERROR_NO_AGGREGATION; - } - ByteBufferImpl* it = new ByteBufferImpl(aBufferSize); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kByteBufferIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/base/src/nsCRT.cpp b/mozilla/base/src/nsCRT.cpp deleted file mode 100644 index c4ac141a2ad..00000000000 --- a/mozilla/base/src/nsCRT.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCRT.h" - -// XXX Bug: These tables don't lowercase the upper 128 characters properly - -// This table maps uppercase characters to lower case characters; -// characters that are neither upper nor lower case are unaffected. -static const unsigned char kUpper2Lower[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, - - // upper band mapped to lower [A-Z] => [a-z] - 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static const unsigned char kLower2Upper[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, - - // lower band mapped to upper [a-z] => [A-Z] - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - - 123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static const PRUnichar kIsoLatin1ToUCS2[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -//---------------------------------------------------------------------- - -#define TOLOWER(_ucs2) \ - (((_ucs2) < 256) ? PRUnichar(kUpper2Lower[_ucs2]) : _ToLower(_ucs2)) - -#define TOUPPER(_ucs2) \ - (((_ucs2) < 256) ? PRUnichar(kLower2Upper[_ucs2]) : _ToUpper(_ucs2)) - -static PRUnichar _ToLower(PRUnichar aChar) -{ - // XXX need i18n code here - return aChar; -} - -static PRUnichar _ToUpper(PRUnichar aChar) -{ - // XXX need i18n code here - return aChar; -} - -//---------------------------------------------------------------------- - -PRUnichar nsCRT::ToUpper(PRUnichar aChar) -{ - return TOUPPER(aChar); -} - -PRUnichar nsCRT::ToLower(PRUnichar aChar) -{ - return TOLOWER(aChar); -} - -PRInt32 nsCRT::strlen(const PRUnichar* s) -{ - PRInt32 len = 0; - while (*s++ != 0) { - len++; - } - return len; -} - -PRInt32 nsCRT::strcmp(const PRUnichar* s1, const PRUnichar* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -// characters following a null character are not compared -PRInt32 nsCRT::strncmp(const PRUnichar* s1, const PRUnichar* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const PRUnichar* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const PRUnichar* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strcmp(const PRUnichar* s1, const char* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strncmp(const PRUnichar* s1, const char* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const char* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const char* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::HashCode(const PRUnichar* us) -{ - PRInt32 rv = 0; - PRUnichar ch; - while ((ch = *us++) != 0) { - // FYI: rv = rv*37 + ch - rv = ((rv << 5) + (rv << 2) + rv) + ch; - } - return rv; -} - -PRInt32 nsCRT::HashCode(const PRUnichar* us, PRInt32* uslenp) -{ - PRInt32 rv = 0; - PRInt32 len = 0; - PRUnichar ch; - while ((ch = *us++) != 0) { - // FYI: rv = rv*37 + ch - rv = ((rv << 5) + (rv << 2) + rv) + ch; - len++; - } - *uslenp = len; - return rv; -} - -PRInt32 nsCRT::atoi( const PRUnichar *string ) -{ - return atoi(string); -} - diff --git a/mozilla/base/src/nsCRT.h b/mozilla/base/src/nsCRT.h deleted file mode 100644 index a14ed2bbcb5..00000000000 --- a/mozilla/base/src/nsCRT.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCRT_h___ -#define nsCRT_h___ - -#include -#include -#include "plstr.h" -#include "nscore.h" - -/// This is a wrapper class around all the C runtime functions. - -class NS_BASE nsCRT { -public: - /** Copy bytes from aSrc to aDest. - @param aDest the destination address - @param aSrc the source address - @param aCount the number of bytes to copy - */ - static void memcpy(void* aDest, const void* aSrc, PRInt32 aCount) { - ::memcpy(aDest, aSrc, (size_t)aCount); - } - - static void memmove(void* aDest, const void* aSrc, PRInt32 aCount) { - ::memmove(aDest, aSrc, (size_t)aCount); - } - - static void memset(void* aDest, PRUint8 aByte, PRInt32 aCount) { - ::memset(aDest, aByte, aCount); - } - - static void zero(void* aDest, PRInt32 aCount) { - ::memset(aDest, 0, (size_t)aCount); - } - - /** Compute the string length of s - @param s the string in question - @return the length of s - */ - static PRInt32 strlen(const char* s) { - return PRInt32(::strlen(s)); - } - - /// Compare s1 and s2. - static PRInt32 strcmp(const char* s1, const char* s2) { - return PRInt32(PL_strcmp(s1, s2)); - } - - /// Case-insensitive string comparison. - static PRInt32 strcasecmp(const char* s1, const char* s2) { - return PRInt32(PL_strcasecmp(s1, s2)); - } - - /// Like strlen except for ucs2 strings - static PRInt32 strlen(const PRUnichar* s); - - /// Like strcmp except for ucs2 strings - static PRInt32 strcmp(const PRUnichar* s1, const PRUnichar* s2); - /// Like strcmp except for ucs2 strings - static PRInt32 strncmp(const PRUnichar* s1, const PRUnichar* s2, - PRInt32 aMaxLen); - - /// Like strcasecmp except for ucs2 strings - static PRInt32 strcasecmp(const PRUnichar* s1, const PRUnichar* s2); - /// Like strncasecmp except for ucs2 strings - static PRInt32 strncasecmp(const PRUnichar* s1, const PRUnichar* s2, - PRInt32 aMaxLen); - - /// Like strcmp with a char* and a ucs2 string - static PRInt32 strcmp(const PRUnichar* s1, const char* s2); - /// Like strncmp with a char* and a ucs2 string - static PRInt32 strncmp(const PRUnichar* s1, const char* s2, - PRInt32 aMaxLen); - - /// Like strcasecmp with a char* and a ucs2 string - static PRInt32 strcasecmp(const PRUnichar* s1, const char* s2); - /// Like strncasecmp with a char* and a ucs2 string - static PRInt32 strncasecmp(const PRUnichar* s1, const char* s2, - PRInt32 aMaxLen); - - /// Compute a hashcode for a ucs2 string - static PRInt32 HashCode(const PRUnichar* s1); - - /// Same as above except that we return the length in s1len - static PRInt32 HashCode(const PRUnichar* s1, PRInt32* s1len); - - /// String to integer. - static PRInt32 atoi( const PRUnichar *string ); - - static PRUnichar ToUpper(PRUnichar aChar); - - static PRUnichar ToLower(PRUnichar aChar); -}; - -#endif /* nsCRT_h___ */ diff --git a/mozilla/base/src/nsDeque.cpp b/mozilla/base/src/nsDeque.cpp deleted file mode 100644 index aa7ca4e027c..00000000000 --- a/mozilla/base/src/nsDeque.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - - -#include "nsDeque.h" - -/** - * Standard constructor - * @update gess4/18/98 - * @return new deque - */ -nsDeque::nsDeque(PRBool aOwnsMemory) { - mOwnsMemory=aOwnsMemory; - mCapacity=eGrowthDelta; - mOrigin=mSize=0; - mData=new void*[mCapacity]; -} - - -/** - * Destructor - * @update gess4/18/98 - */ -nsDeque::~nsDeque() { - if(mOwnsMemory) - Erase(); - delete [] mData; - mData=0; - mOwnsMemory=PR_FALSE; -} - - -/** - * Returns the number of elements currently stored in - * this deque. - * - * @update gess4/18/98 - * @param - * @return int contains element count - */ -PRInt32 nsDeque::GetSize(void) const { - return mSize; -} - -/** - * Remove all items from container without destroying them. - * - * @update gess4/18/98 - * @param - * @return - */ -nsDeque& nsDeque::Empty() { - for(int i=0;i0) { - result=mData[mOrigin]; - mData[mOrigin++]=0; //zero it out for debugging purposes. - mSize--; - if(0==mSize) - mOrigin=0; - } - return result; -} - -/** - * Call this to retrieve the ith element from this container. - * Keep in mind that accessing the underlying elements is - * done in a relative fashion. Object 0 is not necessarily - * the first element (the first element is at mOrigin). - * - * @update gess4/18/98 - * @param anIndex : 0 relative offset of item you want - * @return void* or null - */ -void* nsDeque::ObjectAt(PRInt32 anIndex) const { - void* result=0; - - if((anIndex>=0) && (anIndexoperator==(anIter)); -} - - -/** - * Compare 2 iterators for equivalence. - * - * @update gess4/18/98 - * @param anIter is the other iterator to be compared to - * @return TRUE if EQUAL - */ -PRBool nsDequeIterator::operator<(nsDequeIterator& anIter) { - return PRBool(((mIndex=(nsDequeIterator& anIter) { - return PRBool(((mIndex>=anIter.mIndex) && (&mDeque==&anIter.mDeque))); -} - -/** - * Pre-increment operator - * - * @update gess4/18/98 - * @return object at preincremented index - */ -void* nsDequeIterator::operator++() { - return mDeque.ObjectAt(++mIndex); -} - -/** - * Post-increment operator - * - * @update gess4/18/98 - * @param param is ignored - * @return object at post-incremented index - */ -void* nsDequeIterator::operator++(int) { - return mDeque.ObjectAt(mIndex++); -} - -/** - * Pre-decrement operator - * - * @update gess4/18/98 - * @return object at pre-decremented index - */ -void* nsDequeIterator::operator--() { - return mDeque.ObjectAt(--mIndex); -} - -/** - * Post-decrement operator - * - * @update gess4/18/98 - * @param param is ignored - * @return object at post-decremented index - */ -void* nsDequeIterator::operator--(int) { - return mDeque.ObjectAt(mIndex--); -} - -/** - * Dereference operator - * - * @update gess4/18/98 - * @return object at ith index - */ -void* nsDequeIterator::GetCurrent(void) { - return mDeque.ObjectAt(mIndex); -} - -/** - * Call this method when you wanto to iterate all the - * members of the container, passing a functor along - * to call your code. - * - * @update gess4/20/98 - * @param aFunctor object to call for each member - * @return *this - */ -const nsDequeIterator& nsDequeIterator::ForEach(nsDequeFunctor& aFunctor) const{ - mDeque.ForEach(aFunctor); - return *this; -} - - -/** - * conduct automated self test for this class - * - * @update gess4/18/98 - * @param - * @return - */ -void nsDeque::SelfTest(void) { -#undef _SELFTEST_DEQUE -#ifdef _SELFTEST_DEQUE -#include - - { - nsDeque theDeque(PR_FALSE); //construct a simple one... - - int ints[10]={100,200,300,400,500,600,700,800,900,1000}; - int count=sizeof(ints)/sizeof(int); - - for(int i=0;i
    -Broken tags are shown, only if no gt sign can be found.
    -
    -
    -ccccccc
    -
    \ No newline at end of file
    diff --git a/mozilla/htmlparser/tests/html/pre015.html b/mozilla/htmlparser/tests/html/pre015.html
    deleted file mode 100644
    index f07de01c753..00000000000
    --- a/mozilla/htmlparser/tests/html/pre015.html
    +++ /dev/null
    @@ -1,18 +0,0 @@
    -The following is copied from test tag005.html
    -first line -
    empty brakets are displayed as text -This -and this eat next br tag. -and another one. -Last text. -
    Now wrapped with a PRE tag. -
    -first line
    -
    empty brakets are displayed as text -This -and this eat next br tag. -and another one. -Last text. -
    \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/pre016.html b/mozilla/htmlparser/tests/html/pre016.html deleted file mode 100644 index cfd595dce40..00000000000 --- a/mozilla/htmlparser/tests/html/pre016.html +++ /dev/null @@ -1,17 +0,0 @@ -The following is copied from test tag006.html
    -first line -
    invalide tags are ignored by 4.0 - - - -Note: no line break here. - -
    Now wrapped with a PRE tag. -
    -first line
    -
    invalide tags are ignored by 4.0 -
    - - -Note: no line break here. - \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/q001.html b/mozilla/htmlparser/tests/html/q001.html deleted file mode 100644 index e7cd998188b..00000000000 --- a/mozilla/htmlparser/tests/html/q001.html +++ /dev/null @@ -1,18 +0,0 @@ - - -test BLOCKQUOTE and Q tag - - -test BLOCKQUOTE and Q tag
    -1normal text in body line 1. -
    -A This text is in blockquote -
    B line 2 -
    -2normal text in body line 2. - -this text is in Q tag - -3normal text in body line 3. - - diff --git a/mozilla/htmlparser/tests/html/quote001.html b/mozilla/htmlparser/tests/html/quote001.html deleted file mode 100644 index 6b591b9193c..00000000000 --- a/mozilla/htmlparser/tests/html/quote001.html +++ /dev/null @@ -1,51 +0,0 @@ - - - HTML test for quoted string - - - - This was created on 9/12/97, for Xena bug # 85121 -
    Testing the quoted value string. -
    tag A is used so you can check the string by moving mouse on the link. -
    use view source or text editor to compare with browser display. - -
    The goal is to be compatible with Navigator 4.0 -
    Test results are compared with Nav4.0 display. Relavent Nav4.0 source - files are ns\lib\libparse\pa_parse.c and others. -
    Differences between 4.0 and xena are indecated. Search for XENA60 - to find all the defferences. - -

    comments from ns\xena\lego\src\lego\html\scanner\HTMLScanner.java: -
    // For quoted value string : -
    // Double/single quote only take effect as the first char -
    // of the value string, -
    // Quoted string is terminated by the second double/single quote -
    // respectively. -
    // In other places, double/single quote is treated literally. -
    // Entity & quot; is always treated literally, enven it is the -
    // first char. -
    // -
    // Unquoted value string is terminated by while space, or '>' sign. -

    - - Test lines: - -
    10(quote / quote ) good syntax: both quotes striped from string -
    20( / ) value not quoted, not recommented, but still good syntax. -
    30 - Navigator 4.0 value string trunketed at 82 characters XENA60 limit is MAX_STRING_LENGTH = 2000. - -
    40 The following are illegal HTML, but handled by Nav4.0 in different ways. -
    50( / ) string not quoted, whight space terminates the value -
    60( / ) string not quoted, CR terminates the string -
    70(escaped-quote / quote ) both quotes remain in string -
    80(quote / ) - move mouse on this. If we didn't have a quote in the text, the value string would - run through the end of the A tag. -
    90(quote / escaped-quote ) same as above, escaped quote does NOT terminate quote -
    100( / quote) if no opening quote, quotes are included in string -
    110( / quote) no opening quote, value terminated at right brack - - - diff --git a/mozilla/htmlparser/tests/html/quote002.html b/mozilla/htmlparser/tests/html/quote002.html deleted file mode 100644 index 2873a8c8fe8..00000000000 --- a/mozilla/htmlparser/tests/html/quote002.html +++ /dev/null @@ -1,33 +0,0 @@ - - - HTML test for quoted string - - - - This was created on 9/15/97, for Xena bug # 85121 -
    Testing the quoted value string. -
    tag A is used so you can check the string by moving mouse on the link. -
    use view source or text editor to compare with browser display. -
    10 2 quoted string stick together -
    20 2 quoted string seperated by space -
    30 Navigator doesn't support nested quote. -
    40 quoted string can have escaped quote. -
    50 unquoted string can have escaped quote. -
    60 unquoted string can have other entities. -
    70 entity missing ';', ended by > -
    80 entity missing ';', not treated as entity inside a value word. -
    90 ending entity with a space, missing ';', value terminated. -
    100 ending entity with a '=', missing ';', value not terminated. -
    110 unquoted script is treated as text. -
    120 Navigator 4.0 does not support script - entity in quoted string. - - -
    130 this is fisrt quote " and second quote " in text area. -
    140 this is fisrt escaped-quote " and second escaped-quote " in text area. - -
    -
    In the following test line, quote is the last char in the html file. -
    Navigator 4.0 displace the line as text. -
    XENA60 appends a closing quote and display it as link with empty href="". -
    150 - - - -Test SPAN001 - - - - -

    -In HTML standard, SPANs are not allowed to cross Paragraphs. -
    In Vav4.0, SPAN tags go thour paragraphs and other block-level elements, -except tbles. -
    It be compatable with Nav4.0 and HTML standard, HTMLParser -close all SPANs before open a new paragraph, and reopen SPANs -inside the new paragraph -
    - - - Text ater the color=red SPAN is opend. -

    - Text in a new paragraph. -

    -

    - Text after the new paragrapg is closed, still in color=red SPAN. - -
    -Text ater the color=red SPAN is closed. - - diff --git a/mozilla/htmlparser/tests/html/span002.html b/mozilla/htmlparser/tests/html/span002.html deleted file mode 100644 index 5f3c497ff84..00000000000 --- a/mozilla/htmlparser/tests/html/span002.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Test SPAN001 - - - - -Normal text - -Text after the color=red SPAN is opend. -

    - Text in a new paragraph. -

    - Text after the new paragrapg is closed, still in color=red SPAN. - -Text ater the color=red SPAN is closed. -
    another line. - - diff --git a/mozilla/htmlparser/tests/html/span003.html b/mozilla/htmlparser/tests/html/span003.html deleted file mode 100644 index c4ea303d8c9..00000000000 --- a/mozilla/htmlparser/tests/html/span003.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - -Test SPAN001 - - - - -

    - - bold - italic - B closed(but actualy it closed the last span tag, which is I tag. - I closed - - diff --git a/mozilla/htmlparser/tests/html/strike002.html b/mozilla/htmlparser/tests/html/strike002.html deleted file mode 100644 index 65d505d595a..00000000000 --- a/mozilla/htmlparser/tests/html/strike002.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Nested STRIKE - - -nested STRIKE
    -1normal text in body line 1. - -A This text is in STRIKE - -
    B line 2 in STRIKE -
    -C line 3 in STRIKE -
    -2normal text in body line 2. - - diff --git a/mozilla/htmlparser/tests/html/strike005.html b/mozilla/htmlparser/tests/html/strike005.html deleted file mode 100644 index 4040627aca8..00000000000 --- a/mozilla/htmlparser/tests/html/strike005.html +++ /dev/null @@ -1,22 +0,0 @@ - - -strikeover a whole TABLE - - -strikeover a whole TABLE, no visual effect, no strikeover on text in table
    -1normal text in body line 1. - -text with strikeover -

    - - -
    This is the first cell in the table - This is the second cell in the table -
    This is the third cell in the table - This is the fourth cell in the table -
    -text still inside strikeover. - -2normal text in body line 2. - - diff --git a/mozilla/htmlparser/tests/html/strike006.html b/mozilla/htmlparser/tests/html/strike006.html deleted file mode 100644 index 979198c12b3..00000000000 --- a/mozilla/htmlparser/tests/html/strike006.html +++ /dev/null @@ -1,18 +0,0 @@ - - -strikeover in a table cell TD - - -strikeover in a table cell TD
    -1normal text in body line 1. - - - -
    This is the first cell in the table - This is strikeover -
    This is the third cell in the table - This is the fourth cell in the table -
    -2normal text in body line 2. - - diff --git a/mozilla/htmlparser/tests/html/strike007.html b/mozilla/htmlparser/tests/html/strike007.html deleted file mode 100644 index eaa80db9961..00000000000 --- a/mozilla/htmlparser/tests/html/strike007.html +++ /dev/null @@ -1,20 +0,0 @@ - - -strikeover a whole table cell TD - - -strikeover a whole table cell TD -1normal text in body line 1. - - - - - -
    This is the first cell in the table - - This cell is in strikeover
    This is the third cell in the table - This is the fourth cell in the table -
    -2normal text in body line 2. - - diff --git a/mozilla/htmlparser/tests/html/strike008.html b/mozilla/htmlparser/tests/html/strike008.html deleted file mode 100644 index cc95b6ebf47..00000000000 --- a/mozilla/htmlparser/tests/html/strike008.html +++ /dev/null @@ -1,26 +0,0 @@ - - -strikeover cross scope with a table - - -

    strikeover cross scope with a table
    -It starts before table, but ends inside table. -
    It does not effect the table, but the strikeover is terminated after the table. -
    1normal text in body line 1. - -text in strikeover. - - - - - -
    This is the first cell in the table - This cell 2
    This is the third cell in the table - This is the fourth cell in the table -
    -

    -text not in strikeover - -
    2normal text in body line 2. - - diff --git a/mozilla/htmlparser/tests/html/table05a.html b/mozilla/htmlparser/tests/html/table05a.html deleted file mode 100644 index a6df8ca395e..00000000000 --- a/mozilla/htmlparser/tests/html/table05a.html +++ /dev/null @@ -1,14 +0,0 @@ -Caption before end of table -
    Nav 4.0: caption is accepted. (terminate tr) -
    Xena6.0: ignore misplaced caption tag. - - - - - -
    cell 1-1 - cell 1-2 -
    cell 2-1 - cell 2-2
    caption1
    - -last text diff --git a/mozilla/htmlparser/tests/html/table05b.html b/mozilla/htmlparser/tests/html/table05b.html deleted file mode 100644 index e05836f3ee2..00000000000 --- a/mozilla/htmlparser/tests/html/table05b.html +++ /dev/null @@ -1,14 +0,0 @@ -Caption after tr. -
    Nav 4.0: caption is accepted, terminate an empty tr, -
    Xena6.0: ignore misplaced caption tag. - - - taxeA - -
    caption1
    cell 1-1 - cell 1-2 -
    cell 2-1 - cell 2-2 -
    - -last text diff --git a/mozilla/htmlparser/tests/html/table05c.html b/mozilla/htmlparser/tests/html/table05c.html deleted file mode 100644 index 1b55afcc3a5..00000000000 --- a/mozilla/htmlparser/tests/html/table05c.html +++ /dev/null @@ -1,14 +0,0 @@ -Caption between table cell -
    Nav 4.0: caption is accepted, terminate tr, -
    Xena6.0: ignore misplaced caption tag. - - - - textA - -
    cell 1-1
    caption1
    cell 1-2 -
    cell 2-1 - cell2-2 -
    - -last text diff --git a/mozilla/htmlparser/tests/html/table05d.html b/mozilla/htmlparser/tests/html/table05d.html deleted file mode 100644 index 3144e70f146..00000000000 --- a/mozilla/htmlparser/tests/html/table05d.html +++ /dev/null @@ -1,13 +0,0 @@ -Caption inside cell -
    Nav 4.0: caption is accepted, terminates both td and tr. -
    Xena6.0: ignore misplaced caption tag. - - - textA - -
    cell 1-1
    caption1
    cell 1-2 -
    cell 2-1 - cell 2-2 -
    - -last text diff --git a/mozilla/htmlparser/tests/html/table05k.html b/mozilla/htmlparser/tests/html/table05k.html deleted file mode 100644 index d05228d0811..00000000000 --- a/mozilla/htmlparser/tests/html/table05k.html +++ /dev/null @@ -1,19 +0,0 @@ -Table in caption works. - - - -
    caption1
    text1 text2 - - - -
    cell 1-1 - cell 1-2 -
    still in - caption -
    -
    cell 2-1-1 - cell 2-1-2 -
    cell 2-2-1 -
    - -last text diff --git a/mozilla/htmlparser/tests/html/table05l.html b/mozilla/htmlparser/tests/html/table05l.html deleted file mode 100644 index c7dbd30c4e9..00000000000 --- a/mozilla/htmlparser/tests/html/table05l.html +++ /dev/null @@ -1,14 +0,0 @@ -Table in caption, and Nav4.0 show blank page if the window is wide. -Table in caption is part of the caption, leave the table body empty. - - - -
    caption1
    text1 text2 - - - -
    cell 1-1 - cell 1-2 -
    cell 2-1 - cell 2-2 -
    - -Nev. 4.0 ignore empty tables. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/table05m.html b/mozilla/htmlparser/tests/html/table05m.html deleted file mode 100644 index 18c01e22dfa..00000000000 --- a/mozilla/htmlparser/tests/html/table05m.html +++ /dev/null @@ -1,5 +0,0 @@ -Start table tag alone is ignored. - - - -last text diff --git a/mozilla/htmlparser/tests/html/table05n.html b/mozilla/htmlparser/tests/html/table05n.html deleted file mode 100644 index 83aede59060..00000000000 --- a/mozilla/htmlparser/tests/html/table05n.html +++ /dev/null @@ -1,11 +0,0 @@ -End table tag terminates caption and table. -
    -
    caption1
    text1 text2 -
    -
    cell1 -
    cell2 -
    - -last text diff --git a/mozilla/htmlparser/tests/html/table05o.html b/mozilla/htmlparser/tests/html/table05o.html deleted file mode 100644 index 34fa22e5fd1..00000000000 --- a/mozilla/htmlparser/tests/html/table05o.html +++ /dev/null @@ -1,6 +0,0 @@ -caption is not shown for empty table. - - -
    caption1
    text1 text2
    - -last text diff --git a/mozilla/htmlparser/tests/html/table07.html b/mozilla/htmlparser/tests/html/table07.html deleted file mode 100644 index 64a0edfbe9c..00000000000 --- a/mozilla/htmlparser/tests/html/table07.html +++ /dev/null @@ -1,13 +0,0 @@ -text1 - text2 - - - -
    cell 1-1 - cell 1-2 -
    still in - caption -
    -text3 -
    -last text diff --git a/mozilla/htmlparser/tests/html/table200.html b/mozilla/htmlparser/tests/html/table200.html deleted file mode 100644 index e43c788bf7b..00000000000 --- a/mozilla/htmlparser/tests/html/table200.html +++ /dev/null @@ -1,21 +0,0 @@ -Table in table, but not in tr-td. -
    the outter table is ignored. - - -
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -This is the first cell in table2. - - -NOTE, even no line break here! -
    -Caption of outer table is ignored. -Data of outer table is treated as text. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/table201.html b/mozilla/htmlparser/tests/html/table201.html deleted file mode 100644 index 62e9665d5e8..00000000000 --- a/mozilla/htmlparser/tests/html/table201.html +++ /dev/null @@ -1,22 +0,0 @@ -Table in table, but not in tr-td. -
    the outter table is ignored. - - - -
    caption of table2.
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -This is the first cell in table2. - - -NOTE, even no line break here! -
    -Caption of outer table is ignored. -Data of outer table is treated as text. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/table202.html b/mozilla/htmlparser/tests/html/table202.html deleted file mode 100644 index 5f5c81afdcf..00000000000 --- a/mozilla/htmlparser/tests/html/table202.html +++ /dev/null @@ -1,23 +0,0 @@ -Table in table, after tr, but not td. -
    the outter table and tr are ignored. - - - - -
    caption of table2.
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -This is the first cell in table2. - - -NOTE, even no line break here! -
    -Caption of outer table is ignored. -Data of outer table is treated as text. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/table203.html b/mozilla/htmlparser/tests/html/table203.html deleted file mode 100644 index 8d0075d53ef..00000000000 --- a/mozilla/htmlparser/tests/html/table203.html +++ /dev/null @@ -1,29 +0,0 @@ -Table nested 3 levels, table3 be the out most. -
    Table 1 is not in table2's tr-td. That makes table2 invalid. -
    Table3 is still valid, and table2's tr and td are used for -table3. - - - - - -
    caption of table3.
    - - - Text after table2, not in tr-td, but in table3's tr-td. -
    caption of table2.
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in the table1 - fourth cell in the table1 -
    -
    first cell in table2, but displayed in table 3. -
    - - second cell in table3. but table2's end tag closed table3. - So, this will be displayed out of table3. - - diff --git a/mozilla/htmlparser/tests/html/table204.html b/mozilla/htmlparser/tests/html/table204.html deleted file mode 100644 index 0842245cc02..00000000000 --- a/mozilla/htmlparser/tests/html/table204.html +++ /dev/null @@ -1,23 +0,0 @@ -nested table missing end td. -
    Nav. 4.0(bug): For inner table td does NOT terminate previous td. -
    Xena 6.0: end td is always optional. - - - - - -
    caption of table1.
    cell 1-1 - cell 1-2 -
    cell 1-3 - cell 1-4 - - - - -
    caption of table2.
    cell1 in table2 - cell2 in table2 -
    cell3 in table2 - cell4 in table2 -
    -
    -
    Last text. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/table205.html b/mozilla/htmlparser/tests/html/table205.html deleted file mode 100644 index 905659196c3..00000000000 --- a/mozilla/htmlparser/tests/html/table205.html +++ /dev/null @@ -1,28 +0,0 @@ -Table in table, but not in tr-td. -
    The only thing missing is the end tag of the -first table! -Nav. 4.0: the outter table is ignored. -Xena 6.0: second table start tag is ignored. Contents put in 1 table. - - - - - - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - - - -
    caption of table2.
    cell1 in table2 - cell2 in table2 -
    cell3 in table2 - cell4 in table2 -
    - -
    Last text. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/tableall.html b/mozilla/htmlparser/tests/html/tableall.html deleted file mode 100644 index 0381ca289ca..00000000000 --- a/mozilla/htmlparser/tests/html/tableall.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    table test cases
    Test case description -
    good syntax
    -
    table01.html <table> <tr> <td> -
    table02.html <table> <tr> <td> <table> nested -
    table03.html <table border align=left> -
    table04.html <table> mixed with list. - -
    table05 The correct position for Caption is after table start tag. - - -
    bad syntax
    -
    *table05a Caption before </table>. 4.0: Accepted, 6.0: ignored. -
    *table05b Caption after tr. 4.0: Accepted, 6.0: ignored. -
    *table05c Caption between table cell. 4.0: Accepted, 6.0: ignored. -
    *table05d Caption inside cell. 4.0: terminates both td and tr. 6.0: Ignored. -
    table05e Multiple caption outside cells. 4.0 takes first as Caption, others as text. -
    *table05f Captions inside cells, 4.0 takes last one, terminate td tr, 6.0 Ignore misplaced tag. -
    table05g Captions outside of table are treated as text. -
    table05h tr terminates caption -
    table05i tr terminates Caption, and close open(font) tags in caption. -
    table05j TD does NOT terminate Caption. TD's contents are used in caption. -
    table05k Table in caption works. -
    table05l Table in caption, table empty. 4.0(bug): shows blank page. -
    table05m <table> alone is ignored. -
    table05n </table> terminates caption and table. -
    table05o caption is not shown for empty table.
    table110.htm <tr> <td> missing <table> -
    table115.htm <table> text1 <tr> test2 <td> test3 -
    table120.htm <table> </table> table totally empty . -
    table125.htm <table> text </table>, no tr, td -
    table130.htm <table> <td> , missing tr -
    table135.htm <table> <tr> <tr> <td> , empty tr. -
    table140.htm <table> <tr> text <tr> <td> , empty tr. -
    table150.htm <table> <tr> <td> <td> , empty td. - -
    table201.html <table> <table> -
    table202.html <table> <tr> <table> -
    table203.html Table nested 3 levels, T1 not in T2's td -
    *table204.htm nested table missing end td. 4.0(bug) inner table need </td> -
    *table205.htm table in table. 4.0: discard outer, 6.0: put into 1 table. -
    - - diff --git a/mozilla/htmlparser/tests/html/tag001.html b/mozilla/htmlparser/tests/html/tag001.html deleted file mode 100644 index dd2b5698dca..00000000000 --- a/mozilla/htmlparser/tests/html/tag001.html +++ /dev/null @@ -1,3 +0,0 @@ -first line -second line -third line < \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/tag002.html b/mozilla/htmlparser/tests/html/tag002.html deleted file mode 100644 index 5083bee2948..00000000000 --- a/mozilla/htmlparser/tests/html/tag002.html +++ /dev/null @@ -1,23 +0,0 @@ -Broken tags are shown, only if no gt sign can be found. - - -aaaaaaaaaaaa - - -bbbbbbbb - -< - -open tag without name, stat with space, treated as text. -
    -KKKKKKKKKK - -< open tag has no tag name, stat with space, treated as text. -
    -ccccccc - -second line -

    Here is next paragraph. -
    -They ignored by 4,0. -Everything between the brakets is consummed. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/tag004.html b/mozilla/htmlparser/tests/html/tag004.html deleted file mode 100644 index 00b6cc77073..00000000000 --- a/mozilla/htmlparser/tests/html/tag004.html +++ /dev/null @@ -1,4 +0,0 @@ -first line -
    empty brakets are displayed as text -<> -more text. diff --git a/mozilla/htmlparser/tests/html/tag005.html b/mozilla/htmlparser/tests/html/tag005.html deleted file mode 100644 index cb46e427796..00000000000 --- a/mozilla/htmlparser/tests/html/tag005.html +++ /dev/null @@ -1,7 +0,0 @@ -first line -
    empty brakets are displayed as text -This -and this eat next br tag. -and another one. -Last text. diff --git a/mozilla/htmlparser/tests/html/tag006.html b/mozilla/htmlparser/tests/html/tag006.html deleted file mode 100644 index 36d3dcc0d02..00000000000 --- a/mozilla/htmlparser/tests/html/tag006.html +++ /dev/null @@ -1,6 +0,0 @@ -first line -
    invalide tags are ignored by 4.0 - - - -Note: no line break here. diff --git a/mozilla/htmlparser/tests/html/tag007.html b/mozilla/htmlparser/tests/html/tag007.html deleted file mode 100644 index 596b5484dc5..00000000000 --- a/mozilla/htmlparser/tests/html/tag007.html +++ /dev/null @@ -1,5 +0,0 @@ -first line -
    Unmacthed opening tag in next line is ignored by 4.0 - -
    -Note: no line break inserted here. diff --git a/mozilla/htmlparser/tests/html/tag008.html b/mozilla/htmlparser/tests/html/tag008.html deleted file mode 100644 index 6b67931e732..00000000000 --- a/mozilla/htmlparser/tests/html/tag008.html +++ /dev/null @@ -1,4 +0,0 @@ -first line -
    Unmacthed end tag in next line is ignored by 4.0 -
    -Note: no line break inserted here. diff --git a/mozilla/htmlparser/tests/html/target01.html b/mozilla/htmlparser/tests/html/target01.html deleted file mode 100644 index 44c34fdbb29..00000000000 --- a/mozilla/htmlparser/tests/html/target01.html +++ /dev/null @@ -1,7 +0,0 @@ - -Target outside of quoted HREF. -
    example: -
    -two days - - \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/tbody001.html b/mozilla/htmlparser/tests/html/tbody001.html deleted file mode 100644 index d639a01c606..00000000000 --- a/mozilla/htmlparser/tests/html/tbody001.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Welcome to Netscape - - -
    - - - - - -
    - table element with no attributes. The required embedded - elements are used - TBODY-TR-TD. -
    - - diff --git a/mozilla/htmlparser/tests/html/text001.html b/mozilla/htmlparser/tests/html/text001.html deleted file mode 100644 index 55c4e5ee38e..00000000000 --- a/mozilla/htmlparser/tests/html/text001.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Welcome to Netscape - - -Text-001 - - diff --git a/mozilla/htmlparser/tests/html/text002.html b/mozilla/htmlparser/tests/html/text002.html deleted file mode 100644 index 68b070ca308..00000000000 --- a/mozilla/htmlparser/tests/html/text002.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Welcome to Netscape - - -Text-002 - - diff --git a/mozilla/htmlparser/tests/html/text003.html b/mozilla/htmlparser/tests/html/text003.html deleted file mode 100644 index aa1f7ae9ccc..00000000000 --- a/mozilla/htmlparser/tests/html/text003.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -Welcome to Netscape - - -Text-001 -
    -
    -Text after closing font tag. - - diff --git a/mozilla/htmlparser/tests/html/thead001.html b/mozilla/htmlparser/tests/html/thead001.html deleted file mode 100644 index b517ea769be..00000000000 --- a/mozilla/htmlparser/tests/html/thead001.html +++ /dev/null @@ -1,25 +0,0 @@ -Normal case for thead, tfoot, tbody - - - - - - - - - - - - - - - - - -
    caption of table2.
    text in thead
    text in tfoot
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -last text. \ No newline at end of file diff --git a/mozilla/htmlparser/tests/html/title01.html b/mozilla/htmlparser/tests/html/title01.html deleted file mode 100644 index c6404098244..00000000000 --- a/mozilla/htmlparser/tests/html/title01.html +++ /dev/null @@ -1,6 +0,0 @@ - - -<!-- still in comment --> - -some text - diff --git a/mozilla/htmlparser/tests/html/usascii.html b/mozilla/htmlparser/tests/html/usascii.html deleted file mode 100644 index 834856339d0..00000000000 --- a/mozilla/htmlparser/tests/html/usascii.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Juan Gotoh's Visual Workshop - - - - - - - - - - - - -<BODY> - -<P>If your brouser can not display frame, please click -<A HREF="home_E.html">here.</A> it has same contents as frame -version.</P> - -</BODY> - - diff --git a/mozilla/htmlparser/tests/html/utf8001.html b/mozilla/htmlparser/tests/html/utf8001.html deleted file mode 100644 index 017a3d7c652..00000000000 --- a/mozilla/htmlparser/tests/html/utf8001.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Welcome to Netscape - - -Text-001 - - diff --git a/mozilla/htmlparser/tests/html/value001.html b/mozilla/htmlparser/tests/html/value001.html deleted file mode 100644 index 55c926e7eb7..00000000000 --- a/mozilla/htmlparser/tests/html/value001.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - -Welcome to Netscape - - - - - - - - - diff --git a/mozilla/htmlparser/tests/html/xmp005.html b/mozilla/htmlparser/tests/html/xmp005.html deleted file mode 100644 index ac952f5b849..00000000000 --- a/mozilla/htmlparser/tests/html/xmp005.html +++ /dev/null @@ -1,48 +0,0 @@ - - -use a XMP tag for C or JAVA source code. -
    The lt and gt signes are problematic. - - - - cc = 123; - // test lt - if( cc < hhh ) { - if(cc<xxx || as > gh) { - //do womthing here; - } - } - if( cc <= iii ) { - if(cc<=yyy) { - //do womthing here; - } - } - // test gt - if( cc > rrr ) { - if(cc>eee) { - //do womthing here; - } - } - if( cc >= www ) { - if(cc>=qqq) { - //do womthing here; - } - } - // what if the variable name is a valid tag name. - if( cc < B && cc > kk ) { - if(cc<B && cc > gg) { - //do womthing here; - } - } - cc = aa<<I; - cc = B>>3; - gt = true; - for(a=0,gt=true; (a>0)&&gt; a++) { - } - a = 0x0004; - lt = 0x0002; - for(; a&lt; ) { - } - - - \ No newline at end of file diff --git a/mozilla/htmlparser/tests/windows/Selftest.cpp b/mozilla/htmlparser/tests/windows/Selftest.cpp deleted file mode 100644 index 0660fc576ba..00000000000 --- a/mozilla/htmlparser/tests/windows/Selftest.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include -#include -#include -#include -#include -#include - -#include "nsScanner.h" -#include "nsTokenizer.h" -#include "nsHTMLDelegate.h" - - -bool compareFiles(const char* file1,const char* file2) { - bool result=true; - bool done=false; - char ch1,ch2; - int eof1,eof2; - - ifstream input1(file1,ios::in && ios::binary,filebuf::openprot); - ifstream input2(file2,ios::in && ios::binary,filebuf::openprot); - - while(!done) { - - while(!(eof1=input1.eof())) { - input1.read(&ch1,1); - if(('\n'!=ch1) && (' '!=ch1)) - break; - } - - while(!(eof2=input2.eof())) { - input2.read(&ch2,1); - if(('\n'!=ch2) && (' '!=ch2)) - break; - } - - if(eof1==eof2) { - if(eof1) - done=true; - else if(ch1!=ch2) { - done=true; - result=false; - } - } - else done=true; - } - return result; -} - -void parseFile (const char* aFilename,int size) -{ - //debug - aFilename="s:\\ns\\raptor\\parser\\tests\\html\\tag001.html"; - //aFilename="c:\\temp\\temp.html"; - - char filename[_MAX_PATH]; - strcpy(filename,aFilename); - strcat(filename,".tokens"); - { - ofstream out(filename); - ifstream input(aFilename); - CScanner scanner(input); - CHTMLTokenizerDelegate delegate; - CTokenizer tokenizer(scanner,delegate); - tokenizer.tokenize(); - tokenizer.debugDumpSource(out); - } - cout << aFilename; - if(compareFiles(aFilename,filename)) - cout << " PASS " << endl; - else cout << " FAIL" << endl; -} - -int walkDirectoryTree(char* aPath) { - int result=0; - char fullPath[_MAX_PATH]; - struct _finddata_t c_file; - long hFile; - - strcpy(fullPath,aPath); - strcat(fullPath,"\\*.*"); - /* Find first .c file in current directory */ - if((hFile = _findfirst( fullPath, &c_file )) == -1L ) - printf( "No matching files in current directory!\n" ); - else { - - bool done=false; - while(!done) { - if(c_file.attrib & _A_SUBDIR) { - if(strlen(c_file.name)>2){ - char newPath[_MAX_PATH]; - strcpy(newPath,aPath); - strcat(newPath,"\\"); - strcat(newPath,c_file.name); - walkDirectoryTree(newPath); - } - } - else { - int len=strlen(c_file.name); - if(len>5) { - if(0==strnicmp(&c_file.name[len-5],".HTML",5)) { - char filepath[_MAX_PATH]; - strcpy(filepath,aPath); - strcat(filepath,"\\"); - strcat(filepath,c_file.name); - parseFile(filepath,c_file.size); - } - } - } - if(_findnext( hFile, &c_file )!=0) - done=true; - } - _findclose( hFile ); - } - return 0; -} - -int main(int argc, char* argv []) -{ - int result=0; - char buffer[_MAX_PATH]; - - if(argc==2) - strcpy(buffer,argv[1]); - else _getcwd(buffer,_MAX_PATH); - walkDirectoryTree(buffer); - return 0; -} - - - diff --git a/mozilla/layout/Makefile b/mozilla/layout/Makefile deleted file mode 100644 index 58defa2a298..00000000000 --- a/mozilla/layout/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = .. - -DIRS = base html build - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/base/Makefile b/mozilla/layout/base/Makefile deleted file mode 100644 index 4135f9605a8..00000000000 --- a/mozilla/layout/base/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -DIRS = public src tests - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/base/makefile.win b/mozilla/layout/base/makefile.win deleted file mode 100644 index c08fab64fd1..00000000000 --- a/mozilla/layout/base/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS=public src tests - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp deleted file mode 100644 index 93535dd8ec9..00000000000 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ /dev/null @@ -1,785 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCSSRendering.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIImage.h" -#include "nsIFrame.h" -#include "nsPoint.h" -#include "nsRect.h" -#include "nsIViewManager.h" -#include "nsIPresShell.h" - -#define BORDER_FULL 0 //entire side -#define BORDER_INSIDE 1 //inside half -#define BORDER_OUTSIDE 2 //outside half - -//thickness of dashed line relative to dotted line -#define DOT_LENGTH 1 //square -#define DASH_LENGTH 3 //3 times longer than dot - -/** - * Special method to brighten a Color and have it shift to white when - * fully saturated. - */ -nscolor nsCSSRendering::Brighten(nscolor inColor) -{ - PRIntn r, g, b, max, over; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color increase across the board - r += 25; - g += 25; - b += 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we overflowed on this max color, increase - //other components by the overflow amount - if (max > 255) - { - over = max - 255; - - if (max == r) - { - g += over; - b += over; - } - else if (max == g) - { - r += over; - b += over; - } - else - { - r += over; - g += over; - } - } - - //clamp - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - -/** - * Special method to darken a Color and have it shift to black when - * darkest component underflows - */ -nscolor nsCSSRendering::Darken(nscolor inColor) -{ - PRIntn r, g, b, max; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color decrease across the board - r -= 25; - g -= 25; - b -= 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we underflowed on this max color, decrease - //other components by the underflow amount - if (max < 0) - { - if (max == r) - { - g += max; - b += max; - } - else if (max == g) - { - r += max; - b += max; - } - else - { - r += max; - g += max; - } - } - - //clamp - if (r < 0) - r = 0; - if (g < 0) - g = 0; - if (b < 0) - b = 0; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - -/** - * Make a bevel color - */ -nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style, - nscolor baseColor) -{ - nscolor theColor = baseColor; - - if ((style == NS_STYLE_BORDER_STYLE_OUTSET) || - (style == NS_STYLE_BORDER_STYLE_RIDGE)) { - // Flip colors for these two border style - switch (whichSide) { - case NS_SIDE_BOTTOM: whichSide = NS_SIDE_TOP; break; - case NS_SIDE_RIGHT: whichSide = NS_SIDE_LEFT; break; - case NS_SIDE_TOP: whichSide = NS_SIDE_BOTTOM; break; - case NS_SIDE_LEFT: whichSide = NS_SIDE_RIGHT; break; - } - } - - switch (whichSide) { - case NS_SIDE_BOTTOM: - theColor = Brighten(Brighten(baseColor)); - break; - case NS_SIDE_RIGHT: - theColor = Brighten(baseColor); - break; - case NS_SIDE_TOP: - theColor = Darken(Darken(baseColor)); - break; - case NS_SIDE_LEFT: - theColor = Darken(baseColor); - break; - } - return theColor; -} - -// Maximum poly points in any of the polygons we generate below -#define MAX_POLY_POINTS 4 - -// a nifty helper function to create a polygon representing a -// particular side of a border. This helps localize code for figuring -// mitered edges. It is mainly used by the solid, inset, and outset -// styles... -PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[], - nsIRenderingContext& aContext, - PRIntn whichSide, - const nsRect& inside, const nsRect& outside, - PRIntn borderPart, float borderFrac) -{ - float borderRest = 1.0f - borderFrac; - - // XXX QQQ We really should decide to do a bevel based on whether there - // is a side adjacent or not. This could let you join borders across - // block elements (paragraphs). - - PRIntn np = 0; - switch (whichSide) { - case NS_SIDE_TOP: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(inside.x, inside.y); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(inside.x, inside.y); - } else { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - } - break; - - case NS_SIDE_LEFT: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(inside.x, inside.y); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(outside.x, outside.YMost()); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(inside.x, inside.y); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - } else { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - aPoints[np++].MoveTo(outside.x, outside.YMost()); - } - break; - - case NS_SIDE_BOTTOM: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(outside.x, outside.YMost()); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - } else { - aPoints[np++].MoveTo(outside.x, outside.YMost()); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - } - break; - - case NS_SIDE_RIGHT: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - } else { - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - } - break; - } - return np; -} - -void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, - PRIntn whichSide, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside) -{ - nsPoint theSide[MAX_POLY_POINTS]; - nscolor theColor = borderColors[whichSide]; - PRUint8 theStyle = borderStyles[whichSide]; - PRInt32 np; - switch (theStyle) { - case NS_STYLE_BORDER_STYLE_NONE: - case NS_STYLE_BORDER_STYLE_BLANK: - return; - - case NS_STYLE_BORDER_STYLE_DOTTED: //handled a special case elsewhere - case NS_STYLE_BORDER_STYLE_DASHED: //handled a special case elsewhere - break; // That was easy... - - case NS_STYLE_BORDER_STYLE_GROOVE: - case NS_STYLE_BORDER_STYLE_RIDGE: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_INSIDE, 0.5f); - aContext.SetColor ( MakeBevelColor (whichSide, theStyle, theColor)); - aContext.FillPolygon (theSide, np); - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_OUTSIDE, 0.5f); - aContext.SetColor ( MakeBevelColor (whichSide, - (theStyle == NS_STYLE_BORDER_STYLE_RIDGE) - ? NS_STYLE_BORDER_STYLE_GROOVE - : NS_STYLE_BORDER_STYLE_RIDGE, theColor)); - aContext.FillPolygon (theSide, np); - break; - - case NS_STYLE_BORDER_STYLE_SOLID: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_FULL, 1.0f); - aContext.SetColor (borderColors[whichSide]); - aContext.FillPolygon (theSide, np); - break; - - case NS_STYLE_BORDER_STYLE_DOUBLE: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_INSIDE, 0.333333f); - aContext.SetColor (borderColors[whichSide]); - aContext.FillPolygon (theSide, np); - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_OUTSIDE, 0.333333f); - aContext.FillPolygon (theSide, np); - break; - - case NS_STYLE_BORDER_STYLE_OUTSET: - case NS_STYLE_BORDER_STYLE_INSET: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_FULL, 1.0f); - aContext.SetColor ( MakeBevelColor (whichSide, theStyle, theColor)); - aContext.FillPolygon (theSide, np); - break; - } -} - -/** - * Draw a dotted/dashed sides of a box - */ -//XXX dashes which span more than two edges are not handled properly MMP -void nsCSSRendering::DrawDashedSides(PRIntn startSide, - nsIRenderingContext& aContext, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside, - PRIntn aSkipSides) -{ - PRIntn dashLength; - nsRect dashRect, firstRect, currRect; - - PRBool bSolid = PR_TRUE; - float over = 0.0f; - PRUint8 style = borderStyles[startSide]; - PRBool skippedSide = PR_FALSE; - for (PRIntn whichSide = startSide; whichSide < 4; whichSide++) { - PRUint8 prevStyle = style; - style = borderStyles[whichSide]; - if ((1< 0.0f) { - firstRect.x = dashRect.x; - firstRect.width = dashRect.width; - firstRect.height = nscoord(dashRect.height * over); - firstRect.y = dashRect.y + (dashRect.height - firstRect.height); - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.YMost() > borderInside.y) { - //clip if necessary - if (currRect.y < borderInside.y) { - over = float(borderInside.y - dashRect.y) / - float(dashRect.height); - currRect.height = currRect.height - (borderInside.y - currRect.y); - currRect.y = borderInside.y; - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.y = dashRect.y - currRect.height; - currRect = dashRect; - } - break; - - case NS_SIDE_TOP: - //if we are continuing a solid rect, fill in the corner first - if (bSolid) { - aContext.FillRect(borderOutside.x, borderOutside.y, - borderInside.x - borderOutside.x, - borderInside.y - borderOutside.y); - } - - dashRect.height = borderInside.y - borderOutside.y; - dashRect.width = dashRect.height * dashLength; - dashRect.x = borderInside.x; - dashRect.y = borderOutside.y; - - if (over > 0.0f) { - firstRect.x = dashRect.x; - firstRect.y = dashRect.y; - firstRect.width = nscoord(dashRect.width * over); - firstRect.height = dashRect.height; - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.x < borderInside.XMost()) { - //clip if necessary - if (currRect.XMost() > borderInside.XMost()) { - over = float(dashRect.XMost() - borderInside.XMost()) / - float(dashRect.width); - currRect.width = currRect.width - - (currRect.XMost() - borderInside.XMost()); - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.x = dashRect.x + currRect.width; - currRect = dashRect; - } - break; - - case NS_SIDE_RIGHT: - //if we are continuing a solid rect, fill in the corner first - if (bSolid) { - aContext.FillRect(borderInside.XMost(), borderOutside.y, - borderOutside.XMost() - borderInside.XMost(), - borderInside.y - borderOutside.y); - } - - dashRect.width = borderOutside.XMost() - borderInside.XMost(); - dashRect.height = nscoord(dashRect.width * dashLength); - dashRect.x = borderInside.XMost(); - dashRect.y = borderInside.y; - - if (over > 0.0f) { - firstRect.x = dashRect.x; - firstRect.y = dashRect.y; - firstRect.width = dashRect.width; - firstRect.height = nscoord(dashRect.height * over); - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.y < borderInside.YMost()) { - //clip if necessary - if (currRect.YMost() > borderInside.YMost()) { - over = float(dashRect.YMost() - borderInside.YMost()) / - float(dashRect.height); - currRect.height = currRect.height - - (currRect.YMost() - borderInside.YMost()); - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.y = dashRect.y + currRect.height; - currRect = dashRect; - } - break; - - case NS_SIDE_BOTTOM: - //if we are continuing a solid rect, fill in the corner first - if (bSolid) { - aContext.FillRect(borderInside.XMost(), borderInside.YMost(), - borderOutside.XMost() - borderInside.XMost(), - borderOutside.YMost() - borderInside.YMost()); - } - - dashRect.height = borderOutside.YMost() - borderInside.YMost(); - dashRect.width = nscoord(dashRect.height * dashLength); - dashRect.x = borderInside.XMost() - dashRect.width; - dashRect.y = borderInside.YMost(); - - if (over > 0.0f) { - firstRect.y = dashRect.y; - firstRect.width = nscoord(dashRect.width * over); - firstRect.height = dashRect.height; - firstRect.x = dashRect.x + (dashRect.width - firstRect.width); - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.XMost() > borderInside.x) { - //clip if necessary - if (currRect.x < borderInside.x) { - over = float(borderInside.x - dashRect.x) / float(dashRect.width); - currRect.width = currRect.width - (borderInside.x - currRect.x); - currRect.x = borderInside.x; - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.x = dashRect.x - currRect.width; - currRect = dashRect; - } - break; - } - } - skippedSide = PR_FALSE; - } -} - -// XXX improve this to constrain rendering to the damaged area -void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - nsIFrame* aForFrame, - const nsRect& aDirtyRect, - const nsRect& aBounds, - const nsStyleBorder& aStyle, - PRIntn aSkipSides) -{ - const nsMargin& border = aStyle.mSize; - if ((0 == border.left) && (0 == border.right) && - (0 == border.top) && (0 == border.bottom)) { - // Empty border area - return; - } - - nsRect inside(0, 0, aBounds.width, aBounds.height); - nsRect outside(inside); - outside.Deflate(border); - - //see if any sides are dotted or dashed - for (PRIntn cnt = 0; cnt < 4; cnt++) { - if ((aStyle.mStyle[cnt] == NS_STYLE_BORDER_STYLE_DOTTED) || - (aStyle.mStyle[cnt] == NS_STYLE_BORDER_STYLE_DASHED)) { - break; - } - } - if (cnt < 4) { - // Draw the dashed/dotted lines first - DrawDashedSides(cnt, aRenderingContext, aStyle.mStyle, - aStyle.mColor, inside, outside, - aSkipSides); - } - - // Draw all the other sides - if (0 == (aSkipSides & (1<NeedsBlend()) { - if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { - aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height); - } - } -#endif - - // Convert image dimensions into nscoord's - float p2t = aPresContext.GetPixelsToTwips(); - nscoord tileWidth = nscoord(p2t * image->GetWidth()); - nscoord tileHeight = nscoord(p2t * image->GetHeight()); - - PRIntn repeat = aColor.mBackgroundRepeat; - PRIntn xcount, ycount; - switch (aColor.mBackgroundRepeat) { - case NS_STYLE_BG_REPEAT_OFF: - default: - xcount = 0; - ycount = 0; - break; - case NS_STYLE_BG_REPEAT_X: - xcount = (PRIntn) (aBounds.width / tileWidth); - ycount = 0; - break; - case NS_STYLE_BG_REPEAT_Y: - xcount = 0; - ycount = (PRIntn) (aBounds.height / tileHeight); - break; - case NS_STYLE_BG_REPEAT_XY: - xcount = (PRIntn) (aBounds.width / tileWidth); - ycount = (PRIntn) (aBounds.height / tileHeight); - break; - } - - // Tile the background - nscoord xpos = 0, ypos = 0; - nscoord xpos0 = 0; -#if XXX - // XXX support offset positioning - PRIntn xPos = aColor.mBackgroundXPosition; - PRIntn yPos = aColor.mBackgroundXPosition; -#endif - aRenderingContext.PushState(); - aRenderingContext.SetClipRect(aDirtyRect, PR_TRUE); - PRIntn x, y; - for (y = 0; y <= ycount; ++y, ypos += tileHeight) { - for (x = 0, xpos = xpos0; x <= xcount; ++x, xpos += tileWidth) { - aRenderingContext.DrawImage(image, xpos, ypos); - } - } - aRenderingContext.PopState(); - } else { - if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { - // XXX This step can be avoided if we have an image and it doesn't - // have any transparent pixels and the image is tiled in both - // the x and the y - aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height); - } - } -} diff --git a/mozilla/layout/base/nsCSSRendering.h b/mozilla/layout/base/nsCSSRendering.h deleted file mode 100644 index 09181f85aef..00000000000 --- a/mozilla/layout/base/nsCSSRendering.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSRendering_h___ -#define nsCSSRendering_h___ - -#include "nsIRenderingContext.h" -#include "nsIStyleContext.h" -struct nsPoint; - -class nsCSSRendering { -public: - /** - * Render the border for an element using css rendering rules - * for borders. aSkipSides is a bitmask of the sides to skip - * when rendering. If 0 then no sides are skipped. - */ - static void PaintBorder(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - nsIFrame* aForFrame, - const nsRect& aDirtyRect, - const nsRect& aBounds, - const nsStyleBorder& aStyle, - PRIntn aSkipSides); - - /** - * Render the background for an element using css rendering rules - * for backgrounds. - */ - static void PaintBackground(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - nsIFrame* aForFrame, - const nsRect& aDirtyRect, - const nsRect& aBounds, - const nsStyleColor& aColor); - - /** - * Special method to brighten a Color and have it shift to white when - * fully saturated. - */ - static nscolor Brighten(nscolor inColor); - - /** - * Special method to darken a Color and have it shift to black when - * darkest component underflows - */ - static nscolor Darken(nscolor inColor); - -protected: - static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style, - nscolor baseColor); - - static PRIntn MakeSide(nsPoint aPoints[], - nsIRenderingContext& aContext, - PRIntn whichSide, - const nsRect& inside, const nsRect& outside, - PRIntn borderPart, float borderFrac); - - static void DrawSide(nsIRenderingContext& aContext, - PRIntn whichSide, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside); - - static void DrawDashedSides(PRIntn startSide, - nsIRenderingContext& aContext, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside, - PRIntn aSkipSides); -}; - -#endif /* nsCSSRendering_h___ */ diff --git a/mozilla/layout/base/nsIPresShell.h b/mozilla/layout/base/nsIPresShell.h deleted file mode 100644 index 7a88f3d12c6..00000000000 --- a/mozilla/layout/base/nsIPresShell.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIPresShell_h___ -#define nsIPresShell_h___ - -#include "nslayout.h" -#include "nsIDocumentObserver.h" -#include "nsCoord.h" -class nsIContent; -class nsIDocument; -class nsIFrame; -class nsIPresContext; -class nsIStyleSet; -class nsIViewManager; -class nsReflowCommand; - -#define NS_IPRESSHELL_IID \ -{ 0x76e79c60, 0x944e, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -/** - * Presentation shell interface. Presentation shells are the - * controlling point for managing the presentation of a document. The - * presentation shell holds a live reference to the document, the - * presentation context, the style manager, the style set and the root - * frame.

    - * - * When this object is Release'd, it will release the document, the - * presentation context, the style manager, the style set and the root - * frame. - */ -class nsIPresShell : public nsIDocumentObserver { -public: - virtual nsresult Init(nsIDocument* aDocument, - nsIPresContext* aPresContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet) = 0; - - virtual nsIDocument* GetDocument() = 0; - - virtual nsIPresContext* GetPresContext() = 0; - - virtual nsIViewManager * GetViewManager() = 0; - - virtual nsIStyleSet* GetStyleSet() = 0; - - // Make shell be a document observer - virtual void BeginObservingDocument() = 0; - - // Make shell stop being a document observer - virtual void EndObservingDocument() = 0; - - /** - * Reflow the frame model into a new width and height. The - * coordinates for aWidth and aHeight must be in standard nscoord's. - */ - virtual void ResizeReflow(nscoord aWidth, nscoord aHeight) = 0; - - virtual nsIFrame* GetRootFrame() = 0; - - virtual nsIFrame* FindFrameWithContent(nsIContent* aContent) = 0; - - virtual void AppendReflowCommand(nsReflowCommand* aReflowCommand) = 0; - - virtual void ProcessReflowCommands() = 0; - - /** - * Place some cached data into the shell's cache. The key for - * the cache is the given frame. - */ - virtual void PutCachedData(nsIFrame* aKeyFrame, void* aData) = 0; - - virtual void* GetCachedData(nsIFrame* aKeyFrame) = 0; - - virtual void* RemoveCachedData(nsIFrame* aKeyFrame) = 0; - - // XXX events - // XXX selection -}; - -/** - * Create a new empty presentation shell. Upon success, call Init - * before attempting to use the shell. - */ -extern NS_LAYOUT nsresult - NS_NewPresShell(nsIPresShell** aInstancePtrResult); - -#endif /* nsIPresShell_h___ */ diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp deleted file mode 100644 index 47f3bd99801..00000000000 --- a/mozilla/layout/base/nsPresContext.cpp +++ /dev/null @@ -1,471 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPresContext.h" -#include "nsIPresShell.h" -#include "nsILinkHandler.h" -#include "nsIStyleContext.h" -#include "nsIStyleSet.h" -#include "nsIFontMetrics.h" -#include "nsIImageManager.h" -#include "nsIImageGroup.h" -#include "nsIImageRequest.h" -#include "nsIImageObserver.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsIFrame.h" -#include "nsIRenderingContext.h" -#include "nsTransform2D.h" -#include "nsIDocument.h" -#include "nsIURL.h" -#include "nsString.h" - -static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); - -#if 0 -// XXX this code needs to move far away from here -static nsIImageManager* gImageManager = nsnull; -static void InitImageLibrary() -{ - // Initialize image library - if (NS_OK == NS_NewImageManager(&gImageManager)) { - if (NS_OK == gImageManager->Init()) { - gImageManager->SetCacheSize(1024*1024); - return; - } - } - printf("can't initialize image library\n"); -} -// XXX end code with no home... -#endif - -class ImageLoader : public nsIImageRequestObserver { -public: - ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame); - ~ImageLoader(); - - NS_DECL_ISUPPORTS - - void LoadImage(const nsString& aURL); - - const nsString& GetURL() const { - return mURL; - } - - nsIImage* GetImage() { - return mImage; - } - - PRInt32 FrameCount(); - - PRBool RemoveFrame(nsIFrame* aFrame); - - void AddFrame(nsIFrame* aFrame); - - void UpdateFrames(); - - virtual void Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3); - - virtual void NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType); - - nsVoidArray mFrames; - nsString mURL; - nsPresContext* mCX; - nsIImage* mImage; - nsIImageRequest* mImageRequest; - nsIImageGroup* mImageGroup; - - PRInt32 mWidth, mHeight; // in pixels -}; - -ImageLoader::ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, - nsIFrame* aFrame) -{ - mCX = aCX; - AddFrame(aFrame); - mImage = nsnull; - mImageRequest = nsnull; - mImageGroup = aGroup; NS_ADDREF(aGroup); - mWidth = -1; - mHeight = -1; -} - -ImageLoader::~ImageLoader() -{ - if (nsnull != mImageRequest) { - mImageRequest->Interrupt(); - mImageRequest->RemoveObserver(this); - } -} - -void ImageLoader::LoadImage(const nsString& aURL) -{ - if (nsnull == mImage) { - // Save url - mURL.SetLength(0); - mURL.Append(aURL); - - // Start image load - char* cp = aURL.ToNewCString(); - mImageRequest = mImageGroup->GetImage(cp, this, NS_RGB(255,255,255), - 0, 0, 0); - delete cp; - } -} - -static NS_DEFINE_IID(kIImageRequestObserver, NS_IIMAGEREQUESTOBSERVER_IID); - -NS_IMPL_ISUPPORTS(ImageLoader, kIImageRequestObserver); - -static PRBool gXXXInstalledColorMap; -void ImageLoader::Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3) -{ - switch (aNotificationType) { - case nsImageNotification_kDimensions: -#ifdef NOISY - printf("Image:%d x %d\n", aParam1, aParam2); -#endif - mWidth = aParam1; - mHeight = aParam2; - break; - - case nsImageNotification_kPixmapUpdate: - case nsImageNotification_kImageComplete: - case nsImageNotification_kFrameComplete: - if ((mImage == nsnull) && (nsnull != aImage)) { - mImage = aImage; - NS_ADDREF(aImage); - } - UpdateFrames(); - } -} - -PRInt32 ImageLoader::FrameCount() -{ - return mFrames.Count(); -} - -PRBool ImageLoader::RemoveFrame(nsIFrame* aFrame) -{ - return mFrames.RemoveElement(aFrame); -} - -void ImageLoader::AddFrame(nsIFrame* aFrame) -{ - PRInt32 i, n = mFrames.Count(); - for (i = 0; i < n; i++) { - nsIFrame* frame = (nsIFrame*) mFrames.ElementAt(i); - if (frame == aFrame) { - return; - } - } - mFrames.AppendElement(aFrame); -} - -void ImageLoader::UpdateFrames() -{ - PRInt32 i, n = mFrames.Count(); - for (i = 0; i < n; i++) { - nsIFrame* frame = (nsIFrame*) mFrames.ElementAt(i); - - // XXX installed colormap should be presentation-context/window state - nsIWidget* window; - - frame->GetWindow(window); - if (!gXXXInstalledColorMap && mImage) { - nsColorMap* cmap = mImage->GetColorMap(); - if ((nsnull != cmap) && (cmap->NumColors > 0)) { - window->SetColorMap(cmap); - } - gXXXInstalledColorMap = PR_TRUE; - } - - // Determine damaged area and tell view manager to redraw it - nsPoint offset; - nsRect bounds; - frame->GetRect(bounds); - nsIView* view; - - frame->GetOffsetFromView(offset, view); - nsIViewManager* vm = view->GetViewManager(); - bounds.x = offset.x; - bounds.y = offset.y; - vm->UpdateView(view, bounds, 0); - NS_RELEASE(vm); - NS_RELEASE(view); - } -} - -void ImageLoader::NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType) -{ - printf("XXX image error: %d\n", aErrorType); -} - -//---------------------------------------------------------------------- - -nsPresContext::nsPresContext() - : mVisibleArea(0, 0, 0, 0), - mDefaultFont("Times", NS_FONT_STYLE_NORMAL, - NS_FONT_VARIANT_NORMAL, - NS_FONT_WEIGHT_NORMAL, - 0, - NS_POINTS_TO_TWIPS_INT(12)) -{ - NS_INIT_REFCNT(); - mShell = nsnull; - mDeviceContext = nsnull; - mImageGroup = nsnull; - mLinkHandler = nsnull; - mContainer = nsnull; -} - -nsPresContext::~nsPresContext() -{ - mShell = nsnull; - - // XXX there is a race between an async notify and this code because - // the presentation shell code deletes the frame tree first and then - // deletes us. We need an "Deactivation" hook for this code too - - // Release all the image loaders - PRInt32 n = mImageLoaders.Count(); - for (PRInt32 i = 0; i < n; i++) { - ImageLoader* loader = (ImageLoader*) mImageLoaders.ElementAt(i); - delete loader; - } - - // XXX Release all the cached images - - if (nsnull != mImageGroup) { - mImageGroup->Interrupt(); - NS_RELEASE(mImageGroup); - } - - NS_IF_RELEASE(mLinkHandler); - NS_IF_RELEASE(mContainer); -} - -nsrefcnt nsPresContext::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt nsPresContext::Release(void) -{ - NS_PRECONDITION(0 != mRefCnt, "bad refcnt"); - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} - -NS_IMPL_QUERY_INTERFACE(nsPresContext, kIPresContextIID); - -// Note: We don't hold a reference on the shell; it has a reference to -// us -void nsPresContext::SetShell(nsIPresShell* aShell) -{ - mShell = aShell; -} - -nsIPresShell* nsPresContext::GetShell() -{ - if (nsnull != mShell) { - NS_ADDREF(mShell); - } - return mShell; -} - -nsIStyleContext* -nsPresContext::ResolveStyleContextFor(nsIContent* aContent, - nsIFrame* aParentFrame) -{ - nsIStyleContext* result = nsnull; - - nsIStyleSet* set = mShell->GetStyleSet(); - if (nsnull != set) { - result = set->ResolveStyleFor(this, aContent, aParentFrame); - NS_RELEASE(set); - } - - return result; -} - -nsIFontMetrics* nsPresContext::GetMetricsFor(const nsFont& aFont) -{ - if (nsnull != mDeviceContext) - return mDeviceContext->GetMetricsFor(aFont); - - return nsnull; -} - -const nsFont& nsPresContext::GetDefaultFont(void) -{ - return mDefaultFont; -} - -nsRect nsPresContext::GetVisibleArea() -{ - return mVisibleArea; -} - -void nsPresContext::SetVisibleArea(const nsRect& r) -{ - mVisibleArea = r; -} - -float nsPresContext::GetPixelsToTwips() const -{ - if (nsnull != mDeviceContext) - return mDeviceContext->GetDevUnitsToAppUnits(); - - return 1.0f; -} - -float nsPresContext::GetTwipsToPixels() const -{ - if (nsnull != mDeviceContext) - return mDeviceContext->GetAppUnitsToDevUnits(); - - return 1.0f; -} - -nsIDeviceContext * nsPresContext::GetDeviceContext() const -{ - NS_IF_ADDREF(mDeviceContext); - return mDeviceContext; -} - -nsIImage* nsPresContext::LoadImage(const nsString& aURL, nsIFrame* aForFrame) -{ - if (nsnull == mImageGroup) { - // XXX this is bad; if we allow for subwindows that have different - // rendering context's this won't work - nsIWidget* window; - - aForFrame->GetWindow(window); - nsIRenderingContext* drawCtx = window->GetRenderingContext(); - drawCtx->Scale(mDeviceContext->GetAppUnitsToDevUnits(), - mDeviceContext->GetAppUnitsToDevUnits()); - if ((NS_OK != NS_NewImageGroup(&mImageGroup)) || - (NS_OK != mImageGroup->Init(drawCtx))) { - // XXX what to do? - printf("XXX: can't get image group created\n"); - NS_RELEASE(drawCtx); - return nsnull; - } - NS_RELEASE(drawCtx); - } - - // Get absolute version of the url - nsIDocument* doc = mShell->GetDocument(); - nsIURL* docURL = doc->GetDocumentURL(); - char* spec = aURL.ToNewCString(); - nsIURL* url; - nsresult rv = NS_NewURL(&url, docURL, spec); - delete spec; - NS_RELEASE(docURL); - NS_RELEASE(doc); - if (NS_OK != rv) { - // XXX lost error - return nsnull; - } - nsAutoString absURL; - url->ToString(absURL); - NS_RELEASE(url); - - PRInt32 n = mImageLoaders.Count(); - for (PRInt32 i = 0; i < n; i++) { - ImageLoader* loader = (ImageLoader*) mImageLoaders.ElementAt(i); - if (absURL.Equals(loader->GetURL())) { - loader->AddFrame(aForFrame); - return loader->GetImage(); - } - } - - ImageLoader* loader = new ImageLoader(this, mImageGroup, aForFrame); - mImageLoaders.AppendElement(loader); - - loader->LoadImage(absURL); - return loader->GetImage(); -} - -void nsPresContext::StopLoadImage(nsIFrame* aForFrame) -{ - PRInt32 n = mImageLoaders.Count(); - for (PRInt32 i = 0; i < n;) { - ImageLoader* loader = (ImageLoader*) mImageLoaders.ElementAt(i); - if (loader->RemoveFrame(aForFrame)) { - if (0 == loader->FrameCount()) { - delete loader; - mImageLoaders.RemoveElementAt(i); - n--; - continue; - } - } - i++; - } -} - -NS_IMETHODIMP nsPresContext::SetLinkHandler(nsILinkHandler* aHandler) -{ // XXX should probably be a WEAK reference - NS_IF_RELEASE(mLinkHandler); - mLinkHandler = aHandler; - NS_IF_ADDREF(aHandler); - return NS_OK; -} - -NS_IMETHODIMP nsPresContext::GetLinkHandler(nsILinkHandler** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mLinkHandler; - NS_IF_ADDREF(mLinkHandler); - return NS_OK; -} - -NS_IMETHODIMP nsPresContext::SetContainer(nsISupports* aHandler) -{ // XXX should most likely be a WEAK reference - NS_IF_RELEASE(mContainer); - mContainer = aHandler; - NS_IF_ADDREF(aHandler); - return NS_OK; -} - -NS_IMETHODIMP nsPresContext::GetContainer(nsISupports** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mContainer; - NS_IF_ADDREF(mContainer); - return NS_OK; -} diff --git a/mozilla/layout/base/nsPresContext.h b/mozilla/layout/base/nsPresContext.h deleted file mode 100644 index 916ea9538b5..00000000000 --- a/mozilla/layout/base/nsPresContext.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIPresContext_h___ -#define nsIPresContext_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsRect.h" - -class nsIImage; -class nsILinkHandler; -class nsIPresShell; -class nsIRenderingContext; -class nsIFrame; -class nsIStyleContext; -class nsIFontMetrics; -class nsIContent; -class nsViewManager; -class nsIView; -class nsIFontCache; -class nsIDeviceContext; -class nsString; -struct nsFont; - -#define NS_IPRESCONTEXT_IID \ -{ 0x0a5d12e0, 0x944e, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - - -// An interface for presentation contexts. Presentation contexts are -// objects that provide an outer context for a presentation shell. -class nsIPresContext : public nsISupports { -public: - /** - * Set the presentation shell that this context is bound to. - * A presentation context may only be bound to a single shell. - */ - virtual void SetShell(nsIPresShell* aShell) = 0; - - /** - * Get the PresentationShell that this context is bound to. - */ - virtual nsIPresShell* GetShell() = 0; - - /** - * Resolve style for the given piece of content that will be a child - * of the aParentFrame frame. - */ - virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, - nsIFrame* aParentFrame) = 0; - - /** - * Get the font metrics for a given font. - */ - virtual nsIFontMetrics* GetMetricsFor(const nsFont& aFont) = 0; - - /** - * Get the default font - */ - virtual const nsFont& GetDefaultFont(void) = 0; - - /** - * Load an image for the given url name for the given frame. When - * the image is ready for rendering the frame will be repainted. - * - * If the image is ready then this method will return the image, - * otherwise it will return nsnull and guarantee that the frame - * is repained when the image is ready. - * - * XXX this api needs work; the frame can't find out the size when - * it arrives nor can it find out any error information, etc. - */ - virtual nsIImage* LoadImage(const nsString& aURL, nsIFrame* aForFrame) = 0; - - /** - * Stop any image loading being done on behalf of the argument frame. - */ - virtual void StopLoadImage(nsIFrame* aForFrame) = 0; - - NS_IMETHOD SetContainer(nsISupports* aContainer) = 0; - - NS_IMETHOD GetContainer(nsISupports** aResult) = 0; - - NS_IMETHOD SetLinkHandler(nsILinkHandler* aHandler) = 0; - - NS_IMETHOD GetLinkHandler(nsILinkHandler** aResult) = 0; - - /** - * Get the currently visible portion of the RootContent ILayoutable. - * The units returned are in pixels. An acceptable answer is "null" - * which means "I don't know". - *

    Speculative

    - */ - virtual nsRect GetVisibleArea() = 0; - - /** - * Set the currently visible area. This is the size and location - * of the visible portion of the RootContent ILayoutable. - */ - virtual void SetVisibleArea(const nsRect& r) = 0; - - /** - * Return true if this presentation context is a paginated - * context. - */ - virtual PRBool IsPaginated() = 0; - - /** - * Return the page width if this is a paginated context. - */ - virtual nscoord GetPageWidth() = 0; - - /** - * Return the page height if this is a paginated context - */ - virtual nscoord GetPageHeight() = 0; - - virtual float GetPixelsToTwips() const = 0; - virtual float GetTwipsToPixels() const = 0; - - //be sure to Relase() after you are done with the Get() - virtual nsIDeviceContext * GetDeviceContext() const = 0; -}; - -// Factory method to create a "galley" presentation context (galley is -// a kind of view that has no limit to the size of a page) -extern NS_LAYOUT nsresult - NS_NewGalleyContext(nsIPresContext** aInstancePtrResult); - -// Factory method to create a "paginated" presentation context for -// the screen. -extern NS_LAYOUT nsresult - NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult); - -#endif /* nsIPresContext_h___ */ diff --git a/mozilla/layout/base/public/Makefile b/mozilla/layout/base/public/Makefile deleted file mode 100644 index b39fd8b61a1..00000000000 --- a/mozilla/layout/base/public/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -MODULE = raptor - -EXPORTS = \ - nslayout.h \ - nsIContent.h \ - nsIContentDelegate.h \ - nsIDocument.h \ - nsIDocumentContainer.h \ - nsIDocumentObserver.h \ - nsIFrame.h \ - nsIPresContext.h \ - nsIPresShell.h \ - nsIRunaround.h \ - nsISpaceManager.h \ - nsStyleCoord.h \ - nsIStyleContext.h \ - nsIStyleRule.h \ - nsIStyleSet.h \ - nsIStyleSheet.h \ - nsITextContent.h \ - $(NULL) - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/base/public/makefile.win b/mozilla/layout/base/public/makefile.win deleted file mode 100644 index c8ca00b6ede..00000000000 --- a/mozilla/layout/base/public/makefile.win +++ /dev/null @@ -1,44 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -EXPORTS = \ - nslayout.h \ - nsIContent.h \ - nsIContentDelegate.h \ - nsIDocument.h \ - nsIDocumentContainer.h \ - nsIDocumentObserver.h \ - nsIFrame.h \ - nsIPresContext.h \ - nsIPresShell.h \ - nsIRunaround.h \ - nsISpaceManager.h \ - nsStyleCoord.h \ - nsIStyleContext.h \ - nsIStyleRule.h \ - nsIStyleSet.h \ - nsIStyleSheet.h \ - nsITextContent.h \ - $(NULL) - -MODULE=raptor - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/layout/base/public/nsIContent.h b/mozilla/layout/base/public/nsIContent.h deleted file mode 100644 index 70a8b75779d..00000000000 --- a/mozilla/layout/base/public/nsIContent.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIContent_h___ -#define nsIContent_h___ - -#include -#include "nslayout.h" -#include "nsISupports.h" -class nsIAtom; -class nsIContentDelegate; -class nsIDocument; -class nsIPresContext; -class nsISizeofHandler; -class nsString; -class nsString; -class nsVoidArray; - -// IID for the nsIContent interface -#define NS_ICONTENT_IID \ -{ 0x78030220, 0x9447, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -/** - * Content attribute states - */ -enum nsContentAttr { - // Attribute does not exist on the piece of content - eContentAttr_NotThere, - - // Attribute exists, but has no value, e.g. "BORDER" in - eContentAttr_NoValue, - - // Attribute exists and has a value. However, value may be the - // empty string. e.g.
    or
    - eContentAttr_HasValue, -}; - -// A node of content in a documents content model. This interface -// is supported by all content objects. -class nsIContent : public nsISupports -{ -public: - virtual nsIDocument* GetDocument() const = 0; - virtual void SetDocument(nsIDocument* aDocument) = 0; - - virtual nsIContent* GetParent() const = 0; - virtual void SetParent(nsIContent* aParent) = 0; - - virtual PRBool CanContainChildren() const = 0; - virtual PRInt32 ChildCount() const = 0; - virtual nsIContent* ChildAt(PRInt32 aIndex) const = 0; - virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const = 0; - virtual PRBool InsertChildAt(nsIContent* aKid, PRInt32 aIndex) = 0; - virtual PRBool ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex) = 0; - virtual PRBool AppendChild(nsIContent* aKid) = 0; - virtual PRBool RemoveChildAt(PRInt32 aIndex) = 0; - - virtual nsIAtom* GetTag() const = 0; - - /** - * Set attribute values. All attribute values are assumed to have a - * canonical String representation that can be used for these - * methods. The setAttribute method is assumed to perform a translation - * of the canonical form into the underlying content specific - * form. - * - * aValue may legitimately be the empty string. - */ - virtual void SetAttribute(const nsString& aName, const nsString& aValue) = 0; - - /** - * Get the current value of the attribute. This returns a form that is - * suitable for passing back into setAttribute. - * - *
      - * - *
    • If the attribute is not set and has no default value, return - * eContentAttr_NotThere. - * - *
    • If the attribute exists, but has no value, return - * eContentAttr_NoValue. - * - *
    • If the attribute has a value, empty or otherwise, set ret to - * be the value, and return eContentAttr_HasValue. - * - *
    */ - virtual nsContentAttr GetAttribute(const nsString& aName, - nsString& aResult) const = 0; - - virtual nsIContentDelegate* GetDelegate(nsIPresContext* aCX) = 0; - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; - - /** - * Return the number of bytes consumed by this node of content and - * anything that it can reach. - */ - virtual PRUint32 SizeOf(nsISizeofHandler* aHandler) const = 0; -}; - -#endif /* nsIContent_h___ */ diff --git a/mozilla/layout/base/public/nsIContentDelegate.h b/mozilla/layout/base/public/nsIContentDelegate.h deleted file mode 100644 index e2d50297c60..00000000000 --- a/mozilla/layout/base/public/nsIContentDelegate.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIContentDelegate_h___ -#define nsIContentDelegate_h___ - -#include "nslayout.h" -class nsIFrame; -class nsIPresContext; - -#define NS_ICONTENTDELEGATE_IID \ - { 0x0f135ce0, 0xa286, 0x11d1, \ - {0x89, 0x73, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} } - -/** - * API for content delegation. Content objects create these objects to - * provide hooks to creating their visual presentation. - */ -class nsIContentDelegate : public nsISupports { -public: - /** - * Create a new frame object that will be responsible for the layout - * and presentation of the content. - */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) = 0; -}; - -#endif /* nsIContentDelegate_h___ */ diff --git a/mozilla/layout/base/public/nsIDocument.h b/mozilla/layout/base/public/nsIDocument.h deleted file mode 100644 index 0901278676b..00000000000 --- a/mozilla/layout/base/public/nsIDocument.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIDocument_h___ -#define nsIDocument_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsIUnicharInputStream.h" -class nsIArena; -class nsIContent; -class nsIDocumentContainer; -class nsIDocumentObserver; -class nsIPresContext; -class nsIPresShell; -class nsISubContent; -class nsIStyleSet; -class nsIStyleSheet; -class nsIURL; -class nsIViewManager; -class nsString; - -// IID for the nsIDocument interface -#define NS_IDOCUMENT_IID \ -{ 0x94c6ceb0, 0x9447, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -//---------------------------------------------------------------------- - -// Document interface -class nsIDocument : public nsISupports { -public: - // All documents have a memory arena associated with them which is - // used for memory allocation during document creation. This call - // returns the arena associated with this document. - virtual nsIArena* GetArena() = 0; - - virtual void LoadURL(nsIURL* aURL) = 0; - - virtual void StartDocumentLoad() = 0; - virtual void PauseDocumentLoad() = 0; - virtual void StopDocumentLoad() = 0; - virtual void WaitForDocumentLoad() = 0; - virtual PRBool IsDocumentLoaded() = 0; - - /** - * Return the title of the document. May return null. - */ - virtual const nsString* GetDocumentTitle() const = 0; - - /** - * Return the URL for the document. May return null. - */ - virtual nsIURL* GetDocumentURL() const = 0; - - /** - * Return a standard name for the document's character set. This will - * trigger a startDocumentLoad if necessary to answer the question. - */ - virtual nsCharSetID GetDocumentCharacterSet() const = 0; - virtual void SetDocumentCharacterSet(nsCharSetID aCharSetID) = 0; - - /** - * Create a new presentation shell that will use aContext for - * it's presentation context (presentation context's must not be - * shared among multiple presentation shell's). - */ - virtual nsresult CreateShell(nsIPresContext* aContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet, - nsIPresShell** aInstancePtrResult) = 0; - virtual PRBool DeleteShell(nsIPresShell* aShell) = 0; - virtual PRInt32 GetNumberOfShells() = 0; - virtual nsIPresShell* GetShellAt(PRInt32 aIndex) = 0; - - /** - * Return the parent document of this document. Will return null - * unless this document is within a compound document and has a parent. - */ - virtual nsIDocument* GetParentDocument() = 0; - virtual void SetParentDocument(nsIDocument* aParent) = 0; - virtual void AddSubDocument(nsIDocument* aSubDoc) = 0; - virtual PRInt32 GetNumberOfSubDocuments() = 0; - virtual nsIDocument* GetSubDocumentAt(PRInt32 aIndex) = 0; - - /** - * Return the root content object for this document. - */ - virtual nsIContent* GetRootContent() = 0; - virtual void SetRootContent(nsIContent* aRoot) = 0; - - /** - * Get the style sheets owned by this document. - */ - virtual PRInt32 GetNumberOfStyleSheets() = 0; - virtual nsIStyleSheet* GetStyleSheetAt(PRInt32 aIndex) = 0; - virtual void AddStyleSheet(nsIStyleSheet* aSheet) = 0; - - //---------------------------------------------------------------------- - - // Document notification API's - - /** - * Add a new observer of document change notifications. Whenever - * content is changed, appended, inserted or removed the observers are - * informed. - */ - virtual void AddObserver(nsIDocumentObserver* aObserver) = 0; - - /** - * Remove an observer of document change notifications. This will - * return false if the observer cannot be found. - */ - virtual PRBool RemoveObserver(nsIDocumentObserver* aObserver) = 0; - - // Observation hooks used by content nodes to propagate - // notifications to document observers. - virtual void ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType) = 0; - - virtual void ContentAppended(nsIContent* aContainer) = 0; - - virtual void ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) = 0; - - virtual void ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer) = 0; - - virtual void ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) = 0; - - virtual void ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) = 0; -}; - -// XXX Belongs somewhere else -extern NS_LAYOUT nsresult - NS_NewHTMLDocument(nsIDocument** aInstancePtrResult); - -#endif /* nsIDocument_h___ */ diff --git a/mozilla/layout/base/public/nsIDocumentContainer.h b/mozilla/layout/base/public/nsIDocumentContainer.h deleted file mode 100644 index 96862447dc2..00000000000 --- a/mozilla/layout/base/public/nsIDocumentContainer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIDocumentContainer_h___ -#define nsIDocumentContainer_h___ - -#include "nsISupports.h" -class nsIScriptable; -class nsIScriptEnvironment; -class nsIURL; - -#define NS_IDOCUMENT_CONTAINER_IID \ -{ 0x8efd4470, 0x944d, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -class nIDocumentContainer : public nsISupports { -public: - /** - * Display the specified URL with the given connection. - * - * @param url the URL to display - * @param connection the connection to use. - */ - virtual void Display(nsIURL* aURL) = 0; - - /** - * Returns a script environment for the specified language and version. - * The expectation is that the script environment already has been - * set up with a container object. If a script environment has already - * been requested for the given language, the same instance should - * be returned. - * - * @param language the scripting language for the environment. If this - * is null, returns the default scripting environment. - * @param majorVersion the major version number of the language - * @param minorVersion the minor version number of the language - * @return the script environment for the language - * @see mg.magellan.script.IScriptEnvrionment - */ - virtual nsIScriptEnvironment* - GetScriptEnvironment(nsString* aLanguage, - PRInt32 aMajorVersion, - PRInt32 aMinorVersion) = 0; - - /** - * Returns the scriptable container object for the document container. - * The scriptable object will be used as the scoping object in the - * definition of scriptable classes used in the Document Object Model. - * - * @return the scriptable container for the application - * @see mg.magellan.script.IScriptable - * @see mg.magellan.script.IScriptEnvrionment - */ - virtual nsIScriptable* GetScriptableContainer() = 0; -} - -#endif /* nsIDocumentContainer_h___ */ diff --git a/mozilla/layout/base/public/nsIDocumentObserver.h b/mozilla/layout/base/public/nsIDocumentObserver.h deleted file mode 100644 index 54fdc6ef4a2..00000000000 --- a/mozilla/layout/base/public/nsIDocumentObserver.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIDocumentObserver_h___ -#define nsIDocumentObserver_h___ - -#include "nsISupports.h" -class nsIContent; -class nsISubContent; -class nsIStyleSheet; -class nsString; - -#define NS_IDOCUMENTOBSERVER_IID \ -{ 0xb3f92460, 0x944c, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -// Document observer interface -class nsIDocumentObserver : public nsISupports { -public: - /** - * This is called when the documents title has arrived. - */ - NS_IMETHOD SetTitle(const nsString& aTitle) = 0; - - /** - * Notify that a content model update is beginning. This call can be - * nested. - */ - virtual void BeginUpdate() = 0; - - /** - * Notify that a content model update is finished. This call can be - * nested. - */ - virtual void EndUpdate() = 0; - - /** - * Notification that the content model has changed. This method is - * called automatically by content objects when their state is changed - * (therefore there is normally no need to invoke this method - * directly). The notification is passed to any - * IDocumentObservers. The notification is passed on to all of the - * document observers.

    - * - * This notification is not sent when a piece of content is - * added/removed from the document (the other notifications are used - * for that). - * - * @param aContent the piece of content that changed - * @param aSubContent subrange information about the piece of content - * that change - * @param aChangeType one of the change types (kLogicalChange, - * kPhysicalChange or kRenderingChange) - */ - virtual void ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType) = 0; - - /** - * Notifcation that the content model has had data appended to the - * given content object. This method is called automatically by the - * content container objects when a new content object is appended to - * the container (therefore there is normally no need to invoke this - * method directly). The notification is passed on to all of the - * document observers. - * - * @param aContainer the container that had a new child appended - */ - virtual void ContentAppended(nsIContent* aContainer) = 0; - - /** - * Notification that content has been inserted. This method is called - * automatically by the content container objects when a new content - * object is inserted in the container (therefore there is normally no - * need to invoke this method directly). The notification is passed on - * to all of the document observers. - * - * @param aContainer the container that now contains aChild - * @param aChild the child that was inserted - * @param aIndexInContainer the index of the child in the container - */ - virtual void ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) = 0; - - /** - * Notification that content has been replaced. This method is called - * automatically by the content container objects when a content object - * is replaced in the container (therefore there is normally no need to - * invoke this method directly). The notification is passed on to all - * of the document observers. - * - * @param aContainer the container that now contains aChild - * @param aOldChild the child that was replaced - * @param aNewChild the child that replaced aOldChild - * @param aIndexInContainer the index of the old and new child in the - * container - */ - virtual void ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer) = 0; - - /** - * Content is going to be removed immediately after this call. This - * method is called automatically by content container objects when a - * content object is about to be removed from the container (therefore - * there is normally no need to invoke this method directly). The - * notification is passed on to all of the document observers. - * - * @param aContainer the container that contains aChild - * @param aChild the child that will be removed - * @param aIndexInContainer the index of the child in the container - */ - virtual void ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) = 0; - - /** - * Content has just been removed. This method is called automatically - * by content container objects when a content object has just been - * removed from the container (therefore there is normally no need to - * invoke this method directly). The notification is passed on to all - * of the document observers. - * - * @param aContainer the container that had a child removed - * @param aChild the child that was just removed - * @param aIndexInContainer the index of the child in the container - * before it was removed - */ - virtual void ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) = 0; - - /** - * A StyleSheet has just been added to the document. - * This method is called automatically when a StyleSheet gets added - * to the document. The notification is passed on to all of the - * document observers. - * - * @param aStyleSheet the StyleSheet that has been added - */ - virtual void StyleSheetAdded(nsIStyleSheet* aStyleSheet) = 0; -}; - -#endif /* nsIDocumentObserver_h___ */ diff --git a/mozilla/layout/base/public/nsIFrame.h b/mozilla/layout/base/public/nsIFrame.h deleted file mode 100644 index 7d1b8f97851..00000000000 --- a/mozilla/layout/base/public/nsIFrame.h +++ /dev/null @@ -1,406 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIFrame_h___ -#define nsIFrame_h___ - -#include -#include "nslayout.h" -#include "nsISupports.h" -#include "nsSize.h" -#include "nsGUIEvent.h" - -class nsIContent; -class nsIPresContext; -class nsIPresShell; -class nsIRenderingContext; -class nsISpaceManager; -class nsIStyleContext; -class nsIView; -class nsIWidget; -class nsReflowCommand; - -struct nsPoint; -struct nsRect; -struct nsReflowMetrics; -struct nsStyleStruct; - -// IID for the nsIFrame interface {12B193D0-9F70-11d1-8500-00A02468FAB6} -#define NS_IFRAME_IID \ -{ 0x12b193d0, 0x9f70, 0x11d1, \ - {0x85, 0x0, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}} - -/** - * Reflow metrics used to return the frame's desired size and alignment - * information. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - * @see #GetReflowMetrics() - */ -struct nsReflowMetrics { - nscoord width, height; - nscoord ascent, descent; -}; - -/** - * Constant used to indicate an unconstrained size. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - */ -#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE - -/** - * A frame in the layout model. This interface is supported by all frame - * objects. - * - * Frames are NOT reference counted. Use the DeleteFrame() member function - * instead - */ -class nsIFrame : private nsISupports -{ -public: - /** - * QueryInterface() defined in nsISupports. This is the only member - * function of nsISupports that is public. - */ - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr) = 0; - - /** - * Deletes this frame and each of its child frames (recursively calls - * DeleteFrame() for each child) - */ - NS_IMETHOD DeleteFrame() = 0; - - /** - * Get the content object associated with this frame. Adds a reference to - * the content object so the caller must do a release. - * - * @see nsISupports#Release() - */ - NS_IMETHOD GetContent(nsIContent*& aContent) const = 0; - - /** - * Get/Set the frame's index in parent. - */ - NS_IMETHOD GetIndexInParent(PRInt32& aIndexInParent) const = 0; - NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent) = 0; - - /** - * Get the style context associated with this frame. Note that GetStyleContext() - * adds a reference to the style context so the caller must do a release. - * - * @see nsISupports#Release() - */ - NS_IMETHOD GetStyleContext(nsIPresContext* aContext, - nsIStyleContext*& aStyleContext) = 0; - NS_IMETHOD SetStyleContext(nsIStyleContext* aContext) = 0; - - /** - * Get the style data associated with this frame - */ - NS_IMETHOD GetStyleData(const nsIID& aSID, nsStyleStruct*& aStyleStruct) = 0; - - /** - * Accessor functions for geometric and content parent. - */ - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetContentParent(const nsIFrame* aParent) = 0; - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent) = 0; - - /** - * Bounding rect of the frame. The values are in twips, and the origin is - * relative to the upper-left of the geometric parent. The size includes the - * content area, borders, and padding. - */ - NS_IMETHOD GetRect(nsRect& aRect) const = 0; - NS_IMETHOD GetOrigin(nsPoint& aPoint) const = 0; - NS_IMETHOD GetSize(nsSize& aSize) const = 0; - NS_IMETHOD SetRect(const nsRect& aRect) = 0; - NS_IMETHOD MoveTo(nscoord aX, nscoord aY) = 0; - NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight) = 0; - - /** - * Child frame enumeration - */ - NS_IMETHOD ChildCount(PRInt32& aChildCount) const = 0; - NS_IMETHOD ChildAt(PRInt32 aIndex, nsIFrame*& aFrame) const = 0; - NS_IMETHOD IndexOf(const nsIFrame* aChild, PRInt32& aIndex) const = 0; - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const = 0; - NS_IMETHOD NextChild(const nsIFrame* aChild, nsIFrame*& aNextChild) const = 0; - NS_IMETHOD PrevChild(const nsIFrame* aChild, nsIFrame*& aPrevChild) const = 0; - NS_IMETHOD LastChild(nsIFrame*& aLastChild) const = 0; - - /** - * Painting - */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) = 0; - - /** - * Handle an event. - */ - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) = 0; - - /** - * Get the cursor for a given point in the frame tree. The - * call returns the desired cursor (or NS_STYLE_CURSOR_INHERIT if - * no cursor is wanted). In addition, if a cursor is desired - * then *aFrame is set to the frame that wants the cursor. - */ - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) = 0; - - /** - * Reflow status returned by the reflow methods. frNotComplete means you didn't - * map all your content, and so your parent should create a continuing frame - * for you. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - * @see #CreateContinuingFrame() - */ - enum ReflowStatus {frComplete, frNotComplete}; - - /** - * Resize reflow. The frame is given a maximum size and asked for its desired - * size. This is the frame's opportunity to reflow its children. - * - * @param aDesiredSize out parameter where you should return the - * desired size and ascent/descent info. You should include any - * space you want for border/padding in the desired size you return. - * @param aMaxSize the available space in which to lay out. Each dimension - * can either be constrained or unconstrained (a value of - * NS_UNCONSTRAINEDSIZE). If constrained you should choose a value that's - * less than or equal to the constrained size. If unconstrained you can - * choose as large a value as you like. - * - * It's okay to return a desired size that exceeds the max size if that's - * the smallest you can be, i.e. it's your minimum size. - * - * @param aMaxElementSize an optional parameter for returning your maximum - * element size. If may be null in which case you don't have to compute - * a maximum element size. The maximum element size must be less than or - * equal to your desired size. - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) = 0; - - /** - * Post-processing reflow method invoked when justification is enabled. - * This is always called after ResizeReflow/IncrementalReflow. - * - * @param aAvailableSpace The amount of available space that the frame - * should distribute internally. - */ - NS_IMETHOD JustifyReflow(nsIPresContext* aPresContext, - nscoord aAvailableSpace) = 0; - - /** - * Incremental reflow. The reflow command contains information about the - * type of change. The frame is given a maximum size and asked for its - * desired size. - * - * @param aDesiredSize out parameter where you should return - * the desired size and ascent/descent info. You should - * include any space you want for border/padding in the - * desired size you return. - * - * @param aMaxSize the available space in which to lay out. Each - * dimension can either be constrained or unconstrained (a - * value of NS_UNCONSTRAINEDSIZE). If constrained you - * should choose a value that's less than or equal to the - * constrained size. If unconstrained you can choose as - * large a value as you like. It's okay to return a - * desired size that exceeds the max size if that's the - * smallest you can be, i.e. it's your minimum size. - * - * @see nsReflowCommand#GetTarget() - * @see nsReflowCommand#GetType() - */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) = 0; - - /** - * This call is invoked when content is appended to the content - * tree. The container frame that maps that content is asked to deal - * with the appended content by creating new frames and updating the - * index-in-parent values for it's affected children. In addition, - * the call must generate reflow commands that will incrementally - * reflow and repair the damaged portion of the frame tree. - */ - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) = 0; - - /** - * This call is invoked when content is inserted in the content - * tree. The container frame that maps that content is asked to deal - * with the inserted content by creating new frames and updating the - * index-in-parent values for it's affected children. In addition, - * the call must generate reflow commands that will incrementally - * reflow and repair the damaged portion of the frame tree. - * - * @param aIndexInParent the index in the content container where - * the new content was inserted. - */ - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) = 0; - - /** - * This call is invoked when content is replaced in the content - * tree. The container frame that maps that content is asked to deal - * with the replaced content by deleting old frames and then - * creating new frames and updating the index-in-parent values for - * it's affected children. In addition, the call must generate - * reflow commands that will incrementally reflow and repair the - * damaged portion of the frame tree. - * - * @param aIndexInParent the index in the content container where - * the new content was inserted. */ - NS_IMETHOD ContentReplaced(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInParent) = 0; - - /** - * This call is invoked when content is deleted from the content - * tree. The container frame that maps that content is asked to deal - * with the deleted content by deleting frames and updating the - * index-in-parent values for it's affected children. In addition, - * the call must generate reflow commands that will incrementally - * reflow and repair the damaged portion of the frame tree. - * - * @param aIndexInParent the index in the content container where - * the new content was deleted. - */ - NS_IMETHOD ContentDeleted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) = 0; - - /** - * Return the reflow metrics for this frame. If the frame is a - * container then the values for ascent and descent are computed - * across the the various children in the appropriate manner - * (e.g. for a line frame the ascent value would be the maximum - * ascent of the line's children). Note that the metrics returned - * apply to the frame as it exists at the time of the call. - */ - NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics) = 0; - - /** - * Indication of how the frame can be split. This is used when doing runaround - * of floaters, and when pulling up child frames from a next-in-flow. - * - * The choices are splittable, not splittable at all, and splittable in - * a non-rectangular fashion. This last type only applies to block-level - * elements, and indicates whether splitting can be used when doing runaround. - * If you can split across page boundaries, but you expect each continuing - * frame to be the same width then return frSplittable and not - * frSplittableNonRectangular. - * - * @see #IsSplittable() - */ - enum SplittableType {frNotSplittable = 0, frSplittable = 1, frSplittableNonRectangular = 3}; - - /** - * Return how your frame can be split. - */ - NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const = 0; - - /** - * Flow member functions. CreateContinuingFrame() is responsible for appending - * the continuing frame to the flow. - */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) = 0; - - NS_IMETHOD GetPrevInFlow(nsIFrame*& aPrevInFlow) const = 0; - NS_IMETHOD SetPrevInFlow(nsIFrame*) = 0; - NS_IMETHOD GetNextInFlow(nsIFrame*& aNextInFlow) const = 0; - NS_IMETHOD SetNextInFlow(nsIFrame*) = 0; - - NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame) = 0; - NS_IMETHOD PrependToFlow(nsIFrame* aBeforeFrame) = 0; - NS_IMETHOD RemoveFromFlow() = 0; - NS_IMETHOD BreakFromPrevFlow() = 0; - NS_IMETHOD BreakFromNextFlow() = 0; - - /** - * Accessor functions to get/set the associated view object - */ - NS_IMETHOD GetView(nsIView*& aView) const = 0; // may be null - NS_IMETHOD SetView(nsIView* aView) = 0; - - /** - * Find the first geometric parent that has a view - */ - NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const = 0; - - /** - * Returns the offset from this frame to the closest geometric parent that - * has a view. Also returns the containing view or null in case of error - */ - NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const = 0; - - /** - * Returns the window that contains this frame. If this frame has a - * view and the view has a window, then this frames window is - * returned, otherwise this frame's geometric parent is checked - * recursively upwards. - */ - NS_IMETHOD GetWindow(nsIWidget*&) const = 0; - - /** - * Sibling pointer used to link together frames - */ - NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const = 0; - NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling) = 0; - - // Debugging - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const= 0; - NS_IMETHOD ListTag(FILE* out = stdout) const = 0; - NS_IMETHOD VerifyTree() const = 0; - - // Show frame borders when rendering - static NS_LAYOUT void ShowFrameBorders(PRBool aEnable); - static NS_LAYOUT PRBool GetShowFrameBorders(); -}; - -#endif /* nsIFrame_h___ */ diff --git a/mozilla/layout/base/public/nsIPresContext.h b/mozilla/layout/base/public/nsIPresContext.h deleted file mode 100644 index 916ea9538b5..00000000000 --- a/mozilla/layout/base/public/nsIPresContext.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIPresContext_h___ -#define nsIPresContext_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsRect.h" - -class nsIImage; -class nsILinkHandler; -class nsIPresShell; -class nsIRenderingContext; -class nsIFrame; -class nsIStyleContext; -class nsIFontMetrics; -class nsIContent; -class nsViewManager; -class nsIView; -class nsIFontCache; -class nsIDeviceContext; -class nsString; -struct nsFont; - -#define NS_IPRESCONTEXT_IID \ -{ 0x0a5d12e0, 0x944e, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - - -// An interface for presentation contexts. Presentation contexts are -// objects that provide an outer context for a presentation shell. -class nsIPresContext : public nsISupports { -public: - /** - * Set the presentation shell that this context is bound to. - * A presentation context may only be bound to a single shell. - */ - virtual void SetShell(nsIPresShell* aShell) = 0; - - /** - * Get the PresentationShell that this context is bound to. - */ - virtual nsIPresShell* GetShell() = 0; - - /** - * Resolve style for the given piece of content that will be a child - * of the aParentFrame frame. - */ - virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, - nsIFrame* aParentFrame) = 0; - - /** - * Get the font metrics for a given font. - */ - virtual nsIFontMetrics* GetMetricsFor(const nsFont& aFont) = 0; - - /** - * Get the default font - */ - virtual const nsFont& GetDefaultFont(void) = 0; - - /** - * Load an image for the given url name for the given frame. When - * the image is ready for rendering the frame will be repainted. - * - * If the image is ready then this method will return the image, - * otherwise it will return nsnull and guarantee that the frame - * is repained when the image is ready. - * - * XXX this api needs work; the frame can't find out the size when - * it arrives nor can it find out any error information, etc. - */ - virtual nsIImage* LoadImage(const nsString& aURL, nsIFrame* aForFrame) = 0; - - /** - * Stop any image loading being done on behalf of the argument frame. - */ - virtual void StopLoadImage(nsIFrame* aForFrame) = 0; - - NS_IMETHOD SetContainer(nsISupports* aContainer) = 0; - - NS_IMETHOD GetContainer(nsISupports** aResult) = 0; - - NS_IMETHOD SetLinkHandler(nsILinkHandler* aHandler) = 0; - - NS_IMETHOD GetLinkHandler(nsILinkHandler** aResult) = 0; - - /** - * Get the currently visible portion of the RootContent ILayoutable. - * The units returned are in pixels. An acceptable answer is "null" - * which means "I don't know". - *

    Speculative

    - */ - virtual nsRect GetVisibleArea() = 0; - - /** - * Set the currently visible area. This is the size and location - * of the visible portion of the RootContent ILayoutable. - */ - virtual void SetVisibleArea(const nsRect& r) = 0; - - /** - * Return true if this presentation context is a paginated - * context. - */ - virtual PRBool IsPaginated() = 0; - - /** - * Return the page width if this is a paginated context. - */ - virtual nscoord GetPageWidth() = 0; - - /** - * Return the page height if this is a paginated context - */ - virtual nscoord GetPageHeight() = 0; - - virtual float GetPixelsToTwips() const = 0; - virtual float GetTwipsToPixels() const = 0; - - //be sure to Relase() after you are done with the Get() - virtual nsIDeviceContext * GetDeviceContext() const = 0; -}; - -// Factory method to create a "galley" presentation context (galley is -// a kind of view that has no limit to the size of a page) -extern NS_LAYOUT nsresult - NS_NewGalleyContext(nsIPresContext** aInstancePtrResult); - -// Factory method to create a "paginated" presentation context for -// the screen. -extern NS_LAYOUT nsresult - NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult); - -#endif /* nsIPresContext_h___ */ diff --git a/mozilla/layout/base/public/nsIPresShell.h b/mozilla/layout/base/public/nsIPresShell.h deleted file mode 100644 index 7a88f3d12c6..00000000000 --- a/mozilla/layout/base/public/nsIPresShell.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIPresShell_h___ -#define nsIPresShell_h___ - -#include "nslayout.h" -#include "nsIDocumentObserver.h" -#include "nsCoord.h" -class nsIContent; -class nsIDocument; -class nsIFrame; -class nsIPresContext; -class nsIStyleSet; -class nsIViewManager; -class nsReflowCommand; - -#define NS_IPRESSHELL_IID \ -{ 0x76e79c60, 0x944e, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -/** - * Presentation shell interface. Presentation shells are the - * controlling point for managing the presentation of a document. The - * presentation shell holds a live reference to the document, the - * presentation context, the style manager, the style set and the root - * frame.

    - * - * When this object is Release'd, it will release the document, the - * presentation context, the style manager, the style set and the root - * frame. - */ -class nsIPresShell : public nsIDocumentObserver { -public: - virtual nsresult Init(nsIDocument* aDocument, - nsIPresContext* aPresContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet) = 0; - - virtual nsIDocument* GetDocument() = 0; - - virtual nsIPresContext* GetPresContext() = 0; - - virtual nsIViewManager * GetViewManager() = 0; - - virtual nsIStyleSet* GetStyleSet() = 0; - - // Make shell be a document observer - virtual void BeginObservingDocument() = 0; - - // Make shell stop being a document observer - virtual void EndObservingDocument() = 0; - - /** - * Reflow the frame model into a new width and height. The - * coordinates for aWidth and aHeight must be in standard nscoord's. - */ - virtual void ResizeReflow(nscoord aWidth, nscoord aHeight) = 0; - - virtual nsIFrame* GetRootFrame() = 0; - - virtual nsIFrame* FindFrameWithContent(nsIContent* aContent) = 0; - - virtual void AppendReflowCommand(nsReflowCommand* aReflowCommand) = 0; - - virtual void ProcessReflowCommands() = 0; - - /** - * Place some cached data into the shell's cache. The key for - * the cache is the given frame. - */ - virtual void PutCachedData(nsIFrame* aKeyFrame, void* aData) = 0; - - virtual void* GetCachedData(nsIFrame* aKeyFrame) = 0; - - virtual void* RemoveCachedData(nsIFrame* aKeyFrame) = 0; - - // XXX events - // XXX selection -}; - -/** - * Create a new empty presentation shell. Upon success, call Init - * before attempting to use the shell. - */ -extern NS_LAYOUT nsresult - NS_NewPresShell(nsIPresShell** aInstancePtrResult); - -#endif /* nsIPresShell_h___ */ diff --git a/mozilla/layout/base/public/nsIRunaround.h b/mozilla/layout/base/public/nsIRunaround.h deleted file mode 100644 index 286339f9199..00000000000 --- a/mozilla/layout/base/public/nsIRunaround.h +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIRunaround_h___ -#define nsIRunaround_h___ - -#include -#include "nsIFrame.h" - -// IID for the nsIRunaround interface {3C6ABCF0-C028-11d1-853F-00A02468FAB6} -#define NS_IRUNAROUND_IID \ -{ 0x3c6abcf0, 0xc028, 0x11d1, \ - {0x85, 0x3f, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}} - -/** - * An interface for handling reflow that allows direct access to the space - * manager. Note that this interface is not an nsISupports interface, and - * therefore you cannot QueryInterface() back - */ -class nsIRunaround -{ -public: - /** - * Resize reflow. The frame is given a maximum size and asked for its - * desired rect. The space manager should be used to do runaround of anchored - * items. - * - * @param aSpaceManager the space manager to use. The caller has translated - * the coordinate system so the frame has its own local coordinate - * space with an origin of (0, 0). If you translate the coordinate - * space you must restore it before returning. - * @param aMaxSize the available space in which to lay out. Each dimension - * can either be constrained or unconstrained (a value of - * NS_UNCONSTRAINEDSIZE). If constrained you should choose a value - * that's less than or equal to the constrained size. If unconstrained - * you can choose as large a value as you like. - * - * It's okay to return a desired size that exceeds the max size if - * that's the smallest you can be, i.e. it's your minimum size. - * - * @param aDesiredRect out parameter where you should return the desired - * origin and size. You should include any space you want for border - * and padding in the desired size. - * - * The origin of the desired rect is relative to the upper-left of the - * local coordinate space. - * - * @param aMaxElementSize an optional parameter for returning your maximum - * element size. If may be null in which case you don't have to compute - * a maximum element size - * - * @see nsISpaceManager#Translate() - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) = 0; - - /** - * Incremental reflow. The reflow command contains information about the - * type of change. The frame is given a maximum size and asked for its - * desired rect. The space manager should be used to do runaround of anchored - * items. - * - * @param aSpaceManager the space manager to use. The caller has translated - * the coordinate system so the frame has its own local coordinate - * space with an origin of (0, 0). If you translate the coordinate - * space you must restore it before returning. - * @param aMaxSize the available space in which to lay out. Each dimension - * can either be constrained or unconstrained (a value of - * NS_UNCONSTRAINEDSIZE). If constrained you should choose a value - * that's less than or equal to the constrained size. If unconstrained - * you can choose as large a value as you like. - * - * It's okay to return a desired size that exceeds the max size if - * that's the smallest you can be, i.e. it's your minimum size. - * - * @param aDesiredRect out parameter where you should return the desired - * origin and size. You should include any space you want for border - * and padding in the desired size. - * - * The origin of the desired rect is relative to the upper-left of the - * local coordinate space. - * - * @param aReflowCommand the reflow command contains information about the - * type of change. - */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) = 0; -}; - -#endif /* nsIRunaround_h___ */ diff --git a/mozilla/layout/base/public/nsISpaceManager.h b/mozilla/layout/base/public/nsISpaceManager.h deleted file mode 100644 index 7909c4d257e..00000000000 --- a/mozilla/layout/base/public/nsISpaceManager.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsISpaceManager_h___ -#define nsISpaceManager_h___ - -#include "nsISupports.h" -#include "nsCoord.h" -#include "nsRect.h" - -class nsIFrame; -class nsVoidArray; -struct nsSize; - -// IID for the nsISpaceManager interface {17C8FB50-BE96-11d1-80B5-00805F8A274D} -#define NS_ISPACEMANAGER_IID \ -{ 0x17c8fb50, 0xbe96, 0x11d1, \ - {0x80, 0xb5, 0x0, 0x80, 0x5f, 0x8a, 0x27, 0x4d}} - -/** - * Information about a particular trapezoid within a band. The space described - * by the trapezoid is in one of three states: - *

      - *
    • available - *
    • occupied by one frame - *
    • occupied by more than one frame - *
    - */ -struct nsBandTrapezoid { - enum State {smAvailable, smOccupied, smOccupiedMultiple}; - - nscoord yTop, yBottom; // top and bottom y-coordinates - nscoord xTopLeft, xBottomLeft; // left edge x-coordinates - nscoord xTopRight, xBottomRight; // right edge x-coordinates - State state; // state of the space - union { - nsIFrame* frame; // frame occupying the space - const nsVoidArray* frames; // list of frames occupying the space - }; - - // Get the height of the trapezoid - nscoord GetHeight() {return yBottom - yTop;} - - // Get the bouding rect of the trapezoid - void GetRect(nsRect& aRect); - - // Set the trapezoid from a rectangle - void operator=(const nsRect& aRect); -}; - -/** - * Structure used for describing the space within a band. - * @see #GetBandData() - */ -struct nsBandData { - PRInt32 count; // 'out' parameter. Actual number of trapezoids in the band data - PRInt32 size; // 'in' parameter. The size of the array - nsBandTrapezoid* trapezoids; // 'out' parameter. Array of length 'size' -}; - -/** - * Interface for dealing with bands of available space. - * - * @see nsIRunaround - */ -class nsISpaceManager : public nsISupports { -public: - /** - * Get the frame that's associated with the space manager. This frame created - * the space manager, and the world coordinate space is relative to this frame. - * - * You can use QueryInterface() on this frame to get additional interfaces such - * as nsIAnchoredItems - */ - virtual nsIFrame* GetFrame() const = 0; - - /** - * Translate the current origin by the specified (dx, dy). This creates a new - * local coordinate space relative to the current coordinate space. - */ - virtual void Translate(nscoord aDx, nscoord aDy) = 0; - - /** - * Returns the current translation from local coordinate space to world - * coordinate space. This represents the accumulated calls to Translate(). - */ - virtual void GetTranslation(nscoord& aX, nscoord& aY) const = 0; - - /** - * Returns the y-most of the bottommost band, or 0 if there are no bands. - */ - virtual nscoord YMost() const = 0; - - /** - * Returns a band starting at the specified y-offset. The band data indicates - * which parts of the band are available, and which parts are unavailable - * - * The band data that is returned is in the coordinate space of the local - * coordinate system. - * - * The local coordinate space origin together with the max size describe a - * rectangle that's used to clip the underlying band of available space. - * - * @param aYOffset the y-offset of where the band begins. The coordinate is - * relative to the upper-left corner of the local coordinate space - * @param aMaxSize the size to use to constrain the band data - * @param aBandData out parameter used to return the list of - * trapezoids that describe the available space and the unavailable - * space. - * @returns the number of trapezoids in the band data. If the band data is - * not large enough, returns the negative of the number of - * trapezoids needed - */ - virtual PRInt32 GetBandData(nscoord aYOffset, - const nsSize& aMaxSize, - nsBandData& aBandData) const = 0; - - /** - * Add a rectangular region of unavailable space. The space is relative to - * the local coordinate system. - */ - virtual void AddRectRegion(const nsRect& aUnavailableSpace, nsIFrame* aFrame) = 0; - - /** - * Clears the list of regions representing the unavailable space. - */ - virtual void ClearRegions() = 0; -}; - -void inline nsBandTrapezoid::GetRect(nsRect& aRect) -{ - aRect.x = PR_MIN(xTopLeft, xBottomLeft); - aRect.y = yTop; - aRect.width = PR_MAX(xTopRight, xBottomRight) - aRect.x; - aRect.height = yBottom - yTop; -} - -void inline nsBandTrapezoid::operator=(const nsRect& aRect) -{ - xTopLeft = xBottomLeft = aRect.x; - xTopRight = xBottomRight = aRect.XMost(); - yTop = aRect.y; - yBottom = aRect.YMost(); -} - -#endif /* nsISpaceManager_h___ */ diff --git a/mozilla/layout/base/public/nsIStyleContext.h b/mozilla/layout/base/public/nsIStyleContext.h deleted file mode 100644 index 58325221a7e..00000000000 --- a/mozilla/layout/base/public/nsIStyleContext.h +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIStyleContext_h___ -#define nsIStyleContext_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsColor.h" -#include "nsCoord.h" -#include "nsMargin.h" -#include "nsFont.h" -#include "nsStyleCoord.h" - -class nsIFrame; -class nsIPresContext; -class nsIContent; -class nsISupportsArray; - -// SID e31e1bc0-ca9b-11d1-8031-006008159b5a -#define NS_STYLEFONT_SID \ -{0xe31e1bc0, 0xca9b, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -// SID 05953860-ca9c-11d1-8031-006008159b5a -#define NS_STYLECOLOR_SID \ -{0x05953860, 0xca9c, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -// SID 0ba04d20-d89e-11d1-8031-006008159b5a -#define NS_STYLESPACING_SID \ -{0x0ba04d20, 0xd89e, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -// SID 0a7036d0-d89e-11d1-8031-006008159b5a -#define NS_STYLEBORDER_SID \ -{0x0a7036d0, 0xd89e, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -// SID 4fb83b60-cf27-11d1-8031-006008159b5a -#define NS_STYLELIST_SID \ -{0x4fb83b60, 0xcf27, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -// SID AD5993F0-DA2B-11d1-80B9-00805F8A274D -#define NS_STYLEPOSITION_SID \ -{0xad5993f0, 0xda2b, 0x11d1, {0x80, 0xb9, 0x00, 0x80, 0x5f, 0x8a, 0x27, 0x4d}} - -// SID 3C29D620-DAF5-11D1-932B-00805F8ADD32 -#define NS_STYLETEXT_SID \ -{0x3c29d620, 0xdaf5, 0x11d1, {0x93, 0x2b, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} - -// SID 3C29D621-DAF5-11D1-932B-00805F8ADD32 -#define NS_STYLEDISPLAY_SID \ -{0x3c29d621, 0xdaf5, 0x11d1, {0x93, 0x2b, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} - -// Indicies into border/padding/margin arrays -#define NS_SIDE_TOP 0 -#define NS_SIDE_RIGHT 1 -#define NS_SIDE_BOTTOM 2 -#define NS_SIDE_LEFT 3 - -// The lifetime of these objects is managed by the nsIStyleContext. - -struct nsStyleStruct { - virtual const nsID& GetID(void) = 0; -}; - -struct nsStyleFont : public nsStyleStruct { - nsFont mFont; - PRUint8 mThreeD; // XXX fold this into nsFont - -protected: - nsStyleFont(const nsFont& aFont); - ~nsStyleFont(); -}; - -struct nsStyleColor : public nsStyleStruct { - nscolor mColor; - - PRUint8 mBackgroundAttachment; // See nsStyleConsts.h - PRUint8 mBackgroundFlags; // See nsStyleConsts.h - PRUint8 mBackgroundRepeat; // See nsStyleConsts.h - PRUint8 mCursor; // See nsStyleConsts.h NS_STYLE_CURSOR_* - - nscolor mBackgroundColor; - nscoord mBackgroundXPosition; - nscoord mBackgroundYPosition; - nsString mBackgroundImage; // absolute url string - - nsString mCursorImage; // url string - -protected: - nsStyleColor(); - ~nsStyleColor(); -}; - -struct nsStyleSpacing: public nsStyleStruct { - nsMargin mMargin; - nsMargin mPadding; - nsMargin mBorder; // automatic computed value (DON'T SET) - nsMargin mBorderPadding; // automatic computed value (DON'T SET) - -protected: - nsStyleSpacing(void); -}; - -struct nsStyleBorder: public nsStyleStruct { - PRUint8 mSizeFlag[4]; // See nsStyleConsts.h - PRUint8 mStyle[4]; // See nsStyleConsts.h - nsMargin mSize; - nscolor mColor[4]; - -protected: - nsStyleBorder(void); -}; - -struct nsStyleList : public nsStyleStruct { - PRUint8 mListStyleType; // See nsStyleConsts.h - PRUint8 mListStylePosition; - nsString mListStyleImage; // absolute url string - -protected: - nsStyleList(); - ~nsStyleList(); -}; - -struct nsStylePosition : public nsStyleStruct { - PRUint8 mPosition; // see nsStyleConsts.h - PRUint8 mOverflow; // see nsStyleConsts.h - PRUint8 mClipFlags; // see nsStyleConsts.h - - PRUint8 mLeftOffsetFlags; // see nsStyleConsts.h - PRUint8 mTopOffsetFlags; // see nsStyleConsts.h - PRUint8 mWidthFlags; // see nsStyleConsts.h - PRUint8 mHeightFlags; // see nsStyleConsts.h - - nscoord mLeftOffset; - nscoord mTopOffset; - nscoord mWidth; - nscoord mHeight; - - PRInt32 mZIndex; - nsMargin mClip; // offsets from respective edge - -protected: - nsStylePosition(); -}; - -// XXX missing: length, inherit and percentage support -struct nsStyleText : public nsStyleStruct { - PRUint8 mTextAlign; // see nsStyleConsts.h - PRUint8 mTextDecoration; // see nsStyleConsts.h - PRUint8 mTextTransform; // see nsStyleConsts.h - PRUint8 mWhiteSpace; // see nsStyleConsts.h - - nsStyleCoord mLetterSpacing; - nsStyleCoord mLineHeight; - nsStyleCoord mTextIndent; - nsStyleCoord mWordSpacing; - nsStyleCoord mVerticalAlign; // see nsStyleConsts.h for enums - -protected: - nsStyleText(); -}; - -struct nsStyleDisplay : public nsStyleStruct { - PRUint8 mDirection; // see nsStyleConsts.h NS_STYLE_DIRECTION_* - PRUint8 mDisplay; // see nsStyleConsts.h NS_STYLE_DISPLAY_* - PRUint8 mFloats; // see nsStyleConsts.h NS_STYLE_FLOAT_* - PRUint8 mBreakType; // see nsStyleConsts.h NS_STYLE_CLEAR_* - PRPackedBool mBreakBefore; - PRPackedBool mBreakAfter; - -protected: - nsStyleDisplay(); -}; - -//---------------------------------------------------------------------- - -#define NS_ISTYLECONTEXT_IID \ - { 0x26a4d970, 0xa342, 0x11d1, \ - {0x89, 0x74, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} } - -class nsIStyleContext : public nsISupports { -public: - virtual PRBool Equals(const nsIStyleContext* aOther) const = 0; - virtual PRUint32 HashValue(void) const = 0; - - virtual nsIStyleContext* GetParent(void) const = 0; - virtual nsISupportsArray* GetStyleRules(void) const = 0; - - // get a style data struct by ID, may return null - virtual nsStyleStruct* GetData(const nsIID& aSID) = 0; - - // call if you change style data after creation - virtual void RecalcAutomaticData(void) = 0; -}; - -// this is private to nsStyleSet, don't call it -extern NS_LAYOUT nsresult - NS_NewStyleContext(nsIStyleContext** aInstancePtrResult, - nsISupportsArray* aRules, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame); - -#endif /* nsIStyleContext_h___ */ diff --git a/mozilla/layout/base/public/nsIStyleRule.h b/mozilla/layout/base/public/nsIStyleRule.h deleted file mode 100644 index e79eff7dae8..00000000000 --- a/mozilla/layout/base/public/nsIStyleRule.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIStyleRule_h___ -#define nsIStyleRule_h___ - -#include - -#include "nslayout.h" -#include "nsISupports.h" - -class nsIStyleContext; -class nsIPresContext; - -// IID for the nsIStyleRule interface {40ae5c90-ad6a-11d1-8031-006008159b5a} -#define NS_ISTYLE_RULE_IID \ -{0x40ae5c90, 0xad6a, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIStyleRule : public nsISupports { -public: - virtual PRBool Equals(const nsIStyleRule* aRule) const = 0; - virtual PRUint32 HashValue(void) const = 0; - - virtual void MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) = 0; - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -#endif /* nsIStyleRule_h___ */ diff --git a/mozilla/layout/base/public/nsIStyleSet.h b/mozilla/layout/base/public/nsIStyleSet.h deleted file mode 100644 index c084ed98826..00000000000 --- a/mozilla/layout/base/public/nsIStyleSet.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsStyleSet_h___ -#define nsStyleSet_h___ - -#include -#include "nsISupports.h" -#include "nslayout.h" - -class nsIAtom; -class nsIStyleMolecule; -class nsIStyleRule; -class nsIStyleSheet; -class nsIStyleContext; -class nsIPresContext; -class nsIContent; -class nsIFrame; - - -// IID for the nsIStyleSet interface {e59396b0-b244-11d1-8031-006008159b5a} -#define NS_ISTYLE_SET_IID \ -{0xe59396b0, 0xb244, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIStyleSet : public nsISupports { -public: - virtual void AppendOverrideStyleSheet(nsIStyleSheet* aSheet) = 0; - virtual void InsertOverrideStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) = 0; - virtual void InsertOverrideStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) = 0; - virtual void RemoveOverrideStyleSheet(nsIStyleSheet* aSheet) = 0; - virtual PRInt32 GetNumberOfOverrideStyleSheets() = 0; - virtual nsIStyleSheet* GetOverrideStyleSheetAt(PRInt32 aIndex) = 0; - - virtual void AppendDocStyleSheet(nsIStyleSheet* aSheet) = 0; - virtual void InsertDocStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) = 0; - virtual void InsertDocStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) = 0; - virtual void RemoveDocStyleSheet(nsIStyleSheet* aSheet) = 0; - virtual PRInt32 GetNumberOfDocStyleSheets() = 0; - virtual nsIStyleSheet* GetDocStyleSheetAt(PRInt32 aIndex) = 0; - - virtual void AppendBackstopStyleSheet(nsIStyleSheet* aSheet) = 0; - virtual void InsertBackstopStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) = 0; - virtual void InsertBackstopStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) = 0; - virtual void RemoveBackstopStyleSheet(nsIStyleSheet* aSheet) = 0; - virtual PRInt32 GetNumberOfBackstopStyleSheets() = 0; - virtual nsIStyleSheet* GetBackstopStyleSheetAt(PRInt32 aIndex) = 0; - - - virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame) = 0; - - // xxx style rules enumeration - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) = 0; -}; - -extern NS_LAYOUT nsresult - NS_NewStyleSet(nsIStyleSet** aInstancePtrResult); - -#endif /* nsIStyleSet_h___ */ diff --git a/mozilla/layout/base/public/nsIStyleSheet.h b/mozilla/layout/base/public/nsIStyleSheet.h deleted file mode 100644 index bac20159aa0..00000000000 --- a/mozilla/layout/base/public/nsIStyleSheet.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIStyleSheet_h___ -#define nsIStyleSheet_h___ - -#include -#include "nsISupports.h" -class nsIAtom; -class nsIURL; -class nsIStyleRule; -class nsISupportsArray; -class nsIPresContext; -class nsIContent; -class nsIFrame; - -// IID for the nsIStyleSheet interface {8c4a80a0-ad6a-11d1-8031-006008159b5a} -#define NS_ISTYLE_SHEET_IID \ -{0x8c4a80a0, 0xad6a, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIStyleSheet : public nsISupports { -public: - virtual nsIURL* GetURL(void) = 0; - - // populate void array with nsIStyleRule* - virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) = 0; - - // XXX style rule enumerations - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -#endif /* nsIStyleSheet_h___ */ diff --git a/mozilla/layout/base/public/nsITextContent.h b/mozilla/layout/base/public/nsITextContent.h deleted file mode 100644 index fca6973fa58..00000000000 --- a/mozilla/layout/base/public/nsITextContent.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsITextContent_h___ -#define nsITextContent_h___ - -#include "nslayout.h" -class nsString; - -// IID for the nsITextContent interface -#define NS_ITEXTCONTENT_IID \ -{ 0xdd0755d0, 0x944d, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -// Abstract interface for textual content. Note that this interface -// does not implement nsISupports (which means it's not transitive or -// reflexive). This is done for efficiency reasons. -class nsITextContent { -public: - /* - * Get the total length of the text content. - */ - virtual PRInt32 GetLength() = 0; - - /* - * Copy a subrange of the text content into aBuf starting at aOffset - * for aCount characters. aBuf's length will be reset before the - * copy occurs and it's length upon return will reflect the amount - * of data copied. - */ - virtual void GetText(nsString& aBuf, PRInt32 aOffset, PRInt32 aCount) = 0; -}; - -#endif /* nsITextContent_h___ */ diff --git a/mozilla/layout/base/public/nsPresContext.h b/mozilla/layout/base/public/nsPresContext.h deleted file mode 100644 index 916ea9538b5..00000000000 --- a/mozilla/layout/base/public/nsPresContext.h +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIPresContext_h___ -#define nsIPresContext_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsRect.h" - -class nsIImage; -class nsILinkHandler; -class nsIPresShell; -class nsIRenderingContext; -class nsIFrame; -class nsIStyleContext; -class nsIFontMetrics; -class nsIContent; -class nsViewManager; -class nsIView; -class nsIFontCache; -class nsIDeviceContext; -class nsString; -struct nsFont; - -#define NS_IPRESCONTEXT_IID \ -{ 0x0a5d12e0, 0x944e, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - - -// An interface for presentation contexts. Presentation contexts are -// objects that provide an outer context for a presentation shell. -class nsIPresContext : public nsISupports { -public: - /** - * Set the presentation shell that this context is bound to. - * A presentation context may only be bound to a single shell. - */ - virtual void SetShell(nsIPresShell* aShell) = 0; - - /** - * Get the PresentationShell that this context is bound to. - */ - virtual nsIPresShell* GetShell() = 0; - - /** - * Resolve style for the given piece of content that will be a child - * of the aParentFrame frame. - */ - virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, - nsIFrame* aParentFrame) = 0; - - /** - * Get the font metrics for a given font. - */ - virtual nsIFontMetrics* GetMetricsFor(const nsFont& aFont) = 0; - - /** - * Get the default font - */ - virtual const nsFont& GetDefaultFont(void) = 0; - - /** - * Load an image for the given url name for the given frame. When - * the image is ready for rendering the frame will be repainted. - * - * If the image is ready then this method will return the image, - * otherwise it will return nsnull and guarantee that the frame - * is repained when the image is ready. - * - * XXX this api needs work; the frame can't find out the size when - * it arrives nor can it find out any error information, etc. - */ - virtual nsIImage* LoadImage(const nsString& aURL, nsIFrame* aForFrame) = 0; - - /** - * Stop any image loading being done on behalf of the argument frame. - */ - virtual void StopLoadImage(nsIFrame* aForFrame) = 0; - - NS_IMETHOD SetContainer(nsISupports* aContainer) = 0; - - NS_IMETHOD GetContainer(nsISupports** aResult) = 0; - - NS_IMETHOD SetLinkHandler(nsILinkHandler* aHandler) = 0; - - NS_IMETHOD GetLinkHandler(nsILinkHandler** aResult) = 0; - - /** - * Get the currently visible portion of the RootContent ILayoutable. - * The units returned are in pixels. An acceptable answer is "null" - * which means "I don't know". - *

    Speculative

    - */ - virtual nsRect GetVisibleArea() = 0; - - /** - * Set the currently visible area. This is the size and location - * of the visible portion of the RootContent ILayoutable. - */ - virtual void SetVisibleArea(const nsRect& r) = 0; - - /** - * Return true if this presentation context is a paginated - * context. - */ - virtual PRBool IsPaginated() = 0; - - /** - * Return the page width if this is a paginated context. - */ - virtual nscoord GetPageWidth() = 0; - - /** - * Return the page height if this is a paginated context - */ - virtual nscoord GetPageHeight() = 0; - - virtual float GetPixelsToTwips() const = 0; - virtual float GetTwipsToPixels() const = 0; - - //be sure to Relase() after you are done with the Get() - virtual nsIDeviceContext * GetDeviceContext() const = 0; -}; - -// Factory method to create a "galley" presentation context (galley is -// a kind of view that has no limit to the size of a page) -extern NS_LAYOUT nsresult - NS_NewGalleyContext(nsIPresContext** aInstancePtrResult); - -// Factory method to create a "paginated" presentation context for -// the screen. -extern NS_LAYOUT nsresult - NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult); - -#endif /* nsIPresContext_h___ */ diff --git a/mozilla/layout/base/public/nsStyleCoord.h b/mozilla/layout/base/public/nsStyleCoord.h deleted file mode 100644 index 0df2a9abec6..00000000000 --- a/mozilla/layout/base/public/nsStyleCoord.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsStyleCoord_h___ -#define nsStyleCoord_h___ - -#include "nscore.h" -#include "nsCoord.h" -class nsString; - -enum nsStyleUnit { - eStyleUnit_Twips = 0, // (nscoord) value is twips - eStyleUnit_Percent = 1, // (float) 1.0 == 100% - eStyleUnit_Normal = 2, // (no value) - eStyleUnit_Auto = 3, // (no value) - eStyleUnit_Inherit = 4, // (no value) value should be inherited - eStyleUnit_Proportional = 5, // (int) value has proportional meaning - eStyleUnit_Enumerated = 6, // (int) value has enumerated meaning -}; - -class nsStyleCoord { -public: - nsStyleCoord(void); // sets to 0 twips - nsStyleCoord(nscoord aValue); - nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit); - nsStyleCoord(float aValue); - nsStyleCoord(const nsStyleCoord& aCopy); - - nsStyleCoord& operator=(const nsStyleCoord& aCopy); - PRBool operator==(const nsStyleCoord& aOther) const; - - nsStyleUnit GetUnit(void) const { return mUnit; } - nscoord GetCoordValue(void) const; - PRInt32 GetIntValue(void) const; - float GetFloatValue(void) const; - - void Set(nscoord aValue); - void Set(PRInt32 aValue, nsStyleUnit aUnit); - void Set(float aValue); - void SetNormal(void); - void SetAuto(void); - void SetInherit(void); - - void AppendToString(nsString& aBuffer) const; - void ToString(nsString& aBuffer) const; - -protected: - nsStyleUnit mUnit; - union { - PRInt32 mInt; // nscoord is a PRInt32 for now - float mFloat; - } mValue; -}; - -inline PRInt32 nsStyleCoord::GetCoordValue(void) const -{ - NS_ASSERTION((mUnit == eStyleUnit_Twips), "not a coord value"); - if (mUnit == eStyleUnit_Twips) { - return mValue.mInt; - } - return 0; -} - -inline PRInt32 nsStyleCoord::GetIntValue(void) const -{ - NS_ASSERTION((mUnit == eStyleUnit_Proportional) || - (mUnit == eStyleUnit_Enumerated), "not an int value"); - if ((mUnit == eStyleUnit_Proportional) || - (mUnit == eStyleUnit_Enumerated)) { - return mValue.mInt; - } - return 0; -} - -inline float nsStyleCoord::GetFloatValue(void) const -{ - NS_ASSERTION(mUnit == eStyleUnit_Percent, "not a float value"); - if (mUnit == eStyleUnit_Percent) { - return mValue.mFloat; - } - return 0.0f; -} - - - -#endif /* nsStyleCoord_h___ */ diff --git a/mozilla/layout/base/public/nslayout.h b/mozilla/layout/base/public/nslayout.h deleted file mode 100644 index 585c564e22b..00000000000 --- a/mozilla/layout/base/public/nslayout.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nslayout_h___ -#define nslayout_h___ - -#include "nscore.h" - -// Note: For now, NS_LAYOUT and NS_HTML are joined at the hip -#if defined(_IMPL_NS_LAYOUT) || defined(_IMPL_NS_HTML) -#define NS_LAYOUT NS_EXPORT -#define NS_HTML NS_EXPORT -#else -#define NS_LAYOUT NS_IMPORT -#define NS_HTML NS_IMPORT -#endif - -#endif /* nslayout_h___ */ diff --git a/mozilla/layout/base/src/Makefile b/mozilla/layout/base/src/Makefile deleted file mode 100644 index c5a0c6e8281..00000000000 --- a/mozilla/layout/base/src/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../.. - -LIBRARY_NAME = raptorlayout_s - -DEFINES = -D_IMPL_NS_LAYOUT - -CPPSRCS = \ - nsContainerFrame.cpp \ - nsDocument.cpp \ - nsFrame.cpp \ - nsGalleyContext.cpp \ - nsPresContext.cpp \ - nsPresShell.cpp \ - nsPrintPreviewContext.cpp \ - nsReflowCommand.cpp \ - nsSpaceManager.cpp \ - nsSplittableFrame.cpp \ - nsStyleCoord.cpp \ - nsStyleContext.cpp \ - nsStyleSet.cpp \ - $(NULL) - -EXPORTS = \ - $(NULL) - -MODULE = raptor - -REQUIRES = xpcom raptor dom - -include $(DEPTH)/config/config.mk - -TARGETS = $(LIBRARY) - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/base/src/makefile.win b/mozilla/layout/base/src/makefile.win deleted file mode 100644 index bd4ce0fc64f..00000000000 --- a/mozilla/layout/base/src/makefile.win +++ /dev/null @@ -1,52 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -LIBRARY_NAME=raptorlayout_s -DEFINES=-D_IMPL_NS_LAYOUT -DWIN32_LEAN_AND_MEAN -CPPSRCS=nsContainerFrame.cpp nsDocument.cpp nsFrame.cpp \ - nsGalleyContext.cpp nsPresContext.cpp nsPresShell.cpp \ - nsPrintPreviewContext.cpp nsReflowCommand.cpp nsSpaceManager.cpp \ - nsSplittableFrame.cpp nsStyleCoord.cpp nsStyleContext.cpp \ - nsStyleSet.cpp -MODULE=raptor -REQUIRES=xpcom raptor dom -CPP_OBJS=.\$(OBJDIR)\nsContainerFrame.obj .\$(OBJDIR)\nsDocument.obj \ - .\$(OBJDIR)\nsFrame.obj .\$(OBJDIR)\nsGalleyContext.obj \ - .\$(OBJDIR)\nsPresContext.obj .\$(OBJDIR)\nsPresShell.obj \ - .\$(OBJDIR)\nsPrintPreviewContext.obj \ - .\$(OBJDIR)\nsReflowCommand.obj .\$(OBJDIR)\nsSpaceManager.obj \ - .\$(OBJDIR)\nsSplittableFrame.obj .\$(OBJDIR)\nsStyleCoord.obj \ - .\$(OBJDIR)\nsStyleContext.obj .\$(OBJDIR)\nsStyleSet.obj - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \ - -I$(XPDIST)\public\dom -I$(XPDIST)\public\js - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - -clobber:: - rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/layout/base/src/nsContainerFrame.cpp b/mozilla/layout/base/src/nsContainerFrame.cpp deleted file mode 100644 index ebb7c189d4b..00000000000 --- a/mozilla/layout/base/src/nsContainerFrame.cpp +++ /dev/null @@ -1,1449 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsContainerFrame.h" -#include "nsIContent.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsIRunaround.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsIContentDelegate.h" -#include "nsRect.h" -#include "nsPoint.h" -#include "nsGUIEvent.h" -#include "nsStyleConsts.h" -#include "nsIView.h" - -#ifdef NS_DEBUG -#undef NOISY -#else -#undef NOISY -#endif - -static NS_DEFINE_IID(kIStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); - -nsContainerFrame::nsContainerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsSplittableFrame(aContent, aIndexInParent, aParent), - mLastContentIsComplete(PR_TRUE) -{ -} - -nsContainerFrame::~nsContainerFrame() -{ - // Delete our child frames before doing anything else. In particular - // we do all of this before our base class releases it's hold on the - // view. - for (nsIFrame* child = mFirstChild; child; ) { - nsIFrame* nextChild; - - child->GetNextSibling(nextChild); - child->DeleteFrame(); - child = nextChild; - } -} - -void nsContainerFrame::PrepareContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsContainerFrame* aContFrame) -{ - // Append the continuing frame to the flow - aContFrame->AppendToFlow(this); - - // Initialize it's content offsets. Note that we assume for now that - // the continuingFrame will map the remainder of the content and - // that therefore mLastContentIsComplete will be true. - PRInt32 nextOffset = NextChildOffset(); - aContFrame->mFirstContentOffset = nextOffset; - aContFrame->mLastContentOffset = nextOffset; - aContFrame->mLastContentIsComplete = PR_TRUE; - - // Resolve style for the continuing frame and set its style context. - // XXX presumptive - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(mContent, aParent); - aContFrame->SetStyleContext(styleContext); - NS_RELEASE(styleContext); -} - -NS_METHOD nsContainerFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsIContentDelegate* contentDelegate = mContent->GetDelegate(aPresContext); - - aContinuingFrame = contentDelegate->CreateFrame(aPresContext, mContent, - mIndexInParent, aParent); - NS_RELEASE(contentDelegate); - - PrepareContinuingFrame(aPresContext, aParent, (nsContainerFrame*)aContinuingFrame); - return NS_OK; -} - - -///////////////////////////////////////////////////////////////////////////// -// Child frame enumeration - -NS_METHOD nsContainerFrame::ChildCount(PRInt32& aChildCount) const -{ - aChildCount = mChildCount; - return NS_OK; -} - -NS_METHOD nsContainerFrame::ChildAt(PRInt32 aIndex, nsIFrame*& aFrame) const -{ - // Check that the index is in range - if ((aIndex < 0) || (aIndex >= mChildCount)) { - aFrame = nsnull; - return NS_OK; - } - - aFrame = mFirstChild; - while ((aIndex-- > 0) && (aFrame != nsnull)) { - aFrame->GetNextSibling(aFrame); - } - return NS_OK; -} - -NS_METHOD nsContainerFrame::IndexOf(const nsIFrame* aChild, PRInt32& aIndex) const -{ - aIndex = -1; // initialize out parameter - - for (nsIFrame* f = mFirstChild; f != nsnull; f->GetNextSibling(f)) { - aIndex++; - - if (f == aChild) - break; - } - - return NS_OK; -} - -NS_METHOD nsContainerFrame::FirstChild(nsIFrame*& aFirstChild) const -{ - aFirstChild = mFirstChild; - return NS_OK; -} - -NS_METHOD nsContainerFrame::NextChild(const nsIFrame* aChild, nsIFrame*& aNextChild) const -{ - NS_PRECONDITION(aChild != nsnull, "null pointer"); - aChild->GetNextSibling(aNextChild); - return NS_OK; -} - -NS_METHOD nsContainerFrame::PrevChild(const nsIFrame* aChild, nsIFrame*& aPrevChild) const -{ - NS_PRECONDITION(aChild != nsnull, "null pointer"); - - if (mFirstChild == aChild) { - aPrevChild = nsnull; - } else { - aPrevChild = mFirstChild; - - while ((aPrevChild != nsnull)) { - nsIFrame* nextChild; - - aPrevChild->GetNextSibling(nextChild); - if (nextChild == aChild) { - break; - } - - aPrevChild = nextChild; - } - } - - return NS_OK; -} - -NS_METHOD nsContainerFrame::LastChild(nsIFrame*& aLastChild) const -{ - aLastChild = mFirstChild; - - if (nsnull != aLastChild) { - nsIFrame* nextChild; - - aLastChild->GetNextSibling(nextChild); - while (nextChild != nsnull) { - aLastChild = nextChild; - aLastChild->GetNextSibling(nextChild); - } - } - - return NS_OK; -} - -///////////////////////////////////////////////////////////////////////////// -// Painting - -NS_METHOD nsContainerFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -// aDirtyRect is in our coordinate system -// child rect's are also in our coordinate system -void nsContainerFrame::PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsIView *pView; - - kid->GetView(pView); - if (nsnull == pView) { - nsRect kidRect; - kid->GetRect(kidRect); - nsRect damageArea; - PRBool overlap = damageArea.IntersectRect(aDirtyRect, kidRect); - if (overlap) { - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - aRenderingContext.PushState(); - aRenderingContext.Translate(kidRect.x, kidRect.y); - kid->Paint(aPresContext, aRenderingContext, kidDamageArea); - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, kidRect.width, kidRect.height); - } - aRenderingContext.PopState(); - } - } - else { - NS_RELEASE(pView); - } - kid->GetNextSibling(kid); - } -} - -///////////////////////////////////////////////////////////////////////////// -// Events - -NS_METHOD nsContainerFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ - aEventStatus = nsEventStatus_eIgnore; - - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsRect kidRect; - kid->GetRect(kidRect); - if (kidRect.Contains(aEvent->point)) { - aEvent->point.MoveBy(-kidRect.x, -kidRect.y); - kid->HandleEvent(aPresContext, aEvent, aEventStatus); - aEvent->point.MoveBy(kidRect.x, kidRect.y); - break; - } - kid->GetNextSibling(kid); - } - - return NS_OK; -} - -NS_METHOD nsContainerFrame::GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) -{ - aCursor = NS_STYLE_CURSOR_INHERIT; - - nsIFrame* kid = mFirstChild; - nsPoint tmp; - while (nsnull != kid) { - nsRect kidRect; - kid->GetRect(kidRect); - if (kidRect.Contains(aPoint)) { - tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y); - kid->GetCursorAt(aPresContext, tmp, aFrame, aCursor); - break; - } - kid->GetNextSibling(kid); - } - return NS_OK; -} - -///////////////////////////////////////////////////////////////////////////// -// Managing content mapping - -// Get the offset for the next child content, i.e. the child after the -// last child that fit in us -PRInt32 nsContainerFrame::NextChildOffset() const -{ - PRInt32 result; - - if (mChildCount > 0) { - result = mLastContentOffset; - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - if (mLastContentIsComplete) { - result++; - } - } else { - result = mFirstContentOffset; - } - return result; -} - -/** - * Sets the first content offset based on the first child frame. - */ -void nsContainerFrame::SetFirstContentOffset(const nsIFrame* aFirstChild) -{ - NS_PRECONDITION(nsnull != aFirstChild, "bad argument"); - NS_PRECONDITION(IsChild(aFirstChild), "bad geometric parent"); - - if (ChildIsPseudoFrame(aFirstChild)) { - nsContainerFrame* pseudoFrame = (nsContainerFrame*)aFirstChild; - mFirstContentOffset = pseudoFrame->mFirstContentOffset; - } else { - aFirstChild->GetIndexInParent(mFirstContentOffset); - } -} - -/** - * Sets the last content offset based on the last child frame. If the last - * child is a pseudo frame then it sets mLastContentIsComplete to be the same - * as the last child's mLastContentIsComplete - */ -void nsContainerFrame::SetLastContentOffset(const nsIFrame* aLastChild) -{ - NS_PRECONDITION(nsnull != aLastChild, "bad argument"); - NS_PRECONDITION(IsChild(aLastChild), "bad geometric parent"); - - if (ChildIsPseudoFrame(aLastChild)) { - nsContainerFrame* pseudoFrame = (nsContainerFrame*)aLastChild; - mLastContentOffset = pseudoFrame->mLastContentOffset; -#ifdef NS_DEBUG - pseudoFrame->VerifyLastIsComplete(); -#endif - mLastContentIsComplete = pseudoFrame->mLastContentIsComplete; - } else { - aLastChild->GetIndexInParent(mLastContentOffset); - } -#ifdef NS_DEBUG - if (mLastContentOffset < mFirstContentOffset) { - DumpTree(); - } -#endif - NS_ASSERTION(mLastContentOffset >= mFirstContentOffset, "unexpected content mapping"); -} - -///////////////////////////////////////////////////////////////////////////// -// Pseudo frame related - -// Returns true if this frame is being used a pseudo frame -PRBool nsContainerFrame::IsPseudoFrame() const -{ - PRBool result = PR_FALSE; - - if (nsnull != mGeometricParent) { - nsIContent* parentContent; - - mGeometricParent->GetContent(parentContent); - if (parentContent == mContent) { - result = PR_TRUE; - } - NS_RELEASE(parentContent); - } - - return result; -} - -// Returns true if aChild is being used as a pseudo frame -PRBool nsContainerFrame::ChildIsPseudoFrame(const nsIFrame* aChild) const -{ - NS_PRECONDITION(IsChild(aChild), "bad geometric parent"); - - nsIContent* childContent; - PRBool result; - - aChild->GetContent(childContent); - result = PRBool(childContent == mContent); - NS_RELEASE(childContent); - return result; -} - -///////////////////////////////////////////////////////////////////////////// -// Helper member functions - -/** - * Reflow a child frame and return the status of the reflow. If the - * child is complete and it has next-in-flows (it was a splittable child) - * then delete the next-in-flows. - */ -nsIFrame::ReflowStatus -nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - ReflowStatus status; - - aKidFrame->ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, status); - - if (frComplete == status) { - nsIFrame* kidNextInFlow; - - aKidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull != kidNextInFlow) { - // Remove all of the childs next-in-flows. Make sure that we ask - // the right parent to do the removal (it's possible that the - // parent is not this because we are executing pullup code) - nsIFrame* parent; - - aKidFrame->GetGeometricParent(parent); - ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aKidFrame); - } - } - return status; -} - -/** - * Reflow a child frame and return the status of the reflow. If the child - * is complete and it has next-in-flows, then delete the next-in-flows. - * - * Use this version if you have a space manager. Checks if the child frame - * supports interface nsIRunaround. If it does, interface nsIRunaround is - * used to reflow the child; otherwise interface nsIFrame is used. If the - * child is splittable then runaround is done using continuing frames. - */ -nsIFrame::ReflowStatus -nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize) -{ - nsIRunaround* reflowRunaround; - ReflowStatus status; - - // Get the band for this y-offset and see whether there are any floaters - // that have changed the left/right edges. - // - // XXX In order to do this efficiently we should move all this code to - // nsBlockFrame since it already has band data, and it's probably the only - // one who calls this routine anyway - nsBandData bandData; - nsBandTrapezoid trapezoids[12]; - nsBandTrapezoid* trapezoid = trapezoids; - nsRect availBand; - nsSize availSize = aMaxSize; - - bandData.trapezoids = trapezoids; - bandData.size = 12; - aSpaceManager->GetBandData(0, aMaxSize, bandData); - - if (bandData.count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < bandData.count; i++) { - nsBandTrapezoid* trapezoid = &trapezoids[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &trapezoids[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availBand); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availBand); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availBand.x = availBand.XMost(); - } - availBand.width = 0; - } - - // Does the child frame want to do continuation-based runaround? - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable == frSplittableNonRectangular) { - // Reduce the max height to the band height. - availSize.height = availBand.height; - } - - nsStyleSpacing* spacing; - - aKidFrame->GetStyleData(kIStyleSpacingSID, (nsStyleStruct*&)spacing); - - if (aMaxSize.width != NS_UNCONSTRAINEDSIZE) { - if ((availBand.x > 0) || (availBand.XMost() < aMaxSize.width)) { - // There are left/right floaters. - availSize.width = availBand.width; - } - - // Reduce the available width by the kid's left/right margin - availSize.width -= spacing->mMargin.left + spacing->mMargin.right; - } - - // Does the child frame support interface nsIRunaround? - if (NS_OK == aKidFrame->QueryInterface(kIRunaroundIID, (void**)&reflowRunaround)) { - // Yes, the child frame wants to interact directly with the space manager. - nscoord tx = availBand.x + spacing->mMargin.left; - - // Translate the local coordinate space to the current left edge plus any - // left margin the child wants - aSpaceManager->Translate(tx, 0); - - reflowRunaround->ResizeReflow(aPresContext, aSpaceManager, availSize, - aDesiredRect, aMaxElementSize, status); - aDesiredRect.x += availBand.x; - - // Translate back - aSpaceManager->Translate(-tx, 0); - - } else { - // No, use interface nsIFrame instead. - nsReflowMetrics desiredSize; - - aKidFrame->ResizeReflow(aPresContext, desiredSize, availSize, - aMaxElementSize, status); - - // Return the desired rect - aDesiredRect.x = availBand.x; - aDesiredRect.y = 0; - aDesiredRect.width = desiredSize.width; - aDesiredRect.height = desiredSize.height; - } - - if (frComplete == status) { - nsIFrame* kidNextInFlow; - - aKidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull != kidNextInFlow) { - // Remove all of the childs next-in-flows. Make sure that we ask - // the right parent to do the removal (it's possible that the - // parent is not this because we are executing pullup code) - nsIFrame* parent; - - aKidFrame->GetGeometricParent(parent); - ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aKidFrame); - } - } - - return status; -} - -/** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow - * pointers - * - * Updates the child count and content offsets of all containers that are - * affected - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise - */ -PRBool nsContainerFrame::DeleteChildsNextInFlow(nsIFrame* aChild) -{ - NS_PRECONDITION(IsChild(aChild), "bad geometric parent"); - - nsIFrame* nextInFlow; - nsContainerFrame* parent; - - aChild->GetNextInFlow(nextInFlow); - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); - - // If the next-in-flow has a next-in-flow then delete it, too (and - // delete it first). - nsIFrame* nextNextInFlow; - - nextInFlow->GetNextInFlow(nextNextInFlow); - if (nsnull != nextNextInFlow) { - ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(nextInFlow); - } - -#ifdef NS_DEBUG - PRInt32 childCount; - nsIFrame* firstChild; - - nextInFlow->ChildCount(childCount); - nextInFlow->FirstChild(firstChild); - - NS_ASSERTION(childCount == 0, "deleting !empty next-in-flow"); - - NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); -#endif - - // Disconnect the next-in-flow from the flow list - nextInFlow->BreakFromPrevFlow(); - - // Take the next-in-flow out of the parent's child list - if (parent->mFirstChild == nextInFlow) { - nextInFlow->GetNextSibling(parent->mFirstChild); - if (nsnull != parent->mFirstChild) { - parent->SetFirstContentOffset(parent->mFirstChild); - if (parent->IsPseudoFrame()) { - parent->PropagateContentOffsets(); - } - } - - // When a parent loses it's last child and that last child is a - // pseudo-frame then the parent's content offsets are now wrong. - // However, we know that the parent will eventually be reflowed - // in one of two ways: it will either get a chance to pullup - // children or it will be deleted because it's prev-in-flow - // (e.g. this) is complete. In either case, the content offsets - // will be repaired. - - } else { - nsIFrame* nextSibling; - - // Because the next-in-flow is not the first child of the parent - // we know that it shares a parent with aChild. Therefore, we need - // to capture the next-in-flow's next sibling (in case the - // next-in-flow is the last next-in-flow for aChild AND the - // next-in-flow is not the last child in parent) - NS_ASSERTION(((nsContainerFrame*)parent)->IsChild(aChild), "screwy flow"); - aChild->GetNextSibling(nextSibling); - NS_ASSERTION(nextSibling == nextInFlow, "unexpected sibling"); - - nextInFlow->GetNextSibling(nextSibling); - aChild->SetNextSibling(nextSibling); - } - - // Delete the next-in-flow frame and adjust it's parent's child count - nextInFlow->DeleteFrame(); - parent->mChildCount--; -#ifdef NS_DEBUG - if (0 != parent->mChildCount) { - parent->CheckContentOffsets(); - } - - aChild->GetNextInFlow(nextInFlow); - NS_POSTCONDITION(nsnull == nextInFlow, "non null next-in-flow"); -#endif - - return PR_TRUE; -} - -void nsContainerFrame::PropagateContentOffsets() -{ - NS_PRECONDITION(IsPseudoFrame(), "not a pseudo frame"); - nsContainerFrame* parent = (nsContainerFrame*)mGeometricParent; - - if (nsnull != parent) { - // If we're the first child frame then update our parent's content offset - if (parent->mFirstChild == this) { - parent->mFirstContentOffset = mFirstContentOffset; - } - - // If we're the last child frame then update our parent's content offset - if (nsnull == mNextSibling) { - parent->mLastContentOffset = mLastContentOffset; - parent->mLastContentIsComplete = mLastContentIsComplete; - } - - // If the parent is being used as a pseudo frame then we need to propagate - // the content offsets upwards to its parent frame - if (parent->IsPseudoFrame()) { - parent->PropagateContentOffsets(); - } - } -} - -/** - * Push aFromChild and its next siblings to the next-in-flow. Change the - * geometric parent of each frame that's pushed. If there is no next-in-flow - * the frames are placed on the overflow list (and the geometric parent is - * left unchanged). - * - * Updates the next-in-flow's child count and content offsets. Does - * not update the pusher's child count or last content offset. - * - * @param aFromChild the first child frame to push. It is disconnected from - * aPrevSibling - * @param aPrevSibling aFromChild's previous sibling. Must not be null. It's - * an error to push a parent's first child frame - * @param aNextInFlowsLastChildIsComplete the next-in-flow's - * mLastContentIsComplete flag. This is used when refilling an - * empty next-in-flow that was drained by the caller. - * - */ -// Note: we cannot VerifyLastIsComplete here because the caller is -// responsible for setting it. -void nsContainerFrame::PushChildren(nsIFrame* aFromChild, - nsIFrame* aPrevSibling, - PRBool aNextInFlowsLastContentIsComplete) -{ - NS_PRECONDITION(nsnull != aFromChild, "null pointer"); - NS_PRECONDITION(nsnull != aPrevSibling, "pushing first child"); -#ifdef NS_DEBUG - nsIFrame* prevNextSibling; - - aPrevSibling->GetNextSibling(prevNextSibling); - NS_PRECONDITION(prevNextSibling == aFromChild, "bad prev sibling"); -#endif - - // Disconnect aFromChild from its previous sibling - aPrevSibling->SetNextSibling(nsnull); - - // Do we have a next-in-flow? - nsContainerFrame* nextInFlow = (nsContainerFrame*)mNextInFlow; - if (nsnull != nextInFlow) { - PRInt32 numChildren = 0; - nsIFrame* lastChild = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids (childCount=%d)\n", mChildCount); - { - nsContainerFrame* flow = (nsContainerFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsContainerFrame*) flow->mNextInFlow; - } - } -#endif - // Compute the number of children being pushed, and for each child change - // its geometric parent. Remember the last child - for (nsIFrame* f = aFromChild; nsnull != f; f->GetNextSibling(f)) { - numChildren++; -#ifdef NOISY - printf(" "); - ((nsFrame*)f)->ListTag(stdout); - printf("\n"); -#endif - lastChild = f; - f->SetGeometricParent(nextInFlow); - - nsIFrame* contentParent; - - f->GetContentParent(contentParent); - if (this == contentParent) { - f->SetContentParent(nextInFlow); - } - } - NS_ASSERTION(numChildren > 0, "no children to push"); - - // Prepend the frames to our next-in-flow's child list - lastChild->SetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mFirstChild = aFromChild; - - // Update our next-in-flow's first content offset and child count - nextInFlow->SetFirstContentOffset(aFromChild); - if (0 == nextInFlow->mChildCount) { - nextInFlow->SetLastContentOffset(lastChild); - // If the child is pseudo-frame then SetLastContentOffset will - // have updated the next-in-flow's mLastContentIsComplete flag, - // otherwise we have to do it. - if (!nextInFlow->ChildIsPseudoFrame(lastChild)) { - nsIFrame* lastChildNextInFlow; - - lastChild->GetNextInFlow(lastChildNextInFlow); - nextInFlow->mLastContentIsComplete = PRBool(nsnull == lastChildNextInFlow); - } - } - nextInFlow->mChildCount += numChildren; -#ifdef NS_DEBUG - nextInFlow->VerifyLastIsComplete(); -#endif - - // If the next-in-flow is being used as a pseudo frame then we need - // to propagate the content offsets upwards to its parent frame - if (nextInFlow->IsPseudoFrame()) { - nextInFlow->PropagateContentOffsets(); - } - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d)\n", mChildCount); - { - nsContainerFrame* flow = (nsContainerFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsContainerFrame*) flow->mNextInFlow; - } - } -#endif - } else { - // Add the frames to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids to my overflow list\n"); -#endif - mOverflowList = aFromChild; - } -} - -// Note: mLastContentIsComplete is not set correctly by this routine -// (we don't always know the correct value at this time) -nsIFrame* nsContainerFrame::PullUpOneChild(nsContainerFrame* aNextInFlow, - nsIFrame* aLastChild) -{ - NS_PRECONDITION(nsnull != aNextInFlow, "null ptr"); -#ifdef NS_DEBUG - if (nsnull != aLastChild) { - NS_PRECONDITION(IsLastChild(aLastChild), "bad last child"); - } -#endif - - // Get first available frame from the next-in-flow - NS_ASSERTION(nsnull == aNextInFlow->mOverflowList, "bad next in flow"); - nsIFrame* kidFrame = aNextInFlow->mFirstChild; - if (nsnull == kidFrame) { - return nsnull; - } - -#ifdef NOISY - ListTag(stdout); - printf(": pulled "); - kidFrame->ListTag(stdout); - printf("\n"); -#endif - - // Take the frame away from the next-in-flow. Update it's first - // content offset and propagate upward the offset if the - // next-in-flow is a pseudo-frame. - kidFrame->GetNextSibling(aNextInFlow->mFirstChild); - aNextInFlow->mChildCount--; - if (nsnull != aNextInFlow->mFirstChild) { - aNextInFlow->SetFirstContentOffset(aNextInFlow->mFirstChild); - if (aNextInFlow->IsPseudoFrame()) { - aNextInFlow->PropagateContentOffsets(); - } - } else { -#ifdef NOISY - ListTag(stdout); - printf(": drained next-in-flow %p\n", aNextInFlow); -#endif - } - - // Now give the frame to this container - kidFrame->SetGeometricParent(this); - - nsIFrame* contentParent; - - kidFrame->GetContentParent(contentParent); - if (aNextInFlow == contentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == aLastChild) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - // If we are a pseudo-frame propagate our first offset upward - if (IsPseudoFrame()) { - PropagateContentOffsets(); - } - } else { - aLastChild->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - return kidFrame; -} - -/** - * Moves any frames on the overflwo lists (the prev-in-flow's overflow list and - * the receiver's overflow list) to the child list. - * - * Updates this frame's child count and content mapping. - * - * @return PR_TRUE if any frames were moved and PR_FALSE otherwise - */ -PRBool nsContainerFrame::MoveOverflowToChildList() -{ - PRBool result = PR_FALSE; - - // Check for an overflow list with our prev-in-flow - nsContainerFrame* prevInFlow = (nsContainerFrame*)mPrevInFlow; - if (nsnull != prevInFlow) { - if (nsnull != prevInFlow->mOverflowList) { - NS_ASSERTION(nsnull == mFirstChild, "bad overflow list"); - AppendChildren(prevInFlow->mOverflowList); - prevInFlow->mOverflowList = nsnull; - result = PR_TRUE; - } - } - - // It's also possible that we have an overflow list for ourselves - if (nsnull != mOverflowList) { - NS_ASSERTION(nsnull != mFirstChild, "overflow list but no mapped children"); - AppendChildren(mOverflowList, PR_FALSE); - mOverflowList = nsnull; - result = PR_TRUE; - } - - return result; -} - -/** - * Append child list starting at aChild to this frame's child list. Used for - * processing of the overflow list. - * - * Updates this frame's child count and content mapping. - * - * @param aChild the beginning of the child list - * @param aSetParent if true each child's geometric (and content parent if - * they're the same) parent is set to this frame. - */ -void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent) -{ - // Link the frames into our child frame list - if (nsnull == mFirstChild) { - // We have no children so aChild becomes the first child - mFirstChild = aChild; - } else { - nsIFrame* lastChild; - - LastChild(lastChild); - lastChild->SetNextSibling(aChild); - } - - // Update our child count and last content offset - nsIFrame* lastChild; - for (nsIFrame* f = aChild; nsnull != f; f->GetNextSibling(f)) { - lastChild = f; - mChildCount++; - - // Reset the geometric parent if requested - if (aSetParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - - f->GetGeometricParent(geometricParent); - f->GetContentParent(contentParent); - if (contentParent == geometricParent) { - f->SetContentParent(this); - } - f->SetGeometricParent(this); - } - } - - // Update our content mapping - if (mFirstChild == aChild) { - SetFirstContentOffset(mFirstChild); - } - SetLastContentOffset(lastChild); - if (!ChildIsPseudoFrame(lastChild)) { - nsIFrame* nextInFlow; - - lastChild->GetNextInFlow(nextInFlow); - mLastContentIsComplete = PRBool(nsnull == nextInFlow); - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -} - -/** - * Called after pulling-up children from the next-in-flow. Adjusts the first - * content offset of all the empty next-in-flows - * - * It's an error to call this function if all of the next-in-flow frames - * are empty. - * - * @return PR_TRUE if successful and PR_FALSE if all the next-in-flows are - * empty - */ -void nsContainerFrame::AdjustOffsetOfEmptyNextInFlows() -{ - // If the first next-in-flow is not empty then the caller drained - // more than one next-in-flow and then pushed back into it's - // immediate next-in-flow. - nsContainerFrame* nextInFlow = (nsContainerFrame*)mNextInFlow; - PRInt32 nextOffset; - if ((nsnull != nextInFlow) && (nsnull != nextInFlow->mFirstChild)) { - // Use the offset from this frame's first next-in-flow (because - // it's not empty) to propagate into the next next-in-flow (and - // onward if necessary) - nextOffset = nextInFlow->NextChildOffset(); - - // Use next next-in-flow - nextInFlow = (nsContainerFrame*) nextInFlow->mNextInFlow; - - // When this happens, there *must* be a next next-in-flow and the - // next next-in-flow must be empty. - NS_ASSERTION(nsnull != nextInFlow, "bad adjust offsets"); - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "bad adjust offsets"); - } else { - // Use our offset (since our next-in-flow is empty) to propagate - // into our empty next-in-flows - nextOffset = NextChildOffset(); - } - - while (nsnull != nextInFlow) { - if (nsnull == nextInFlow->mFirstChild) { - NS_ASSERTION(nextInFlow->IsEmpty(), "bad state"); - nextInFlow->mFirstContentOffset = nextOffset; - // If the next-in-flow is a pseudo-frame then we need to have it - // update it's parents offsets too. - if (nextInFlow->IsPseudoFrame()) { - nextInFlow->PropagateContentOffsets(); - } - } else { - // We found a non-empty frame. Verify that its first content offset - // is correct - NS_ASSERTION(nextInFlow->mFirstContentOffset == nextOffset, "bad first content offset"); - return; - } - - nextInFlow = (nsContainerFrame*)nextInFlow->mNextInFlow; - } - - // Make sure that all the next-in-flows weren't empty - NS_ASSERTION(nsnull != ((nsContainerFrame*)mNextInFlow)->mFirstChild, - "Every next-in-flow is empty!"); -} - -///////////////////////////////////////////////////////////////////////////// -// Debugging - -NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent) const -{ - // Indent - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - - // Output the tag - ListTag(out); - - // Output the first/last content offset - fprintf(out, "[%d,%d,%c] pif=%p nif=%p", - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F'), - mPrevInFlow, mNextInFlow); - - // Output the rect - out << mRect; - - // Output the children - if (mChildCount > 0) { - if (!mLastContentIsComplete) { - fputs(", complete=>false ", out); - } - - fputs("<\n", out); - for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) { - child->List(out, aIndent + 1); - } - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - fputs(">\n", out); - } else { - fputs("<>\n", out); - } - - return NS_OK; -} - -NS_METHOD nsContainerFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fputs("*", out); - } - nsFrame::ListTag(out); - return NS_OK; -} - -#define VERIFY_ASSERT(_expr, _msg) \ - if (!(_expr)) { \ - DumpTree(); \ - } \ - NS_ASSERTION(_expr, _msg) - -NS_METHOD nsContainerFrame::VerifyTree() const -{ -#ifdef NS_DEBUG - // Check our child count - PRInt32 len = LengthOf(mFirstChild); - VERIFY_ASSERT(len == mChildCount, "bad child count"); - - nsIFrame* lastChild; - - LastChild(lastChild); - if (len != 0) { - VERIFY_ASSERT(nsnull != lastChild, "bad last child"); - } - VERIFY_ASSERT(nsnull == mOverflowList, "bad overflow list"); - - // Make sure our content offsets are sane - VERIFY_ASSERT(mFirstContentOffset <= mLastContentOffset, "bad offsets"); - - // Verify child content offsets and index-in-parents - PRInt32 offset = mFirstContentOffset; - nsIFrame* child = mFirstChild; - while (nsnull != child) { - // Make sure that the child's tree is valid - child->VerifyTree(); - - // Make sure child's index-in-parent is correct - if (ChildIsPseudoFrame(child)) { - nsContainerFrame* pseudo = (nsContainerFrame*) child; - if (pseudo == mFirstChild) { - VERIFY_ASSERT(pseudo->mFirstContentOffset == offset, - "bad pseudo first content offset"); - } - if (pseudo == lastChild) { - VERIFY_ASSERT(pseudo->mFirstContentOffset == offset, - "bad pseudo first content offset"); - VERIFY_ASSERT(pseudo->mLastContentOffset == mLastContentOffset, - "bad pseudo last content offset"); - VERIFY_ASSERT(pseudo->mLastContentIsComplete == mLastContentIsComplete, - "bad pseudo last content is complete"); - } - - offset = pseudo->mLastContentOffset; - if (pseudo->mLastContentIsComplete) { - offset++; - } - } else { - PRInt32 indexInParent; - - child->GetIndexInParent(indexInParent); - VERIFY_ASSERT(offset == indexInParent, "bad child offset"); - - nsIFrame* nextInFlow; - child->GetNextInFlow(nextInFlow); - if (nsnull == nextInFlow) { - offset++; - } - } - - child->GetNextSibling(child); - } - - // Verify that our last content offset is correct - if (0 != mChildCount) { - if (mLastContentIsComplete) { - VERIFY_ASSERT(offset == mLastContentOffset + 1, "bad last offset"); - } else { - VERIFY_ASSERT(offset == mLastContentOffset, "bad last offset"); - } - } - - // Make sure that our flow blocks offsets are all correct - if (nsnull == mPrevInFlow) { - PRInt32 nextOffset = NextChildOffset(); - nsContainerFrame* nextInFlow = (nsContainerFrame*) mNextInFlow; - while (nsnull != nextInFlow) { - VERIFY_ASSERT(0 != nextInFlow->mChildCount, "empty next-in-flow"); - VERIFY_ASSERT(nextInFlow->GetFirstContentOffset() == nextOffset, - "bad next-in-flow first offset"); - nextOffset = nextInFlow->NextChildOffset(); - nextInFlow = (nsContainerFrame*) nextInFlow->mNextInFlow; - } - } -#endif - return NS_OK; -} - -///////////////////////////////////////////////////////////////////////////// - -#ifdef NS_DEBUG -PRInt32 nsContainerFrame::LengthOf(nsIFrame* aFrame) -{ - PRInt32 result = 0; - - while (nsnull != aFrame) { - result++; - aFrame->GetNextSibling(aFrame); - } - - return result; -} - -PRBool nsContainerFrame::IsChild(const nsIFrame* aChild) const -{ - // Check the geometric parent - nsIFrame* parent; - - aChild->GetGeometricParent(parent); - if (parent != (nsIFrame*)this) { - return PR_FALSE; - } - -// XXX Turn back on once all frame code has been changed to always add -// a child frame to the sibling list before reflowing the child. Right now -// that's not true for inline and column when reflowing unmapped children... -#if 0 - // Check that aChild is in our sibling list - PRInt32 index; - - IndexOf(aChild, index); - if (-1 == index) { - return PR_FALSE; - } -#endif - - return PR_TRUE; -} - -PRBool nsContainerFrame::IsLastChild(const nsIFrame* aChild) const -{ - // Check the geometric parent - nsIFrame* parent; - - aChild->GetGeometricParent(parent); - if (parent != (nsIFrame*)this) { - return PR_FALSE; - } - - // Check that aChild is in our sibling list - nsIFrame* lastChild; - - LastChild(lastChild); - if (lastChild != aChild) { - return PR_FALSE; - } - - return PR_TRUE; -} - -void nsContainerFrame::DumpTree() const -{ - nsIFrame* root = (nsIFrame*)this; - nsIFrame* parent = mGeometricParent; - - while (nsnull != parent) { - root = parent; - parent->GetGeometricParent(parent); - } - - root->List(); -} - -void nsContainerFrame::CheckContentOffsets() -{ - NS_PRECONDITION(nsnull != mFirstChild, "null first child"); - - // Verify that our first content offset is correct - if (ChildIsPseudoFrame(mFirstChild)) { - nsContainerFrame* pseudoFrame = (nsContainerFrame*)mFirstChild; - - if (pseudoFrame->GetFirstContentOffset() != mFirstContentOffset) { - DumpTree(); - } - NS_ASSERTION(pseudoFrame->GetFirstContentOffset() == mFirstContentOffset, - "bad first content offset"); - } else { - PRInt32 indexInParent; - - mFirstChild->GetIndexInParent(indexInParent); - if (indexInParent != mFirstContentOffset) { - DumpTree(); - } - - NS_ASSERTION(indexInParent == mFirstContentOffset, "bad first content offset"); - } - - // Verify that our last content offset is correct - nsIFrame* lastChild; - - LastChild(lastChild); - if (ChildIsPseudoFrame(lastChild)) { - nsContainerFrame* pseudoFrame = (nsContainerFrame*)lastChild; - - NS_ASSERTION(pseudoFrame->GetLastContentOffset() == mLastContentOffset, - "bad last content offset"); - - } else { - PRInt32 indexInParent; - - lastChild->GetIndexInParent(indexInParent); - NS_ASSERTION(indexInParent == mLastContentOffset, "bad last content offset"); - } -} - -void nsContainerFrame::PreReflowCheck() -{ - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - - if (0 == mChildCount) { - NS_ASSERTION(nsnull == mFirstChild, "bad child-count/first-child"); - } else { - NS_ASSERTION(nsnull != mFirstChild, "bad child-count/first-child"); - CheckContentOffsets(); - } - VerifyLastIsComplete(); -} - -void nsContainerFrame::PostReflowCheck(ReflowStatus aStatus) -{ - PRInt32 len = LengthOf(mFirstChild) ; - NS_ASSERTION(len == mChildCount, "bad child count"); - - if (0 == mChildCount) { - NS_ASSERTION(nsnull == mFirstChild, "bad child-count/first-child"); - } else { - NS_ASSERTION(nsnull != mFirstChild, "bad child-count/first-child"); - CheckContentOffsets(); - } - VerifyLastIsComplete(); -} - -/** - * A container is empty if it has no children, or it has exactly one - * child and that child is a pseudo-frame and it's empty (recursively - * applied if that child contains one child which is a - * pseudo-frame...) - */ -PRBool nsContainerFrame::IsEmpty() -{ - if (0 == mChildCount) { - return PR_TRUE; - } - if (mChildCount > 1) { - return PR_FALSE; - } - if (ChildIsPseudoFrame(mFirstChild)) { - return ((nsContainerFrame*)mFirstChild)->IsEmpty(); - } - return PR_FALSE; -} - -void nsContainerFrame::CheckNextInFlowOffsets() -{ - // We have to be in a safe state before we can even consider - // checking our next-in-flows state. - if (!SafeToCheckLastContentOffset(this)) { - return; - } - - PRInt32 nextOffset = NextChildOffset(); - nsContainerFrame* nextInFlow = (nsContainerFrame*)mNextInFlow; - while (nsnull != nextInFlow) { - if (!SafeToCheckLastContentOffset(nextInFlow)) { - return; - } -#ifdef NS_DEBUG - if (nextInFlow->GetFirstContentOffset() != nextOffset) { - DumpTree(); - } -#endif - NS_ASSERTION(nextInFlow->GetFirstContentOffset() == nextOffset, - "bad next-in-flow first offset"); - // Verify the content offsets are in sync with the first/last child - nextInFlow->CheckContentOffsets(); - nextOffset = nextInFlow->NextChildOffset(); - - // Move to the next-in-flow - nextInFlow = (nsContainerFrame*)nextInFlow->mNextInFlow; - } -} - -PRBool -nsContainerFrame::SafeToCheckLastContentOffset(nsContainerFrame* aContainer) -{ - if (0 == aContainer->mChildCount) { - // We can't use the last content offset on an empty frame - return PR_FALSE; - } - - if (nsnull != aContainer->mOverflowList) { - // If a frame has an overflow list then it's last content offset - // cannot be used for assertion checks (because it's not done - // being reflowed). - return PR_FALSE; - } - - nsIFrame* lastChild; - - aContainer->LastChild(lastChild); - if (aContainer->ChildIsPseudoFrame(lastChild)) { - // If the containers last child is a pseudo-frame then the - // containers last content offset is determined by the child. Ask - // the child if it's safe to use the last content offset. - return SafeToCheckLastContentOffset((nsContainerFrame*)lastChild); - } - - return PR_TRUE; -} - -void nsContainerFrame::VerifyLastIsComplete() const -{ - if (nsnull == mFirstChild) { - // If we have no children, our mLastContentIsComplete doesn't mean - // anything - return; - } - if (nsnull != mOverflowList) { - // If we can an overflow list then our mLastContentIsComplete and - // mLastContentOffset are un-verifyable because a reflow is in - // process. - return; - } - - nsIFrame* lastKid; - - LastChild(lastKid); - if (ChildIsPseudoFrame(lastKid)) { - // When my last child is a pseudo-frame it means that our - // mLastContentIsComplete is a copy of it's. - nsContainerFrame* pseudoFrame = (nsContainerFrame*) lastKid; - NS_ASSERTION(mLastContentIsComplete == pseudoFrame->mLastContentIsComplete, - "bad mLastContentIsComplete"); - } else { - // If my last child has a next-in-flow then our - // mLastContentIsComplete must be false (because our last child is - // obviously not complete) - nsIFrame* lastKidNextInFlow; - - lastKid->GetNextInFlow(lastKidNextInFlow); - if (nsnull != lastKidNextInFlow) { - if (mLastContentIsComplete) { - DumpTree(); - } - NS_ASSERTION(mLastContentIsComplete == PR_FALSE, "bad mLastContentIsComplete"); - } else { - // We don't know what state our mLastContentIsComplete should be in. - } - } -} -#endif diff --git a/mozilla/layout/base/src/nsContainerFrame.h b/mozilla/layout/base/src/nsContainerFrame.h deleted file mode 100644 index 9188465737a..00000000000 --- a/mozilla/layout/base/src/nsContainerFrame.h +++ /dev/null @@ -1,410 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsContainerFrame_h___ -#define nsContainerFrame_h___ - -#include "nsSplittableFrame.h" - -/** - * Implementation of a container frame. Supports being used a pseudo- - * frame (a frame that maps the same content as its parent). - * - * Container frame iterates its child content and for each content object creates - * one or more child frames. There are three member variables (class invariants) - * used to manage this mapping: - *
    - *
    mFirstContentOffset - *
    the content offset of the first piece of content mapped by this container. - *
    mLastContentOffset - *
    the content offset of the last piece of content mapped by this container - *
    mLastContentIsComplete - *
    a boolean indicating whether the last piece of content mapped by this - * container is complete, or whether its frame needs to be continued. - *
    - * - * Here are the rules governing the state of the class invariants. The debug member - * functions PreReflowCheck() and PostReflowCheck() validate these rules. For the - * purposes of this discussion an empty frame is defined as a container - * frame with a null child-list, i.e. its mFirstChild is nsnull. - * - *

    Non-Empty Frames

    - * For a container frame that is not an empty frame the following must be true: - *
      - *
    • if the first child frame is a pseudo-frame then mFirstContentOffset must be - * equal to the first child's mFirstContentOffset; otherwise, mFirstContentOffset - * must be equal to the first child frame's index in parent - *
    • if the last child frame is a pseudo-frame then mLastContentOffset must be - * equal to the last child's mLastContentOffset; otherwise, mLastContentOffset - * must be equal to the last child frame's index in parent - *
    • if the last child is a pseudo-frame then mLastContentIsComplete should be - * equal to that last child's mLastContentIsComplete; otherwise, if the last - * child frame has a next-in-flow then mLastContentIsComplete must be PR_TRUE - *
    - * - *

    Empty Frames

    - * For an empty container frame the following must be true: - *
      - *
    • mFirstContentOffset must be equal to the NextContentOffset() of the first - * non-empty prev-in-flow - *
    • mChildCount must be 0 - *
    - * - * The value of mLastContentOffset and mLastContentIsComplete are undefined - * for an empty frame. - * - *

    Next-In-Flow List

    - * The rule is that if a container frame is not complete then the mFirstContentOffset, - * mLastContentOffset, and mLastContentIsComplete of its next-in-flow frames must - * always correct. This means that whenever you push/pull child frames from a - * next-in-flow you must update that next-in-flow's state so that it is - * consistent with the aforementioned rules for empty and non-empty frames. - * - *

    Pulling-Up Frames

    - * In the processing of pulling-up child frames from a next-in-flow it's possible - * to pull-up all the child frames from a next-in-flow thereby leaving the next-in-flow - * empty. There are two cases to consider: - *
      - *
    1. All of the child frames from all of the next-in-flow have been pulled-up. - * This means that all the next-in-flow frames are empty, the container being - * reflowed is complete, and the next-in-flows will be deleted. - * - * In this case the next-in-flows' mFirstContentOffset is also undefined. - *
    2. Not all the child frames from all the next-in-flows have been pulled-up. - * This means the next-in-flow consists of one or more empty frames followed - * by one or more non-empty frames. Note that all the empty frames must be - * consecutive. This means it is illegal to have an empty frame followed by - * a non-empty frame, followed by an empty frame, followed by a non-empty frame. - *
    - * - *

    Pseudo-Frames

    - * As stated above, when pulling/pushing child frames from/to a next-in-flow the - * state of the next-in-flow must be updated. - * - * If the next-in-flow is a pseudo-frame then not only does the next-in-flow's state - * need to be updated, but the state of its geometric parent must be updated as well. - * See member function PropagateContentOffsets() for details. - * - * This rule is applied recursively, so if the next-in-flow's geometric parent is - * also a pseudo-frame then its geometric parent must be updated. - */ -class nsContainerFrame : public nsSplittableFrame -{ -public: - /** - * Default implementation is to use the content delegate to create a new - * frame. After the frame is created it uses PrepareContinuingFrame() to - * set the content offsets, mLastContentOffset, and append the continuing - * frame to the flow. - */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - // Painting - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** - * Pass through the event to the correct child frame. - * Return PR_TRUE if the event is consumed. - */ - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); - - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor); - - // Child frame enumeration. - // ChildAt() retruns null if the index is not in the range 0 .. ChildCount() - 1. - // IndexOf() returns -1 if the frame is not in the child list. - NS_IMETHOD ChildCount(PRInt32& aChildCount) const; - NS_IMETHOD ChildAt(PRInt32 aIndex, nsIFrame*& aFrame) const; - NS_IMETHOD IndexOf(const nsIFrame* aChild, PRInt32& aIndex) const; - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; - NS_IMETHOD NextChild(const nsIFrame* aChild, nsIFrame*& aNextChild) const; - NS_IMETHOD PrevChild(const nsIFrame* aChild, nsIFrame*& aPrevChild) const; - NS_IMETHOD LastChild(nsIFrame*& aLastChild) const; - - // Access functions for starting and end content offsets. These reflect the - // range of content mapped by the frame. - // - // If the container is empty (has no children) the last content offset is - // undefined - PRInt32 GetFirstContentOffset() const {return mFirstContentOffset;} - void SetFirstContentOffset(PRInt32 aOffset) {mFirstContentOffset = aOffset;} - PRInt32 GetLastContentOffset() const {return mLastContentOffset;} - void SetLastContentOffset(PRInt32 aOffset) {mLastContentOffset = aOffset;} - - /** return PR_TRUE if the last mapped child is complete */ - PRBool GetLastContentIsComplete() const {return mLastContentIsComplete;} - /** set the state indicating whether the last mapped child is complete */ - void SetLastContentIsComplete(PRBool aLIC) {mLastContentIsComplete = aLIC;} - - // Get the offset for the next child content, i.e. the child after the - // last child that fit in us - PRInt32 NextChildOffset() const; - - // Returns true if this frame is being used a pseudo frame - PRBool IsPseudoFrame() const; - - // Debugging - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - NS_IMETHOD ListTag(FILE* out = stdout) const; - NS_IMETHOD VerifyTree() const; - - /** - * This is used to propagate this frame's mFirstContentOffset, mLastContentOffset, - * and mLastContentIsComplete to its geometric parent frame. Recurses if the - * geometric parent is a pseudo-frame. - * - * If this frame is the parent's first child then the parent's mFirstContentOffset - * is set to be this frame's mFirstContentOffset. - * - * If this frame is the parent's last child then the parent's mLastContentOffset - * is set to be this frame's mLastContentOffset, and the parent's - * mLastContentIsComplete is set to be this frame's mLastContentIsComplete. - * - * It's a precondition that this frame must be a pseudo-frame. - */ - void PropagateContentOffsets(); - -protected: - // Constructor. Takes as arguments the content object, the index in parent, - // and the Frame for the content parent - nsContainerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsContainerFrame(); - - /** - * Prepare a continuation frame of this frame for reflow. Appends it to the - * flow, sets its content offsets, mLastContentIsComplete, and style context. - * Subclasses should invoke this method after construction of a continuing frame. - */ - void PrepareContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsContainerFrame* aContFrame); - - - virtual void PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** - * Reflow a child frame and return the status of the reflow. If the child - * is complete and it has next-in-flows, then delete the next-in-flows. - */ - ReflowStatus ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** - * Reflow a child frame and return the status of the reflow. If the child - * is complete and it has next-in-flows, then delete the next-in-flows. - * - * Use this version if you have a space manager. Checks if the child frame - * supports interface nsIRunaround. If it does, interface nsIRunaround is - * used to reflow the child; otherwise interface nsIFrame is used. If the - * child is splittable then runaround is done using continuing frames. - * - * XXX This function needs to account for left/right margins so the caller - * should not adjust the max size to account for left/right margins -or- - * translate the space manager coordinate space - * - * @see nsIRunaround - */ - ReflowStatus ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize); - - /** - * Moves any frames on both the prev-in-flow's overflow list and the receiver's - * overflow to the receiver's child list. - * - * Resets the overlist pointers to nsnull, and updates the receiver's child - * count and content mapping. - * - * @return PR_TRUE if any frames were moved and PR_FALSE otherwise - */ - PRBool MoveOverflowToChildList(); - - /** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow - * pointers - * - * Updates the child count and content offsets of all containers that are - * affected - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise - */ - PRBool DeleteChildsNextInFlow(nsIFrame* aChild); - - /** - * Push aFromChild and its next siblings to the next-in-flow. Change the - * geometric parent of each frame that's pushed. If there is no next-in-flow - * the frames are placed on the overflow list (and the geometric parent is - * left unchanged). - * - * Updates the next-in-flow's child count and content offsets. Does - * not update the pusher's child count or last content offset. - * - * @param aFromChild the first child frame to push. It is disconnected from - * aPrevSibling - * @param aPrevSibling aFromChild's previous sibling. Must not be null. It's - * an error to push a parent's first child frame - * @param aNextInFlowsLastChildIsComplete the next-in-flow's - * mLastContentIsComplete flag. This is used when refilling an - * empty next-in-flow that was drained by the caller. - */ - void PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling, - PRBool aNextInFlowsLastChildIsComplete); - - /** - * Attempt to pull one child from the next-in-flow, if any. This - * does everything necessary for the receiving frame and the - * next-in-flow frame to ensure that the content offsets and - * mLastContentIsComplete flags are correct, and it makes sure that - * the parent offsets if this frame or the next is a pseudo-frame - * are correct. If there are no children to pull from the next - * in flow, nsnull is returned. - * - * If the caller decides that it doesn't want the child from the - * next in flow, it can call PushChildren to push it back. - * - * @param aNextInFlow the next-in-flow frame to attempt to pull a child - * from - * @param aLastChild the current last child for this frame. If a child - * is pullable then the child will become aLastChild's next - * sibling - */ - nsIFrame* PullUpOneChild(nsContainerFrame* aNextInFlow, - nsIFrame* aLastChild); - - /** - * Called after pulling-up children from the next-in-flow. Adjusts the first - * content offset of all the empty next-in-flows - * - * It's an error to call this function if all of the next-in-flow frames - * are empty. - */ - void AdjustOffsetOfEmptyNextInFlows(); - - /** - * Append child list starting at aChild to this frame's child list. Used for - * processing of the overflow list. - * - * Updates this frame's child count and content mapping. - * - * @param aChild the beginning of the child list - * @param aSetParent if true each child's geometric (and content parent if - * they're the same) parent is set to this frame. - */ - void AppendChildren(nsIFrame* aChild, PRBool aSetParent = PR_TRUE); - - // Returns true if aChild is being used as a pseudo frame - PRBool ChildIsPseudoFrame(const nsIFrame* aChild) const; - - /** - * Sets the first content offset based on the first child frame. - */ - void SetFirstContentOffset(const nsIFrame* aFirstChild); - - /** - * Sets the last content offset based on the last child frame. If the last - * child is a pseudo frame then it sets mLastContentIsComplete to be the same - * as the last child's mLastContentIsComplete - */ - void SetLastContentOffset(const nsIFrame* aLastChild); - -#ifdef NS_DEBUG - /** - * Return the number of children in the sibling list, starting at aChild. - * Returns zero if aChild is nsnull. - */ - static PRInt32 LengthOf(nsIFrame* aChild); - - /** - * Returns PR_TRUE if aChild is a child of this frame. - */ - PRBool IsChild(const nsIFrame* aChild) const; - - /** - * Returns PR_TRUE if aChild is the last child of this frame. - */ - PRBool IsLastChild(const nsIFrame* aChild) const; - - void DumpTree() const; - - /** - * Before reflow for this container has started we check that all - * is well. - */ - void PreReflowCheck(); - - /** - * After reflow for this container has finished we check that all - * is well. - * - * @param aStatus status to be returned from the resize reflow. If the status - * is frNotComplete then the next-in-flow content offsets are - * validated as well - */ - void PostReflowCheck(ReflowStatus aStatus); - - void CheckNextInFlowOffsets(); - - PRBool IsEmpty(); - - PRBool SafeToCheckLastContentOffset(nsContainerFrame* nextInFlow); - - /** - * Verify that our mLastContentIsComplete flag is set correctly. - */ - void VerifyLastIsComplete() const; -#endif - - nsIFrame* mFirstChild; - PRInt32 mChildCount; - PRInt32 mFirstContentOffset; // index of first child we map - PRInt32 mLastContentOffset; // index of last child we map - PRBool mLastContentIsComplete; - nsIFrame* mOverflowList; - -private: -#ifdef NS_DEBUG - /** - * Helper function to verify that the first/last content offsets - * are correct. Note: this call will blow up if you have no - * children. - */ - void CheckContentOffsets(); -#endif -}; - -#endif /* nsContainerFrame_h___ */ diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp deleted file mode 100644 index 026842324e1..00000000000 --- a/mozilla/layout/base/src/nsDocument.cpp +++ /dev/null @@ -1,630 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsDocument.h" -#include "nsIArena.h" -#include "nsIURL.h" -#include "nsString.h" -#include "nsIContent.h" -#include "nsIStyleSet.h" -#include "nsIStyleSheet.h" -#include "nsIPresShell.h" -#include "nsIDocumentObserver.h" - -static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID); - -#include "nsIDOMElement.h" - -static NS_DEFINE_IID(kIDOMDocumentIID, NS_IDOMDOCUMENT_IID); -static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); -static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID); -static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID); -static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); - - -nsDocument::nsDocument() -{ - NS_INIT_REFCNT(); - - mArena = nsnull; - mDocumentTitle = nsnull; - mDocumentURL = nsnull; - mCharacterSet = eCharSetID_IsoLatin1; - mParentDocument = nsnull; - mRootContent = nsnull; - mScriptObject = nsnull; - - Init();/* XXX */ -} - -nsDocument::~nsDocument() -{ - if (nsnull != mDocumentTitle) { - delete mDocumentTitle; - mDocumentTitle = nsnull; - } - NS_IF_RELEASE(mDocumentURL); - - mParentDocument = nsnull; - - // Delete references to sub-documents - PRInt32 index = mSubDocuments.Count(); - while (--index >= 0) { - nsIDocument* subdoc = (nsIDocument*) mSubDocuments.ElementAt(index); - NS_RELEASE(subdoc); - } - - NS_IF_RELEASE(mRootContent); - // Delete references to style sheets - index = mStyleSheets.Count(); - while (--index >= 0) { - nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(index); - NS_RELEASE(sheet); - } - - NS_IF_RELEASE(mArena); -} - -nsresult nsDocument::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (nsnull == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIDocumentIID)) { - *aInstancePtr = (void*)(nsIDocument*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIDOMDocumentIID)) { - *aInstancePtr = (void*)(nsIDOMDocument*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIScriptObjectOwnerIID)) { - *aInstancePtr = (void*)(nsIScriptObjectOwner*)this; - AddRef(); - return NS_OK; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*)(nsISupports*)(nsIDocument*)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(nsDocument) -NS_IMPL_RELEASE(nsDocument) - -nsresult nsDocument::Init() -{ - nsresult rv = NS_NewHeapArena(&mArena, nsnull); - if (NS_OK != rv) { - return rv; - } - return NS_OK; -} - -nsIArena* nsDocument::GetArena() -{ - if (nsnull != mArena) { - NS_ADDREF(mArena); - } - return mArena; -} - -void nsDocument::StartDocumentLoad() -{ -} - -void nsDocument::PauseDocumentLoad() -{ -} - -void nsDocument::StopDocumentLoad() -{ -} - -void nsDocument::WaitForDocumentLoad() -{ -} - -PRBool nsDocument::IsDocumentLoaded() -{ - return PR_TRUE; -} - -const nsString* nsDocument::GetDocumentTitle() const -{ - return mDocumentTitle; -} - -nsIURL* nsDocument::GetDocumentURL() const -{ - NS_IF_ADDREF(mDocumentURL); - return mDocumentURL; -} - -nsCharSetID nsDocument::GetDocumentCharacterSet() const -{ - return mCharacterSet; -} - -void nsDocument::SetDocumentCharacterSet(nsCharSetID aCharSetID) -{ - mCharacterSet = aCharSetID; -} - -nsresult nsDocument::CreateShell(nsIPresContext* aContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet, - nsIPresShell** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIPresShell* shell; - nsresult rv = NS_NewPresShell(&shell); - if (NS_OK != rv) { - return rv; - } - if (NS_OK != shell->Init(this, aContext, aViewManager, aStyleSet)) { - NS_RELEASE(shell); - return rv; - } - - // Note: we don't hold a ref to the shell (it holds a ref to us) - mPresShells.AppendElement(shell); - *aInstancePtrResult = shell; - return NS_OK; -} - -PRBool nsDocument::DeleteShell(nsIPresShell* aShell) -{ - return mPresShells.RemoveElement(aShell); -} - -PRInt32 nsDocument::GetNumberOfShells() -{ - return mPresShells.Count(); -} - -nsIPresShell* nsDocument::GetShellAt(PRInt32 aIndex) -{ - nsIPresShell* shell = (nsIPresShell*) mPresShells.ElementAt(aIndex); - if (nsnull != shell) { - NS_ADDREF(shell); - } - return shell; -} - -nsIDocument* nsDocument::GetParentDocument() -{ - if (nsnull != mParentDocument) { - NS_ADDREF(mParentDocument); - } - return mParentDocument; -} - -/** - * Note that we do *not* AddRef our parent because that would - * create a circular reference. - */ -void nsDocument::SetParentDocument(nsIDocument* aParent) -{ - mParentDocument = aParent; -} - -void nsDocument::AddSubDocument(nsIDocument* aSubDoc) -{ - NS_ADDREF(aSubDoc); - mSubDocuments.AppendElement(aSubDoc); -} - -PRInt32 nsDocument::GetNumberOfSubDocuments() -{ - return mSubDocuments.Count(); -} - -nsIDocument* nsDocument::GetSubDocumentAt(PRInt32 aIndex) -{ - nsIDocument* doc = (nsIDocument*) mSubDocuments.ElementAt(aIndex); - if (nsnull != doc) { - NS_ADDREF(doc); - } - return doc; -} - -nsIContent* nsDocument::GetRootContent() -{ - if (nsnull != mRootContent) { - NS_ADDREF(mRootContent); - } - return mRootContent; -} - -void nsDocument::SetRootContent(nsIContent* aRoot) -{ - NS_IF_RELEASE(mRootContent); - if (nsnull != aRoot) { - mRootContent = aRoot; - NS_ADDREF(aRoot); - } -} - -PRInt32 nsDocument::GetNumberOfStyleSheets() -{ - return mStyleSheets.Count(); -} - -nsIStyleSheet* nsDocument::GetStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = (nsIStyleSheet*)mStyleSheets.ElementAt(aIndex); - NS_IF_ADDREF(sheet); - return sheet; -} - -void nsDocument::AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet) -{ - aSet->AppendDocStyleSheet(aSheet); -} - -void nsDocument::AddStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - mStyleSheets.AppendElement(aSheet); - NS_ADDREF(aSheet); - - PRInt32 count = mPresShells.Count(); - PRInt32 index; - for (index = 0; index < count; index++) { - nsIPresShell* shell = (nsIPresShell*)mPresShells.ElementAt(index); - nsIStyleSet* set = shell->GetStyleSet(); - if (nsnull != set) { - AddStyleSheetToSet(aSheet, set); - NS_RELEASE(set); - } - } - - count = mObservers.Count(); - for (index = 0; index < count; index++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers.ElementAt(index); - observer->StyleSheetAdded(aSheet); - } -} - -// Note: We don't hold a reference to the document observer; we assume -// that it has a live reference to the document. -void nsDocument::AddObserver(nsIDocumentObserver* aObserver) -{ - mObservers.AppendElement(aObserver); -} - -PRBool nsDocument::RemoveObserver(nsIDocumentObserver* aObserver) -{ - return mObservers.RemoveElement(aObserver); -} - -void nsDocument::ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType) -{ - PRInt32 count = mObservers.Count(); - for (PRInt32 i = 0; i < count; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->ContentChanged(aContent, aSubContent, aChangeType); - } -} - -void nsDocument::ContentAppended(nsIContent* aContainer) -{ - PRInt32 count = mObservers.Count(); - for (PRInt32 i = 0; i < count; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->ContentAppended(aContainer); - } -} - -void nsDocument::ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) -{ - PRInt32 count = mObservers.Count(); - for (PRInt32 i = 0; i < count; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->ContentInserted(aContainer, aChild, aIndexInContainer); - } -} - -void nsDocument::ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer) -{ - PRInt32 count = mObservers.Count(); - for (PRInt32 i = 0; i < count; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->ContentReplaced(aContainer, aOldChild, aNewChild, - aIndexInContainer); - } -} - -void nsDocument::ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) -{ - PRInt32 count = mObservers.Count(); - for (PRInt32 i = 0; i < count; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->ContentWillBeRemoved(aContainer, aChild, aIndexInContainer); - } -} - -void nsDocument::ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) -{ - PRInt32 count = mObservers.Count(); - for (PRInt32 i = 0; i < count; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->ContentHasBeenRemoved(aContainer, aChild, aIndexInContainer); - } -} - -nsresult nsDocument::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - nsresult res = NS_OK; - - if (nsnull == mScriptObject) { - res = NS_NewScriptDocument(aContext, this, nsnull, (JSObject**)&mScriptObject); - } - *aScriptObject = mScriptObject; - - return res; -} - -nsresult nsDocument::ResetScriptObject() -{ - mScriptObject = nsnull; - return NS_OK; -} - -// -// nsIDOMDocument interface -// -nsresult nsDocument::GetNodeType(PRInt32 *aType) -{ - *aType = nsIDOMNode::DOCUMENT; - return NS_OK; -} - -nsresult nsDocument::GetParentNode(nsIDOMNode **aNode) -{ - return NS_ERROR_FAILURE; -} - -nsresult nsDocument::GetChildNodes(nsIDOMNodeIterator **aIterator) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::HasChildNodes() -{ - if (nsnull != mRootContent) { - return NS_OK; - } - else { - return NS_ERROR_FAILURE; - } -} - -nsresult nsDocument::GetFirstChild(nsIDOMNode **aNode) -{ - if (nsnull != mRootContent) { - nsresult res = mRootContent->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); - return res; - } - - return NS_ERROR_FAILURE; -} - -nsresult nsDocument::GetPreviousSibling(nsIDOMNode **aNode) -{ - // no siblings - return NS_ERROR_FAILURE; -} - -nsresult nsDocument::GetNextSibling(nsIDOMNode **aNode) -{ - // no siblings - return NS_ERROR_FAILURE; -} - -nsresult nsDocument::InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild) -{ - // a document has only one child - return NS_ERROR_FAILURE; -} - -nsresult nsDocument::ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild) -{ - NS_PRECONDITION(nsnull != newChild && nsnull != oldChild, "null arg"); - nsIContent* content; - - nsresult res = oldChild->QueryInterface(kIContentIID, (void**)&content); - if (NS_OK == res) { - // check that we are replacing the root content - if (content == mRootContent) { - nsIContent* newContent; - res = newChild->QueryInterface(kIContentIID, (void**)&newContent); - if (NS_OK == res) { - SetRootContent(newContent); - NS_RELEASE(newContent); - } - else NS_ASSERTION(0, "Must be an nsIContent"); // nsIContent not supported. Who are you? - } - - NS_RELEASE(content); - } - else NS_ASSERTION(0, "Must be an nsIContent"); // nsIContent not supported. Who are you? - - return res; -} - -nsresult nsDocument::RemoveChild(nsIDOMNode *oldChild) -{ - NS_PRECONDITION(nsnull != oldChild, "null arg"); - nsIContent* content; - - nsresult res = oldChild->QueryInterface(kIContentIID, (void**)&content); - if (NS_OK == res) { - if (content == mRootContent) { - NS_RELEASE(mRootContent); - mRootContent = nsnull; - } - } - - return res; -} - -nsresult nsDocument::GetMasterDoc(nsIDOMDocument **aDocument) -{ - AddRef(); - *aDocument = (nsIDOMDocument*)this; - return NS_OK; -} - -nsresult nsDocument::SetMasterDoc(nsIDOMDocument *aDocument) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::GetDocumentType(nsIDOMNode **aDocType) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::SetDocumentType(nsIDOMNode *aNode) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::GetDocumentElement(nsIDOMElement **aElement) -{ - nsresult res = NS_ERROR_FAILURE; - - if (nsnull != mRootContent) { - res = mRootContent->QueryInterface(kIDOMElementIID, (void**)aElement); - NS_ASSERTION(NS_OK == res, "Must be a DOM Element"); - } - - return res; -} - -nsresult nsDocument::SetDocumentElement(nsIDOMElement *aElement) -{ - NS_PRECONDITION(nsnull != aElement, "null arg"); - nsIContent* content; - - nsresult res = aElement->QueryInterface(kIContentIID, (void**)&content); - if (NS_OK == res) { - SetRootContent(content); - NS_RELEASE(content); - } - else NS_ASSERTION(0, "Must be an nsIContent"); // nsIContent not supported. Who are you? - - return res; -} - -nsresult nsDocument::GetDocumentContext(nsIDOMDocumentContext **aDocContext) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::SetDocumentContext(nsIDOMDocumentContext *aContext) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateDocumentContext(nsIDOMDocumentContext **aDocContext) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateElement(nsString &aTagName, - nsIDOMAttributeList *aAttributes, - nsIDOMElement **aElement) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateTextNode(nsString &aData, nsIDOMText** aTextNode) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateComment(nsString &aData, nsIDOMComment **aComment) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreatePI(nsString &aName, nsString &aData, nsIDOMPI **aPI) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateAttribute(nsString &aName, - nsIDOMNode *value, - nsIDOMAttribute **aAttribute) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateAttributeList(nsIDOMAttributeList **aAttributesList) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::CreateTreeIterator(nsIDOMNode **aNode, nsIDOMTreeIterator **aTreeIterator) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDocument::GetElementsByTagName(nsString &aTagname, nsIDOMNodeIterator **aIterator) -{ - //XXX TBI - return NS_ERROR_NOT_IMPLEMENTED; -} - diff --git a/mozilla/layout/base/src/nsDocument.h b/mozilla/layout/base/src/nsDocument.h deleted file mode 100644 index a5533e44e7a..00000000000 --- a/mozilla/layout/base/src/nsDocument.h +++ /dev/null @@ -1,188 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsDocument_h___ -#define nsDocument_h___ - -#include "nsIDocument.h" -#include "nsVoidArray.h" -#include "nsIDOMDocument.h" -#include "nsIScriptObjectOwner.h" - -// Base class for our document implementations -class nsDocument : public nsIDocument, public nsIDOMDocument, public nsIScriptObjectOwner { -public: - NS_DECL_ISUPPORTS - - virtual nsIArena* GetArena(); - - virtual void StartDocumentLoad(); - virtual void PauseDocumentLoad(); - virtual void StopDocumentLoad(); - virtual void WaitForDocumentLoad(); - virtual PRBool IsDocumentLoaded(); - - /** - * Return the title of the document. May return null. - */ - virtual const nsString* GetDocumentTitle() const; - - /** - * Return the URL for the document. May return null. - */ - virtual nsIURL* GetDocumentURL() const; - - /** - * Return a standard name for the document's character set. This will - * trigger a startDocumentLoad if necessary to answer the question. - */ - virtual nsCharSetID GetDocumentCharacterSet() const; - virtual void SetDocumentCharacterSet(nsCharSetID aCharSetID); - - /** - * Create a new presentation shell that will use aContext for - * it's presentation context (presentation context's must not be - * shared among multiple presentation shell's). - */ - virtual nsresult CreateShell(nsIPresContext* aContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet, - nsIPresShell** aInstancePtrResult); - virtual PRBool DeleteShell(nsIPresShell* aShell); - virtual PRInt32 GetNumberOfShells(); - virtual nsIPresShell* GetShellAt(PRInt32 aIndex); - - /** - * Return the parent document of this document. Will return null - * unless this document is within a compound document and has a parent. - */ - virtual nsIDocument* GetParentDocument(); - virtual void SetParentDocument(nsIDocument* aParent); - virtual void AddSubDocument(nsIDocument* aSubDoc); - virtual PRInt32 GetNumberOfSubDocuments(); - virtual nsIDocument* GetSubDocumentAt(PRInt32 aIndex); - - /** - * Return the root content object for this document. - */ - virtual nsIContent* GetRootContent(); - virtual void SetRootContent(nsIContent* aRoot); - - /** - * Get the style sheets owned by this document. - */ - virtual PRInt32 GetNumberOfStyleSheets(); - virtual nsIStyleSheet* GetStyleSheetAt(PRInt32 aIndex); - virtual void AddStyleSheet(nsIStyleSheet* aSheet); - - /** - * Add a new observer of document change notifications. Whenever - * content is changed, appended, inserted or removed the observers are - * informed. - */ - virtual void AddObserver(nsIDocumentObserver* aObserver); - - /** - * Remove an observer of document change notifications. This will - * return false if the observer cannot be found. - */ - virtual PRBool RemoveObserver(nsIDocumentObserver* aObserver); - - // Observation hooks used by content nodes to propagate - // notifications to document observers. - virtual void ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType); - - virtual void ContentAppended(nsIContent* aContainer); - - virtual void ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer); - - virtual void ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer); - - virtual void ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer); - - virtual void ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer); - -public: - - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - virtual nsresult ResetScriptObject(); - - // nsIDOMDocument interface - virtual nsresult GetNodeType(PRInt32 *aType); - virtual nsresult GetParentNode(nsIDOMNode **aNode); - virtual nsresult GetChildNodes(nsIDOMNodeIterator **aIterator); - virtual nsresult HasChildNodes(); - virtual nsresult GetFirstChild(nsIDOMNode **aNode); - virtual nsresult GetPreviousSibling(nsIDOMNode **aNode); - virtual nsresult GetNextSibling(nsIDOMNode **aNode); - virtual nsresult InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild); - virtual nsresult ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild); - virtual nsresult RemoveChild(nsIDOMNode *oldChild); - virtual nsresult GetMasterDoc(nsIDOMDocument **aDocument); - virtual nsresult SetMasterDoc(nsIDOMDocument *aDocument); - virtual nsresult GetDocumentType(nsIDOMNode **aDocType); - virtual nsresult SetDocumentType(nsIDOMNode *aNode); - virtual nsresult GetDocumentElement(nsIDOMElement **aElement); - virtual nsresult SetDocumentElement(nsIDOMElement *aElement); - virtual nsresult GetDocumentContext(nsIDOMDocumentContext **aDocContext); - virtual nsresult SetDocumentContext(nsIDOMDocumentContext *aContext); - virtual nsresult CreateDocumentContext(nsIDOMDocumentContext **aDocContext); - virtual nsresult CreateElement(nsString &aTagName, - nsIDOMAttributeList *aAttributes, - nsIDOMElement **aElement); - virtual nsresult CreateTextNode(nsString &aData, nsIDOMText** aTextNode); - virtual nsresult CreateComment(nsString &aData, nsIDOMComment **aComment); - virtual nsresult CreatePI(nsString &aName, nsString &aData, nsIDOMPI **aPI); - virtual nsresult CreateAttribute(nsString &aName, - nsIDOMNode *value, - nsIDOMAttribute **aAttribute); - virtual nsresult CreateAttributeList(nsIDOMAttributeList **aAttributesList); - virtual nsresult CreateTreeIterator(nsIDOMNode **aNode, nsIDOMTreeIterator **aTreeIterator); - virtual nsresult GetElementsByTagName(nsString &aTagname, nsIDOMNodeIterator **aIterator); - -protected: - virtual void AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet); // subclass hook - - nsDocument(); - virtual ~nsDocument(); - nsresult Init(); - - nsIArena* mArena; - nsString* mDocumentTitle; - nsIURL* mDocumentURL; - nsCharSetID mCharacterSet; - nsIDocument* mParentDocument; - nsVoidArray mSubDocuments; - nsVoidArray mPresShells; - nsIContent* mRootContent; - nsVoidArray mStyleSheets; - nsVoidArray mObservers; - void* mScriptObject; -}; - -#endif /* nsDocument_h___ */ diff --git a/mozilla/layout/base/src/nsFrame.cpp b/mozilla/layout/base/src/nsFrame.cpp deleted file mode 100644 index 3e00831e09a..00000000000 --- a/mozilla/layout/base/src/nsFrame.cpp +++ /dev/null @@ -1,1260 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsFrame.h" -#include "nsIContent.h" -#include "nsIAtom.h" -#include "nsString.h" -#include "nsIStyleContext.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsIPresContext.h" -#include "nsCRT.h" -#include "nsGUIEvent.h" -#include "nsStyleConsts.h" - -#define DO_SELECTION 1 - -#if DO_SELECTION -#include "nsIDOMText.h" -static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID); -static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); - -/////////////////////////////////// -// Important Selection Variables -/////////////////////////////////// -nsIFrame * mCurrentFrame = nsnull; -PRBool mDoingSelection = PR_FALSE; -PRBool mDidDrag = PR_FALSE; - -#define gSelectionDebug 0 - -// [HACK] Foward Declarations -void BuildContentList(nsIContent*aContent); -PRBool IsInRange(nsIContent * aStartContent, nsIContent * aEndContent, nsIContent * aContent); -PRBool IsBefore(nsIContent * aNewContent, nsIContent * aCurrentContent); -nsIContent * GetPrevContent(nsIContent * aContent); -nsIContent * GetNextContent(nsIContent * aContent); -#endif - - -static PRBool gShowFrameBorders = PR_FALSE; - -NS_LAYOUT void nsIFrame::ShowFrameBorders(PRBool aEnable) -{ - gShowFrameBorders = aEnable; -} - -NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders() -{ - return gShowFrameBorders; -} - -static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID); - -nsresult -nsFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -void* nsFrame::operator new(size_t size) -{ - void* result = new char[size]; - - nsCRT::zero(result, size); - return result; -} - -nsFrame::nsFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : mContent(aContent), mIndexInParent(aIndexInParent), mContentParent(aParent), - mGeometricParent(aParent) -{ - NS_ADDREF(mContent); -} - -nsFrame::~nsFrame() -{ - NS_RELEASE(mContent); - NS_IF_RELEASE(mStyleContext); - if (nsnull != mView) { - // Break association between view and frame - mView->SetFrame(nsnull); - NS_RELEASE(mView); - } -} - -///////////////////////////////////////////////////////////////////////////// -// nsISupports - -nsresult nsFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kClassIID, kIFrameIID); - if (aIID.Equals(kClassIID) || (aIID.Equals(kISupportsIID))) { - *aInstancePtr = (void*)this; - return NS_OK; - } - return NS_NOINTERFACE; -} - -nsrefcnt nsFrame::AddRef(void) -{ - NS_ERROR("not supported"); - return 0; -} - -nsrefcnt nsFrame::Release(void) -{ - NS_ERROR("not supported"); - return 0; -} - -///////////////////////////////////////////////////////////////////////////// -// nsIFrame - -NS_METHOD nsFrame::DeleteFrame() -{ - nsIView* view = mView; - if (nsnull == view) { - nsIFrame* parent; - - GetParentWithView(parent); - if (nsnull != parent) { - parent->GetView(view); - } - } - if (nsnull != view) { - nsIViewManager* vm = view->GetViewManager(); - nsIPresContext* cx = vm->GetPresContext(); - // XXX Is this a really good ordering for the releases? MMP - NS_RELEASE(vm); - NS_RELEASE(view); - cx->StopLoadImage(this); - NS_RELEASE(cx); - } - - delete this; - return NS_OK; -} - -NS_METHOD nsFrame::GetContent(nsIContent*& aContent) const -{ - if (nsnull != mContent) { - NS_ADDREF(mContent); - } - aContent = mContent; - return NS_OK; -} - -NS_METHOD nsFrame::GetIndexInParent(PRInt32& aIndexInParent) const -{ - aIndexInParent = mIndexInParent; - return NS_OK; -} - -NS_METHOD nsFrame::SetIndexInParent(PRInt32 aIndexInParent) -{ - mIndexInParent = aIndexInParent; - return NS_OK; -} - -NS_METHOD nsFrame::GetStyleContext(nsIPresContext* aPresContext, - nsIStyleContext*& aStyleContext) -{ - if ((nsnull == mStyleContext) && (nsnull != aPresContext)) { - mStyleContext = aPresContext->ResolveStyleContextFor(mContent, mGeometricParent); // XXX should be content parent??? - if (nsnull != mStyleContext) { - DidSetStyleContext(); - } - } - NS_IF_ADDREF(mStyleContext); - aStyleContext = mStyleContext; - return NS_OK; -} - -NS_METHOD nsFrame::SetStyleContext(nsIStyleContext* aContext) -{ - NS_PRECONDITION(nsnull != aContext, "null ptr"); - if (aContext != mStyleContext) { - NS_IF_RELEASE(mStyleContext); - if (nsnull != aContext) { - mStyleContext = aContext; - NS_ADDREF(aContext); - DidSetStyleContext(); - } - } - - return NS_OK; -} - -// Subclass hook for style post processing -NS_METHOD nsFrame::DidSetStyleContext(void) -{ - return NS_OK; -} - -NS_METHOD nsFrame::GetStyleData(const nsIID& aSID, nsStyleStruct*& aStyleStruct) -{ - NS_ASSERTION(mStyleContext!=nsnull,"null style context"); - if (mStyleContext) { - aStyleStruct = mStyleContext->GetData(aSID); - } else { - aStyleStruct = nsnull; - } - return NS_OK; -} - -// Geometric and content parent member functions - -NS_METHOD nsFrame::GetContentParent(nsIFrame*& aParent) const -{ - aParent = mContentParent; - return NS_OK; -} - -NS_METHOD nsFrame::SetContentParent(const nsIFrame* aParent) -{ - mContentParent = (nsIFrame*)aParent; - return NS_OK; -} - -NS_METHOD nsFrame::GetGeometricParent(nsIFrame*& aParent) const -{ - aParent = mGeometricParent; - return NS_OK; -} - -NS_METHOD nsFrame::SetGeometricParent(const nsIFrame* aParent) -{ - mGeometricParent = (nsIFrame*)aParent; - return NS_OK; -} - -// Bounding rect member functions - -NS_METHOD nsFrame::GetRect(nsRect& aRect) const -{ - aRect = mRect; - return NS_OK; -} - -NS_METHOD nsFrame::GetOrigin(nsPoint& aPoint) const -{ - aPoint.x = mRect.x; - aPoint.y = mRect.y; - return NS_OK; -} - -NS_METHOD nsFrame::GetSize(nsSize& aSize) const -{ - aSize.width = mRect.width; - aSize.height = mRect.height; - return NS_OK; -} - -NS_METHOD nsFrame::SetRect(const nsRect& aRect) -{ - MoveTo(aRect.x, aRect.y); - SizeTo(aRect.width, aRect.height); - return NS_OK; -} - -NS_METHOD nsFrame::MoveTo(nscoord aX, nscoord aY) -{ - if ((aX != mRect.x) || (aY != mRect.y)) { - mRect.x = aX; - mRect.y = aY; - - // Let the view know - if (nsnull != mView) { - mView->SetPosition(aX, aY); - } - } - - return NS_OK; -} - -NS_METHOD nsFrame::SizeTo(nscoord aWidth, nscoord aHeight) -{ - //I have commented out this if test since we really need to - //always pass the fact that a resize was attempted to the - //view system. Today is 23-apr-98. If this change still looks - //good on or after 23-may-98, I'll kill the commented code - //altogether. Pretty scientific, huh? MMP - -// if ((aWidth != mRect.width) || (aHeight != mRect.height)) { - mRect.width = aWidth; - mRect.height = aHeight; - - // Let the view know - if (nsnull != mView) { - mView->SetDimensions(aWidth, aHeight); - } -// } - - return NS_OK; -} - -// Child frame enumeration - -NS_METHOD nsFrame::ChildCount(PRInt32& aChildCount) const -{ - aChildCount = 0; - return NS_OK; -} - -NS_METHOD nsFrame::ChildAt(PRInt32 aIndex, nsIFrame*& aFrame) const -{ - NS_ERROR("not a container"); - aFrame = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::IndexOf(const nsIFrame* aChild, PRInt32& aIndex) const -{ - NS_ERROR("not a container"); - aIndex = -1; - return NS_OK; -} - -NS_METHOD nsFrame::FirstChild(nsIFrame*& aFirstChild) const -{ - aFirstChild = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::NextChild(const nsIFrame* aChild, nsIFrame*& aNextChild) const -{ - NS_ERROR("not a container"); - aNextChild = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::PrevChild(const nsIFrame* aChild, nsIFrame*& aPrevChild) const -{ - NS_ERROR("not a container"); - aPrevChild = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::LastChild(nsIFrame*& aLastChild) const -{ - aLastChild = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - return NS_OK; -} - -/** - * - */ -NS_METHOD nsFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ -#if DO_SELECTION - - if (aEvent->message == NS_MOUSE_MOVE && mDoingSelection || - aEvent->message == NS_MOUSE_LEFT_BUTTON_UP || - aEvent->message == NS_MOUSE_LEFT_BUTTON_DOWN) { - } else { - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; - } - - //printf("-------------------------------------------------------------\n"); - - if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) { - if (!mDidDrag && mDoingSelection) { - //mEndSelect = 0; - HandleRelease(aPresContext, aEvent, aEventStatus, this); - } - } else if (aEvent->message == NS_MOUSE_MOVE) { - mDidDrag = PR_TRUE; - - HandleDrag(aPresContext, aEvent, aEventStatus, this); - //if (gSelectionDebug) printf("HandleEvent(Drag)::fTextRange %s\n", fTextRange->ToString()); - - } else if (aEvent->message == NS_MOUSE_LEFT_BUTTON_DOWN) { - nsIContent * content; - GetContent(content); - BuildContentList(content); - - HandlePress(aPresContext, aEvent, aEventStatus, this); - } - - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; -} - - -NS_METHOD nsFrame::HandlePress(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus, - nsFrame * aFrame) -{ - nsFrame * currentFrame = aFrame; - - PRInt32 offset = 0; - PRInt32 width = 0; - - mDoingSelection = PR_TRUE; - mDidDrag = PR_FALSE; - mCurrentFrame = currentFrame; - - /*fStartPos = GetPosition(aPresContext, aEvent, currentFrame); - - // CalcCursorPosition(aPresContext, aEvent, currentFrame, fStartPos, width); - - // Click count is 1 - nsIContent * newContent = currentFrame->GetContent(); - - // Fix this next section - if (fTextRange == nsnull) { - fTextRange = new nsTextRange(newContent, fStartPos, PR_TRUE, - newContent, fStartPos, PR_TRUE); - } else { - //selection.resetContentTrackers(); - - if (IsInRange(newContent, fTextRange)) { - //??selection.resetContentTrackers(); - if (gTrackerDebug) printf("Adding split range to removed selection.\n"); - - nsIContent * prevContent = GetPrevContent(newContent); - nsIContent * nextContent = GetNextContent(newContent); - - - //??addRangeToSelectionTrackers(selection, fTextRange.getStartContent(), - //?? prevContent, kInsertInRemoveList); - //??addRangeToSelectionTrackers(selection, nextContent, - //?? fTextRange.getEndContent(), kInsertInRemoveList); - - } else { - if (gTrackerDebug) printf("Adding full range to removed selection.\n"); - //addRangeToSelectionTrackers(selection, fTextRange.getStartContent(), - // fTextRange.getEndContent(), kInsertInRemoveList); // removed from selection - } - fTextRange->SetRange(newContent, fStartPos, PR_TRUE, - newContent, fStartPos, PR_TRUE); - } - if (fStartTextPoint == nsnull) { - fStartTextPoint = new nsTextPoint(nsnull, 0, PR_FALSE); - } - if (fEndTextPoint == nsnull) { - fEndTextPoint = new nsTextPoint(nsnull, 0, PR_FALSE); - } - fTextRange->GetStartTextPoint(fStartTextPoint); - fTextRange->GetEndTextPoint(fEndTextPoint); - - // [TODO] Recycle sub-selections here? - ////fSubSelection = new SubSelection(fTextRange); - ////selection.setSelection(fSubSelection); - //aPart.setSelection(fTextRange); - //updateSelection(); - ////selection.resetContentTrackers(); - - //addRangeToSelectionTrackers(selection, newContent, nsnull, kInsertInAddList); - - //// [TODO] Set position of caret at start point, - //// [TODO] Turn on caret and have it rendered - ////printf("Selection Start Point set."); - - fDoingSelection = PR_TRUE; - mCurrentFrame = currentFrame; - - //buildContentTree(currentFrame); - - //fCurrentParentContentList = eventStrategy.getParentList(); - printf("HandleEvent::fTextRange %s\n", fTextRange->ToString()); - - // Force Update - if (FORCE_SELECTION_UPDATE) { - nsRect rect; - GetRect(rect); - nsIView * view = GetView(); - if (view == nsnull) { - nsIFrame * frame = GetParentWithView(); - view = GetViewWithWindow(frame->GetView()); - } - rect.height *= 2; - nsIViewManager * viewMgr = view->GetViewManager(); - nsIDeviceContext * devContext = aPresContext.GetDeviceContext(); - nsIRenderingContext * renderContext = devContext->CreateRenderingContext(view); - viewMgr->Refresh(view, renderContext, &rect, NS_VMREFRESH_IMMEDIATE|NS_VMREFRESH_DOUBLE_BUFFER); - printf("***** %d\n", rect.height); - NS_RELEASE(renderContext); - NS_RELEASE(devContext); - NS_RELEASE(view); - }*/ - -#endif - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; - -} - -NS_METHOD nsFrame::HandleDrag(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus, - nsFrame * aFrame) -{ - PRBool isNewFrame = PR_FALSE; // for testing (rcs) - - mDidDrag = PR_TRUE; - - if (aFrame != nsnull) { - - // Check to see if we have changed frame - if (aFrame != mCurrentFrame) { - isNewFrame = PR_TRUE; - // We are in a new Frame! - if (gSelectionDebug) printf("HandleDrag::Different Frame in selection!\n"); - - // Get Content for current Frame - nsIContent * currentContent; - mCurrentFrame->GetContent(currentContent); - - // Get Content for New Frame - nsIContent * newContent; - aFrame->GetContent(newContent); - - // Check to see if we are still in the same Content - if (currentContent == newContent) { - if (gSelectionDebug) printf("HandleDrag::New Frame, same content.\n"); - - // AdjustTextPointsInNewContent(aPresContext, aEvent, newFrame); - - } else if (IsBefore(newContent, currentContent)) { - if (gSelectionDebug) printf("HandleDrag::New Frame, is Before.\n"); - - //??selection.resetContentTrackers(); - NewContentIsBefore(aPresContext, aEvent, newContent, currentContent, aFrame); - - } else { // Content is AFTER - if (gSelectionDebug) printf("HandleDrag::New Frame, is After.\n"); - - //??selection.resetContentTrackers(); - NewContentIsAfter(aPresContext, aEvent, newContent, currentContent, aFrame); - } - mCurrentFrame = aFrame; - } else { - if (gSelectionDebug) printf("HandleDrag::Same Frame.\n"); - - // Same Frame as before - //if (gSelectionDebug) printf("\nSame Start: %s\n", fStartTextPoint->ToString()); - //if (gSelectionDebug) printf("Same End: %s\n", fEndTextPoint->ToString()); - // [TODO] Uncomment these soon -/* - if (fStartTextPoint->GetContent() == fEndTextPoint->GetContent()) { - if (gSelectionDebug) printf("Start & End Frame are the same: \n"); - //AdjustTextPointsInSameContent(aPresContext, aEvent); - } else { - if (gSelectionDebug) printf("Start & End Frame are different: \n"); - - // Get Content for New Frame - nsIContent * newContent; - newFrame->GetContent(newContent); - PRInt32 newPos = -1; - - newPos = GetPosition(aPresContext, aEvent, newFrame); - - if (newContent == fStartTextPoint->GetContent()) { - if (gSelectionDebug) printf("New Content equals Start Content\n"); - fStartTextPoint->SetOffset(newPos); - fTextRange->SetStartPoint(fStartTextPoint); - } else if (newContent == fEndTextPoint->GetContent()) { - if (gSelectionDebug) printf("New Content equals End Content\n"); - fEndTextPoint->SetOffset(newPos); - fTextRange->SetEndPoint(fEndTextPoint); - } else { - if (gSelectionDebug) printf("=====\n=====\n=====\n=====\n=====\n=====\n Should NOT be here.\n"); - } - - //if (gSelectionDebug) printf("*Same Start: "+fStartTextPoint->GetOffset()+ - // " "+fStartTextPoint->IsAnchor()+ - // " End: "+fEndTextPoint->GetOffset() + - // " "+fEndTextPoint->IsAnchor()); - }*/ - //??doDragRepaint(mCurrentFrame); - } - } - - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; -} - -NS_METHOD nsFrame::HandleRelease(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus, - nsFrame * aFrame) -{ - mDoingSelection = PR_FALSE; - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; -} - - -NS_METHOD nsFrame::GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) -{ - aCursor = NS_STYLE_CURSOR_INHERIT; - return NS_OK; -} - -// Resize and incremental reflow - -NS_METHOD nsFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - aDesiredSize.width = 0; - aDesiredSize.height = 0; - aDesiredSize.ascent = 0; - aDesiredSize.descent = 0; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsFrame::JustifyReflow(nsIPresContext* aPresContext, - nscoord aAvailableSpace) -{ - return NS_OK; -} - -NS_METHOD nsFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - NS_ERROR("not a reflow command handler"); - aDesiredSize.width = 0; - aDesiredSize.height = 0; - aDesiredSize.ascent = 0; - aDesiredSize.descent = 0; - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - return NS_OK; -} - -NS_METHOD nsFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - return NS_OK; -} - -NS_METHOD nsFrame::ContentReplaced(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInParent) -{ - return NS_OK; -} - -NS_METHOD nsFrame::ContentDeleted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - return NS_OK; -} - -NS_METHOD nsFrame::GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics) -{ - aMetrics.width = mRect.width; - aMetrics.height = mRect.height; - aMetrics.ascent = mRect.height; - aMetrics.descent = 0; - return NS_OK; -} - -// Flow member functions - -NS_METHOD nsFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frNotSplittable; - return NS_OK; -} - -NS_METHOD nsFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - NS_ERROR("not splittable"); - aContinuingFrame = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::GetPrevInFlow(nsIFrame*& aPrevInFlow) const -{ - aPrevInFlow = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::SetPrevInFlow(nsIFrame*) -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -NS_METHOD nsFrame::GetNextInFlow(nsIFrame*& aNextInFlow) const -{ - aNextInFlow = nsnull; - return NS_OK; -} - -NS_METHOD nsFrame::SetNextInFlow(nsIFrame*) -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -NS_METHOD nsFrame::AppendToFlow(nsIFrame* aAfterFrame) -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -NS_METHOD nsFrame::PrependToFlow(nsIFrame* aBeforeFrame) -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -NS_METHOD nsFrame::RemoveFromFlow() -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -NS_METHOD nsFrame::BreakFromPrevFlow() -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -NS_METHOD nsFrame::BreakFromNextFlow() -{ - NS_ERROR("not splittable"); - return NS_OK; -} - -// Associated view object -NS_METHOD nsFrame::GetView(nsIView*& aView) const -{ - aView = mView; - NS_IF_ADDREF(aView); - return NS_OK; -} - -NS_METHOD nsFrame::SetView(nsIView* aView) -{ - NS_IF_RELEASE(mView); - if (nsnull != aView) { - mView = aView; - aView->SetFrame(this); - NS_ADDREF(aView); - } - return NS_OK; -} - -// Find the first geometric parent that has a view -NS_METHOD nsFrame::GetParentWithView(nsIFrame*& aParent) const -{ - aParent = mGeometricParent; - - while (nsnull != aParent) { - nsIView* parView; - - aParent->GetView(parView); - if (nsnull != parView) { - NS_RELEASE(parView); - break; - } - aParent->GetGeometricParent(aParent); - } - - return NS_OK; -} - -// Returns the offset from this frame to the closest geometric parent that -// has a view. Also returns the containing view or null in case of error -NS_METHOD nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const -{ - nsIFrame* frame = (nsIFrame*)this; - - aView = nsnull; - aOffset.MoveTo(0, 0); - do { - nsPoint origin; - - frame->GetOrigin(origin); - aOffset += origin; - frame->GetGeometricParent(frame); - if (nsnull != frame) { - frame->GetView(aView); - } - } while ((nsnull != frame) && (nsnull == aView)); - - return NS_OK; -} - -NS_METHOD nsFrame::GetWindow(nsIWidget*& aWindow) const -{ - nsIFrame* frame = (nsIFrame*)this; - - aWindow = nsnull; - while (nsnull != frame) { - nsIView* view; - - frame->GetView(view); - if (nsnull != view) { - aWindow = view->GetWidget(); - NS_RELEASE(view); - if (nsnull != aWindow) { - break; - } - } - frame->GetParentWithView(frame); - } - NS_POSTCONDITION(nsnull != aWindow, "no window in frame tree"); - return NS_OK; -} - -// Sibling pointer used to link together frames - -NS_METHOD nsFrame::GetNextSibling(nsIFrame*& aNextSibling) const -{ - aNextSibling = mNextSibling; - return NS_OK; -} - -NS_METHOD nsFrame::SetNextSibling(nsIFrame* aNextSibling) -{ - mNextSibling = aNextSibling; - return NS_OK; -} - -// Debugging -NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent) const -{ - // Indent - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - - // Output the tag and rect - ListTag(out); - fputs(" ", out); - out << mRect; - fputs("<>\n", out); - return NS_OK; -} - -// Output the frame's tag -NS_METHOD nsFrame::ListTag(FILE* out) const -{ - nsIAtom* tag = mContent->GetTag(); - if (tag != nsnull) { - nsAutoString buf; - tag->ToString(buf); - fputs(buf, out); - NS_RELEASE(tag); - } - fprintf(out, "(%d)@%p", mIndexInParent, this); - return NS_OK; -} - -NS_METHOD nsFrame::VerifyTree() const -{ - return NS_OK; -} - -//----------------------------------------------------------------------------------- -#if DO_SELECTION -//----------------------------------------------------------------------------------- - -nsIContent * fContentArray[1024]; -PRInt32 fMax = -1; - -//------------------------------ -void WalkTree(nsIContent * aParent) { - fContentArray[fMax++] = aParent; - for (PRInt32 i=0;iChildCount();i++) { - nsIContent * node = aParent->ChildAt(i); - WalkTree(node); - } -} - -//------------------------------ -void PrintContent() { - //static NS_DEFINE_IID(kITextContentIID, NS_ITEXTCONTENT_IID); - static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID); - - nsIDOMText * textContent; - - for (int i=0;iQueryInterface(kIDOMTextIID, (void**) &textContent); - if (NS_OK == status) { - nsString text; - //textContent->GetText(text, 0, textContent->GetLength()); - textContent->GetData(text); - char * str = text.ToNewCString(); - printf("%i [%s]\n", i, str); - delete str; - } - } -} - - -//------------------------------ -void BuildContentList(nsIContent * Start) { - - if (fMax > -1) { - return; - } - - fMax = 0; - nsIContent * node = Start; - nsIContent * parent = node->GetParent(); - // root content - while (parent != nsnull) { - parent = node->GetParent(); - if (parent != nsnull) { - node = parent; - } - } // while - //fContentArray = new nsIContent[1024]; - WalkTree(node); - PrintContent(); -} - - -//-------------------------------------------------------------------------- -// Determines whether a piece of content in question is inbetween the two -// piece of content -//-------------------------------------------------------------------------- -PRBool IsInRange(nsIContent * aStartContent, - nsIContent * aEndContent, - nsIContent * aContent) { - // Start and End Content is the same, so check against the start - if (aStartContent == aEndContent) { - return PRBool(aContent == aStartContent); - } - - // Check to see if it is equal to the start or the end - if (aContent == aStartContent || aContent == aEndContent) { - return PR_TRUE; - } - - PRBool foundStart = PR_FALSE; - if (fMax == -1) { - BuildContentList(aContent); - } - - for (PRInt32 i=0;iGetContent(), fEndTextPoint->GetContent(), aNewContent)) { - - // Case #1 - Remove Current Content from Selection (at End) - if (gSelectionDebug) printf("Case #1 - (Before) New Content is in selected Range.\n"); - - if (aNewContent == fStartTextPoint->GetContent()) { - // [TODO] This is where we might have to delete from end to new content - - // Returns the new End Point, if Start and End are on the - // same content then End Point's Cursor is set to Start's - fEndTextPoint->SetContent(fStartTextPoint->GetContent()); - AdjustTextPointsInNewContent(aPresContext, aEvent, aNewFrame); - - } else { - PRInt32 newPos = GetPosition(aPresContext, aEvent, aNewFrame); - fEndTextPoint->SetPoint(aNewContent, newPos, PR_FALSE); - fTextRange->SetEndPoint(fEndTextPoint); - } - - // The current content is being removed from Selection - //??addRangeToSelectionTrackers(aSelection, null, aCurrentContent, kInsertInRemoveList); - } else { - // Case #2 - Add new content to selection (At Start) - if (gSelectionDebug) printf("Case #2 - (Before) New Content is NOT in selected Range. Moving Start Backward.\n"); - - PRInt32 newPos = GetPosition(aPresContext, aEvent, aNewFrame); - - // Create new TextPoint and move Start Point backward - fStartTextPoint->SetPoint(aNewContent, newPos, PR_FALSE); // position is set correctly in adjustTextPoints - - // The New Content is added to Tracker - //??addRangeToSelectionTrackers(aSelection, aNewContent, null, kInsertInAddList); - } - //??doDragRepaint(fCurrentFrame); - //??doDragRepaint(aNewFrame); - //??if (gSelectionDebug) fTextRange.printContent(); -#endif -} - -/******************************************************** -* Handles a when the cursor enters new content that is After -* the content that the cursor is currently in -*********************************************************/ -void nsFrame::NewContentIsAfter(nsIPresContext& aPresContext, - nsGUIEvent * aEvent, - nsIContent * aNewContent, - nsIContent * aCurrentContent, - nsIFrame * aNewFrame) -{ - if (gSelectionDebug) printf("New Frame, New content is after.\n"); -#if 0 - - // Dragging Mouse to the Right - // - // 3) The cursor is being dragged foward in the content - // and the mouse is "before" the anchor in the content - // and the current piece of content is being removed from the selection - // - // This section cover two cases: - // 4) The cursor is being dragged foward in the content - // and the mouse is "after" the anchor in the content - // and each new piece of content is being added to the selection - // - - // Check to see if the new content is in the selection - if (IsInRange(fStartTextPoint->GetContent(), fEndTextPoint->GetContent(), aNewContent)) { - - // Case #3 - Remove Content (from Start) - if (gSelectionDebug) printf("Case #3 - (After) New Content is in selected Range.\n"); - - // [TODO] Always get nearest Text content - PRInt32 newPos = GetPosition(aPresContext, aEvent, aNewFrame); - - // Check to see if the new Content is the same as the End Point's - if (aNewContent == fEndTextPoint->GetContent()) { - if (gSelectionDebug) printf("New Content matches End Point\n"); - - fStartTextPoint->SetContent(aNewContent); - AdjustTextPointsInNewContent(aPresContext, aEvent, aNewFrame); - - } else { - if (gSelectionDebug) printf("New Content does NOT matches End Point\n"); - fStartTextPoint->SetPoint(aNewContent, newPos, PR_FALSE); - fTextRange->SetStartPoint(fStartTextPoint); - } - - // Remove Current Content in Tracker, but leave New Content in Selection - //??addRangeToSelectionTrackers(aSelection, aCurrentContent, null, kInsertInRemoveList); - } else { - if (gSelectionDebug) - printf("Case #4 - (After) Adding New Content\n"); - - // Case #2 - Adding Content (at End) - // The new content is not in the selection - PRInt32 newPos = GetPosition(aPresContext, aEvent, aNewFrame); - - // Check to see if we need to create a new TextPoint and add it - // or do we simply move the existing start or end point - if (fStartTextPoint->GetContent() == fEndTextPoint->GetContent()) { - if (gSelectionDebug) printf("Case #4 - Start & End Content the Same\n"); - // Move start or end point - // Get new Cursor Poition in the new content - - if (fStartTextPoint->IsAnchor()) { - if (gSelectionDebug) printf("Case #4 - Start is Anchor\n"); - // Since the Start is the Anchor just adjust the end - // What is up Here???????? - if (gSelectionDebug) printf("Start: %s\n", fStartTextPoint->ToString()); - if (gSelectionDebug) printf("End: %s\n", fEndTextPoint->ToString()); - if (gSelectionDebug) printf("---->"); - - fEndTextPoint->SetPoint(aNewContent, newPos, PR_FALSE); - fTextRange->SetEndPoint(fEndTextPoint); - - if (gSelectionDebug) printf("Start: %s\n", fStartTextPoint->ToString()); - if (gSelectionDebug) printf("End: %s\n", fEndTextPoint->ToString()); - - } else { - if (gSelectionDebug) printf("Case #4 - Start is NOT Anchor\n"); - // Because End was the anchor, we need to set the Start Point to - // the End's Offset and set it to be the new anchor - - int endPos = fEndTextPoint->GetOffset(); - fStartTextPoint->SetOffset(endPos); - fStartTextPoint->SetAnchor(PR_TRUE); - - // The Start point was being moved so when it jumped to the new frame - // we needed to make it the new End Point - fEndTextPoint->SetPoint(aNewContent, newPos, PR_FALSE); - fTextRange->SetRange(fStartTextPoint, fEndTextPoint); - } - // Same Content so don't do anything with Selection Tracker - // Add New Content to Selection Tracker - //??addRangeToSelectionTrackers(aSelection, aNewContent, null, kInsertInAddList); - } else { - if (gSelectionDebug) printf("Case #4 - Start & End Content NOT the Same\n"); - // Adjust the end point - fEndTextPoint->SetPoint(aNewContent, newPos, PR_FALSE); - fTextRange->SetRange(fStartTextPoint, fEndTextPoint); - - // Add New Content to Selection Tracker - //?? addRangeToSelectionTrackers(aSelection, aNewContent, null, kInsertInAddList); - } - } - //??if (gSelectionDebug) fTextRange.printContent(); -#endif -} - -#endif \ No newline at end of file diff --git a/mozilla/layout/base/src/nsFrame.h b/mozilla/layout/base/src/nsFrame.h deleted file mode 100644 index ed81cf94e34..00000000000 --- a/mozilla/layout/base/src/nsFrame.h +++ /dev/null @@ -1,228 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsFrame_h___ -#define nsFrame_h___ - -#include "nsIFrame.h" -#include "nsRect.h" - - -// Implementation of a simple frame with no children and that isn't splittable -class nsFrame : public nsIFrame -{ -public: - /** - * Create a new "empty" frame that maps a given piece of content into a - * 0,0 area. - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - - // Overloaded new operator. Initializes the memory to 0 - void* operator new(size_t size); - - NS_IMETHOD DeleteFrame(); - - NS_IMETHOD GetContent(nsIContent*& aContent) const; - NS_IMETHOD GetIndexInParent(PRInt32& aIndexInParent) const; - NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent); - - NS_IMETHOD GetStyleContext(nsIPresContext* aContext, nsIStyleContext*& aStyleContext); - NS_IMETHOD SetStyleContext(nsIStyleContext* aContext); - - // Get the style struct associated with this frame - NS_IMETHOD GetStyleData(const nsIID& aSID, nsStyleStruct*& aStyleStruct); - - - // Geometric and content parent - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const; - NS_IMETHOD SetContentParent(const nsIFrame* aParent); - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent); - - // Bounding rect - NS_IMETHOD GetRect(nsRect& aRect) const; - NS_IMETHOD GetOrigin(nsPoint& aPoint) const; - NS_IMETHOD GetSize(nsSize& aSize) const; - NS_IMETHOD SetRect(const nsRect& aRect); - NS_IMETHOD MoveTo(nscoord aX, nscoord aY); - NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight); - - // Child frame enumeration - NS_IMETHOD ChildCount(PRInt32& aChildCount) const; - NS_IMETHOD ChildAt(PRInt32 aIndex, nsIFrame*& aFrame) const; - NS_IMETHOD IndexOf(const nsIFrame* aChild, PRInt32& aIndex) const; - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; - NS_IMETHOD NextChild(const nsIFrame* aChild, nsIFrame*& aNextChild) const; - NS_IMETHOD PrevChild(const nsIFrame* aChild, nsIFrame*& aPrevChild) const; - NS_IMETHOD LastChild(nsIFrame*& aLastChild) const; - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); - - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor); - - // Resize reflow methods - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD JustifyReflow(nsIPresContext* aPresContext, - nscoord aAvailableSpace); - - // Incremental reflow methods - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer); - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); - NS_IMETHOD ContentReplaced(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInParent); - NS_IMETHOD ContentDeleted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); - - NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics); - - // Flow member functions - NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const; - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - NS_IMETHOD GetPrevInFlow(nsIFrame*& aPrevInFlow) const; - NS_IMETHOD SetPrevInFlow(nsIFrame*); - NS_IMETHOD GetNextInFlow(nsIFrame*& aNextInFlow) const; - NS_IMETHOD SetNextInFlow(nsIFrame*); - - NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame); - NS_IMETHOD PrependToFlow(nsIFrame* aAfterFrame); - NS_IMETHOD RemoveFromFlow(); - NS_IMETHOD BreakFromPrevFlow(); - NS_IMETHOD BreakFromNextFlow(); - - // Associated view object - NS_IMETHOD GetView(nsIView*& aView) const; - NS_IMETHOD SetView(nsIView* aView); - - // Find the first geometric parent that has a view - NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const; - - // Returns the offset from this frame to the closest geometric parent that - // has a view. Also returns the containing view, or null in case of error - NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const; - - // Returns the closest geometric parent that has a view which has a - // a window. - NS_IMETHOD GetWindow(nsIWidget*&) const; - - // Sibling pointer used to link together frames - NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const; - NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling); - - // Debugging - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - NS_IMETHOD ListTag(FILE* out = stdout) const; - NS_IMETHOD VerifyTree() const; - -protected: - // Style post processing hook - NS_METHOD DidSetStyleContext(void); - - // Selection Methods - NS_METHOD HandlePress(nsIPresContext& aPresContext, - nsGUIEvent * aEvent, - nsEventStatus& aEventStatus, - nsFrame * aFrame); - - NS_METHOD HandleDrag(nsIPresContext& aPresContext, - nsGUIEvent * aEvent, - nsEventStatus& aEventStatus, - nsFrame * aFrame); - - NS_METHOD HandleRelease(nsIPresContext& aPresContext, - nsGUIEvent * aEvent, - nsEventStatus& aEventStatus, - nsFrame * aFrame); - - void NewContentIsBefore(nsIPresContext& aPresContext, - nsGUIEvent * aEvent, - nsIContent * aNewContent, - nsIContent * aCurrentContent, - nsIFrame * aNewFrame); - - void NewContentIsAfter(nsIPresContext& aPresContext, - nsGUIEvent * aEvent, - nsIContent * aNewContent, - nsIContent * aCurrentContent, - nsIFrame * aNewFrame); - - - // Constructor. Takes as arguments the content object, the index in parent, - // and the Frame for the content parent - nsFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsFrame(); - - nsRect mRect; - nsIContent* mContent; - nsIStyleContext* mStyleContext; - PRInt32 mIndexInParent; - nsIFrame* mContentParent; - nsIFrame* mGeometricParent; - nsIFrame* mNextSibling; // singly linked list of frames - -private: - nsIView* mView; // must use accessor member functions - - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); -}; - -#endif /* nsFrame_h___ */ diff --git a/mozilla/layout/base/src/nsGalleyContext.cpp b/mozilla/layout/base/src/nsGalleyContext.cpp deleted file mode 100644 index 03f9dd9d309..00000000000 --- a/mozilla/layout/base/src/nsGalleyContext.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPresContext.h" -#include "nsIRenderingContext.h" -#include "nsIView.h" -#include "nsIWidget.h" -#include "nsGfxCIID.h" - -static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); - -class GalleyContext : public nsPresContext { -public: - GalleyContext(); - ~GalleyContext(); - - virtual PRBool IsPaginated(); - virtual nscoord GetPageWidth(); - virtual nscoord GetPageHeight(); -}; - -GalleyContext::GalleyContext() -{ - nsresult res; - - static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID); - - res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, - kDeviceContextIID, - (void **)&mDeviceContext); - if (NS_OK == res) { - mDeviceContext->Init(); - mDeviceContext->SetDevUnitsToAppUnits(mDeviceContext->GetDevUnitsToTwips()); - mDeviceContext->SetAppUnitsToDevUnits(mDeviceContext->GetTwipsToDevUnits()); - } -} - -GalleyContext::~GalleyContext() -{ - mDeviceContext->FlushFontCache(); - NS_IF_RELEASE(mDeviceContext); -} - -PRBool GalleyContext::IsPaginated() -{ - return PR_FALSE; -} - -nscoord GalleyContext::GetPageWidth() -{ - return 0; -} - -nscoord GalleyContext::GetPageHeight() -{ - return 0; -} - -NS_LAYOUT nsresult -NS_NewGalleyContext(nsIPresContext** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - GalleyContext *it = new GalleyContext(); - - if (it == nsnull) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIPresContextIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/base/src/nsPresContext.cpp b/mozilla/layout/base/src/nsPresContext.cpp deleted file mode 100644 index 47f3bd99801..00000000000 --- a/mozilla/layout/base/src/nsPresContext.cpp +++ /dev/null @@ -1,471 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPresContext.h" -#include "nsIPresShell.h" -#include "nsILinkHandler.h" -#include "nsIStyleContext.h" -#include "nsIStyleSet.h" -#include "nsIFontMetrics.h" -#include "nsIImageManager.h" -#include "nsIImageGroup.h" -#include "nsIImageRequest.h" -#include "nsIImageObserver.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsIFrame.h" -#include "nsIRenderingContext.h" -#include "nsTransform2D.h" -#include "nsIDocument.h" -#include "nsIURL.h" -#include "nsString.h" - -static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); - -#if 0 -// XXX this code needs to move far away from here -static nsIImageManager* gImageManager = nsnull; -static void InitImageLibrary() -{ - // Initialize image library - if (NS_OK == NS_NewImageManager(&gImageManager)) { - if (NS_OK == gImageManager->Init()) { - gImageManager->SetCacheSize(1024*1024); - return; - } - } - printf("can't initialize image library\n"); -} -// XXX end code with no home... -#endif - -class ImageLoader : public nsIImageRequestObserver { -public: - ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame); - ~ImageLoader(); - - NS_DECL_ISUPPORTS - - void LoadImage(const nsString& aURL); - - const nsString& GetURL() const { - return mURL; - } - - nsIImage* GetImage() { - return mImage; - } - - PRInt32 FrameCount(); - - PRBool RemoveFrame(nsIFrame* aFrame); - - void AddFrame(nsIFrame* aFrame); - - void UpdateFrames(); - - virtual void Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3); - - virtual void NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType); - - nsVoidArray mFrames; - nsString mURL; - nsPresContext* mCX; - nsIImage* mImage; - nsIImageRequest* mImageRequest; - nsIImageGroup* mImageGroup; - - PRInt32 mWidth, mHeight; // in pixels -}; - -ImageLoader::ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, - nsIFrame* aFrame) -{ - mCX = aCX; - AddFrame(aFrame); - mImage = nsnull; - mImageRequest = nsnull; - mImageGroup = aGroup; NS_ADDREF(aGroup); - mWidth = -1; - mHeight = -1; -} - -ImageLoader::~ImageLoader() -{ - if (nsnull != mImageRequest) { - mImageRequest->Interrupt(); - mImageRequest->RemoveObserver(this); - } -} - -void ImageLoader::LoadImage(const nsString& aURL) -{ - if (nsnull == mImage) { - // Save url - mURL.SetLength(0); - mURL.Append(aURL); - - // Start image load - char* cp = aURL.ToNewCString(); - mImageRequest = mImageGroup->GetImage(cp, this, NS_RGB(255,255,255), - 0, 0, 0); - delete cp; - } -} - -static NS_DEFINE_IID(kIImageRequestObserver, NS_IIMAGEREQUESTOBSERVER_IID); - -NS_IMPL_ISUPPORTS(ImageLoader, kIImageRequestObserver); - -static PRBool gXXXInstalledColorMap; -void ImageLoader::Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3) -{ - switch (aNotificationType) { - case nsImageNotification_kDimensions: -#ifdef NOISY - printf("Image:%d x %d\n", aParam1, aParam2); -#endif - mWidth = aParam1; - mHeight = aParam2; - break; - - case nsImageNotification_kPixmapUpdate: - case nsImageNotification_kImageComplete: - case nsImageNotification_kFrameComplete: - if ((mImage == nsnull) && (nsnull != aImage)) { - mImage = aImage; - NS_ADDREF(aImage); - } - UpdateFrames(); - } -} - -PRInt32 ImageLoader::FrameCount() -{ - return mFrames.Count(); -} - -PRBool ImageLoader::RemoveFrame(nsIFrame* aFrame) -{ - return mFrames.RemoveElement(aFrame); -} - -void ImageLoader::AddFrame(nsIFrame* aFrame) -{ - PRInt32 i, n = mFrames.Count(); - for (i = 0; i < n; i++) { - nsIFrame* frame = (nsIFrame*) mFrames.ElementAt(i); - if (frame == aFrame) { - return; - } - } - mFrames.AppendElement(aFrame); -} - -void ImageLoader::UpdateFrames() -{ - PRInt32 i, n = mFrames.Count(); - for (i = 0; i < n; i++) { - nsIFrame* frame = (nsIFrame*) mFrames.ElementAt(i); - - // XXX installed colormap should be presentation-context/window state - nsIWidget* window; - - frame->GetWindow(window); - if (!gXXXInstalledColorMap && mImage) { - nsColorMap* cmap = mImage->GetColorMap(); - if ((nsnull != cmap) && (cmap->NumColors > 0)) { - window->SetColorMap(cmap); - } - gXXXInstalledColorMap = PR_TRUE; - } - - // Determine damaged area and tell view manager to redraw it - nsPoint offset; - nsRect bounds; - frame->GetRect(bounds); - nsIView* view; - - frame->GetOffsetFromView(offset, view); - nsIViewManager* vm = view->GetViewManager(); - bounds.x = offset.x; - bounds.y = offset.y; - vm->UpdateView(view, bounds, 0); - NS_RELEASE(vm); - NS_RELEASE(view); - } -} - -void ImageLoader::NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType) -{ - printf("XXX image error: %d\n", aErrorType); -} - -//---------------------------------------------------------------------- - -nsPresContext::nsPresContext() - : mVisibleArea(0, 0, 0, 0), - mDefaultFont("Times", NS_FONT_STYLE_NORMAL, - NS_FONT_VARIANT_NORMAL, - NS_FONT_WEIGHT_NORMAL, - 0, - NS_POINTS_TO_TWIPS_INT(12)) -{ - NS_INIT_REFCNT(); - mShell = nsnull; - mDeviceContext = nsnull; - mImageGroup = nsnull; - mLinkHandler = nsnull; - mContainer = nsnull; -} - -nsPresContext::~nsPresContext() -{ - mShell = nsnull; - - // XXX there is a race between an async notify and this code because - // the presentation shell code deletes the frame tree first and then - // deletes us. We need an "Deactivation" hook for this code too - - // Release all the image loaders - PRInt32 n = mImageLoaders.Count(); - for (PRInt32 i = 0; i < n; i++) { - ImageLoader* loader = (ImageLoader*) mImageLoaders.ElementAt(i); - delete loader; - } - - // XXX Release all the cached images - - if (nsnull != mImageGroup) { - mImageGroup->Interrupt(); - NS_RELEASE(mImageGroup); - } - - NS_IF_RELEASE(mLinkHandler); - NS_IF_RELEASE(mContainer); -} - -nsrefcnt nsPresContext::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt nsPresContext::Release(void) -{ - NS_PRECONDITION(0 != mRefCnt, "bad refcnt"); - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} - -NS_IMPL_QUERY_INTERFACE(nsPresContext, kIPresContextIID); - -// Note: We don't hold a reference on the shell; it has a reference to -// us -void nsPresContext::SetShell(nsIPresShell* aShell) -{ - mShell = aShell; -} - -nsIPresShell* nsPresContext::GetShell() -{ - if (nsnull != mShell) { - NS_ADDREF(mShell); - } - return mShell; -} - -nsIStyleContext* -nsPresContext::ResolveStyleContextFor(nsIContent* aContent, - nsIFrame* aParentFrame) -{ - nsIStyleContext* result = nsnull; - - nsIStyleSet* set = mShell->GetStyleSet(); - if (nsnull != set) { - result = set->ResolveStyleFor(this, aContent, aParentFrame); - NS_RELEASE(set); - } - - return result; -} - -nsIFontMetrics* nsPresContext::GetMetricsFor(const nsFont& aFont) -{ - if (nsnull != mDeviceContext) - return mDeviceContext->GetMetricsFor(aFont); - - return nsnull; -} - -const nsFont& nsPresContext::GetDefaultFont(void) -{ - return mDefaultFont; -} - -nsRect nsPresContext::GetVisibleArea() -{ - return mVisibleArea; -} - -void nsPresContext::SetVisibleArea(const nsRect& r) -{ - mVisibleArea = r; -} - -float nsPresContext::GetPixelsToTwips() const -{ - if (nsnull != mDeviceContext) - return mDeviceContext->GetDevUnitsToAppUnits(); - - return 1.0f; -} - -float nsPresContext::GetTwipsToPixels() const -{ - if (nsnull != mDeviceContext) - return mDeviceContext->GetAppUnitsToDevUnits(); - - return 1.0f; -} - -nsIDeviceContext * nsPresContext::GetDeviceContext() const -{ - NS_IF_ADDREF(mDeviceContext); - return mDeviceContext; -} - -nsIImage* nsPresContext::LoadImage(const nsString& aURL, nsIFrame* aForFrame) -{ - if (nsnull == mImageGroup) { - // XXX this is bad; if we allow for subwindows that have different - // rendering context's this won't work - nsIWidget* window; - - aForFrame->GetWindow(window); - nsIRenderingContext* drawCtx = window->GetRenderingContext(); - drawCtx->Scale(mDeviceContext->GetAppUnitsToDevUnits(), - mDeviceContext->GetAppUnitsToDevUnits()); - if ((NS_OK != NS_NewImageGroup(&mImageGroup)) || - (NS_OK != mImageGroup->Init(drawCtx))) { - // XXX what to do? - printf("XXX: can't get image group created\n"); - NS_RELEASE(drawCtx); - return nsnull; - } - NS_RELEASE(drawCtx); - } - - // Get absolute version of the url - nsIDocument* doc = mShell->GetDocument(); - nsIURL* docURL = doc->GetDocumentURL(); - char* spec = aURL.ToNewCString(); - nsIURL* url; - nsresult rv = NS_NewURL(&url, docURL, spec); - delete spec; - NS_RELEASE(docURL); - NS_RELEASE(doc); - if (NS_OK != rv) { - // XXX lost error - return nsnull; - } - nsAutoString absURL; - url->ToString(absURL); - NS_RELEASE(url); - - PRInt32 n = mImageLoaders.Count(); - for (PRInt32 i = 0; i < n; i++) { - ImageLoader* loader = (ImageLoader*) mImageLoaders.ElementAt(i); - if (absURL.Equals(loader->GetURL())) { - loader->AddFrame(aForFrame); - return loader->GetImage(); - } - } - - ImageLoader* loader = new ImageLoader(this, mImageGroup, aForFrame); - mImageLoaders.AppendElement(loader); - - loader->LoadImage(absURL); - return loader->GetImage(); -} - -void nsPresContext::StopLoadImage(nsIFrame* aForFrame) -{ - PRInt32 n = mImageLoaders.Count(); - for (PRInt32 i = 0; i < n;) { - ImageLoader* loader = (ImageLoader*) mImageLoaders.ElementAt(i); - if (loader->RemoveFrame(aForFrame)) { - if (0 == loader->FrameCount()) { - delete loader; - mImageLoaders.RemoveElementAt(i); - n--; - continue; - } - } - i++; - } -} - -NS_IMETHODIMP nsPresContext::SetLinkHandler(nsILinkHandler* aHandler) -{ // XXX should probably be a WEAK reference - NS_IF_RELEASE(mLinkHandler); - mLinkHandler = aHandler; - NS_IF_ADDREF(aHandler); - return NS_OK; -} - -NS_IMETHODIMP nsPresContext::GetLinkHandler(nsILinkHandler** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mLinkHandler; - NS_IF_ADDREF(mLinkHandler); - return NS_OK; -} - -NS_IMETHODIMP nsPresContext::SetContainer(nsISupports* aHandler) -{ // XXX should most likely be a WEAK reference - NS_IF_RELEASE(mContainer); - mContainer = aHandler; - NS_IF_ADDREF(aHandler); - return NS_OK; -} - -NS_IMETHODIMP nsPresContext::GetContainer(nsISupports** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mContainer; - NS_IF_ADDREF(mContainer); - return NS_OK; -} diff --git a/mozilla/layout/base/src/nsPresContext.h b/mozilla/layout/base/src/nsPresContext.h deleted file mode 100644 index 92ca53013a7..00000000000 --- a/mozilla/layout/base/src/nsPresContext.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsPresContext_h___ -#define nsPresContext_h___ - -#include "nsIPresContext.h" -#include "nsIDeviceContext.h" -#include "nsVoidArray.h" -#include "nsFont.h" -class nsIImageGroup; - -// Base class for concrete presentation context classes -class nsPresContext : public nsIPresContext { -public: - NS_DECL_ISUPPORTS - - virtual void SetShell(nsIPresShell* aShell); - virtual nsIPresShell* GetShell(); - virtual nsIStyleContext* ResolveStyleContextFor(nsIContent* aContent, - nsIFrame* aParentFrame); - virtual nsIFontMetrics* GetMetricsFor(const nsFont& aFont); - virtual const nsFont& GetDefaultFont(void); - virtual nsIImage* LoadImage(const nsString&, nsIFrame* aForFrame); - virtual void StopLoadImage(nsIFrame* aForFrame); - - NS_IMETHOD SetContainer(nsISupports* aContainer); - - NS_IMETHOD GetContainer(nsISupports** aResult); - - NS_IMETHOD SetLinkHandler(nsILinkHandler* aHander); - - NS_IMETHOD GetLinkHandler(nsILinkHandler** aResult); - - virtual nsRect GetVisibleArea(); - virtual void SetVisibleArea(const nsRect& r); - - virtual float GetPixelsToTwips() const; - virtual float GetTwipsToPixels() const; - - virtual nsIDeviceContext* GetDeviceContext() const; - -protected: - nsPresContext(); - virtual ~nsPresContext(); - - nsIPresShell* mShell; - nsRect mVisibleArea; - nsIDeviceContext* mDeviceContext; - nsIImageGroup* mImageGroup; - nsILinkHandler* mLinkHandler; - nsISupports* mContainer; - nsFont mDefaultFont; - - nsVoidArray mImageLoaders;/* XXX temporary */ - -private: - // Not supported and not implemented - nsPresContext(const nsPresContext&); - nsPresContext& operator=(const nsPresContext&); -}; - -#endif /* nsPresContext_h___ */ diff --git a/mozilla/layout/base/src/nsPresShell.cpp b/mozilla/layout/base/src/nsPresShell.cpp deleted file mode 100644 index d9acac6b4d0..00000000000 --- a/mozilla/layout/base/src/nsPresShell.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIDocument.h" -#include "nsIStyleSet.h" -#include "nsIStyleContext.h" -#include "nsIFrame.h" -#include "nsReflowCommand.h" -#include "nsIViewManager.h" -#include "nsIView.h" -#include "nsCRT.h" -#include "plhash.h" - -#undef NOISY - -static PLHashNumber HashKey(nsIFrame* key) -{ - return (PLHashNumber) key; -} - -static PRIntn CompareKeys(nsIFrame* key1, nsIFrame* key2) -{ - return key1 == key2; -} - -class FrameHashTable { -public: - FrameHashTable(); - ~FrameHashTable(); - - void* Get(nsIFrame* aKey); - void* Put(nsIFrame* aKey, void* aValue); - void* Remove(nsIFrame* aKey); - -protected: - PLHashTable* mTable; -}; - -FrameHashTable::FrameHashTable() -{ - mTable = PL_NewHashTable(8, (PLHashFunction) HashKey, - (PLHashComparator) CompareKeys, - (PLHashComparator) nsnull, - nsnull, nsnull); -} - -FrameHashTable::~FrameHashTable() -{ - // XXX if debugging then we should assert that the table is empty - PL_HashTableDestroy(mTable); -} - -/** - * Get the data associated with a frame. - */ -void* FrameHashTable::Get(nsIFrame* aKey) -{ - PRInt32 hashCode = (PRInt32) aKey; - PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey); - PLHashEntry* he = *hep; - if (nsnull != he) { - return he->value; - } - return nsnull; -} - -/** - * Create an association between a frame and some data. This call - * returns an old association if there was one (or nsnull if there - * wasn't). - */ -void* FrameHashTable::Put(nsIFrame* aKey, void* aData) -{ - PRInt32 hashCode = (PRInt32) aKey; - PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey); - PLHashEntry* he = *hep; - if (nsnull != he) { - void* oldValue = he->value; - he->value = aData; - return oldValue; - } - PL_HashTableRawAdd(mTable, hep, hashCode, aKey, aData); - return nsnull; -} - -/** - * Remove an association between a frame and it's data. This returns - * the old associated data. - */ -void* FrameHashTable::Remove(nsIFrame* aKey) -{ - PRInt32 hashCode = (PRInt32) aKey; - PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey); - PLHashEntry* he = *hep; - void* oldValue = nsnull; - if (nsnull != he) { - oldValue = he->value; - PL_HashTableRawRemove(mTable, hep, he); - } - return oldValue; -} - -//---------------------------------------------------------------------- - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIPresShellIID, NS_IPRESSHELL_IID); -static NS_DEFINE_IID(kIDocumentObserverIID, NS_IDOCUMENTOBSERVER_IID); - -class PresShell : public nsIPresShell { -public: - PresShell(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - // nsISupports - NS_DECL_ISUPPORTS - - // nsIDocumentObserver - NS_IMETHOD SetTitle(const nsString& aTitle); - virtual void BeginUpdate(); - virtual void EndUpdate(); - virtual void ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType); - virtual void ContentAppended(nsIContent* aContainer); - virtual void ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer); - virtual void ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer); - virtual void ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer); - virtual void ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer); - virtual void StyleSheetAdded(nsIStyleSheet* aStyleSheet); - - // nsIPresShell - virtual nsresult Init(nsIDocument* aDocument, - nsIPresContext* aPresContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet); - virtual nsIDocument* GetDocument(); - virtual nsIPresContext* GetPresContext(); - virtual nsIViewManager* GetViewManager(); - virtual nsIStyleSet* GetStyleSet(); - virtual void BeginObservingDocument(); - virtual void EndObservingDocument(); - virtual void ResizeReflow(nscoord aWidth, nscoord aHeight); - virtual nsIFrame* GetRootFrame(); - virtual nsIFrame* FindFrameWithContent(nsIContent* aContent); - virtual void AppendReflowCommand(nsReflowCommand* aReflowCommand); - virtual void ProcessReflowCommands(); - virtual void PutCachedData(nsIFrame* aKeyFrame, void* aData); - virtual void* GetCachedData(nsIFrame* aKeyFrame); - virtual void* RemoveCachedData(nsIFrame* aKeyFrame); - -protected: - ~PresShell(); - - FrameHashTable* mCache; - nsIDocument* mDocument; - nsIPresContext* mPresContext; - nsIStyleSet* mStyleSet; - nsIFrame* mRootFrame; - nsIViewManager* mViewManager; - PRUint32 mUpdateCount; - nsVoidArray mReflowCommands; -}; - -//---------------------------------------------------------------------- - -PresShell::PresShell() -{ -} - -nsrefcnt PresShell::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt PresShell::Release(void) -{ - NS_PRECONDITION(0 != mRefCnt, "bad refcnt"); - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} - -nsresult PresShell::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (aIID.Equals(kIPresShellIID)) { - *aInstancePtr = (void*) ((nsIPresShell*) this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIDocumentObserverIID)) { - *aInstancePtr = (void*) ((nsIDocumentObserver*) this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*) ((nsISupports*) ((nsIPresShell*)this)); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -PresShell::~PresShell() -{ - delete mCache; - - if (nsnull != mDocument) { - mDocument->DeleteShell(this); - NS_RELEASE(mDocument); - } - if (nsnull != mRootFrame) { - mRootFrame->DeleteFrame(); - } - NS_IF_RELEASE(mPresContext); - NS_IF_RELEASE(mViewManager); - NS_IF_RELEASE(mStyleSet); -} - -/** - * Initialize the presentation shell. Create view manager and style - * manager. - */ -nsresult PresShell::Init(nsIDocument* aDocument, - nsIPresContext* aPresContext, - nsIViewManager* aViewManager, - nsIStyleSet* aStyleSet) -{ - NS_PRECONDITION(nsnull != aDocument, "null ptr"); - NS_PRECONDITION(nsnull != aPresContext, "null ptr"); - NS_PRECONDITION(nsnull != aViewManager, "null ptr"); - if ((nsnull == aDocument) || (nsnull == aPresContext) || - (nsnull == aViewManager)) { - return NS_ERROR_NULL_POINTER; - } - if (nsnull != mDocument) { - return NS_ERROR_ALREADY_INITIALIZED; - } - - mCache = new FrameHashTable(); - - mDocument = aDocument; - NS_ADDREF(aDocument); - mViewManager = aViewManager; - NS_ADDREF(mViewManager); - - // Bind the context to the presentation shell. - mPresContext = aPresContext; - NS_ADDREF(aPresContext); - aPresContext->SetShell(this); - - mStyleSet = aStyleSet; - NS_ADDREF(aStyleSet); - - return NS_OK; -} - -nsIDocument* PresShell::GetDocument() -{ - NS_IF_ADDREF(mDocument); - return mDocument; -} - -nsIPresContext* PresShell::GetPresContext() -{ - NS_IF_ADDREF(mPresContext); - return mPresContext; -} - -nsIViewManager* PresShell::GetViewManager() -{ - NS_IF_ADDREF(mViewManager); - return mViewManager; -} - -nsIStyleSet* PresShell::GetStyleSet() -{ - NS_IF_ADDREF(mStyleSet); - return mStyleSet; -} - -// Make shell be a document observer -void PresShell::BeginObservingDocument() -{ - if (nsnull != mDocument) { - mDocument->AddObserver(this); - } -} - -// Make shell stop being a document observer -void PresShell::EndObservingDocument() -{ - if (nsnull != mDocument) { - mDocument->RemoveObserver(this); - } -} - -void PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight) -{ - if (nsnull != mPresContext) { - nsRect r(0, 0, aWidth, aHeight); - mPresContext->SetVisibleArea(r); - } - - if (nsnull == mRootFrame) { - if (nsnull != mDocument) { - nsIContent* root = mDocument->GetRootContent(); - if (nsnull != root) { - nsIContentDelegate* cd = root->GetDelegate(mPresContext); - if (nsnull != cd) { - mRootFrame = cd->CreateFrame(mPresContext, root, -1, nsnull); - NS_RELEASE(cd); - - // set root frame's style context - nsIStyleContext* rootContext = mPresContext->ResolveStyleContextFor(root, nsnull); - mRootFrame->SetStyleContext(rootContext); - NS_RELEASE(rootContext); - - // Bind root frame to root view (and root window) - nsIView* rootView = mViewManager->GetRootView(); - mRootFrame->SetView(rootView); - NS_RELEASE(rootView); - } - NS_RELEASE(root); - } - } - } - - if (nsnull != mRootFrame) { - nsRect bounds = mPresContext->GetVisibleArea(); - nsReflowMetrics desiredSize; - nsSize maxSize(bounds.width, bounds.height); - - // Kick off a top-down reflow -#ifdef NS_DEBUG - mRootFrame->VerifyTree(); -#endif - nsIFrame::ReflowStatus status; - - mRootFrame->ResizeReflow(mPresContext, desiredSize, maxSize, nsnull, status); - mRootFrame->SizeTo(desiredSize.width, desiredSize.height); -#ifdef NS_DEBUG - mRootFrame->VerifyTree(); -#endif -#ifdef NOISY - mRootFrame->List(); -#endif - - //force a redraw of the entire view - -#if 0 - nsIView *view = mRootFrame->GetView(); - - if (nsnull != view) { - nsRect rect = mRootFrame->GetRect(); - nsIViewManager* vm = view->GetViewManager(); - vm->UpdateView(view, &rect, NS_VMREFRESH_DOUBLE_BUFFER); - NS_RELEASE(vm); - NS_RELEASE(view); - } -#endif - // XXX if debugging then we should assert that the cache is empty - } else { -#ifdef NOISY - printf("PresShell::ResizeReflow: null root frame\n"); -#endif - } -} - -nsIFrame* PresShell::GetRootFrame() -{ - return mRootFrame; -} - -NS_IMETHODIMP PresShell::SetTitle(const nsString& aTitle) -{ - if (nsnull != mPresContext) { - nsISupports* container; - if (NS_OK == mPresContext->GetContainer(&container)) { - if (nsnull != container) { - nsIDocumentObserver* docob; - if (NS_OK == container->QueryInterface(kIDocumentObserverIID, - (void**) &docob)) { - docob->SetTitle(aTitle); - NS_RELEASE(docob); - } - NS_RELEASE(container); - } - } - } - return NS_OK; -} - -void PresShell::BeginUpdate() -{ - mUpdateCount++; -} - -void PresShell::EndUpdate() -{ - NS_PRECONDITION(0 != mUpdateCount, "too many EndUpdate's"); - if (--mUpdateCount == 0) { - // XXX do something here - } -} - -void PresShell::AppendReflowCommand(nsReflowCommand* aReflowCommand) -{ - mReflowCommands.AppendElement(aReflowCommand); -} - -void PresShell::ProcessReflowCommands() -{ - if (0 != mReflowCommands.Count()) { - nsReflowMetrics desiredSize; - - while (0 != mReflowCommands.Count()) { - nsReflowCommand* rc = (nsReflowCommand*) mReflowCommands.ElementAt(0); - mReflowCommands.RemoveElementAt(0); - - // Dispatch the reflow command - nsSize maxSize; - - mRootFrame->GetSize(maxSize); - rc->Dispatch(desiredSize, maxSize); - delete rc; - } - - // Place and size the root frame - mRootFrame->SizeTo(desiredSize.width, desiredSize.height); -#ifdef NS_DEBUG - mRootFrame->VerifyTree(); -#endif - } -} - -void PresShell::ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType) -{ -} - -void PresShell::ContentAppended(nsIContent* aContainer) -{ - NS_PRECONDITION(nsnull != mRootFrame, "null root frame"); - nsReflowCommand* rc = new nsReflowCommand(mPresContext, - FindFrameWithContent(aContainer), - nsReflowCommand::ContentAppended, - aContainer); - AppendReflowCommand(rc); - ProcessReflowCommands(); -} - -void PresShell::ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) -{ - NS_PRECONDITION(nsnull != mRootFrame, "null root frame"); - nsReflowCommand* rc = new nsReflowCommand(mPresContext, - FindFrameWithContent(aContainer), - nsReflowCommand::ContentInserted, - aContainer, aChild, - aIndexInContainer); - AppendReflowCommand(rc); - ProcessReflowCommands(); -} - -void PresShell::ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer) -{ - NS_PRECONDITION(nsnull != mRootFrame, "null root frame"); - nsReflowCommand* rc = new nsReflowCommand(mPresContext, - FindFrameWithContent(aContainer), - nsReflowCommand::ContentReplaced, - aContainer, aOldChild, aNewChild, - aIndexInContainer); - AppendReflowCommand(rc); - ProcessReflowCommands(); -} - -// XXX keep this? -void PresShell::ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) -{ -} - -void PresShell::ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) -{ - NS_PRECONDITION(nsnull != mRootFrame, "null root frame"); - nsReflowCommand* rc = new nsReflowCommand(mPresContext, - FindFrameWithContent(aContainer), - nsReflowCommand::ContentDeleted, - aContainer, aChild, - aIndexInContainer); - AppendReflowCommand(rc); - ProcessReflowCommands(); -} - -void PresShell::StyleSheetAdded(nsIStyleSheet* aStyleSheet) -{ -} - -static nsIFrame* FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent) -{ - nsIContent* frameContent; - - aFrame->GetContent(frameContent); - if (frameContent == aContent) { - NS_RELEASE(frameContent); - return aFrame; - } - NS_RELEASE(frameContent); - - aFrame->FirstChild(aFrame); - while (aFrame) { - nsIFrame* result = FindFrameWithContent(aFrame, aContent); - - if (result) { - return result; - } - - aFrame->GetNextSibling(aFrame); - } - - return nsnull; -} - -nsIFrame* PresShell::FindFrameWithContent(nsIContent* aContent) -{ - // For the time being do a brute force depth-first search of - // the frame tree - return ::FindFrameWithContent(mRootFrame, aContent); -} - -void PresShell::PutCachedData(nsIFrame* aKeyFrame, void* aData) -{ - void* oldData = mCache->Put(aKeyFrame, aData); - NS_ASSERTION(nsnull == oldData, "bad cached data usage"); -} - -void* PresShell::GetCachedData(nsIFrame* aKeyFrame) -{ - return mCache->Get(aKeyFrame); -} - -void* PresShell::RemoveCachedData(nsIFrame* aKeyFrame) -{ - return mCache->Remove(aKeyFrame); -} - -//---------------------------------------------------------------------- - -NS_LAYOUT nsresult -NS_NewPresShell(nsIPresShell** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - PresShell* it = new PresShell(); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIPresShellIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/base/src/nsPrintPreviewContext.cpp b/mozilla/layout/base/src/nsPrintPreviewContext.cpp deleted file mode 100644 index f0de71f8815..00000000000 --- a/mozilla/layout/base/src/nsPrintPreviewContext.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPresContext.h" -#include "nsIDeviceContext.h" -#include "nsUnitConversion.h" -#include "nsIView.h" -#include "nsIWidget.h" -#include "nsGfxCIID.h" - -static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); - -class PrintPreviewContext : public nsPresContext { -public: - PrintPreviewContext(); - ~PrintPreviewContext(); - - virtual PRBool IsPaginated(); - virtual nscoord GetPageWidth(); - virtual nscoord GetPageHeight(); -}; - -PrintPreviewContext::PrintPreviewContext() -{ - nsresult res; - - static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID); - - res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mDeviceContext); - - if (NS_OK == res) - { - mDeviceContext->Init(); - - mDeviceContext->SetDevUnitsToAppUnits(mDeviceContext->GetDevUnitsToTwips()); - mDeviceContext->SetAppUnitsToDevUnits(mDeviceContext->GetTwipsToDevUnits()); - - NS_ADDREF(mDeviceContext); - } -} - -PrintPreviewContext::~PrintPreviewContext() -{ - NS_IF_RELEASE(mDeviceContext); -} - -PRBool PrintPreviewContext::IsPaginated() -{ - return PR_TRUE; -} - -// XXX assumes a 1/2 margin around all sides -nscoord PrintPreviewContext::GetPageWidth() -{ -#if 0 - return (nscoord) NS_INCHES_TO_TWIPS(7.5); -#else - // For testing purposes make the page width 95% of the visible area - return mVisibleArea.width * 95 / 100; -#endif -} - -nscoord PrintPreviewContext::GetPageHeight() -{ -#if 0 - return (nscoord) NS_INCHES_TO_TWIPS(10); -#else - // For testing purposes make the page height 60% of the visible area - return mVisibleArea.height * 60 / 100; -#endif -} - -NS_LAYOUT nsresult -NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - PrintPreviewContext *it = new PrintPreviewContext(); - - if (it == nsnull) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIPresContextIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/base/src/nsReflowCommand.cpp b/mozilla/layout/base/src/nsReflowCommand.cpp deleted file mode 100644 index 34a72cb37c4..00000000000 --- a/mozilla/layout/base/src/nsReflowCommand.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsReflowCommand.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsIContent.h" -#include "nsIRunaround.h" - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); - -// Construct a reflow command given a presentation context, target frame, -// and a reflow command type -nsReflowCommand::nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - PRInt32 aIndex) - : mType(aReflowType), mTargetFrame(aTargetFrame), mPresContext(aPresContext), - mIndex(aIndex), - mContainer(nsnull), - mChild(nsnull), - mOldChild(nsnull) -{ - NS_PRECONDITION(mTargetFrame != nsnull, "null target frame"); - aPresContext->AddRef(); -} - -nsReflowCommand::nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - nsIContent* aContainer) - : mType(aReflowType), mTargetFrame(aTargetFrame), mPresContext(aPresContext), - mIndex(-1), - mContainer(aContainer), - mChild(nsnull), - mOldChild(nsnull) -{ - NS_PRECONDITION(mTargetFrame != nsnull, "null target frame"); - NS_PRECONDITION(mContainer != nsnull, "null container"); - NS_ADDREF(aPresContext); - NS_ADDREF(aContainer); -} - -nsReflowCommand::nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) - : mType(aReflowType), mTargetFrame(aTargetFrame), mPresContext(aPresContext), - mIndex(aIndexInParent), - mContainer(aContainer), - mChild(aChild), - mOldChild(nsnull) -{ - NS_PRECONDITION(mTargetFrame != nsnull, "null target frame"); - NS_PRECONDITION(mContainer != nsnull, "null container"); - NS_PRECONDITION(mChild != nsnull, "null child"); - NS_ADDREF(aPresContext); - NS_ADDREF(aContainer); - NS_ADDREF(aChild); -} - -nsReflowCommand::nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInParent) - : mType(aReflowType), mTargetFrame(aTargetFrame), mPresContext(aPresContext), - mIndex(aIndexInParent), - mContainer(aContainer), - mChild(aNewChild), - mOldChild(aOldChild) -{ - NS_PRECONDITION(mTargetFrame != nsnull, "null target frame"); - NS_PRECONDITION(mContainer != nsnull, "null container"); - NS_PRECONDITION(mChild != nsnull, "null new child"); - NS_PRECONDITION(mOldChild != nsnull, "null old child"); - NS_ADDREF(aPresContext); - NS_ADDREF(aContainer); - NS_ADDREF(aNewChild); - NS_ADDREF(aOldChild); -} - -nsReflowCommand::~nsReflowCommand() -{ - NS_IF_RELEASE(mPresContext); - NS_IF_RELEASE(mContainer); - NS_IF_RELEASE(mChild); - NS_IF_RELEASE(mOldChild); -} - -void nsReflowCommand::Dispatch(nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) -{ - // Special handling for content tree change commands - nsIPresShell* shell; - switch (mType) { - case nsReflowCommand::ContentAppended: - shell = mPresContext->GetShell(); - mTargetFrame->ContentAppended(shell, mPresContext, mContainer); - NS_RELEASE(shell); - return; - - case nsReflowCommand::ContentInserted: - shell = mPresContext->GetShell(); - mTargetFrame->ContentInserted(shell, mPresContext, mContainer, - mChild, mIndex); - NS_RELEASE(shell); - return; - - case nsReflowCommand::ContentReplaced: - shell = mPresContext->GetShell(); - mTargetFrame->ContentReplaced(shell, mPresContext, mContainer, - mOldChild, mChild, mIndex); - NS_RELEASE(shell); - return; - - case nsReflowCommand::ContentDeleted: - shell = mPresContext->GetShell(); - mTargetFrame->ContentDeleted(shell, mPresContext, mContainer, - mChild, mIndex); - NS_RELEASE(shell); - return; - } - - // Build the path from the target frame (index 0) to the root frame - mPath.Clear(); - for (nsIFrame* f = (nsIFrame*)mTargetFrame; nsnull != f; - f->GetGeometricParent(f)) { - mPath.AppendElement((void*)f); - } - - // Send an incremental reflow notification to the root frame - nsIFrame* root = (nsIFrame*)mPath[mPath.Count() - 1]; - -#ifdef NS_DEBUG - shell = mPresContext->GetShell(); - if (nsnull != shell) { - NS_ASSERTION(shell->GetRootFrame() == root, "bad root frame"); - NS_RELEASE(shell); - } -#endif - - if (nsnull != root) { - mPath.RemoveElementAt(mPath.Count() - 1); - - nsIFrame::ReflowStatus status; - - root->IncrementalReflow(mPresContext, aDesiredSize, aMaxSize, *this, status); - } -} - -// Pass the reflow command to the next frame in the hierarchy -nsIFrame::ReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame) -{ - PRInt32 count = mPath.Count(); - nsIFrame::ReflowStatus result = nsIFrame::frComplete; - - NS_ASSERTION(count > 0, "empty path vector"); - if (count > 0) { - aNextFrame = (nsIFrame*)mPath[count - 1]; - - NS_ASSERTION(nsnull != aNextFrame, "null frame"); - mPath.RemoveElementAt(count - 1); - aNextFrame->IncrementalReflow(mPresContext, aDesiredSize, aMaxSize, - *this, result); - } else { - aNextFrame = nsnull; - } - - return result; -} - -// Pass the reflow command to the next frame in the hierarchy. Check -// whether it wants to use nsIRunaround or nsIFrame -nsIFrame::ReflowStatus nsReflowCommand::Next(nsISpaceManager* aSpaceManager, - nsRect& aDesiredRect, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame) -{ - PRInt32 count = mPath.Count(); - nsIFrame::ReflowStatus result = nsIFrame::frComplete; - - NS_ASSERTION(count > 0, "empty path vector"); - if (count > 0) { - aNextFrame = (nsIFrame*)mPath[count - 1]; - - NS_ASSERTION(nsnull != aNextFrame, "null frame"); - mPath.RemoveElementAt(count - 1); - - // Does the frame support nsIRunaround? - nsIRunaround* reflowRunaround; - - if (NS_OK == aNextFrame->QueryInterface(kIRunaroundIID, (void**)&reflowRunaround)) { - reflowRunaround->IncrementalReflow(mPresContext, aSpaceManager, aMaxSize, - aDesiredRect, *this, result); - } else { - nsReflowMetrics desiredSize; - - aNextFrame->IncrementalReflow(mPresContext, desiredSize, aMaxSize, - *this, result); - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = desiredSize.width; - aDesiredRect.height = desiredSize.height; - } - } else { - aNextFrame = nsnull; - } - - return result; -} - -nsIFrame* nsReflowCommand::GetNext() const -{ - PRInt32 count = mPath.Count(); - nsIFrame* rv = nsnull; - if (count > 0) { - rv = (nsIFrame*) mPath[count - 1]; - } - return rv; -} diff --git a/mozilla/layout/base/src/nsReflowCommand.h b/mozilla/layout/base/src/nsReflowCommand.h deleted file mode 100644 index 84deb9c47b4..00000000000 --- a/mozilla/layout/base/src/nsReflowCommand.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsReflowCommand_h___ -#define nsReflowCommand_h___ - -#include "nsIFrame.h" -#include "nsVoidArray.h" - -class nsIPresContext; -class nsISpaceManager; - -// A reflow command. -class nsReflowCommand { -public: - enum ReflowType { - // These reflow types are used for pre-processing a content - // append, insert or delete. The target frame is responsible for - // creating frames for the new children (or removing frames for - // delete) and then updating it's children's index-in-parent - // values. After that, the frame is responsible for creating new - // reflow commands to deal with the appended, inserted or deleted - // frames. - ContentAppended, - ContentInserted, - ContentReplaced, - ContentDeleted, - - // These are the reflow commands generated after the previous - // commands have completed. - FrameAppended, - FrameInserted, - FrameDeleted, - - // This reflow command is used when a leaf node's content changes - // (e.g. some text in a text run, an image's source, etc.) - ContentChanged, - - // When an incremental reflow operation affects a next-in-flow, - // these commands are used to get the next-in-flow to update - // itself. - PullupReflow, - PushReflow, - - // This command is used to see if a prev-in-flow wants to pullup - // some children from a next-in-flow that has changed because of - // an incremental reflow. - CheckPullupReflow, - - // Trap door for extensions - UserDefined - }; - - // XXX factory methods? - - nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType); - - nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - PRInt32 aIndexValue); - - nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - nsIContent* aContainer); - - nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); - - nsReflowCommand(nsIPresContext* aPresContext, - nsIFrame* aTargetFrame, - ReflowType aReflowType, - nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInParent); - - virtual ~nsReflowCommand(); - - /** - * Dispatch the reflow command. The command is processed and dispatched - * to the appropriate frame's appropriate method. - */ - void Dispatch(nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize); - - // Pass the reflow command to the next frame in the hierarchy. Returns the - // status and the next frame to which the command was dispatched - nsIFrame::ReflowStatus Next(nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame); - - // Pass the reflow command to the next frame in the hierarchy. Returns the - // status and the next frame to which the command was dispatched - // - // Use this version if you have a space manager. This function will check if - // the caller supports nsIRunaround and call either the nsIFrame or the - // nsIRunaround IncrementalReflow() function - nsIFrame::ReflowStatus Next(nsISpaceManager* aSpaceManager, - nsRect& aDesiredRect, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame); - - nsIFrame* GetNext() const; - - // Get the target of the reflow command - nsIFrame* GetTarget() const { return mTargetFrame; } - - // Get the type of reflow command - ReflowType GetType() const { return mType; } - - // Get the index value - PRInt32 GetIndex() const { return mIndex; } - -private: - nsIPresContext* mPresContext; - ReflowType mType; - nsIContent* mContainer; - nsIContent* mChild; - nsIContent* mOldChild; - PRInt32 mIndex; - nsIFrame* mTargetFrame; - nsVoidArray mPath; -}; - -#endif /* nsReflowCommand_h___ */ diff --git a/mozilla/layout/base/src/nsSelection.cpp b/mozilla/layout/base/src/nsSelection.cpp deleted file mode 100644 index 62551490edb..00000000000 --- a/mozilla/layout/base/src/nsSelection.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSelection.h" -#include "nsISelection.h" - -nsresult nsSelection::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - static NS_DEFINE_IID(kISelectionIID, NS_ISELECTION_IID); - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kISelectionIID)) { - *aInstancePtrResult = (void*) ((nsISelection*)this); - //AddRef(); - return NS_OK; - } - return !NS_OK; -} - -nsSelection::nsSelection() { - mRange = new nsSelectionRange(); -} - -NS_IMPL_ADDREF(nsSelection) -NS_IMPL_RELEASE(nsSelection) - -/** - * Returns whether there is a valid selection - */ -PRBool nsSelection::IsValidSelection() { - return (PRBool)(mRange->GetStartContent() == nsnull || - mRange->GetEndContent() == nsnull); - -} - - -/** - * Clears the current selection (invalidates the selection) - */ -void nsSelection::ClearSelection() { - mRange->GetStartPoint()->SetPoint(nsnull, -1, PR_TRUE); - mRange->GetEndPoint()->SetPoint(nsnull, -1, PR_TRUE); -} - - - -/** - * Copies the data from one nsSelectionPoint in the range to another, - * it does NOT just assign the pointers - */ -void nsSelection::SetRange(nsSelectionRange * aSelectionRange) { - mRange->SetRange(aSelectionRange->GetStartPoint(), - aSelectionRange->GetEndPoint()); -} - -/** - * Copies the data from one nsSelectionPoint in the range to another, - * it does NOT just assign the pointers - */ -void nsSelection::GetRange(nsSelectionRange * aSelectionRange) { - mRange->SetRange(aSelectionRange->GetStartPoint(), - aSelectionRange->GetEndPoint()); -} - - -/** - * For debug only, it potentially leaks memory - */ -char * nsSelection::ToString() { - return mRange->ToString();; -} \ No newline at end of file diff --git a/mozilla/layout/base/src/nsSelection.h b/mozilla/layout/base/src/nsSelection.h deleted file mode 100644 index b7a91fbc32f..00000000000 --- a/mozilla/layout/base/src/nsSelection.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsSelection_h___ -#define nsSelection_h___ - -#include "nsSelectionRange.h" -//#include "nsISupports.h" -#include "nsISelection.h" - -class nsSelection : public nsISelection { - - nsSelectionRange * mRange; - - public: - NS_DECL_ISUPPORTS - - nsSelection(); - - /** supports implementation */ - //NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtrResult); - - /** - * Returns whether there is a valid selection - */ - PRBool IsValidSelection(); - - /** - * Clears the current selection (invalidates the selection) - */ - void ClearSelection(); - - /** - * Copies the data from the param into the internal Range - */ - void SetRange(nsSelectionRange * aRange); - - /** - * Copies the param's (aRange) contents with the Range's data - */ - void GetRange(nsSelectionRange * aRange); - - /** - * Copies the param's (aRange) contents with the Range's data - */ - nsSelectionRange * GetRange() { return mRange; } - - char * ToString(); -}; - -#endif /* nsSelection_h___ */ diff --git a/mozilla/layout/base/src/nsSelectionPoint.cpp b/mozilla/layout/base/src/nsSelectionPoint.cpp deleted file mode 100644 index 4cb7e7a44ff..00000000000 --- a/mozilla/layout/base/src/nsSelectionPoint.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSelectionPoint.h" - -nsSelectionPoint::nsSelectionPoint(nsIContent * aContent, - PRInt32 aOffset, - PRBool aIsAnchor) { - fContent = aContent; - fOffset = aOffset; - fIsAnchor = aIsAnchor; -}; - - -void nsSelectionPoint::SetPoint(nsIContent * aContent, - PRInt32 aOffset, - PRBool aIsAnchor) { - fContent = aContent; - fOffset = aOffset; - fIsAnchor = aIsAnchor; -}; - - -/** - * For debug only, it potentially leaks memory - */ -char * nsSelectionPoint::ToString() { - char * str = new char[256]; - sprintf(str, "TextPoint[0x%X, offset=%d, isAnchor=%s]", fContent, fOffset, (fIsAnchor?"PR_TRUE":"PR_FALSE")); - return str; -} diff --git a/mozilla/layout/base/src/nsSelectionPoint.h b/mozilla/layout/base/src/nsSelectionPoint.h deleted file mode 100644 index 4d551f0dfd2..00000000000 --- a/mozilla/layout/base/src/nsSelectionPoint.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsSelectionPoint_h___ -#define nsSelectionPoint_h___ - -#include "nsIContent.h" - -class nsSelectionPoint { - - nsIContent * fContent; - PRInt32 fOffset; - PRBool fIsAnchor; - PRBool fEntireContent; - - public: - - nsSelectionPoint(nsIContent * aContent, - PRInt32 aOffset, - PRBool aIsAnchor); - - nsIContent * GetContent() { return fContent; } - PRInt32 GetOffset() { return fOffset; } - PRBool IsAnchor() { return fIsAnchor;} - - PRBool IsEntireContentSelected() { return fEntireContent; } - void setEntireContentSelected(PRBool aState) { fEntireContent = aState; } - - void SetContent(nsIContent * aValue) { fContent = aValue; } - void SetOffset(PRInt32 aValue) { fOffset = aValue; } - void SetAnchor(PRBool aValue) { fIsAnchor = aValue; } - - void SetPoint(nsIContent * aContent, - PRInt32 aOffset, - PRBool aIsAnchor); - char * ToString(); - -}; -#endif /* nsSelectionPoint_h___ */ diff --git a/mozilla/layout/base/src/nsSelectionRange.cpp b/mozilla/layout/base/src/nsSelectionRange.cpp deleted file mode 100644 index 4e05ab03a39..00000000000 --- a/mozilla/layout/base/src/nsSelectionRange.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSelectionRange.h" - -nsSelectionRange::nsSelectionRange() { - mStart = new nsSelectionPoint(nsnull, -1, PR_TRUE); - mEnd = new nsSelectionPoint(nsnull, -1, PR_TRUE); -} - -nsSelectionRange::nsSelectionRange(nsIContent * aStartContent, - PRInt32 aStartOffset, - PRBool aStartIsAnchor, - nsIContent * aEndContent, - PRInt32 aEndOffset, - PRBool aEndIsAnchor) { - mStart = new nsSelectionPoint(aStartContent, aStartOffset, aStartIsAnchor); - mEnd = new nsSelectionPoint(aEndContent, aEndOffset, aEndIsAnchor); -} - -void nsSelectionRange::SetRange(nsIContent * aStartContent, - PRInt32 aStartOffset, - PRBool aStartIsAnchor, - nsIContent * aEndContent, - PRInt32 aEndOffset, - PRBool aEndIsAnchor) { - mStart->SetPoint(aStartContent, aStartOffset, aStartIsAnchor); - mEnd->SetPoint(aEndContent, aEndOffset, aEndIsAnchor); -} - -void nsSelectionRange::SetRange(nsSelectionPoint * aStartPoint, - nsSelectionPoint * aEndPoint) { - SetStartPoint(aStartPoint); - SetEndPoint(aEndPoint); -} - -void nsSelectionRange::SetRange(nsSelectionRange * aRange) { - SetStartPoint(aRange->GetStartPoint()); - SetEndPoint(aRange->GetEndPoint()); -} - -void nsSelectionRange::SetStartPoint(nsSelectionPoint * aPoint) { - mStart->SetPoint(aPoint->GetContent(), aPoint->GetOffset(), aPoint->IsAnchor()); -} - -void nsSelectionRange::SetEndPoint(nsSelectionPoint * aPoint) { - mEnd->SetPoint(aPoint->GetContent(), aPoint->GetOffset(), aPoint->IsAnchor()); -} - -void nsSelectionRange::GetStartPoint(nsSelectionPoint * aPoint) { - aPoint->SetPoint(mStart->GetContent(), mStart->GetOffset(), mStart->IsAnchor()); -} - -void nsSelectionRange::GetEndPoint(nsSelectionPoint * aPoint) { - aPoint->SetPoint(mEnd->GetContent(), mEnd->GetOffset(), mEnd->IsAnchor()); -} - -void nsSelectionRange::GetRange(nsSelectionRange * aRange) { - aRange->SetStartPoint(mStart); - aRange->SetEndPoint(mEnd); -} - -/** - * For debug only, it potentially leaks memory - */ -char * nsSelectionRange::ToString() { - static char str[1024]; - char * startStr = mStart->ToString(); - char * endStr = mEnd->ToString(); - sprintf(str, "nsSelectionRange[\nStart=%s,\nEnd =%s\n]", startStr, endStr); - delete startStr; - delete endStr; - return str; -} \ No newline at end of file diff --git a/mozilla/layout/base/src/nsSelectionRange.h b/mozilla/layout/base/src/nsSelectionRange.h deleted file mode 100644 index decccd7cfbc..00000000000 --- a/mozilla/layout/base/src/nsSelectionRange.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsSelectionRange_h___ -#define nsSelectionRange_h___ - -#include "nsSelectionPoint.h" - -class nsSelectionRange { - - nsSelectionPoint * mStart; - nsSelectionPoint * mEnd; - - public: - nsSelectionRange(); - - nsSelectionRange(nsIContent * aStartContent, - PRInt32 aStartOffset, - PRBool aStartIsAnchor, - nsIContent * aEndContent, - PRInt32 aEndOffset, - PRBool aEndIsAnchor); - - void SetRange(nsIContent * aStartContent, - PRInt32 aStartOffset, - PRBool aStartIsAnchor, - nsIContent * aEndContent, - PRInt32 aEndOffset, - PRBool aEndIsAnchor); - - void SetRange(nsSelectionPoint * aStartPoint, - nsSelectionPoint * aEndPoint); - - /** - * Copies the data from the param into the internal Range - */ - void SetRange(nsSelectionRange * aRange); - - nsIContent * GetStartContent() { return mStart->GetContent();} - nsIContent * GetEndContent() { return mEnd->GetContent(); } - nsSelectionPoint * GetStartPoint() { return mStart; } - nsSelectionPoint * GetEndPoint() { return mEnd; } - - /** - * Copies the data from the param into the Start Point - */ - void SetStartPoint(nsSelectionPoint * aPoint); - - /** - * Copies the data from the param into the End Point - */ - void SetEndPoint(nsSelectionPoint * aPoint); - - - /** - * Copies the param's (aPoint) contents with the Range's Point data - */ - void GetStartPoint(nsSelectionPoint * aPoint); - - /** - * Copies the param's (aPoint) contents with the Range's Point data - */ - void GetEndPoint(nsSelectionPoint * aPoint); - - /** - * Copies the param's (aRange) contents with the Range's data - */ - void GetRange(nsSelectionRange * aRange); - - char * ToString(); -}; - -#endif /* nsSelectionRange_h___ */ diff --git a/mozilla/layout/base/src/nsSpaceManager.cpp b/mozilla/layout/base/src/nsSpaceManager.cpp deleted file mode 100644 index 780bedf1d40..00000000000 --- a/mozilla/layout/base/src/nsSpaceManager.cpp +++ /dev/null @@ -1,670 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSpaceManager.h" -#include "nsPoint.h" -#include "nsRect.h" -#include "nsSize.h" -#include - -static NS_DEFINE_IID(kISpaceManagerIID, NS_ISPACEMANAGER_IID); - -///////////////////////////////////////////////////////////////////////////// -// nsSpaceManager - -SpaceManager::SpaceManager(nsIFrame* aFrame) - : mFrame(aFrame) -{ - NS_INIT_REFCNT(); - mX = mY = 0; -} - -NS_IMPL_ISUPPORTS(SpaceManager, kISpaceManagerIID); - -nsIFrame* SpaceManager::GetFrame() const -{ - return mFrame; -} - -void SpaceManager::Translate(nscoord aDx, nscoord aDy) -{ - mX += aDx; - mY += aDy; -} - -void SpaceManager::GetTranslation(nscoord& aX, nscoord& aY) const -{ - aX = mX; - aY = mY; -} - -nscoord SpaceManager::YMost() const -{ - if (mRectArray.mCount > 0) { - return mRectArray.YMost(); - } else { - return 0; - } -} - -/** - * Internal function that returns the list of available and unavailable space - * within the band - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - * @param aY the y-offset in world coordinates - * @param aMaxSize the size to use to constrain the band data - * @param aAvailableBand - */ -PRInt32 SpaceManager::GetBandAvailableSpace(const nsBandRect* aBand, - PRInt32 aIndex, - nscoord aY, - const nsSize& aMaxSize, - nsBandData& aBandData) const -{ - PRInt32 numRects = LengthOfBand(aBand, aIndex); - nscoord localY = aY - mY; - nscoord height = PR_MIN(aBand->YMost() - aY, aMaxSize.height); - nsBandTrapezoid* trapezoid = aBandData.trapezoids; - nscoord rightEdge = mX + aMaxSize.width; - - // Initialize the band data - aBandData.count = 0; - - // Skip any rectangles that are to the left of the local coordinate space - while (numRects > 0) { - if (aBand->XMost() > mX) { - break; - } - - // Get the next rect in the band - aBand++; - numRects--; - } - - // This is used to track the current x-location within the band. This is in - // world coordinates - nscoord left = mX; - - // Process the remaining rectangles that are within the clip width - while ((numRects > 0) && (aBand->x < rightEdge)) { - // Compare the left edge of the occupied space with the current left - // coordinate - if (aBand->x > left) { - // The rect is to the right of our current left coordinate, so we've - // found some available space - trapezoid->state = nsBandTrapezoid::smAvailable; - trapezoid->frame = nsnull; - - // Assign the trapezoid a rectangular shape. The trapezoid must be in the - // local coordinate space, so convert the current left coordinate - *trapezoid = nsRect(left - mX, localY, aBand->x - left, height); - - // Move to the next output rect - trapezoid++; - aBandData.count++; - } - - // The rect represents unavailable space, so add another trapezoid - trapezoid->state = nsBandTrapezoid::smOccupied; - trapezoid->frame = aBand->frame; - - nscoord x = aBand->x; - // The first band can straddle the clip rect - if (x < mX) { - // Clip the left edge - x = mX; - } - - // Assign the trapezoid a rectangular shape. The trapezoid must be in the - // local coordinate space, so convert the rects's left coordinate - *trapezoid = nsRect(x - mX, localY, aBand->XMost() - x, height); - - // Move to the next output rect - trapezoid++; - aBandData.count++; - - // Adjust our current x-location within the band - left = aBand->XMost(); - - // Move to the next rect within the band - numRects--; - aBand++; - } - - // No more rects left in the band. If we haven't yet reached the right edge, - // then all the remaining space is available - if (left < rightEdge) { - trapezoid->state = nsBandTrapezoid::smAvailable; - trapezoid->frame = nsnull; - - // Assign the trapezoid a rectangular shape. The trapezoid must be in the - // local coordinate space, so convert the current left coordinate - *trapezoid = nsRect(left - mX, localY, rightEdge - left, height); - aBandData.count++; - } - - return aBandData.count; -} - -PRInt32 SpaceManager::GetBandData(nscoord aYOffset, - const nsSize& aMaxSize, - nsBandData& aBandData) const -{ - // Convert the y-offset to world coordinates - nscoord y = mY + aYOffset; - - // If there are no unavailable rects or the offset is below the bottommost - // band then all the space is available - if ((0 == mRectArray.mCount) || (y >= mRectArray.YMost())) { - // All the requested space is available - aBandData.count = 1; - aBandData.trapezoids[0] = nsRect(0, aYOffset, aMaxSize.width, aMaxSize.height); - aBandData.trapezoids[0].state = nsBandTrapezoid::smAvailable; - aBandData.trapezoids[0].frame = nsnull; - } else { - // Find the first band that contains the y-offset or is below the y-offset - nsBandRect* band = mRectArray.mRects; - - for (PRInt32 i = 0; i < mRectArray.mCount; ) { - if (band->y > y) { - // The band is below the y-offset. The area between the y-offset and - // the top of the band is available - aBandData.count = 1; - aBandData.trapezoids[0] = - nsRect(0, aYOffset, aMaxSize.width, PR_MIN(band->y - y, aMaxSize.height)); - aBandData.trapezoids[0].state = nsBandTrapezoid::smAvailable; - aBandData.trapezoids[0].frame = nsnull; - break; - } else if (y < band->YMost()) { - // The band contains the y-offset. Return a list of available and - // unavailable rects within the band - return GetBandAvailableSpace(band, i, y, aMaxSize, aBandData); - } else { - // Skip to the next band - GetNextBand(band, i); - } - } - } - - return aBandData.count; -} - -/** - * Skips to the start of the next band. - * - * @param aRect in out paremeter. A rect in the band - * @param aIndex in out parameter. aRect's index in the rect array - * @returns PR_TRUE if successful and PR_FALSE if this is the last band. - * If successful aRect and aIndex are updated to point to the - * next band. If there is no next band then aRect is undefined - * and aIndex is set to the number of rects in the rect array - */ -PRBool SpaceManager::GetNextBand(nsBandRect*& aRect, PRInt32& aIndex) const -{ - nscoord topOfBand = aRect->y; - - while (++aIndex < mRectArray.mCount) { - // Get the next rect and check whether it's part of the same band - aRect++; - - if (aRect->y != topOfBand) { - // We found the start of the next band - return PR_TRUE; - } - } - - // No bands left - return PR_FALSE; -} - -/** - * Returns the number of rectangles in the band - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - */ -PRInt32 SpaceManager::LengthOfBand(const nsBandRect* aBand, PRInt32 aIndex) const -{ - nscoord topOfBand = aBand->y; - PRInt32 result = 1; - - while (++aIndex < mRectArray.mCount) { - // Get the next rect and check whether it's part of the same band - aBand++; - - if (aBand->y != topOfBand) { - // We found the start of the next band - break; - } - - result++; - } - - return result; -} - -/** - * Tries to coalesce adjoining rectangles within a band. Returns PR_TRUE if any - * of the rects are coalesced and PR_FALSE otherwise - * - * @param aRect the first rect in the band - * @param aIndex aBand's index in the rect array - */ -PRBool SpaceManager::CoalesceBand(nsBandRect* aBand, PRInt32 aIndex) -{ - PRBool result = PR_FALSE; - - while ((aIndex + 1) < mRectArray.mCount) { - // Is there another rect in this band? - nsBandRect* nextRect = aBand + 1; - - if (nextRect->y == aBand->y) { - // The rects must not be overlapping - NS_ASSERTION(nextRect->x >= aBand->XMost(), "overlapping rects"); - - // Are the two rects adjoining and have the same tagged frame? - if ((aBand->XMost() == nextRect->x) && (aBand->frame == nextRect->frame)) { - // Yes. Extend the right edge of the current rect - aBand->width = nextRect->XMost() - aBand->x; - - // Remove the next rect - mRectArray.RemoveAt(aIndex + 1); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - - // Continue through the loop trying to coalesce this rect - result = PR_TRUE; - - } else { - // No. Move to the next rect within the band - aBand++; - aIndex++; - } - } else { - // The next rect is part of a different band, so we're all done - break; - } - } - - return result; -} - -/** - * Divides the current band into two vertically - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - * @param aB1Height the height of the new band to create - */ -void SpaceManager::DivideBand(nsBandRect* aBand, PRInt32 aIndex, nscoord aB1Height) -{ - NS_PRECONDITION(aB1Height < aBand->height, "bad height"); - - PRInt32 numRects = LengthOfBand(aBand, aIndex); - nscoord aB2Height = aBand->height - aB1Height; - - // Index where we'll insert the new band - PRInt32 insertAt = aIndex + numRects; - - while (numRects-- > 0) { - // Insert a new bottom band - nsRect r(aBand->x, aBand->y + aB1Height, aBand->width, aB2Height); - - mRectArray.InsertAt(r, insertAt, aBand->frame); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - - // Adjust the height of the top band - aBand->height = aB1Height; - - // Move to the next rect in the band - aBand++; - insertAt++; - } -} - -/** - * Adds a new rect to a band. - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - * @param aRect the rect to add to the band. It's in world coordinates - * @returns PR_TRUE if successful and PR_FALSE if this is the last band - */ -void SpaceManager::AddRectToBand(nsBandRect* aBand, - PRInt32 aIndex, - const nsRect& aRect, - nsIFrame* aFrame) -{ - NS_PRECONDITION((aBand->y == aRect.y) && (aBand->height == aRect.height), "bad band"); - - nscoord topOfBand = aBand->y; - nsRect rect(aRect); - - // Figure out where in the band horizontally to insert the rect. Try and - // coalesce it with an existing rect if possible. We can only do this if - // they're tagged with the same frame - do { - // Compare the left edge of the new rect with the left edge of the existing - // rect - if (rect.x < aBand->x) { - // The new rect's left edge is to the left of the existing rect's left edge. - // Could be any of these cases (N is new rect, E is existing rect): - // - // Case 1: left-of Case 2: overlaps Case 3: N.contains(E) - // --------------- ---------------- --------------------- - // +-----+ +-----+ +-----+ +---------+ - // | N | | E | | N | | N | - // +-----+ +-----+ +-----+ +---------+ - // +-----+ +---+ - // | E | | E | - // +-----+ +---+ - // - // Do the two rectangles overlap? - if (rect.XMost() <= aBand->x) { - // No, the new rect is completely to the left of the existing rect - // (case #1). Insert a new rect - mRectArray.InsertAt(rect, aIndex, aFrame); - return; - } - - // Yes, they overlap. Insert a new rect for the part that's to the left - // of the existing rect - nsRect r1(rect.x, rect.y, aBand->x - rect.x, rect.height); - - mRectArray.InsertAt(r1, aIndex, aFrame); - aIndex++; - aBand = mRectArray.mRects + aIndex; // memory may have changed... - - // Adjust rect to reflect the overlap - rect.width = rect.XMost() - aBand->x; - rect.x = aBand->x; - - } else if (rect.x > aBand->x) { - // The new rect's left edge is to the right of the existing rect's left - // edge. Could be any one of these cases: - // - // Case 4: right-of Case 5: overlaps Case 6: E.Contains(N) - // --------------- ---------------- --------------------- - // +-----+ +-----+ +-----+ +------------+ - // | E | | N | | E | | E | - // +-----+ +-----+ +-----+ +------------+ - // +-----+ +-----+ - // | N | | N | - // +-----+ +-----+ - // - if (rect.x >= aBand->XMost()) { - // The new rect is to the right of the existing rect (case #4), so move - // to the next rect in the band - aBand++; aIndex++; - continue; - } - - // The rects overlap, so divide the existing rect into two rects: the - // part to the left of the new rect, and the part that overlaps - nsRect r1(rect.x, aBand->y, aBand->XMost() - rect.x, aBand->height); - - // Modify the left half of the existing rect - aBand->width = rect.x - aBand->x; - - // Insert the new right half of the existing rect, and make it the current - // rect - aIndex++; - mRectArray.InsertAt(r1, aIndex, aBand->frame); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - } - - // At this point the left edge of the new rect is the same as the left edge - // of the existing rect - NS_ASSERTION(rect.x == aBand->x, "unexpected rect"); - - // Compare which rect is wider, the new rect or the existing rect - if (aBand->width > rect.width) { - // The existing rect is wider (cases 2 and 6). Divide the existing rect - // into two rects: the part that overlaps, and the part to the right of - // the new rect - nsRect r1(rect.XMost(), aBand->y, aBand->XMost() - rect.XMost(), aBand->height); - - // Modify the left half of the existing rect - aBand->width = r1.x - aBand->x; - - // Insert the new right half of the existing rect - mRectArray.InsertAt(r1, aIndex, aBand->frame); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - } - - // XXX Mark the existing rect as being shared by the two frames... - - if (rect.width == aBand->width) { - // We're all done - return; - } - - // The new rect is wider than the existing rect (cases 3 and 5). Set rect - // to be the overhang and move to the next rect within the band - rect.width = rect.XMost() - aBand->XMost(); - rect.x = aBand->XMost(); - aBand++; aIndex++; - } while ((aIndex < mRectArray.mCount) && (aBand->y == topOfBand)); - - // Insert a new rect - mRectArray.InsertAt(aRect, aIndex, aFrame); -} - -// When comparing a rect to a band there are seven cases to consider. -// 'R' is the rect and 'B' is the band. -// -// Case 1 Case 2 Case 3 Case 4 -// ------ ------ ------ ------ -// +-----+ +-----+ +-----+ +-----+ -// | R | | R | +-----+ +-----+ | | | | -// +-----+ +-----+ | | | R | | B | | B | -// +-----+ | B | +-----+ | | +-----+ | | -// | | | | +-----+ | R | +-----+ -// | B | +-----+ +-----+ -// | | -// +-----+ -// -// -// -// Case 5 Case 6 Case 7 -// ------ ------ ------ -// +-----+ +-----+ +-----+ +-----+ -// | | | R | | B | | | +-----+ -// | B | +-----+ +-----+ | R | | B | -// | | | | +-----+ -// +-----+ +-----+ -// +-----+ -// | R | -// +-----+ -// -void SpaceManager::AddRectRegion(const nsRect& aUnavailableSpace, nsIFrame* aFrame) -{ - // Convert from local to world coordinates - nsRect rect(aUnavailableSpace.x + mX, aUnavailableSpace.y + mY, - aUnavailableSpace.width, aUnavailableSpace.height); - - // If there are no existing bands or this rect is below the bottommost band, - // then add a new band - if ((0 == mRectArray.mCount) || (rect.y >= mRectArray.YMost())) { - // Append a new bottommost band - mRectArray.Append(rect, aFrame); - return; - } - - // Examine each band looking for a band that intersects this rect - nsBandRect* band = mRectArray.mRects; - - for (PRInt32 i = 0; i < mRectArray.mCount; ) { - // Compare the top edge of this rect with the top edge of the band - if (rect.y < band->y) { - // The top edge of the rect is above the top edge of the band. - // Is there any overlap? - if (rect.YMost() <= band->y) { - // Case #1. This rect is completely above the band, so insert a - // new band - mRectArray.InsertAt(rect, i, aFrame); - break; // we're all done - } - - // Case #2 and case #7. Divide this rect, creating a new rect for the - // part that's above the band - nsRect r1(rect.x, rect.y, rect.width, band->y - rect.y); - - // Insert r1 as a new band - mRectArray.InsertAt(r1, i, aFrame); - i++; - band = mRectArray.mRects + i; // memory may have changed... - - // Modify rect to exclude the part above the band - rect.height = rect.YMost() - band->y; - rect.y = band->y; - - } else if (rect.y > band->y) { - // The top edge of the rect is below the top edge of the band. Is there - // any overlap? - if (rect.y >= band->YMost()) { - // Case #5. This rect is below the current band. Skip to the next band - GetNextBand(band, i); - continue; - } - - // Case #3 and case #4. Divide the current band into two bands with the - // top band being the part that's above the rect - DivideBand(band, i, rect.y - band->y); - band = mRectArray.mRects + i; // memory may have changed... - - // Skip to the bottom band that we just created - GetNextBand(band, i); - } - - // At this point the rect and the band should have the same y-offset - NS_ASSERTION(rect.y == band->y, "unexpected band"); - - // Is the band higher than the rect? - if (band->height > rect.height) { - // Divide the band into two bands with the top band the same height - // as the rect - DivideBand(band, i, rect.height); - band = mRectArray.mRects + i; // memory may have changed... - } - - if (rect.height == band->height) { - // Add the rect to the band - AddRectToBand(band, i, rect, aFrame); - break; - - } else { - // Case #4 and case #7. The rect contains the band vertically. Divide - // the rect, creating a new rect for the part that overlaps the band - nsRect r1(rect.x, rect.y, rect.width, band->YMost() - rect.y); - - // Add r1 to the band - AddRectToBand(band, i, r1, aFrame); - band = mRectArray.mRects + i; // memory may have changed... - - // Modify rect to be the part below the band - rect.height = rect.YMost() - band->YMost(); - rect.y = band->YMost(); - - // Continue with the next band - if (!GetNextBand(band, i)) { - // Append a new bottommost band - mRectArray.Append(rect, aFrame); - break; - } - } - } -} - -void SpaceManager::ClearRegions() -{ - mRectArray.Clear(); -} - -///////////////////////////////////////////////////////////////////////////// -// RectArray - -SpaceManager::RectArray::RectArray() -{ - mRects = nsnull; - mCount = mMax = 0; -} - -SpaceManager::RectArray::~RectArray() -{ - if (nsnull != mRects) { - free(mRects); - } -} - -nscoord SpaceManager::RectArray::YMost() const -{ - return mRects[mCount - 1].YMost(); -} - -void SpaceManager::RectArray::Append(const nsRect& aRect, nsIFrame* aFrame) -{ - // Ensure there's enough capacity - if (mCount >= mMax) { - mMax += 8; - mRects = (nsBandRect*)realloc(mRects, mMax * sizeof(nsBandRect)); - } - - mRects[mCount].x = aRect.x; - mRects[mCount].y = aRect.y; - mRects[mCount].width = aRect.width; - mRects[mCount].height = aRect.height; - mRects[mCount].frame = aFrame; - mCount++; -} - -void SpaceManager::RectArray::InsertAt(const nsRect& aRect, - PRInt32 aIndex, - nsIFrame* aFrame) -{ - NS_PRECONDITION(aIndex <= mCount, "bad index"); // no holes in the array - - // Ensure there's enough capacity - if (mCount >= mMax) { - mMax += 8; - mRects = (nsBandRect*)realloc(mRects, mMax * sizeof(nsBandRect)); - } - - memmove(&mRects[aIndex + 1], &mRects[aIndex], (mCount - aIndex) * sizeof(nsBandRect)); - mRects[aIndex].x = aRect.x; - mRects[aIndex].y = aRect.y; - mRects[aIndex].width = aRect.width; - mRects[aIndex].height = aRect.height; - mRects[aIndex].frame = aFrame; - mCount++; -} - -void SpaceManager::RectArray::RemoveAt(PRInt32 aIndex) -{ - NS_PRECONDITION(aIndex < mCount, "bad index"); - - mCount--; - if (aIndex < mCount) { - memmove(&mRects[aIndex], &mRects[aIndex + 1], (mCount - aIndex) * sizeof(nsBandRect)); - } -} - -void SpaceManager::RectArray::Clear() -{ - mCount = 0; -} diff --git a/mozilla/layout/base/src/nsSpaceManager.h b/mozilla/layout/base/src/nsSpaceManager.h deleted file mode 100644 index 0c01d5a5dcf..00000000000 --- a/mozilla/layout/base/src/nsSpaceManager.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsSpaceManager_h___ -#define nsSpaceManager_h___ - -#include "nsISpaceManager.h" - -/** - * Implementation of nsISpaceManager that maintains a region data structure of - * unavailable space - */ -class SpaceManager : public nsISpaceManager { -public: - SpaceManager(nsIFrame* aFrame); - - // nsISupports - NS_DECL_ISUPPORTS - - virtual nsIFrame* GetFrame() const; - - virtual void Translate(nscoord aDx, nscoord aDy); - virtual void GetTranslation(nscoord& aX, nscoord& aY) const; - virtual nscoord YMost() const; - virtual PRInt32 GetBandData(nscoord aYOffset, - const nsSize& aMaxSize, - nsBandData& aBandData) const; - virtual void AddRectRegion(const nsRect& aUnavailableSpace, nsIFrame* aFrame); - virtual void ClearRegions(); - -protected: - struct nsBandRect : nsRect { - nsIFrame* frame; - }; - - class RectArray { - public: - RectArray(); - ~RectArray(); - - // Functions to add rects - void Append(const nsRect& aRect, nsIFrame* aFrame); - void InsertAt(const nsRect& aRect, PRInt32 aIndex, nsIFrame* aFrame); - void RemoveAt(PRInt32 aIndex); - - // Clear the list of rectangles - void Clear(); - - // Returns the y-most of the bottom band - nscoord YMost() const; - - public: - // Access to the underlying storage - nsBandRect* mRects; // y-x banded array of rectangles of unavailable space - PRInt32 mCount; // current number of rects - PRInt32 mMax; // capacity of rect array - }; - - nsIFrame* const mFrame; // frame associated with the space manager - nscoord mX, mY; // translation from local to global coordinate space - RectArray mRectArray; // y-x banded array of rectangles of unavailable space - -protected: - PRBool GetNextBand(nsBandRect*& aRect, PRInt32& aIndex) const; - PRInt32 LengthOfBand(const nsBandRect* aBand, PRInt32 aIndex) const; - PRBool CoalesceBand(nsBandRect* aBand, PRInt32 aIndex); - void DivideBand(nsBandRect* aBand, PRInt32 aIndex, nscoord aB1Height); - void AddRectToBand(nsBandRect* aBand, PRInt32 aIndex, - const nsRect& aRect, nsIFrame* aFrame); - PRInt32 GetBandAvailableSpace(const nsBandRect* aBand, - PRInt32 aIndex, - nscoord aY, - const nsSize& aMaxSize, - nsBandData& aAvailableSpace) const; - -private: - SpaceManager(const SpaceManager&); // no implementation - void operator=(const SpaceManager&); // no implementation -}; - -#endif /* nsSpaceManager_h___ */ - diff --git a/mozilla/layout/base/src/nsSplittableFrame.cpp b/mozilla/layout/base/src/nsSplittableFrame.cpp deleted file mode 100644 index 9c0c6a8d4ff..00000000000 --- a/mozilla/layout/base/src/nsSplittableFrame.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSplittableFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" - -nsSplittableFrame::nsSplittableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsFrame(aContent, aIndexInParent, aParent) -{ -} - -nsSplittableFrame::~nsSplittableFrame() -{ - // XXX write me -} - -// Flow member functions - -NS_METHOD nsSplittableFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittable; - return NS_OK; -} - -/** - * Creates a continuing frame. The continuing frame is appended to the flow. - * - * @param aPresContext presentation context to use to get the content delegate - * @param aParent the geometric parent to use. Note that it maybe different than - * the receiver's geometric parent - * @return the continuing frame or null if unsuccessful - */ -NS_METHOD nsSplittableFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsIContentDelegate* contentDelegate = mContent->GetDelegate(aPresContext); - - aContinuingFrame = contentDelegate->CreateFrame(aPresContext, mContent, - mIndexInParent, aParent); - NS_RELEASE(contentDelegate); - - // Append the continuing frame to the flow - aContinuingFrame->AppendToFlow(this); - - // Resolve style for the continuing frame and set its style context. - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(mContent, aParent); - aContinuingFrame->SetStyleContext(styleContext); - NS_RELEASE(styleContext); - - return NS_OK; -} - -NS_METHOD nsSplittableFrame::GetPrevInFlow(nsIFrame*& aPrevInFlow) const -{ - aPrevInFlow = mPrevInFlow; - return NS_OK; -} - -NS_METHOD nsSplittableFrame::SetPrevInFlow(nsIFrame* aFrame) -{ - mPrevInFlow = aFrame; - return NS_OK; -} - -NS_METHOD nsSplittableFrame::GetNextInFlow(nsIFrame*& aNextInFlow) const -{ - aNextInFlow = mNextInFlow; - return NS_OK; -} - -NS_METHOD nsSplittableFrame::SetNextInFlow(nsIFrame* aFrame) -{ - mNextInFlow = aFrame; - return NS_OK; -} - -nsIFrame* nsSplittableFrame::GetFirstInFlow() const -{ - nsSplittableFrame* firstInFlow; - nsSplittableFrame* prevInFlow = (nsSplittableFrame*)this; - while (nsnull!=prevInFlow) { - firstInFlow = prevInFlow; - prevInFlow = (nsSplittableFrame*)firstInFlow->mPrevInFlow; - } - NS_POSTCONDITION(nsnull!=firstInFlow, "illegal state in flow chain."); - return firstInFlow; -} - -nsIFrame* nsSplittableFrame::GetLastInFlow() const -{ - nsSplittableFrame* lastInFlow; - nsSplittableFrame* nextInFlow = (nsSplittableFrame*)this; - while (nsnull!=nextInFlow) { - lastInFlow = nextInFlow; - nextInFlow = (nsSplittableFrame*)lastInFlow->mNextInFlow; - } - NS_POSTCONDITION(nsnull!=lastInFlow, "illegal state in flow chain."); - return lastInFlow; -} - -// Append this frame to flow after aAfterFrame -NS_METHOD nsSplittableFrame::AppendToFlow(nsIFrame* aAfterFrame) -{ - NS_PRECONDITION(aAfterFrame != nsnull, "null pointer"); - - mPrevInFlow = aAfterFrame; - aAfterFrame->GetNextInFlow(mNextInFlow); - mPrevInFlow->SetNextInFlow(this); - if (mNextInFlow) { - mNextInFlow->SetPrevInFlow(this); - } - return NS_OK; -} - -// Prepend this frame to flow before aBeforeFrame -NS_METHOD nsSplittableFrame::PrependToFlow(nsIFrame* aBeforeFrame) -{ - NS_PRECONDITION(aBeforeFrame != nsnull, "null pointer"); - - aBeforeFrame->GetPrevInFlow(mPrevInFlow); - mNextInFlow = aBeforeFrame; - mNextInFlow->SetPrevInFlow(this); - if (mPrevInFlow) { - mPrevInFlow->SetNextInFlow(this); - } - return NS_OK; -} - -// Remove this frame from the flow. Connects prev in flow and next in flow -NS_METHOD nsSplittableFrame::RemoveFromFlow() -{ - if (mPrevInFlow) { - mPrevInFlow->SetNextInFlow(mNextInFlow); - } - - if (mNextInFlow) { - mNextInFlow->SetPrevInFlow(mPrevInFlow); - } - - mPrevInFlow = mNextInFlow = nsnull; - return NS_OK; -} - -// Detach from previous frame in flow -NS_METHOD nsSplittableFrame::BreakFromPrevFlow() -{ - if (mPrevInFlow) { - mPrevInFlow->SetNextInFlow(nsnull); - mPrevInFlow = nsnull; - } - return NS_OK; -} - -// Detach from next frame in flow -NS_METHOD nsSplittableFrame::BreakFromNextFlow() -{ - if (mNextInFlow) { - mNextInFlow->SetPrevInFlow(nsnull); - mNextInFlow = nsnull; - } - return NS_OK; -} - diff --git a/mozilla/layout/base/src/nsSplittableFrame.h b/mozilla/layout/base/src/nsSplittableFrame.h deleted file mode 100644 index 2dabfe05725..00000000000 --- a/mozilla/layout/base/src/nsSplittableFrame.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsSplittableFrame_h___ -#define nsSplittableFrame_h___ - -#include "nsFrame.h" - -// Derived class that allows splitting -class nsSplittableFrame : public nsFrame -{ -public: - // Flow member functions. - - // CreateContinuingFrame() does the default behavior of using the - // content delegate to create a new frame - NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const; - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - NS_IMETHOD GetPrevInFlow(nsIFrame*& aPrevInFlow) const; - NS_IMETHOD SetPrevInFlow(nsIFrame*); - NS_IMETHOD GetNextInFlow(nsIFrame*& aNextInFlow) const; - NS_IMETHOD SetNextInFlow(nsIFrame*); - - /** - * Return the first frame in our current flow. - */ - nsIFrame* GetFirstInFlow() const; - - /** - * Return the last frame in our current flow. - */ - nsIFrame* GetLastInFlow() const; - - NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame); - NS_IMETHOD PrependToFlow(nsIFrame* aAfterFrame); - NS_IMETHOD RemoveFromFlow(); - NS_IMETHOD BreakFromPrevFlow(); - NS_IMETHOD BreakFromNextFlow(); - -protected: - // Constructor. Takes as arguments the content object, the index in parent, - // and the Frame for the content parent - nsSplittableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsSplittableFrame(); - - nsIFrame* mPrevInFlow; - nsIFrame* mNextInFlow; -}; - -#endif /* nsSplittableFrame_h___ */ diff --git a/mozilla/layout/base/src/nsStyleConsts.h b/mozilla/layout/base/src/nsStyleConsts.h deleted file mode 100644 index 6ce366d94ae..00000000000 --- a/mozilla/layout/base/src/nsStyleConsts.h +++ /dev/null @@ -1,215 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsStyleConsts_h___ -#define nsStyleConsts_h___ - -#include "nsFont.h" - -// XXX fold this into nsIStyleContext and group by nsStyleXXX struct - -// Defines for various style related constants - -// See nsStyleColor -#define NS_STYLE_BG_ATTACHMENT_FIXED 0x01 -#define NS_STYLE_BG_ATTACHMENT_SCROLL 0x02 - -// See nsStyleColor -#define NS_STYLE_BG_COLOR_TRANSPARENT 0x01 -#define NS_STYLE_BG_IMAGE_NONE 0x02 -#define NS_STYLE_BG_X_POSITION_PERCENT 0x04 -#define NS_STYLE_BG_X_POSITION_LENGTH 0x08 -#define NS_STYLE_BG_Y_POSITION_PERCENT 0x10 -#define NS_STYLE_BG_Y_POSITION_LENGTH 0x20 - -// See nsStyleColor -#define NS_STYLE_BG_REPEAT_OFF 0x00 -#define NS_STYLE_BG_REPEAT_X 0x01 -#define NS_STYLE_BG_REPEAT_Y 0x02 -#define NS_STYLE_BG_REPEAT_XY 0x03 - -// See nsStyleBorder -#define NS_STYLE_BORDER_WIDTH_THIN 0 -#define NS_STYLE_BORDER_WIDTH_MEDIUM 1 -#define NS_STYLE_BORDER_WIDTH_THICK 2 -#define NS_STYLE_BORDER_WIDTH_LENGTH_VALUE 3 - -// See nsStyleBorder -#define NS_STYLE_BORDER_STYLE_NONE 0 -#define NS_STYLE_BORDER_STYLE_GROOVE 1 -#define NS_STYLE_BORDER_STYLE_RIDGE 2 -#define NS_STYLE_BORDER_STYLE_DOTTED 3 -#define NS_STYLE_BORDER_STYLE_DASHED 4 -#define NS_STYLE_BORDER_STYLE_SOLID 5 -#define NS_STYLE_BORDER_STYLE_DOUBLE 6 -#define NS_STYLE_BORDER_STYLE_BLANK 7 -#define NS_STYLE_BORDER_STYLE_INSET 8 -#define NS_STYLE_BORDER_STYLE_OUTSET 9 - -// See nsStyleDisplay -#define NS_STYLE_CLEAR_NONE 0 -#define NS_STYLE_CLEAR_LEFT 1 -#define NS_STYLE_CLEAR_RIGHT 2 -#define NS_STYLE_CLEAR_LEFT_AND_RIGHT 3 -#define NS_STYLE_CLEAR_LINE 4 -#define NS_STYLE_CLEAR_BLOCK 5 -#define NS_STYLE_CLEAR_COLUMN 6 -#define NS_STYLE_CLEAR_PAGE 7 - -// See nsStyleColor -#define NS_STYLE_CURSOR_INHERIT 0 -#define NS_STYLE_CURSOR_DEFAULT 1 -#define NS_STYLE_CURSOR_HAND 2 -#define NS_STYLE_CURSOR_IBEAM 3 - -// See nsStyleDisplay -#define NS_STYLE_DIRECTION_LTR 0 -#define NS_STYLE_DIRECTION_RTL 1 -#define NS_STYLE_DIRECTION_INHERIT 2 - -// See nsStyleDisplay -#define NS_STYLE_DISPLAY_NONE 0 -#define NS_STYLE_DISPLAY_BLOCK 1 -#define NS_STYLE_DISPLAY_INLINE 2 -#define NS_STYLE_DISPLAY_LIST_ITEM 3 - -// See nsStyleDisplay -#define NS_STYLE_FLOAT_NONE 0 -#define NS_STYLE_FLOAT_LEFT 1 -#define NS_STYLE_FLOAT_RIGHT 2 - -// See nsStyleFont -#define NS_STYLE_FONT_STYLE_NORMAL 0 -#define NS_STYLE_FONT_STYLE_ITALIC 1 -#define NS_STYLE_FONT_STYLE_OBLIQUE 2 - -// See nsStyleFont -#define NS_STYLE_FONT_VARIANT_NORMAL 0 -#define NS_STYLE_FONT_VARIANT_SMALL_CAPS 1 - -// See nsStyleFont -#define NS_STYLE_FONT_WEIGHT_NORMAL 400 -#define NS_STYLE_FONT_WEIGHT_BOLD 700 -#define NS_STYLE_FONT_WEIGHT_BOLDER 100 -#define NS_STYLE_FONT_WEIGHT_LIGHTER -100 - -// See nsStyleFont -#define NS_STYLE_FONT_SIZE_XXSMALL 0 -#define NS_STYLE_FONT_SIZE_XSMALL 1 -#define NS_STYLE_FONT_SIZE_SMALL 2 -#define NS_STYLE_FONT_SIZE_MEDIUM 3 -#define NS_STYLE_FONT_SIZE_LARGE 4 -#define NS_STYLE_FONT_SIZE_XLARGE 5 -#define NS_STYLE_FONT_SIZE_XXLARGE 6 -#define NS_STYLE_FONT_SIZE_LARGER 7 -#define NS_STYLE_FONT_SIZE_SMALLER 8 - -// See nsStylePosition.mPosition -#define NS_STYLE_POSITION_STATIC 0 -#define NS_STYLE_POSITION_RELATIVE 1 -#define NS_STYLE_POSITION_ABSOLUTE 2 - -// See nsStylePosition flags; used for width, height, left, top -#define NS_STYLE_POSITION_VALUE_LENGTH 0 -#define NS_STYLE_POSITION_VALUE_PERCENT 1 -#define NS_STYLE_POSITION_VALUE_AUTO 2 -#define NS_STYLE_POSITION_VALUE_INHERIT 3 -#define NS_STYLE_POSITION_VALUE_PROPORTIONAL 4 - -// See nsStylePosition.mClip -#define NS_STYLE_CLIP_AUTO 0 -#define NS_STYLE_CLIP_RECT 1 - -// See nsStylePosition.mOverflow -#define NS_STYLE_OVERFLOW_VISIBLE 0 -#define NS_STYLE_OVERFLOW_HIDDEN 1 -#define NS_STYLE_OVERFLOW_SCROLL 2 -#define NS_STYLE_OVERFLOW_AUTO 3 - -// See nsStyleDisplay -#define NS_STYLE_LINE_HEIGHT_NORMAL 0 - -// See nsStyleList -#define NS_STYLE_LIST_STYLE_IMAGE_NONE 0 - -// See nsStyleList -#define NS_STYLE_LIST_STYLE_NONE 0 -#define NS_STYLE_LIST_STYLE_DISC 1 -#define NS_STYLE_LIST_STYLE_CIRCLE 2 -#define NS_STYLE_LIST_STYLE_SQUARE 3 -#define NS_STYLE_LIST_STYLE_DECIMAL 4 -#define NS_STYLE_LIST_STYLE_LOWER_ROMAN 5 -#define NS_STYLE_LIST_STYLE_UPPER_ROMAN 6 -#define NS_STYLE_LIST_STYLE_LOWER_ALPHA 7 -#define NS_STYLE_LIST_STYLE_UPPER_ALPHA 8 -#define NS_STYLE_LIST_STYLE_BASIC 9 // not in css - -// See nsStyleList -#define NS_STYLE_LIST_STYLE_POSITION_INSIDE 0 -#define NS_STYLE_LIST_STYLE_POSITION_OUTSIDE 1 - -// See nsStyleSpacing -#define NS_STYLE_MARGIN_SIZE_AUTO 0 - -// See nsStyleText (word/letter) -#define NS_STYLE_SPACING_NORMAL 0 - -// See nsStyleText -#define NS_STYLE_TEXT_ALIGN_LEFT 0 -#define NS_STYLE_TEXT_ALIGN_RIGHT 1 -#define NS_STYLE_TEXT_ALIGN_CENTER 2 -#define NS_STYLE_TEXT_ALIGN_JUSTIFY 3 - -// See nsStyleText, nsStyleFont -#define NS_STYLE_TEXT_DECORATION_NONE 0 -#define NS_STYLE_TEXT_DECORATION_UNDERLINE NS_FONT_DECORATION_UNDERLINE -#define NS_STYLE_TEXT_DECORATION_OVERLINE NS_FONT_DECORATION_OVERLINE -#define NS_STYLE_TEXT_DECORATION_LINE_THROUGH NS_FONT_DECORATION_LINE_THROUGH -#define NS_STYLE_TEXT_DECORATION_BLINK 0x8 - -// See nsStyleText -#define NS_STYLE_TEXT_TRANSFORM_NONE 0 -#define NS_STYLE_TEXT_TRANSFORM_CAPITALIZE 1 -#define NS_STYLE_TEXT_TRANSFORM_LOWERCASE 2 -#define NS_STYLE_TEXT_TRANSFORM_UPPERCASE 3 - -// See nsStyleText -// Note: these values pickup after the text-align values because there -// are a few html cases where an object can have both types of -// alignment applied with a single attribute -#define NS_STYLE_VERTICAL_ALIGN_BASELINE 10 -#define NS_STYLE_VERTICAL_ALIGN_SUB 11 -#define NS_STYLE_VERTICAL_ALIGN_SUPER 12 -#define NS_STYLE_VERTICAL_ALIGN_TOP 13 -#define NS_STYLE_VERTICAL_ALIGN_TEXT_TOP 14 -#define NS_STYLE_VERTICAL_ALIGN_MIDDLE 15 -#define NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM 16 -#define NS_STYLE_VERTICAL_ALIGN_BOTTOM 17 -//#define NS_STYLE_VERTICAL_ALIGN_LENGTH 18 -//#define NS_STYLE_VERTICAL_ALIGN_PERCENT 19 - -// See nsStyleDisplay -#define NS_STYLE_VISIBILITY_INHERIT 0 -#define NS_STYLE_VISIBILITY_VISIBLE 1 -#define NS_STYLE_VISIBILITY_HIDDEN 2 - -// See nsStyleText -#define NS_STYLE_WHITESPACE_NORMAL 0 -#define NS_STYLE_WHITESPACE_PRE 1 -#define NS_STYLE_WHITESPACE_NOWRAP 2 - -#endif /* nsStyleConsts_h___ */ diff --git a/mozilla/layout/base/src/nsStyleContext.cpp b/mozilla/layout/base/src/nsStyleContext.cpp deleted file mode 100644 index c0b88aaa2cf..00000000000 --- a/mozilla/layout/base/src/nsStyleContext.cpp +++ /dev/null @@ -1,545 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsString.h" -#include "nsUnitConversion.h" -#include "nsIContent.h" -#include "nsIPresContext.h" -#include "nsIStyleRule.h" -#include "nsISupportsArray.h" -#include "nsCRT.h" - -#include "nsIFrame.h" - -//#define DEBUG_REFS - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); - -static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID); - - -// -------------------- -// nsStyleFont -// -nsStyleFont::nsStyleFont(const nsFont& aFont) - : mFont(aFont) -{ } - -nsStyleFont::~nsStyleFont(void) { } - -struct StyleFontImpl : public nsStyleFont { - StyleFontImpl(const nsFont& aFont) - : nsStyleFont(aFont) - {} - - virtual const nsID& GetID(void) - { return kStyleFontSID; } - - virtual void InheritFrom(const nsStyleFont& aCopy); - -private: // These are not allowed - StyleFontImpl(const StyleFontImpl& aOther); - StyleFontImpl& operator=(const StyleFontImpl& aOther); -}; - -void StyleFontImpl::InheritFrom(const nsStyleFont& aCopy) -{ - mFont = aCopy.mFont; - mThreeD = aCopy.mThreeD; -} - -// -------------------- -// nsStyleColor -// -nsStyleColor::nsStyleColor() { } -nsStyleColor::~nsStyleColor() { } - -struct StyleColorImpl: public nsStyleColor { - StyleColorImpl(void) - { - mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL; - mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT; - mBackgroundRepeat = NS_STYLE_BG_REPEAT_OFF; - - mBackgroundColor = NS_RGB(192,192,192); - mCursor = NS_STYLE_CURSOR_INHERIT; - } - - virtual const nsID& GetID(void) - { return kStyleColorSID; } - - virtual void InheritFrom(const nsStyleColor& aCopy); - -private: // These are not allowed - StyleColorImpl(const StyleColorImpl& aOther); - StyleColorImpl& operator=(const StyleColorImpl& aOther); -}; - -void StyleColorImpl::InheritFrom(const nsStyleColor& aCopy) -{ - mColor = aCopy.mColor; -} - - -// -------------------- -// nsStyleSpacing -// -nsStyleSpacing::nsStyleSpacing(void) - : mMargin(0, 0, 0, 0), - mPadding(0, 0, 0, 0), - mBorderPadding(0, 0, 0, 0) -{ -} - -struct StyleSpacingImpl: public nsStyleSpacing { - StyleSpacingImpl(void) - : nsStyleSpacing() - {} - - virtual const nsID& GetID(void) - { return kStyleSpacingSID; } - - virtual void InheritFrom(const nsStyleSpacing& aCopy); -}; - -void StyleSpacingImpl::InheritFrom(const nsStyleSpacing& aCopy) -{ - // spacing values not inherited -} - -// -------------------- -// nsStyleBorder -// - -nsStyleBorder::nsStyleBorder(void) - : mSize(0, 0, 0, 0) -{ - mSizeFlag[0] = mSizeFlag[1] = mSizeFlag[2] = mSizeFlag[3] = NS_STYLE_BORDER_WIDTH_LENGTH_VALUE; - mStyle[0] = mStyle[1] = mStyle[2] = mStyle[3] = NS_STYLE_BORDER_STYLE_NONE; - mColor[0] = mColor[1] = mColor[2] = mColor[3] = NS_RGB(0, 0, 0); -} - -struct StyleBorderImpl: public nsStyleBorder { - StyleBorderImpl(void) - : nsStyleBorder() - {} - - virtual const nsID& GetID(void) - { return kStyleBorderSID; } - - virtual void InheritFrom(const nsStyleBorder& aCopy); -}; - -void StyleBorderImpl::InheritFrom(const nsStyleBorder& aCopy) -{ - // border values not inherited -} - -// -------------------- -// nsStyleList -// -nsStyleList::nsStyleList() { } -nsStyleList::~nsStyleList() { } - -struct StyleListImpl: public nsStyleList { - StyleListImpl(void) - { - mListStyleType = NS_STYLE_LIST_STYLE_BASIC; - mListStylePosition = NS_STYLE_LIST_STYLE_POSITION_OUTSIDE; - } - - virtual const nsID& GetID(void) - { return kStyleListSID; } - - virtual void InheritFrom(const nsStyleList& aCopy); -}; - -void StyleListImpl::InheritFrom(const nsStyleList& aCopy) -{ - mListStyleType = aCopy.mListStyleType; - mListStyleImage = aCopy.mListStyleImage; - mListStylePosition = aCopy.mListStylePosition; -} - -// -------------------- -// nsStylePosition -// -nsStylePosition::nsStylePosition() { } - -struct StylePositionImpl: public nsStylePosition { - StylePositionImpl(void) - { - mPosition = NS_STYLE_POSITION_STATIC; - mOverflow = NS_STYLE_OVERFLOW_VISIBLE; - mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO; - mLeftOffset = 0; - mTopOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO; - mTopOffset = 0; - mWidthFlags = NS_STYLE_POSITION_VALUE_AUTO; - mWidth = 0; - mHeightFlags = NS_STYLE_POSITION_VALUE_AUTO; - mHeight = 0; - mZIndex = 0; - mClipFlags = NS_STYLE_CLIP_AUTO; - mClip.SizeTo(0,0,0,0); - } - - virtual const nsID& GetID(void) - { return kStylePositionSID; } - - virtual void InheritFrom(const nsStylePosition& aCopy); - -private: // These are not allowed - StylePositionImpl(const StylePositionImpl& aOther); - StylePositionImpl& operator=(const StylePositionImpl& aOther); -}; - -void StylePositionImpl::InheritFrom(const nsStylePosition& aCopy) -{ - // positioning values not inherited -} - -// -------------------- -// nsStyleText -// - -nsStyleText::nsStyleText() { } - -struct StyleTextImpl: public nsStyleText { - StyleTextImpl() { - mTextAlign = NS_STYLE_TEXT_ALIGN_LEFT; - mTextDecoration = NS_STYLE_TEXT_DECORATION_NONE; - mTextTransform = NS_STYLE_TEXT_TRANSFORM_NONE; - mWhiteSpace = NS_STYLE_WHITESPACE_NORMAL; - - mLetterSpacing.SetNormal(); - mLineHeight.SetNormal(); - mTextIndent.Set(0); - mWordSpacing.SetNormal(); - mVerticalAlign.Set(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated); - } - - virtual const nsID& GetID() { - return kStyleTextSID; - } - - virtual void InheritFrom(const nsStyleText& aCopy); -}; - -void StyleTextImpl::InheritFrom(const nsStyleText& aCopy) -{ - // Properties not listed here are not inherited: mVerticalAlign, - // mTextDecoration - mTextAlign = aCopy.mTextAlign; - mTextTransform = aCopy.mTextTransform; - mWhiteSpace = aCopy.mWhiteSpace; - - mLetterSpacing = aCopy.mLetterSpacing; - mLineHeight = aCopy.mLineHeight; - mTextIndent = aCopy.mTextIndent; - mWordSpacing = aCopy.mWordSpacing; -} - -// -------------------- -// nsStyleDisplay -// - -nsStyleDisplay::nsStyleDisplay() { } - -struct StyleDisplayImpl: public nsStyleDisplay { - StyleDisplayImpl() { - mDirection = NS_STYLE_DIRECTION_LTR; - mDisplay = NS_STYLE_DISPLAY_INLINE; - mFloats = NS_STYLE_FLOAT_NONE; - mBreakType = NS_STYLE_CLEAR_NONE; - mBreakBefore = PR_FALSE; - mBreakAfter = PR_FALSE; - } - - virtual const nsID& GetID() { - return kStyleDisplaySID; - } - - virtual void InheritFrom(const nsStyleDisplay& aCopy); -}; - -void StyleDisplayImpl::InheritFrom(const nsStyleDisplay& aCopy) -{ - mDirection = aCopy.mDirection; -} - -//---------------------------------------------------------------------- - -class StyleContextImpl : public nsIStyleContext { -public: - StyleContextImpl(nsIStyleContext* aParent, nsISupportsArray* aRules, nsIPresContext* aPresContext); - ~StyleContextImpl(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - virtual nsIStyleContext* GetParent(void) const; - virtual nsISupportsArray* GetStyleRules(void) const; - - virtual PRBool Equals(const nsIStyleContext* aOther) const; - virtual PRUint32 HashValue(void) const; - - virtual nsStyleStruct* GetData(const nsIID& aSID); - - virtual void InheritFrom(const StyleContextImpl& aParent); - virtual void RecalcAutomaticData(void); - - nsIStyleContext* mParent; - PRUint32 mHashValid: 1; - PRUint32 mHashValue: 31; - nsISupportsArray* mRules; - - // the style data... - StyleFontImpl mFont; - StyleColorImpl mColor; - StyleSpacingImpl mSpacing; - StyleBorderImpl mBorder; - StyleListImpl mList; - StylePositionImpl mPosition; - StyleTextImpl mText; - StyleDisplayImpl mDisplay; -}; - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - -StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent, - nsISupportsArray* aRules, - nsIPresContext* aPresContext) - : mParent(aParent), // weak ref - mRules(aRules), - mFont(aPresContext->GetDefaultFont()), - mColor(), - mSpacing(), - mBorder(), - mList(), - mPosition(), - mText(), - mDisplay() -{ - NS_INIT_REFCNT(); - NS_IF_ADDREF(mRules); - - if (nsnull != aParent) { - InheritFrom((StyleContextImpl&)*aParent); - } - - if (nsnull != mRules) { - PRInt32 index = mRules->Count(); - while (0 < index) { - nsIStyleRule* rule = (nsIStyleRule*)mRules->ElementAt(--index); - rule->MapStyleInto(this, aPresContext); - NS_RELEASE(rule); - } - } -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + StyleContext\n", gInstanceCount); -#endif -} - -StyleContextImpl::~StyleContextImpl() -{ - mParent = nsnull; // weak ref - NS_IF_RELEASE(mRules); -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - StyleContext\n", gInstanceCount); -#endif -} - -NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID) - -nsIStyleContext* StyleContextImpl::GetParent(void) const -{ - NS_IF_ADDREF(mParent); - return mParent; -} - -nsISupportsArray* StyleContextImpl::GetStyleRules(void) const -{ - NS_IF_ADDREF(mRules); - return mRules; -} - - -PRBool StyleContextImpl::Equals(const nsIStyleContext* aOther) const -{ - PRBool result = PR_TRUE; - const StyleContextImpl* other = (StyleContextImpl*)aOther; - - if (other != this) { - if (mParent != other->mParent) { - result = PR_FALSE; - } - else { - if ((nsnull != mRules) && (nsnull != other->mRules)) { - result = mRules->Equals(other->mRules); - } - else { - result = PRBool((nsnull == mRules) && (nsnull == other->mRules)); - } - } - } - return result; -} - -PRUint32 StyleContextImpl::HashValue(void) const -{ - if (0 == mHashValid) { - ((StyleContextImpl*)this)->mHashValue = ((nsnull != mParent) ? mParent->HashValue() : 0); - if (nsnull != mRules) { - PRInt32 index = mRules->Count(); - while (0 <= --index) { - nsIStyleRule* rule = (nsIStyleRule*)mRules->ElementAt(index); - PRUint32 hash = rule->HashValue(); - ((StyleContextImpl*)this)->mHashValue ^= (hash & 0x7FFFFFFF); - NS_RELEASE(rule); - } - } - ((StyleContextImpl*)this)->mHashValid = 1; - } - return mHashValue; -} - - -nsStyleStruct* StyleContextImpl::GetData(const nsIID& aSID) -{ - if (aSID.Equals(kStyleFontSID)) { - return &mFont; - } - if (aSID.Equals(kStyleColorSID)) { - return &mColor; - } - if (aSID.Equals(kStyleSpacingSID)) { - return &mSpacing; - } - if (aSID.Equals(kStyleBorderSID)) { - return &mBorder; - } - if (aSID.Equals(kStyleListSID)) { - return &mList; - } - if (aSID.Equals(kStylePositionSID)) { - return &mPosition; - } - if (aSID.Equals(kStyleTextSID)) { - return &mText; - } - if (aSID.Equals(kStyleDisplaySID)) { - return &mDisplay; - } - return nsnull; -} - -void StyleContextImpl::InheritFrom(const StyleContextImpl& aParent) -{ - mFont.InheritFrom(aParent.mFont); - mColor.InheritFrom(aParent.mColor); - mSpacing.InheritFrom(aParent.mSpacing); - mBorder.InheritFrom(aParent.mBorder); - mList.InheritFrom(aParent.mList); - mText.InheritFrom(aParent.mText); - mPosition.InheritFrom(aParent.mPosition); - mDisplay.InheritFrom(aParent.mDisplay); -} - -static void CalcBorderSize(nscoord& aSize, const nsStyleBorder& aBorder, PRUint8 aSide) -{ - static const nscoord kBorderSize[3] = // XXX need real numbers here (this is probably wrong anyway) - { NS_POINTS_TO_TWIPS_INT(1), - NS_POINTS_TO_TWIPS_INT(3), - NS_POINTS_TO_TWIPS_INT(5) }; - PRUint8 style = aBorder.mStyle[aSide]; - if (NS_STYLE_BORDER_STYLE_NONE == style) { - aSize = 0; - } - else { - PRUint8 flag = aBorder.mSizeFlag[aSide]; - if (flag < NS_STYLE_BORDER_WIDTH_LENGTH_VALUE) { - aSize = kBorderSize[flag]; - } - } -} - -void StyleContextImpl::RecalcAutomaticData(void) -{ - CalcBorderSize(mBorder.mSize.top, mBorder, NS_SIDE_TOP); - CalcBorderSize(mBorder.mSize.right, mBorder, NS_SIDE_RIGHT); - CalcBorderSize(mBorder.mSize.bottom, mBorder, NS_SIDE_BOTTOM); - CalcBorderSize(mBorder.mSize.left, mBorder, NS_SIDE_LEFT); - - // XXX fixup missing border colors - - mSpacing.mBorder = mBorder.mSize; - mSpacing.mBorderPadding = mSpacing.mPadding; - mSpacing.mBorderPadding += mBorder.mSize; -} - -NS_LAYOUT nsresult -NS_NewStyleContext(nsIStyleContext** aInstancePtrResult, - nsISupportsArray* aRules, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIStyleContext* parent = nsnull; - if (nsnull != aParentFrame) { - aParentFrame->GetStyleContext(aPresContext, parent); - NS_ASSERTION(nsnull != parent, "parent frame must have style context"); - } - - StyleContextImpl* context = new StyleContextImpl(parent, aRules, aPresContext); - NS_IF_RELEASE(parent); - if (nsnull == context) { - return NS_ERROR_OUT_OF_MEMORY; - } - context->RecalcAutomaticData(); - - return context->QueryInterface(kIStyleContextIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/base/src/nsStyleCoord.cpp b/mozilla/layout/base/src/nsStyleCoord.cpp deleted file mode 100644 index e410a4b5a58..00000000000 --- a/mozilla/layout/base/src/nsStyleCoord.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsStyleCoord.h" -#include "nsString.h" -#include "nsCRT.h" - -nsStyleCoord::nsStyleCoord(void) - : mUnit(eStyleUnit_Twips) -{ - mValue.mInt = 0; -} - -nsStyleCoord::nsStyleCoord(nscoord aValue) - : mUnit(eStyleUnit_Twips) -{ - mValue.mInt = aValue; -} - -nsStyleCoord::nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit) - : mUnit(aUnit) -{ - mValue.mInt = aValue; -} - -nsStyleCoord::nsStyleCoord(float aValue) - : mUnit(eStyleUnit_Percent) -{ - mValue.mFloat = aValue; -} - -nsStyleCoord::nsStyleCoord(const nsStyleCoord& aCopy) - : mUnit(aCopy.mUnit) -{ - if (eStyleUnit_Percent == mUnit) { - mValue.mFloat = aCopy.mValue.mFloat; - } - else { - mValue.mInt = aCopy.mValue.mInt; - } -} - -nsStyleCoord& nsStyleCoord::operator=(const nsStyleCoord& aCopy) -{ - mUnit = aCopy.mUnit; - if (eStyleUnit_Percent == mUnit) { - mValue.mFloat = aCopy.mValue.mFloat; - } - else { - mValue.mInt = aCopy.mValue.mInt; - } - return *this; -} - -PRBool nsStyleCoord::operator==(const nsStyleCoord& aOther) const -{ - if (mUnit == aOther.mUnit) { - if (eStyleUnit_Percent == mUnit) { - return PRBool(mValue.mFloat == aOther.mValue.mFloat); - } - else { - return PRBool(mValue.mInt == aOther.mValue.mInt); - } - } - return PR_FALSE; -} - -void nsStyleCoord::Set(nscoord aValue) -{ - mUnit = eStyleUnit_Twips; - mValue.mInt = aValue; -} - -void nsStyleCoord::Set(PRInt32 aValue, nsStyleUnit aUnit) -{ - mUnit = aUnit; - mValue.mInt = aValue; -} - -void nsStyleCoord::Set(float aValue) -{ - mUnit = eStyleUnit_Percent; - mValue.mFloat = aValue; -} - -void nsStyleCoord::SetNormal(void) -{ - mUnit = eStyleUnit_Normal; - mValue.mInt = 0; -} - -void nsStyleCoord::SetAuto(void) -{ - mUnit = eStyleUnit_Auto; - mValue.mInt = 0; -} - -void nsStyleCoord::SetInherit(void) -{ - mUnit = eStyleUnit_Inherit; - mValue.mInt = 0; -} - -void nsStyleCoord::AppendToString(nsString& aBuffer) const -{ - if (eStyleUnit_Percent == mUnit) { - aBuffer.Append(mValue.mFloat); - } - else if ((eStyleUnit_Twips == mUnit) || - (eStyleUnit_Proportional == mUnit) || - (eStyleUnit_Enumerated == mUnit)) { - aBuffer.Append(mValue.mInt, 10); - aBuffer.Append("[0x"); - aBuffer.Append(mValue.mInt, 16); - aBuffer.Append(']'); - } - - switch (mUnit) { - case eStyleUnit_Twips: aBuffer.Append("tw"); break; - case eStyleUnit_Percent: aBuffer.Append("%"); break; - case eStyleUnit_Normal: aBuffer.Append("Normal"); break; - case eStyleUnit_Auto: aBuffer.Append("Auto"); break; - case eStyleUnit_Inherit: aBuffer.Append("Inherit"); break; - case eStyleUnit_Proportional: aBuffer.Append("*"); break; - case eStyleUnit_Enumerated: aBuffer.Append("enum"); break; - } - aBuffer.Append(' '); -} - -void nsStyleCoord::ToString(nsString& aBuffer) const -{ - aBuffer.Truncate(); - AppendToString(aBuffer); -} - diff --git a/mozilla/layout/base/src/nsStyleSet.cpp b/mozilla/layout/base/src/nsStyleSet.cpp deleted file mode 100644 index 94ea2a5c0e7..00000000000 --- a/mozilla/layout/base/src/nsStyleSet.cpp +++ /dev/null @@ -1,530 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIStyleSet.h" -#include "nsIStyleSheet.h" -#include "nsIStyleRule.h" -#include "nsIStyleContext.h" -#include "nsISupportsArray.h" -#include "nsIFrame.h" -#include "nsHashtable.h" - - -static NS_DEFINE_IID(kIStyleSetIID, NS_ISTYLE_SET_IID); - -class ContextKey : public nsHashKey { -public: - ContextKey(nsIStyleContext* aContext); - ContextKey(nsIStyleContext* aParent, nsISupportsArray* aRules); - virtual ~ContextKey(void); - - void SetContext(nsIStyleContext* aContext); - - PRBool Equals(const nsHashKey* aOther) const; - PRUint32 HashValue(void) const; - nsHashKey* Clone(void) const; - -private: - ContextKey(void); - ContextKey(const ContextKey& aCopy); - ContextKey& operator=(const ContextKey& aCopy) const; - -protected: - nsIStyleContext* mContext; - nsIStyleContext* mParent; - nsISupportsArray* mRules; -}; - -ContextKey::ContextKey(nsIStyleContext* aContext) - : mContext(aContext), - mParent(nsnull), - mRules(nsnull) -{ - NS_IF_ADDREF(mContext); -} - -ContextKey::ContextKey(nsIStyleContext* aParent, nsISupportsArray* aRules) - : mContext(nsnull), - mParent(aParent), - mRules(aRules) -{ - NS_IF_ADDREF(mParent); - NS_IF_ADDREF(mRules); -} - -ContextKey::ContextKey(const ContextKey& aCopy) - : mContext(aCopy.mContext), - mParent(aCopy.mParent), - mRules(aCopy.mRules) -{ - NS_IF_ADDREF(mContext); - NS_IF_ADDREF(mParent); - NS_IF_ADDREF(mRules); -} - -ContextKey::~ContextKey(void) -{ - NS_IF_RELEASE(mContext); - NS_IF_RELEASE(mParent); - NS_IF_RELEASE(mRules); -} - -void ContextKey::SetContext(nsIStyleContext* aContext) -{ - if (aContext != mContext) { - NS_IF_RELEASE(mContext); - mContext = aContext; - NS_IF_ADDREF(mContext); - } - NS_IF_RELEASE(mParent); - NS_IF_RELEASE(mRules); -} - -PRBool ContextKey::Equals(const nsHashKey* aOther) const -{ - PRBool result = PR_TRUE; - const ContextKey* other = (const ContextKey*)aOther; - - if (other != this) { - if ((nsnull == mContext) || (nsnull == other->mContext) || (mContext != other->mContext)) { - nsIStyleContext* otherParent = other->mParent; - if ((nsnull == otherParent) && (nsnull != other->mContext)) { - otherParent = other->mContext->GetParent(); - } - else { - NS_IF_ADDREF(otherParent); // simulate the above addref - } - - if (mParent == otherParent) { - nsISupportsArray* otherRules = other->mRules; - if ((nsnull == otherRules) && (nsnull != other->mContext)) { - otherRules = other->mContext->GetStyleRules(); - } - else { - NS_IF_ADDREF(otherRules); // simulate the above addref - } - if ((nsnull != mRules) && (nsnull != otherRules)) { - result = mRules->Equals(otherRules); - } - else { - result = PRBool((nsnull == mRules) && (nsnull == otherRules)); - } - NS_IF_RELEASE(otherRules); - } - else { - result = PR_FALSE; - } - NS_IF_RELEASE(otherParent); - } - } - return result; -} - -PRUint32 ContextKey::HashValue(void) const -{ - if (nsnull != mContext) { - return mContext->HashValue(); - } - // we don't have a context yet, compute it like it would - PRUint32 hashValue = ((nsnull != mParent) ? mParent->HashValue() : 0); - if (nsnull != mRules) { - PRInt32 index = mRules->Count(); - while (0 <= --index) { - nsIStyleRule* rule = (nsIStyleRule*)mRules->ElementAt(index); - PRUint32 hash = rule->HashValue(); - hashValue ^= (hash & 0x7FFFFFFF); - NS_RELEASE(rule); - } - } - return hashValue; -} - -nsHashKey* ContextKey::Clone(void) const -{ - return new ContextKey(*this); -} - - -class StyleSetImpl : public nsIStyleSet { -public: - StyleSetImpl(); - - NS_DECL_ISUPPORTS - - virtual void AppendOverrideStyleSheet(nsIStyleSheet* aSheet); - virtual void InsertOverrideStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet); - virtual void InsertOverrideStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet); - virtual void RemoveOverrideStyleSheet(nsIStyleSheet* aSheet); - virtual PRInt32 GetNumberOfOverrideStyleSheets(); - virtual nsIStyleSheet* GetOverrideStyleSheetAt(PRInt32 aIndex); - - virtual void AppendDocStyleSheet(nsIStyleSheet* aSheet); - virtual void InsertDocStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet); - virtual void InsertDocStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet); - virtual void RemoveDocStyleSheet(nsIStyleSheet* aSheet); - virtual PRInt32 GetNumberOfDocStyleSheets(); - virtual nsIStyleSheet* GetDocStyleSheetAt(PRInt32 aIndex); - - virtual void AppendBackstopStyleSheet(nsIStyleSheet* aSheet); - virtual void InsertBackstopStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet); - virtual void InsertBackstopStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet); - virtual void RemoveBackstopStyleSheet(nsIStyleSheet* aSheet); - virtual PRInt32 GetNumberOfBackstopStyleSheets(); - virtual nsIStyleSheet* GetBackstopStyleSheetAt(PRInt32 aIndex); - - virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame); - - // xxx style rules enumeration - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0); - -private: - // These are not supported and are not implemented! - StyleSetImpl(const StyleSetImpl& aCopy); - StyleSetImpl& operator=(const StyleSetImpl& aCopy); - -protected: - virtual ~StyleSetImpl(); - PRBool EnsureArray(nsISupportsArray** aArray); - PRInt32 RulesMatching(nsISupportsArray* aSheets, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults); - void List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets); - - nsISupportsArray* mOverrideSheets; - nsISupportsArray* mDocSheets; - nsISupportsArray* mBackstopSheets; - nsHashtable mStyleContexts; -}; - - -StyleSetImpl::StyleSetImpl() - : mOverrideSheets(nsnull), - mDocSheets(nsnull), - mBackstopSheets(nsnull) -{ - NS_INIT_REFCNT(); -} - -PRBool ReleaseContext(nsHashKey *aKey, void *aData) -{ - ((nsIStyleContext*)aData)->Release(); - return PR_TRUE; -} - -StyleSetImpl::~StyleSetImpl() -{ - NS_IF_RELEASE(mOverrideSheets); - NS_IF_RELEASE(mDocSheets); - NS_IF_RELEASE(mBackstopSheets); - mStyleContexts.Enumerate(ReleaseContext); -} - -NS_IMPL_ISUPPORTS(StyleSetImpl, kIStyleSetIID) - -PRBool StyleSetImpl::EnsureArray(nsISupportsArray** aArray) -{ - if (nsnull == *aArray) { - if (NS_OK != NS_NewISupportsArray(aArray)) { - return PR_FALSE; - } - } - return PR_TRUE; -} - -// ----- Override sheets - -void StyleSetImpl::AppendOverrideStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mOverrideSheets)) { - mOverrideSheets->AppendElement(aSheet); - } -} - -void StyleSetImpl::InsertOverrideStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mOverrideSheets)) { - PRInt32 index = mOverrideSheets->IndexOf(aAfterSheet); - mOverrideSheets->InsertElementAt(aSheet, ++index); - } -} - -void StyleSetImpl::InsertOverrideStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mOverrideSheets)) { - PRInt32 index = mOverrideSheets->IndexOf(aBeforeSheet); - mOverrideSheets->InsertElementAt(aSheet, ((-1 < index) ? index : 0)); - } -} - -void StyleSetImpl::RemoveOverrideStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (nsnull != mOverrideSheets) { - mOverrideSheets->RemoveElement(aSheet); - } -} - -PRInt32 StyleSetImpl::GetNumberOfOverrideStyleSheets() -{ - if (nsnull != mOverrideSheets) { - return mOverrideSheets->Count(); - } - return 0; -} - -nsIStyleSheet* StyleSetImpl::GetOverrideStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = nsnull; - if (nsnull == mOverrideSheets) { - sheet = (nsIStyleSheet*)mOverrideSheets->ElementAt(aIndex); - } - return sheet; -} - -// -------- Doc Sheets - -void StyleSetImpl::AppendDocStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mDocSheets)) { - mDocSheets->AppendElement(aSheet); - } -} - -void StyleSetImpl::InsertDocStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mDocSheets)) { - PRInt32 index = mDocSheets->IndexOf(aAfterSheet); - mDocSheets->InsertElementAt(aSheet, ++index); - } -} - -void StyleSetImpl::InsertDocStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mDocSheets)) { - PRInt32 index = mDocSheets->IndexOf(aBeforeSheet); - mDocSheets->InsertElementAt(aSheet, ((-1 < index) ? index : 0)); - } -} - -void StyleSetImpl::RemoveDocStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (nsnull != mDocSheets) { - mDocSheets->RemoveElement(aSheet); - } -} - -PRInt32 StyleSetImpl::GetNumberOfDocStyleSheets() -{ - if (nsnull != mDocSheets) { - return mDocSheets->Count(); - } - return 0; -} - -nsIStyleSheet* StyleSetImpl::GetDocStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = nsnull; - if (nsnull == mDocSheets) { - sheet = (nsIStyleSheet*)mDocSheets->ElementAt(aIndex); - } - return sheet; -} - -// ------ backstop sheets - -void StyleSetImpl::AppendBackstopStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mBackstopSheets)) { - mBackstopSheets->AppendElement(aSheet); - } -} - -void StyleSetImpl::InsertBackstopStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mBackstopSheets)) { - PRInt32 index = mBackstopSheets->IndexOf(aAfterSheet); - mBackstopSheets->InsertElementAt(aSheet, ++index); - } -} - -void StyleSetImpl::InsertBackstopStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mBackstopSheets)) { - PRInt32 index = mBackstopSheets->IndexOf(aBeforeSheet); - mBackstopSheets->InsertElementAt(aSheet, ((-1 < index) ? index : 0)); - } -} - -void StyleSetImpl::RemoveBackstopStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (nsnull != mBackstopSheets) { - mBackstopSheets->RemoveElement(aSheet); - } -} - -PRInt32 StyleSetImpl::GetNumberOfBackstopStyleSheets() -{ - if (nsnull != mBackstopSheets) { - return mBackstopSheets->Count(); - } - return 0; -} - -nsIStyleSheet* StyleSetImpl::GetBackstopStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = nsnull; - if (nsnull == mBackstopSheets) { - sheet = (nsIStyleSheet*)mBackstopSheets->ElementAt(aIndex); - } - return sheet; -} - -PRInt32 StyleSetImpl::RulesMatching(nsISupportsArray* aSheets, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) -{ - PRInt32 ruleCount = 0; - - if (nsnull != aSheets) { - PRInt32 sheetCount = aSheets->Count(); - PRInt32 index; - for (index = 0; index < sheetCount; index++) { - nsIStyleSheet* sheet = (nsIStyleSheet*)aSheets->ElementAt(index); - ruleCount += sheet->RulesMatching(aPresContext, aContent, aParentFrame, - aResults); - NS_RELEASE(sheet); - } - } - return ruleCount; -} - -nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame) -{ - nsIStyleContext* result = nsnull; - - nsIStyleContext* parentContext = nsnull; - - if (nsnull != aParentFrame) { - aParentFrame->GetStyleContext(aPresContext, parentContext); - NS_ASSERTION(nsnull != parentContext, "parent must have style context"); - } - - // want to check parent frame's context for cached child context first - - // then do a brute force rule search - - nsISupportsArray* rules = nsnull; - if (NS_OK == NS_NewISupportsArray(&rules)) { - PRInt32 ruleCount = RulesMatching(mOverrideSheets, aPresContext, aContent, aParentFrame, rules); - ruleCount += RulesMatching(mDocSheets, aPresContext, aContent, aParentFrame, rules); - ruleCount += RulesMatching(mBackstopSheets, aPresContext, aContent, aParentFrame, rules); - - // then check for cached ruleSet to context or create - ContextKey tempKey(parentContext, rules); - result = (nsIStyleContext*)mStyleContexts.Get(&tempKey); - if (nsnull == result) { - if (NS_OK == NS_NewStyleContext(&result, rules, aPresContext, aContent, aParentFrame)) { - tempKey.SetContext(result); - mStyleContexts.Put(&tempKey, result); // hashtable clones key, so this is OK (table gets first ref) - NS_ADDREF(result); // add ref for the caller -//fprintf(stdout, "+"); - } - } - else { - NS_ADDREF(result); -//fprintf(stdout, "-"); - } - NS_RELEASE(rules); - } - - NS_IF_RELEASE(parentContext); - - return result; -} - -// xxx style rules enumeration - -void StyleSetImpl::List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets) -{ - PRInt32 count = ((nsnull != aSheets) ? aSheets->Count() : 0); - - for (PRInt32 index = 0; index < count; index++) { - nsIStyleSheet* sheet = (nsIStyleSheet*)aSheets->ElementAt(index); - sheet->List(out, aIndent); - fputs("\n", out); - NS_RELEASE(sheet); - } -} - -void StyleSetImpl::List(FILE* out, PRInt32 aIndent) -{ - List(out, aIndent, mOverrideSheets); - List(out, aIndent, mDocSheets); - List(out, aIndent, mBackstopSheets); -} - - -NS_LAYOUT nsresult -NS_NewStyleSet(nsIStyleSet** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - StyleSetImpl *it = new StyleSetImpl(); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIStyleSetIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/base/tests/Makefile b/mozilla/layout/base/tests/Makefile deleted file mode 100644 index 12358087090..00000000000 --- a/mozilla/layout/base/tests/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/base/tests/TestContainerFrame.cpp b/mozilla/layout/base/tests/TestContainerFrame.cpp deleted file mode 100644 index db9e991fff8..00000000000 --- a/mozilla/layout/base/tests/TestContainerFrame.cpp +++ /dev/null @@ -1,681 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nscore.h" -#include "nsCRT.h" -#include "nscoord.h" -#include "nsContainerFrame.h" -#include "nsIContent.h" - -static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID); - -/////////////////////////////////////////////////////////////////////////////// -// Helper functions - -// Compute the number of frames in the list -static PRInt32 -LengthOf(nsIFrame* aChildList) -{ - PRInt32 result = 0; - - while (nsnull != aChildList) { - aChildList->GetNextSibling(aChildList); - result++; - } - - return result; -} - -/////////////////////////////////////////////////////////////////////////////// -// - -class SimpleContent : public nsIContent { -public: - SimpleContent(); - - nsIDocument* GetDocument() const {return mDocument;} - void SetDocument(nsIDocument* aDocument) {mDocument = aDocument;} - - nsIContent* GetParent() const { return nsnull; } - void SetParent(nsIContent* aParent) {} - - PRBool CanContainChildren() const {return PR_FALSE;} - PRInt32 ChildCount() const {return 0;} - nsIContent* ChildAt(PRInt32 aIndex) const {return nsnull;} - PRInt32 IndexOf(nsIContent* aPossibleChild) const {return -1;} - PRBool InsertChildAt(nsIContent* aKid, PRInt32 aIndex) {return PR_FALSE;} - PRBool ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex) {return PR_FALSE;} - PRBool AppendChild(nsIContent* aKid) {return PR_FALSE;} - PRBool RemoveChildAt(PRInt32 aIndex) {return PR_FALSE;} - - nsIAtom* GetTag() const {return nsnull;} - void SetAttribute(const nsString& aName,const nsString& aValue) {;} - nsContentAttr GetAttribute(const nsString& aName, nsString& aRet) const {return eContentAttr_NotThere;} - - nsIContentDelegate* GetDelegate(nsIPresContext* aCX) {return nsnull;} - - void List(FILE* out = stdout, PRInt32 aIndent = 0) const {;} - PRUint32 SizeOf(nsISizeofHandler* aHandler) const { return 0; } - - NS_DECL_ISUPPORTS - -protected: - nsIDocument* mDocument; -}; - -SimpleContent::SimpleContent() -{ -} - -NS_IMPL_ISUPPORTS(SimpleContent, kIContentIID); - -/////////////////////////////////////////////////////////////////////////////// -// - -class SimpleContainer : public nsContainerFrame -{ -public: - SimpleContainer(nsIContent* aContent, PRInt32 aIndexInParent); - - ReflowStatus IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand); - - void SetFirstChild(nsIFrame* aChild, PRInt32 aChildCount); - nsIFrame* GetOverflowList() {return mOverflowList;} - void SetOverflowList(nsIFrame* aChildList) {mOverflowList = aChildList;} - - // Allow public access to protected member functions - void PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling, PRBool aLastIsComplete); - PRBool DeleteChildsNextInFlow(nsIFrame* aChild); - - PRInt32 ChildCount() {return mChildCount;} -}; - -SimpleContainer::SimpleContainer(nsIContent* aContent, PRInt32 aIndexInParent) - : nsContainerFrame(aContent, aIndexInParent, nsnull) -{ -} - -nsIFrame::ReflowStatus -SimpleContainer::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand) -{ - NS_NOTYETIMPLEMENTED("incremental reflow"); - return frComplete; -} - -// Sets mFirstChild and mChildCount, but not mContentOffset, mContentLength, -// or mLastContentIsComplete -void SimpleContainer::SetFirstChild(nsIFrame* aChild, PRInt32 aChildCount) -{ - mFirstChild = aChild; - mChildCount = aChildCount; - NS_ASSERTION(LengthOf(mFirstChild) == aChildCount, "bad child count argument"); -} - -void SimpleContainer::PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling, PRBool aLastIsComplete) -{ - nsContainerFrame::PushChildren(aFromChild, aPrevSibling, aLastIsComplete); -} - -PRBool SimpleContainer::DeleteChildsNextInFlow(nsIFrame* aChild) -{ - return nsContainerFrame::DeleteChildsNextInFlow(aChild); -} - -/////////////////////////////////////////////////////////////////////////////// -// - -class SimpleSplittableFrame : public nsSplittableFrame { -public: - SimpleSplittableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); -}; - -SimpleSplittableFrame::SimpleSplittableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsSplittableFrame(aContent, aIndexInParent, aParent) -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// - -// Basic test of the child enumeration member functions -static PRBool -TestChildEnumeration() -{ - // Create a simple test container - SimpleContainer* f = new SimpleContainer(new SimpleContent(), 0); - - // Add three child frames - SimpleContent* childContent = new SimpleContent(); - nsFrame* c1; - nsFrame* c2; - nsFrame* c3; - - nsFrame::NewFrame((nsIFrame**)&c1, childContent, 0, f); - nsFrame::NewFrame((nsIFrame**)&c2, childContent, 1, f); - nsFrame::NewFrame((nsIFrame**)&c3, childContent, 2, f); - - c1->SetNextSibling(c2); - c2->SetNextSibling(c3); - f->SetFirstChild(c1, 3); - f->SetLastContentOffset(2); - - // Make sure the child count is correct - if (f->ChildCount() != 3) { - printf("ChildEnumeration: wrong child count: %d\n", f->ChildCount()); - return PR_FALSE; - } - - // Test indexing of child frames. nsnull should be returned for index - // values that are out of range - nsIFrame* child; - f->ChildAt(-1, child); - if (nsnull != child) { - printf("ChildEnumeration: child index failed for index < 0\n"); - return PR_FALSE; - } - f->ChildAt(0, child); - if (c1 != child) { - printf("ChildEnumeration: wrong child at index: %d\n", 0); - return PR_FALSE; - } - f->ChildAt(1, child); - if (c2 != child) { - printf("ChildEnumeration: wrong child at index: %d\n", 1); - return PR_FALSE; - } - f->ChildAt(2, child); - if (c3 != child) { - printf("ChildEnumeration: wrong child at index: %d\n", 2); - return PR_FALSE; - } - f->ChildAt(3, child); - if (nsnull != child) { - printf("ChildEnumeration: child index failed for index >= child countn"); - return PR_FALSE; - } - - // Test first and last child member functions - f->FirstChild(child); - if (child != c1) { - printf("ChildEnumeration: wrong first child\n"); - return PR_FALSE; - } - f->LastChild(child); - if (child != c3) { - printf("ChildEnumeration: wrong last child\n"); - return PR_FALSE; - } - -#if 0 - // Test IndexOf() - if ((f->IndexOf(c1) != 0) || (f->IndexOf(c2) != 1) || (f->IndexOf(c3) != 2)) { - printf("ChildEnumeration: index of failed\n"); - return PR_FALSE; - } -#endif - - return PR_TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// -// - -#if 0 -// Test the push children method -// -// This tests the following: -// 1. pushing children to the overflow list when there's no next-in-flow -// 2. pushing to a next-in-flow that's empty -// 3. pushing to a next-in-flow that isn't empty -static PRBool -TestPushChildren() -{ - // Create a simple test container - SimpleContainer* f = new SimpleContainer(new SimpleContent(), 0); - - // Add five child frames - SimpleContent* childContent = new SimpleContent(); - nsFrame* c1; - nsFrame* c2; - nsFrame* c3; - nsFrame* c4; - nsFrame* c5; - - nsFrame::NewFrame((nsIFrame**)&c1, childContent, 0, f); - nsFrame::NewFrame((nsIFrame**)&c2, childContent, 1, f); - nsFrame::NewFrame((nsIFrame**)&c3, childContent, 2, f); - nsFrame::NewFrame((nsIFrame**)&c4, childContent, 3, f); - nsFrame::NewFrame((nsIFrame**)&c5, childContent, 4, f); - - c1->SetNextSibling(c2); - c2->SetNextSibling(c3); - c3->SetNextSibling(c4); - c4->SetNextSibling(c5); - f->SetFirstChild(c1, 5); - f->SetLastContentOffset(4); - - /////////////////////////////////////////////////////////////////////////// - // #1 - - // Push the last two children. Since there's no next-in-flow the children - // should be placed on the overflow list - f->PushChildren(c4, c3, PR_TRUE); - - // Verify that the next sibling pointer of c3 has been cleared - if (nsnull != c3->GetNextSibling()) { - printf("PushChildren: sibling pointer isn't null\n"); - return PR_FALSE; - } - - // Verify that there are two frames on the overflow list - nsIFrame* overflowList = f->GetOverflowList(); - if ((nsnull == overflowList) || (LengthOf(overflowList) != 2)) { - printf("PushChildren: bad overflow list\n"); - return PR_FALSE; - } - - // and that the children on the overflow still have the same geometric parent - while (nsnull != overflowList) { - if (f != overflowList->GetGeometricParent()) { - printf("PushChildren: bad geometric parent\n"); - return PR_FALSE; - } - - overflowList = overflowList->GetNextSibling(); - } - - /////////////////////////////////////////////////////////////////////////// - // #2 - - // Link the overflow list back into the child list - c3->SetNextSibling(f->GetOverflowList()); - f->SetOverflowList(nsnull); - - // Create a continuing frame - SimpleContainer* f1 = new SimpleContainer(f->GetContent(), 0); - - // Link it into the flow - f->SetNextInFlow(f1); - f1->SetPrevInFlow(f); - - // Push the last two children to the next-in-flow which is empty. - f->PushChildren(c4, c3, PR_TRUE); - - // Verify there are two children in f1 - if (f1->ChildCount() != 2) { - printf("PushChildren: continuing frame bad child count: %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // Verify the content offsets are correct - if ((f1->GetFirstContentOffset() != 3) || (f1->GetLastContentOffset() != 4)) { - printf("PushChildren: continuing frame bad mapping\n"); - return PR_FALSE; - } - - // Verify that the first child is correct - if (c4 != f1->FirstChild()) { - printf("PushChildren: continuing frame first child is wrong\n"); - return PR_FALSE; - } - - // Verify that the next sibling pointer of c3 has been cleared - if (nsnull != c3->GetNextSibling()) { - printf("PushChildren: sibling pointer isn't null\n"); - return PR_FALSE; - } - - // Verify that the geometric parent and content parent have been changed - nsIFrame* firstChild = f1->FirstChild(); - while (nsnull != firstChild) { - if (f1 != firstChild->GetGeometricParent()) { - printf("PushChildren: bad geometric parent\n"); - return PR_FALSE; - } - - if (f1 != firstChild->GetContentParent()) { - printf("PushChildren: bad content parent\n"); - return PR_FALSE; - } - - firstChild = firstChild->GetNextSibling(); - } - - /////////////////////////////////////////////////////////////////////////// - // #3 - - // Test pushing two children to a next-in-flow that already has children - f->PushChildren(c2, c1, PR_TRUE); - - // Verify there are four children in f1 - if (f1->ChildCount() != 4) { - printf("PushChildren: continuing frame bad child count: %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // Verify the content offset/length are correct - if ((f1->GetFirstContentOffset() != 1) || (f1->GetLastContentOffset() != 4)) { - printf("PushChildren: continuing frame bad mapping\n"); - return PR_FALSE; - } - - // Verify that the first child is correct - if (c2 != f1->FirstChild()) { - printf("PushChildren: continuing frame first child is wrong\n"); - return PR_FALSE; - } - - // Verify that c3 points to c4 - if (c4 != c3->GetNextSibling()) { - printf("PushChildren: bad sibling pointers\n"); - return PR_FALSE; - } - - return PR_TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// -// - -// Test the delete child's next-in-flow method -// -// This tests the following: -// 1. one next-in-flow in same geometric parent -// a) next-in-flow is parent's last child -// b) next-in-flow is not the parent's last child -// 2. one next-in-flow in different geometric parents -// a) next-in-flow is parent's first and last child -// b) next-in-flow is not the parent's last child -// 3. multiple next-in-flow frames -static PRBool -TestDeleteChildsNext() -{ - // Create two simple test containers - SimpleContainer* f = new SimpleContainer(new SimpleContent(), 0); - - // Create two child frames - SimpleContent* childContent = new SimpleContent(); - nsFrame* c1 = new SimpleSplittableFrame(childContent, 0, f); - nsFrame* c11 = new SimpleSplittableFrame(childContent, 0, f); - - /////////////////////////////////////////////////////////////////////////// - // #1a - - // Make the child frames siblings and in the same flow - c1->SetNextSibling(c11); - c11->AppendToFlow(c1); - f->SetFirstChild(c1, 2); - - // Delete the next-in-flow - f->DeleteChildsNextInFlow(c1); - - // Verify the child count - if (f->ChildCount() != 1) { - printf("DeleteNextInFlow: bad child count (#1a): %d\n", f->ChildCount()); - return PR_FALSE; - } - - // Verify the sibling pointer is null - if (nsnull != c1->GetNextSibling()) { - printf("DeleteNextInFlow: bad sibling pointer (#1a):\n"); - return PR_FALSE; - } - - // Verify the next-in-flow pointer is null - if (nsnull != c1->GetNextInFlow()) { - printf("DeleteNextInFlow: bad next-in-flow (#1a)\n"); - return PR_FALSE; - } - - // Verify the first/last content offsets are still 0 - if ((f->GetFirstContentOffset() != 0) || (f->GetLastContentOffset() != 0)) { - printf("DeleteNextInFlow: bad content mapping (#1a)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // #2a - - // Create a second container frame - SimpleContainer* f1 = new SimpleContainer(new SimpleContent(), 0); - - // Re-create the continuing child frame - c11 = new SimpleSplittableFrame(childContent, 0, f1); - - // Put the first child in the first container and the continuing child frame in - // the second container - c11->AppendToFlow(c1); - f->SetFirstChild(c1, 1); - f->SetLastContentOffset(0); - f1->SetFirstChild(c11, 1); - - // Link the containers together - f1->AppendToFlow(f); - - // Delete the next-in-flow - f->DeleteChildsNextInFlow(c1); - - // Verify that the second container frame is empty - if ((f1->ChildCount() != 0) || (f1->FirstChild() != nsnull)) { - printf("DeleteNextInFlow: continuing frame not empty (#2a)\n"); - return PR_FALSE; - } - - // Verify the next-in-flow pointer is null - if (nsnull != c1->GetNextInFlow()) { - printf("DeleteNextInFlow: bad next-in-flow (#1b)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // #1b - - // Re-create the continuing child frame - c11 = new SimpleSplittableFrame(childContent, 0, f); - - // Create a third child frame - nsFrame* c2 = new SimpleSplittableFrame(childContent, 1, f); - - c1->SetNextSibling(c11); - c11->AppendToFlow(c1); - c11->SetNextSibling(c2); - f->SetFirstChild(c1, 3); - f->SetLastContentOffset(1); - - // Delete the next-in-flow - f->DeleteChildsNextInFlow(c1); - - // Verify the child count - if (f->ChildCount() != 2) { - printf("DeleteNextInFlow: bad child count (#1b): %d\n", f->ChildCount()); - return PR_FALSE; - } - - // Verify the sibling pointer is correct - if (c1->GetNextSibling() != c2) { - printf("DeleteNextInFlow: bad sibling pointer (#1b):\n"); - return PR_FALSE; - } - - // Verify the next-in-flow pointer is correct - if (nsnull != c1->GetNextInFlow()) { - printf("DeleteNextInFlow: bad next-in-flow (#1b)\n"); - return PR_FALSE; - } - - // Verify the first/last content offsets are correct - if ((f->GetFirstContentOffset() != 0) || (f->GetLastContentOffset() != 1)) { - printf("DeleteNextInFlow: bad content mapping (#1a)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // #2b - - // Re-create the continuing frame and the third child frame - c11 = new SimpleSplittableFrame(childContent, 0, f1); - c2 = new SimpleSplittableFrame(childContent, 1, f1); - - // Put the first child in the first container, and the continuing child frame - // and the third frame in the second container - c1->SetNextSibling(nsnull); - c11->AppendToFlow(c1); - f->SetFirstChild(c1, 1); - f->SetLastContentOffset(0); - - c11->SetNextSibling(c2); - f1->SetFirstChild(c11, 2); - f1->SetFirstContentOffset(0); - f1->SetLastContentOffset(1); - - // Link the containers together - f1->AppendToFlow(f); - - // Delete the next-in-flow - f->DeleteChildsNextInFlow(c1); - - // Verify the next-in-flow pointer is null - if (nsnull != c1->GetNextInFlow()) { - printf("DeleteNextInFlow: bad next-in-flow (#2b)\n"); - return PR_FALSE; - } - - // Verify that the second container frame has one child - if (f1->ChildCount() != 1) { - printf("DeleteNextInFlow: continuing frame bad child count (#2b): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // Verify that the second container's first child is correct - if (f1->FirstChild() != c2) { - printf("DeleteNextInFlow: continuing frame bad first child (#2b)\n"); - return PR_FALSE; - } - - // Verify the second container's first content offset - if (f1->GetFirstContentOffset() != 1) { - printf("DeleteNextInFlow: continuing frame bad first content offset (#2b): %d\n", - f1->GetFirstContentOffset()); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // #3 - - // Re-create the continuing frame and the third child frame - c11 = new SimpleSplittableFrame(childContent, 0, f); - c2 = new SimpleSplittableFrame(childContent, 1, f); - - // Create a second continuing frame - SimpleSplittableFrame* c12 = new SimpleSplittableFrame(childContent, 0, f); - - // Put all the child frames in the first container - c1->SetNextSibling(c11); - c11->SetNextSibling(c12); - c12->SetNextSibling(c2); - c11->AppendToFlow(c1); - c12->AppendToFlow(c11); - f->SetFirstChild(c1, 4); - f->SetLastContentOffset(1); - - // Delete the next-in-flow - f->DeleteChildsNextInFlow(c1); - - // Verify the next-in-flow pointer is null - if (nsnull != c1->GetNextInFlow()) { - printf("DeleteNextInFlow: bad next-in-flow (#3)\n"); - return PR_FALSE; - } - - // Verify the child count is correct - if (f->ChildCount() != 2) { - printf("DeleteNextInFlow: bad child count (#3): %d\n", f->ChildCount()); - return PR_FALSE; - } - - // and the last content offset is still correct - if (f->GetLastContentOffset() != 1) { - printf("DeleteNextInFlow: bad last content offset (#3): %d\n", f->GetLastContentOffset()); - return PR_FALSE; - } - - // Verify the sibling list is correct - if ((c1->GetNextSibling() != c2) || (c2->GetNextSibling()!= nsnull)) { - printf("DeleteNextInFlow: bad sibling list (#3)\n"); - return PR_FALSE; - } - - // Verify the next-in-flow pointer is null - if (nsnull != c1->GetNextInFlow()) { - printf("DeleteNextInFlow: bad next-in-flow (#3)\n"); - return PR_FALSE; - } - - return PR_TRUE; -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// - -// Test the container frame being used as a pseudo frame -static PRBool -TestAsPseudo() -{ - return PR_TRUE; -} - -/////////////////////////////////////////////////////////////////////////////// -// - -int main(int argc, char** argv) -{ - // Test the child frame enumeration member functions - if (!TestChildEnumeration()) { - return -1; - } - -#if 0 - // Test the push children method - if (!TestPushChildren()) { - return -1; - } - - // Test the push children method - if (!TestDeleteChildsNext()) { - return -1; - } -#endif - - // Test being used as a pseudo frame - if (!TestAsPseudo()) { - return -1; - } - - return 0; -} diff --git a/mozilla/layout/base/tests/makefile.win b/mozilla/layout/base/tests/makefile.win deleted file mode 100644 index c09afa47309..00000000000 --- a/mozilla/layout/base/tests/makefile.win +++ /dev/null @@ -1,56 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = EXE -PROG1 = .\$(OBJDIR)\TestContainerFrame.exe -PROGRAMS = $(PROG1) - -LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I..\src -LLIBS= \ - $(DIST)\lib\raptorlayout_s.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\jsdom.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAMS) - $(MAKE_INSTALL) $(PROG1) $(DIST)\bin - -# Move this into config/obj.inc when it's allowed -.cpp{.\$(OBJDIR)\}.exe: - -$(CC) @<<$(CFGFILE) - $(CFLAGS) - $(LCFLAGS) - $(LINCS) - $(LINCS_1) - $(INCS) - $(LLIBS) - $(OS_LIBS) - -Fd$(PBDFILE) - -Fe.\$(OBJDIR)\ - -Fo.\$(OBJDIR)\ - $(CURDIR)$(*B).cpp -< - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib - -clobber:: - rm -f $(DIST)\bin\$(DLLNAME).dll - rm -f $(DIST)\lib\$(DLLNAME).lib diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp deleted file mode 100644 index 6b45fe72cab..00000000000 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ /dev/null @@ -1,2184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBlockFrame.h" -#include "nsSize.h" -#include "nsIAnchoredItems.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsMargin.h" -#include "nsHTMLIIDs.h" -#include "nsCSSLayout.h" -#include "nsCRT.h" -#include "nsIPresShell.h" -#include "nsReflowCommand.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsAbsoluteFrame.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct BlockBandData : public nsBandData { - nsBandTrapezoid data[12]; - - // Bounding rect of available space between any left and right floaters - nsRect availSpace; - - // Constructor - BlockBandData() {size = 12; trapezoids = data;} - - // Computes the bounding rect of the available space, i.e. space between - // any left and right floaters - // - // Uses the current trapezoid data, see nsISpaceManager::GetBandData(). - // Updates member data "availSpace" - void ComputeAvailSpaceRect(); -}; - -void BlockBandData::ComputeAvailSpaceRect() -{ - nsBandTrapezoid* trapezoid = data; - - if (count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < count; i++) { - nsBandTrapezoid* trapezoid = &data[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &data[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availSpace); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availSpace); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availSpace.x = availSpace.XMost(); - } - availSpace.width = 0; - } -} - -// XXX Bugs -// 1. right to left reflow can generate negative x coordinates. - -// XXX Speedup idea (all containers) - -// If I reflow a child and it gives back not-complete status then -// there is no sense in trying to pullup children. For blocks, it's a -// little more complicated unless the child is a block - if the child -// is a block, then we must be out of room hence we should stop. If -// the child is not a block then our line should be flushed (see #2 -// below) if our line is already empty then we must be out of room. - -// For inline frames and column frames, if we reflow a child and get -// back not-complete status then we should bail immediately because we -// are out of room. - -// XXX Speedup ideas: -// 1. change pullup code to use line information from next in flow -// 2. we can advance to next line immediately after reflowing something -// and noticing that it's not complete. -// 3. pass down last child information in aState so that pullup, etc., -// don't need to recompute it - -// XXX TODO: -// 0. Move justification into line flushing code - -// 1. To get ebina margins I need "auto" information from the style -// system margin's. A bottom/top margin of auto will then be computed like -// ebina computes it [however the heck that is]. - -// 2. kicking out floaters and talking with floater container to adjust -// left and right margins - -nsBlockReflowState::nsBlockReflowState() -{ -} - -void nsBlockReflowState::Init(const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsIStyleContext* aBlockSC, - nsISpaceManager* aSpaceManager) -{ - firstLine = PR_TRUE; - allowLeadingWhitespace = PR_FALSE; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - firstChildIsInsideBullet = PR_FALSE; - nextListOrdinal = -1; - column = 0; - - spaceManager = aSpaceManager; - currentBand = new BlockBandData; - - styleContext = aBlockSC; - styleText = (nsStyleText*) aBlockSC->GetData(kStyleTextSID); - styleFont = (nsStyleFont*) aBlockSC->GetData(kStyleFontSID); - styleDisplay = (nsStyleDisplay*) aBlockSC->GetData(kStyleDisplaySID); - - justifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == styleText->mTextAlign) && - (NS_STYLE_WHITESPACE_PRE != styleText->mWhiteSpace); - - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - maxElementSize = aMaxElementSize; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - kidXMost = 0; - x = 0; - y = 0; - - isInline = PR_FALSE; - currentLineNumber = 0; - lineStart = nsnull; - lineLength = 0; - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; - lineMaxElementSize.width = 0; - lineMaxElementSize.height = 0; - lastContentIsComplete = PR_TRUE; - - maxAscents = sizeof(ascentBuf) / sizeof(ascentBuf[0]); - needRelativePos = PR_FALSE; - - prevLineLastFrame = nsnull; - prevLineHeight = 0; - topMargin = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - prevLineLastContentIsComplete = PR_TRUE; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - reflowStatus = nsIFrame::frNotComplete; -} - -nsBlockReflowState::~nsBlockReflowState() -{ - if (ascents != ascentBuf) { - delete ascents; - } - delete currentBand; -} - -void nsBlockReflowState::AddAscent(nscoord aAscent) -{ - NS_PRECONDITION(lineLength <= maxAscents, "bad line length"); - if (lineLength == maxAscents) { - maxAscents *= 2; - nscoord* newAscents = new nscoord[maxAscents]; - if (nsnull != newAscents) { - nsCRT::memcpy(newAscents, ascents, sizeof(nscoord) * lineLength); - if (ascents != ascentBuf) { - delete ascents; - } - ascents = newAscents; - } else { - // Yikes! Out of memory! - return; - } - } - ascents[lineLength] = aAscent; -} - -void nsBlockReflowState::AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, - nscoord aPrevLineHeight) -{ - firstLine = PR_FALSE; - allowLeadingWhitespace = PR_FALSE; - column = 0; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - lineStart = nsnull; - lineLength = 0; - currentLineNumber++; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - needRelativePos = PR_FALSE; - - prevLineLastFrame = aPrevLineLastFrame; - prevLineHeight = aPrevLineHeight; - prevMaxPosBottomMargin = maxPosBottomMargin; - prevMaxNegBottomMargin = maxNegBottomMargin; - - // Remember previous line's lastContentIsComplete - prevLineLastContentIsComplete = lastContentIsComplete; - lastContentIsComplete = PR_TRUE; - - topMargin = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; -} - -#ifdef NS_DEBUG -void nsBlockReflowState::DumpLine() -{ - nsIFrame* f = lineStart; - PRInt32 ll = lineLength; - while (--ll >= 0) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} - -void nsBlockReflowState::DumpList() -{ - nsIFrame* f = lineStart; - while (nsnull != f) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} -#endif - -//---------------------------------------------------------------------- - -nsresult nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBlockFrame::nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsBlockFrame::~nsBlockFrame() -{ - if (nsnull != mLines) { - delete mLines; - } -} - -nsresult -nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLFrameTypeIID)) { - *aInstancePtr = (void*) ((nsIHTMLFrameType*) this); - return NS_OK; - } else if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void*) ((nsIRunaround*) this); - return NS_OK; - } else if (aIID.Equals(kIFloaterContainerIID)) { - *aInstancePtr = (void*) ((nsIFloaterContainer*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Computes the top margin to use for this child frames based on its display -// type and the display type of the previous child frame. -// -// Adjacent vertical margins between block-level elements are collapsed. -nscoord nsBlockFrame::GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - if (aIsInline) { - // Just use whatever the previous bottom margin was - return aState.prevMaxPosBottomMargin - aState.prevMaxNegBottomMargin; - } else { - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - if (ss->mMargin.top < 0) { - maxNegTopMargin = -ss->mMargin.top; - } else { - maxPosTopMargin = ss->mMargin.top; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - return maxPos - maxNeg; - } else { - return 0; - } - } -} - -void nsBlockFrame::PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY) -{ - NS_PRECONDITION(aState.floaterToDo.Count() > 0, "no floaters"); - - // XXX Factor this code with PlaceFloater()... - PRInt32 numFloaters = aState.floaterToDo.Count(); - - for (PRInt32 i = 0; i < numFloaters; i++) { - nsIFrame* floater = (nsIFrame*)aState.floaterToDo[i]; - nsRect region; - - // Get the band of available space - // XXX This is inefficient to do this inside the loop... - GetAvailableSpaceBand(aState, aY); - - // Get the type of floater - nsIStyleContextPtr styleContext; - - floater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* sd = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - floater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == sd->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == sd->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, - 0); - mCurrentState->spaceManager->AddRectRegion(region, floater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - floater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - } - aState.floaterToDo.Clear(); -} - -/** - * Flush a line out. Return true if the line fits in our available - * height. If the line does not fit then return false. When the line - * fits we advance the y coordinate, reset the x coordinate and - * prepare the nsBlockReflowState for the next line. - */ -PRBool nsBlockFrame::AdvanceToNextLine(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - NS_PRECONDITION(aState.lineLength > 0, "bad line"); - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nscoord y = aState.y + aState.topMargin; - nscoord lineHeight; - - if (aState.isInline) { - // Vertically align the children on this line, returning the height of - // the line upon completion. - lineHeight = nsCSSLayout::VerticallyAlignChildren(aCX, this, - aState.styleFont, - y, - aState.lineStart, - aState.lineLength, - aState.ascents, - aState.maxAscent); - - // Any below current line floaters to place? - if (aState.floaterToDo.Count() > 0) { - PlaceBelowCurrentLineFloaters(aCX, aState, y + lineHeight); - // XXX Factor in the height of the floaters as well when considering - // whether the line fits. - // The default policy is that if there isn't room for the floaters then - // both the line and the floaters are pushed to the next-in-flow... - } - } else { - nsSize size; - - aState.lineStart->GetSize(size); - lineHeight = size.height; - } - - // The first line always fits - if (aState.currentLineNumber > 0) { - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if (y + lineHeight > yb) { - // After vertical alignment of the children and factoring in the - // proper margin, the line doesn't fit. - return PR_FALSE; - } - } - - if (aState.isInline) { - // Check if the right-edge of the line exceeds our running x-most - nscoord xMost = aState.borderPadding.left + aState.lineWidth; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - } - - // Advance the y coordinate to the new position where the next - // line or block element will go. - aState.y = y + lineHeight; - aState.x = 0; - - // Now that the vertical alignment is done we can perform horizontal - // alignment and relative positioning. Skip all of these if we are - // doing an unconstrained (in x) reflow. There's no point in doing - // the work if we *know* we are going to reflowed again. - if (!aState.unconstrainedWidth) { - nsCSSLayout::HorizontallyPlaceChildren(aCX, this, aState.styleText, - aState.lineStart, aState.lineLength, - aState.lineWidth, - aState.availSize.width); - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - if (!aState.justifying) { - nsCSSLayout::RelativePositionChildren(aCX, this, - aState.lineStart, - aState.lineLength); - } - } - - // Record line length - aState.lineLengths.AppendElement((void*)aState.lineLength); - - // Find the last frame in the line - // XXX keep this as running state in the nsBlockReflowState - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - // Update maxElementSize - if (nsnull != aState.maxElementSize) { - nsSize& lineMax = aState.lineMaxElementSize; - nsSize* maxMax = aState.maxElementSize; - if (lineMax.width > maxMax->width) { - maxMax->width = lineMax.width; - } - if (lineMax.height > maxMax->height) { - maxMax->height = lineMax.height; - } - aState.lineMaxElementSize.width = 0; - aState.lineMaxElementSize.height = 0; - } - - // Advance to the next line - aState.AdvanceToNextLine(lastFrame, lineHeight); - - return PR_TRUE; -} - -/** - * Add an inline child to the current line. Advance various running - * values after placement. - */ -void nsBlockFrame::AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Place and size the child - // XXX add in left margin from kid - nsRect r; - r.y = aState.y; - r.width = aKidSize.width; - r.height = aKidSize.height; - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - // Left to right positioning. - r.x = aState.borderPadding.left + aState.x + ss->mMargin.left; - aState.x += aKidSize.width + ss->mMargin.left + ss->mMargin.right; - } else { - // Right to left positioning - // XXX what should we do when aState.x goes negative??? - r.x = aState.x - aState.borderPadding.right - ss->mMargin.right - - aKidSize.width; - aState.x -= aKidSize.width + ss->mMargin.right + ss->mMargin.left; - } - aKidFrame->SetRect(r); - aState.AddAscent(aKidSize.ascent); - aState.lineWidth += aKidSize.width; - aState.lineLength++; - - // Update maximums for the line - if (aKidSize.ascent > aState.maxAscent) { - aState.maxAscent = aKidSize.ascent; - } - if (aKidSize.descent > aState.maxDescent) { - aState.maxDescent = aKidSize.descent; - } - // Update running margin maximums - if (aState.firstChildIsInsideBullet && (aKidFrame == mFirstChild)) { - // XXX temporary code. Since the molecule for the bullet frame - // is the same as the LI frame, we get bad style information. - // ignore it. - } else { - nscoord margin; -#if 0 - // XXX CSS2 spec says that top/bottom margin don't affect line height - // calculation. We're waiting for clarification on this issue... - if ((margin = ss->mMargin.top) < 0) { - margin = -margin; - if (margin > aState.maxNegTopMargin) { - aState.maxNegTopMargin = margin; - } - } else { - if (margin > aState.maxPosTopMargin) { - aState.maxPosTopMargin = margin; - } - } -#endif - if ((margin = ss->mMargin.bottom) < 0) { - margin = -margin; - if (margin > aState.maxNegBottomMargin) { - aState.maxNegBottomMargin = margin; - } - } else { - if (margin > aState.maxPosBottomMargin) { - aState.maxPosBottomMargin = margin; - } - } - } - - // Update line max element size - nsSize& mes = aState.lineMaxElementSize; - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > mes.width) { - mes.width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > mes.height) { - mes.height = aKidMaxElementSize->height; - } - } -} - -// Places and sizes the block-level element, and advances the line. -// The rect is in the local coordinate space of the kid frame. -void nsBlockFrame::AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Translate from the kid's coordinate space to our coordinate space - aKidRect.x += aState.borderPadding.left + ss->mMargin.left; - aKidRect.y += aState.y + aState.topMargin; - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - aState.AddAscent(aKidRect.height); - aState.lineLength++; - - // Is this the widest child frame? - nscoord xMost = aKidRect.XMost() + ss->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // Update the max element size - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aKidMaxElementSize->height; - } - } - - // and the bottom line margin information which we'll use when placing - // the next child - if (ss->mMargin.bottom < 0) { - aState.maxNegBottomMargin = -ss->mMargin.bottom; - } else { - aState.maxPosBottomMargin = ss->mMargin.bottom; - } - - // Update the running y-offset - aState.y += aKidRect.height + aState.topMargin; - - // Apply relative positioning if necessary - nsCSSLayout::RelativePositionChildren(aCX, this, aKidFrame, 1); - - // Advance to the next line - aState.AdvanceToNextLine(aKidFrame, aKidRect.height); -} - -/** - * Compute the available size for reflowing the given child at the - * current x,y position in the state. Note that this may return - * negative or zero width/height's if we are out of room. - */ -void nsBlockFrame::GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - // Determine the maximum available reflow height for the child - nscoord yb = aState.borderPadding.top + aState.availSize.height; - aResult.height = aState.unconstrainedHeight ? NS_UNCONSTRAINEDSIZE : - yb - aState.y - aState.topMargin; - - // Determine the maximum available reflow width for the child - if (aState.unconstrainedWidth) { - aResult.width = NS_UNCONSTRAINEDSIZE; - } else if (aIsInline) { - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - aResult.width = aState.currentBand->availSpace.XMost() - aState.x; - } else { - aResult.width = aState.x - aState.currentBand->availSpace.x; - } - } else { - // It's a block. Don't adjust for the left/right margin here. That happens - // later on once we know the current left/right edge - aResult.width = aState.availSize.width; - } -} - -/** - * Push all of the kids that we have not reflowed, starting at - * aState.lineStart. aPrevKid is the kid previous to aState.lineStart - * and is also our last child. Note that line length is NOT a - * reflection of the number of children we are actually pushing - * (because we don't break the sibling list as we add children to the - * line). - */ -void nsBlockFrame::PushKids(nsBlockReflowState& aState) -{ - nsIFrame* prevFrame = aState.prevLineLastFrame; - NS_PRECONDITION(nsnull != prevFrame, "pushing all kids"); -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevFrame->GetNextSibling(nextSibling); - NS_PRECONDITION(nextSibling == aState.lineStart, "bad prev line"); -#endif - -#ifdef NS_DEBUG - PRInt32 numKids = LengthOf(mFirstChild); - NS_ASSERTION(numKids == mChildCount, "bad child count"); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": push kids (childCount=%d)\n", mChildCount); - DumpFlow(); -#endif - - PushChildren(aState.lineStart, prevFrame, mLastContentIsComplete); - SetLastContentOffset(prevFrame); - - // Set mLastContentIsComplete to the previous lines last content is - // complete now that the previous line's last child is our last - // child. - mLastContentIsComplete = aState.prevLineLastContentIsComplete; - - // Fix up child count - // XXX is there a better way? aState.lineLength doesn't work because - // we might be pushing more than just the pending line. - nsIFrame* kid = mFirstChild; - PRInt32 kids = 0; - while (nsnull != kid) { - kids++; - kid->GetNextSibling(kid); - } - mChildCount = kids; - - // Make sure we have no lingering line data - aState.lineLength = 0; - aState.lineStart = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d) [%c]\n", mChildCount, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif -} - -/** - * Gets a band of available space starting at the specified y-offset. Assumes - * the local coordinate space is currently set to the upper-left origin of the - * bounding rect - * - * Updates "currentBand" and "x" member data of the block reflow state - */ -void nsBlockFrame::GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY) -{ - // Gets a band of available space. - aState.spaceManager->Translate(aState.borderPadding.left, 0); - aState.spaceManager->GetBandData(aY, aState.availSize, *aState.currentBand); - - // Compute the bounding rect of the available space, i.e. space between any - // left and right floaters - aState.currentBand->ComputeAvailSpaceRect(); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - aState.x = aState.currentBand->availSpace.x; -} - -void nsBlockFrame::ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear) -{ - // Translate the coordinate space - aState.spaceManager->Translate(aState.borderPadding.left, 0); - -getBand: - nscoord y = aState.y + aState.topMargin; - PRBool isLeftFloater = PR_FALSE; - PRBool isRightFloater = PR_FALSE; - - // Get a band of available space - aState.spaceManager->GetBandData(y, aState.availSize, *aState.currentBand); - - // Scan the trapezoids looking for left and right floaters - nsBandTrapezoid* trapezoid = aState.currentBand->trapezoids; - for (PRInt32 i = 0; i < aState.currentBand->count; i++) { - // XXX Handle multiply occupied - if (nsBandTrapezoid::smOccupied == trapezoid->state) { - nsStyleDisplay* display; - - trapezoid->frame->GetStyleData(kStylePositionSID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - isLeftFloater = PR_TRUE; - } else if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - isRightFloater = PR_TRUE; - } - } - - trapezoid++; - } - - if (isLeftFloater) { - if ((aClear == NS_STYLE_CLEAR_LEFT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - if (isRightFloater) { - if ((aClear == NS_STYLE_CLEAR_RIGHT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - - aState.spaceManager->Translate(-aState.borderPadding.left, 0); -} - -// Bit's for PlaceAndReflowChild return value -#define PLACE_FIT 0x1 -#define PLACE_FLOWED 0x2 - -PRIntn -nsBlockFrame::PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC) -{ - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = - (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - - // Get line start setup if we are at the start of a new line - if (nsnull == aState.lineStart) { - NS_ASSERTION(0 == aState.lineLength, "bad line length"); - aState.lineStart = aKidFrame; - } - - // Get kid and its style - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - - // Figure out if kid is a block element or not - PRBool isInline = PR_TRUE; - PRIntn display = styleDisplay->mDisplay; - if (aState.firstChildIsInsideBullet && (mFirstChild == aKidFrame)) { - // XXX Special hack for properly reflowing bullets that have the - // inside value for list-style-position. - display = NS_STYLE_DISPLAY_INLINE; - } - if ((NS_STYLE_DISPLAY_BLOCK == display) || - (NS_STYLE_DISPLAY_LIST_ITEM == display)) { - // Block elements always end up on the next line (unless they are - // already at the start of the line). - isInline = PR_FALSE; - if (aState.lineLength > 0) { - aState.breakAfterChild = PR_TRUE; - } - } - - // Handle forced break first - if (aState.breakAfterChild) { - NS_ASSERTION(aState.lineStart != aKidFrame, "bad line"); - - // Get the last child in the current line - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - if (!AdvanceToNextLine(aCX, aState)) { - // The previous line didn't fit. - return 0; - } - aState.lineStart = aKidFrame; - - // Get the style for the last child, and see if it wanted to clear - // floaters. This handles the BR tag, which is the only inline - // element for which clear applies - nsIStyleContextPtr lastChildSC; - - lastFrame->GetStyleContext(aCX, lastChildSC.AssignRef()); - nsStyleDisplay* lastChildDisplay = (nsStyleDisplay*) - lastChildSC->GetData(kStyleDisplaySID); - switch (lastChildDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, lastChildDisplay->mBreakType); - break; - } - } - - // Now that we've handled force breaks (and maybe called AdvanceToNextLine() - // which checks), remember whether it's an inline frame - aState.isInline = isInline; - - // If we're at the beginning of a line then compute the top margin that we - // should use - if (aState.lineStart == aKidFrame) { - // Compute the top margin to use for this line - aState.topMargin = GetTopMarginFor(aCX, aState, aKidFrame, aKidSC, - aState.isInline); - - // If it's an inline element then get a band of available space - // - // XXX If we have a current band and there's unused space in that band - // then avoid this call to get a band... - if (aState.isInline) { - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - } - } - - // Compute the available space to reflow the child into and then - // reflow it into that space. - nsSize kidAvailSize; - GetAvailSize(kidAvailSize, aState, aKidSC, aState.isInline); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - - ReflowStatus status; - - if (aState.isInline) { - nsReflowMetrics kidSize; - - // Inline elements are never passed the space manager - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - NS_ASSERTION(nsnull != aState.lineStart, "bad line start"); - - if (aKidFrame == aState.lineStart) { - // Width always fits when we are at the logical left margin. - // Just check the height. - // - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall - return PLACE_FLOWED; - } - } else { - // Examine state and if the breakBeforeChild is set and we - // aren't already on the new line, do the forcing now. - // XXX Why aren't we doing this check BEFORE we resize reflow the child? - if (aState.breakBeforeChild) { - aState.breakBeforeChild = PR_FALSE; - if (aKidFrame != aState.lineStart) { - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow child now that it has the line to itself - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - } - } - - // When we are not at the logical left margin then we need - // to check the width first. If we are too wide then advance - // to the next line and try reflowing again. - if (kidSize.width > kidAvailSize.width) { - // Too wide. Try next line - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow splittable children - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable != frNotSplittable) { - // Update size info now that we are on the next line. Then - // reflow the child into the new available space. - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - } - - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall on the next line - return PLACE_FLOWED; - } - // It's ok if it's too wide on the next line. - } - } - } - - // Add child to the line - AddInlineChildToLine(aCX, aState, aKidFrame, kidSize, - pKidMaxElementSize, aKidSC); - } else { - nsRect kidRect; - - // Does the block-level element want to clear any floaters that impact - // it? Note that the clear property only applies to block-level elements - // and the BR tag - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - switch (styleDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, styleDisplay->mBreakType); - GetAvailSize(kidAvailSize, aState, aKidSC, PR_FALSE); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - break; - } - - // Give the block its own local coordinate space.. Note: ReflowChild() - // will adjust for the child's left/right margin after determining the - // current left/right edge - aState.spaceManager->Translate(aState.borderPadding.left, 0); - // Give the block-level element the opportunity to use the space manager - status = ReflowChild(aKidFrame, aCX, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - // Block elements always fit horizontally (because they are - // always placed at the logical left margin). Check to see if - // the block fits vertically - if (kidRect.YMost() > kidAvailSize.height) { - // Nope - return PLACE_FLOWED; - } - } - - // Add block child - // XXX We need to set lastContentIsComplete here, because AddBlockChild() - // calls AdvaneceToNextLine(). We need to restructure the flow of control, - // and use a state machine... - aState.lastContentIsComplete = PRBool(status == frComplete); - AddBlockChild(aCX, aState, aKidFrame, kidRect, pKidMaxElementSize, aKidSC); - } - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - - aState.lastContentIsComplete = PRBool(status == frComplete); - if (aState.isInline && (frNotComplete == status)) { - // Since the inline child didn't complete its reflow we *know* - // that a continuation of it can't possibly fit on the current - // line. Therefore, set a flag in the state that will cause the - // a line break before the next frame is placed. - aState.breakAfterChild = PR_TRUE; - } - - aState.reflowStatus = status; - return PLACE_FLOWED | PLACE_FIT; -} - -/** - * Reflow the existing frames. - * - * @param aCX presentation context to use - * @param aState in out parameter which tracks the state of - * reflow for the block frame. - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool -nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsIFrame* kidFrame; - - for (kidFrame = mFirstChild; nsnull != kidFrame; ) { - - /* we get the kid's style from kidFrame's cached style context */ - nsIStyleContextPtr kidSC; - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - - // Attempt to place and reflow the child - - // XXX if child is not splittable and it fits just place it where - // it is, otherwise advance to the next line and place it there if - // possible - - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - ReflowStatus status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // The child doesn't fit. Push it and any remaining children. - PushKids(aState); - result = PR_FALSE; - goto push_done; - } - - // Is the child complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - // Yes, the child is complete - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else { - // No the child isn't complete - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Unlike the inline frame code we can't assume that we used - // up all of our space because the child's reflow status is - // frNotComplete. Instead, the child is probably split and - // we need to reflow the continuations as well. - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - } - - push_done: -#ifdef NS_DEBUG - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - - PRInt32 len = LengthOf(mFirstChild); - NS_POSTCONDITION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -/* XXX: - * In this method, we seem to be getting the style for the next child, - * and checking that child's style for the child's display type. - * The problem is that it's very inefficient to ResolveStyleFor(kid) here - * and then just throw it away, when we end up doing a ResolveStyleFor(kid) - * again when we actually create a frame for the content. - * It would be nice to cache the resolved style, maybe in the reflow state? - */ -PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) -{ - PRBool rv = PR_FALSE; - if (IsPseudoFrame()) { - // Get the next content object that we would like to reflow - PRInt32 kidIndex = NextChildOffset(); - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNotNull()) { - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - switch (kidStyleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block pseudo-frames do not contain other block elements - break; - - default: - rv = PR_TRUE; - break; - } - } - } else { - if (NextChildOffset() < mContent->ChildCount()) { - rv = PR_TRUE; - } - } - return rv; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aCX presentation context to use - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsBlockFrame* prev = (nsBlockFrame*) mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - mFirstContentOffset = prev->NextChildOffset(); - if (PR_FALSE == prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time until we are out of children - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (nsnull == kidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // If we're being used as a pseudo frame, i.e. we map the same - // content as our parent then we want to indicate we're complete; - // otherwise we'll be continued and go on mapping children... - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - result = frComplete; - goto done; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aCX); - kidFrame = kidDel->CreateFrame(aCX, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidSC); - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - kidPrevInFlow->CreateContinuingFrame(aCX, this, kidFrame); - } - - // Link child frame into the list of children. If the frame ends - // up not fitting and getting pushed, the PushKids code will fixup - // the child count for us. - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - - // Reflow child frame as many times as necessary until it is - // complete. - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // We ran out of room. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - goto push_done; - } - - // Did the child complete? - prevKidFrame = kidFrame; - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "huh?"); -#endif - } while (frNotComplete == status); - - // The child that we just reflowed is complete -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); -#endif - kidIndex++; - kidPrevInFlow = nsnull; - } - - done: - // To get here we either completely reflowed all our appended - // children OR we are a pseudo-frame and we ran into a block - // element. In either case our last content MUST be complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - - push_done: -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Pullup frames from our next in flow and try to place them. Before - * this is called our previously mapped children, if any have been - * reflowed which means that the block reflow state's x and y - * coordinates and other data are ready to go. - * - * Return true if we pulled everything up. - */ -PRBool -nsBlockFrame::PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsBlockFrame* nextInFlow = (nsBlockFrame*) mNextInFlow; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - while (nsnull != nextInFlow) { - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (nsBlockFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get style information for the pulled up kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // Push the kids that didn't fit back down to the next-in-flow - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - result = PR_FALSE; - goto push_done; - } - - if (frNotComplete == status) { - // Child is not complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // Create a continuing frame for the incomplete child - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - } - - if (nsnull != prevKidFrame) { - // The only way we can get here is by pulling up every last child - // in our next-in-flows (and reflowing any continunations they - // have). Therefore we KNOW that our last child is complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - push_done:; - - if (result == PR_FALSE) { - // If our next-in-flow is empty OR our next next-in-flow is empty - // then adjust the offsets of all of the empty next-in-flows. - nextInFlow = (nsBlockFrame*) mNextInFlow; - if ((0 == nextInFlow->mChildCount) || - ((nsnull != nextInFlow->mNextInFlow) && - (0 == ((nsBlockFrame*)(nextInFlow->mNextInFlow))->mChildCount))) { - // We didn't pullup everything and we need to fixup one of our - // next-in-flows content offsets. - AdjustOffsetOfEmptyNextInFlows(); - } - } - - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -void nsBlockFrame::SetupState(nsIPresContext* aCX, - nsBlockReflowState& aState, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager) -{ - // Setup reflow state - aState.Init(aMaxSize, aMaxElementSize, mStyleContext, aSpaceManager); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - - // Apply border and padding adjustments for regular frames only - if (PR_FALSE == IsPseudoFrame()) { - aState.borderPadding = mySpacing->mBorderPadding; - aState.y = mySpacing->mBorderPadding.top; - aState.availSize.width -= - (mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right); - aState.availSize.height -= - (mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom); - } else { - aState.borderPadding.SizeTo(0, 0, 0, 0); - } - - // Setup initial list ordinal value - nsIAtom* tag = mContent->GetTag(); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - nsHTMLValue value; - if (eContentAttr_HasValue == - ((nsIHTMLContent*)mContent)->GetAttribute(nsHTMLAtoms::start, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - aState.nextListOrdinal = value.GetIntValue(); - } - } - } - NS_RELEASE(tag); - - mCurrentState = &aState; -} - -#include "nsUnitConversion.h"/* XXX */ -NS_METHOD nsBlockFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - return DoResizeReflow(aCX, state, aDesiredRect, aStatus); -} - -nsresult nsBlockFrame::DoResizeReflow(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height)); - DumpFlow(); -#endif - - // Zap old line data - if (nsnull != mLines) { - delete mLines; - mLines = nsnull; - } - mNumLines = 0; - - // Check for an overflow list - MoveOverflowToChildList(); - - // Before we start reflowing, cache a pointer to our state structure - // so that inline frames can find it. - nsIPresShell* shell = aCX->GetShell(); - shell->PutCachedData(this, &aState); - - // First reflow any existing frames - PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aCX, aState); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } - - if (reflowMappedOK) { - // Any space left? - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if ((nsnull != mFirstChild) && (aState.y >= yb)) { - // No space left. Don't try to pull-up children or reflow - // unmapped. We need to return the correct completion status, - // so see if there is more to reflow. - if (MoreToReflow(aCX)) { - aStatus = frNotComplete; - } - } else if (MoreToReflow(aCX)) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || PullUpChildren(aCX, aState)) { - // If we still have unmapped children then create some new frames - if (MoreToReflow(aCX)) { - aStatus = ReflowAppendedChildren(aCX, aState); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Deal with last line - make sure it gets vertically and - // horizontally aligned. This also updates the state's y coordinate - // which is good because that's how we size ourselves. - if (0 != aState.lineLength) { - if (!AdvanceToNextLine(aCX, aState)) { - // The last line of output doesn't fit. Push all of the kids to - // the next in flow and change our reflow status to not complete - // so that we are continued. -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids since last line doesn't fit\n"); -#endif - - PushKids(aState); - aStatus = frNotComplete; - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there is room for it. - nscoord margin = aState.prevMaxPosBottomMargin - - aState.prevMaxNegBottomMargin; - nscoord y = aState.y + margin; - if (y <= aState.borderPadding.top + aState.availSize.height) { - aState.y = y; - } - } - - // Now that reflow has finished, remove the cached pointer - shell->RemoveCachedData(this); - NS_RELEASE(shell); - - // Translate state.lineLengths into an integer array - mNumLines = aState.lineLengths.Count(); - if (mNumLines > 0) { - mLines = new PRInt32[mNumLines]; - for (PRInt32 i = 0; i < mNumLines; i++) { - PRInt32 ll = (PRInt32) aState.lineLengths.ElementAt(i); - mLines[i] = ll; - } - } - - if (!aState.unconstrainedWidth && aState.justifying) { - // Perform justification now that we know how many lines we have. - JustifyLines(aCX, aState); - } - - // Return our desired rect and our status - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = aState.kidXMost + aState.borderPadding.right; - if (!aState.unconstrainedWidth) { - // Make sure we're at least as wide as the max size we were given - nscoord maxWidth = aState.availSize.width + aState.borderPadding.left + - aState.borderPadding.right; - - if (aDesiredRect.width < maxWidth) { - aDesiredRect.width = maxWidth; - } - } - aState.y += aState.borderPadding.bottom; - aDesiredRect.height = aState.y; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g %scomplete [%d,%d,%c]\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height), - ((status == frNotComplete) ? "NOT " : ""), - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F') - ); - DumpFlow(); -#endif - mCurrentState = nsnull; - return NS_OK; -} - -void nsBlockFrame::JustifyLines(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - // XXX we don't justify the last line; what if we are continued, - // should we do it then? - nsIFrame* kid = mFirstChild; - for (PRInt32 i = 0; i < mNumLines; i++) { - nsIFrame* lineStart = kid; - PRInt32 lineLength = mLines[i]; - if (i < mNumLines - 1) { - if (1 == lineLength) { - // For lines with one element on them we can take a shortcut and - // let them do the justification. Note that we still call - // JustifyReflow even if the available space is zero in case the - // child is a hunk of text that ends in whitespace. The whitespace - // will be distributed elsewhere causing a proper flush right look - // for the last word. - nsRect r; - kid->GetRect(r); - nscoord maxWidth = aState.availSize.width; - nscoord availableSpace = maxWidth - r.width; - nscoord maxAvailSpace = nscoord(maxWidth * 0.1f); - if ((availableSpace >= 0) && (availableSpace < maxAvailSpace)) { - kid->JustifyReflow(aCX, availableSpace); - kid->SizeTo(r.width + availableSpace, r.height); - } - kid->GetNextSibling(kid); - } else { - // XXX Get justification of multiple elements working - while (--lineLength >= 0) { - kid->GetNextSibling(kid); - } - } - } - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - nsCSSLayout::RelativePositionChildren(aCX, this, lineStart, mLines[i]); - } -} - -NS_METHOD nsBlockFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittableNonRectangular; - return NS_OK; -} - -NS_METHOD nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD nsBlockFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - - if (aReflowCommand.GetTarget() == this) { - // XXX for now, just do a complete reflow mapped (it'll kinda - // work, but it's slow) - - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, nsnull, aSpaceManager); - PRBool reflowMappedOK = ReflowMappedChildren(aCX, state); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } else { - // XXX not yet implemented - NS_ABORT(); - // XXX work to compute initial state goes *HERE* - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = 0; - aDesiredRect.height = 0; - } - - mCurrentState = nsnull; - return NS_OK; -} - -PRBool nsBlockFrame::IsLeftMostChild(nsIFrame* aFrame) -{ - do { - nsIFrame* parent; - - aFrame->GetGeometricParent(parent); - - // See if there are any non-zero sized child frames that precede aFrame - // in the child list - nsIFrame* child; - - parent->FirstChild(child); - while ((nsnull != child) && (aFrame != child)) { - nsSize size; - - // Is the child zero-sized? - child->GetSize(size); - if ((size.width > 0) || (size.height > 0)) { - // We found a non-zero sized child frame that precedes aFrame - return PR_FALSE; - } - - child->GetNextSibling(child); - } - - // aFrame is the left-most non-zero sized frame in its geometric parent. - // Walk up one level and check that its parent is left-most as well - aFrame = parent; - } while (aFrame != this); - - return PR_TRUE; -} - -PRBool nsBlockFrame::AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // Get the frame associated with the space manager, and get its nsIAnchoredItems - // interface - nsIFrame* frame = mCurrentState->spaceManager->GetFrame(); - nsIAnchoredItems* anchoredItems = nsnull; - - frame->QueryInterface(kIAnchoredItemsIID, (void**)&anchoredItems); - NS_ASSERTION(nsnull != anchoredItems, "no anchored items interface"); - - if (nsnull != anchoredItems) { - anchoredItems->AddAnchoredItem(aFloater, nsIAnchoredItems::anHTMLFloater, this); - PlaceFloater(aCX, aFloater, aPlaceholder); - return PR_TRUE; - } - - return PR_FALSE; -} - -// XXX The size of the floater needs to be taken into consideration if we're -// computing a maximum element size -void nsBlockFrame::PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // If the floater is the left-most non-zero size child frame then insert - // it before the current line; otherwise add it to the below-current-line - // todo list and we'll handle it when we flush out the line - if (IsLeftMostChild(aPlaceholder)) { - // Get the type of floater - nsIStyleContextPtr styleContext; - - aFloater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* floaterDisplay = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - if (!mCurrentState->isInline) { - // Get the current band for this line - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } - - // Commit some space in the space manager - nsRect region; - - aFloater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == floaterDisplay->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == floaterDisplay->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, 0); - mCurrentState->spaceManager->AddRectRegion(region, aFloater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - aFloater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - - // Update the band of available space to reflect space taken up by the floater - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } else { - // Add the floater to our to-do list - mCurrentState->floaterToDo.AppendElement(aFloater); - } -} - -NS_METHOD nsBlockFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last-in-flow - nsBlockFrame* flow = (nsBlockFrame*)GetLastInFlow(); - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - -#if 0 - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Is it a floater? - if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - // Create initial frame for the child - nsIContentDelegate* kidDel; - nsresult fr; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // Update last content offset now that we are done drawing - // children from our parent. - SetLastContentOffset(prevKidFrame); - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - return NS_OK; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - } - kidFrame->SetStyleContext(kidSC); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - kidIndex++; - mChildCount++; - } - SetLastContentOffset(prevKidFrame); -#endif - - // If this is a pseudo-frame then our parent will generate the - // reflow command. Otherwise, if the container is us then we should - // generate the reflow command because we were directly called. - if (!IsPseudoFrame() && (aContainer == mContent)) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} - -PRIntn nsBlockFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - -nsHTMLFrameType nsBlockFrame::GetFrameType() const -{ - return eHTMLFrame_Block; -} - -NS_METHOD nsBlockFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fprintf(out, "*block<"); - nsIAtom* atom = mContent->GetTag(); - if (nsnull != atom) { - nsAutoString tmp; - atom->ToString(tmp); - fputs(tmp, out); - } - fprintf(out, ">(%d)@%p", mIndexInParent, this); - } else { - nsHTMLContainerFrame::ListTag(out); - } - return NS_OK; -} - -#ifdef NS_DEBUG -void nsBlockFrame::DumpFlow() const -{ -#ifdef NOISY_FLOW - nsBlockFrame* flow = (nsBlockFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsBlockFrame*) flow->mNextInFlow; - } -#endif -} -#endif diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h deleted file mode 100644 index f11bba52ca1..00000000000 --- a/mozilla/layout/generic/nsBlockFrame.h +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsBlockFrame_h___ -#define nsBlockFrame_h___ - -#include "nsHTMLContainerFrame.h" -#include "nsIFloaterContainer.h" -#include "nsIHTMLFrameType.h" -#include "nsIRunaround.h" -#include "nsVoidArray.h" -struct BlockBandData; -struct nsMargin; -struct nsStyleDisplay; -struct nsStyleFont; -struct nsStyleText; - -/** - * Block frames have some state which needs to be made - * available to child frames for proper reflow. This structure - * describes that state. - */ -struct nsBlockReflowState { - // True if this is the first line of text in a block container - PRPackedBool firstLine; - - // True if leading whitespace is allowed to show - PRPackedBool allowLeadingWhitespace; - - // This is set when some child frame needs a break after it's placed - PRPackedBool breakAfterChild; - - // This is set when a child needs a break before it's placed. Note - // that this value is set by a child AFTER we have called it's - // ResizeReflow method. - PRPackedBool breakBeforeChild; - - // This is set when the first child should be treated specially - // because it's an inside list item bullet. - // XXX this can go away once we have a way for the bullet's style - // molecule to *not* be the same as it's parent's - PRPackedBool firstChildIsInsideBullet; - - // For pre-formatted text, this is our current column - PRIntn column; - - // The next list ordinal value - PRInt32 nextListOrdinal; - - //---------------------------------------------------------------------- - // State from here on down is not to be used by block child frames! - - // Space manager to use - nsISpaceManager* spaceManager; - - // Block's style context - nsIStyleContext* styleContext; - nsStyleText* styleText; - nsStyleFont* styleFont; - nsStyleDisplay* styleDisplay; - - // Block's available size (computed from the block's parent) - nsSize availSize; - - // Current band of available space. Used for doing runaround - BlockBandData* currentBand; - - // Pointer to a max-element-size (nsnull if none required) - nsSize* maxElementSize; - - // The maximum x-most of our lines and block-level elements. This is used to - // compute our desired size, and includes our left border/padding. For block- - // level elements this also includes the block's right margin. - nscoord kidXMost; - - // Current reflow position - nscoord y; - - // Current line state - nscoord x; // inline elements only. not include border/padding - PRBool isInline; // whether the current is inline or block - nsVoidArray lineLengths; // line length temporary storage - PRIntn currentLineNumber; // index into mLines - nsIFrame* lineStart; // frame starting the line - PRInt32 lineLength; // length of line - nscoord* ascents; // ascent information for each child - nscoord maxAscent; // max ascent for this line - nscoord maxDescent; // max descent for this line - nscoord lineWidth; // current width of line -#if 0 - nscoord maxPosTopMargin; // maximum positive top margin - nscoord maxNegTopMargin; // maximum negative top margin -#else - nscoord topMargin; // current top margin -#endif - nscoord maxPosBottomMargin; // maximum positive bottom margin - nscoord maxNegBottomMargin; // maximum negative bottom margin - nsSize lineMaxElementSize; // max element size for current line - PRBool lastContentIsComplete; // reflow status of last child on line - nsVoidArray floaterToDo; // list of floaters to place below current line - - PRInt32 maxAscents; // size of ascent buffer - nscoord ascentBuf[20]; - - PRPackedBool needRelativePos; // some kid in line needs relative pos - - // Previous line state that we carry forward to the next line - nsIFrame* prevLineLastFrame; - nscoord prevLineHeight; // height of the previous line - nscoord prevMaxPosBottomMargin; // maximum posative bottom margin - nscoord prevMaxNegBottomMargin; // maximum negative bottom margin - PRBool prevLineLastContentIsComplete; - - // Sanitized version of mol->borderPadding; if this block frame is a - // pseudo-frame then the margin will be zero'd. - nsMargin borderPadding; - - PRPackedBool justifying; // we are justifying - - // Status from last PlaceAndReflowChild - nsIFrame::ReflowStatus reflowStatus; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - nsBlockReflowState(); - - ~nsBlockReflowState(); - - void Init(const nsSize& aMaxSize, nsSize* aMaxElementSize, - nsIStyleContext* aStyleContext, nsISpaceManager* aSpaceManager); - - void AddAscent(nscoord aAscent); - void AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, nscoord aPrevLineHeight); - -#ifdef NS_DEBUG - void DumpLine(); - void DumpList(); -#endif -}; - -//---------------------------------------------------------------------- - -/** - *

    Block Reflow

    - * - * The block frame reflow machinery performs "2D" layout. Inline - * elements are flowed into logical lines (left to right or right to - * left) and the lines are stacked vertically. Block elements are - * flowed onto their own line after flushing out any preceeding line.

    - * - * After a line is ready to be flushed out, vertical alignment is - * performed. Vertical alignment may require the line to consume more - * vertical space than is available thus causing the entire line to - * be pushed.

    - * - * After vertical alignment is done, horizontal alignment (including - * justification) is performed. Finally, relative positioning is done - * on any elements that require it.

    - * - * During reflow, the block frame will make available to child frames - * it's reflow state using the presentation shell's cached data - * mechanism.

    - * - *

    Reflowing Mapped Content

    - *

    Pullup

    - *

    Reflowing Unmapped Content

    - *

    Content Insertion Handling

    - *

    Content Deletion Handling

    - *

    Style Change Handling

    - * - *

    Assertions

    - * mLastContentIsComplete always reflects the state of the last - * child frame on our chlid list. - */ -class nsBlockFrame : public nsHTMLContainerFrame, public nsIHTMLFrameType, - public nsIRunaround, public nsIFloaterContainer -{ -public: - /** - * Create a new block frame that maps the given piece of content. - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer); - - NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const; - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - virtual PRBool AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder); - virtual void PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder); - - NS_IMETHOD ListTag(FILE* out = stdout) const; - - virtual nsHTMLFrameType GetFrameType() const; - -protected: - nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsBlockFrame(); - - virtual PRIntn GetSkipSides() const; - - PRBool MoreToReflow(nsIPresContext* aCX); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline); - - PRBool AdvanceToNextLine(nsIPresContext* aPresContext, - nsBlockReflowState& aState); - - void AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC); - - void AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC); - - void GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline); - - PRIntn PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* kidFrame, - nsIStyleContext* aKidSC); - - void PushKids(nsBlockReflowState& aState); - - void SetupState(nsIPresContext* aCX, nsBlockReflowState& aState, - const nsSize& aMaxSize, nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager); - - nsresult DoResizeReflow(nsIPresContext* aPresContext, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus); - - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - nsBlockReflowState& aState); - - PRBool PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState); - - ReflowStatus ReflowAppendedChildren(nsIPresContext* aPresContext, - nsBlockReflowState& aState); - - void JustifyLines(nsIPresContext* aPresContext, nsBlockReflowState& aState); - - PRBool IsLeftMostChild(nsIFrame* aFrame); - - void GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY); - - void PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY); - - void ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear); - -#ifdef NS_DEBUG - void DumpFlow() const; -#endif - - /** - * Array of lines lengths. For each logical line of children, this array - * contains a count of the number of children on the line. - */ - PRInt32* mLines; - PRInt32 mNumLines; - nsBlockReflowState* mCurrentState; -}; - -#endif /* nsBlockFrame_h___ */ diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp deleted file mode 100644 index 6b45fe72cab..00000000000 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ /dev/null @@ -1,2184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBlockFrame.h" -#include "nsSize.h" -#include "nsIAnchoredItems.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsMargin.h" -#include "nsHTMLIIDs.h" -#include "nsCSSLayout.h" -#include "nsCRT.h" -#include "nsIPresShell.h" -#include "nsReflowCommand.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsAbsoluteFrame.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct BlockBandData : public nsBandData { - nsBandTrapezoid data[12]; - - // Bounding rect of available space between any left and right floaters - nsRect availSpace; - - // Constructor - BlockBandData() {size = 12; trapezoids = data;} - - // Computes the bounding rect of the available space, i.e. space between - // any left and right floaters - // - // Uses the current trapezoid data, see nsISpaceManager::GetBandData(). - // Updates member data "availSpace" - void ComputeAvailSpaceRect(); -}; - -void BlockBandData::ComputeAvailSpaceRect() -{ - nsBandTrapezoid* trapezoid = data; - - if (count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < count; i++) { - nsBandTrapezoid* trapezoid = &data[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &data[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availSpace); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availSpace); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availSpace.x = availSpace.XMost(); - } - availSpace.width = 0; - } -} - -// XXX Bugs -// 1. right to left reflow can generate negative x coordinates. - -// XXX Speedup idea (all containers) - -// If I reflow a child and it gives back not-complete status then -// there is no sense in trying to pullup children. For blocks, it's a -// little more complicated unless the child is a block - if the child -// is a block, then we must be out of room hence we should stop. If -// the child is not a block then our line should be flushed (see #2 -// below) if our line is already empty then we must be out of room. - -// For inline frames and column frames, if we reflow a child and get -// back not-complete status then we should bail immediately because we -// are out of room. - -// XXX Speedup ideas: -// 1. change pullup code to use line information from next in flow -// 2. we can advance to next line immediately after reflowing something -// and noticing that it's not complete. -// 3. pass down last child information in aState so that pullup, etc., -// don't need to recompute it - -// XXX TODO: -// 0. Move justification into line flushing code - -// 1. To get ebina margins I need "auto" information from the style -// system margin's. A bottom/top margin of auto will then be computed like -// ebina computes it [however the heck that is]. - -// 2. kicking out floaters and talking with floater container to adjust -// left and right margins - -nsBlockReflowState::nsBlockReflowState() -{ -} - -void nsBlockReflowState::Init(const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsIStyleContext* aBlockSC, - nsISpaceManager* aSpaceManager) -{ - firstLine = PR_TRUE; - allowLeadingWhitespace = PR_FALSE; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - firstChildIsInsideBullet = PR_FALSE; - nextListOrdinal = -1; - column = 0; - - spaceManager = aSpaceManager; - currentBand = new BlockBandData; - - styleContext = aBlockSC; - styleText = (nsStyleText*) aBlockSC->GetData(kStyleTextSID); - styleFont = (nsStyleFont*) aBlockSC->GetData(kStyleFontSID); - styleDisplay = (nsStyleDisplay*) aBlockSC->GetData(kStyleDisplaySID); - - justifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == styleText->mTextAlign) && - (NS_STYLE_WHITESPACE_PRE != styleText->mWhiteSpace); - - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - maxElementSize = aMaxElementSize; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - kidXMost = 0; - x = 0; - y = 0; - - isInline = PR_FALSE; - currentLineNumber = 0; - lineStart = nsnull; - lineLength = 0; - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; - lineMaxElementSize.width = 0; - lineMaxElementSize.height = 0; - lastContentIsComplete = PR_TRUE; - - maxAscents = sizeof(ascentBuf) / sizeof(ascentBuf[0]); - needRelativePos = PR_FALSE; - - prevLineLastFrame = nsnull; - prevLineHeight = 0; - topMargin = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - prevLineLastContentIsComplete = PR_TRUE; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - reflowStatus = nsIFrame::frNotComplete; -} - -nsBlockReflowState::~nsBlockReflowState() -{ - if (ascents != ascentBuf) { - delete ascents; - } - delete currentBand; -} - -void nsBlockReflowState::AddAscent(nscoord aAscent) -{ - NS_PRECONDITION(lineLength <= maxAscents, "bad line length"); - if (lineLength == maxAscents) { - maxAscents *= 2; - nscoord* newAscents = new nscoord[maxAscents]; - if (nsnull != newAscents) { - nsCRT::memcpy(newAscents, ascents, sizeof(nscoord) * lineLength); - if (ascents != ascentBuf) { - delete ascents; - } - ascents = newAscents; - } else { - // Yikes! Out of memory! - return; - } - } - ascents[lineLength] = aAscent; -} - -void nsBlockReflowState::AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, - nscoord aPrevLineHeight) -{ - firstLine = PR_FALSE; - allowLeadingWhitespace = PR_FALSE; - column = 0; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - lineStart = nsnull; - lineLength = 0; - currentLineNumber++; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - needRelativePos = PR_FALSE; - - prevLineLastFrame = aPrevLineLastFrame; - prevLineHeight = aPrevLineHeight; - prevMaxPosBottomMargin = maxPosBottomMargin; - prevMaxNegBottomMargin = maxNegBottomMargin; - - // Remember previous line's lastContentIsComplete - prevLineLastContentIsComplete = lastContentIsComplete; - lastContentIsComplete = PR_TRUE; - - topMargin = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; -} - -#ifdef NS_DEBUG -void nsBlockReflowState::DumpLine() -{ - nsIFrame* f = lineStart; - PRInt32 ll = lineLength; - while (--ll >= 0) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} - -void nsBlockReflowState::DumpList() -{ - nsIFrame* f = lineStart; - while (nsnull != f) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} -#endif - -//---------------------------------------------------------------------- - -nsresult nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBlockFrame::nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsBlockFrame::~nsBlockFrame() -{ - if (nsnull != mLines) { - delete mLines; - } -} - -nsresult -nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLFrameTypeIID)) { - *aInstancePtr = (void*) ((nsIHTMLFrameType*) this); - return NS_OK; - } else if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void*) ((nsIRunaround*) this); - return NS_OK; - } else if (aIID.Equals(kIFloaterContainerIID)) { - *aInstancePtr = (void*) ((nsIFloaterContainer*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Computes the top margin to use for this child frames based on its display -// type and the display type of the previous child frame. -// -// Adjacent vertical margins between block-level elements are collapsed. -nscoord nsBlockFrame::GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - if (aIsInline) { - // Just use whatever the previous bottom margin was - return aState.prevMaxPosBottomMargin - aState.prevMaxNegBottomMargin; - } else { - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - if (ss->mMargin.top < 0) { - maxNegTopMargin = -ss->mMargin.top; - } else { - maxPosTopMargin = ss->mMargin.top; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - return maxPos - maxNeg; - } else { - return 0; - } - } -} - -void nsBlockFrame::PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY) -{ - NS_PRECONDITION(aState.floaterToDo.Count() > 0, "no floaters"); - - // XXX Factor this code with PlaceFloater()... - PRInt32 numFloaters = aState.floaterToDo.Count(); - - for (PRInt32 i = 0; i < numFloaters; i++) { - nsIFrame* floater = (nsIFrame*)aState.floaterToDo[i]; - nsRect region; - - // Get the band of available space - // XXX This is inefficient to do this inside the loop... - GetAvailableSpaceBand(aState, aY); - - // Get the type of floater - nsIStyleContextPtr styleContext; - - floater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* sd = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - floater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == sd->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == sd->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, - 0); - mCurrentState->spaceManager->AddRectRegion(region, floater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - floater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - } - aState.floaterToDo.Clear(); -} - -/** - * Flush a line out. Return true if the line fits in our available - * height. If the line does not fit then return false. When the line - * fits we advance the y coordinate, reset the x coordinate and - * prepare the nsBlockReflowState for the next line. - */ -PRBool nsBlockFrame::AdvanceToNextLine(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - NS_PRECONDITION(aState.lineLength > 0, "bad line"); - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nscoord y = aState.y + aState.topMargin; - nscoord lineHeight; - - if (aState.isInline) { - // Vertically align the children on this line, returning the height of - // the line upon completion. - lineHeight = nsCSSLayout::VerticallyAlignChildren(aCX, this, - aState.styleFont, - y, - aState.lineStart, - aState.lineLength, - aState.ascents, - aState.maxAscent); - - // Any below current line floaters to place? - if (aState.floaterToDo.Count() > 0) { - PlaceBelowCurrentLineFloaters(aCX, aState, y + lineHeight); - // XXX Factor in the height of the floaters as well when considering - // whether the line fits. - // The default policy is that if there isn't room for the floaters then - // both the line and the floaters are pushed to the next-in-flow... - } - } else { - nsSize size; - - aState.lineStart->GetSize(size); - lineHeight = size.height; - } - - // The first line always fits - if (aState.currentLineNumber > 0) { - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if (y + lineHeight > yb) { - // After vertical alignment of the children and factoring in the - // proper margin, the line doesn't fit. - return PR_FALSE; - } - } - - if (aState.isInline) { - // Check if the right-edge of the line exceeds our running x-most - nscoord xMost = aState.borderPadding.left + aState.lineWidth; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - } - - // Advance the y coordinate to the new position where the next - // line or block element will go. - aState.y = y + lineHeight; - aState.x = 0; - - // Now that the vertical alignment is done we can perform horizontal - // alignment and relative positioning. Skip all of these if we are - // doing an unconstrained (in x) reflow. There's no point in doing - // the work if we *know* we are going to reflowed again. - if (!aState.unconstrainedWidth) { - nsCSSLayout::HorizontallyPlaceChildren(aCX, this, aState.styleText, - aState.lineStart, aState.lineLength, - aState.lineWidth, - aState.availSize.width); - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - if (!aState.justifying) { - nsCSSLayout::RelativePositionChildren(aCX, this, - aState.lineStart, - aState.lineLength); - } - } - - // Record line length - aState.lineLengths.AppendElement((void*)aState.lineLength); - - // Find the last frame in the line - // XXX keep this as running state in the nsBlockReflowState - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - // Update maxElementSize - if (nsnull != aState.maxElementSize) { - nsSize& lineMax = aState.lineMaxElementSize; - nsSize* maxMax = aState.maxElementSize; - if (lineMax.width > maxMax->width) { - maxMax->width = lineMax.width; - } - if (lineMax.height > maxMax->height) { - maxMax->height = lineMax.height; - } - aState.lineMaxElementSize.width = 0; - aState.lineMaxElementSize.height = 0; - } - - // Advance to the next line - aState.AdvanceToNextLine(lastFrame, lineHeight); - - return PR_TRUE; -} - -/** - * Add an inline child to the current line. Advance various running - * values after placement. - */ -void nsBlockFrame::AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Place and size the child - // XXX add in left margin from kid - nsRect r; - r.y = aState.y; - r.width = aKidSize.width; - r.height = aKidSize.height; - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - // Left to right positioning. - r.x = aState.borderPadding.left + aState.x + ss->mMargin.left; - aState.x += aKidSize.width + ss->mMargin.left + ss->mMargin.right; - } else { - // Right to left positioning - // XXX what should we do when aState.x goes negative??? - r.x = aState.x - aState.borderPadding.right - ss->mMargin.right - - aKidSize.width; - aState.x -= aKidSize.width + ss->mMargin.right + ss->mMargin.left; - } - aKidFrame->SetRect(r); - aState.AddAscent(aKidSize.ascent); - aState.lineWidth += aKidSize.width; - aState.lineLength++; - - // Update maximums for the line - if (aKidSize.ascent > aState.maxAscent) { - aState.maxAscent = aKidSize.ascent; - } - if (aKidSize.descent > aState.maxDescent) { - aState.maxDescent = aKidSize.descent; - } - // Update running margin maximums - if (aState.firstChildIsInsideBullet && (aKidFrame == mFirstChild)) { - // XXX temporary code. Since the molecule for the bullet frame - // is the same as the LI frame, we get bad style information. - // ignore it. - } else { - nscoord margin; -#if 0 - // XXX CSS2 spec says that top/bottom margin don't affect line height - // calculation. We're waiting for clarification on this issue... - if ((margin = ss->mMargin.top) < 0) { - margin = -margin; - if (margin > aState.maxNegTopMargin) { - aState.maxNegTopMargin = margin; - } - } else { - if (margin > aState.maxPosTopMargin) { - aState.maxPosTopMargin = margin; - } - } -#endif - if ((margin = ss->mMargin.bottom) < 0) { - margin = -margin; - if (margin > aState.maxNegBottomMargin) { - aState.maxNegBottomMargin = margin; - } - } else { - if (margin > aState.maxPosBottomMargin) { - aState.maxPosBottomMargin = margin; - } - } - } - - // Update line max element size - nsSize& mes = aState.lineMaxElementSize; - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > mes.width) { - mes.width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > mes.height) { - mes.height = aKidMaxElementSize->height; - } - } -} - -// Places and sizes the block-level element, and advances the line. -// The rect is in the local coordinate space of the kid frame. -void nsBlockFrame::AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Translate from the kid's coordinate space to our coordinate space - aKidRect.x += aState.borderPadding.left + ss->mMargin.left; - aKidRect.y += aState.y + aState.topMargin; - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - aState.AddAscent(aKidRect.height); - aState.lineLength++; - - // Is this the widest child frame? - nscoord xMost = aKidRect.XMost() + ss->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // Update the max element size - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aKidMaxElementSize->height; - } - } - - // and the bottom line margin information which we'll use when placing - // the next child - if (ss->mMargin.bottom < 0) { - aState.maxNegBottomMargin = -ss->mMargin.bottom; - } else { - aState.maxPosBottomMargin = ss->mMargin.bottom; - } - - // Update the running y-offset - aState.y += aKidRect.height + aState.topMargin; - - // Apply relative positioning if necessary - nsCSSLayout::RelativePositionChildren(aCX, this, aKidFrame, 1); - - // Advance to the next line - aState.AdvanceToNextLine(aKidFrame, aKidRect.height); -} - -/** - * Compute the available size for reflowing the given child at the - * current x,y position in the state. Note that this may return - * negative or zero width/height's if we are out of room. - */ -void nsBlockFrame::GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - // Determine the maximum available reflow height for the child - nscoord yb = aState.borderPadding.top + aState.availSize.height; - aResult.height = aState.unconstrainedHeight ? NS_UNCONSTRAINEDSIZE : - yb - aState.y - aState.topMargin; - - // Determine the maximum available reflow width for the child - if (aState.unconstrainedWidth) { - aResult.width = NS_UNCONSTRAINEDSIZE; - } else if (aIsInline) { - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - aResult.width = aState.currentBand->availSpace.XMost() - aState.x; - } else { - aResult.width = aState.x - aState.currentBand->availSpace.x; - } - } else { - // It's a block. Don't adjust for the left/right margin here. That happens - // later on once we know the current left/right edge - aResult.width = aState.availSize.width; - } -} - -/** - * Push all of the kids that we have not reflowed, starting at - * aState.lineStart. aPrevKid is the kid previous to aState.lineStart - * and is also our last child. Note that line length is NOT a - * reflection of the number of children we are actually pushing - * (because we don't break the sibling list as we add children to the - * line). - */ -void nsBlockFrame::PushKids(nsBlockReflowState& aState) -{ - nsIFrame* prevFrame = aState.prevLineLastFrame; - NS_PRECONDITION(nsnull != prevFrame, "pushing all kids"); -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevFrame->GetNextSibling(nextSibling); - NS_PRECONDITION(nextSibling == aState.lineStart, "bad prev line"); -#endif - -#ifdef NS_DEBUG - PRInt32 numKids = LengthOf(mFirstChild); - NS_ASSERTION(numKids == mChildCount, "bad child count"); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": push kids (childCount=%d)\n", mChildCount); - DumpFlow(); -#endif - - PushChildren(aState.lineStart, prevFrame, mLastContentIsComplete); - SetLastContentOffset(prevFrame); - - // Set mLastContentIsComplete to the previous lines last content is - // complete now that the previous line's last child is our last - // child. - mLastContentIsComplete = aState.prevLineLastContentIsComplete; - - // Fix up child count - // XXX is there a better way? aState.lineLength doesn't work because - // we might be pushing more than just the pending line. - nsIFrame* kid = mFirstChild; - PRInt32 kids = 0; - while (nsnull != kid) { - kids++; - kid->GetNextSibling(kid); - } - mChildCount = kids; - - // Make sure we have no lingering line data - aState.lineLength = 0; - aState.lineStart = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d) [%c]\n", mChildCount, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif -} - -/** - * Gets a band of available space starting at the specified y-offset. Assumes - * the local coordinate space is currently set to the upper-left origin of the - * bounding rect - * - * Updates "currentBand" and "x" member data of the block reflow state - */ -void nsBlockFrame::GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY) -{ - // Gets a band of available space. - aState.spaceManager->Translate(aState.borderPadding.left, 0); - aState.spaceManager->GetBandData(aY, aState.availSize, *aState.currentBand); - - // Compute the bounding rect of the available space, i.e. space between any - // left and right floaters - aState.currentBand->ComputeAvailSpaceRect(); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - aState.x = aState.currentBand->availSpace.x; -} - -void nsBlockFrame::ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear) -{ - // Translate the coordinate space - aState.spaceManager->Translate(aState.borderPadding.left, 0); - -getBand: - nscoord y = aState.y + aState.topMargin; - PRBool isLeftFloater = PR_FALSE; - PRBool isRightFloater = PR_FALSE; - - // Get a band of available space - aState.spaceManager->GetBandData(y, aState.availSize, *aState.currentBand); - - // Scan the trapezoids looking for left and right floaters - nsBandTrapezoid* trapezoid = aState.currentBand->trapezoids; - for (PRInt32 i = 0; i < aState.currentBand->count; i++) { - // XXX Handle multiply occupied - if (nsBandTrapezoid::smOccupied == trapezoid->state) { - nsStyleDisplay* display; - - trapezoid->frame->GetStyleData(kStylePositionSID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - isLeftFloater = PR_TRUE; - } else if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - isRightFloater = PR_TRUE; - } - } - - trapezoid++; - } - - if (isLeftFloater) { - if ((aClear == NS_STYLE_CLEAR_LEFT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - if (isRightFloater) { - if ((aClear == NS_STYLE_CLEAR_RIGHT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - - aState.spaceManager->Translate(-aState.borderPadding.left, 0); -} - -// Bit's for PlaceAndReflowChild return value -#define PLACE_FIT 0x1 -#define PLACE_FLOWED 0x2 - -PRIntn -nsBlockFrame::PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC) -{ - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = - (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - - // Get line start setup if we are at the start of a new line - if (nsnull == aState.lineStart) { - NS_ASSERTION(0 == aState.lineLength, "bad line length"); - aState.lineStart = aKidFrame; - } - - // Get kid and its style - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - - // Figure out if kid is a block element or not - PRBool isInline = PR_TRUE; - PRIntn display = styleDisplay->mDisplay; - if (aState.firstChildIsInsideBullet && (mFirstChild == aKidFrame)) { - // XXX Special hack for properly reflowing bullets that have the - // inside value for list-style-position. - display = NS_STYLE_DISPLAY_INLINE; - } - if ((NS_STYLE_DISPLAY_BLOCK == display) || - (NS_STYLE_DISPLAY_LIST_ITEM == display)) { - // Block elements always end up on the next line (unless they are - // already at the start of the line). - isInline = PR_FALSE; - if (aState.lineLength > 0) { - aState.breakAfterChild = PR_TRUE; - } - } - - // Handle forced break first - if (aState.breakAfterChild) { - NS_ASSERTION(aState.lineStart != aKidFrame, "bad line"); - - // Get the last child in the current line - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - if (!AdvanceToNextLine(aCX, aState)) { - // The previous line didn't fit. - return 0; - } - aState.lineStart = aKidFrame; - - // Get the style for the last child, and see if it wanted to clear - // floaters. This handles the BR tag, which is the only inline - // element for which clear applies - nsIStyleContextPtr lastChildSC; - - lastFrame->GetStyleContext(aCX, lastChildSC.AssignRef()); - nsStyleDisplay* lastChildDisplay = (nsStyleDisplay*) - lastChildSC->GetData(kStyleDisplaySID); - switch (lastChildDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, lastChildDisplay->mBreakType); - break; - } - } - - // Now that we've handled force breaks (and maybe called AdvanceToNextLine() - // which checks), remember whether it's an inline frame - aState.isInline = isInline; - - // If we're at the beginning of a line then compute the top margin that we - // should use - if (aState.lineStart == aKidFrame) { - // Compute the top margin to use for this line - aState.topMargin = GetTopMarginFor(aCX, aState, aKidFrame, aKidSC, - aState.isInline); - - // If it's an inline element then get a band of available space - // - // XXX If we have a current band and there's unused space in that band - // then avoid this call to get a band... - if (aState.isInline) { - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - } - } - - // Compute the available space to reflow the child into and then - // reflow it into that space. - nsSize kidAvailSize; - GetAvailSize(kidAvailSize, aState, aKidSC, aState.isInline); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - - ReflowStatus status; - - if (aState.isInline) { - nsReflowMetrics kidSize; - - // Inline elements are never passed the space manager - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - NS_ASSERTION(nsnull != aState.lineStart, "bad line start"); - - if (aKidFrame == aState.lineStart) { - // Width always fits when we are at the logical left margin. - // Just check the height. - // - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall - return PLACE_FLOWED; - } - } else { - // Examine state and if the breakBeforeChild is set and we - // aren't already on the new line, do the forcing now. - // XXX Why aren't we doing this check BEFORE we resize reflow the child? - if (aState.breakBeforeChild) { - aState.breakBeforeChild = PR_FALSE; - if (aKidFrame != aState.lineStart) { - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow child now that it has the line to itself - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - } - } - - // When we are not at the logical left margin then we need - // to check the width first. If we are too wide then advance - // to the next line and try reflowing again. - if (kidSize.width > kidAvailSize.width) { - // Too wide. Try next line - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow splittable children - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable != frNotSplittable) { - // Update size info now that we are on the next line. Then - // reflow the child into the new available space. - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - } - - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall on the next line - return PLACE_FLOWED; - } - // It's ok if it's too wide on the next line. - } - } - } - - // Add child to the line - AddInlineChildToLine(aCX, aState, aKidFrame, kidSize, - pKidMaxElementSize, aKidSC); - } else { - nsRect kidRect; - - // Does the block-level element want to clear any floaters that impact - // it? Note that the clear property only applies to block-level elements - // and the BR tag - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - switch (styleDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, styleDisplay->mBreakType); - GetAvailSize(kidAvailSize, aState, aKidSC, PR_FALSE); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - break; - } - - // Give the block its own local coordinate space.. Note: ReflowChild() - // will adjust for the child's left/right margin after determining the - // current left/right edge - aState.spaceManager->Translate(aState.borderPadding.left, 0); - // Give the block-level element the opportunity to use the space manager - status = ReflowChild(aKidFrame, aCX, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - // Block elements always fit horizontally (because they are - // always placed at the logical left margin). Check to see if - // the block fits vertically - if (kidRect.YMost() > kidAvailSize.height) { - // Nope - return PLACE_FLOWED; - } - } - - // Add block child - // XXX We need to set lastContentIsComplete here, because AddBlockChild() - // calls AdvaneceToNextLine(). We need to restructure the flow of control, - // and use a state machine... - aState.lastContentIsComplete = PRBool(status == frComplete); - AddBlockChild(aCX, aState, aKidFrame, kidRect, pKidMaxElementSize, aKidSC); - } - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - - aState.lastContentIsComplete = PRBool(status == frComplete); - if (aState.isInline && (frNotComplete == status)) { - // Since the inline child didn't complete its reflow we *know* - // that a continuation of it can't possibly fit on the current - // line. Therefore, set a flag in the state that will cause the - // a line break before the next frame is placed. - aState.breakAfterChild = PR_TRUE; - } - - aState.reflowStatus = status; - return PLACE_FLOWED | PLACE_FIT; -} - -/** - * Reflow the existing frames. - * - * @param aCX presentation context to use - * @param aState in out parameter which tracks the state of - * reflow for the block frame. - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool -nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsIFrame* kidFrame; - - for (kidFrame = mFirstChild; nsnull != kidFrame; ) { - - /* we get the kid's style from kidFrame's cached style context */ - nsIStyleContextPtr kidSC; - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - - // Attempt to place and reflow the child - - // XXX if child is not splittable and it fits just place it where - // it is, otherwise advance to the next line and place it there if - // possible - - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - ReflowStatus status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // The child doesn't fit. Push it and any remaining children. - PushKids(aState); - result = PR_FALSE; - goto push_done; - } - - // Is the child complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - // Yes, the child is complete - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else { - // No the child isn't complete - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Unlike the inline frame code we can't assume that we used - // up all of our space because the child's reflow status is - // frNotComplete. Instead, the child is probably split and - // we need to reflow the continuations as well. - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - } - - push_done: -#ifdef NS_DEBUG - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - - PRInt32 len = LengthOf(mFirstChild); - NS_POSTCONDITION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -/* XXX: - * In this method, we seem to be getting the style for the next child, - * and checking that child's style for the child's display type. - * The problem is that it's very inefficient to ResolveStyleFor(kid) here - * and then just throw it away, when we end up doing a ResolveStyleFor(kid) - * again when we actually create a frame for the content. - * It would be nice to cache the resolved style, maybe in the reflow state? - */ -PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) -{ - PRBool rv = PR_FALSE; - if (IsPseudoFrame()) { - // Get the next content object that we would like to reflow - PRInt32 kidIndex = NextChildOffset(); - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNotNull()) { - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - switch (kidStyleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block pseudo-frames do not contain other block elements - break; - - default: - rv = PR_TRUE; - break; - } - } - } else { - if (NextChildOffset() < mContent->ChildCount()) { - rv = PR_TRUE; - } - } - return rv; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aCX presentation context to use - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsBlockFrame* prev = (nsBlockFrame*) mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - mFirstContentOffset = prev->NextChildOffset(); - if (PR_FALSE == prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time until we are out of children - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (nsnull == kidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // If we're being used as a pseudo frame, i.e. we map the same - // content as our parent then we want to indicate we're complete; - // otherwise we'll be continued and go on mapping children... - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - result = frComplete; - goto done; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aCX); - kidFrame = kidDel->CreateFrame(aCX, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidSC); - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - kidPrevInFlow->CreateContinuingFrame(aCX, this, kidFrame); - } - - // Link child frame into the list of children. If the frame ends - // up not fitting and getting pushed, the PushKids code will fixup - // the child count for us. - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - - // Reflow child frame as many times as necessary until it is - // complete. - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // We ran out of room. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - goto push_done; - } - - // Did the child complete? - prevKidFrame = kidFrame; - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "huh?"); -#endif - } while (frNotComplete == status); - - // The child that we just reflowed is complete -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); -#endif - kidIndex++; - kidPrevInFlow = nsnull; - } - - done: - // To get here we either completely reflowed all our appended - // children OR we are a pseudo-frame and we ran into a block - // element. In either case our last content MUST be complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - - push_done: -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Pullup frames from our next in flow and try to place them. Before - * this is called our previously mapped children, if any have been - * reflowed which means that the block reflow state's x and y - * coordinates and other data are ready to go. - * - * Return true if we pulled everything up. - */ -PRBool -nsBlockFrame::PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsBlockFrame* nextInFlow = (nsBlockFrame*) mNextInFlow; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - while (nsnull != nextInFlow) { - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (nsBlockFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get style information for the pulled up kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // Push the kids that didn't fit back down to the next-in-flow - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - result = PR_FALSE; - goto push_done; - } - - if (frNotComplete == status) { - // Child is not complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // Create a continuing frame for the incomplete child - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - } - - if (nsnull != prevKidFrame) { - // The only way we can get here is by pulling up every last child - // in our next-in-flows (and reflowing any continunations they - // have). Therefore we KNOW that our last child is complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - push_done:; - - if (result == PR_FALSE) { - // If our next-in-flow is empty OR our next next-in-flow is empty - // then adjust the offsets of all of the empty next-in-flows. - nextInFlow = (nsBlockFrame*) mNextInFlow; - if ((0 == nextInFlow->mChildCount) || - ((nsnull != nextInFlow->mNextInFlow) && - (0 == ((nsBlockFrame*)(nextInFlow->mNextInFlow))->mChildCount))) { - // We didn't pullup everything and we need to fixup one of our - // next-in-flows content offsets. - AdjustOffsetOfEmptyNextInFlows(); - } - } - - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -void nsBlockFrame::SetupState(nsIPresContext* aCX, - nsBlockReflowState& aState, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager) -{ - // Setup reflow state - aState.Init(aMaxSize, aMaxElementSize, mStyleContext, aSpaceManager); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - - // Apply border and padding adjustments for regular frames only - if (PR_FALSE == IsPseudoFrame()) { - aState.borderPadding = mySpacing->mBorderPadding; - aState.y = mySpacing->mBorderPadding.top; - aState.availSize.width -= - (mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right); - aState.availSize.height -= - (mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom); - } else { - aState.borderPadding.SizeTo(0, 0, 0, 0); - } - - // Setup initial list ordinal value - nsIAtom* tag = mContent->GetTag(); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - nsHTMLValue value; - if (eContentAttr_HasValue == - ((nsIHTMLContent*)mContent)->GetAttribute(nsHTMLAtoms::start, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - aState.nextListOrdinal = value.GetIntValue(); - } - } - } - NS_RELEASE(tag); - - mCurrentState = &aState; -} - -#include "nsUnitConversion.h"/* XXX */ -NS_METHOD nsBlockFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - return DoResizeReflow(aCX, state, aDesiredRect, aStatus); -} - -nsresult nsBlockFrame::DoResizeReflow(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height)); - DumpFlow(); -#endif - - // Zap old line data - if (nsnull != mLines) { - delete mLines; - mLines = nsnull; - } - mNumLines = 0; - - // Check for an overflow list - MoveOverflowToChildList(); - - // Before we start reflowing, cache a pointer to our state structure - // so that inline frames can find it. - nsIPresShell* shell = aCX->GetShell(); - shell->PutCachedData(this, &aState); - - // First reflow any existing frames - PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aCX, aState); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } - - if (reflowMappedOK) { - // Any space left? - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if ((nsnull != mFirstChild) && (aState.y >= yb)) { - // No space left. Don't try to pull-up children or reflow - // unmapped. We need to return the correct completion status, - // so see if there is more to reflow. - if (MoreToReflow(aCX)) { - aStatus = frNotComplete; - } - } else if (MoreToReflow(aCX)) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || PullUpChildren(aCX, aState)) { - // If we still have unmapped children then create some new frames - if (MoreToReflow(aCX)) { - aStatus = ReflowAppendedChildren(aCX, aState); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Deal with last line - make sure it gets vertically and - // horizontally aligned. This also updates the state's y coordinate - // which is good because that's how we size ourselves. - if (0 != aState.lineLength) { - if (!AdvanceToNextLine(aCX, aState)) { - // The last line of output doesn't fit. Push all of the kids to - // the next in flow and change our reflow status to not complete - // so that we are continued. -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids since last line doesn't fit\n"); -#endif - - PushKids(aState); - aStatus = frNotComplete; - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there is room for it. - nscoord margin = aState.prevMaxPosBottomMargin - - aState.prevMaxNegBottomMargin; - nscoord y = aState.y + margin; - if (y <= aState.borderPadding.top + aState.availSize.height) { - aState.y = y; - } - } - - // Now that reflow has finished, remove the cached pointer - shell->RemoveCachedData(this); - NS_RELEASE(shell); - - // Translate state.lineLengths into an integer array - mNumLines = aState.lineLengths.Count(); - if (mNumLines > 0) { - mLines = new PRInt32[mNumLines]; - for (PRInt32 i = 0; i < mNumLines; i++) { - PRInt32 ll = (PRInt32) aState.lineLengths.ElementAt(i); - mLines[i] = ll; - } - } - - if (!aState.unconstrainedWidth && aState.justifying) { - // Perform justification now that we know how many lines we have. - JustifyLines(aCX, aState); - } - - // Return our desired rect and our status - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = aState.kidXMost + aState.borderPadding.right; - if (!aState.unconstrainedWidth) { - // Make sure we're at least as wide as the max size we were given - nscoord maxWidth = aState.availSize.width + aState.borderPadding.left + - aState.borderPadding.right; - - if (aDesiredRect.width < maxWidth) { - aDesiredRect.width = maxWidth; - } - } - aState.y += aState.borderPadding.bottom; - aDesiredRect.height = aState.y; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g %scomplete [%d,%d,%c]\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height), - ((status == frNotComplete) ? "NOT " : ""), - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F') - ); - DumpFlow(); -#endif - mCurrentState = nsnull; - return NS_OK; -} - -void nsBlockFrame::JustifyLines(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - // XXX we don't justify the last line; what if we are continued, - // should we do it then? - nsIFrame* kid = mFirstChild; - for (PRInt32 i = 0; i < mNumLines; i++) { - nsIFrame* lineStart = kid; - PRInt32 lineLength = mLines[i]; - if (i < mNumLines - 1) { - if (1 == lineLength) { - // For lines with one element on them we can take a shortcut and - // let them do the justification. Note that we still call - // JustifyReflow even if the available space is zero in case the - // child is a hunk of text that ends in whitespace. The whitespace - // will be distributed elsewhere causing a proper flush right look - // for the last word. - nsRect r; - kid->GetRect(r); - nscoord maxWidth = aState.availSize.width; - nscoord availableSpace = maxWidth - r.width; - nscoord maxAvailSpace = nscoord(maxWidth * 0.1f); - if ((availableSpace >= 0) && (availableSpace < maxAvailSpace)) { - kid->JustifyReflow(aCX, availableSpace); - kid->SizeTo(r.width + availableSpace, r.height); - } - kid->GetNextSibling(kid); - } else { - // XXX Get justification of multiple elements working - while (--lineLength >= 0) { - kid->GetNextSibling(kid); - } - } - } - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - nsCSSLayout::RelativePositionChildren(aCX, this, lineStart, mLines[i]); - } -} - -NS_METHOD nsBlockFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittableNonRectangular; - return NS_OK; -} - -NS_METHOD nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD nsBlockFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - - if (aReflowCommand.GetTarget() == this) { - // XXX for now, just do a complete reflow mapped (it'll kinda - // work, but it's slow) - - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, nsnull, aSpaceManager); - PRBool reflowMappedOK = ReflowMappedChildren(aCX, state); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } else { - // XXX not yet implemented - NS_ABORT(); - // XXX work to compute initial state goes *HERE* - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = 0; - aDesiredRect.height = 0; - } - - mCurrentState = nsnull; - return NS_OK; -} - -PRBool nsBlockFrame::IsLeftMostChild(nsIFrame* aFrame) -{ - do { - nsIFrame* parent; - - aFrame->GetGeometricParent(parent); - - // See if there are any non-zero sized child frames that precede aFrame - // in the child list - nsIFrame* child; - - parent->FirstChild(child); - while ((nsnull != child) && (aFrame != child)) { - nsSize size; - - // Is the child zero-sized? - child->GetSize(size); - if ((size.width > 0) || (size.height > 0)) { - // We found a non-zero sized child frame that precedes aFrame - return PR_FALSE; - } - - child->GetNextSibling(child); - } - - // aFrame is the left-most non-zero sized frame in its geometric parent. - // Walk up one level and check that its parent is left-most as well - aFrame = parent; - } while (aFrame != this); - - return PR_TRUE; -} - -PRBool nsBlockFrame::AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // Get the frame associated with the space manager, and get its nsIAnchoredItems - // interface - nsIFrame* frame = mCurrentState->spaceManager->GetFrame(); - nsIAnchoredItems* anchoredItems = nsnull; - - frame->QueryInterface(kIAnchoredItemsIID, (void**)&anchoredItems); - NS_ASSERTION(nsnull != anchoredItems, "no anchored items interface"); - - if (nsnull != anchoredItems) { - anchoredItems->AddAnchoredItem(aFloater, nsIAnchoredItems::anHTMLFloater, this); - PlaceFloater(aCX, aFloater, aPlaceholder); - return PR_TRUE; - } - - return PR_FALSE; -} - -// XXX The size of the floater needs to be taken into consideration if we're -// computing a maximum element size -void nsBlockFrame::PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // If the floater is the left-most non-zero size child frame then insert - // it before the current line; otherwise add it to the below-current-line - // todo list and we'll handle it when we flush out the line - if (IsLeftMostChild(aPlaceholder)) { - // Get the type of floater - nsIStyleContextPtr styleContext; - - aFloater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* floaterDisplay = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - if (!mCurrentState->isInline) { - // Get the current band for this line - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } - - // Commit some space in the space manager - nsRect region; - - aFloater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == floaterDisplay->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == floaterDisplay->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, 0); - mCurrentState->spaceManager->AddRectRegion(region, aFloater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - aFloater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - - // Update the band of available space to reflect space taken up by the floater - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } else { - // Add the floater to our to-do list - mCurrentState->floaterToDo.AppendElement(aFloater); - } -} - -NS_METHOD nsBlockFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last-in-flow - nsBlockFrame* flow = (nsBlockFrame*)GetLastInFlow(); - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - -#if 0 - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Is it a floater? - if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - // Create initial frame for the child - nsIContentDelegate* kidDel; - nsresult fr; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // Update last content offset now that we are done drawing - // children from our parent. - SetLastContentOffset(prevKidFrame); - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - return NS_OK; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - } - kidFrame->SetStyleContext(kidSC); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - kidIndex++; - mChildCount++; - } - SetLastContentOffset(prevKidFrame); -#endif - - // If this is a pseudo-frame then our parent will generate the - // reflow command. Otherwise, if the container is us then we should - // generate the reflow command because we were directly called. - if (!IsPseudoFrame() && (aContainer == mContent)) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} - -PRIntn nsBlockFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - -nsHTMLFrameType nsBlockFrame::GetFrameType() const -{ - return eHTMLFrame_Block; -} - -NS_METHOD nsBlockFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fprintf(out, "*block<"); - nsIAtom* atom = mContent->GetTag(); - if (nsnull != atom) { - nsAutoString tmp; - atom->ToString(tmp); - fputs(tmp, out); - } - fprintf(out, ">(%d)@%p", mIndexInParent, this); - } else { - nsHTMLContainerFrame::ListTag(out); - } - return NS_OK; -} - -#ifdef NS_DEBUG -void nsBlockFrame::DumpFlow() const -{ -#ifdef NOISY_FLOW - nsBlockFrame* flow = (nsBlockFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsBlockFrame*) flow->mNextInFlow; - } -#endif -} -#endif diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h deleted file mode 100644 index 6b45fe72cab..00000000000 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ /dev/null @@ -1,2184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBlockFrame.h" -#include "nsSize.h" -#include "nsIAnchoredItems.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsMargin.h" -#include "nsHTMLIIDs.h" -#include "nsCSSLayout.h" -#include "nsCRT.h" -#include "nsIPresShell.h" -#include "nsReflowCommand.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsAbsoluteFrame.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct BlockBandData : public nsBandData { - nsBandTrapezoid data[12]; - - // Bounding rect of available space between any left and right floaters - nsRect availSpace; - - // Constructor - BlockBandData() {size = 12; trapezoids = data;} - - // Computes the bounding rect of the available space, i.e. space between - // any left and right floaters - // - // Uses the current trapezoid data, see nsISpaceManager::GetBandData(). - // Updates member data "availSpace" - void ComputeAvailSpaceRect(); -}; - -void BlockBandData::ComputeAvailSpaceRect() -{ - nsBandTrapezoid* trapezoid = data; - - if (count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < count; i++) { - nsBandTrapezoid* trapezoid = &data[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &data[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availSpace); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availSpace); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availSpace.x = availSpace.XMost(); - } - availSpace.width = 0; - } -} - -// XXX Bugs -// 1. right to left reflow can generate negative x coordinates. - -// XXX Speedup idea (all containers) - -// If I reflow a child and it gives back not-complete status then -// there is no sense in trying to pullup children. For blocks, it's a -// little more complicated unless the child is a block - if the child -// is a block, then we must be out of room hence we should stop. If -// the child is not a block then our line should be flushed (see #2 -// below) if our line is already empty then we must be out of room. - -// For inline frames and column frames, if we reflow a child and get -// back not-complete status then we should bail immediately because we -// are out of room. - -// XXX Speedup ideas: -// 1. change pullup code to use line information from next in flow -// 2. we can advance to next line immediately after reflowing something -// and noticing that it's not complete. -// 3. pass down last child information in aState so that pullup, etc., -// don't need to recompute it - -// XXX TODO: -// 0. Move justification into line flushing code - -// 1. To get ebina margins I need "auto" information from the style -// system margin's. A bottom/top margin of auto will then be computed like -// ebina computes it [however the heck that is]. - -// 2. kicking out floaters and talking with floater container to adjust -// left and right margins - -nsBlockReflowState::nsBlockReflowState() -{ -} - -void nsBlockReflowState::Init(const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsIStyleContext* aBlockSC, - nsISpaceManager* aSpaceManager) -{ - firstLine = PR_TRUE; - allowLeadingWhitespace = PR_FALSE; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - firstChildIsInsideBullet = PR_FALSE; - nextListOrdinal = -1; - column = 0; - - spaceManager = aSpaceManager; - currentBand = new BlockBandData; - - styleContext = aBlockSC; - styleText = (nsStyleText*) aBlockSC->GetData(kStyleTextSID); - styleFont = (nsStyleFont*) aBlockSC->GetData(kStyleFontSID); - styleDisplay = (nsStyleDisplay*) aBlockSC->GetData(kStyleDisplaySID); - - justifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == styleText->mTextAlign) && - (NS_STYLE_WHITESPACE_PRE != styleText->mWhiteSpace); - - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - maxElementSize = aMaxElementSize; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - kidXMost = 0; - x = 0; - y = 0; - - isInline = PR_FALSE; - currentLineNumber = 0; - lineStart = nsnull; - lineLength = 0; - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; - lineMaxElementSize.width = 0; - lineMaxElementSize.height = 0; - lastContentIsComplete = PR_TRUE; - - maxAscents = sizeof(ascentBuf) / sizeof(ascentBuf[0]); - needRelativePos = PR_FALSE; - - prevLineLastFrame = nsnull; - prevLineHeight = 0; - topMargin = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - prevLineLastContentIsComplete = PR_TRUE; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - reflowStatus = nsIFrame::frNotComplete; -} - -nsBlockReflowState::~nsBlockReflowState() -{ - if (ascents != ascentBuf) { - delete ascents; - } - delete currentBand; -} - -void nsBlockReflowState::AddAscent(nscoord aAscent) -{ - NS_PRECONDITION(lineLength <= maxAscents, "bad line length"); - if (lineLength == maxAscents) { - maxAscents *= 2; - nscoord* newAscents = new nscoord[maxAscents]; - if (nsnull != newAscents) { - nsCRT::memcpy(newAscents, ascents, sizeof(nscoord) * lineLength); - if (ascents != ascentBuf) { - delete ascents; - } - ascents = newAscents; - } else { - // Yikes! Out of memory! - return; - } - } - ascents[lineLength] = aAscent; -} - -void nsBlockReflowState::AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, - nscoord aPrevLineHeight) -{ - firstLine = PR_FALSE; - allowLeadingWhitespace = PR_FALSE; - column = 0; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - lineStart = nsnull; - lineLength = 0; - currentLineNumber++; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - needRelativePos = PR_FALSE; - - prevLineLastFrame = aPrevLineLastFrame; - prevLineHeight = aPrevLineHeight; - prevMaxPosBottomMargin = maxPosBottomMargin; - prevMaxNegBottomMargin = maxNegBottomMargin; - - // Remember previous line's lastContentIsComplete - prevLineLastContentIsComplete = lastContentIsComplete; - lastContentIsComplete = PR_TRUE; - - topMargin = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; -} - -#ifdef NS_DEBUG -void nsBlockReflowState::DumpLine() -{ - nsIFrame* f = lineStart; - PRInt32 ll = lineLength; - while (--ll >= 0) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} - -void nsBlockReflowState::DumpList() -{ - nsIFrame* f = lineStart; - while (nsnull != f) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} -#endif - -//---------------------------------------------------------------------- - -nsresult nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBlockFrame::nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsBlockFrame::~nsBlockFrame() -{ - if (nsnull != mLines) { - delete mLines; - } -} - -nsresult -nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLFrameTypeIID)) { - *aInstancePtr = (void*) ((nsIHTMLFrameType*) this); - return NS_OK; - } else if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void*) ((nsIRunaround*) this); - return NS_OK; - } else if (aIID.Equals(kIFloaterContainerIID)) { - *aInstancePtr = (void*) ((nsIFloaterContainer*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Computes the top margin to use for this child frames based on its display -// type and the display type of the previous child frame. -// -// Adjacent vertical margins between block-level elements are collapsed. -nscoord nsBlockFrame::GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - if (aIsInline) { - // Just use whatever the previous bottom margin was - return aState.prevMaxPosBottomMargin - aState.prevMaxNegBottomMargin; - } else { - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - if (ss->mMargin.top < 0) { - maxNegTopMargin = -ss->mMargin.top; - } else { - maxPosTopMargin = ss->mMargin.top; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - return maxPos - maxNeg; - } else { - return 0; - } - } -} - -void nsBlockFrame::PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY) -{ - NS_PRECONDITION(aState.floaterToDo.Count() > 0, "no floaters"); - - // XXX Factor this code with PlaceFloater()... - PRInt32 numFloaters = aState.floaterToDo.Count(); - - for (PRInt32 i = 0; i < numFloaters; i++) { - nsIFrame* floater = (nsIFrame*)aState.floaterToDo[i]; - nsRect region; - - // Get the band of available space - // XXX This is inefficient to do this inside the loop... - GetAvailableSpaceBand(aState, aY); - - // Get the type of floater - nsIStyleContextPtr styleContext; - - floater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* sd = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - floater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == sd->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == sd->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, - 0); - mCurrentState->spaceManager->AddRectRegion(region, floater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - floater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - } - aState.floaterToDo.Clear(); -} - -/** - * Flush a line out. Return true if the line fits in our available - * height. If the line does not fit then return false. When the line - * fits we advance the y coordinate, reset the x coordinate and - * prepare the nsBlockReflowState for the next line. - */ -PRBool nsBlockFrame::AdvanceToNextLine(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - NS_PRECONDITION(aState.lineLength > 0, "bad line"); - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nscoord y = aState.y + aState.topMargin; - nscoord lineHeight; - - if (aState.isInline) { - // Vertically align the children on this line, returning the height of - // the line upon completion. - lineHeight = nsCSSLayout::VerticallyAlignChildren(aCX, this, - aState.styleFont, - y, - aState.lineStart, - aState.lineLength, - aState.ascents, - aState.maxAscent); - - // Any below current line floaters to place? - if (aState.floaterToDo.Count() > 0) { - PlaceBelowCurrentLineFloaters(aCX, aState, y + lineHeight); - // XXX Factor in the height of the floaters as well when considering - // whether the line fits. - // The default policy is that if there isn't room for the floaters then - // both the line and the floaters are pushed to the next-in-flow... - } - } else { - nsSize size; - - aState.lineStart->GetSize(size); - lineHeight = size.height; - } - - // The first line always fits - if (aState.currentLineNumber > 0) { - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if (y + lineHeight > yb) { - // After vertical alignment of the children and factoring in the - // proper margin, the line doesn't fit. - return PR_FALSE; - } - } - - if (aState.isInline) { - // Check if the right-edge of the line exceeds our running x-most - nscoord xMost = aState.borderPadding.left + aState.lineWidth; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - } - - // Advance the y coordinate to the new position where the next - // line or block element will go. - aState.y = y + lineHeight; - aState.x = 0; - - // Now that the vertical alignment is done we can perform horizontal - // alignment and relative positioning. Skip all of these if we are - // doing an unconstrained (in x) reflow. There's no point in doing - // the work if we *know* we are going to reflowed again. - if (!aState.unconstrainedWidth) { - nsCSSLayout::HorizontallyPlaceChildren(aCX, this, aState.styleText, - aState.lineStart, aState.lineLength, - aState.lineWidth, - aState.availSize.width); - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - if (!aState.justifying) { - nsCSSLayout::RelativePositionChildren(aCX, this, - aState.lineStart, - aState.lineLength); - } - } - - // Record line length - aState.lineLengths.AppendElement((void*)aState.lineLength); - - // Find the last frame in the line - // XXX keep this as running state in the nsBlockReflowState - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - // Update maxElementSize - if (nsnull != aState.maxElementSize) { - nsSize& lineMax = aState.lineMaxElementSize; - nsSize* maxMax = aState.maxElementSize; - if (lineMax.width > maxMax->width) { - maxMax->width = lineMax.width; - } - if (lineMax.height > maxMax->height) { - maxMax->height = lineMax.height; - } - aState.lineMaxElementSize.width = 0; - aState.lineMaxElementSize.height = 0; - } - - // Advance to the next line - aState.AdvanceToNextLine(lastFrame, lineHeight); - - return PR_TRUE; -} - -/** - * Add an inline child to the current line. Advance various running - * values after placement. - */ -void nsBlockFrame::AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Place and size the child - // XXX add in left margin from kid - nsRect r; - r.y = aState.y; - r.width = aKidSize.width; - r.height = aKidSize.height; - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - // Left to right positioning. - r.x = aState.borderPadding.left + aState.x + ss->mMargin.left; - aState.x += aKidSize.width + ss->mMargin.left + ss->mMargin.right; - } else { - // Right to left positioning - // XXX what should we do when aState.x goes negative??? - r.x = aState.x - aState.borderPadding.right - ss->mMargin.right - - aKidSize.width; - aState.x -= aKidSize.width + ss->mMargin.right + ss->mMargin.left; - } - aKidFrame->SetRect(r); - aState.AddAscent(aKidSize.ascent); - aState.lineWidth += aKidSize.width; - aState.lineLength++; - - // Update maximums for the line - if (aKidSize.ascent > aState.maxAscent) { - aState.maxAscent = aKidSize.ascent; - } - if (aKidSize.descent > aState.maxDescent) { - aState.maxDescent = aKidSize.descent; - } - // Update running margin maximums - if (aState.firstChildIsInsideBullet && (aKidFrame == mFirstChild)) { - // XXX temporary code. Since the molecule for the bullet frame - // is the same as the LI frame, we get bad style information. - // ignore it. - } else { - nscoord margin; -#if 0 - // XXX CSS2 spec says that top/bottom margin don't affect line height - // calculation. We're waiting for clarification on this issue... - if ((margin = ss->mMargin.top) < 0) { - margin = -margin; - if (margin > aState.maxNegTopMargin) { - aState.maxNegTopMargin = margin; - } - } else { - if (margin > aState.maxPosTopMargin) { - aState.maxPosTopMargin = margin; - } - } -#endif - if ((margin = ss->mMargin.bottom) < 0) { - margin = -margin; - if (margin > aState.maxNegBottomMargin) { - aState.maxNegBottomMargin = margin; - } - } else { - if (margin > aState.maxPosBottomMargin) { - aState.maxPosBottomMargin = margin; - } - } - } - - // Update line max element size - nsSize& mes = aState.lineMaxElementSize; - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > mes.width) { - mes.width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > mes.height) { - mes.height = aKidMaxElementSize->height; - } - } -} - -// Places and sizes the block-level element, and advances the line. -// The rect is in the local coordinate space of the kid frame. -void nsBlockFrame::AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Translate from the kid's coordinate space to our coordinate space - aKidRect.x += aState.borderPadding.left + ss->mMargin.left; - aKidRect.y += aState.y + aState.topMargin; - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - aState.AddAscent(aKidRect.height); - aState.lineLength++; - - // Is this the widest child frame? - nscoord xMost = aKidRect.XMost() + ss->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // Update the max element size - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aKidMaxElementSize->height; - } - } - - // and the bottom line margin information which we'll use when placing - // the next child - if (ss->mMargin.bottom < 0) { - aState.maxNegBottomMargin = -ss->mMargin.bottom; - } else { - aState.maxPosBottomMargin = ss->mMargin.bottom; - } - - // Update the running y-offset - aState.y += aKidRect.height + aState.topMargin; - - // Apply relative positioning if necessary - nsCSSLayout::RelativePositionChildren(aCX, this, aKidFrame, 1); - - // Advance to the next line - aState.AdvanceToNextLine(aKidFrame, aKidRect.height); -} - -/** - * Compute the available size for reflowing the given child at the - * current x,y position in the state. Note that this may return - * negative or zero width/height's if we are out of room. - */ -void nsBlockFrame::GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - // Determine the maximum available reflow height for the child - nscoord yb = aState.borderPadding.top + aState.availSize.height; - aResult.height = aState.unconstrainedHeight ? NS_UNCONSTRAINEDSIZE : - yb - aState.y - aState.topMargin; - - // Determine the maximum available reflow width for the child - if (aState.unconstrainedWidth) { - aResult.width = NS_UNCONSTRAINEDSIZE; - } else if (aIsInline) { - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - aResult.width = aState.currentBand->availSpace.XMost() - aState.x; - } else { - aResult.width = aState.x - aState.currentBand->availSpace.x; - } - } else { - // It's a block. Don't adjust for the left/right margin here. That happens - // later on once we know the current left/right edge - aResult.width = aState.availSize.width; - } -} - -/** - * Push all of the kids that we have not reflowed, starting at - * aState.lineStart. aPrevKid is the kid previous to aState.lineStart - * and is also our last child. Note that line length is NOT a - * reflection of the number of children we are actually pushing - * (because we don't break the sibling list as we add children to the - * line). - */ -void nsBlockFrame::PushKids(nsBlockReflowState& aState) -{ - nsIFrame* prevFrame = aState.prevLineLastFrame; - NS_PRECONDITION(nsnull != prevFrame, "pushing all kids"); -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevFrame->GetNextSibling(nextSibling); - NS_PRECONDITION(nextSibling == aState.lineStart, "bad prev line"); -#endif - -#ifdef NS_DEBUG - PRInt32 numKids = LengthOf(mFirstChild); - NS_ASSERTION(numKids == mChildCount, "bad child count"); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": push kids (childCount=%d)\n", mChildCount); - DumpFlow(); -#endif - - PushChildren(aState.lineStart, prevFrame, mLastContentIsComplete); - SetLastContentOffset(prevFrame); - - // Set mLastContentIsComplete to the previous lines last content is - // complete now that the previous line's last child is our last - // child. - mLastContentIsComplete = aState.prevLineLastContentIsComplete; - - // Fix up child count - // XXX is there a better way? aState.lineLength doesn't work because - // we might be pushing more than just the pending line. - nsIFrame* kid = mFirstChild; - PRInt32 kids = 0; - while (nsnull != kid) { - kids++; - kid->GetNextSibling(kid); - } - mChildCount = kids; - - // Make sure we have no lingering line data - aState.lineLength = 0; - aState.lineStart = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d) [%c]\n", mChildCount, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif -} - -/** - * Gets a band of available space starting at the specified y-offset. Assumes - * the local coordinate space is currently set to the upper-left origin of the - * bounding rect - * - * Updates "currentBand" and "x" member data of the block reflow state - */ -void nsBlockFrame::GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY) -{ - // Gets a band of available space. - aState.spaceManager->Translate(aState.borderPadding.left, 0); - aState.spaceManager->GetBandData(aY, aState.availSize, *aState.currentBand); - - // Compute the bounding rect of the available space, i.e. space between any - // left and right floaters - aState.currentBand->ComputeAvailSpaceRect(); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - aState.x = aState.currentBand->availSpace.x; -} - -void nsBlockFrame::ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear) -{ - // Translate the coordinate space - aState.spaceManager->Translate(aState.borderPadding.left, 0); - -getBand: - nscoord y = aState.y + aState.topMargin; - PRBool isLeftFloater = PR_FALSE; - PRBool isRightFloater = PR_FALSE; - - // Get a band of available space - aState.spaceManager->GetBandData(y, aState.availSize, *aState.currentBand); - - // Scan the trapezoids looking for left and right floaters - nsBandTrapezoid* trapezoid = aState.currentBand->trapezoids; - for (PRInt32 i = 0; i < aState.currentBand->count; i++) { - // XXX Handle multiply occupied - if (nsBandTrapezoid::smOccupied == trapezoid->state) { - nsStyleDisplay* display; - - trapezoid->frame->GetStyleData(kStylePositionSID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - isLeftFloater = PR_TRUE; - } else if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - isRightFloater = PR_TRUE; - } - } - - trapezoid++; - } - - if (isLeftFloater) { - if ((aClear == NS_STYLE_CLEAR_LEFT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - if (isRightFloater) { - if ((aClear == NS_STYLE_CLEAR_RIGHT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - - aState.spaceManager->Translate(-aState.borderPadding.left, 0); -} - -// Bit's for PlaceAndReflowChild return value -#define PLACE_FIT 0x1 -#define PLACE_FLOWED 0x2 - -PRIntn -nsBlockFrame::PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC) -{ - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = - (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - - // Get line start setup if we are at the start of a new line - if (nsnull == aState.lineStart) { - NS_ASSERTION(0 == aState.lineLength, "bad line length"); - aState.lineStart = aKidFrame; - } - - // Get kid and its style - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - - // Figure out if kid is a block element or not - PRBool isInline = PR_TRUE; - PRIntn display = styleDisplay->mDisplay; - if (aState.firstChildIsInsideBullet && (mFirstChild == aKidFrame)) { - // XXX Special hack for properly reflowing bullets that have the - // inside value for list-style-position. - display = NS_STYLE_DISPLAY_INLINE; - } - if ((NS_STYLE_DISPLAY_BLOCK == display) || - (NS_STYLE_DISPLAY_LIST_ITEM == display)) { - // Block elements always end up on the next line (unless they are - // already at the start of the line). - isInline = PR_FALSE; - if (aState.lineLength > 0) { - aState.breakAfterChild = PR_TRUE; - } - } - - // Handle forced break first - if (aState.breakAfterChild) { - NS_ASSERTION(aState.lineStart != aKidFrame, "bad line"); - - // Get the last child in the current line - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - if (!AdvanceToNextLine(aCX, aState)) { - // The previous line didn't fit. - return 0; - } - aState.lineStart = aKidFrame; - - // Get the style for the last child, and see if it wanted to clear - // floaters. This handles the BR tag, which is the only inline - // element for which clear applies - nsIStyleContextPtr lastChildSC; - - lastFrame->GetStyleContext(aCX, lastChildSC.AssignRef()); - nsStyleDisplay* lastChildDisplay = (nsStyleDisplay*) - lastChildSC->GetData(kStyleDisplaySID); - switch (lastChildDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, lastChildDisplay->mBreakType); - break; - } - } - - // Now that we've handled force breaks (and maybe called AdvanceToNextLine() - // which checks), remember whether it's an inline frame - aState.isInline = isInline; - - // If we're at the beginning of a line then compute the top margin that we - // should use - if (aState.lineStart == aKidFrame) { - // Compute the top margin to use for this line - aState.topMargin = GetTopMarginFor(aCX, aState, aKidFrame, aKidSC, - aState.isInline); - - // If it's an inline element then get a band of available space - // - // XXX If we have a current band and there's unused space in that band - // then avoid this call to get a band... - if (aState.isInline) { - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - } - } - - // Compute the available space to reflow the child into and then - // reflow it into that space. - nsSize kidAvailSize; - GetAvailSize(kidAvailSize, aState, aKidSC, aState.isInline); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - - ReflowStatus status; - - if (aState.isInline) { - nsReflowMetrics kidSize; - - // Inline elements are never passed the space manager - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - NS_ASSERTION(nsnull != aState.lineStart, "bad line start"); - - if (aKidFrame == aState.lineStart) { - // Width always fits when we are at the logical left margin. - // Just check the height. - // - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall - return PLACE_FLOWED; - } - } else { - // Examine state and if the breakBeforeChild is set and we - // aren't already on the new line, do the forcing now. - // XXX Why aren't we doing this check BEFORE we resize reflow the child? - if (aState.breakBeforeChild) { - aState.breakBeforeChild = PR_FALSE; - if (aKidFrame != aState.lineStart) { - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow child now that it has the line to itself - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - } - } - - // When we are not at the logical left margin then we need - // to check the width first. If we are too wide then advance - // to the next line and try reflowing again. - if (kidSize.width > kidAvailSize.width) { - // Too wide. Try next line - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow splittable children - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable != frNotSplittable) { - // Update size info now that we are on the next line. Then - // reflow the child into the new available space. - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - } - - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall on the next line - return PLACE_FLOWED; - } - // It's ok if it's too wide on the next line. - } - } - } - - // Add child to the line - AddInlineChildToLine(aCX, aState, aKidFrame, kidSize, - pKidMaxElementSize, aKidSC); - } else { - nsRect kidRect; - - // Does the block-level element want to clear any floaters that impact - // it? Note that the clear property only applies to block-level elements - // and the BR tag - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - switch (styleDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, styleDisplay->mBreakType); - GetAvailSize(kidAvailSize, aState, aKidSC, PR_FALSE); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - break; - } - - // Give the block its own local coordinate space.. Note: ReflowChild() - // will adjust for the child's left/right margin after determining the - // current left/right edge - aState.spaceManager->Translate(aState.borderPadding.left, 0); - // Give the block-level element the opportunity to use the space manager - status = ReflowChild(aKidFrame, aCX, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - // Block elements always fit horizontally (because they are - // always placed at the logical left margin). Check to see if - // the block fits vertically - if (kidRect.YMost() > kidAvailSize.height) { - // Nope - return PLACE_FLOWED; - } - } - - // Add block child - // XXX We need to set lastContentIsComplete here, because AddBlockChild() - // calls AdvaneceToNextLine(). We need to restructure the flow of control, - // and use a state machine... - aState.lastContentIsComplete = PRBool(status == frComplete); - AddBlockChild(aCX, aState, aKidFrame, kidRect, pKidMaxElementSize, aKidSC); - } - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - - aState.lastContentIsComplete = PRBool(status == frComplete); - if (aState.isInline && (frNotComplete == status)) { - // Since the inline child didn't complete its reflow we *know* - // that a continuation of it can't possibly fit on the current - // line. Therefore, set a flag in the state that will cause the - // a line break before the next frame is placed. - aState.breakAfterChild = PR_TRUE; - } - - aState.reflowStatus = status; - return PLACE_FLOWED | PLACE_FIT; -} - -/** - * Reflow the existing frames. - * - * @param aCX presentation context to use - * @param aState in out parameter which tracks the state of - * reflow for the block frame. - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool -nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsIFrame* kidFrame; - - for (kidFrame = mFirstChild; nsnull != kidFrame; ) { - - /* we get the kid's style from kidFrame's cached style context */ - nsIStyleContextPtr kidSC; - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - - // Attempt to place and reflow the child - - // XXX if child is not splittable and it fits just place it where - // it is, otherwise advance to the next line and place it there if - // possible - - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - ReflowStatus status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // The child doesn't fit. Push it and any remaining children. - PushKids(aState); - result = PR_FALSE; - goto push_done; - } - - // Is the child complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - // Yes, the child is complete - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else { - // No the child isn't complete - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Unlike the inline frame code we can't assume that we used - // up all of our space because the child's reflow status is - // frNotComplete. Instead, the child is probably split and - // we need to reflow the continuations as well. - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - } - - push_done: -#ifdef NS_DEBUG - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - - PRInt32 len = LengthOf(mFirstChild); - NS_POSTCONDITION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -/* XXX: - * In this method, we seem to be getting the style for the next child, - * and checking that child's style for the child's display type. - * The problem is that it's very inefficient to ResolveStyleFor(kid) here - * and then just throw it away, when we end up doing a ResolveStyleFor(kid) - * again when we actually create a frame for the content. - * It would be nice to cache the resolved style, maybe in the reflow state? - */ -PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) -{ - PRBool rv = PR_FALSE; - if (IsPseudoFrame()) { - // Get the next content object that we would like to reflow - PRInt32 kidIndex = NextChildOffset(); - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNotNull()) { - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - switch (kidStyleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block pseudo-frames do not contain other block elements - break; - - default: - rv = PR_TRUE; - break; - } - } - } else { - if (NextChildOffset() < mContent->ChildCount()) { - rv = PR_TRUE; - } - } - return rv; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aCX presentation context to use - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsBlockFrame* prev = (nsBlockFrame*) mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - mFirstContentOffset = prev->NextChildOffset(); - if (PR_FALSE == prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time until we are out of children - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (nsnull == kidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // If we're being used as a pseudo frame, i.e. we map the same - // content as our parent then we want to indicate we're complete; - // otherwise we'll be continued and go on mapping children... - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - result = frComplete; - goto done; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aCX); - kidFrame = kidDel->CreateFrame(aCX, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidSC); - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - kidPrevInFlow->CreateContinuingFrame(aCX, this, kidFrame); - } - - // Link child frame into the list of children. If the frame ends - // up not fitting and getting pushed, the PushKids code will fixup - // the child count for us. - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - - // Reflow child frame as many times as necessary until it is - // complete. - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // We ran out of room. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - goto push_done; - } - - // Did the child complete? - prevKidFrame = kidFrame; - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "huh?"); -#endif - } while (frNotComplete == status); - - // The child that we just reflowed is complete -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); -#endif - kidIndex++; - kidPrevInFlow = nsnull; - } - - done: - // To get here we either completely reflowed all our appended - // children OR we are a pseudo-frame and we ran into a block - // element. In either case our last content MUST be complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - - push_done: -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Pullup frames from our next in flow and try to place them. Before - * this is called our previously mapped children, if any have been - * reflowed which means that the block reflow state's x and y - * coordinates and other data are ready to go. - * - * Return true if we pulled everything up. - */ -PRBool -nsBlockFrame::PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsBlockFrame* nextInFlow = (nsBlockFrame*) mNextInFlow; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - while (nsnull != nextInFlow) { - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (nsBlockFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get style information for the pulled up kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // Push the kids that didn't fit back down to the next-in-flow - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - result = PR_FALSE; - goto push_done; - } - - if (frNotComplete == status) { - // Child is not complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // Create a continuing frame for the incomplete child - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - } - - if (nsnull != prevKidFrame) { - // The only way we can get here is by pulling up every last child - // in our next-in-flows (and reflowing any continunations they - // have). Therefore we KNOW that our last child is complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - push_done:; - - if (result == PR_FALSE) { - // If our next-in-flow is empty OR our next next-in-flow is empty - // then adjust the offsets of all of the empty next-in-flows. - nextInFlow = (nsBlockFrame*) mNextInFlow; - if ((0 == nextInFlow->mChildCount) || - ((nsnull != nextInFlow->mNextInFlow) && - (0 == ((nsBlockFrame*)(nextInFlow->mNextInFlow))->mChildCount))) { - // We didn't pullup everything and we need to fixup one of our - // next-in-flows content offsets. - AdjustOffsetOfEmptyNextInFlows(); - } - } - - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -void nsBlockFrame::SetupState(nsIPresContext* aCX, - nsBlockReflowState& aState, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager) -{ - // Setup reflow state - aState.Init(aMaxSize, aMaxElementSize, mStyleContext, aSpaceManager); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - - // Apply border and padding adjustments for regular frames only - if (PR_FALSE == IsPseudoFrame()) { - aState.borderPadding = mySpacing->mBorderPadding; - aState.y = mySpacing->mBorderPadding.top; - aState.availSize.width -= - (mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right); - aState.availSize.height -= - (mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom); - } else { - aState.borderPadding.SizeTo(0, 0, 0, 0); - } - - // Setup initial list ordinal value - nsIAtom* tag = mContent->GetTag(); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - nsHTMLValue value; - if (eContentAttr_HasValue == - ((nsIHTMLContent*)mContent)->GetAttribute(nsHTMLAtoms::start, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - aState.nextListOrdinal = value.GetIntValue(); - } - } - } - NS_RELEASE(tag); - - mCurrentState = &aState; -} - -#include "nsUnitConversion.h"/* XXX */ -NS_METHOD nsBlockFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - return DoResizeReflow(aCX, state, aDesiredRect, aStatus); -} - -nsresult nsBlockFrame::DoResizeReflow(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height)); - DumpFlow(); -#endif - - // Zap old line data - if (nsnull != mLines) { - delete mLines; - mLines = nsnull; - } - mNumLines = 0; - - // Check for an overflow list - MoveOverflowToChildList(); - - // Before we start reflowing, cache a pointer to our state structure - // so that inline frames can find it. - nsIPresShell* shell = aCX->GetShell(); - shell->PutCachedData(this, &aState); - - // First reflow any existing frames - PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aCX, aState); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } - - if (reflowMappedOK) { - // Any space left? - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if ((nsnull != mFirstChild) && (aState.y >= yb)) { - // No space left. Don't try to pull-up children or reflow - // unmapped. We need to return the correct completion status, - // so see if there is more to reflow. - if (MoreToReflow(aCX)) { - aStatus = frNotComplete; - } - } else if (MoreToReflow(aCX)) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || PullUpChildren(aCX, aState)) { - // If we still have unmapped children then create some new frames - if (MoreToReflow(aCX)) { - aStatus = ReflowAppendedChildren(aCX, aState); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Deal with last line - make sure it gets vertically and - // horizontally aligned. This also updates the state's y coordinate - // which is good because that's how we size ourselves. - if (0 != aState.lineLength) { - if (!AdvanceToNextLine(aCX, aState)) { - // The last line of output doesn't fit. Push all of the kids to - // the next in flow and change our reflow status to not complete - // so that we are continued. -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids since last line doesn't fit\n"); -#endif - - PushKids(aState); - aStatus = frNotComplete; - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there is room for it. - nscoord margin = aState.prevMaxPosBottomMargin - - aState.prevMaxNegBottomMargin; - nscoord y = aState.y + margin; - if (y <= aState.borderPadding.top + aState.availSize.height) { - aState.y = y; - } - } - - // Now that reflow has finished, remove the cached pointer - shell->RemoveCachedData(this); - NS_RELEASE(shell); - - // Translate state.lineLengths into an integer array - mNumLines = aState.lineLengths.Count(); - if (mNumLines > 0) { - mLines = new PRInt32[mNumLines]; - for (PRInt32 i = 0; i < mNumLines; i++) { - PRInt32 ll = (PRInt32) aState.lineLengths.ElementAt(i); - mLines[i] = ll; - } - } - - if (!aState.unconstrainedWidth && aState.justifying) { - // Perform justification now that we know how many lines we have. - JustifyLines(aCX, aState); - } - - // Return our desired rect and our status - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = aState.kidXMost + aState.borderPadding.right; - if (!aState.unconstrainedWidth) { - // Make sure we're at least as wide as the max size we were given - nscoord maxWidth = aState.availSize.width + aState.borderPadding.left + - aState.borderPadding.right; - - if (aDesiredRect.width < maxWidth) { - aDesiredRect.width = maxWidth; - } - } - aState.y += aState.borderPadding.bottom; - aDesiredRect.height = aState.y; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g %scomplete [%d,%d,%c]\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height), - ((status == frNotComplete) ? "NOT " : ""), - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F') - ); - DumpFlow(); -#endif - mCurrentState = nsnull; - return NS_OK; -} - -void nsBlockFrame::JustifyLines(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - // XXX we don't justify the last line; what if we are continued, - // should we do it then? - nsIFrame* kid = mFirstChild; - for (PRInt32 i = 0; i < mNumLines; i++) { - nsIFrame* lineStart = kid; - PRInt32 lineLength = mLines[i]; - if (i < mNumLines - 1) { - if (1 == lineLength) { - // For lines with one element on them we can take a shortcut and - // let them do the justification. Note that we still call - // JustifyReflow even if the available space is zero in case the - // child is a hunk of text that ends in whitespace. The whitespace - // will be distributed elsewhere causing a proper flush right look - // for the last word. - nsRect r; - kid->GetRect(r); - nscoord maxWidth = aState.availSize.width; - nscoord availableSpace = maxWidth - r.width; - nscoord maxAvailSpace = nscoord(maxWidth * 0.1f); - if ((availableSpace >= 0) && (availableSpace < maxAvailSpace)) { - kid->JustifyReflow(aCX, availableSpace); - kid->SizeTo(r.width + availableSpace, r.height); - } - kid->GetNextSibling(kid); - } else { - // XXX Get justification of multiple elements working - while (--lineLength >= 0) { - kid->GetNextSibling(kid); - } - } - } - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - nsCSSLayout::RelativePositionChildren(aCX, this, lineStart, mLines[i]); - } -} - -NS_METHOD nsBlockFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittableNonRectangular; - return NS_OK; -} - -NS_METHOD nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD nsBlockFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - - if (aReflowCommand.GetTarget() == this) { - // XXX for now, just do a complete reflow mapped (it'll kinda - // work, but it's slow) - - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, nsnull, aSpaceManager); - PRBool reflowMappedOK = ReflowMappedChildren(aCX, state); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } else { - // XXX not yet implemented - NS_ABORT(); - // XXX work to compute initial state goes *HERE* - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = 0; - aDesiredRect.height = 0; - } - - mCurrentState = nsnull; - return NS_OK; -} - -PRBool nsBlockFrame::IsLeftMostChild(nsIFrame* aFrame) -{ - do { - nsIFrame* parent; - - aFrame->GetGeometricParent(parent); - - // See if there are any non-zero sized child frames that precede aFrame - // in the child list - nsIFrame* child; - - parent->FirstChild(child); - while ((nsnull != child) && (aFrame != child)) { - nsSize size; - - // Is the child zero-sized? - child->GetSize(size); - if ((size.width > 0) || (size.height > 0)) { - // We found a non-zero sized child frame that precedes aFrame - return PR_FALSE; - } - - child->GetNextSibling(child); - } - - // aFrame is the left-most non-zero sized frame in its geometric parent. - // Walk up one level and check that its parent is left-most as well - aFrame = parent; - } while (aFrame != this); - - return PR_TRUE; -} - -PRBool nsBlockFrame::AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // Get the frame associated with the space manager, and get its nsIAnchoredItems - // interface - nsIFrame* frame = mCurrentState->spaceManager->GetFrame(); - nsIAnchoredItems* anchoredItems = nsnull; - - frame->QueryInterface(kIAnchoredItemsIID, (void**)&anchoredItems); - NS_ASSERTION(nsnull != anchoredItems, "no anchored items interface"); - - if (nsnull != anchoredItems) { - anchoredItems->AddAnchoredItem(aFloater, nsIAnchoredItems::anHTMLFloater, this); - PlaceFloater(aCX, aFloater, aPlaceholder); - return PR_TRUE; - } - - return PR_FALSE; -} - -// XXX The size of the floater needs to be taken into consideration if we're -// computing a maximum element size -void nsBlockFrame::PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // If the floater is the left-most non-zero size child frame then insert - // it before the current line; otherwise add it to the below-current-line - // todo list and we'll handle it when we flush out the line - if (IsLeftMostChild(aPlaceholder)) { - // Get the type of floater - nsIStyleContextPtr styleContext; - - aFloater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* floaterDisplay = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - if (!mCurrentState->isInline) { - // Get the current band for this line - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } - - // Commit some space in the space manager - nsRect region; - - aFloater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == floaterDisplay->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == floaterDisplay->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, 0); - mCurrentState->spaceManager->AddRectRegion(region, aFloater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - aFloater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - - // Update the band of available space to reflect space taken up by the floater - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } else { - // Add the floater to our to-do list - mCurrentState->floaterToDo.AppendElement(aFloater); - } -} - -NS_METHOD nsBlockFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last-in-flow - nsBlockFrame* flow = (nsBlockFrame*)GetLastInFlow(); - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - -#if 0 - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Is it a floater? - if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - // Create initial frame for the child - nsIContentDelegate* kidDel; - nsresult fr; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // Update last content offset now that we are done drawing - // children from our parent. - SetLastContentOffset(prevKidFrame); - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - return NS_OK; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - } - kidFrame->SetStyleContext(kidSC); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - kidIndex++; - mChildCount++; - } - SetLastContentOffset(prevKidFrame); -#endif - - // If this is a pseudo-frame then our parent will generate the - // reflow command. Otherwise, if the container is us then we should - // generate the reflow command because we were directly called. - if (!IsPseudoFrame() && (aContainer == mContent)) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} - -PRIntn nsBlockFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - -nsHTMLFrameType nsBlockFrame::GetFrameType() const -{ - return eHTMLFrame_Block; -} - -NS_METHOD nsBlockFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fprintf(out, "*block<"); - nsIAtom* atom = mContent->GetTag(); - if (nsnull != atom) { - nsAutoString tmp; - atom->ToString(tmp); - fputs(tmp, out); - } - fprintf(out, ">(%d)@%p", mIndexInParent, this); - } else { - nsHTMLContainerFrame::ListTag(out); - } - return NS_OK; -} - -#ifdef NS_DEBUG -void nsBlockFrame::DumpFlow() const -{ -#ifdef NOISY_FLOW - nsBlockFrame* flow = (nsBlockFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsBlockFrame*) flow->mNextInFlow; - } -#endif -} -#endif diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp deleted file mode 100644 index 7ea228ca7b2..00000000000 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLContainerFrame.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsCSSRendering.h" -#include "nsIContent.h" -#include "nsHTMLAtoms.h" -#include "nsIWidget.h" -#include "nsILinkHandler.h" -#include "nsHTMLValue.h" -#include "nsGUIEvent.h" -#include "nsIDocument.h" -#include "nsIURL.h" - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); - -nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsHTMLContainerFrame::~nsHTMLContainerFrame() -{ -} - -NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // Do not paint ourselves if we are a pseudo-frame - if (PR_FALSE == IsPseudoFrame()) { - PRIntn skipSides = GetSkipSides(); - nsStyleColor* color = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* border = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *color); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *border, skipSides); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - return NS_OK; -} - -void nsHTMLContainerFrame::TriggerLink(nsIPresContext& aPresContext, - const nsString& aBase, - const nsString& aURLSpec, - const nsString& aTargetSpec) -{ - nsILinkHandler* handler; - if (NS_OK == aPresContext.GetLinkHandler(&handler)) { - // Resolve url to an absolute url - nsIURL* docURL = nsnull; - nsIDocument* doc = mContent->GetDocument(); - if (nsnull != doc) { - docURL = doc->GetDocumentURL(); - NS_RELEASE(doc); - } - - nsAutoString absURLSpec; - nsresult rv = NS_MakeAbsoluteURL(docURL, aBase, aURLSpec, absURLSpec); - if (nsnull != docURL) { - NS_RELEASE(docURL); - } - - // Now pass on absolute url to the click handler - handler->OnLinkClick(this, absURLSpec, aTargetSpec); - } -} - -NS_METHOD nsHTMLContainerFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ - aEventStatus = nsEventStatus_eIgnore; - switch (aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_UP: - if (nsEventStatus_eIgnore == - nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus)) { - // If our child didn't take the click then since we are an - // anchor, we take the click. - nsIAtom* tag = mContent->GetTag(); - if (tag == nsHTMLAtoms::a) { - nsAutoString base, href, target; - mContent->GetAttribute("href", href); - mContent->GetAttribute("target", target); - TriggerLink(aPresContext, base, href, target); - aEventStatus = nsEventStatus_eConsumeNoDefault; - } - NS_IF_RELEASE(tag); - } - break; - - case NS_MOUSE_RIGHT_BUTTON_DOWN: - // XXX Bring up a contextual menu provided by the application - break; - - default: - nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus); - break; - } - return NS_OK; -} - -NS_METHOD nsHTMLContainerFrame::GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) -{ - // Get my cursor - nsStyleColor* styleColor = (nsStyleColor*) - mStyleContext->GetData(kStyleColorSID); - PRInt32 myCursor = styleColor->mCursor; - - // Get child's cursor, if any - nsresult rv = nsContainerFrame::GetCursorAt(aPresContext, aPoint, aFrame, - aCursor); - if (NS_OK != rv) return rv; - if (aCursor != NS_STYLE_CURSOR_INHERIT) { - nsIAtom* tag = mContent->GetTag(); - if (nsHTMLAtoms::a == tag) { - // Anchor tags override their child cursors in some cases. - if ((NS_STYLE_CURSOR_IBEAM == aCursor) && - (NS_STYLE_CURSOR_INHERIT != myCursor)) { - aCursor = myCursor; - } - } - NS_RELEASE(tag); - return rv; - } - - if (NS_STYLE_CURSOR_INHERIT != myCursor) { - // If this container has a particular cursor, use it, otherwise - // let the child decide. - *aFrame = this; - aCursor = myCursor; - return NS_OK; - } - - // No specific cursor for us - aCursor = NS_STYLE_CURSOR_INHERIT; - return NS_OK; -} - -#if 0 -nsIFrame::ReflowStatus -nsHTMLContainerFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 0. Get to the correct flow block for this frame that applies to - // the effected frame. If the reflow command is not for us or it's - // deleted or changed then "child" is the child being - // effected. Otherwise child is the child before the effected - // content child (or null if the effected child is our first child) - * flow = FindFlowBlock(aReflowCommand, &child); - - // 1. Recover reflow state - State state; - RecoverState(aPresContext, ..., state); - - // 2. Put state into presentation shell cache so child frames can find - // it. - - if (aReflowCommand.GetTarget() == this) { - // Apply reflow command to the flow frame; one of it's immediate - // children has changed state. - ReflowStatus status; - switch (aReflowCommand.GetType()) { - case nsReflowCommand::rcContentAppended: - status = ReflowAppended(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcContentInserted: - status = ReflowInserted(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcContentDeleted: - status = ReflowDeleted(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcContentChanged: - status = ReflowChanged(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcUserDefined: - switch ( - break; - default: - // Ignore all other reflow commands - status = frComplete; - break; - } - } else { - // Reflow command applies to one of our children. We need to - // figure out which child because it's going to change size most - // likely and we need to be prepared to deal with it. - nsIFrame* kid = nsnull; - status = aReflowCommand.Next(aDesiredSize, aMaxSize, aSpaceManager, kid); - - // Execute the ReflowChanged post-processing code that deals with - // the child frame's size change; next-in-flows, overflow-lists, - // etc. - } - - // 4. Remove state from presentation shell cache - - return status; -} - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowAppended(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including new content w/o reflowing - // everything that's already been flowed - - // 2. if this container uses pseudo-frames then 2b, else 2a - - // 2a. start a reflow-unmapped of the new children - - // 2b. reflow-mapped the last-child if it's a pseudo as it might - // pickup the new children; smarter containers can avoid this if - // they can determine that the last-child won't pickup the new - // children up. Once reflowing the last-child is complete then if - // the status is frComplete then and only then try reflowing any - // remaining unmapped children - - // 2c. For inline and column code the result of a reflow mapped - // cannot impact any previously reflowed children. For block this - // is not true so block needs to reconstruct the line and then - // proceed as if the line were being reflowed for the first time - // (skipping over the existing children, of course). The line still - // needs to be flushed out, vertically aligned, etc, which may cause - // it to not fit. - - // 3. we may end up pushing kids to next-in-flow or stopping before - // all children have been mapped because we are out of room. parent - // needs to look at our return status and create a next-in-flow for - // us; the currently implemented reflow-unmapped code will do the - // right thing in that a child that is being appended and reflowed - // will get it's continuations created by us; if we run out of room - // we return an incomplete status to our parent and it does the same - // to us. -} - -// use a custom reflow command when we push or create an overflow list; - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowInserted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including new content w/o reflowing - // everything that's already been flowed - - // 2. Content insertion implies a new child of this container; the - // content inserted may need special attention (see - // ContentAppended). The same rules apply. However, if the - // pseudo-frame doesn't pullup the child then we need to - // ResizeReflow the addition (We cannot go through the - // reflow-unmapped path because the child frame(s) will need to be - // inserted into the list). - - // 2a if reflow results in a push then go through push reflow - // command path else go through deal-with-size-change -} - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowDeleted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including deleted content w/o reflowing - // everything that's already been flowed - - // 2. remove all of the child frames that belong to the deleted - // child; this includes next-in-flows. mark all of our next-in-flows - // that are impacted by this as dirty (or generate another reflow - // command) - - // 3. Run reflow-mapped code starting at the deleted child point; - // return the usual status to the parent. - - - // Generate reflow commands for my next-in-flows if they are - // impacted by deleting my child's next-in-flows -} - -// Meta point about ReflowChanged; we will factor out the change so -// that only stylistic changes that actually require a reflow end up -// at this frame. The style system will differentiate between -// rendering-only changes and reflow changes. - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowChanged(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including deleted content w/o reflowing - // everything that's already been flowed - - // 2. delete the frame that corresponds to the changed child (and - // it's next-in-flows, etc.) - - // 3. run the ReflowInserted code on the content -} -#endif diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.h b/mozilla/layout/generic/nsHTMLContainerFrame.h deleted file mode 100644 index 9364e3f870b..00000000000 --- a/mozilla/layout/generic/nsHTMLContainerFrame.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLContainerFrame_h___ -#define nsHTMLContainerFrame_h___ - -#include "nsContainerFrame.h" -class nsString; - -// Base class for html container frames that provides common -// functionality. -class nsHTMLContainerFrame : public nsContainerFrame { -public: - nsHTMLContainerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); - - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor); - -#if 0 - virtual ReflowStatus IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); -#endif - -protected: - virtual ~nsHTMLContainerFrame(); - - virtual PRIntn GetSkipSides() const = 0; - - void TriggerLink(nsIPresContext& aPresContext, - const nsString& aBase, - const nsString& aURLSpec, - const nsString& aTargetSpec); - -#if 0 - virtual ReflowStatus ReflowAppended(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); - - virtual ReflowStatus ReflowInserted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); - - virtual ReflowStatus ReflowDeleted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); - - virtual ReflowStatus ReflowChanged(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); -#endif -}; - -#endif /* nsHTMLContainerFrame_h___ */ diff --git a/mozilla/layout/generic/nsHTMLParts.h b/mozilla/layout/generic/nsHTMLParts.h deleted file mode 100644 index 4004a300b13..00000000000 --- a/mozilla/layout/generic/nsHTMLParts.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLParts_h___ -#define nsHTMLParts_h___ - -#include "nscore.h" -#include "nsISupports.h" -class nsIArena; -class nsIAtom; -class nsIContent; -class nsIDocument; -class nsIHTMLContent; -class nsIHTMLContentSink; -class nsITextContent; -class nsIURL; -class nsString; - -// XXX naming consistency puhleeze! - -extern nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult, - nsIDocument* aDoc, - nsIURL* aURL); - -// Create an html root part -extern nsresult - NS_NewRootPart(nsIHTMLContent** aInstancePtrResult, - nsIDocument* aDocument); - -// Create an html body part -extern nsresult - NS_NewBodyPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -// Create a new generic html container (e.g. P, DIV, SPAN, B, I, etc). -// Not used for tables or framesets (see below). -extern nsresult - NS_NewHTMLContainer(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); -extern nsresult - NS_NewHTMLContainer(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, nsIAtom* aTag); - -extern nsresult - NS_NewHTMLBreak(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag); - -extern nsresult - NS_NewHTMLWordBreak(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag); - -extern nsresult - NS_NewHTMLSpacer(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag); - -// Create a new text content object. The memory for the unicode string -// will be allocated from the heap. The object returned will support -// the nsIHTMLContent interface as well as the nsITextContent -// interface -extern nsresult - NS_NewHTMLText(nsIHTMLContent** aInstancePtrResult, - const PRUnichar* us, PRInt32 uslen = 0); -extern nsresult - NS_NewHTMLText(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, const PRUnichar* us, PRInt32 uslen = 0); - -// Create a new text content object. The memory for the unicode string -// is allocated by the caller. The caller is responsible for -// deallocating the memory (e.g. use an nsIArena). The object returned -// will support the nsIHTMLContent interface as well as the -// nsITextContent interface -extern nsresult - NS_NewSharedHTMLText(nsIHTMLContent** aInstancePtrResult, - PRUnichar* us, PRInt32 uslen = 0); -extern nsresult - NS_NewSharedHTMLText(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, PRUnichar* us, PRInt32 uslen = 0); - -/** Create a new horizontal rule content object (e.g
    .) */ -extern nsresult -NS_NewHRulePart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table content object
    */ -extern nsresult -NS_NewTablePart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table row group object */ -extern nsresult -NS_NewTableRowGroupPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table row content object */ -extern nsresult -NS_NewTableRowPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table column group content object */ -extern nsresult -NS_NewTableColGroupPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table column content object */ -extern nsresult -NS_NewTableColPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table cell content object -
    */ -extern nsresult -NS_NewTableCellPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table caption content object
    */ -extern nsresult -NS_NewTableCaptionPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -extern nsresult -NS_NewHTMLImage(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -#endif /* nsHTMLParts_h___ */ diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h deleted file mode 100644 index 7d1b8f97851..00000000000 --- a/mozilla/layout/generic/nsIFrame.h +++ /dev/null @@ -1,406 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIFrame_h___ -#define nsIFrame_h___ - -#include -#include "nslayout.h" -#include "nsISupports.h" -#include "nsSize.h" -#include "nsGUIEvent.h" - -class nsIContent; -class nsIPresContext; -class nsIPresShell; -class nsIRenderingContext; -class nsISpaceManager; -class nsIStyleContext; -class nsIView; -class nsIWidget; -class nsReflowCommand; - -struct nsPoint; -struct nsRect; -struct nsReflowMetrics; -struct nsStyleStruct; - -// IID for the nsIFrame interface {12B193D0-9F70-11d1-8500-00A02468FAB6} -#define NS_IFRAME_IID \ -{ 0x12b193d0, 0x9f70, 0x11d1, \ - {0x85, 0x0, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}} - -/** - * Reflow metrics used to return the frame's desired size and alignment - * information. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - * @see #GetReflowMetrics() - */ -struct nsReflowMetrics { - nscoord width, height; - nscoord ascent, descent; -}; - -/** - * Constant used to indicate an unconstrained size. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - */ -#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE - -/** - * A frame in the layout model. This interface is supported by all frame - * objects. - * - * Frames are NOT reference counted. Use the DeleteFrame() member function - * instead - */ -class nsIFrame : private nsISupports -{ -public: - /** - * QueryInterface() defined in nsISupports. This is the only member - * function of nsISupports that is public. - */ - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr) = 0; - - /** - * Deletes this frame and each of its child frames (recursively calls - * DeleteFrame() for each child) - */ - NS_IMETHOD DeleteFrame() = 0; - - /** - * Get the content object associated with this frame. Adds a reference to - * the content object so the caller must do a release. - * - * @see nsISupports#Release() - */ - NS_IMETHOD GetContent(nsIContent*& aContent) const = 0; - - /** - * Get/Set the frame's index in parent. - */ - NS_IMETHOD GetIndexInParent(PRInt32& aIndexInParent) const = 0; - NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent) = 0; - - /** - * Get the style context associated with this frame. Note that GetStyleContext() - * adds a reference to the style context so the caller must do a release. - * - * @see nsISupports#Release() - */ - NS_IMETHOD GetStyleContext(nsIPresContext* aContext, - nsIStyleContext*& aStyleContext) = 0; - NS_IMETHOD SetStyleContext(nsIStyleContext* aContext) = 0; - - /** - * Get the style data associated with this frame - */ - NS_IMETHOD GetStyleData(const nsIID& aSID, nsStyleStruct*& aStyleStruct) = 0; - - /** - * Accessor functions for geometric and content parent. - */ - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetContentParent(const nsIFrame* aParent) = 0; - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent) = 0; - - /** - * Bounding rect of the frame. The values are in twips, and the origin is - * relative to the upper-left of the geometric parent. The size includes the - * content area, borders, and padding. - */ - NS_IMETHOD GetRect(nsRect& aRect) const = 0; - NS_IMETHOD GetOrigin(nsPoint& aPoint) const = 0; - NS_IMETHOD GetSize(nsSize& aSize) const = 0; - NS_IMETHOD SetRect(const nsRect& aRect) = 0; - NS_IMETHOD MoveTo(nscoord aX, nscoord aY) = 0; - NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight) = 0; - - /** - * Child frame enumeration - */ - NS_IMETHOD ChildCount(PRInt32& aChildCount) const = 0; - NS_IMETHOD ChildAt(PRInt32 aIndex, nsIFrame*& aFrame) const = 0; - NS_IMETHOD IndexOf(const nsIFrame* aChild, PRInt32& aIndex) const = 0; - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const = 0; - NS_IMETHOD NextChild(const nsIFrame* aChild, nsIFrame*& aNextChild) const = 0; - NS_IMETHOD PrevChild(const nsIFrame* aChild, nsIFrame*& aPrevChild) const = 0; - NS_IMETHOD LastChild(nsIFrame*& aLastChild) const = 0; - - /** - * Painting - */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) = 0; - - /** - * Handle an event. - */ - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) = 0; - - /** - * Get the cursor for a given point in the frame tree. The - * call returns the desired cursor (or NS_STYLE_CURSOR_INHERIT if - * no cursor is wanted). In addition, if a cursor is desired - * then *aFrame is set to the frame that wants the cursor. - */ - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) = 0; - - /** - * Reflow status returned by the reflow methods. frNotComplete means you didn't - * map all your content, and so your parent should create a continuing frame - * for you. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - * @see #CreateContinuingFrame() - */ - enum ReflowStatus {frComplete, frNotComplete}; - - /** - * Resize reflow. The frame is given a maximum size and asked for its desired - * size. This is the frame's opportunity to reflow its children. - * - * @param aDesiredSize out parameter where you should return the - * desired size and ascent/descent info. You should include any - * space you want for border/padding in the desired size you return. - * @param aMaxSize the available space in which to lay out. Each dimension - * can either be constrained or unconstrained (a value of - * NS_UNCONSTRAINEDSIZE). If constrained you should choose a value that's - * less than or equal to the constrained size. If unconstrained you can - * choose as large a value as you like. - * - * It's okay to return a desired size that exceeds the max size if that's - * the smallest you can be, i.e. it's your minimum size. - * - * @param aMaxElementSize an optional parameter for returning your maximum - * element size. If may be null in which case you don't have to compute - * a maximum element size. The maximum element size must be less than or - * equal to your desired size. - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) = 0; - - /** - * Post-processing reflow method invoked when justification is enabled. - * This is always called after ResizeReflow/IncrementalReflow. - * - * @param aAvailableSpace The amount of available space that the frame - * should distribute internally. - */ - NS_IMETHOD JustifyReflow(nsIPresContext* aPresContext, - nscoord aAvailableSpace) = 0; - - /** - * Incremental reflow. The reflow command contains information about the - * type of change. The frame is given a maximum size and asked for its - * desired size. - * - * @param aDesiredSize out parameter where you should return - * the desired size and ascent/descent info. You should - * include any space you want for border/padding in the - * desired size you return. - * - * @param aMaxSize the available space in which to lay out. Each - * dimension can either be constrained or unconstrained (a - * value of NS_UNCONSTRAINEDSIZE). If constrained you - * should choose a value that's less than or equal to the - * constrained size. If unconstrained you can choose as - * large a value as you like. It's okay to return a - * desired size that exceeds the max size if that's the - * smallest you can be, i.e. it's your minimum size. - * - * @see nsReflowCommand#GetTarget() - * @see nsReflowCommand#GetType() - */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) = 0; - - /** - * This call is invoked when content is appended to the content - * tree. The container frame that maps that content is asked to deal - * with the appended content by creating new frames and updating the - * index-in-parent values for it's affected children. In addition, - * the call must generate reflow commands that will incrementally - * reflow and repair the damaged portion of the frame tree. - */ - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) = 0; - - /** - * This call is invoked when content is inserted in the content - * tree. The container frame that maps that content is asked to deal - * with the inserted content by creating new frames and updating the - * index-in-parent values for it's affected children. In addition, - * the call must generate reflow commands that will incrementally - * reflow and repair the damaged portion of the frame tree. - * - * @param aIndexInParent the index in the content container where - * the new content was inserted. - */ - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) = 0; - - /** - * This call is invoked when content is replaced in the content - * tree. The container frame that maps that content is asked to deal - * with the replaced content by deleting old frames and then - * creating new frames and updating the index-in-parent values for - * it's affected children. In addition, the call must generate - * reflow commands that will incrementally reflow and repair the - * damaged portion of the frame tree. - * - * @param aIndexInParent the index in the content container where - * the new content was inserted. */ - NS_IMETHOD ContentReplaced(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInParent) = 0; - - /** - * This call is invoked when content is deleted from the content - * tree. The container frame that maps that content is asked to deal - * with the deleted content by deleting frames and updating the - * index-in-parent values for it's affected children. In addition, - * the call must generate reflow commands that will incrementally - * reflow and repair the damaged portion of the frame tree. - * - * @param aIndexInParent the index in the content container where - * the new content was deleted. - */ - NS_IMETHOD ContentDeleted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) = 0; - - /** - * Return the reflow metrics for this frame. If the frame is a - * container then the values for ascent and descent are computed - * across the the various children in the appropriate manner - * (e.g. for a line frame the ascent value would be the maximum - * ascent of the line's children). Note that the metrics returned - * apply to the frame as it exists at the time of the call. - */ - NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics) = 0; - - /** - * Indication of how the frame can be split. This is used when doing runaround - * of floaters, and when pulling up child frames from a next-in-flow. - * - * The choices are splittable, not splittable at all, and splittable in - * a non-rectangular fashion. This last type only applies to block-level - * elements, and indicates whether splitting can be used when doing runaround. - * If you can split across page boundaries, but you expect each continuing - * frame to be the same width then return frSplittable and not - * frSplittableNonRectangular. - * - * @see #IsSplittable() - */ - enum SplittableType {frNotSplittable = 0, frSplittable = 1, frSplittableNonRectangular = 3}; - - /** - * Return how your frame can be split. - */ - NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const = 0; - - /** - * Flow member functions. CreateContinuingFrame() is responsible for appending - * the continuing frame to the flow. - */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) = 0; - - NS_IMETHOD GetPrevInFlow(nsIFrame*& aPrevInFlow) const = 0; - NS_IMETHOD SetPrevInFlow(nsIFrame*) = 0; - NS_IMETHOD GetNextInFlow(nsIFrame*& aNextInFlow) const = 0; - NS_IMETHOD SetNextInFlow(nsIFrame*) = 0; - - NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame) = 0; - NS_IMETHOD PrependToFlow(nsIFrame* aBeforeFrame) = 0; - NS_IMETHOD RemoveFromFlow() = 0; - NS_IMETHOD BreakFromPrevFlow() = 0; - NS_IMETHOD BreakFromNextFlow() = 0; - - /** - * Accessor functions to get/set the associated view object - */ - NS_IMETHOD GetView(nsIView*& aView) const = 0; // may be null - NS_IMETHOD SetView(nsIView* aView) = 0; - - /** - * Find the first geometric parent that has a view - */ - NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const = 0; - - /** - * Returns the offset from this frame to the closest geometric parent that - * has a view. Also returns the containing view or null in case of error - */ - NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const = 0; - - /** - * Returns the window that contains this frame. If this frame has a - * view and the view has a window, then this frames window is - * returned, otherwise this frame's geometric parent is checked - * recursively upwards. - */ - NS_IMETHOD GetWindow(nsIWidget*&) const = 0; - - /** - * Sibling pointer used to link together frames - */ - NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const = 0; - NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling) = 0; - - // Debugging - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const= 0; - NS_IMETHOD ListTag(FILE* out = stdout) const = 0; - NS_IMETHOD VerifyTree() const = 0; - - // Show frame borders when rendering - static NS_LAYOUT void ShowFrameBorders(PRBool aEnable); - static NS_LAYOUT PRBool GetShowFrameBorders(); -}; - -#endif /* nsIFrame_h___ */ diff --git a/mozilla/layout/generic/nsImageMap.cpp b/mozilla/layout/generic/nsImageMap.cpp deleted file mode 100644 index 3bca969fa62..00000000000 --- a/mozilla/layout/generic/nsImageMap.cpp +++ /dev/null @@ -1,710 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIImageMap.h" -#include "nsString.h" -#include "nsVoidArray.h" -#include "nsCoord.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIURL.h" - -#undef SCALE -#define SCALE(a,b) nscoord((a) * (b)) - -class Area { -public: - Area(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - virtual ~Area(); - - void ParseCoords(const nsString& aSpec); - - virtual PRBool IsInside(nscoord x, nscoord y) = 0; - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC) = 0; - virtual void GetShapeName(nsString& aResult) = 0; - - void ToHTML(nsString& aResult); - - const nsString& GetBase() const { return mBase; } - const nsString& GetHREF() const { return mHREF; } - const nsString& GetTarget() const { return mTarget; } - const nsString& GetAltText() const { return mAltText; } - PRBool GetSuppress() const { return mSuppressFeedback; } - - nsString mBase; - nsString mHREF; - nsString mTarget; - nsString mAltText; - nscoord* mCoords; - PRInt32 mNumCoords; - PRBool mSuppressFeedback; -}; - -Area::Area(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : mBase(aBaseURL), mHREF(aHREF), mTarget(aTarget), mAltText(aAltText), - mSuppressFeedback(aSuppress) -{ - mCoords = nsnull; - mNumCoords = 0; -} - -Area::~Area() -{ - delete [] mCoords; -} - -// XXX move into nsCRT -#define XP_IS_SPACE(_ch) \ - (((_ch) == ' ') || ((_ch) == '\t') || ((_ch) == '\r') || ((_ch) == '\n')) - -#include -#define XP_ATOI(_s) ::atoi(_s) - -// XXX straight copy from laymap.c -static nscoord* lo_parse_coord_list(char *str, PRInt32* value_cnt) -{ - char *tptr; - char *n_str; - PRInt32 i, cnt; - PRInt32 *value_list; - - /* - * Nothing in an empty list - */ - *value_cnt = 0; - if ((str == NULL)||(*str == '\0')) - { - return((PRInt32 *)NULL); - } - - /* - * Skip beginning whitespace, all whitespace is empty list. - */ - n_str = str; - while (XP_IS_SPACE(*n_str)) - { - n_str++; - } - if (*n_str == '\0') - { - return((PRInt32 *)NULL); - } - - /* - * Make a pass where any two numbers separated by just whitespace - * are given a comma separator. Count entries while passing. - */ - cnt = 0; - while (*n_str != '\0') - { - PRBool has_comma; - - /* - * Skip to a separator - */ - tptr = n_str; - while ((!XP_IS_SPACE(*tptr))&&(*tptr != ',')&&(*tptr != '\0')) - { - tptr++; - } - n_str = tptr; - - /* - * If no more entries, break out here - */ - if (*n_str == '\0') - { - break; - } - - /* - * Skip to the end of the separator, noting if we have a - * comma. - */ - has_comma = PR_FALSE; - while ((XP_IS_SPACE(*tptr))||(*tptr == ',')) - { - if (*tptr == ',') - { - if (has_comma == PR_FALSE) - { - has_comma = PR_TRUE; - } - else - { - break; - } - } - tptr++; - } - /* - * If this was trailing whitespace we skipped, we are done. - */ - if ((*tptr == '\0')&&(has_comma == PR_FALSE)) - { - break; - } - /* - * Else if the separator is all whitespace, and this is not the - * end of the string, add a comma to the separator. - */ - else if (has_comma == PR_FALSE) - { - *n_str = ','; - } - - /* - * count the entry skipped. - */ - cnt++; - - n_str = tptr; - } - /* - * count the last entry in the list. - */ - cnt++; - - *value_cnt = cnt; - - /* - * Allocate space for the coordinate array. - */ - value_list = new nscoord[cnt]; - if (value_list == NULL) - { - return((PRInt32 *)NULL); - } - - /* - * Second pass to copy integer values into list. - */ - tptr = str; - for (i=0; i'); -} - -//---------------------------------------------------------------------- - -class DefaultArea : public Area { -public: - DefaultArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~DefaultArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -DefaultArea::DefaultArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -DefaultArea::~DefaultArea() -{ -} - -PRBool DefaultArea::IsInside(nscoord x, nscoord y) -{ - return PR_TRUE; -} - -void DefaultArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ -} - -void DefaultArea::GetShapeName(nsString& aResult) -{ - aResult.Append("default"); -} - -//---------------------------------------------------------------------- - -class RectArea : public Area { -public: - RectArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~RectArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -RectArea::RectArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -RectArea::~RectArea() -{ -} - -PRBool RectArea::IsInside(nscoord x, nscoord y) -{ - if (mNumCoords >= 4) { // Note: > is for nav compatabilty - nscoord x1 = mCoords[0]; - nscoord y1 = mCoords[1]; - nscoord x2 = mCoords[2]; - nscoord y2 = mCoords[3]; - if ((x1 > x2)|| (y1 > y2)) { - // Can't be inside a screwed up rect - return PR_FALSE; - } - if ((x >= x1) && (x <= x2) && (y >= y1) && (y <= y2)) { - return PR_TRUE; - } - } - return PR_FALSE; -} - -void RectArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - if (mNumCoords >= 4) { - float p2t = aCX.GetPixelsToTwips(); - nscoord x1 = SCALE(p2t, mCoords[0]); - nscoord y1 = SCALE(p2t, mCoords[1]); - nscoord x2 = SCALE(p2t, mCoords[2]); - nscoord y2 = SCALE(p2t, mCoords[3]); - if ((x1 > x2)|| (y1 > y2)) { - return; - } - aRC.DrawRect(x1, y1, x2 - x1, y2 - y1); - } -} - -void RectArea::GetShapeName(nsString& aResult) -{ - aResult.Append("rect"); -} - -//---------------------------------------------------------------------- - -class PolyArea : public Area { -public: - PolyArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~PolyArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -PolyArea::PolyArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -PolyArea::~PolyArea() -{ -} - -PRBool PolyArea::IsInside(nscoord x, nscoord y) -{ - if (mNumCoords >= 6) { - PRInt32 intersects = 0; - nscoord wherex = x; - nscoord wherey = y; - PRInt32 totalv = mNumCoords / 2; - PRInt32 totalc = totalv * 2; - nscoord xval = mCoords[totalc - 2]; - nscoord yval = mCoords[totalc - 1]; - PRInt32 end = totalc; - PRInt32 pointer = 1; - - if ((yval >= wherey) != (mCoords[pointer] >= wherey)) - if ((xval >= wherex) == (mCoords[0] >= wherex)) - intersects += (xval >= wherex) ? 1 : 0; - else - intersects += ((xval - (yval - wherey) * - (mCoords[0] - xval) / - (mCoords[pointer] - yval)) >= wherex) ? 1 : 0; - - // XXX I wonder what this is doing; this is a translation of ptinpoly.c - while (pointer < end) { - yval = mCoords[pointer]; - pointer += 2; - if (yval >= wherey) { - while((pointer < end) && (mCoords[pointer] >= wherey)) - pointer+=2; - if (pointer >= end) - break; - if ((mCoords[pointer-3] >= wherex) == - (mCoords[pointer-1] >= wherex)) { - intersects += (mCoords[pointer-3] >= wherex) ? 1 : 0; - } else { - intersects += - ((mCoords[pointer-3] - (mCoords[pointer-2] - wherey) * - (mCoords[pointer-1] - mCoords[pointer-3]) / - (mCoords[pointer] - mCoords[pointer - 2])) >= wherex) ? 1:0; - } - } else { - while((pointer < end) && (mCoords[pointer] < wherey)) - pointer+=2; - if (pointer >= end) - break; - if ((mCoords[pointer-3] >= wherex) == - (mCoords[pointer-1] >= wherex)) { - intersects += (mCoords[pointer-3] >= wherex) ? 1:0; - } else { - intersects += - ((mCoords[pointer-3] - (mCoords[pointer-2] - wherey) * - (mCoords[pointer-1] - mCoords[pointer-3]) / - (mCoords[pointer] - mCoords[pointer - 2])) >= wherex) ? 1:0; - } - } - } - if ((intersects & 1) != 0) { - return PR_TRUE; - } - } - return PR_FALSE; -} - -void PolyArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - if (mNumCoords >= 6) { - float p2t = aCX.GetPixelsToTwips(); - nscoord x0 = SCALE(p2t, mCoords[0]); - nscoord y0 = SCALE(p2t, mCoords[1]); - for (PRInt32 i = 2; i < mNumCoords; i += 2) { - nscoord x1 = SCALE(p2t, mCoords[i]); - nscoord y1 = SCALE(p2t, mCoords[i+1]); - aRC.DrawLine(x0, y0, x1, y1); - x0 = x1; - y0 = y1; - } - aRC.DrawLine(x0, y0, mCoords[0], mCoords[1]); - } -} - -void PolyArea::GetShapeName(nsString& aResult) -{ - aResult.Append("polygon"); -} - -//---------------------------------------------------------------------- - -class CircleArea : public Area { -public: - CircleArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~CircleArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -CircleArea::CircleArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -CircleArea::~CircleArea() -{ -} - -PRBool CircleArea::IsInside(nscoord x, nscoord y) -{ - // Note: > is for nav compatabilty - if (mNumCoords >= 3) { - nscoord x1 = mCoords[0]; - nscoord y1 = mCoords[1]; - nscoord radius = mCoords[2]; - if (radius < 0) { - return PR_FALSE; - } - nscoord dx = x1 - x; - nscoord dy = y1 - y; - nscoord dist = (dx * dx) + (dy * dy); - if (dist <= (radius * radius)) { - return PR_TRUE; - } - } - return PR_FALSE; -} - -void CircleArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - if (mNumCoords >= 3) { - float p2t = aCX.GetPixelsToTwips(); - nscoord x1 = SCALE(p2t, mCoords[0]); - nscoord y1 = SCALE(p2t, mCoords[1]); - nscoord radius = SCALE(p2t, mCoords[2]); - if (radius < 0) { - return; - } - nscoord x = x1 - radius / 2; - nscoord y = y1 - radius / 2; - nscoord w = 2 * radius; - aRC.DrawEllipse(x, y, w, w); - } -} - -void CircleArea::GetShapeName(nsString& aResult) -{ - aResult.Append("circle"); -} - -//---------------------------------------------------------------------- - -static NS_DEFINE_IID(kIImageMapIID, NS_IIMAGEMAP_IID); - -class ImageMapImpl : public nsIImageMap { -public: - ImageMapImpl(nsIAtom* aTag); - ~ImageMapImpl(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD SetName(const nsString& aMapName); - - NS_IMETHOD GetName(nsString& aResult); - - NS_IMETHOD AddArea(const nsString& aBaseURL, - const nsString& aShape, - const nsString& aCoords, - const nsString& aHREF, - const nsString& aTarget, - const nsString& aAltText, - PRBool aSuppress); - - NS_IMETHOD IsInside(nscoord aX, nscoord aY, - nsIURL* aDocURL, - nsString& aAbsURL, - nsString& aTarget, - nsString& aAltText, - PRBool* aSuppress); - - NS_IMETHOD IsInside(nscoord aX, nscoord aY); - - NS_IMETHOD Draw(nsIPresContext& aCX, nsIRenderingContext& aRC); - - nsString mName; - nsIAtom* mTag; - nsVoidArray mAreas; -}; - -ImageMapImpl::ImageMapImpl(nsIAtom* aTag) -{ - mTag = aTag; - NS_IF_ADDREF(aTag); -} - -ImageMapImpl::~ImageMapImpl() -{ - NS_IF_RELEASE(mTag); - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - delete area; - } -} - -NS_IMPL_ISUPPORTS(ImageMapImpl, kIImageMapIID); - -NS_IMETHODIMP ImageMapImpl::SetName(const nsString& aMapName) -{ - mName = aMapName; - return NS_OK; -} - -NS_IMETHODIMP ImageMapImpl::GetName(nsString& aResult) -{ - aResult = mName; - return NS_OK; -} - -NS_IMETHODIMP ImageMapImpl::AddArea(const nsString& aBaseURL, - const nsString& aShape, - const nsString& aCoords, - const nsString& aHREF, - const nsString& aTarget, - const nsString& aAltText, - PRBool aSuppress) -{ - Area* area; - if ((0 == aShape.Length()) || aShape.EqualsIgnoreCase("rect")) { - area = new RectArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } else if (aShape.EqualsIgnoreCase("poly") || - aShape.EqualsIgnoreCase("polygon")) { - area = new PolyArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } else if (aShape.EqualsIgnoreCase("circle")) { - area = new CircleArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } - else { - area = new DefaultArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } - area->ParseCoords(aCoords); - mAreas.AppendElement(area); - return NS_OK; -} - -NS_IMETHODIMP ImageMapImpl::IsInside(nscoord aX, nscoord aY, - nsIURL* aDocURL, - nsString& aAbsURL, - nsString& aTarget, - nsString& aAltText, - PRBool* aSuppress) -{ - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - if (area->IsInside(aX, aY)) { - NS_MakeAbsoluteURL(aDocURL, area->mBase, area->mHREF, aAbsURL); - aTarget = area->mTarget; - aAltText = area->mAltText; - *aSuppress = area->mSuppressFeedback; - return NS_OK; - } - } - return NS_NOT_INSIDE; -} - -NS_IMETHODIMP ImageMapImpl::IsInside(nscoord aX, nscoord aY) -{ - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - if (area->IsInside(aX, aY)) { - return NS_OK; - } - } - return NS_NOT_INSIDE; -} - -NS_IMETHODIMP ImageMapImpl::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - area->Draw(aCX, aRC); - } - return NS_OK; -} - -NS_HTML nsresult NS_NewImageMap(nsIImageMap** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - ImageMapImpl* it = new ImageMapImpl(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIImageMapIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp deleted file mode 100644 index 27734eb6e3f..00000000000 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ /dev/null @@ -1,1113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsInlineFrame.h" -#include "nsSize.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsCSSLayout.h" -#include "nsPlaceholderFrame.h" -#include "nsReflowCommand.h" -#include "nsHTMLAtoms.h" -#include "nsAbsoluteFrame.h" - -// XXX To Do: -// 2. horizontal child margins -// 3. borders/padding and splitting -// 4. child relative positioning -// 5. absolutely positioned children -// 6. direction support -// 7. CSS line-height property - -/* XXX */ -#include "nsHTMLIIDs.h" -#include "nsBlockFrame.h" - -#define DEFAULT_ASCENT_LEN 10 - -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -class nsInlineState -{ -public: - nsStyleFont* font; // style font - nsStyleSpacing* spacing; // style spacing - nsSize availSize; // available space in which to reflow (starts as max size minus insets) - nsSize* maxElementSize; // maximum element size (may be null) - nscoord x; // running x-offset (starts at left inner edge) - const nscoord y; // y-offset (top inner edge) - nscoord maxAscent; // max child ascent - nscoord maxDescent; // max child descent - nscoord* ascents; // ascent information for each child - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Constructor - nsInlineState(nsStyleFont* aStyleFont, - nsStyleSpacing* aSpacing, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) - : x(aSpacing->mBorderPadding.left), // determined by inner edge - y(aSpacing->mBorderPadding.top) // determined by inner edge - { - font = aStyleFont; - spacing = aSpacing; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - // If we're constrained adjust the available size so it excludes space - // needed for border/padding - availSize.width = aMaxSize.width; - if (PR_FALSE == unconstrainedWidth) { - availSize.width -= aSpacing->mBorderPadding.left + aSpacing->mBorderPadding.right; - } - availSize.height = aMaxSize.height; - if (PR_FALSE == unconstrainedHeight) { - availSize.height -= aSpacing->mBorderPadding.top + aSpacing->mBorderPadding.bottom; - } - - // Initialize max element size - maxElementSize = aMaxElementSize; - if (nsnull != maxElementSize) { - maxElementSize->SizeTo(0, 0); - } - - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - } - - void SetNumAscents(PRIntn aNumAscents) { - // We keep around ascent information so that we can vertically align - // children after we figure out how many children fit. - if (aNumAscents > DEFAULT_ASCENT_LEN) { - ascents = new nscoord[aNumAscents]; - } - } - - // Destructor - ~nsInlineState() { - if (ascents != ascentBuf) { - delete ascents; - } - } - -private: - nscoord ascentBuf[DEFAULT_ASCENT_LEN]; -}; - -///////////////////////////////////////////////////////////////////////////// -// - -nsresult nsInlineFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsInlineFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsInlineFrame::nsInlineFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ - NS_PRECONDITION(!IsPseudoFrame(), "can not be a pseudo frame"); -} - -nsInlineFrame::~nsInlineFrame() -{ -} - -void nsInlineFrame::PlaceChild(nsIFrame* aChild, - PRInt32 aIndex, - nsInlineState& aState, - const nsReflowMetrics& aChildSize, - const nsSize* aChildMaxElementSize) -{ - // Set the child's rect - aChild->SetRect(nsRect(aState.x, aState.y, aChildSize.width, aChildSize.height)); - - // Adjust the running x-offset - aState.x += aChildSize.width; - - // Update the array of ascents and the max ascent and descent - aState.ascents[aIndex] = aChildSize.ascent; - if (aChildSize.ascent > aState.maxAscent) { - aState.maxAscent = aChildSize.ascent; - } - if (aChildSize.descent > aState.maxDescent) { - aState.maxDescent = aChildSize.descent; - } - - // If we're constrained then update the available width - if (!aState.unconstrainedWidth) { - aState.availSize.width -= aChildSize.width; - } - - // Update the maximum element size - if (nsnull != aChildMaxElementSize) { - if (aChildMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aChildMaxElementSize->width; - } - if (aChildMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aChildMaxElementSize->height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsInlineFrame::ReflowMappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool originalLastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.width > aState.availSize.width) && (kidFrame != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - result = PR_FALSE; - break; - } - - // Place and size the child. We'll deal with vertical alignment when - // we're all done - PlaceChild(kidFrame, childCount, aState, kidSize, pKidMaxElementSize); - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Is the child complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No, the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count member data - mChildCount = childCount; -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, - nsInlineState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsInlineFrame* nextInFlow = (nsInlineFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list - NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow = (nsInlineFrame*)nextInFlow->mNextInFlow; - continue; - } - } - - // XXX if the frame being pulled up is not appropriate (e.g. a block - // frame) then we should stop! If we have an inline BR tag we should - // stop too! - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - if ((kidFrameSize.width > aState.availSize.width) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Place and size the child. We'll deal with vertical alignment when - // we're all done - PlaceChild(kidFrame, mChildCount, aState, kidSize, pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsInlineFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow = (nsInlineFrame*)nextInFlow->mNextInFlow; - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsInlineFrame* prev = (nsInlineFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - PRBool breakAfter = PR_FALSE; - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContent* kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.width <= 0) { - // Note: return status was set to frNotComplete above... - NS_RELEASE(kid); - break; - } - - // Resolve style for the child - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - - // Figure out how we should treat the child - nsIFrame* kidFrame; - nsStyleDisplay* kidDisplay = - (nsStyleDisplay*)kidStyleContext->GetData(kStyleDisplaySID); - nsStylePosition* kidPosition = (nsStylePosition*) - kidStyleContext->GetData(kStylePositionSID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidStyleContext); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidStyleContext); - } else if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - if (kidIndex != mFirstContentOffset) { - // We don't allow block elements to be placed in us anywhere - // other than at our left margin. - NS_RELEASE(kidStyleContext); - NS_RELEASE(kid); - goto done; - } - // FALLTHROUGH - - case NS_STYLE_DISPLAY_INLINE: - // XXX temporary hack to make plain BR's in inlines "work" - // get style for break-before-after; get break-type (line, page, etc.) - { - nsIAtom* tag = kid->GetTag(); - if (nsHTMLAtoms::br == tag) { - // Set break-after flag so we stop mapping children (we - // will end up being continued if there are more children) - breakAfter = PR_TRUE; - - // Get cached state for containing block frame - // XXX how about QueryInterface(kIHTMLBlockFrameIID)? DOH! - nsBlockReflowState* state = nsnull; - nsIFrame* parent = mGeometricParent; - while (nsnull != parent) { - nsIHTMLFrameType* ft; - nsresult status = - parent->QueryInterface(kIHTMLFrameTypeIID, (void**) &ft); - if (NS_OK == status) { - nsHTMLFrameType type = ft->GetFrameType(); - if (eHTMLFrame_Block == type) { - break; - } - } - parent->GetGeometricParent(parent); - } - if (nsnull != parent) { - nsIPresShell* shell = aPresContext->GetShell(); - state = (nsBlockReflowState*) shell->GetCachedData(parent); - // XXX Of course this won't work if the inline span is nested - // in another inline span! - state->breakAfterChild = PR_TRUE; - NS_RELEASE(shell); - } - } - NS_IF_RELEASE(tag); - } - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - NS_RELEASE(kid); - NS_RELEASE(kidStyleContext); - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - // Place and size the child. We'll deal with vertical alignment when - // we're all done - PlaceChild(kidFrame, mChildCount, aState, kidSize, pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - - // If we need to break after the kidFrame, then do so now - if (breakAfter) { - break; - } - } - -done:; - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - -NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -//XXX not now NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "unexpected max size"); - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; // initialize out parameter - - // Get the style molecule - nsStyleFont* styleFont = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsStyleSpacing* styleSpacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - - // Check for an overflow list - MoveOverflowToChildList(); - - // Initialize our reflow state. We must wait until after we've processed - // the overflow list, because our first content offset might change - nsInlineState state(styleFont, styleSpacing, aMaxSize, aMaxElementSize); - state.SetNumAscents(mContent->ChildCount() - mFirstContentOffset); - - // Reflow any existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state); - - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.width <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = ReflowUnmappedChildren(aPresContext, state); - } - } else { - // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; - } - } - } - - const nsMargin& insets = styleSpacing->mBorderPadding; - - // Vertically align the children - nscoord lineHeight = - nsCSSLayout::VerticallyAlignChildren(aPresContext, this, styleFont, - insets.top, mFirstChild, mChildCount, - state.ascents, state.maxAscent); - - // XXX I don't think our return size properly accounts for the lineHeight - // (which may not == state.maxAscent + state.maxDescent) - // Return our size and our status - aDesiredSize.width = state.x + insets.right; - aDesiredSize.ascent = insets.top + state.maxAscent; - aDesiredSize.descent = state.maxDescent + insets.bottom; - aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - return NS_OK; -} - -///////////////////////////////////////////////////////////////////////////// - -PRIntn nsInlineFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_LEFT; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_RIGHT; - } - return skip; -} - -///////////////////////////////////////////////////////////////////////////// - -// Incremental reflow support - -NS_METHOD nsInlineFrame::GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics) -{ - nscoord maxAscent = 0; - nscoord maxDescent = 0; - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsReflowMetrics kidMetrics; - kid->GetReflowMetrics(aPresContext, kidMetrics); - if (kidMetrics.ascent > maxAscent) maxAscent = kidMetrics.ascent; - if (kidMetrics.descent > maxDescent) maxDescent = kidMetrics.descent; - kid->GetNextSibling(kid); - } - - // XXX what about border & padding - aMetrics.width = mRect.width; - aMetrics.height = mRect.height; - aMetrics.ascent = maxAscent; - aMetrics.descent = maxDescent; - - return NS_OK; -} - -/** - * Setup aState to the state it would have had we just reflowed our - * children up to, but not including, aSkipChild. Return the index - * of aSkipChild in our list of children. - */ -PRIntn nsInlineFrame::RecoverState(nsIPresContext* aPresContext, - nsInlineState& aState, - nsIFrame* aSkipChild) -{ - // Get ascent & descent info for all the children up to but not - // including aSkipChild. Also compute the x coordinate for where - // aSkipChild will be place after it is reflowed. - PRIntn i = 0; - nsIFrame* kid = mFirstChild; - nscoord x = aState.x; - nscoord maxAscent = 0; - nscoord maxDescent = 0; - while (kid != aSkipChild) { - nsReflowMetrics kidMetrics; - kid->GetReflowMetrics(aPresContext, kidMetrics); - aState.ascents[i] = kidMetrics.ascent; - if (kidMetrics.ascent > maxAscent) maxAscent = kidMetrics.ascent; - if (kidMetrics.descent > maxDescent) maxDescent = kidMetrics.descent; - - // XXX Factor in left and right margins - x += kidMetrics.width; - - kid->GetNextSibling(kid); - i++; - } - aState.maxAscent = maxAscent; - aState.maxDescent = maxDescent; - aState.x = x; - return (nsnull == aSkipChild) ? 0 : i; -} - -NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; // initialize out parameter - -#if 0 - if (aReflowCommand.GetTarget() == this) { - // NOTE: target frame is first in flow even when reflow commands - // applies to some piece of content in any of the next-in-flows - nsInlineFrame* flow = this; - - switch (aReflowCommand.GetType()) { - case nsReflowCommand::rcContentAppended: - // Get to last-in-flow where the append is occuring - while (nsnull != flow->mNextInFlow) { - flow = flow->mNextInFlow; - } - aStatus = flow->ReflowUnmappedChildren(...); - break; - - case nsReflowCommand::rcContentInserted: - // XXX where did the insertion point go? - - // Get to correct next-in-flow - // XXX this is more complicated when dealing with pseudo children - PRInt32 contentIndex = 0; - while (nsnull != flow->mNextInFlow) { - // XXX the last child we have may be continued into our - // next-in-flow which means that endIndex is wrong??? - PRInt32 endIndex = contentIndex + mChildCount; - if ((contentIndex <= aIndexInParent) && (aIndexInParent < endIndex)) { - break; - } - flow = flow->mNextInFlow; - contentIndex = endIndex; - } - - // Create frame and insert it into the sibling list at the right - // spot. Reflow it. Adjust position of siblings including - // pushing frames that don't fit. - flow->ReflowUnmappedChild(..., index information); - break; - - case nsReflowCommand::rcContentDeleted: - // XXX what about will-delete, did-delete? - - // Find the affected flow blocks and remove the child and any - // continuations it has from the flow. Every flow block except - // the first one will recieve a reflow command to cleanup after - // the first flow block does it's clean up. Except for the - // post-processing (impacting sibling frames) the code is - // generic across container types. - break; - - case nsReflowCommand::rcContentChanged: - // XXX The piece of content affected may change stylistically - // from inline to block. If it does and it's not our first kid - // then we just push it and let our next-in-flow reflow it. - - // Either: a) delete the old frame, create a new frame, reflow -or- - // b) ResizeReflow the affected child - - // If the reflow status is incomplete then the remaining - // children on the line get pushed; else only push children that - // don't fit. If no pushing occurs then maybe we can pullup a - // child; if we do then generate reflow commands for our - // next-in-flows to deal with a pull event. - break; - } - - } else { - // XXX Tuneup? if we save the child's continuation status and its - // current bounding rect and then pass the command down and it - // comes back with the same bounds in aDesiredSize and with the - // same continuation status then we are done, right? - - // Get the next frame that the reflow command is targeted at. - // This will be one of my children. - nsIFrame* nextInChain = aReflowCommand.GetNext(); - NS_ASSERTION(this == nextInChain->GetGeometricParent(), "bad reflow cmd"); - - // Recover the reflow state as if we had reflowed our children up - // to but not including the child that is next in the reflow chain - nsInlineState state(aMaxSize, nsnull); - state.SetNumAscents(mChildCount); - PRIntn nextIndex = RecoverState(aPresContext, state, nextInChain); - - // Save away the current location and size of the child which the - // reflow command is targeted towards. This isn't strictly - // necessary, but our child might tamper with it's x/y - // XXX bother? - nsRect oldBounds; - nextInChain->GetRect(oldBounds); - - // Now pass reflow command down to our child to handle - nsReflowMetrics kidMetrics; - aStatus = aReflowCommand.Next(kidMetrics, aMaxSize, kid); - // XXX what do we do when the nextInChain's completion status changes? - // XXX if kid == LastChild() then mLastContentIsComplete needs updating - - // Update placement information for the impacted child frame and - // any other frames following the child frame. - if ((oldBounds.width == kidMetrics.width) && - (oldBounds.height == kidMetrics.height)) { - // The child didn't change as far as we can tell. Nobody needs - // to be moved. - - // XXX what about a child who's shape is the same but who's - // reflow status is frNotComplete? - - // Note: a child that used to be continued and is no longer - // continued and whose size is unchanged: we don't care because - // as far as we are concerned nothing happened to us. However, - // our next-in-flow might get torched (our parent will deal with - // that). - - // XXX figure out the right status to return - } else { - // Factor in ascent information from the updated child - state.ascents[nextIndex] = kidMetrics.ascent; - if (kidMetrics.ascent > state.maxAscent) { - state.maxAscent = kidMetrics.ascent; - } - if (kidMetrics.descent > state.maxDescent) { - state.maxDescent = kidMetrics.descent; - } - - // Update other children that are impacted by the change in - // nextInChain. In addition, re-apply vertical alignment and - // relative positioning to the children on the line. - aStatus = AdjustChildren(aPresContext, aDesiredSize, aState, kid, - kidMetrics, aStatus); - } - } -#endif - - return NS_OK; -} - - -// In order to execute the vertical alignment code after incremental -// reflow of the inline frame, we need to reposition any child frames -// that were relatively positioned back to their computed x origin. -// This should probably be done as a pre-alignment computation (and it -// can be avoided if there are no relatively positioned children). - -/** - * Adjust the position of all the children in this frame. - * - * The children after aKid in the list of children are slid over by - * dx. - * - * Once the x and y coordinates have been set, then the vertical - * alignment code is executed to place the children vertically and to - * compute the final height of our frame. - * - * If one of our children spills over the end then push it to the - * next-in-flow or to our overflow list. - */ -nsIFrame::ReflowStatus -nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsInlineState& aState, - nsIFrame* aKid, - nsReflowMetrics& aKidMetrics, - ReflowStatus aKidReflowStatus) -{ - nsStyleSpacing* spacing = aState.spacing; - nscoord xr = aState.availSize.width + spacing->mBorderPadding.left; - nscoord remainingSpace = xr - aState.x; - nscoord x = aState.x; - - // Slide all of the children over following aKid - nsIFrame* kid = aKid; - nsRect r; - while (nsnull != kid) { - kid->GetRect(r); - if (r.x != x) { - kid->MoveTo(x, r.y); - } - x += r.width; - // XXX factor in left and right margins - kid->GetNextSibling(kid); - } - - // Vertically align the children - const nsMargin& insets = spacing->mBorderPadding; - nsCSSLayout::VerticallyAlignChildren(aPresContext, this, aState.font, - insets.top, mFirstChild, mChildCount, - aState.ascents, aState.maxAscent); - - // XXX relative position children, if any - - // XXX adjust mLastContentOffset if we push - // XXX if we push, generate a reflow command - - return frComplete; -} - -// My container has new content at the end of it. Create frames for -// the appended content and then generate an incremental reflow -// command for ourselves. -NS_METHOD nsInlineFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last in flow - nsInlineFrame* flow = (nsInlineFrame*)GetLastInFlow(); - - // Get index of where the content has been appended - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - // Create frames for each new child - for (;;) { - // Get the next content object - nsIContent* kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - nsIContentDelegate* del = kid->GetDelegate(aPresContext); - nsIFrame* kidFrame = del->CreateFrame(aPresContext, kid, kidIndex, flow); - NS_RELEASE(del); - NS_RELEASE(kid); - - // Append kidFrame to the sibling list - prevKidFrame->SetNextSibling(kidFrame); - prevKidFrame = kidFrame; - kidIndex++; - } - flow->SetLastContentOffset(prevKidFrame); - - // Now generate a reflow command for flow - if (aContainer == mContent) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} diff --git a/mozilla/layout/generic/nsLeafFrame.cpp b/mozilla/layout/generic/nsLeafFrame.cpp deleted file mode 100644 index 912178cb2db..00000000000 --- a/mozilla/layout/generic/nsLeafFrame.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsLeafFrame.h" -#include "nsIStyleContext.h" -#include "nsCSSRendering.h" - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); - -nsLeafFrame::nsLeafFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsLeafFrame::~nsLeafFrame() -{ -} - -NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - return NS_OK; -} - -NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - // XXX add in code to check for width/height being set via css - // and if set use them instead of calling GetDesiredSize. - - GetDesiredSize(aPresContext, aDesiredSize, aMaxSize); - AddBordersAndPadding(aPresContext, aDesiredSize); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aDesiredSize.width; - aMaxElementSize->height = aDesiredSize.height; - } - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // XXX Unless the reflow command is a style change, we should - // just return the current size, otherwise we should invoke - // GetDesiredSize - - // XXX add in code to check for width/height being set via css - // and if set use them instead of calling GetDesiredSize. - GetDesiredSize(aPresContext, aDesiredSize, aMaxSize); - AddBordersAndPadding(aPresContext, aDesiredSize); - - aStatus = frComplete; - return NS_OK; -} - -// XXX how should border&padding effect baseline alignment? -// => descent = borderPadding.bottom for example -void nsLeafFrame::AddBordersAndPadding(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize) -{ - nsStyleSpacing* space = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - aDesiredSize.width += space->mBorderPadding.left + space->mBorderPadding.right; - aDesiredSize.height += space->mBorderPadding.top + space->mBorderPadding.bottom; - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; -} - -void nsLeafFrame::GetInnerArea(nsIPresContext* aPresContext, - nsRect& aInnerArea) const -{ - nsStyleSpacing* space = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - aInnerArea.x = space->mBorderPadding.left; - aInnerArea.y = space->mBorderPadding.top; - aInnerArea.width = mRect.width - - (space->mBorderPadding.left + space->mBorderPadding.right); - aInnerArea.height = mRect.height - - (space->mBorderPadding.top + space->mBorderPadding.bottom); -} - -NS_METHOD nsLeafFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - NS_NOTREACHED("Attempt to split the unsplittable"); - aContinuingFrame = nsnull; - return NS_OK; -} diff --git a/mozilla/layout/generic/nsLeafFrame.h b/mozilla/layout/generic/nsLeafFrame.h deleted file mode 100644 index e979cc2aa06..00000000000 --- a/mozilla/layout/generic/nsLeafFrame.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsLeafFrame_h___ -#define nsLeafFrame_h___ - -#include "nsFrame.h" - -/** - * Abstract class that provides simple fixed-size layout for leaf objects - * (e.g. images, form elements, etc.). Deriviations provide the implementation - * of the GetDesiredSize method. The rendering method knows how to render - * borders and backgrounds. - */ -class nsLeafFrame : public nsFrame { -public: - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - -protected: - nsLeafFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - virtual ~nsLeafFrame(); - - /** - * Return the desired size of the frame. Note that this method - * doesn't need to deal with padding or borders (the caller will - * deal with it). In addition, the ascent will be set to the height - * and the descent will be set to zero. - */ - virtual void GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) = 0; - - /** - * Get the inner rect of this frame. This takes the outer size (mRect) - * and subtracts off the borders and padding. - */ - void GetInnerArea(nsIPresContext* aPresContext, nsRect& aInnerArea) const; - - /** - * Subroutine to add in borders and padding - */ - void AddBordersAndPadding(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize); -}; - -#endif /* nsLeafFrame_h___ */ diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp deleted file mode 100644 index 7da6ddc801b..00000000000 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPageFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsReflowCommand.h" -#include "nsIRenderingContext.h" - -PageFrame::PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent) - : nsContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -void PageFrame::CreateFirstChild(nsIPresContext* aPresContext) -{ - // Create a frame for our one and only content child - if (mContent->ChildCount() > 0) { - nsIContent* child = mContent->ChildAt(0); - - if (nsnull != child) { - // Create a frame - nsIContentDelegate* cd = child->GetDelegate(aPresContext); - if (nsnull != cd) { - mFirstChild = cd->CreateFrame(aPresContext, child, 0, this); - if (nsnull != mFirstChild) { - mChildCount = 1; - mLastContentOffset = mFirstContentOffset; - - // Resolve style and set the style context - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(child, this); - mFirstChild->SetStyleContext(kidStyleContext); - NS_RELEASE(kidStyleContext); - } - NS_RELEASE(cd); - } - NS_RELEASE(child); - } - } -} - -NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - aStatus = frComplete; // initialize out parameter - - // Do we have any children? - if (nsnull == mFirstChild) { - if (nsnull == mPrevInFlow) { - // Create the first child frame - CreateFirstChild(aPresContext); - } else { - PageFrame* prevPage = (PageFrame*)mPrevInFlow; - - NS_ASSERTION(!prevPage->mLastContentIsComplete, "bad continuing page"); - nsIFrame* prevLastChild; - prevPage->LastChild(prevLastChild); - - // Create a continuing child of the previous page's last child - prevLastChild->CreateContinuingFrame(aPresContext, this, mFirstChild); - mChildCount = 1; - mLastContentOffset = mFirstContentOffset; - } - } - - // Resize our frame allowing it only to be as big as we are - // XXX Pay attention to the page's border and padding... - if (nsnull != mFirstChild) { - // Get the child's desired size - aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize, - aMaxElementSize); - mLastContentIsComplete = PRBool(aStatus == frComplete); - - // Make sure the child is at least as tall as our max size (the containing window) - if (aDesiredSize.height < aMaxSize.height) { - aDesiredSize.height = aMaxSize.height; - } - - // Place and size the child - nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); - mFirstChild->SetRect(rect); - - // Is the frame complete? - if (frComplete == aStatus) { - nsIFrame* childNextInFlow; - - mFirstChild->GetNextInFlow(childNextInFlow); - NS_ASSERTION(nsnull == childNextInFlow, "bad child flow list"); - } - } - - // Return our desired size - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = aMaxSize.height; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - return NS_OK; -} - -// XXX Do something sensible in page mode... -NS_METHOD PageFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // We don't expect the target of the reflow command to be page frame - NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target"); - - nsSize maxSize(aMaxSize.width, NS_UNCONSTRAINEDSIZE); - nsIFrame* child; - - // Dispatch the reflow command to our pseudo frame. Allow it to be as high - // as it wants - aStatus = aReflowCommand.Next(aDesiredSize, maxSize, child); - - // Place and size the child. Make sure the child is at least as - // tall as our max size (the containing window) - if (nsnull != child) { - NS_ASSERTION(child == mFirstChild, "unexpected reflow command frame"); - if (aDesiredSize.height < aMaxSize.height) { - aDesiredSize.height = aMaxSize.height; - } - - nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); - child->SetRect(rect); - } - - return NS_OK; -} - -NS_METHOD PageFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - PageFrame* cf = new PageFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD PageFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsContainerFrame::Paint(aPresContext, aRenderingContext, aDirtyRect); - - // For the time being paint a border around the page so we know - // where each page begins and ends - aRenderingContext.SetColor(NS_RGB(0, 0, 0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - return NS_OK; -} - -NS_METHOD PageFrame::ListTag(FILE* out) const -{ - fprintf(out, "*PAGE@%p", this); - return NS_OK; -} - diff --git a/mozilla/layout/generic/nsPageFrame.h b/mozilla/layout/generic/nsPageFrame.h deleted file mode 100644 index aaee82d3952..00000000000 --- a/mozilla/layout/generic/nsPageFrame.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsPageFrame_h___ -#define nsPageFrame_h___ - -#include "nsHTMLContainerFrame.h" - -// Pseudo frame created by the root content frame -class PageFrame : public nsContainerFrame { -public: - PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - // Debugging - NS_IMETHOD ListTag(FILE* out = stdout) const; - -protected: - void CreateFirstChild(nsIPresContext* aPresContext); -}; - -#endif /* nsPageFrame_h___ */ - diff --git a/mozilla/layout/generic/nsPlaceholderFrame.cpp b/mozilla/layout/generic/nsPlaceholderFrame.cpp deleted file mode 100644 index 902c2f2603f..00000000000 --- a/mozilla/layout/generic/nsPlaceholderFrame.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPlaceholderFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIFloaterContainer.h" - -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); - -nsresult -PlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new PlaceholderFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -PlaceholderFrame::PlaceholderFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsFrame(aContent, aIndexInParent, aParent) -{ - mAnchoredItem = nsnull; -} - -PlaceholderFrame::~PlaceholderFrame() -{ -} - -NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - // Get the floater container in which we're inserted - nsIFloaterContainer* container = nsnull; - - for (nsIFrame* parent = mGeometricParent; parent; parent->GetGeometricParent(parent)) { - if (NS_OK == parent->QueryInterface(kIFloaterContainerIID, (void**)&container)) { - break; - } - } - NS_ASSERTION(nsnull != container, "no floater container"); - - // Have we created the anchored item yet? - if (nsnull == mAnchoredItem) { - // Create the anchored item - nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext); - - mAnchoredItem = delegate->CreateFrame(aPresContext, mContent, mIndexInParent, - mGeometricParent); - NS_RELEASE(delegate); - - // Set the style context for the frame - mAnchoredItem->SetStyleContext(mStyleContext); - - // Resize reflow the anchored item into the available space - // XXX Check for complete? - mAnchoredItem->ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - mAnchoredItem->SizeTo(aDesiredSize.width, aDesiredSize.height); - - // Now notify our containing block that there's a new floater - container->AddFloater(aPresContext, mAnchoredItem, this); - } else { - container->PlaceFloater(aPresContext, mAnchoredItem, this); - } - - return nsFrame::ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, aStatus); -} - -NS_METHOD PlaceholderFrame::ListTag(FILE* out) const -{ - fputs("*placeholder", out); - fprintf(out, "(%d)@%p", mIndexInParent, this); - return NS_OK; -} diff --git a/mozilla/layout/generic/nsPlaceholderFrame.h b/mozilla/layout/generic/nsPlaceholderFrame.h deleted file mode 100644 index 6cae7e1c546..00000000000 --- a/mozilla/layout/generic/nsPlaceholderFrame.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsPlaceholderFrame_h___ -#define nsPlaceholderFrame_h___ - -#include "nsFrame.h" - -// Implementation of a frame that's used as a placeholder for an anchored item -class PlaceholderFrame : public nsFrame -{ -public: - /** - * Create a new placeholder frame - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - // Returns the associated anchored item - nsIFrame* GetAnchoredItem() const {return mAnchoredItem;} - - // Resize reflow methods - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - NS_IMETHOD ListTag(FILE* out = stdout) const; - -protected: - // Constructor. Takes as arguments the content object, the index in parent, - // and the Frame for the content parent - PlaceholderFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~PlaceholderFrame(); - - nsIFrame* mAnchoredItem; -}; - -#endif /* nsPlaceholderFrame_h___ */ diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp deleted file mode 100644 index 62551490edb..00000000000 --- a/mozilla/layout/generic/nsSelection.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSelection.h" -#include "nsISelection.h" - -nsresult nsSelection::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - static NS_DEFINE_IID(kISelectionIID, NS_ISELECTION_IID); - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kISelectionIID)) { - *aInstancePtrResult = (void*) ((nsISelection*)this); - //AddRef(); - return NS_OK; - } - return !NS_OK; -} - -nsSelection::nsSelection() { - mRange = new nsSelectionRange(); -} - -NS_IMPL_ADDREF(nsSelection) -NS_IMPL_RELEASE(nsSelection) - -/** - * Returns whether there is a valid selection - */ -PRBool nsSelection::IsValidSelection() { - return (PRBool)(mRange->GetStartContent() == nsnull || - mRange->GetEndContent() == nsnull); - -} - - -/** - * Clears the current selection (invalidates the selection) - */ -void nsSelection::ClearSelection() { - mRange->GetStartPoint()->SetPoint(nsnull, -1, PR_TRUE); - mRange->GetEndPoint()->SetPoint(nsnull, -1, PR_TRUE); -} - - - -/** - * Copies the data from one nsSelectionPoint in the range to another, - * it does NOT just assign the pointers - */ -void nsSelection::SetRange(nsSelectionRange * aSelectionRange) { - mRange->SetRange(aSelectionRange->GetStartPoint(), - aSelectionRange->GetEndPoint()); -} - -/** - * Copies the data from one nsSelectionPoint in the range to another, - * it does NOT just assign the pointers - */ -void nsSelection::GetRange(nsSelectionRange * aSelectionRange) { - mRange->SetRange(aSelectionRange->GetStartPoint(), - aSelectionRange->GetEndPoint()); -} - - -/** - * For debug only, it potentially leaks memory - */ -char * nsSelection::ToString() { - return mRange->ToString();; -} \ No newline at end of file diff --git a/mozilla/layout/generic/nsSpaceManager.cpp b/mozilla/layout/generic/nsSpaceManager.cpp deleted file mode 100644 index 780bedf1d40..00000000000 --- a/mozilla/layout/generic/nsSpaceManager.cpp +++ /dev/null @@ -1,670 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsSpaceManager.h" -#include "nsPoint.h" -#include "nsRect.h" -#include "nsSize.h" -#include - -static NS_DEFINE_IID(kISpaceManagerIID, NS_ISPACEMANAGER_IID); - -///////////////////////////////////////////////////////////////////////////// -// nsSpaceManager - -SpaceManager::SpaceManager(nsIFrame* aFrame) - : mFrame(aFrame) -{ - NS_INIT_REFCNT(); - mX = mY = 0; -} - -NS_IMPL_ISUPPORTS(SpaceManager, kISpaceManagerIID); - -nsIFrame* SpaceManager::GetFrame() const -{ - return mFrame; -} - -void SpaceManager::Translate(nscoord aDx, nscoord aDy) -{ - mX += aDx; - mY += aDy; -} - -void SpaceManager::GetTranslation(nscoord& aX, nscoord& aY) const -{ - aX = mX; - aY = mY; -} - -nscoord SpaceManager::YMost() const -{ - if (mRectArray.mCount > 0) { - return mRectArray.YMost(); - } else { - return 0; - } -} - -/** - * Internal function that returns the list of available and unavailable space - * within the band - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - * @param aY the y-offset in world coordinates - * @param aMaxSize the size to use to constrain the band data - * @param aAvailableBand - */ -PRInt32 SpaceManager::GetBandAvailableSpace(const nsBandRect* aBand, - PRInt32 aIndex, - nscoord aY, - const nsSize& aMaxSize, - nsBandData& aBandData) const -{ - PRInt32 numRects = LengthOfBand(aBand, aIndex); - nscoord localY = aY - mY; - nscoord height = PR_MIN(aBand->YMost() - aY, aMaxSize.height); - nsBandTrapezoid* trapezoid = aBandData.trapezoids; - nscoord rightEdge = mX + aMaxSize.width; - - // Initialize the band data - aBandData.count = 0; - - // Skip any rectangles that are to the left of the local coordinate space - while (numRects > 0) { - if (aBand->XMost() > mX) { - break; - } - - // Get the next rect in the band - aBand++; - numRects--; - } - - // This is used to track the current x-location within the band. This is in - // world coordinates - nscoord left = mX; - - // Process the remaining rectangles that are within the clip width - while ((numRects > 0) && (aBand->x < rightEdge)) { - // Compare the left edge of the occupied space with the current left - // coordinate - if (aBand->x > left) { - // The rect is to the right of our current left coordinate, so we've - // found some available space - trapezoid->state = nsBandTrapezoid::smAvailable; - trapezoid->frame = nsnull; - - // Assign the trapezoid a rectangular shape. The trapezoid must be in the - // local coordinate space, so convert the current left coordinate - *trapezoid = nsRect(left - mX, localY, aBand->x - left, height); - - // Move to the next output rect - trapezoid++; - aBandData.count++; - } - - // The rect represents unavailable space, so add another trapezoid - trapezoid->state = nsBandTrapezoid::smOccupied; - trapezoid->frame = aBand->frame; - - nscoord x = aBand->x; - // The first band can straddle the clip rect - if (x < mX) { - // Clip the left edge - x = mX; - } - - // Assign the trapezoid a rectangular shape. The trapezoid must be in the - // local coordinate space, so convert the rects's left coordinate - *trapezoid = nsRect(x - mX, localY, aBand->XMost() - x, height); - - // Move to the next output rect - trapezoid++; - aBandData.count++; - - // Adjust our current x-location within the band - left = aBand->XMost(); - - // Move to the next rect within the band - numRects--; - aBand++; - } - - // No more rects left in the band. If we haven't yet reached the right edge, - // then all the remaining space is available - if (left < rightEdge) { - trapezoid->state = nsBandTrapezoid::smAvailable; - trapezoid->frame = nsnull; - - // Assign the trapezoid a rectangular shape. The trapezoid must be in the - // local coordinate space, so convert the current left coordinate - *trapezoid = nsRect(left - mX, localY, rightEdge - left, height); - aBandData.count++; - } - - return aBandData.count; -} - -PRInt32 SpaceManager::GetBandData(nscoord aYOffset, - const nsSize& aMaxSize, - nsBandData& aBandData) const -{ - // Convert the y-offset to world coordinates - nscoord y = mY + aYOffset; - - // If there are no unavailable rects or the offset is below the bottommost - // band then all the space is available - if ((0 == mRectArray.mCount) || (y >= mRectArray.YMost())) { - // All the requested space is available - aBandData.count = 1; - aBandData.trapezoids[0] = nsRect(0, aYOffset, aMaxSize.width, aMaxSize.height); - aBandData.trapezoids[0].state = nsBandTrapezoid::smAvailable; - aBandData.trapezoids[0].frame = nsnull; - } else { - // Find the first band that contains the y-offset or is below the y-offset - nsBandRect* band = mRectArray.mRects; - - for (PRInt32 i = 0; i < mRectArray.mCount; ) { - if (band->y > y) { - // The band is below the y-offset. The area between the y-offset and - // the top of the band is available - aBandData.count = 1; - aBandData.trapezoids[0] = - nsRect(0, aYOffset, aMaxSize.width, PR_MIN(band->y - y, aMaxSize.height)); - aBandData.trapezoids[0].state = nsBandTrapezoid::smAvailable; - aBandData.trapezoids[0].frame = nsnull; - break; - } else if (y < band->YMost()) { - // The band contains the y-offset. Return a list of available and - // unavailable rects within the band - return GetBandAvailableSpace(band, i, y, aMaxSize, aBandData); - } else { - // Skip to the next band - GetNextBand(band, i); - } - } - } - - return aBandData.count; -} - -/** - * Skips to the start of the next band. - * - * @param aRect in out paremeter. A rect in the band - * @param aIndex in out parameter. aRect's index in the rect array - * @returns PR_TRUE if successful and PR_FALSE if this is the last band. - * If successful aRect and aIndex are updated to point to the - * next band. If there is no next band then aRect is undefined - * and aIndex is set to the number of rects in the rect array - */ -PRBool SpaceManager::GetNextBand(nsBandRect*& aRect, PRInt32& aIndex) const -{ - nscoord topOfBand = aRect->y; - - while (++aIndex < mRectArray.mCount) { - // Get the next rect and check whether it's part of the same band - aRect++; - - if (aRect->y != topOfBand) { - // We found the start of the next band - return PR_TRUE; - } - } - - // No bands left - return PR_FALSE; -} - -/** - * Returns the number of rectangles in the band - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - */ -PRInt32 SpaceManager::LengthOfBand(const nsBandRect* aBand, PRInt32 aIndex) const -{ - nscoord topOfBand = aBand->y; - PRInt32 result = 1; - - while (++aIndex < mRectArray.mCount) { - // Get the next rect and check whether it's part of the same band - aBand++; - - if (aBand->y != topOfBand) { - // We found the start of the next band - break; - } - - result++; - } - - return result; -} - -/** - * Tries to coalesce adjoining rectangles within a band. Returns PR_TRUE if any - * of the rects are coalesced and PR_FALSE otherwise - * - * @param aRect the first rect in the band - * @param aIndex aBand's index in the rect array - */ -PRBool SpaceManager::CoalesceBand(nsBandRect* aBand, PRInt32 aIndex) -{ - PRBool result = PR_FALSE; - - while ((aIndex + 1) < mRectArray.mCount) { - // Is there another rect in this band? - nsBandRect* nextRect = aBand + 1; - - if (nextRect->y == aBand->y) { - // The rects must not be overlapping - NS_ASSERTION(nextRect->x >= aBand->XMost(), "overlapping rects"); - - // Are the two rects adjoining and have the same tagged frame? - if ((aBand->XMost() == nextRect->x) && (aBand->frame == nextRect->frame)) { - // Yes. Extend the right edge of the current rect - aBand->width = nextRect->XMost() - aBand->x; - - // Remove the next rect - mRectArray.RemoveAt(aIndex + 1); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - - // Continue through the loop trying to coalesce this rect - result = PR_TRUE; - - } else { - // No. Move to the next rect within the band - aBand++; - aIndex++; - } - } else { - // The next rect is part of a different band, so we're all done - break; - } - } - - return result; -} - -/** - * Divides the current band into two vertically - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - * @param aB1Height the height of the new band to create - */ -void SpaceManager::DivideBand(nsBandRect* aBand, PRInt32 aIndex, nscoord aB1Height) -{ - NS_PRECONDITION(aB1Height < aBand->height, "bad height"); - - PRInt32 numRects = LengthOfBand(aBand, aIndex); - nscoord aB2Height = aBand->height - aB1Height; - - // Index where we'll insert the new band - PRInt32 insertAt = aIndex + numRects; - - while (numRects-- > 0) { - // Insert a new bottom band - nsRect r(aBand->x, aBand->y + aB1Height, aBand->width, aB2Height); - - mRectArray.InsertAt(r, insertAt, aBand->frame); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - - // Adjust the height of the top band - aBand->height = aB1Height; - - // Move to the next rect in the band - aBand++; - insertAt++; - } -} - -/** - * Adds a new rect to a band. - * - * @param aBand the first rect in the band - * @param aIndex aBand's index in the rect array - * @param aRect the rect to add to the band. It's in world coordinates - * @returns PR_TRUE if successful and PR_FALSE if this is the last band - */ -void SpaceManager::AddRectToBand(nsBandRect* aBand, - PRInt32 aIndex, - const nsRect& aRect, - nsIFrame* aFrame) -{ - NS_PRECONDITION((aBand->y == aRect.y) && (aBand->height == aRect.height), "bad band"); - - nscoord topOfBand = aBand->y; - nsRect rect(aRect); - - // Figure out where in the band horizontally to insert the rect. Try and - // coalesce it with an existing rect if possible. We can only do this if - // they're tagged with the same frame - do { - // Compare the left edge of the new rect with the left edge of the existing - // rect - if (rect.x < aBand->x) { - // The new rect's left edge is to the left of the existing rect's left edge. - // Could be any of these cases (N is new rect, E is existing rect): - // - // Case 1: left-of Case 2: overlaps Case 3: N.contains(E) - // --------------- ---------------- --------------------- - // +-----+ +-----+ +-----+ +---------+ - // | N | | E | | N | | N | - // +-----+ +-----+ +-----+ +---------+ - // +-----+ +---+ - // | E | | E | - // +-----+ +---+ - // - // Do the two rectangles overlap? - if (rect.XMost() <= aBand->x) { - // No, the new rect is completely to the left of the existing rect - // (case #1). Insert a new rect - mRectArray.InsertAt(rect, aIndex, aFrame); - return; - } - - // Yes, they overlap. Insert a new rect for the part that's to the left - // of the existing rect - nsRect r1(rect.x, rect.y, aBand->x - rect.x, rect.height); - - mRectArray.InsertAt(r1, aIndex, aFrame); - aIndex++; - aBand = mRectArray.mRects + aIndex; // memory may have changed... - - // Adjust rect to reflect the overlap - rect.width = rect.XMost() - aBand->x; - rect.x = aBand->x; - - } else if (rect.x > aBand->x) { - // The new rect's left edge is to the right of the existing rect's left - // edge. Could be any one of these cases: - // - // Case 4: right-of Case 5: overlaps Case 6: E.Contains(N) - // --------------- ---------------- --------------------- - // +-----+ +-----+ +-----+ +------------+ - // | E | | N | | E | | E | - // +-----+ +-----+ +-----+ +------------+ - // +-----+ +-----+ - // | N | | N | - // +-----+ +-----+ - // - if (rect.x >= aBand->XMost()) { - // The new rect is to the right of the existing rect (case #4), so move - // to the next rect in the band - aBand++; aIndex++; - continue; - } - - // The rects overlap, so divide the existing rect into two rects: the - // part to the left of the new rect, and the part that overlaps - nsRect r1(rect.x, aBand->y, aBand->XMost() - rect.x, aBand->height); - - // Modify the left half of the existing rect - aBand->width = rect.x - aBand->x; - - // Insert the new right half of the existing rect, and make it the current - // rect - aIndex++; - mRectArray.InsertAt(r1, aIndex, aBand->frame); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - } - - // At this point the left edge of the new rect is the same as the left edge - // of the existing rect - NS_ASSERTION(rect.x == aBand->x, "unexpected rect"); - - // Compare which rect is wider, the new rect or the existing rect - if (aBand->width > rect.width) { - // The existing rect is wider (cases 2 and 6). Divide the existing rect - // into two rects: the part that overlaps, and the part to the right of - // the new rect - nsRect r1(rect.XMost(), aBand->y, aBand->XMost() - rect.XMost(), aBand->height); - - // Modify the left half of the existing rect - aBand->width = r1.x - aBand->x; - - // Insert the new right half of the existing rect - mRectArray.InsertAt(r1, aIndex, aBand->frame); - aBand = mRectArray.mRects + aIndex; // memory may have changed... - } - - // XXX Mark the existing rect as being shared by the two frames... - - if (rect.width == aBand->width) { - // We're all done - return; - } - - // The new rect is wider than the existing rect (cases 3 and 5). Set rect - // to be the overhang and move to the next rect within the band - rect.width = rect.XMost() - aBand->XMost(); - rect.x = aBand->XMost(); - aBand++; aIndex++; - } while ((aIndex < mRectArray.mCount) && (aBand->y == topOfBand)); - - // Insert a new rect - mRectArray.InsertAt(aRect, aIndex, aFrame); -} - -// When comparing a rect to a band there are seven cases to consider. -// 'R' is the rect and 'B' is the band. -// -// Case 1 Case 2 Case 3 Case 4 -// ------ ------ ------ ------ -// +-----+ +-----+ +-----+ +-----+ -// | R | | R | +-----+ +-----+ | | | | -// +-----+ +-----+ | | | R | | B | | B | -// +-----+ | B | +-----+ | | +-----+ | | -// | | | | +-----+ | R | +-----+ -// | B | +-----+ +-----+ -// | | -// +-----+ -// -// -// -// Case 5 Case 6 Case 7 -// ------ ------ ------ -// +-----+ +-----+ +-----+ +-----+ -// | | | R | | B | | | +-----+ -// | B | +-----+ +-----+ | R | | B | -// | | | | +-----+ -// +-----+ +-----+ -// +-----+ -// | R | -// +-----+ -// -void SpaceManager::AddRectRegion(const nsRect& aUnavailableSpace, nsIFrame* aFrame) -{ - // Convert from local to world coordinates - nsRect rect(aUnavailableSpace.x + mX, aUnavailableSpace.y + mY, - aUnavailableSpace.width, aUnavailableSpace.height); - - // If there are no existing bands or this rect is below the bottommost band, - // then add a new band - if ((0 == mRectArray.mCount) || (rect.y >= mRectArray.YMost())) { - // Append a new bottommost band - mRectArray.Append(rect, aFrame); - return; - } - - // Examine each band looking for a band that intersects this rect - nsBandRect* band = mRectArray.mRects; - - for (PRInt32 i = 0; i < mRectArray.mCount; ) { - // Compare the top edge of this rect with the top edge of the band - if (rect.y < band->y) { - // The top edge of the rect is above the top edge of the band. - // Is there any overlap? - if (rect.YMost() <= band->y) { - // Case #1. This rect is completely above the band, so insert a - // new band - mRectArray.InsertAt(rect, i, aFrame); - break; // we're all done - } - - // Case #2 and case #7. Divide this rect, creating a new rect for the - // part that's above the band - nsRect r1(rect.x, rect.y, rect.width, band->y - rect.y); - - // Insert r1 as a new band - mRectArray.InsertAt(r1, i, aFrame); - i++; - band = mRectArray.mRects + i; // memory may have changed... - - // Modify rect to exclude the part above the band - rect.height = rect.YMost() - band->y; - rect.y = band->y; - - } else if (rect.y > band->y) { - // The top edge of the rect is below the top edge of the band. Is there - // any overlap? - if (rect.y >= band->YMost()) { - // Case #5. This rect is below the current band. Skip to the next band - GetNextBand(band, i); - continue; - } - - // Case #3 and case #4. Divide the current band into two bands with the - // top band being the part that's above the rect - DivideBand(band, i, rect.y - band->y); - band = mRectArray.mRects + i; // memory may have changed... - - // Skip to the bottom band that we just created - GetNextBand(band, i); - } - - // At this point the rect and the band should have the same y-offset - NS_ASSERTION(rect.y == band->y, "unexpected band"); - - // Is the band higher than the rect? - if (band->height > rect.height) { - // Divide the band into two bands with the top band the same height - // as the rect - DivideBand(band, i, rect.height); - band = mRectArray.mRects + i; // memory may have changed... - } - - if (rect.height == band->height) { - // Add the rect to the band - AddRectToBand(band, i, rect, aFrame); - break; - - } else { - // Case #4 and case #7. The rect contains the band vertically. Divide - // the rect, creating a new rect for the part that overlaps the band - nsRect r1(rect.x, rect.y, rect.width, band->YMost() - rect.y); - - // Add r1 to the band - AddRectToBand(band, i, r1, aFrame); - band = mRectArray.mRects + i; // memory may have changed... - - // Modify rect to be the part below the band - rect.height = rect.YMost() - band->YMost(); - rect.y = band->YMost(); - - // Continue with the next band - if (!GetNextBand(band, i)) { - // Append a new bottommost band - mRectArray.Append(rect, aFrame); - break; - } - } - } -} - -void SpaceManager::ClearRegions() -{ - mRectArray.Clear(); -} - -///////////////////////////////////////////////////////////////////////////// -// RectArray - -SpaceManager::RectArray::RectArray() -{ - mRects = nsnull; - mCount = mMax = 0; -} - -SpaceManager::RectArray::~RectArray() -{ - if (nsnull != mRects) { - free(mRects); - } -} - -nscoord SpaceManager::RectArray::YMost() const -{ - return mRects[mCount - 1].YMost(); -} - -void SpaceManager::RectArray::Append(const nsRect& aRect, nsIFrame* aFrame) -{ - // Ensure there's enough capacity - if (mCount >= mMax) { - mMax += 8; - mRects = (nsBandRect*)realloc(mRects, mMax * sizeof(nsBandRect)); - } - - mRects[mCount].x = aRect.x; - mRects[mCount].y = aRect.y; - mRects[mCount].width = aRect.width; - mRects[mCount].height = aRect.height; - mRects[mCount].frame = aFrame; - mCount++; -} - -void SpaceManager::RectArray::InsertAt(const nsRect& aRect, - PRInt32 aIndex, - nsIFrame* aFrame) -{ - NS_PRECONDITION(aIndex <= mCount, "bad index"); // no holes in the array - - // Ensure there's enough capacity - if (mCount >= mMax) { - mMax += 8; - mRects = (nsBandRect*)realloc(mRects, mMax * sizeof(nsBandRect)); - } - - memmove(&mRects[aIndex + 1], &mRects[aIndex], (mCount - aIndex) * sizeof(nsBandRect)); - mRects[aIndex].x = aRect.x; - mRects[aIndex].y = aRect.y; - mRects[aIndex].width = aRect.width; - mRects[aIndex].height = aRect.height; - mRects[aIndex].frame = aFrame; - mCount++; -} - -void SpaceManager::RectArray::RemoveAt(PRInt32 aIndex) -{ - NS_PRECONDITION(aIndex < mCount, "bad index"); - - mCount--; - if (aIndex < mCount) { - memmove(&mRects[aIndex], &mRects[aIndex + 1], (mCount - aIndex) * sizeof(nsBandRect)); - } -} - -void SpaceManager::RectArray::Clear() -{ - mCount = 0; -} diff --git a/mozilla/layout/generic/nsSpaceManager.h b/mozilla/layout/generic/nsSpaceManager.h deleted file mode 100644 index 0c01d5a5dcf..00000000000 --- a/mozilla/layout/generic/nsSpaceManager.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsSpaceManager_h___ -#define nsSpaceManager_h___ - -#include "nsISpaceManager.h" - -/** - * Implementation of nsISpaceManager that maintains a region data structure of - * unavailable space - */ -class SpaceManager : public nsISpaceManager { -public: - SpaceManager(nsIFrame* aFrame); - - // nsISupports - NS_DECL_ISUPPORTS - - virtual nsIFrame* GetFrame() const; - - virtual void Translate(nscoord aDx, nscoord aDy); - virtual void GetTranslation(nscoord& aX, nscoord& aY) const; - virtual nscoord YMost() const; - virtual PRInt32 GetBandData(nscoord aYOffset, - const nsSize& aMaxSize, - nsBandData& aBandData) const; - virtual void AddRectRegion(const nsRect& aUnavailableSpace, nsIFrame* aFrame); - virtual void ClearRegions(); - -protected: - struct nsBandRect : nsRect { - nsIFrame* frame; - }; - - class RectArray { - public: - RectArray(); - ~RectArray(); - - // Functions to add rects - void Append(const nsRect& aRect, nsIFrame* aFrame); - void InsertAt(const nsRect& aRect, PRInt32 aIndex, nsIFrame* aFrame); - void RemoveAt(PRInt32 aIndex); - - // Clear the list of rectangles - void Clear(); - - // Returns the y-most of the bottom band - nscoord YMost() const; - - public: - // Access to the underlying storage - nsBandRect* mRects; // y-x banded array of rectangles of unavailable space - PRInt32 mCount; // current number of rects - PRInt32 mMax; // capacity of rect array - }; - - nsIFrame* const mFrame; // frame associated with the space manager - nscoord mX, mY; // translation from local to global coordinate space - RectArray mRectArray; // y-x banded array of rectangles of unavailable space - -protected: - PRBool GetNextBand(nsBandRect*& aRect, PRInt32& aIndex) const; - PRInt32 LengthOfBand(const nsBandRect* aBand, PRInt32 aIndex) const; - PRBool CoalesceBand(nsBandRect* aBand, PRInt32 aIndex); - void DivideBand(nsBandRect* aBand, PRInt32 aIndex, nscoord aB1Height); - void AddRectToBand(nsBandRect* aBand, PRInt32 aIndex, - const nsRect& aRect, nsIFrame* aFrame); - PRInt32 GetBandAvailableSpace(const nsBandRect* aBand, - PRInt32 aIndex, - nscoord aY, - const nsSize& aMaxSize, - nsBandData& aAvailableSpace) const; - -private: - SpaceManager(const SpaceManager&); // no implementation - void operator=(const SpaceManager&); // no implementation -}; - -#endif /* nsSpaceManager_h___ */ - diff --git a/mozilla/layout/html/Makefile b/mozilla/layout/html/Makefile deleted file mode 100644 index c398fa8ab75..00000000000 --- a/mozilla/layout/html/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -# Don't do tests for now -#DIRS = base document forms style table build tests -DIRS = base document forms style table - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/base/Makefile b/mozilla/layout/html/base/Makefile deleted file mode 100644 index b0ff7c06fd4..00000000000 --- a/mozilla/layout/html/base/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -DIRS = src - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/base/makefile.win b/mozilla/layout/html/base/makefile.win deleted file mode 100644 index fd332714cf2..00000000000 --- a/mozilla/layout/html/base/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -DIRS=src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/html/base/src/Makefile b/mozilla/layout/html/base/src/Makefile deleted file mode 100644 index 08eb5343ad6..00000000000 --- a/mozilla/layout/html/base/src/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -LIBRARY_NAME = raptorhtmlbase_s - -# Note the sophisticated alphabetical ordering :-| -CPPSRCS = \ - nsBRPart.cpp \ - nsBlockFrame.cpp \ - nsBodyFrame.cpp \ - nsBodyPart.cpp \ - nsColumnFrame.cpp \ - nsGlobalVariables.cpp \ - nsHRPart.cpp \ - nsHTMLAtoms.cpp \ - nsHTMLContainer.cpp \ - nsHTMLContainerFrame.cpp \ - nsHTMLContent.cpp \ - nsHTMLIIDs.cpp \ - nsHTMLImage.cpp \ - nsHTMLTagContent.cpp \ - nsHTMLTags.cpp \ - nsImageMap.cpp \ - nsInlineFrame.cpp \ - nsLeafFrame.cpp \ - nsListItemFrame.cpp \ - nsPageFrame.cpp \ - nsPlaceholderFrame.cpp \ - nsRootPart.cpp \ - nsSpacerPart.cpp \ - nsTextContent.cpp \ - nsWBRPart.cpp \ - nsDOMIterator.cpp \ - nsDOMAttributes.cpp \ - $(NULL) -EXPORTS = \ - nsGlobalVariables.h \ - $(NULL) - -MODULE = raptor - -REQUIRES = xpcom raptor dom - -include $(DEPTH)/config/config.mk - -LCFLAGS += -D_IMPL_NS_HTML - -INCLUDES += -I../../style/src -I../../../base/src - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/base/src/deadnsInlineFrame.h b/mozilla/layout/html/base/src/deadnsInlineFrame.h deleted file mode 100644 index 464d604e65d..00000000000 --- a/mozilla/layout/html/base/src/deadnsInlineFrame.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsInlineFrame_h___ -#define nsInlineFrame_h___ - -#include "nsHTMLContainerFrame.h" - -class nsInlineState; - -// Inline container class. Does not support being used as a pseudo frame -class nsInlineFrame : public nsHTMLContainerFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer); - - NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics); - -protected: - nsInlineFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsInlineFrame(); - - virtual PRIntn GetSkipSides() const; - - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState); - - PRBool PullUpChildren(nsIPresContext* aPresContext, - nsInlineState& aState); - - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState); - - void PlaceChild(nsIFrame* aChild, - PRInt32 aIndex, // in the child frame list - nsInlineState& aState, - const nsReflowMetrics& aChildSize, - const nsSize* aChildMaxElementSize); - - PRIntn RecoverState(nsIPresContext* aCX, nsInlineState& aState, - nsIFrame* aSkipChild); - - ReflowStatus AdjustChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsInlineState& aState, - nsIFrame* aKid, - nsReflowMetrics& aKidMetrics, - ReflowStatus aKidReflowStatus); -}; - -#endif /* nsInlineFrame_h___ */ diff --git a/mozilla/layout/html/base/src/makefile.win b/mozilla/layout/html/base/src/makefile.win deleted file mode 100644 index 9a8b8c59931..00000000000 --- a/mozilla/layout/html/base/src/makefile.win +++ /dev/null @@ -1,104 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -LIBRARY_NAME=raptorhtmlbase_s -MODULE=raptor -REQUIRES=xpcom raptor -DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN - -CPPSRCS= \ - nsAbsoluteFrame.cpp \ - nsBRPart.cpp \ - nsBlockFrame.cpp \ - nsBodyFrame.cpp \ - nsBodyPart.cpp \ - nsColumnFrame.cpp \ - nsGlobalVariables.cpp \ - nsHRPart.cpp \ - nsHTMLAtoms.cpp \ - nsHTMLContainer.cpp \ - nsHTMLContainerFrame.cpp \ - nsHTMLContent.cpp \ - nsHTMLIIDs.cpp \ - nsHTMLImage.cpp \ - nsHTMLTagContent.cpp \ - nsImageMap.cpp \ - nsInlineFrame.cpp \ - nsLeafFrame.cpp \ - nsListItemFrame.cpp \ - nsPageFrame.cpp \ - nsPlaceholderFrame.cpp \ - nsRootPart.cpp \ - nsSpacerPart.cpp \ - nsTextContent.cpp \ - nsWBRPart.cpp \ - nsDOMIterator.cpp \ - nsDOMAttributes.cpp \ - $(NULL) - -CPP_OBJS= \ - .\$(OBJDIR)\nsAbsoluteFrame.obj \ - .\$(OBJDIR)\nsBRPart.obj \ - .\$(OBJDIR)\nsBlockFrame.obj \ - .\$(OBJDIR)\nsBodyFrame.obj \ - .\$(OBJDIR)\nsBodyPart.obj \ - .\$(OBJDIR)\nsColumnFrame.obj \ - .\$(OBJDIR)\nsGlobalVariables.obj \ - .\$(OBJDIR)\nsHRPart.obj \ - .\$(OBJDIR)\nsHTMLAtoms.obj \ - .\$(OBJDIR)\nsHTMLContainer.obj \ - .\$(OBJDIR)\nsHTMLContainerFrame.obj \ - .\$(OBJDIR)\nsHTMLContent.obj \ - .\$(OBJDIR)\nsHTMLIIDs.obj \ - .\$(OBJDIR)\nsHTMLImage.obj \ - .\$(OBJDIR)\nsHTMLTagContent.obj \ - .\$(OBJDIR)\nsHTMLTags.obj \ - .\$(OBJDIR)\nsImageMap.obj \ - .\$(OBJDIR)\nsInlineFrame.obj \ - .\$(OBJDIR)\nsLeafFrame.obj \ - .\$(OBJDIR)\nsListItemFrame.obj \ - .\$(OBJDIR)\nsPageFrame.obj \ - .\$(OBJDIR)\nsPlaceholderFrame.obj \ - .\$(OBJDIR)\nsRootPart.obj \ - .\$(OBJDIR)\nsSpacerPart.obj \ - .\$(OBJDIR)\nsTextContent.obj \ - .\$(OBJDIR)\nsWBRPart.obj \ - .\$(OBJDIR)\nsDOMIterator.obj \ - .\$(OBJDIR)\nsDOMAttributes.obj \ - $(NULL) - -EXPORTS=nsGlobalVariables.h - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \ - -I..\..\style\src -I$(PUBLIC)\dom \ - -I..\..\..\base\src - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - -clobber:: - rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp b/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp deleted file mode 100644 index 7104c836f44..00000000000 --- a/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp +++ /dev/null @@ -1,319 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIPresContext.h" -#include "nsIPtr.h" -#include "nsIScrollableView.h" -#include "nsIStyleContext.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsAbsoluteFrame.h" -#include "nsBodyFrame.h" -#include "nsStyleConsts.h" -#include "nsViewsCID.h" - -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kIScrollableViewIID, NS_ISCROLLABLEVIEW_IID); - -NS_DEF_PTR(nsIStyleContext); - -nsresult -AbsoluteFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new AbsoluteFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -AbsoluteFrame::AbsoluteFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsFrame(aContent, aIndexInParent, aParent) -{ - mFrame = nsnull; -} - -AbsoluteFrame::~AbsoluteFrame() -{ -} - -nsIView* AbsoluteFrame::CreateView(nsIView* aContainingView, - const nsRect& aRect, - nsStylePosition* aPosition) -{ - nsIView* view; - - static NS_DEFINE_IID(kViewCID, NS_VIEW_CID); - static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - - nsresult result = NSRepository::CreateInstance(kViewCID, - nsnull, - kIViewIID, - (void **)&view); - if (NS_OK == result) { - nsIViewManager* viewManager = aContainingView->GetViewManager(); - - // Initialize the view - NS_ASSERTION(nsnull != viewManager, "null view manager"); - - // See if the containing view is a scroll view - nsIScrollableView* scrollView = nsnull; - nsresult result; - nsViewClip clip; - nsViewClip* pClip = NS_STYLE_CLIP_RECT == aPosition->mClipFlags ? - &clip : nsnull; - - // Is there a clip rect specified? - if (NS_STYLE_CLIP_RECT == aPosition->mClipFlags) { - clip.mLeft = aPosition->mClip.left; - clip.mRight = aPosition->mClip.right; - clip.mTop = aPosition->mClip.top; - clip.mBottom = aPosition->mClip.bottom; - } - - result = aContainingView->QueryInterface(kIScrollableViewIID, (void**)&scrollView); - if (NS_OK == result) { - nsIView* scrolledView = scrollView->GetScrolledView(); - - view->Init(viewManager, aRect, scrolledView, nsnull, nsnull, nsnull, - aPosition->mZIndex, pClip); - viewManager->InsertChild(scrolledView, view, 0); - NS_RELEASE(scrolledView); - NS_RELEASE(scrollView); - } else { - view->Init(viewManager, aRect, aContainingView, nsnull, nsnull, nsnull, - aPosition->mZIndex, pClip); - viewManager->InsertChild(aContainingView, view, 0); - } - - NS_RELEASE(viewManager); - } - - return view; -} - -void AbsoluteFrame::ComputeViewBounds(const nsRect& aContainingInnerRect, - nsStylePosition* aPosition, - nsRect& aRect) -{ - // Compute the offset and size of the view based on the position properties - // and the inner rect of the containing block - nsStylePosition* position = (nsStylePosition*)mStyleContext->GetData(kStylePositionSID); - - // x-offset - if (NS_STYLE_POSITION_VALUE_AUTO == position->mLeftOffsetFlags) { - // XXX This isn't correct. We should use the current x-offset of our frame - // translated into the coordinate space of the containing block. But, we - // don't know it yet... - aRect.x = 0; - } else if (NS_STYLE_POSITION_VALUE_LENGTH == position->mLeftOffsetFlags) { - aRect.x = position->mLeftOffset; - } else { - NS_ASSERTION(NS_STYLE_POSITION_VALUE_PERCENT == position->mLeftOffsetFlags, - "unexpected offset type"); - // Percentage values refer to the width of the containing block - aRect.x = aContainingInnerRect.x + (aContainingInnerRect.width * - position->mLeftOffset / 100); - } - - // y-offset - if (NS_STYLE_POSITION_VALUE_AUTO == position->mTopOffsetFlags) { - // XXX This isn't correct. We should use the current y-offset of our frame - // translated into the coordinate space of the containing block. But, we - // don't know it yet... - aRect.y = 0; - } else if (NS_STYLE_POSITION_VALUE_LENGTH == position->mTopOffsetFlags) { - aRect.y = position->mTopOffset; - } else { - NS_ASSERTION(NS_STYLE_POSITION_VALUE_PERCENT == position->mTopOffsetFlags, - "unexpected offset type"); - // Percentage values refer to the height of the containing block - aRect.y = aContainingInnerRect.y + (aContainingInnerRect.height * - position->mTopOffset / 100); - } - - // width - if (NS_STYLE_POSITION_VALUE_AUTO == position->mWidthFlags) { - // Use the right-edge of the containing block - aRect.width = aContainingInnerRect.width - aRect.x; - } else if (NS_STYLE_POSITION_VALUE_LENGTH == position->mWidthFlags) { - aRect.width = position->mWidth; - } else { - NS_ASSERTION(NS_STYLE_POSITION_VALUE_PERCENT == position->mWidthFlags, - "unexpected width type"); - aRect.width = aContainingInnerRect.width * position->mWidth / 100; - } - - // height - if (NS_STYLE_POSITION_VALUE_AUTO == position->mHeightFlags) { - // Allow it to be as high as it wants - aRect.height = NS_UNCONSTRAINEDSIZE; - } else if (NS_STYLE_POSITION_VALUE_LENGTH == position->mHeightFlags) { - aRect.height = position->mHeight; - } else { - NS_ASSERTION(NS_STYLE_POSITION_VALUE_PERCENT == position->mHeightFlags, - "unexpected height type"); - aRect.height = aContainingInnerRect.height * position->mHeight / 100; - } -} - -nsIFrame* AbsoluteFrame::GetContainingBlock() -{ - // Look for a containing frame that is absolutely positioned. If we don't - // find one then use the initial containg block which is the root frame - nsIFrame* lastFrame = this; - nsIFrame* result; - - GetContentParent(result); - while (nsnull != result) { - nsStylePosition* position; - - // Get the style data - result->GetStyleData(kStylePositionSID, (nsStyleStruct*&)position); - - if (position->mPosition == NS_STYLE_POSITION_ABSOLUTE) { - break; - } - - // Get the next contentual parent - lastFrame = result; - result->GetContentParent(result); - } - - if (nsnull == result) { - result = lastFrame; - } - - return result; -} - -NS_METHOD AbsoluteFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - // Have we created the absolutely positioned item yet? - if (nsnull == mFrame) { - // If the content object is a container then wrap it in a body pseudo-frame - if (mContent->CanContainChildren()) { - nsBodyFrame::NewFrame(&mFrame, mContent, mIndexInParent, this); - - // Resolve style for the pseudo-frame. We can't use our style context - nsIStyleContextPtr styleContext = aPresContext->ResolveStyleContextFor(mContent, this); - mFrame->SetStyleContext(styleContext); - - } else { - // Create the absolutely positioned item as a pseudo-frame child. We'll - // also create a view - nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext); - - mFrame= delegate->CreateFrame(aPresContext, mContent, mIndexInParent, this); - NS_RELEASE(delegate); - - // Set the style context for the frame - mFrame->SetStyleContext(mStyleContext); - } - - // Get the containing block, and its associated view - nsIFrame* containingBlock = GetContainingBlock(); - - // Get the inner rect of the containing block. Because of the way the frame - // sizing protocol works (it's top-down and the size of a container is set - // after reflowing its children), get the rect from the containing block's - // view - nsIView* containingView; - nsRect containingRect; - - // XXX We should be using the inner rect, and not just the bounding rect - containingBlock->GetView(containingView); - containingView->GetBounds(containingRect); - containingRect.x = containingRect.y = 0; - - // Use the position properties to determine the offset and size - nsStylePosition* position = (nsStylePosition*)mStyleContext->GetData(kStylePositionSID); - nsRect rect; - - ComputeViewBounds(containingRect, position, rect); - - // Create a view for the frame - nsIView* view = CreateView(containingView, rect, position); - NS_RELEASE(containingView); - - mFrame->SetView(view); - NS_RELEASE(view); - - // Resize reflow the absolutely positioned element - nsSize availSize(rect.width, rect.height); - - if (NS_STYLE_OVERFLOW_VISIBLE == position->mOverflow) { - // Don't constrain the height since the container should be enlarged to - // contain overflowing frames - availSize.height = NS_UNCONSTRAINEDSIZE; - } - - mFrame->ResizeReflow(aPresContext, aDesiredSize, availSize, nsnull, aStatus); - - // Figure out what size to actually use. If the position style is 'auto' or - // the container should be enlarged to contain overflowing frames then use - // the desired size - if ((NS_STYLE_POSITION_VALUE_AUTO == position->mWidthFlags) || - ((aDesiredSize.width > availSize.width) && - (NS_STYLE_OVERFLOW_VISIBLE) == position->mOverflow)) { - rect.width = aDesiredSize.width; - } - if (NS_STYLE_POSITION_VALUE_AUTO == position->mHeightFlags) { - rect.height = aDesiredSize.height; - } - mFrame->SizeTo(rect.width, rect.height); - } - - // Return our desired size as (0, 0) - return nsFrame::ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, aStatus); -} - -NS_METHOD AbsoluteFrame::List(FILE* out, PRInt32 aIndent) const -{ - // Indent - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - - // Output the tag - fputs("*absolute", out); - fprintf(out, "(%d)@%p ", mIndexInParent, this); - - // Output the rect - out << mRect; - - // List the absolutely positioned frame - fputs("<\n", out); - mFrame->List(out, aIndent + 1); - fputs(">\n", out); - - return NS_OK; -} diff --git a/mozilla/layout/html/base/src/nsAbsoluteFrame.h b/mozilla/layout/html/base/src/nsAbsoluteFrame.h deleted file mode 100644 index 7046de8b6b3..00000000000 --- a/mozilla/layout/html/base/src/nsAbsoluteFrame.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsAbsoluteFrame_h___ -#define nsAbsoluteFrame_h___ - -#include "nsFrame.h" - -// Implementation of a frame that's used as a placeholder for an absolutely -// positioned frame -class AbsoluteFrame : public nsFrame -{ -public: - /** - * Create a new absolutely positioned frame - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - // Resize reflow methods - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -protected: - nsIFrame* mFrame; // the actual absolutely positioned frame - - // Constructor. Takes as arguments the content object, the index in parent, - // and the Frame for the content parent - AbsoluteFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~AbsoluteFrame(); - - nsIView* CreateView(nsIView* aContainingView, - const nsRect& aRect, - nsStylePosition* aPosition); - nsIFrame* GetContainingBlock(); - void ComputeViewBounds(const nsRect& aContainingInnerRect, - nsStylePosition* aPosition, - nsRect& aRect); -}; - -#endif /* nsAbsoluteFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsBRPart.cpp b/mozilla/layout/html/base/src/nsBRPart.cpp deleted file mode 100644 index 7af2557d293..00000000000 --- a/mozilla/layout/html/base/src/nsBRPart.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLTagContent.h" -#include "nsIAtom.h" -#include "nsFrame.h" -#include "nsHTMLIIDs.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsBlockFrame.h" -#include "nsStyleConsts.h" -#include "nsHTMLAtoms.h" -#include "nsIHTMLAttributes.h" -#include "nsIStyleContext.h" -#include "nsIFontMetrics.h" - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); - -class BRFrame : public nsFrame -{ -public: - BRFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics); - -protected: - virtual ~BRFrame(); -}; - -BRFrame::BRFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -BRFrame::~BRFrame() -{ -} - -NS_METHOD BRFrame::GetReflowMetrics(nsIPresContext* aPresContext, nsReflowMetrics& aMetrics) -{ - // We have no width, but we're the height of the default font - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsIFontMetrics* fm = aPresContext->GetMetricsFor(font->mFont); - aMetrics.width = 0; - aMetrics.height = fm->GetHeight(); - aMetrics.ascent = fm->GetMaxAscent(); - aMetrics.descent = fm->GetMaxDescent(); - NS_RELEASE(fm); - return NS_OK; -} - -NS_METHOD BRFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - // Get cached state for containing block frame - nsBlockReflowState* state = nsnull; - nsIFrame* parent = mGeometricParent; - while (nsnull != parent) { - nsIHTMLFrameType* ft; - nsresult status = parent->QueryInterface(kIHTMLFrameTypeIID, (void**) &ft); - if (NS_OK == status) { - nsHTMLFrameType type = ft->GetFrameType(); - if (eHTMLFrame_Block == type) { - break; - } - } - parent->GetGeometricParent(parent); - } - if (nsnull != parent) { - nsIPresShell* shell = aPresContext->GetShell(); - state = (nsBlockReflowState*) shell->GetCachedData(parent); - NS_RELEASE(shell); - } - if (nsnull != state) { - // XXX
    - state->breakAfterChild = PR_TRUE; - } - - GetReflowMetrics(aPresContext, aDesiredSize); - aStatus = frComplete; - return NS_OK; -} - -//---------------------------------------------------------------------- - -class BRPart : public nsHTMLTagContent { -public: - BRPart(nsIAtom* aTag); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - - virtual void UnsetAttribute(nsIAtom* aAttribute); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - PRInt32 GetClear() { - return mClear; - } - - void SetClear(PRInt32 aValue) { - mClear = aValue; - } - -protected: - virtual ~BRPart(); - virtual nsContentAttr AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const; - - PRInt32 mClear; -}; - -BRPart::BRPart(nsIAtom* aTag) - : nsHTMLTagContent(aTag) -{ -} - -BRPart::~BRPart() -{ -} - -nsIFrame* BRPart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new BRFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -//---------------------------------------------------------------------- -// Attributes - -static nsHTMLTagContent::EnumTable kClearTable[] = { - { "left", NS_STYLE_CLEAR_LEFT }, - { "right", NS_STYLE_CLEAR_RIGHT }, - { "all", NS_STYLE_CLEAR_LEFT_AND_RIGHT }, - { "both", NS_STYLE_CLEAR_LEFT_AND_RIGHT }, - { 0 } -}; - -void BRPart::SetAttribute(nsIAtom* aAttribute, const nsString& aString) -{ - if (aAttribute == nsHTMLAtoms::clear) { - nsHTMLValue value; - if (ParseEnumValue(aString, kClearTable, value)) { - mClear = value.GetIntValue(); - } - else { - mClear = NS_STYLE_CLEAR_NONE; - } - return; - } - nsHTMLTagContent::SetAttribute(aAttribute, aString); -} - -nsContentAttr BRPart::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - nsContentAttr ca = eContentAttr_NotThere; - if (aAttribute == nsHTMLAtoms::clear) { - aResult.Reset(); - if (NS_STYLE_CLEAR_NONE != mClear) { - aResult.Set(mClear, eHTMLUnit_Enumerated); - ca = eContentAttr_HasValue; - } - } - else { - ca = nsHTMLTagContent::GetAttribute(aAttribute, aResult); - } - return ca; -} - -void BRPart::UnsetAttribute(nsIAtom* aAttribute) -{ - if (aAttribute == nsHTMLAtoms::clear) { - mClear = NS_STYLE_CLEAR_NONE; - } -} - -nsContentAttr BRPart::AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const -{ - if (aAttribute == nsHTMLAtoms::clear) { - if ((eHTMLUnit_Enumerated == aValue.GetUnit()) && - (NS_STYLE_CLEAR_NONE != aValue.GetIntValue())) { - EnumValueToString(aValue, kClearTable, aResult); - return eContentAttr_HasValue; - } - } - return eContentAttr_NotThere; -} - -//---------------------------------------------------------------------- - -nsresult -NS_NewHTMLBreak(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* it = new BRPart(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp deleted file mode 100644 index 6b45fe72cab..00000000000 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ /dev/null @@ -1,2184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBlockFrame.h" -#include "nsSize.h" -#include "nsIAnchoredItems.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsMargin.h" -#include "nsHTMLIIDs.h" -#include "nsCSSLayout.h" -#include "nsCRT.h" -#include "nsIPresShell.h" -#include "nsReflowCommand.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsAbsoluteFrame.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct BlockBandData : public nsBandData { - nsBandTrapezoid data[12]; - - // Bounding rect of available space between any left and right floaters - nsRect availSpace; - - // Constructor - BlockBandData() {size = 12; trapezoids = data;} - - // Computes the bounding rect of the available space, i.e. space between - // any left and right floaters - // - // Uses the current trapezoid data, see nsISpaceManager::GetBandData(). - // Updates member data "availSpace" - void ComputeAvailSpaceRect(); -}; - -void BlockBandData::ComputeAvailSpaceRect() -{ - nsBandTrapezoid* trapezoid = data; - - if (count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < count; i++) { - nsBandTrapezoid* trapezoid = &data[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &data[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availSpace); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availSpace); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availSpace.x = availSpace.XMost(); - } - availSpace.width = 0; - } -} - -// XXX Bugs -// 1. right to left reflow can generate negative x coordinates. - -// XXX Speedup idea (all containers) - -// If I reflow a child and it gives back not-complete status then -// there is no sense in trying to pullup children. For blocks, it's a -// little more complicated unless the child is a block - if the child -// is a block, then we must be out of room hence we should stop. If -// the child is not a block then our line should be flushed (see #2 -// below) if our line is already empty then we must be out of room. - -// For inline frames and column frames, if we reflow a child and get -// back not-complete status then we should bail immediately because we -// are out of room. - -// XXX Speedup ideas: -// 1. change pullup code to use line information from next in flow -// 2. we can advance to next line immediately after reflowing something -// and noticing that it's not complete. -// 3. pass down last child information in aState so that pullup, etc., -// don't need to recompute it - -// XXX TODO: -// 0. Move justification into line flushing code - -// 1. To get ebina margins I need "auto" information from the style -// system margin's. A bottom/top margin of auto will then be computed like -// ebina computes it [however the heck that is]. - -// 2. kicking out floaters and talking with floater container to adjust -// left and right margins - -nsBlockReflowState::nsBlockReflowState() -{ -} - -void nsBlockReflowState::Init(const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsIStyleContext* aBlockSC, - nsISpaceManager* aSpaceManager) -{ - firstLine = PR_TRUE; - allowLeadingWhitespace = PR_FALSE; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - firstChildIsInsideBullet = PR_FALSE; - nextListOrdinal = -1; - column = 0; - - spaceManager = aSpaceManager; - currentBand = new BlockBandData; - - styleContext = aBlockSC; - styleText = (nsStyleText*) aBlockSC->GetData(kStyleTextSID); - styleFont = (nsStyleFont*) aBlockSC->GetData(kStyleFontSID); - styleDisplay = (nsStyleDisplay*) aBlockSC->GetData(kStyleDisplaySID); - - justifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == styleText->mTextAlign) && - (NS_STYLE_WHITESPACE_PRE != styleText->mWhiteSpace); - - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - maxElementSize = aMaxElementSize; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - kidXMost = 0; - x = 0; - y = 0; - - isInline = PR_FALSE; - currentLineNumber = 0; - lineStart = nsnull; - lineLength = 0; - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; - lineMaxElementSize.width = 0; - lineMaxElementSize.height = 0; - lastContentIsComplete = PR_TRUE; - - maxAscents = sizeof(ascentBuf) / sizeof(ascentBuf[0]); - needRelativePos = PR_FALSE; - - prevLineLastFrame = nsnull; - prevLineHeight = 0; - topMargin = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - prevLineLastContentIsComplete = PR_TRUE; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - reflowStatus = nsIFrame::frNotComplete; -} - -nsBlockReflowState::~nsBlockReflowState() -{ - if (ascents != ascentBuf) { - delete ascents; - } - delete currentBand; -} - -void nsBlockReflowState::AddAscent(nscoord aAscent) -{ - NS_PRECONDITION(lineLength <= maxAscents, "bad line length"); - if (lineLength == maxAscents) { - maxAscents *= 2; - nscoord* newAscents = new nscoord[maxAscents]; - if (nsnull != newAscents) { - nsCRT::memcpy(newAscents, ascents, sizeof(nscoord) * lineLength); - if (ascents != ascentBuf) { - delete ascents; - } - ascents = newAscents; - } else { - // Yikes! Out of memory! - return; - } - } - ascents[lineLength] = aAscent; -} - -void nsBlockReflowState::AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, - nscoord aPrevLineHeight) -{ - firstLine = PR_FALSE; - allowLeadingWhitespace = PR_FALSE; - column = 0; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - lineStart = nsnull; - lineLength = 0; - currentLineNumber++; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - needRelativePos = PR_FALSE; - - prevLineLastFrame = aPrevLineLastFrame; - prevLineHeight = aPrevLineHeight; - prevMaxPosBottomMargin = maxPosBottomMargin; - prevMaxNegBottomMargin = maxNegBottomMargin; - - // Remember previous line's lastContentIsComplete - prevLineLastContentIsComplete = lastContentIsComplete; - lastContentIsComplete = PR_TRUE; - - topMargin = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; -} - -#ifdef NS_DEBUG -void nsBlockReflowState::DumpLine() -{ - nsIFrame* f = lineStart; - PRInt32 ll = lineLength; - while (--ll >= 0) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} - -void nsBlockReflowState::DumpList() -{ - nsIFrame* f = lineStart; - while (nsnull != f) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} -#endif - -//---------------------------------------------------------------------- - -nsresult nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBlockFrame::nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsBlockFrame::~nsBlockFrame() -{ - if (nsnull != mLines) { - delete mLines; - } -} - -nsresult -nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLFrameTypeIID)) { - *aInstancePtr = (void*) ((nsIHTMLFrameType*) this); - return NS_OK; - } else if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void*) ((nsIRunaround*) this); - return NS_OK; - } else if (aIID.Equals(kIFloaterContainerIID)) { - *aInstancePtr = (void*) ((nsIFloaterContainer*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Computes the top margin to use for this child frames based on its display -// type and the display type of the previous child frame. -// -// Adjacent vertical margins between block-level elements are collapsed. -nscoord nsBlockFrame::GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - if (aIsInline) { - // Just use whatever the previous bottom margin was - return aState.prevMaxPosBottomMargin - aState.prevMaxNegBottomMargin; - } else { - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - if (ss->mMargin.top < 0) { - maxNegTopMargin = -ss->mMargin.top; - } else { - maxPosTopMargin = ss->mMargin.top; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - return maxPos - maxNeg; - } else { - return 0; - } - } -} - -void nsBlockFrame::PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY) -{ - NS_PRECONDITION(aState.floaterToDo.Count() > 0, "no floaters"); - - // XXX Factor this code with PlaceFloater()... - PRInt32 numFloaters = aState.floaterToDo.Count(); - - for (PRInt32 i = 0; i < numFloaters; i++) { - nsIFrame* floater = (nsIFrame*)aState.floaterToDo[i]; - nsRect region; - - // Get the band of available space - // XXX This is inefficient to do this inside the loop... - GetAvailableSpaceBand(aState, aY); - - // Get the type of floater - nsIStyleContextPtr styleContext; - - floater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* sd = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - floater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == sd->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == sd->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, - 0); - mCurrentState->spaceManager->AddRectRegion(region, floater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - floater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - } - aState.floaterToDo.Clear(); -} - -/** - * Flush a line out. Return true if the line fits in our available - * height. If the line does not fit then return false. When the line - * fits we advance the y coordinate, reset the x coordinate and - * prepare the nsBlockReflowState for the next line. - */ -PRBool nsBlockFrame::AdvanceToNextLine(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - NS_PRECONDITION(aState.lineLength > 0, "bad line"); - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nscoord y = aState.y + aState.topMargin; - nscoord lineHeight; - - if (aState.isInline) { - // Vertically align the children on this line, returning the height of - // the line upon completion. - lineHeight = nsCSSLayout::VerticallyAlignChildren(aCX, this, - aState.styleFont, - y, - aState.lineStart, - aState.lineLength, - aState.ascents, - aState.maxAscent); - - // Any below current line floaters to place? - if (aState.floaterToDo.Count() > 0) { - PlaceBelowCurrentLineFloaters(aCX, aState, y + lineHeight); - // XXX Factor in the height of the floaters as well when considering - // whether the line fits. - // The default policy is that if there isn't room for the floaters then - // both the line and the floaters are pushed to the next-in-flow... - } - } else { - nsSize size; - - aState.lineStart->GetSize(size); - lineHeight = size.height; - } - - // The first line always fits - if (aState.currentLineNumber > 0) { - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if (y + lineHeight > yb) { - // After vertical alignment of the children and factoring in the - // proper margin, the line doesn't fit. - return PR_FALSE; - } - } - - if (aState.isInline) { - // Check if the right-edge of the line exceeds our running x-most - nscoord xMost = aState.borderPadding.left + aState.lineWidth; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - } - - // Advance the y coordinate to the new position where the next - // line or block element will go. - aState.y = y + lineHeight; - aState.x = 0; - - // Now that the vertical alignment is done we can perform horizontal - // alignment and relative positioning. Skip all of these if we are - // doing an unconstrained (in x) reflow. There's no point in doing - // the work if we *know* we are going to reflowed again. - if (!aState.unconstrainedWidth) { - nsCSSLayout::HorizontallyPlaceChildren(aCX, this, aState.styleText, - aState.lineStart, aState.lineLength, - aState.lineWidth, - aState.availSize.width); - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - if (!aState.justifying) { - nsCSSLayout::RelativePositionChildren(aCX, this, - aState.lineStart, - aState.lineLength); - } - } - - // Record line length - aState.lineLengths.AppendElement((void*)aState.lineLength); - - // Find the last frame in the line - // XXX keep this as running state in the nsBlockReflowState - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - // Update maxElementSize - if (nsnull != aState.maxElementSize) { - nsSize& lineMax = aState.lineMaxElementSize; - nsSize* maxMax = aState.maxElementSize; - if (lineMax.width > maxMax->width) { - maxMax->width = lineMax.width; - } - if (lineMax.height > maxMax->height) { - maxMax->height = lineMax.height; - } - aState.lineMaxElementSize.width = 0; - aState.lineMaxElementSize.height = 0; - } - - // Advance to the next line - aState.AdvanceToNextLine(lastFrame, lineHeight); - - return PR_TRUE; -} - -/** - * Add an inline child to the current line. Advance various running - * values after placement. - */ -void nsBlockFrame::AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Place and size the child - // XXX add in left margin from kid - nsRect r; - r.y = aState.y; - r.width = aKidSize.width; - r.height = aKidSize.height; - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - // Left to right positioning. - r.x = aState.borderPadding.left + aState.x + ss->mMargin.left; - aState.x += aKidSize.width + ss->mMargin.left + ss->mMargin.right; - } else { - // Right to left positioning - // XXX what should we do when aState.x goes negative??? - r.x = aState.x - aState.borderPadding.right - ss->mMargin.right - - aKidSize.width; - aState.x -= aKidSize.width + ss->mMargin.right + ss->mMargin.left; - } - aKidFrame->SetRect(r); - aState.AddAscent(aKidSize.ascent); - aState.lineWidth += aKidSize.width; - aState.lineLength++; - - // Update maximums for the line - if (aKidSize.ascent > aState.maxAscent) { - aState.maxAscent = aKidSize.ascent; - } - if (aKidSize.descent > aState.maxDescent) { - aState.maxDescent = aKidSize.descent; - } - // Update running margin maximums - if (aState.firstChildIsInsideBullet && (aKidFrame == mFirstChild)) { - // XXX temporary code. Since the molecule for the bullet frame - // is the same as the LI frame, we get bad style information. - // ignore it. - } else { - nscoord margin; -#if 0 - // XXX CSS2 spec says that top/bottom margin don't affect line height - // calculation. We're waiting for clarification on this issue... - if ((margin = ss->mMargin.top) < 0) { - margin = -margin; - if (margin > aState.maxNegTopMargin) { - aState.maxNegTopMargin = margin; - } - } else { - if (margin > aState.maxPosTopMargin) { - aState.maxPosTopMargin = margin; - } - } -#endif - if ((margin = ss->mMargin.bottom) < 0) { - margin = -margin; - if (margin > aState.maxNegBottomMargin) { - aState.maxNegBottomMargin = margin; - } - } else { - if (margin > aState.maxPosBottomMargin) { - aState.maxPosBottomMargin = margin; - } - } - } - - // Update line max element size - nsSize& mes = aState.lineMaxElementSize; - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > mes.width) { - mes.width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > mes.height) { - mes.height = aKidMaxElementSize->height; - } - } -} - -// Places and sizes the block-level element, and advances the line. -// The rect is in the local coordinate space of the kid frame. -void nsBlockFrame::AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Translate from the kid's coordinate space to our coordinate space - aKidRect.x += aState.borderPadding.left + ss->mMargin.left; - aKidRect.y += aState.y + aState.topMargin; - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - aState.AddAscent(aKidRect.height); - aState.lineLength++; - - // Is this the widest child frame? - nscoord xMost = aKidRect.XMost() + ss->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // Update the max element size - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aKidMaxElementSize->height; - } - } - - // and the bottom line margin information which we'll use when placing - // the next child - if (ss->mMargin.bottom < 0) { - aState.maxNegBottomMargin = -ss->mMargin.bottom; - } else { - aState.maxPosBottomMargin = ss->mMargin.bottom; - } - - // Update the running y-offset - aState.y += aKidRect.height + aState.topMargin; - - // Apply relative positioning if necessary - nsCSSLayout::RelativePositionChildren(aCX, this, aKidFrame, 1); - - // Advance to the next line - aState.AdvanceToNextLine(aKidFrame, aKidRect.height); -} - -/** - * Compute the available size for reflowing the given child at the - * current x,y position in the state. Note that this may return - * negative or zero width/height's if we are out of room. - */ -void nsBlockFrame::GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - // Determine the maximum available reflow height for the child - nscoord yb = aState.borderPadding.top + aState.availSize.height; - aResult.height = aState.unconstrainedHeight ? NS_UNCONSTRAINEDSIZE : - yb - aState.y - aState.topMargin; - - // Determine the maximum available reflow width for the child - if (aState.unconstrainedWidth) { - aResult.width = NS_UNCONSTRAINEDSIZE; - } else if (aIsInline) { - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - aResult.width = aState.currentBand->availSpace.XMost() - aState.x; - } else { - aResult.width = aState.x - aState.currentBand->availSpace.x; - } - } else { - // It's a block. Don't adjust for the left/right margin here. That happens - // later on once we know the current left/right edge - aResult.width = aState.availSize.width; - } -} - -/** - * Push all of the kids that we have not reflowed, starting at - * aState.lineStart. aPrevKid is the kid previous to aState.lineStart - * and is also our last child. Note that line length is NOT a - * reflection of the number of children we are actually pushing - * (because we don't break the sibling list as we add children to the - * line). - */ -void nsBlockFrame::PushKids(nsBlockReflowState& aState) -{ - nsIFrame* prevFrame = aState.prevLineLastFrame; - NS_PRECONDITION(nsnull != prevFrame, "pushing all kids"); -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevFrame->GetNextSibling(nextSibling); - NS_PRECONDITION(nextSibling == aState.lineStart, "bad prev line"); -#endif - -#ifdef NS_DEBUG - PRInt32 numKids = LengthOf(mFirstChild); - NS_ASSERTION(numKids == mChildCount, "bad child count"); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": push kids (childCount=%d)\n", mChildCount); - DumpFlow(); -#endif - - PushChildren(aState.lineStart, prevFrame, mLastContentIsComplete); - SetLastContentOffset(prevFrame); - - // Set mLastContentIsComplete to the previous lines last content is - // complete now that the previous line's last child is our last - // child. - mLastContentIsComplete = aState.prevLineLastContentIsComplete; - - // Fix up child count - // XXX is there a better way? aState.lineLength doesn't work because - // we might be pushing more than just the pending line. - nsIFrame* kid = mFirstChild; - PRInt32 kids = 0; - while (nsnull != kid) { - kids++; - kid->GetNextSibling(kid); - } - mChildCount = kids; - - // Make sure we have no lingering line data - aState.lineLength = 0; - aState.lineStart = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d) [%c]\n", mChildCount, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif -} - -/** - * Gets a band of available space starting at the specified y-offset. Assumes - * the local coordinate space is currently set to the upper-left origin of the - * bounding rect - * - * Updates "currentBand" and "x" member data of the block reflow state - */ -void nsBlockFrame::GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY) -{ - // Gets a band of available space. - aState.spaceManager->Translate(aState.borderPadding.left, 0); - aState.spaceManager->GetBandData(aY, aState.availSize, *aState.currentBand); - - // Compute the bounding rect of the available space, i.e. space between any - // left and right floaters - aState.currentBand->ComputeAvailSpaceRect(); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - aState.x = aState.currentBand->availSpace.x; -} - -void nsBlockFrame::ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear) -{ - // Translate the coordinate space - aState.spaceManager->Translate(aState.borderPadding.left, 0); - -getBand: - nscoord y = aState.y + aState.topMargin; - PRBool isLeftFloater = PR_FALSE; - PRBool isRightFloater = PR_FALSE; - - // Get a band of available space - aState.spaceManager->GetBandData(y, aState.availSize, *aState.currentBand); - - // Scan the trapezoids looking for left and right floaters - nsBandTrapezoid* trapezoid = aState.currentBand->trapezoids; - for (PRInt32 i = 0; i < aState.currentBand->count; i++) { - // XXX Handle multiply occupied - if (nsBandTrapezoid::smOccupied == trapezoid->state) { - nsStyleDisplay* display; - - trapezoid->frame->GetStyleData(kStylePositionSID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - isLeftFloater = PR_TRUE; - } else if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - isRightFloater = PR_TRUE; - } - } - - trapezoid++; - } - - if (isLeftFloater) { - if ((aClear == NS_STYLE_CLEAR_LEFT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - if (isRightFloater) { - if ((aClear == NS_STYLE_CLEAR_RIGHT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - - aState.spaceManager->Translate(-aState.borderPadding.left, 0); -} - -// Bit's for PlaceAndReflowChild return value -#define PLACE_FIT 0x1 -#define PLACE_FLOWED 0x2 - -PRIntn -nsBlockFrame::PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC) -{ - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = - (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - - // Get line start setup if we are at the start of a new line - if (nsnull == aState.lineStart) { - NS_ASSERTION(0 == aState.lineLength, "bad line length"); - aState.lineStart = aKidFrame; - } - - // Get kid and its style - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - - // Figure out if kid is a block element or not - PRBool isInline = PR_TRUE; - PRIntn display = styleDisplay->mDisplay; - if (aState.firstChildIsInsideBullet && (mFirstChild == aKidFrame)) { - // XXX Special hack for properly reflowing bullets that have the - // inside value for list-style-position. - display = NS_STYLE_DISPLAY_INLINE; - } - if ((NS_STYLE_DISPLAY_BLOCK == display) || - (NS_STYLE_DISPLAY_LIST_ITEM == display)) { - // Block elements always end up on the next line (unless they are - // already at the start of the line). - isInline = PR_FALSE; - if (aState.lineLength > 0) { - aState.breakAfterChild = PR_TRUE; - } - } - - // Handle forced break first - if (aState.breakAfterChild) { - NS_ASSERTION(aState.lineStart != aKidFrame, "bad line"); - - // Get the last child in the current line - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - if (!AdvanceToNextLine(aCX, aState)) { - // The previous line didn't fit. - return 0; - } - aState.lineStart = aKidFrame; - - // Get the style for the last child, and see if it wanted to clear - // floaters. This handles the BR tag, which is the only inline - // element for which clear applies - nsIStyleContextPtr lastChildSC; - - lastFrame->GetStyleContext(aCX, lastChildSC.AssignRef()); - nsStyleDisplay* lastChildDisplay = (nsStyleDisplay*) - lastChildSC->GetData(kStyleDisplaySID); - switch (lastChildDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, lastChildDisplay->mBreakType); - break; - } - } - - // Now that we've handled force breaks (and maybe called AdvanceToNextLine() - // which checks), remember whether it's an inline frame - aState.isInline = isInline; - - // If we're at the beginning of a line then compute the top margin that we - // should use - if (aState.lineStart == aKidFrame) { - // Compute the top margin to use for this line - aState.topMargin = GetTopMarginFor(aCX, aState, aKidFrame, aKidSC, - aState.isInline); - - // If it's an inline element then get a band of available space - // - // XXX If we have a current band and there's unused space in that band - // then avoid this call to get a band... - if (aState.isInline) { - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - } - } - - // Compute the available space to reflow the child into and then - // reflow it into that space. - nsSize kidAvailSize; - GetAvailSize(kidAvailSize, aState, aKidSC, aState.isInline); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - - ReflowStatus status; - - if (aState.isInline) { - nsReflowMetrics kidSize; - - // Inline elements are never passed the space manager - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - NS_ASSERTION(nsnull != aState.lineStart, "bad line start"); - - if (aKidFrame == aState.lineStart) { - // Width always fits when we are at the logical left margin. - // Just check the height. - // - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall - return PLACE_FLOWED; - } - } else { - // Examine state and if the breakBeforeChild is set and we - // aren't already on the new line, do the forcing now. - // XXX Why aren't we doing this check BEFORE we resize reflow the child? - if (aState.breakBeforeChild) { - aState.breakBeforeChild = PR_FALSE; - if (aKidFrame != aState.lineStart) { - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow child now that it has the line to itself - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - } - } - - // When we are not at the logical left margin then we need - // to check the width first. If we are too wide then advance - // to the next line and try reflowing again. - if (kidSize.width > kidAvailSize.width) { - // Too wide. Try next line - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow splittable children - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable != frNotSplittable) { - // Update size info now that we are on the next line. Then - // reflow the child into the new available space. - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - } - - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall on the next line - return PLACE_FLOWED; - } - // It's ok if it's too wide on the next line. - } - } - } - - // Add child to the line - AddInlineChildToLine(aCX, aState, aKidFrame, kidSize, - pKidMaxElementSize, aKidSC); - } else { - nsRect kidRect; - - // Does the block-level element want to clear any floaters that impact - // it? Note that the clear property only applies to block-level elements - // and the BR tag - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - switch (styleDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, styleDisplay->mBreakType); - GetAvailSize(kidAvailSize, aState, aKidSC, PR_FALSE); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - break; - } - - // Give the block its own local coordinate space.. Note: ReflowChild() - // will adjust for the child's left/right margin after determining the - // current left/right edge - aState.spaceManager->Translate(aState.borderPadding.left, 0); - // Give the block-level element the opportunity to use the space manager - status = ReflowChild(aKidFrame, aCX, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - // Block elements always fit horizontally (because they are - // always placed at the logical left margin). Check to see if - // the block fits vertically - if (kidRect.YMost() > kidAvailSize.height) { - // Nope - return PLACE_FLOWED; - } - } - - // Add block child - // XXX We need to set lastContentIsComplete here, because AddBlockChild() - // calls AdvaneceToNextLine(). We need to restructure the flow of control, - // and use a state machine... - aState.lastContentIsComplete = PRBool(status == frComplete); - AddBlockChild(aCX, aState, aKidFrame, kidRect, pKidMaxElementSize, aKidSC); - } - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - - aState.lastContentIsComplete = PRBool(status == frComplete); - if (aState.isInline && (frNotComplete == status)) { - // Since the inline child didn't complete its reflow we *know* - // that a continuation of it can't possibly fit on the current - // line. Therefore, set a flag in the state that will cause the - // a line break before the next frame is placed. - aState.breakAfterChild = PR_TRUE; - } - - aState.reflowStatus = status; - return PLACE_FLOWED | PLACE_FIT; -} - -/** - * Reflow the existing frames. - * - * @param aCX presentation context to use - * @param aState in out parameter which tracks the state of - * reflow for the block frame. - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool -nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsIFrame* kidFrame; - - for (kidFrame = mFirstChild; nsnull != kidFrame; ) { - - /* we get the kid's style from kidFrame's cached style context */ - nsIStyleContextPtr kidSC; - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - - // Attempt to place and reflow the child - - // XXX if child is not splittable and it fits just place it where - // it is, otherwise advance to the next line and place it there if - // possible - - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - ReflowStatus status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // The child doesn't fit. Push it and any remaining children. - PushKids(aState); - result = PR_FALSE; - goto push_done; - } - - // Is the child complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - // Yes, the child is complete - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else { - // No the child isn't complete - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Unlike the inline frame code we can't assume that we used - // up all of our space because the child's reflow status is - // frNotComplete. Instead, the child is probably split and - // we need to reflow the continuations as well. - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - } - - push_done: -#ifdef NS_DEBUG - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - - PRInt32 len = LengthOf(mFirstChild); - NS_POSTCONDITION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -/* XXX: - * In this method, we seem to be getting the style for the next child, - * and checking that child's style for the child's display type. - * The problem is that it's very inefficient to ResolveStyleFor(kid) here - * and then just throw it away, when we end up doing a ResolveStyleFor(kid) - * again when we actually create a frame for the content. - * It would be nice to cache the resolved style, maybe in the reflow state? - */ -PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) -{ - PRBool rv = PR_FALSE; - if (IsPseudoFrame()) { - // Get the next content object that we would like to reflow - PRInt32 kidIndex = NextChildOffset(); - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNotNull()) { - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - switch (kidStyleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block pseudo-frames do not contain other block elements - break; - - default: - rv = PR_TRUE; - break; - } - } - } else { - if (NextChildOffset() < mContent->ChildCount()) { - rv = PR_TRUE; - } - } - return rv; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aCX presentation context to use - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsBlockFrame* prev = (nsBlockFrame*) mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - mFirstContentOffset = prev->NextChildOffset(); - if (PR_FALSE == prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time until we are out of children - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (nsnull == kidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // If we're being used as a pseudo frame, i.e. we map the same - // content as our parent then we want to indicate we're complete; - // otherwise we'll be continued and go on mapping children... - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - result = frComplete; - goto done; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aCX); - kidFrame = kidDel->CreateFrame(aCX, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidSC); - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - kidPrevInFlow->CreateContinuingFrame(aCX, this, kidFrame); - } - - // Link child frame into the list of children. If the frame ends - // up not fitting and getting pushed, the PushKids code will fixup - // the child count for us. - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - - // Reflow child frame as many times as necessary until it is - // complete. - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // We ran out of room. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - goto push_done; - } - - // Did the child complete? - prevKidFrame = kidFrame; - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "huh?"); -#endif - } while (frNotComplete == status); - - // The child that we just reflowed is complete -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); -#endif - kidIndex++; - kidPrevInFlow = nsnull; - } - - done: - // To get here we either completely reflowed all our appended - // children OR we are a pseudo-frame and we ran into a block - // element. In either case our last content MUST be complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - - push_done: -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Pullup frames from our next in flow and try to place them. Before - * this is called our previously mapped children, if any have been - * reflowed which means that the block reflow state's x and y - * coordinates and other data are ready to go. - * - * Return true if we pulled everything up. - */ -PRBool -nsBlockFrame::PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsBlockFrame* nextInFlow = (nsBlockFrame*) mNextInFlow; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - while (nsnull != nextInFlow) { - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (nsBlockFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get style information for the pulled up kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // Push the kids that didn't fit back down to the next-in-flow - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - result = PR_FALSE; - goto push_done; - } - - if (frNotComplete == status) { - // Child is not complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // Create a continuing frame for the incomplete child - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - } - - if (nsnull != prevKidFrame) { - // The only way we can get here is by pulling up every last child - // in our next-in-flows (and reflowing any continunations they - // have). Therefore we KNOW that our last child is complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - push_done:; - - if (result == PR_FALSE) { - // If our next-in-flow is empty OR our next next-in-flow is empty - // then adjust the offsets of all of the empty next-in-flows. - nextInFlow = (nsBlockFrame*) mNextInFlow; - if ((0 == nextInFlow->mChildCount) || - ((nsnull != nextInFlow->mNextInFlow) && - (0 == ((nsBlockFrame*)(nextInFlow->mNextInFlow))->mChildCount))) { - // We didn't pullup everything and we need to fixup one of our - // next-in-flows content offsets. - AdjustOffsetOfEmptyNextInFlows(); - } - } - - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -void nsBlockFrame::SetupState(nsIPresContext* aCX, - nsBlockReflowState& aState, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager) -{ - // Setup reflow state - aState.Init(aMaxSize, aMaxElementSize, mStyleContext, aSpaceManager); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - - // Apply border and padding adjustments for regular frames only - if (PR_FALSE == IsPseudoFrame()) { - aState.borderPadding = mySpacing->mBorderPadding; - aState.y = mySpacing->mBorderPadding.top; - aState.availSize.width -= - (mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right); - aState.availSize.height -= - (mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom); - } else { - aState.borderPadding.SizeTo(0, 0, 0, 0); - } - - // Setup initial list ordinal value - nsIAtom* tag = mContent->GetTag(); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - nsHTMLValue value; - if (eContentAttr_HasValue == - ((nsIHTMLContent*)mContent)->GetAttribute(nsHTMLAtoms::start, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - aState.nextListOrdinal = value.GetIntValue(); - } - } - } - NS_RELEASE(tag); - - mCurrentState = &aState; -} - -#include "nsUnitConversion.h"/* XXX */ -NS_METHOD nsBlockFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - return DoResizeReflow(aCX, state, aDesiredRect, aStatus); -} - -nsresult nsBlockFrame::DoResizeReflow(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height)); - DumpFlow(); -#endif - - // Zap old line data - if (nsnull != mLines) { - delete mLines; - mLines = nsnull; - } - mNumLines = 0; - - // Check for an overflow list - MoveOverflowToChildList(); - - // Before we start reflowing, cache a pointer to our state structure - // so that inline frames can find it. - nsIPresShell* shell = aCX->GetShell(); - shell->PutCachedData(this, &aState); - - // First reflow any existing frames - PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aCX, aState); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } - - if (reflowMappedOK) { - // Any space left? - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if ((nsnull != mFirstChild) && (aState.y >= yb)) { - // No space left. Don't try to pull-up children or reflow - // unmapped. We need to return the correct completion status, - // so see if there is more to reflow. - if (MoreToReflow(aCX)) { - aStatus = frNotComplete; - } - } else if (MoreToReflow(aCX)) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || PullUpChildren(aCX, aState)) { - // If we still have unmapped children then create some new frames - if (MoreToReflow(aCX)) { - aStatus = ReflowAppendedChildren(aCX, aState); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Deal with last line - make sure it gets vertically and - // horizontally aligned. This also updates the state's y coordinate - // which is good because that's how we size ourselves. - if (0 != aState.lineLength) { - if (!AdvanceToNextLine(aCX, aState)) { - // The last line of output doesn't fit. Push all of the kids to - // the next in flow and change our reflow status to not complete - // so that we are continued. -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids since last line doesn't fit\n"); -#endif - - PushKids(aState); - aStatus = frNotComplete; - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there is room for it. - nscoord margin = aState.prevMaxPosBottomMargin - - aState.prevMaxNegBottomMargin; - nscoord y = aState.y + margin; - if (y <= aState.borderPadding.top + aState.availSize.height) { - aState.y = y; - } - } - - // Now that reflow has finished, remove the cached pointer - shell->RemoveCachedData(this); - NS_RELEASE(shell); - - // Translate state.lineLengths into an integer array - mNumLines = aState.lineLengths.Count(); - if (mNumLines > 0) { - mLines = new PRInt32[mNumLines]; - for (PRInt32 i = 0; i < mNumLines; i++) { - PRInt32 ll = (PRInt32) aState.lineLengths.ElementAt(i); - mLines[i] = ll; - } - } - - if (!aState.unconstrainedWidth && aState.justifying) { - // Perform justification now that we know how many lines we have. - JustifyLines(aCX, aState); - } - - // Return our desired rect and our status - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = aState.kidXMost + aState.borderPadding.right; - if (!aState.unconstrainedWidth) { - // Make sure we're at least as wide as the max size we were given - nscoord maxWidth = aState.availSize.width + aState.borderPadding.left + - aState.borderPadding.right; - - if (aDesiredRect.width < maxWidth) { - aDesiredRect.width = maxWidth; - } - } - aState.y += aState.borderPadding.bottom; - aDesiredRect.height = aState.y; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g %scomplete [%d,%d,%c]\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height), - ((status == frNotComplete) ? "NOT " : ""), - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F') - ); - DumpFlow(); -#endif - mCurrentState = nsnull; - return NS_OK; -} - -void nsBlockFrame::JustifyLines(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - // XXX we don't justify the last line; what if we are continued, - // should we do it then? - nsIFrame* kid = mFirstChild; - for (PRInt32 i = 0; i < mNumLines; i++) { - nsIFrame* lineStart = kid; - PRInt32 lineLength = mLines[i]; - if (i < mNumLines - 1) { - if (1 == lineLength) { - // For lines with one element on them we can take a shortcut and - // let them do the justification. Note that we still call - // JustifyReflow even if the available space is zero in case the - // child is a hunk of text that ends in whitespace. The whitespace - // will be distributed elsewhere causing a proper flush right look - // for the last word. - nsRect r; - kid->GetRect(r); - nscoord maxWidth = aState.availSize.width; - nscoord availableSpace = maxWidth - r.width; - nscoord maxAvailSpace = nscoord(maxWidth * 0.1f); - if ((availableSpace >= 0) && (availableSpace < maxAvailSpace)) { - kid->JustifyReflow(aCX, availableSpace); - kid->SizeTo(r.width + availableSpace, r.height); - } - kid->GetNextSibling(kid); - } else { - // XXX Get justification of multiple elements working - while (--lineLength >= 0) { - kid->GetNextSibling(kid); - } - } - } - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - nsCSSLayout::RelativePositionChildren(aCX, this, lineStart, mLines[i]); - } -} - -NS_METHOD nsBlockFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittableNonRectangular; - return NS_OK; -} - -NS_METHOD nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD nsBlockFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - - if (aReflowCommand.GetTarget() == this) { - // XXX for now, just do a complete reflow mapped (it'll kinda - // work, but it's slow) - - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, nsnull, aSpaceManager); - PRBool reflowMappedOK = ReflowMappedChildren(aCX, state); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } else { - // XXX not yet implemented - NS_ABORT(); - // XXX work to compute initial state goes *HERE* - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = 0; - aDesiredRect.height = 0; - } - - mCurrentState = nsnull; - return NS_OK; -} - -PRBool nsBlockFrame::IsLeftMostChild(nsIFrame* aFrame) -{ - do { - nsIFrame* parent; - - aFrame->GetGeometricParent(parent); - - // See if there are any non-zero sized child frames that precede aFrame - // in the child list - nsIFrame* child; - - parent->FirstChild(child); - while ((nsnull != child) && (aFrame != child)) { - nsSize size; - - // Is the child zero-sized? - child->GetSize(size); - if ((size.width > 0) || (size.height > 0)) { - // We found a non-zero sized child frame that precedes aFrame - return PR_FALSE; - } - - child->GetNextSibling(child); - } - - // aFrame is the left-most non-zero sized frame in its geometric parent. - // Walk up one level and check that its parent is left-most as well - aFrame = parent; - } while (aFrame != this); - - return PR_TRUE; -} - -PRBool nsBlockFrame::AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // Get the frame associated with the space manager, and get its nsIAnchoredItems - // interface - nsIFrame* frame = mCurrentState->spaceManager->GetFrame(); - nsIAnchoredItems* anchoredItems = nsnull; - - frame->QueryInterface(kIAnchoredItemsIID, (void**)&anchoredItems); - NS_ASSERTION(nsnull != anchoredItems, "no anchored items interface"); - - if (nsnull != anchoredItems) { - anchoredItems->AddAnchoredItem(aFloater, nsIAnchoredItems::anHTMLFloater, this); - PlaceFloater(aCX, aFloater, aPlaceholder); - return PR_TRUE; - } - - return PR_FALSE; -} - -// XXX The size of the floater needs to be taken into consideration if we're -// computing a maximum element size -void nsBlockFrame::PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // If the floater is the left-most non-zero size child frame then insert - // it before the current line; otherwise add it to the below-current-line - // todo list and we'll handle it when we flush out the line - if (IsLeftMostChild(aPlaceholder)) { - // Get the type of floater - nsIStyleContextPtr styleContext; - - aFloater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* floaterDisplay = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - if (!mCurrentState->isInline) { - // Get the current band for this line - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } - - // Commit some space in the space manager - nsRect region; - - aFloater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == floaterDisplay->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == floaterDisplay->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, 0); - mCurrentState->spaceManager->AddRectRegion(region, aFloater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - aFloater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - - // Update the band of available space to reflect space taken up by the floater - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } else { - // Add the floater to our to-do list - mCurrentState->floaterToDo.AppendElement(aFloater); - } -} - -NS_METHOD nsBlockFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last-in-flow - nsBlockFrame* flow = (nsBlockFrame*)GetLastInFlow(); - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - -#if 0 - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Is it a floater? - if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - // Create initial frame for the child - nsIContentDelegate* kidDel; - nsresult fr; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // Update last content offset now that we are done drawing - // children from our parent. - SetLastContentOffset(prevKidFrame); - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - return NS_OK; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - } - kidFrame->SetStyleContext(kidSC); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - kidIndex++; - mChildCount++; - } - SetLastContentOffset(prevKidFrame); -#endif - - // If this is a pseudo-frame then our parent will generate the - // reflow command. Otherwise, if the container is us then we should - // generate the reflow command because we were directly called. - if (!IsPseudoFrame() && (aContainer == mContent)) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} - -PRIntn nsBlockFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - -nsHTMLFrameType nsBlockFrame::GetFrameType() const -{ - return eHTMLFrame_Block; -} - -NS_METHOD nsBlockFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fprintf(out, "*block<"); - nsIAtom* atom = mContent->GetTag(); - if (nsnull != atom) { - nsAutoString tmp; - atom->ToString(tmp); - fputs(tmp, out); - } - fprintf(out, ">(%d)@%p", mIndexInParent, this); - } else { - nsHTMLContainerFrame::ListTag(out); - } - return NS_OK; -} - -#ifdef NS_DEBUG -void nsBlockFrame::DumpFlow() const -{ -#ifdef NOISY_FLOW - nsBlockFrame* flow = (nsBlockFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsBlockFrame*) flow->mNextInFlow; - } -#endif -} -#endif diff --git a/mozilla/layout/html/base/src/nsBlockFrame.h b/mozilla/layout/html/base/src/nsBlockFrame.h deleted file mode 100644 index f11bba52ca1..00000000000 --- a/mozilla/layout/html/base/src/nsBlockFrame.h +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsBlockFrame_h___ -#define nsBlockFrame_h___ - -#include "nsHTMLContainerFrame.h" -#include "nsIFloaterContainer.h" -#include "nsIHTMLFrameType.h" -#include "nsIRunaround.h" -#include "nsVoidArray.h" -struct BlockBandData; -struct nsMargin; -struct nsStyleDisplay; -struct nsStyleFont; -struct nsStyleText; - -/** - * Block frames have some state which needs to be made - * available to child frames for proper reflow. This structure - * describes that state. - */ -struct nsBlockReflowState { - // True if this is the first line of text in a block container - PRPackedBool firstLine; - - // True if leading whitespace is allowed to show - PRPackedBool allowLeadingWhitespace; - - // This is set when some child frame needs a break after it's placed - PRPackedBool breakAfterChild; - - // This is set when a child needs a break before it's placed. Note - // that this value is set by a child AFTER we have called it's - // ResizeReflow method. - PRPackedBool breakBeforeChild; - - // This is set when the first child should be treated specially - // because it's an inside list item bullet. - // XXX this can go away once we have a way for the bullet's style - // molecule to *not* be the same as it's parent's - PRPackedBool firstChildIsInsideBullet; - - // For pre-formatted text, this is our current column - PRIntn column; - - // The next list ordinal value - PRInt32 nextListOrdinal; - - //---------------------------------------------------------------------- - // State from here on down is not to be used by block child frames! - - // Space manager to use - nsISpaceManager* spaceManager; - - // Block's style context - nsIStyleContext* styleContext; - nsStyleText* styleText; - nsStyleFont* styleFont; - nsStyleDisplay* styleDisplay; - - // Block's available size (computed from the block's parent) - nsSize availSize; - - // Current band of available space. Used for doing runaround - BlockBandData* currentBand; - - // Pointer to a max-element-size (nsnull if none required) - nsSize* maxElementSize; - - // The maximum x-most of our lines and block-level elements. This is used to - // compute our desired size, and includes our left border/padding. For block- - // level elements this also includes the block's right margin. - nscoord kidXMost; - - // Current reflow position - nscoord y; - - // Current line state - nscoord x; // inline elements only. not include border/padding - PRBool isInline; // whether the current is inline or block - nsVoidArray lineLengths; // line length temporary storage - PRIntn currentLineNumber; // index into mLines - nsIFrame* lineStart; // frame starting the line - PRInt32 lineLength; // length of line - nscoord* ascents; // ascent information for each child - nscoord maxAscent; // max ascent for this line - nscoord maxDescent; // max descent for this line - nscoord lineWidth; // current width of line -#if 0 - nscoord maxPosTopMargin; // maximum positive top margin - nscoord maxNegTopMargin; // maximum negative top margin -#else - nscoord topMargin; // current top margin -#endif - nscoord maxPosBottomMargin; // maximum positive bottom margin - nscoord maxNegBottomMargin; // maximum negative bottom margin - nsSize lineMaxElementSize; // max element size for current line - PRBool lastContentIsComplete; // reflow status of last child on line - nsVoidArray floaterToDo; // list of floaters to place below current line - - PRInt32 maxAscents; // size of ascent buffer - nscoord ascentBuf[20]; - - PRPackedBool needRelativePos; // some kid in line needs relative pos - - // Previous line state that we carry forward to the next line - nsIFrame* prevLineLastFrame; - nscoord prevLineHeight; // height of the previous line - nscoord prevMaxPosBottomMargin; // maximum posative bottom margin - nscoord prevMaxNegBottomMargin; // maximum negative bottom margin - PRBool prevLineLastContentIsComplete; - - // Sanitized version of mol->borderPadding; if this block frame is a - // pseudo-frame then the margin will be zero'd. - nsMargin borderPadding; - - PRPackedBool justifying; // we are justifying - - // Status from last PlaceAndReflowChild - nsIFrame::ReflowStatus reflowStatus; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - nsBlockReflowState(); - - ~nsBlockReflowState(); - - void Init(const nsSize& aMaxSize, nsSize* aMaxElementSize, - nsIStyleContext* aStyleContext, nsISpaceManager* aSpaceManager); - - void AddAscent(nscoord aAscent); - void AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, nscoord aPrevLineHeight); - -#ifdef NS_DEBUG - void DumpLine(); - void DumpList(); -#endif -}; - -//---------------------------------------------------------------------- - -/** - *

    Block Reflow

    - * - * The block frame reflow machinery performs "2D" layout. Inline - * elements are flowed into logical lines (left to right or right to - * left) and the lines are stacked vertically. Block elements are - * flowed onto their own line after flushing out any preceeding line.

    - * - * After a line is ready to be flushed out, vertical alignment is - * performed. Vertical alignment may require the line to consume more - * vertical space than is available thus causing the entire line to - * be pushed.

    - * - * After vertical alignment is done, horizontal alignment (including - * justification) is performed. Finally, relative positioning is done - * on any elements that require it.

    - * - * During reflow, the block frame will make available to child frames - * it's reflow state using the presentation shell's cached data - * mechanism.

    - * - *

    Reflowing Mapped Content

    - *

    Pullup

    - *

    Reflowing Unmapped Content

    - *

    Content Insertion Handling

    - *

    Content Deletion Handling

    - *

    Style Change Handling

    - * - *

    Assertions

    - * mLastContentIsComplete always reflects the state of the last - * child frame on our chlid list. - */ -class nsBlockFrame : public nsHTMLContainerFrame, public nsIHTMLFrameType, - public nsIRunaround, public nsIFloaterContainer -{ -public: - /** - * Create a new block frame that maps the given piece of content. - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer); - - NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const; - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - virtual PRBool AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder); - virtual void PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder); - - NS_IMETHOD ListTag(FILE* out = stdout) const; - - virtual nsHTMLFrameType GetFrameType() const; - -protected: - nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsBlockFrame(); - - virtual PRIntn GetSkipSides() const; - - PRBool MoreToReflow(nsIPresContext* aCX); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline); - - PRBool AdvanceToNextLine(nsIPresContext* aPresContext, - nsBlockReflowState& aState); - - void AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC); - - void AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC); - - void GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline); - - PRIntn PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* kidFrame, - nsIStyleContext* aKidSC); - - void PushKids(nsBlockReflowState& aState); - - void SetupState(nsIPresContext* aCX, nsBlockReflowState& aState, - const nsSize& aMaxSize, nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager); - - nsresult DoResizeReflow(nsIPresContext* aPresContext, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus); - - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - nsBlockReflowState& aState); - - PRBool PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState); - - ReflowStatus ReflowAppendedChildren(nsIPresContext* aPresContext, - nsBlockReflowState& aState); - - void JustifyLines(nsIPresContext* aPresContext, nsBlockReflowState& aState); - - PRBool IsLeftMostChild(nsIFrame* aFrame); - - void GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY); - - void PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY); - - void ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear); - -#ifdef NS_DEBUG - void DumpFlow() const; -#endif - - /** - * Array of lines lengths. For each logical line of children, this array - * contains a count of the number of children on the line. - */ - PRInt32* mLines; - PRInt32 mNumLines; - nsBlockReflowState* mCurrentState; -}; - -#endif /* nsBlockFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp deleted file mode 100644 index 6b45fe72cab..00000000000 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ /dev/null @@ -1,2184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBlockFrame.h" -#include "nsSize.h" -#include "nsIAnchoredItems.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsMargin.h" -#include "nsHTMLIIDs.h" -#include "nsCSSLayout.h" -#include "nsCRT.h" -#include "nsIPresShell.h" -#include "nsReflowCommand.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsAbsoluteFrame.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct BlockBandData : public nsBandData { - nsBandTrapezoid data[12]; - - // Bounding rect of available space between any left and right floaters - nsRect availSpace; - - // Constructor - BlockBandData() {size = 12; trapezoids = data;} - - // Computes the bounding rect of the available space, i.e. space between - // any left and right floaters - // - // Uses the current trapezoid data, see nsISpaceManager::GetBandData(). - // Updates member data "availSpace" - void ComputeAvailSpaceRect(); -}; - -void BlockBandData::ComputeAvailSpaceRect() -{ - nsBandTrapezoid* trapezoid = data; - - if (count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < count; i++) { - nsBandTrapezoid* trapezoid = &data[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &data[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availSpace); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availSpace); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availSpace.x = availSpace.XMost(); - } - availSpace.width = 0; - } -} - -// XXX Bugs -// 1. right to left reflow can generate negative x coordinates. - -// XXX Speedup idea (all containers) - -// If I reflow a child and it gives back not-complete status then -// there is no sense in trying to pullup children. For blocks, it's a -// little more complicated unless the child is a block - if the child -// is a block, then we must be out of room hence we should stop. If -// the child is not a block then our line should be flushed (see #2 -// below) if our line is already empty then we must be out of room. - -// For inline frames and column frames, if we reflow a child and get -// back not-complete status then we should bail immediately because we -// are out of room. - -// XXX Speedup ideas: -// 1. change pullup code to use line information from next in flow -// 2. we can advance to next line immediately after reflowing something -// and noticing that it's not complete. -// 3. pass down last child information in aState so that pullup, etc., -// don't need to recompute it - -// XXX TODO: -// 0. Move justification into line flushing code - -// 1. To get ebina margins I need "auto" information from the style -// system margin's. A bottom/top margin of auto will then be computed like -// ebina computes it [however the heck that is]. - -// 2. kicking out floaters and talking with floater container to adjust -// left and right margins - -nsBlockReflowState::nsBlockReflowState() -{ -} - -void nsBlockReflowState::Init(const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsIStyleContext* aBlockSC, - nsISpaceManager* aSpaceManager) -{ - firstLine = PR_TRUE; - allowLeadingWhitespace = PR_FALSE; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - firstChildIsInsideBullet = PR_FALSE; - nextListOrdinal = -1; - column = 0; - - spaceManager = aSpaceManager; - currentBand = new BlockBandData; - - styleContext = aBlockSC; - styleText = (nsStyleText*) aBlockSC->GetData(kStyleTextSID); - styleFont = (nsStyleFont*) aBlockSC->GetData(kStyleFontSID); - styleDisplay = (nsStyleDisplay*) aBlockSC->GetData(kStyleDisplaySID); - - justifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == styleText->mTextAlign) && - (NS_STYLE_WHITESPACE_PRE != styleText->mWhiteSpace); - - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - maxElementSize = aMaxElementSize; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - kidXMost = 0; - x = 0; - y = 0; - - isInline = PR_FALSE; - currentLineNumber = 0; - lineStart = nsnull; - lineLength = 0; - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; - lineMaxElementSize.width = 0; - lineMaxElementSize.height = 0; - lastContentIsComplete = PR_TRUE; - - maxAscents = sizeof(ascentBuf) / sizeof(ascentBuf[0]); - needRelativePos = PR_FALSE; - - prevLineLastFrame = nsnull; - prevLineHeight = 0; - topMargin = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - prevLineLastContentIsComplete = PR_TRUE; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - reflowStatus = nsIFrame::frNotComplete; -} - -nsBlockReflowState::~nsBlockReflowState() -{ - if (ascents != ascentBuf) { - delete ascents; - } - delete currentBand; -} - -void nsBlockReflowState::AddAscent(nscoord aAscent) -{ - NS_PRECONDITION(lineLength <= maxAscents, "bad line length"); - if (lineLength == maxAscents) { - maxAscents *= 2; - nscoord* newAscents = new nscoord[maxAscents]; - if (nsnull != newAscents) { - nsCRT::memcpy(newAscents, ascents, sizeof(nscoord) * lineLength); - if (ascents != ascentBuf) { - delete ascents; - } - ascents = newAscents; - } else { - // Yikes! Out of memory! - return; - } - } - ascents[lineLength] = aAscent; -} - -void nsBlockReflowState::AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, - nscoord aPrevLineHeight) -{ - firstLine = PR_FALSE; - allowLeadingWhitespace = PR_FALSE; - column = 0; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - lineStart = nsnull; - lineLength = 0; - currentLineNumber++; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - needRelativePos = PR_FALSE; - - prevLineLastFrame = aPrevLineLastFrame; - prevLineHeight = aPrevLineHeight; - prevMaxPosBottomMargin = maxPosBottomMargin; - prevMaxNegBottomMargin = maxNegBottomMargin; - - // Remember previous line's lastContentIsComplete - prevLineLastContentIsComplete = lastContentIsComplete; - lastContentIsComplete = PR_TRUE; - - topMargin = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; -} - -#ifdef NS_DEBUG -void nsBlockReflowState::DumpLine() -{ - nsIFrame* f = lineStart; - PRInt32 ll = lineLength; - while (--ll >= 0) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} - -void nsBlockReflowState::DumpList() -{ - nsIFrame* f = lineStart; - while (nsnull != f) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} -#endif - -//---------------------------------------------------------------------- - -nsresult nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBlockFrame::nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsBlockFrame::~nsBlockFrame() -{ - if (nsnull != mLines) { - delete mLines; - } -} - -nsresult -nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLFrameTypeIID)) { - *aInstancePtr = (void*) ((nsIHTMLFrameType*) this); - return NS_OK; - } else if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void*) ((nsIRunaround*) this); - return NS_OK; - } else if (aIID.Equals(kIFloaterContainerIID)) { - *aInstancePtr = (void*) ((nsIFloaterContainer*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Computes the top margin to use for this child frames based on its display -// type and the display type of the previous child frame. -// -// Adjacent vertical margins between block-level elements are collapsed. -nscoord nsBlockFrame::GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - if (aIsInline) { - // Just use whatever the previous bottom margin was - return aState.prevMaxPosBottomMargin - aState.prevMaxNegBottomMargin; - } else { - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - if (ss->mMargin.top < 0) { - maxNegTopMargin = -ss->mMargin.top; - } else { - maxPosTopMargin = ss->mMargin.top; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - return maxPos - maxNeg; - } else { - return 0; - } - } -} - -void nsBlockFrame::PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY) -{ - NS_PRECONDITION(aState.floaterToDo.Count() > 0, "no floaters"); - - // XXX Factor this code with PlaceFloater()... - PRInt32 numFloaters = aState.floaterToDo.Count(); - - for (PRInt32 i = 0; i < numFloaters; i++) { - nsIFrame* floater = (nsIFrame*)aState.floaterToDo[i]; - nsRect region; - - // Get the band of available space - // XXX This is inefficient to do this inside the loop... - GetAvailableSpaceBand(aState, aY); - - // Get the type of floater - nsIStyleContextPtr styleContext; - - floater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* sd = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - floater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == sd->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == sd->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, - 0); - mCurrentState->spaceManager->AddRectRegion(region, floater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - floater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - } - aState.floaterToDo.Clear(); -} - -/** - * Flush a line out. Return true if the line fits in our available - * height. If the line does not fit then return false. When the line - * fits we advance the y coordinate, reset the x coordinate and - * prepare the nsBlockReflowState for the next line. - */ -PRBool nsBlockFrame::AdvanceToNextLine(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - NS_PRECONDITION(aState.lineLength > 0, "bad line"); - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nscoord y = aState.y + aState.topMargin; - nscoord lineHeight; - - if (aState.isInline) { - // Vertically align the children on this line, returning the height of - // the line upon completion. - lineHeight = nsCSSLayout::VerticallyAlignChildren(aCX, this, - aState.styleFont, - y, - aState.lineStart, - aState.lineLength, - aState.ascents, - aState.maxAscent); - - // Any below current line floaters to place? - if (aState.floaterToDo.Count() > 0) { - PlaceBelowCurrentLineFloaters(aCX, aState, y + lineHeight); - // XXX Factor in the height of the floaters as well when considering - // whether the line fits. - // The default policy is that if there isn't room for the floaters then - // both the line and the floaters are pushed to the next-in-flow... - } - } else { - nsSize size; - - aState.lineStart->GetSize(size); - lineHeight = size.height; - } - - // The first line always fits - if (aState.currentLineNumber > 0) { - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if (y + lineHeight > yb) { - // After vertical alignment of the children and factoring in the - // proper margin, the line doesn't fit. - return PR_FALSE; - } - } - - if (aState.isInline) { - // Check if the right-edge of the line exceeds our running x-most - nscoord xMost = aState.borderPadding.left + aState.lineWidth; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - } - - // Advance the y coordinate to the new position where the next - // line or block element will go. - aState.y = y + lineHeight; - aState.x = 0; - - // Now that the vertical alignment is done we can perform horizontal - // alignment and relative positioning. Skip all of these if we are - // doing an unconstrained (in x) reflow. There's no point in doing - // the work if we *know* we are going to reflowed again. - if (!aState.unconstrainedWidth) { - nsCSSLayout::HorizontallyPlaceChildren(aCX, this, aState.styleText, - aState.lineStart, aState.lineLength, - aState.lineWidth, - aState.availSize.width); - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - if (!aState.justifying) { - nsCSSLayout::RelativePositionChildren(aCX, this, - aState.lineStart, - aState.lineLength); - } - } - - // Record line length - aState.lineLengths.AppendElement((void*)aState.lineLength); - - // Find the last frame in the line - // XXX keep this as running state in the nsBlockReflowState - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - // Update maxElementSize - if (nsnull != aState.maxElementSize) { - nsSize& lineMax = aState.lineMaxElementSize; - nsSize* maxMax = aState.maxElementSize; - if (lineMax.width > maxMax->width) { - maxMax->width = lineMax.width; - } - if (lineMax.height > maxMax->height) { - maxMax->height = lineMax.height; - } - aState.lineMaxElementSize.width = 0; - aState.lineMaxElementSize.height = 0; - } - - // Advance to the next line - aState.AdvanceToNextLine(lastFrame, lineHeight); - - return PR_TRUE; -} - -/** - * Add an inline child to the current line. Advance various running - * values after placement. - */ -void nsBlockFrame::AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Place and size the child - // XXX add in left margin from kid - nsRect r; - r.y = aState.y; - r.width = aKidSize.width; - r.height = aKidSize.height; - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - // Left to right positioning. - r.x = aState.borderPadding.left + aState.x + ss->mMargin.left; - aState.x += aKidSize.width + ss->mMargin.left + ss->mMargin.right; - } else { - // Right to left positioning - // XXX what should we do when aState.x goes negative??? - r.x = aState.x - aState.borderPadding.right - ss->mMargin.right - - aKidSize.width; - aState.x -= aKidSize.width + ss->mMargin.right + ss->mMargin.left; - } - aKidFrame->SetRect(r); - aState.AddAscent(aKidSize.ascent); - aState.lineWidth += aKidSize.width; - aState.lineLength++; - - // Update maximums for the line - if (aKidSize.ascent > aState.maxAscent) { - aState.maxAscent = aKidSize.ascent; - } - if (aKidSize.descent > aState.maxDescent) { - aState.maxDescent = aKidSize.descent; - } - // Update running margin maximums - if (aState.firstChildIsInsideBullet && (aKidFrame == mFirstChild)) { - // XXX temporary code. Since the molecule for the bullet frame - // is the same as the LI frame, we get bad style information. - // ignore it. - } else { - nscoord margin; -#if 0 - // XXX CSS2 spec says that top/bottom margin don't affect line height - // calculation. We're waiting for clarification on this issue... - if ((margin = ss->mMargin.top) < 0) { - margin = -margin; - if (margin > aState.maxNegTopMargin) { - aState.maxNegTopMargin = margin; - } - } else { - if (margin > aState.maxPosTopMargin) { - aState.maxPosTopMargin = margin; - } - } -#endif - if ((margin = ss->mMargin.bottom) < 0) { - margin = -margin; - if (margin > aState.maxNegBottomMargin) { - aState.maxNegBottomMargin = margin; - } - } else { - if (margin > aState.maxPosBottomMargin) { - aState.maxPosBottomMargin = margin; - } - } - } - - // Update line max element size - nsSize& mes = aState.lineMaxElementSize; - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > mes.width) { - mes.width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > mes.height) { - mes.height = aKidMaxElementSize->height; - } - } -} - -// Places and sizes the block-level element, and advances the line. -// The rect is in the local coordinate space of the kid frame. -void nsBlockFrame::AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Translate from the kid's coordinate space to our coordinate space - aKidRect.x += aState.borderPadding.left + ss->mMargin.left; - aKidRect.y += aState.y + aState.topMargin; - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - aState.AddAscent(aKidRect.height); - aState.lineLength++; - - // Is this the widest child frame? - nscoord xMost = aKidRect.XMost() + ss->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // Update the max element size - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aKidMaxElementSize->height; - } - } - - // and the bottom line margin information which we'll use when placing - // the next child - if (ss->mMargin.bottom < 0) { - aState.maxNegBottomMargin = -ss->mMargin.bottom; - } else { - aState.maxPosBottomMargin = ss->mMargin.bottom; - } - - // Update the running y-offset - aState.y += aKidRect.height + aState.topMargin; - - // Apply relative positioning if necessary - nsCSSLayout::RelativePositionChildren(aCX, this, aKidFrame, 1); - - // Advance to the next line - aState.AdvanceToNextLine(aKidFrame, aKidRect.height); -} - -/** - * Compute the available size for reflowing the given child at the - * current x,y position in the state. Note that this may return - * negative or zero width/height's if we are out of room. - */ -void nsBlockFrame::GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - // Determine the maximum available reflow height for the child - nscoord yb = aState.borderPadding.top + aState.availSize.height; - aResult.height = aState.unconstrainedHeight ? NS_UNCONSTRAINEDSIZE : - yb - aState.y - aState.topMargin; - - // Determine the maximum available reflow width for the child - if (aState.unconstrainedWidth) { - aResult.width = NS_UNCONSTRAINEDSIZE; - } else if (aIsInline) { - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - aResult.width = aState.currentBand->availSpace.XMost() - aState.x; - } else { - aResult.width = aState.x - aState.currentBand->availSpace.x; - } - } else { - // It's a block. Don't adjust for the left/right margin here. That happens - // later on once we know the current left/right edge - aResult.width = aState.availSize.width; - } -} - -/** - * Push all of the kids that we have not reflowed, starting at - * aState.lineStart. aPrevKid is the kid previous to aState.lineStart - * and is also our last child. Note that line length is NOT a - * reflection of the number of children we are actually pushing - * (because we don't break the sibling list as we add children to the - * line). - */ -void nsBlockFrame::PushKids(nsBlockReflowState& aState) -{ - nsIFrame* prevFrame = aState.prevLineLastFrame; - NS_PRECONDITION(nsnull != prevFrame, "pushing all kids"); -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevFrame->GetNextSibling(nextSibling); - NS_PRECONDITION(nextSibling == aState.lineStart, "bad prev line"); -#endif - -#ifdef NS_DEBUG - PRInt32 numKids = LengthOf(mFirstChild); - NS_ASSERTION(numKids == mChildCount, "bad child count"); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": push kids (childCount=%d)\n", mChildCount); - DumpFlow(); -#endif - - PushChildren(aState.lineStart, prevFrame, mLastContentIsComplete); - SetLastContentOffset(prevFrame); - - // Set mLastContentIsComplete to the previous lines last content is - // complete now that the previous line's last child is our last - // child. - mLastContentIsComplete = aState.prevLineLastContentIsComplete; - - // Fix up child count - // XXX is there a better way? aState.lineLength doesn't work because - // we might be pushing more than just the pending line. - nsIFrame* kid = mFirstChild; - PRInt32 kids = 0; - while (nsnull != kid) { - kids++; - kid->GetNextSibling(kid); - } - mChildCount = kids; - - // Make sure we have no lingering line data - aState.lineLength = 0; - aState.lineStart = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d) [%c]\n", mChildCount, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif -} - -/** - * Gets a band of available space starting at the specified y-offset. Assumes - * the local coordinate space is currently set to the upper-left origin of the - * bounding rect - * - * Updates "currentBand" and "x" member data of the block reflow state - */ -void nsBlockFrame::GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY) -{ - // Gets a band of available space. - aState.spaceManager->Translate(aState.borderPadding.left, 0); - aState.spaceManager->GetBandData(aY, aState.availSize, *aState.currentBand); - - // Compute the bounding rect of the available space, i.e. space between any - // left and right floaters - aState.currentBand->ComputeAvailSpaceRect(); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - aState.x = aState.currentBand->availSpace.x; -} - -void nsBlockFrame::ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear) -{ - // Translate the coordinate space - aState.spaceManager->Translate(aState.borderPadding.left, 0); - -getBand: - nscoord y = aState.y + aState.topMargin; - PRBool isLeftFloater = PR_FALSE; - PRBool isRightFloater = PR_FALSE; - - // Get a band of available space - aState.spaceManager->GetBandData(y, aState.availSize, *aState.currentBand); - - // Scan the trapezoids looking for left and right floaters - nsBandTrapezoid* trapezoid = aState.currentBand->trapezoids; - for (PRInt32 i = 0; i < aState.currentBand->count; i++) { - // XXX Handle multiply occupied - if (nsBandTrapezoid::smOccupied == trapezoid->state) { - nsStyleDisplay* display; - - trapezoid->frame->GetStyleData(kStylePositionSID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - isLeftFloater = PR_TRUE; - } else if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - isRightFloater = PR_TRUE; - } - } - - trapezoid++; - } - - if (isLeftFloater) { - if ((aClear == NS_STYLE_CLEAR_LEFT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - if (isRightFloater) { - if ((aClear == NS_STYLE_CLEAR_RIGHT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - - aState.spaceManager->Translate(-aState.borderPadding.left, 0); -} - -// Bit's for PlaceAndReflowChild return value -#define PLACE_FIT 0x1 -#define PLACE_FLOWED 0x2 - -PRIntn -nsBlockFrame::PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC) -{ - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = - (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - - // Get line start setup if we are at the start of a new line - if (nsnull == aState.lineStart) { - NS_ASSERTION(0 == aState.lineLength, "bad line length"); - aState.lineStart = aKidFrame; - } - - // Get kid and its style - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - - // Figure out if kid is a block element or not - PRBool isInline = PR_TRUE; - PRIntn display = styleDisplay->mDisplay; - if (aState.firstChildIsInsideBullet && (mFirstChild == aKidFrame)) { - // XXX Special hack for properly reflowing bullets that have the - // inside value for list-style-position. - display = NS_STYLE_DISPLAY_INLINE; - } - if ((NS_STYLE_DISPLAY_BLOCK == display) || - (NS_STYLE_DISPLAY_LIST_ITEM == display)) { - // Block elements always end up on the next line (unless they are - // already at the start of the line). - isInline = PR_FALSE; - if (aState.lineLength > 0) { - aState.breakAfterChild = PR_TRUE; - } - } - - // Handle forced break first - if (aState.breakAfterChild) { - NS_ASSERTION(aState.lineStart != aKidFrame, "bad line"); - - // Get the last child in the current line - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - if (!AdvanceToNextLine(aCX, aState)) { - // The previous line didn't fit. - return 0; - } - aState.lineStart = aKidFrame; - - // Get the style for the last child, and see if it wanted to clear - // floaters. This handles the BR tag, which is the only inline - // element for which clear applies - nsIStyleContextPtr lastChildSC; - - lastFrame->GetStyleContext(aCX, lastChildSC.AssignRef()); - nsStyleDisplay* lastChildDisplay = (nsStyleDisplay*) - lastChildSC->GetData(kStyleDisplaySID); - switch (lastChildDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, lastChildDisplay->mBreakType); - break; - } - } - - // Now that we've handled force breaks (and maybe called AdvanceToNextLine() - // which checks), remember whether it's an inline frame - aState.isInline = isInline; - - // If we're at the beginning of a line then compute the top margin that we - // should use - if (aState.lineStart == aKidFrame) { - // Compute the top margin to use for this line - aState.topMargin = GetTopMarginFor(aCX, aState, aKidFrame, aKidSC, - aState.isInline); - - // If it's an inline element then get a band of available space - // - // XXX If we have a current band and there's unused space in that band - // then avoid this call to get a band... - if (aState.isInline) { - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - } - } - - // Compute the available space to reflow the child into and then - // reflow it into that space. - nsSize kidAvailSize; - GetAvailSize(kidAvailSize, aState, aKidSC, aState.isInline); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - - ReflowStatus status; - - if (aState.isInline) { - nsReflowMetrics kidSize; - - // Inline elements are never passed the space manager - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - NS_ASSERTION(nsnull != aState.lineStart, "bad line start"); - - if (aKidFrame == aState.lineStart) { - // Width always fits when we are at the logical left margin. - // Just check the height. - // - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall - return PLACE_FLOWED; - } - } else { - // Examine state and if the breakBeforeChild is set and we - // aren't already on the new line, do the forcing now. - // XXX Why aren't we doing this check BEFORE we resize reflow the child? - if (aState.breakBeforeChild) { - aState.breakBeforeChild = PR_FALSE; - if (aKidFrame != aState.lineStart) { - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow child now that it has the line to itself - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - } - } - - // When we are not at the logical left margin then we need - // to check the width first. If we are too wide then advance - // to the next line and try reflowing again. - if (kidSize.width > kidAvailSize.width) { - // Too wide. Try next line - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow splittable children - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable != frNotSplittable) { - // Update size info now that we are on the next line. Then - // reflow the child into the new available space. - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - } - - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall on the next line - return PLACE_FLOWED; - } - // It's ok if it's too wide on the next line. - } - } - } - - // Add child to the line - AddInlineChildToLine(aCX, aState, aKidFrame, kidSize, - pKidMaxElementSize, aKidSC); - } else { - nsRect kidRect; - - // Does the block-level element want to clear any floaters that impact - // it? Note that the clear property only applies to block-level elements - // and the BR tag - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - switch (styleDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, styleDisplay->mBreakType); - GetAvailSize(kidAvailSize, aState, aKidSC, PR_FALSE); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - break; - } - - // Give the block its own local coordinate space.. Note: ReflowChild() - // will adjust for the child's left/right margin after determining the - // current left/right edge - aState.spaceManager->Translate(aState.borderPadding.left, 0); - // Give the block-level element the opportunity to use the space manager - status = ReflowChild(aKidFrame, aCX, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - // Block elements always fit horizontally (because they are - // always placed at the logical left margin). Check to see if - // the block fits vertically - if (kidRect.YMost() > kidAvailSize.height) { - // Nope - return PLACE_FLOWED; - } - } - - // Add block child - // XXX We need to set lastContentIsComplete here, because AddBlockChild() - // calls AdvaneceToNextLine(). We need to restructure the flow of control, - // and use a state machine... - aState.lastContentIsComplete = PRBool(status == frComplete); - AddBlockChild(aCX, aState, aKidFrame, kidRect, pKidMaxElementSize, aKidSC); - } - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - - aState.lastContentIsComplete = PRBool(status == frComplete); - if (aState.isInline && (frNotComplete == status)) { - // Since the inline child didn't complete its reflow we *know* - // that a continuation of it can't possibly fit on the current - // line. Therefore, set a flag in the state that will cause the - // a line break before the next frame is placed. - aState.breakAfterChild = PR_TRUE; - } - - aState.reflowStatus = status; - return PLACE_FLOWED | PLACE_FIT; -} - -/** - * Reflow the existing frames. - * - * @param aCX presentation context to use - * @param aState in out parameter which tracks the state of - * reflow for the block frame. - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool -nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsIFrame* kidFrame; - - for (kidFrame = mFirstChild; nsnull != kidFrame; ) { - - /* we get the kid's style from kidFrame's cached style context */ - nsIStyleContextPtr kidSC; - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - - // Attempt to place and reflow the child - - // XXX if child is not splittable and it fits just place it where - // it is, otherwise advance to the next line and place it there if - // possible - - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - ReflowStatus status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // The child doesn't fit. Push it and any remaining children. - PushKids(aState); - result = PR_FALSE; - goto push_done; - } - - // Is the child complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - // Yes, the child is complete - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else { - // No the child isn't complete - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Unlike the inline frame code we can't assume that we used - // up all of our space because the child's reflow status is - // frNotComplete. Instead, the child is probably split and - // we need to reflow the continuations as well. - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - } - - push_done: -#ifdef NS_DEBUG - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - - PRInt32 len = LengthOf(mFirstChild); - NS_POSTCONDITION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -/* XXX: - * In this method, we seem to be getting the style for the next child, - * and checking that child's style for the child's display type. - * The problem is that it's very inefficient to ResolveStyleFor(kid) here - * and then just throw it away, when we end up doing a ResolveStyleFor(kid) - * again when we actually create a frame for the content. - * It would be nice to cache the resolved style, maybe in the reflow state? - */ -PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) -{ - PRBool rv = PR_FALSE; - if (IsPseudoFrame()) { - // Get the next content object that we would like to reflow - PRInt32 kidIndex = NextChildOffset(); - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNotNull()) { - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - switch (kidStyleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block pseudo-frames do not contain other block elements - break; - - default: - rv = PR_TRUE; - break; - } - } - } else { - if (NextChildOffset() < mContent->ChildCount()) { - rv = PR_TRUE; - } - } - return rv; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aCX presentation context to use - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsBlockFrame* prev = (nsBlockFrame*) mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - mFirstContentOffset = prev->NextChildOffset(); - if (PR_FALSE == prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time until we are out of children - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (nsnull == kidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // If we're being used as a pseudo frame, i.e. we map the same - // content as our parent then we want to indicate we're complete; - // otherwise we'll be continued and go on mapping children... - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - result = frComplete; - goto done; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aCX); - kidFrame = kidDel->CreateFrame(aCX, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidSC); - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - kidPrevInFlow->CreateContinuingFrame(aCX, this, kidFrame); - } - - // Link child frame into the list of children. If the frame ends - // up not fitting and getting pushed, the PushKids code will fixup - // the child count for us. - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - - // Reflow child frame as many times as necessary until it is - // complete. - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // We ran out of room. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - goto push_done; - } - - // Did the child complete? - prevKidFrame = kidFrame; - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "huh?"); -#endif - } while (frNotComplete == status); - - // The child that we just reflowed is complete -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); -#endif - kidIndex++; - kidPrevInFlow = nsnull; - } - - done: - // To get here we either completely reflowed all our appended - // children OR we are a pseudo-frame and we ran into a block - // element. In either case our last content MUST be complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - - push_done: -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Pullup frames from our next in flow and try to place them. Before - * this is called our previously mapped children, if any have been - * reflowed which means that the block reflow state's x and y - * coordinates and other data are ready to go. - * - * Return true if we pulled everything up. - */ -PRBool -nsBlockFrame::PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsBlockFrame* nextInFlow = (nsBlockFrame*) mNextInFlow; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - while (nsnull != nextInFlow) { - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (nsBlockFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get style information for the pulled up kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // Push the kids that didn't fit back down to the next-in-flow - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - result = PR_FALSE; - goto push_done; - } - - if (frNotComplete == status) { - // Child is not complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // Create a continuing frame for the incomplete child - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - } - - if (nsnull != prevKidFrame) { - // The only way we can get here is by pulling up every last child - // in our next-in-flows (and reflowing any continunations they - // have). Therefore we KNOW that our last child is complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - push_done:; - - if (result == PR_FALSE) { - // If our next-in-flow is empty OR our next next-in-flow is empty - // then adjust the offsets of all of the empty next-in-flows. - nextInFlow = (nsBlockFrame*) mNextInFlow; - if ((0 == nextInFlow->mChildCount) || - ((nsnull != nextInFlow->mNextInFlow) && - (0 == ((nsBlockFrame*)(nextInFlow->mNextInFlow))->mChildCount))) { - // We didn't pullup everything and we need to fixup one of our - // next-in-flows content offsets. - AdjustOffsetOfEmptyNextInFlows(); - } - } - - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -void nsBlockFrame::SetupState(nsIPresContext* aCX, - nsBlockReflowState& aState, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager) -{ - // Setup reflow state - aState.Init(aMaxSize, aMaxElementSize, mStyleContext, aSpaceManager); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - - // Apply border and padding adjustments for regular frames only - if (PR_FALSE == IsPseudoFrame()) { - aState.borderPadding = mySpacing->mBorderPadding; - aState.y = mySpacing->mBorderPadding.top; - aState.availSize.width -= - (mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right); - aState.availSize.height -= - (mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom); - } else { - aState.borderPadding.SizeTo(0, 0, 0, 0); - } - - // Setup initial list ordinal value - nsIAtom* tag = mContent->GetTag(); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - nsHTMLValue value; - if (eContentAttr_HasValue == - ((nsIHTMLContent*)mContent)->GetAttribute(nsHTMLAtoms::start, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - aState.nextListOrdinal = value.GetIntValue(); - } - } - } - NS_RELEASE(tag); - - mCurrentState = &aState; -} - -#include "nsUnitConversion.h"/* XXX */ -NS_METHOD nsBlockFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - return DoResizeReflow(aCX, state, aDesiredRect, aStatus); -} - -nsresult nsBlockFrame::DoResizeReflow(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height)); - DumpFlow(); -#endif - - // Zap old line data - if (nsnull != mLines) { - delete mLines; - mLines = nsnull; - } - mNumLines = 0; - - // Check for an overflow list - MoveOverflowToChildList(); - - // Before we start reflowing, cache a pointer to our state structure - // so that inline frames can find it. - nsIPresShell* shell = aCX->GetShell(); - shell->PutCachedData(this, &aState); - - // First reflow any existing frames - PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aCX, aState); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } - - if (reflowMappedOK) { - // Any space left? - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if ((nsnull != mFirstChild) && (aState.y >= yb)) { - // No space left. Don't try to pull-up children or reflow - // unmapped. We need to return the correct completion status, - // so see if there is more to reflow. - if (MoreToReflow(aCX)) { - aStatus = frNotComplete; - } - } else if (MoreToReflow(aCX)) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || PullUpChildren(aCX, aState)) { - // If we still have unmapped children then create some new frames - if (MoreToReflow(aCX)) { - aStatus = ReflowAppendedChildren(aCX, aState); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Deal with last line - make sure it gets vertically and - // horizontally aligned. This also updates the state's y coordinate - // which is good because that's how we size ourselves. - if (0 != aState.lineLength) { - if (!AdvanceToNextLine(aCX, aState)) { - // The last line of output doesn't fit. Push all of the kids to - // the next in flow and change our reflow status to not complete - // so that we are continued. -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids since last line doesn't fit\n"); -#endif - - PushKids(aState); - aStatus = frNotComplete; - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there is room for it. - nscoord margin = aState.prevMaxPosBottomMargin - - aState.prevMaxNegBottomMargin; - nscoord y = aState.y + margin; - if (y <= aState.borderPadding.top + aState.availSize.height) { - aState.y = y; - } - } - - // Now that reflow has finished, remove the cached pointer - shell->RemoveCachedData(this); - NS_RELEASE(shell); - - // Translate state.lineLengths into an integer array - mNumLines = aState.lineLengths.Count(); - if (mNumLines > 0) { - mLines = new PRInt32[mNumLines]; - for (PRInt32 i = 0; i < mNumLines; i++) { - PRInt32 ll = (PRInt32) aState.lineLengths.ElementAt(i); - mLines[i] = ll; - } - } - - if (!aState.unconstrainedWidth && aState.justifying) { - // Perform justification now that we know how many lines we have. - JustifyLines(aCX, aState); - } - - // Return our desired rect and our status - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = aState.kidXMost + aState.borderPadding.right; - if (!aState.unconstrainedWidth) { - // Make sure we're at least as wide as the max size we were given - nscoord maxWidth = aState.availSize.width + aState.borderPadding.left + - aState.borderPadding.right; - - if (aDesiredRect.width < maxWidth) { - aDesiredRect.width = maxWidth; - } - } - aState.y += aState.borderPadding.bottom; - aDesiredRect.height = aState.y; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g %scomplete [%d,%d,%c]\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height), - ((status == frNotComplete) ? "NOT " : ""), - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F') - ); - DumpFlow(); -#endif - mCurrentState = nsnull; - return NS_OK; -} - -void nsBlockFrame::JustifyLines(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - // XXX we don't justify the last line; what if we are continued, - // should we do it then? - nsIFrame* kid = mFirstChild; - for (PRInt32 i = 0; i < mNumLines; i++) { - nsIFrame* lineStart = kid; - PRInt32 lineLength = mLines[i]; - if (i < mNumLines - 1) { - if (1 == lineLength) { - // For lines with one element on them we can take a shortcut and - // let them do the justification. Note that we still call - // JustifyReflow even if the available space is zero in case the - // child is a hunk of text that ends in whitespace. The whitespace - // will be distributed elsewhere causing a proper flush right look - // for the last word. - nsRect r; - kid->GetRect(r); - nscoord maxWidth = aState.availSize.width; - nscoord availableSpace = maxWidth - r.width; - nscoord maxAvailSpace = nscoord(maxWidth * 0.1f); - if ((availableSpace >= 0) && (availableSpace < maxAvailSpace)) { - kid->JustifyReflow(aCX, availableSpace); - kid->SizeTo(r.width + availableSpace, r.height); - } - kid->GetNextSibling(kid); - } else { - // XXX Get justification of multiple elements working - while (--lineLength >= 0) { - kid->GetNextSibling(kid); - } - } - } - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - nsCSSLayout::RelativePositionChildren(aCX, this, lineStart, mLines[i]); - } -} - -NS_METHOD nsBlockFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittableNonRectangular; - return NS_OK; -} - -NS_METHOD nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD nsBlockFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - - if (aReflowCommand.GetTarget() == this) { - // XXX for now, just do a complete reflow mapped (it'll kinda - // work, but it's slow) - - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, nsnull, aSpaceManager); - PRBool reflowMappedOK = ReflowMappedChildren(aCX, state); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } else { - // XXX not yet implemented - NS_ABORT(); - // XXX work to compute initial state goes *HERE* - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = 0; - aDesiredRect.height = 0; - } - - mCurrentState = nsnull; - return NS_OK; -} - -PRBool nsBlockFrame::IsLeftMostChild(nsIFrame* aFrame) -{ - do { - nsIFrame* parent; - - aFrame->GetGeometricParent(parent); - - // See if there are any non-zero sized child frames that precede aFrame - // in the child list - nsIFrame* child; - - parent->FirstChild(child); - while ((nsnull != child) && (aFrame != child)) { - nsSize size; - - // Is the child zero-sized? - child->GetSize(size); - if ((size.width > 0) || (size.height > 0)) { - // We found a non-zero sized child frame that precedes aFrame - return PR_FALSE; - } - - child->GetNextSibling(child); - } - - // aFrame is the left-most non-zero sized frame in its geometric parent. - // Walk up one level and check that its parent is left-most as well - aFrame = parent; - } while (aFrame != this); - - return PR_TRUE; -} - -PRBool nsBlockFrame::AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // Get the frame associated with the space manager, and get its nsIAnchoredItems - // interface - nsIFrame* frame = mCurrentState->spaceManager->GetFrame(); - nsIAnchoredItems* anchoredItems = nsnull; - - frame->QueryInterface(kIAnchoredItemsIID, (void**)&anchoredItems); - NS_ASSERTION(nsnull != anchoredItems, "no anchored items interface"); - - if (nsnull != anchoredItems) { - anchoredItems->AddAnchoredItem(aFloater, nsIAnchoredItems::anHTMLFloater, this); - PlaceFloater(aCX, aFloater, aPlaceholder); - return PR_TRUE; - } - - return PR_FALSE; -} - -// XXX The size of the floater needs to be taken into consideration if we're -// computing a maximum element size -void nsBlockFrame::PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // If the floater is the left-most non-zero size child frame then insert - // it before the current line; otherwise add it to the below-current-line - // todo list and we'll handle it when we flush out the line - if (IsLeftMostChild(aPlaceholder)) { - // Get the type of floater - nsIStyleContextPtr styleContext; - - aFloater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* floaterDisplay = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - if (!mCurrentState->isInline) { - // Get the current band for this line - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } - - // Commit some space in the space manager - nsRect region; - - aFloater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == floaterDisplay->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == floaterDisplay->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, 0); - mCurrentState->spaceManager->AddRectRegion(region, aFloater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - aFloater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - - // Update the band of available space to reflect space taken up by the floater - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } else { - // Add the floater to our to-do list - mCurrentState->floaterToDo.AppendElement(aFloater); - } -} - -NS_METHOD nsBlockFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last-in-flow - nsBlockFrame* flow = (nsBlockFrame*)GetLastInFlow(); - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - -#if 0 - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Is it a floater? - if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - // Create initial frame for the child - nsIContentDelegate* kidDel; - nsresult fr; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // Update last content offset now that we are done drawing - // children from our parent. - SetLastContentOffset(prevKidFrame); - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - return NS_OK; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - } - kidFrame->SetStyleContext(kidSC); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - kidIndex++; - mChildCount++; - } - SetLastContentOffset(prevKidFrame); -#endif - - // If this is a pseudo-frame then our parent will generate the - // reflow command. Otherwise, if the container is us then we should - // generate the reflow command because we were directly called. - if (!IsPseudoFrame() && (aContainer == mContent)) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} - -PRIntn nsBlockFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - -nsHTMLFrameType nsBlockFrame::GetFrameType() const -{ - return eHTMLFrame_Block; -} - -NS_METHOD nsBlockFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fprintf(out, "*block<"); - nsIAtom* atom = mContent->GetTag(); - if (nsnull != atom) { - nsAutoString tmp; - atom->ToString(tmp); - fputs(tmp, out); - } - fprintf(out, ">(%d)@%p", mIndexInParent, this); - } else { - nsHTMLContainerFrame::ListTag(out); - } - return NS_OK; -} - -#ifdef NS_DEBUG -void nsBlockFrame::DumpFlow() const -{ -#ifdef NOISY_FLOW - nsBlockFrame* flow = (nsBlockFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsBlockFrame*) flow->mNextInFlow; - } -#endif -} -#endif diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h deleted file mode 100644 index 6b45fe72cab..00000000000 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ /dev/null @@ -1,2184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBlockFrame.h" -#include "nsSize.h" -#include "nsIAnchoredItems.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsISpaceManager.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsMargin.h" -#include "nsHTMLIIDs.h" -#include "nsCSSLayout.h" -#include "nsCRT.h" -#include "nsIPresShell.h" -#include "nsReflowCommand.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsAbsoluteFrame.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct BlockBandData : public nsBandData { - nsBandTrapezoid data[12]; - - // Bounding rect of available space between any left and right floaters - nsRect availSpace; - - // Constructor - BlockBandData() {size = 12; trapezoids = data;} - - // Computes the bounding rect of the available space, i.e. space between - // any left and right floaters - // - // Uses the current trapezoid data, see nsISpaceManager::GetBandData(). - // Updates member data "availSpace" - void ComputeAvailSpaceRect(); -}; - -void BlockBandData::ComputeAvailSpaceRect() -{ - nsBandTrapezoid* trapezoid = data; - - if (count > 1) { - // If there's more than one trapezoid that means there are floaters - PRInt32 i; - - // Stop when we get to space occupied by a right floater - for (i = 0; i < count; i++) { - nsBandTrapezoid* trapezoid = &data[i]; - - if (trapezoid->state != nsBandTrapezoid::smAvailable) { - nsStyleDisplay* display; - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - break; - } - } - } - - if (i > 0) { - trapezoid = &data[i - 1]; - } - } - - if (nsBandTrapezoid::smAvailable == trapezoid->state) { - // The trapezoid is available - trapezoid->GetRect(availSpace); - } else { - nsStyleDisplay* display; - - // The trapezoid is occupied. That means there's no available space - trapezoid->GetRect(availSpace); - - // XXX Handle the case of multiple frames - trapezoid->frame->GetStyleData(kStyleDisplaySID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - availSpace.x = availSpace.XMost(); - } - availSpace.width = 0; - } -} - -// XXX Bugs -// 1. right to left reflow can generate negative x coordinates. - -// XXX Speedup idea (all containers) - -// If I reflow a child and it gives back not-complete status then -// there is no sense in trying to pullup children. For blocks, it's a -// little more complicated unless the child is a block - if the child -// is a block, then we must be out of room hence we should stop. If -// the child is not a block then our line should be flushed (see #2 -// below) if our line is already empty then we must be out of room. - -// For inline frames and column frames, if we reflow a child and get -// back not-complete status then we should bail immediately because we -// are out of room. - -// XXX Speedup ideas: -// 1. change pullup code to use line information from next in flow -// 2. we can advance to next line immediately after reflowing something -// and noticing that it's not complete. -// 3. pass down last child information in aState so that pullup, etc., -// don't need to recompute it - -// XXX TODO: -// 0. Move justification into line flushing code - -// 1. To get ebina margins I need "auto" information from the style -// system margin's. A bottom/top margin of auto will then be computed like -// ebina computes it [however the heck that is]. - -// 2. kicking out floaters and talking with floater container to adjust -// left and right margins - -nsBlockReflowState::nsBlockReflowState() -{ -} - -void nsBlockReflowState::Init(const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsIStyleContext* aBlockSC, - nsISpaceManager* aSpaceManager) -{ - firstLine = PR_TRUE; - allowLeadingWhitespace = PR_FALSE; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - firstChildIsInsideBullet = PR_FALSE; - nextListOrdinal = -1; - column = 0; - - spaceManager = aSpaceManager; - currentBand = new BlockBandData; - - styleContext = aBlockSC; - styleText = (nsStyleText*) aBlockSC->GetData(kStyleTextSID); - styleFont = (nsStyleFont*) aBlockSC->GetData(kStyleFontSID); - styleDisplay = (nsStyleDisplay*) aBlockSC->GetData(kStyleDisplaySID); - - justifying = (NS_STYLE_TEXT_ALIGN_JUSTIFY == styleText->mTextAlign) && - (NS_STYLE_WHITESPACE_PRE != styleText->mWhiteSpace); - - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - maxElementSize = aMaxElementSize; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - kidXMost = 0; - x = 0; - y = 0; - - isInline = PR_FALSE; - currentLineNumber = 0; - lineStart = nsnull; - lineLength = 0; - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; - lineMaxElementSize.width = 0; - lineMaxElementSize.height = 0; - lastContentIsComplete = PR_TRUE; - - maxAscents = sizeof(ascentBuf) / sizeof(ascentBuf[0]); - needRelativePos = PR_FALSE; - - prevLineLastFrame = nsnull; - prevLineHeight = 0; - topMargin = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - prevLineLastContentIsComplete = PR_TRUE; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - reflowStatus = nsIFrame::frNotComplete; -} - -nsBlockReflowState::~nsBlockReflowState() -{ - if (ascents != ascentBuf) { - delete ascents; - } - delete currentBand; -} - -void nsBlockReflowState::AddAscent(nscoord aAscent) -{ - NS_PRECONDITION(lineLength <= maxAscents, "bad line length"); - if (lineLength == maxAscents) { - maxAscents *= 2; - nscoord* newAscents = new nscoord[maxAscents]; - if (nsnull != newAscents) { - nsCRT::memcpy(newAscents, ascents, sizeof(nscoord) * lineLength); - if (ascents != ascentBuf) { - delete ascents; - } - ascents = newAscents; - } else { - // Yikes! Out of memory! - return; - } - } - ascents[lineLength] = aAscent; -} - -void nsBlockReflowState::AdvanceToNextLine(nsIFrame* aPrevLineLastFrame, - nscoord aPrevLineHeight) -{ - firstLine = PR_FALSE; - allowLeadingWhitespace = PR_FALSE; - column = 0; - breakAfterChild = PR_FALSE; - breakBeforeChild = PR_FALSE; - lineStart = nsnull; - lineLength = 0; - currentLineNumber++; - maxAscent = 0; - maxDescent = 0; - lineWidth = 0; - needRelativePos = PR_FALSE; - - prevLineLastFrame = aPrevLineLastFrame; - prevLineHeight = aPrevLineHeight; - prevMaxPosBottomMargin = maxPosBottomMargin; - prevMaxNegBottomMargin = maxNegBottomMargin; - - // Remember previous line's lastContentIsComplete - prevLineLastContentIsComplete = lastContentIsComplete; - lastContentIsComplete = PR_TRUE; - - topMargin = 0; - maxPosBottomMargin = 0; - maxNegBottomMargin = 0; -} - -#ifdef NS_DEBUG -void nsBlockReflowState::DumpLine() -{ - nsIFrame* f = lineStart; - PRInt32 ll = lineLength; - while (--ll >= 0) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} - -void nsBlockReflowState::DumpList() -{ - nsIFrame* f = lineStart; - while (nsnull != f) { - printf(" "); - ((nsFrame*)f)->ListTag(stdout);/* XXX */ - printf("\n"); - f->GetNextSibling(f); - } -} -#endif - -//---------------------------------------------------------------------- - -nsresult nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBlockFrame::nsBlockFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsBlockFrame::~nsBlockFrame() -{ - if (nsnull != mLines) { - delete mLines; - } -} - -nsresult -nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLFrameTypeIID)) { - *aInstancePtr = (void*) ((nsIHTMLFrameType*) this); - return NS_OK; - } else if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void*) ((nsIRunaround*) this); - return NS_OK; - } else if (aIID.Equals(kIFloaterContainerIID)) { - *aInstancePtr = (void*) ((nsIFloaterContainer*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Computes the top margin to use for this child frames based on its display -// type and the display type of the previous child frame. -// -// Adjacent vertical margins between block-level elements are collapsed. -nscoord nsBlockFrame::GetTopMarginFor(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - if (aIsInline) { - // Just use whatever the previous bottom margin was - return aState.prevMaxPosBottomMargin - aState.prevMaxNegBottomMargin; - } else { - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - if (ss->mMargin.top < 0) { - maxNegTopMargin = -ss->mMargin.top; - } else { - maxPosTopMargin = ss->mMargin.top; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - return maxPos - maxNeg; - } else { - return 0; - } - } -} - -void nsBlockFrame::PlaceBelowCurrentLineFloaters(nsIPresContext* aCX, - nsBlockReflowState& aState, - nscoord aY) -{ - NS_PRECONDITION(aState.floaterToDo.Count() > 0, "no floaters"); - - // XXX Factor this code with PlaceFloater()... - PRInt32 numFloaters = aState.floaterToDo.Count(); - - for (PRInt32 i = 0; i < numFloaters; i++) { - nsIFrame* floater = (nsIFrame*)aState.floaterToDo[i]; - nsRect region; - - // Get the band of available space - // XXX This is inefficient to do this inside the loop... - GetAvailableSpaceBand(aState, aY); - - // Get the type of floater - nsIStyleContextPtr styleContext; - - floater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* sd = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - floater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == sd->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == sd->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, - 0); - mCurrentState->spaceManager->AddRectRegion(region, floater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - floater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - } - aState.floaterToDo.Clear(); -} - -/** - * Flush a line out. Return true if the line fits in our available - * height. If the line does not fit then return false. When the line - * fits we advance the y coordinate, reset the x coordinate and - * prepare the nsBlockReflowState for the next line. - */ -PRBool nsBlockFrame::AdvanceToNextLine(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - NS_PRECONDITION(aState.lineLength > 0, "bad line"); - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nscoord y = aState.y + aState.topMargin; - nscoord lineHeight; - - if (aState.isInline) { - // Vertically align the children on this line, returning the height of - // the line upon completion. - lineHeight = nsCSSLayout::VerticallyAlignChildren(aCX, this, - aState.styleFont, - y, - aState.lineStart, - aState.lineLength, - aState.ascents, - aState.maxAscent); - - // Any below current line floaters to place? - if (aState.floaterToDo.Count() > 0) { - PlaceBelowCurrentLineFloaters(aCX, aState, y + lineHeight); - // XXX Factor in the height of the floaters as well when considering - // whether the line fits. - // The default policy is that if there isn't room for the floaters then - // both the line and the floaters are pushed to the next-in-flow... - } - } else { - nsSize size; - - aState.lineStart->GetSize(size); - lineHeight = size.height; - } - - // The first line always fits - if (aState.currentLineNumber > 0) { - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if (y + lineHeight > yb) { - // After vertical alignment of the children and factoring in the - // proper margin, the line doesn't fit. - return PR_FALSE; - } - } - - if (aState.isInline) { - // Check if the right-edge of the line exceeds our running x-most - nscoord xMost = aState.borderPadding.left + aState.lineWidth; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - } - - // Advance the y coordinate to the new position where the next - // line or block element will go. - aState.y = y + lineHeight; - aState.x = 0; - - // Now that the vertical alignment is done we can perform horizontal - // alignment and relative positioning. Skip all of these if we are - // doing an unconstrained (in x) reflow. There's no point in doing - // the work if we *know* we are going to reflowed again. - if (!aState.unconstrainedWidth) { - nsCSSLayout::HorizontallyPlaceChildren(aCX, this, aState.styleText, - aState.lineStart, aState.lineLength, - aState.lineWidth, - aState.availSize.width); - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - if (!aState.justifying) { - nsCSSLayout::RelativePositionChildren(aCX, this, - aState.lineStart, - aState.lineLength); - } - } - - // Record line length - aState.lineLengths.AppendElement((void*)aState.lineLength); - - // Find the last frame in the line - // XXX keep this as running state in the nsBlockReflowState - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - // Update maxElementSize - if (nsnull != aState.maxElementSize) { - nsSize& lineMax = aState.lineMaxElementSize; - nsSize* maxMax = aState.maxElementSize; - if (lineMax.width > maxMax->width) { - maxMax->width = lineMax.width; - } - if (lineMax.height > maxMax->height) { - maxMax->height = lineMax.height; - } - aState.lineMaxElementSize.width = 0; - aState.lineMaxElementSize.height = 0; - } - - // Advance to the next line - aState.AdvanceToNextLine(lastFrame, lineHeight); - - return PR_TRUE; -} - -/** - * Add an inline child to the current line. Advance various running - * values after placement. - */ -void nsBlockFrame::AddInlineChildToLine(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsReflowMetrics& aKidSize, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Place and size the child - // XXX add in left margin from kid - nsRect r; - r.y = aState.y; - r.width = aKidSize.width; - r.height = aKidSize.height; - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - // Left to right positioning. - r.x = aState.borderPadding.left + aState.x + ss->mMargin.left; - aState.x += aKidSize.width + ss->mMargin.left + ss->mMargin.right; - } else { - // Right to left positioning - // XXX what should we do when aState.x goes negative??? - r.x = aState.x - aState.borderPadding.right - ss->mMargin.right - - aKidSize.width; - aState.x -= aKidSize.width + ss->mMargin.right + ss->mMargin.left; - } - aKidFrame->SetRect(r); - aState.AddAscent(aKidSize.ascent); - aState.lineWidth += aKidSize.width; - aState.lineLength++; - - // Update maximums for the line - if (aKidSize.ascent > aState.maxAscent) { - aState.maxAscent = aKidSize.ascent; - } - if (aKidSize.descent > aState.maxDescent) { - aState.maxDescent = aKidSize.descent; - } - // Update running margin maximums - if (aState.firstChildIsInsideBullet && (aKidFrame == mFirstChild)) { - // XXX temporary code. Since the molecule for the bullet frame - // is the same as the LI frame, we get bad style information. - // ignore it. - } else { - nscoord margin; -#if 0 - // XXX CSS2 spec says that top/bottom margin don't affect line height - // calculation. We're waiting for clarification on this issue... - if ((margin = ss->mMargin.top) < 0) { - margin = -margin; - if (margin > aState.maxNegTopMargin) { - aState.maxNegTopMargin = margin; - } - } else { - if (margin > aState.maxPosTopMargin) { - aState.maxPosTopMargin = margin; - } - } -#endif - if ((margin = ss->mMargin.bottom) < 0) { - margin = -margin; - if (margin > aState.maxNegBottomMargin) { - aState.maxNegBottomMargin = margin; - } - } else { - if (margin > aState.maxPosBottomMargin) { - aState.maxPosBottomMargin = margin; - } - } - } - - // Update line max element size - nsSize& mes = aState.lineMaxElementSize; - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > mes.width) { - mes.width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > mes.height) { - mes.height = aKidMaxElementSize->height; - } - } -} - -// Places and sizes the block-level element, and advances the line. -// The rect is in the local coordinate space of the kid frame. -void nsBlockFrame::AddBlockChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsRect& aKidRect, - nsSize* aKidMaxElementSize, - nsIStyleContext* aKidSC) -{ - NS_PRECONDITION(nsnull != aState.lineStart, "bad line"); - - nsStyleDisplay* ds = (nsStyleDisplay*) aKidSC->GetData(kStyleDisplaySID); - nsStyleSpacing* ss = (nsStyleSpacing*) aKidSC->GetData(kStyleSpacingSID); - nsStylePosition* sp = (nsStylePosition*) aKidSC->GetData(kStylePositionSID); - - if (NS_STYLE_POSITION_RELATIVE == sp->mPosition) { - aState.needRelativePos = PR_TRUE; - } - - // Translate from the kid's coordinate space to our coordinate space - aKidRect.x += aState.borderPadding.left + ss->mMargin.left; - aKidRect.y += aState.y + aState.topMargin; - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - aState.AddAscent(aKidRect.height); - aState.lineLength++; - - // Is this the widest child frame? - nscoord xMost = aKidRect.XMost() + ss->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // Update the max element size - if (nsnull != aKidMaxElementSize) { - if (aKidMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aKidMaxElementSize->width; - } - if (aKidMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aKidMaxElementSize->height; - } - } - - // and the bottom line margin information which we'll use when placing - // the next child - if (ss->mMargin.bottom < 0) { - aState.maxNegBottomMargin = -ss->mMargin.bottom; - } else { - aState.maxPosBottomMargin = ss->mMargin.bottom; - } - - // Update the running y-offset - aState.y += aKidRect.height + aState.topMargin; - - // Apply relative positioning if necessary - nsCSSLayout::RelativePositionChildren(aCX, this, aKidFrame, 1); - - // Advance to the next line - aState.AdvanceToNextLine(aKidFrame, aKidRect.height); -} - -/** - * Compute the available size for reflowing the given child at the - * current x,y position in the state. Note that this may return - * negative or zero width/height's if we are out of room. - */ -void nsBlockFrame::GetAvailSize(nsSize& aResult, - nsBlockReflowState& aState, - nsIStyleContext* aKidSC, - PRBool aIsInline) -{ - // Determine the maximum available reflow height for the child - nscoord yb = aState.borderPadding.top + aState.availSize.height; - aResult.height = aState.unconstrainedHeight ? NS_UNCONSTRAINEDSIZE : - yb - aState.y - aState.topMargin; - - // Determine the maximum available reflow width for the child - if (aState.unconstrainedWidth) { - aResult.width = NS_UNCONSTRAINEDSIZE; - } else if (aIsInline) { - if (NS_STYLE_DIRECTION_LTR == aState.styleDisplay->mDirection) { - aResult.width = aState.currentBand->availSpace.XMost() - aState.x; - } else { - aResult.width = aState.x - aState.currentBand->availSpace.x; - } - } else { - // It's a block. Don't adjust for the left/right margin here. That happens - // later on once we know the current left/right edge - aResult.width = aState.availSize.width; - } -} - -/** - * Push all of the kids that we have not reflowed, starting at - * aState.lineStart. aPrevKid is the kid previous to aState.lineStart - * and is also our last child. Note that line length is NOT a - * reflection of the number of children we are actually pushing - * (because we don't break the sibling list as we add children to the - * line). - */ -void nsBlockFrame::PushKids(nsBlockReflowState& aState) -{ - nsIFrame* prevFrame = aState.prevLineLastFrame; - NS_PRECONDITION(nsnull != prevFrame, "pushing all kids"); -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevFrame->GetNextSibling(nextSibling); - NS_PRECONDITION(nextSibling == aState.lineStart, "bad prev line"); -#endif - -#ifdef NS_DEBUG - PRInt32 numKids = LengthOf(mFirstChild); - NS_ASSERTION(numKids == mChildCount, "bad child count"); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": push kids (childCount=%d)\n", mChildCount); - DumpFlow(); -#endif - - PushChildren(aState.lineStart, prevFrame, mLastContentIsComplete); - SetLastContentOffset(prevFrame); - - // Set mLastContentIsComplete to the previous lines last content is - // complete now that the previous line's last child is our last - // child. - mLastContentIsComplete = aState.prevLineLastContentIsComplete; - - // Fix up child count - // XXX is there a better way? aState.lineLength doesn't work because - // we might be pushing more than just the pending line. - nsIFrame* kid = mFirstChild; - PRInt32 kids = 0; - while (nsnull != kid) { - kids++; - kid->GetNextSibling(kid); - } - mChildCount = kids; - - // Make sure we have no lingering line data - aState.lineLength = 0; - aState.lineStart = nsnull; - -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d) [%c]\n", mChildCount, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif -} - -/** - * Gets a band of available space starting at the specified y-offset. Assumes - * the local coordinate space is currently set to the upper-left origin of the - * bounding rect - * - * Updates "currentBand" and "x" member data of the block reflow state - */ -void nsBlockFrame::GetAvailableSpaceBand(nsBlockReflowState& aState, nscoord aY) -{ - // Gets a band of available space. - aState.spaceManager->Translate(aState.borderPadding.left, 0); - aState.spaceManager->GetBandData(aY, aState.availSize, *aState.currentBand); - - // Compute the bounding rect of the available space, i.e. space between any - // left and right floaters - aState.currentBand->ComputeAvailSpaceRect(); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - aState.x = aState.currentBand->availSpace.x; -} - -void nsBlockFrame::ClearFloaters(nsBlockReflowState& aState, PRUint32 aClear) -{ - // Translate the coordinate space - aState.spaceManager->Translate(aState.borderPadding.left, 0); - -getBand: - nscoord y = aState.y + aState.topMargin; - PRBool isLeftFloater = PR_FALSE; - PRBool isRightFloater = PR_FALSE; - - // Get a band of available space - aState.spaceManager->GetBandData(y, aState.availSize, *aState.currentBand); - - // Scan the trapezoids looking for left and right floaters - nsBandTrapezoid* trapezoid = aState.currentBand->trapezoids; - for (PRInt32 i = 0; i < aState.currentBand->count; i++) { - // XXX Handle multiply occupied - if (nsBandTrapezoid::smOccupied == trapezoid->state) { - nsStyleDisplay* display; - - trapezoid->frame->GetStyleData(kStylePositionSID, (nsStyleStruct*&)display); - if (NS_STYLE_FLOAT_LEFT == display->mFloats) { - isLeftFloater = PR_TRUE; - } else if (NS_STYLE_FLOAT_RIGHT == display->mFloats) { - isRightFloater = PR_TRUE; - } - } - - trapezoid++; - } - - if (isLeftFloater) { - if ((aClear == NS_STYLE_CLEAR_LEFT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - if (isRightFloater) { - if ((aClear == NS_STYLE_CLEAR_RIGHT) || - (aClear == NS_STYLE_CLEAR_LEFT_AND_RIGHT)) { - aState.y += aState.currentBand->trapezoids[0].GetHeight(); - goto getBand; - } - } - - aState.spaceManager->Translate(-aState.borderPadding.left, 0); -} - -// Bit's for PlaceAndReflowChild return value -#define PLACE_FIT 0x1 -#define PLACE_FLOWED 0x2 - -PRIntn -nsBlockFrame::PlaceAndReflowChild(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsIFrame* aKidFrame, - nsIStyleContext* aKidSC) -{ - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = - (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - - // Get line start setup if we are at the start of a new line - if (nsnull == aState.lineStart) { - NS_ASSERTION(0 == aState.lineLength, "bad line length"); - aState.lineStart = aKidFrame; - } - - // Get kid and its style - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - - // Figure out if kid is a block element or not - PRBool isInline = PR_TRUE; - PRIntn display = styleDisplay->mDisplay; - if (aState.firstChildIsInsideBullet && (mFirstChild == aKidFrame)) { - // XXX Special hack for properly reflowing bullets that have the - // inside value for list-style-position. - display = NS_STYLE_DISPLAY_INLINE; - } - if ((NS_STYLE_DISPLAY_BLOCK == display) || - (NS_STYLE_DISPLAY_LIST_ITEM == display)) { - // Block elements always end up on the next line (unless they are - // already at the start of the line). - isInline = PR_FALSE; - if (aState.lineLength > 0) { - aState.breakAfterChild = PR_TRUE; - } - } - - // Handle forced break first - if (aState.breakAfterChild) { - NS_ASSERTION(aState.lineStart != aKidFrame, "bad line"); - - // Get the last child in the current line - nsIFrame* lastFrame = aState.lineStart; - PRInt32 lineLen = aState.lineLength - 1; - while (--lineLen >= 0) { - lastFrame->GetNextSibling(lastFrame); - } - - if (!AdvanceToNextLine(aCX, aState)) { - // The previous line didn't fit. - return 0; - } - aState.lineStart = aKidFrame; - - // Get the style for the last child, and see if it wanted to clear - // floaters. This handles the BR tag, which is the only inline - // element for which clear applies - nsIStyleContextPtr lastChildSC; - - lastFrame->GetStyleContext(aCX, lastChildSC.AssignRef()); - nsStyleDisplay* lastChildDisplay = (nsStyleDisplay*) - lastChildSC->GetData(kStyleDisplaySID); - switch (lastChildDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, lastChildDisplay->mBreakType); - break; - } - } - - // Now that we've handled force breaks (and maybe called AdvanceToNextLine() - // which checks), remember whether it's an inline frame - aState.isInline = isInline; - - // If we're at the beginning of a line then compute the top margin that we - // should use - if (aState.lineStart == aKidFrame) { - // Compute the top margin to use for this line - aState.topMargin = GetTopMarginFor(aCX, aState, aKidFrame, aKidSC, - aState.isInline); - - // If it's an inline element then get a band of available space - // - // XXX If we have a current band and there's unused space in that band - // then avoid this call to get a band... - if (aState.isInline) { - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - } - } - - // Compute the available space to reflow the child into and then - // reflow it into that space. - nsSize kidAvailSize; - GetAvailSize(kidAvailSize, aState, aKidSC, aState.isInline); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - - ReflowStatus status; - - if (aState.isInline) { - nsReflowMetrics kidSize; - - // Inline elements are never passed the space manager - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - NS_ASSERTION(nsnull != aState.lineStart, "bad line start"); - - if (aKidFrame == aState.lineStart) { - // Width always fits when we are at the logical left margin. - // Just check the height. - // - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall - return PLACE_FLOWED; - } - } else { - // Examine state and if the breakBeforeChild is set and we - // aren't already on the new line, do the forcing now. - // XXX Why aren't we doing this check BEFORE we resize reflow the child? - if (aState.breakBeforeChild) { - aState.breakBeforeChild = PR_FALSE; - if (aKidFrame != aState.lineStart) { - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow child now that it has the line to itself - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - } - } - - // When we are not at the logical left margin then we need - // to check the width first. If we are too wide then advance - // to the next line and try reflowing again. - if (kidSize.width > kidAvailSize.width) { - // Too wide. Try next line - if (!AdvanceToNextLine(aCX, aState)) { - // Flushing out the line failed. - return PLACE_FLOWED; - } - aState.lineStart = aKidFrame; - - // Get a band of available space - GetAvailableSpaceBand(aState, aState.y + aState.topMargin); - - // Reflow splittable children - SplittableType isSplittable; - - aKidFrame->IsSplittable(isSplittable); - if (isSplittable != frNotSplittable) { - // Update size info now that we are on the next line. Then - // reflow the child into the new available space. - GetAvailSize(kidAvailSize, aState, aKidSC, PR_TRUE); - status = ReflowChild(aKidFrame, aCX, kidSize, kidAvailSize, - pKidMaxElementSize); - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - } - - // XXX This height check isn't correct now that we have bands of - // available space... - if (kidSize.height > kidAvailSize.height) { - // It's too tall on the next line - return PLACE_FLOWED; - } - // It's ok if it's too wide on the next line. - } - } - } - - // Add child to the line - AddInlineChildToLine(aCX, aState, aKidFrame, kidSize, - pKidMaxElementSize, aKidSC); - } else { - nsRect kidRect; - - // Does the block-level element want to clear any floaters that impact - // it? Note that the clear property only applies to block-level elements - // and the BR tag - nsStyleDisplay* styleDisplay = (nsStyleDisplay*) - aKidSC->GetData(kStyleDisplaySID); - switch (styleDisplay->mBreakType) { - case NS_STYLE_CLEAR_LEFT: - case NS_STYLE_CLEAR_RIGHT: - case NS_STYLE_CLEAR_LEFT_AND_RIGHT: - ClearFloaters(aState, styleDisplay->mBreakType); - GetAvailSize(kidAvailSize, aState, aKidSC, PR_FALSE); - if ((aState.currentLineNumber > 0) && (kidAvailSize.height <= 0)) { - // No more room - return 0; - } - break; - } - - // Give the block its own local coordinate space.. Note: ReflowChild() - // will adjust for the child's left/right margin after determining the - // current left/right edge - aState.spaceManager->Translate(aState.borderPadding.left, 0); - // Give the block-level element the opportunity to use the space manager - status = ReflowChild(aKidFrame, aCX, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(-aState.borderPadding.left, 0); - - // For first children, we skip all the fit checks because we must - // fit at least one child for a parent to figure what to do with us. - if ((aState.currentLineNumber > 0) || (aState.lineLength > 0)) { - // Block elements always fit horizontally (because they are - // always placed at the logical left margin). Check to see if - // the block fits vertically - if (kidRect.YMost() > kidAvailSize.height) { - // Nope - return PLACE_FLOWED; - } - } - - // Add block child - // XXX We need to set lastContentIsComplete here, because AddBlockChild() - // calls AdvaneceToNextLine(). We need to restructure the flow of control, - // and use a state machine... - aState.lastContentIsComplete = PRBool(status == frComplete); - AddBlockChild(aCX, aState, aKidFrame, kidRect, pKidMaxElementSize, aKidSC); - } - - // If we just reflowed our last child then update the - // mLastContentIsComplete state. - nsIFrame* nextSibling; - - aKidFrame->GetNextSibling(nextSibling); - if (nsnull == nextSibling) { - // Use state from the reflow we just did - mLastContentIsComplete = PRBool(status == frComplete); - } - - aState.lastContentIsComplete = PRBool(status == frComplete); - if (aState.isInline && (frNotComplete == status)) { - // Since the inline child didn't complete its reflow we *know* - // that a continuation of it can't possibly fit on the current - // line. Therefore, set a flag in the state that will cause the - // a line break before the next frame is placed. - aState.breakAfterChild = PR_TRUE; - } - - aState.reflowStatus = status; - return PLACE_FLOWED | PLACE_FIT; -} - -/** - * Reflow the existing frames. - * - * @param aCX presentation context to use - * @param aState in out parameter which tracks the state of - * reflow for the block frame. - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool -nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsIFrame* kidFrame; - - for (kidFrame = mFirstChild; nsnull != kidFrame; ) { - - /* we get the kid's style from kidFrame's cached style context */ - nsIStyleContextPtr kidSC; - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - - // Attempt to place and reflow the child - - // XXX if child is not splittable and it fits just place it where - // it is, otherwise advance to the next line and place it there if - // possible - - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - ReflowStatus status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // The child doesn't fit. Push it and any remaining children. - PushKids(aState); - result = PR_FALSE; - goto push_done; - } - - // Is the child complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - // Yes, the child is complete - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else { - // No the child isn't complete - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Unlike the inline frame code we can't assume that we used - // up all of our space because the child's reflow status is - // frNotComplete. Instead, the child is probably split and - // we need to reflow the continuations as well. - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - } - - push_done: -#ifdef NS_DEBUG - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - - PRInt32 len = LengthOf(mFirstChild); - NS_POSTCONDITION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -/* XXX: - * In this method, we seem to be getting the style for the next child, - * and checking that child's style for the child's display type. - * The problem is that it's very inefficient to ResolveStyleFor(kid) here - * and then just throw it away, when we end up doing a ResolveStyleFor(kid) - * again when we actually create a frame for the content. - * It would be nice to cache the resolved style, maybe in the reflow state? - */ -PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) -{ - PRBool rv = PR_FALSE; - if (IsPseudoFrame()) { - // Get the next content object that we would like to reflow - PRInt32 kidIndex = NextChildOffset(); - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNotNull()) { - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - switch (kidStyleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block pseudo-frames do not contain other block elements - break; - - default: - rv = PR_TRUE; - break; - } - } - } else { - if (NextChildOffset() < mContent->ChildCount()) { - rv = PR_TRUE; - } - } - return rv; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aCX presentation context to use - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsBlockFrame* prev = (nsBlockFrame*) mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - mFirstContentOffset = prev->NextChildOffset(); - if (PR_FALSE == prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time until we are out of children - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidSC); - } else if (nsnull == kidPrevInFlow) { - // Create initial frame for the child - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // If we're being used as a pseudo frame, i.e. we map the same - // content as our parent then we want to indicate we're complete; - // otherwise we'll be continued and go on mapping children... - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - result = frComplete; - goto done; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aCX); - kidFrame = kidDel->CreateFrame(aCX, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidSC); - } else { - // Since kid has a prev-in-flow, use that to create the next - // frame. - kidPrevInFlow->CreateContinuingFrame(aCX, this, kidFrame); - } - - // Link child frame into the list of children. If the frame ends - // up not fitting and getting pushed, the PushKids code will fixup - // the child count for us. - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - - // Reflow child frame as many times as necessary until it is - // complete. - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // We ran out of room. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - goto push_done; - } - - // Did the child complete? - prevKidFrame = kidFrame; - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "huh?"); -#endif - } while (frNotComplete == status); - - // The child that we just reflowed is complete -#ifdef NS_DEBUG - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); -#endif - kidIndex++; - kidPrevInFlow = nsnull; - } - - done: - // To get here we either completely reflowed all our appended - // children OR we are a pseudo-frame and we ran into a block - // element. In either case our last content MUST be complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - - push_done: -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Pullup frames from our next in flow and try to place them. Before - * this is called our previously mapped children, if any have been - * reflowed which means that the block reflow state's x and y - * coordinates and other data are ready to go. - * - * Return true if we pulled everything up. - */ -PRBool -nsBlockFrame::PullUpChildren(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - - PRBool result = PR_TRUE; - nsBlockFrame* nextInFlow = (nsBlockFrame*) mNextInFlow; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - while (nsnull != nextInFlow) { - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (nsBlockFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get style information for the pulled up kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); - - ReflowStatus status; - do { - PRIntn placeStatus = PlaceAndReflowChild(aCX, aState, kidFrame, kidSC); - status = aState.reflowStatus; - if (0 == (placeStatus & PLACE_FIT)) { - // Push the kids that didn't fit back down to the next-in-flow - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - mLastContentIsComplete = PRBool(nsnull == kidNextInFlow); - PushKids(aState); - - result = PR_FALSE; - goto push_done; - } - - if (frNotComplete == status) { - // Child is not complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // Create a continuing frame for the incomplete child - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aCX, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - // Switch to new kid style - kidFrame->GetStyleContext(aCX, kidSC.AssignRef()); - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - } - - if (nsnull != prevKidFrame) { - // The only way we can get here is by pulling up every last child - // in our next-in-flows (and reflowing any continunations they - // have). Therefore we KNOW that our last child is complete. - NS_ASSERTION(PR_TRUE == aState.lastContentIsComplete, "bad state"); - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - push_done:; - - if (result == PR_FALSE) { - // If our next-in-flow is empty OR our next next-in-flow is empty - // then adjust the offsets of all of the empty next-in-flows. - nextInFlow = (nsBlockFrame*) mNextInFlow; - if ((0 == nextInFlow->mChildCount) || - ((nsnull != nextInFlow->mNextInFlow) && - (0 == ((nsBlockFrame*)(nextInFlow->mNextInFlow))->mChildCount))) { - // We didn't pullup everything and we need to fixup one of our - // next-in-flows content offsets. - AdjustOffsetOfEmptyNextInFlows(); - } - } - - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); - DumpFlow(); -#endif - return result; -} - -void nsBlockFrame::SetupState(nsIPresContext* aCX, - nsBlockReflowState& aState, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsISpaceManager* aSpaceManager) -{ - // Setup reflow state - aState.Init(aMaxSize, aMaxElementSize, mStyleContext, aSpaceManager); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - - // Apply border and padding adjustments for regular frames only - if (PR_FALSE == IsPseudoFrame()) { - aState.borderPadding = mySpacing->mBorderPadding; - aState.y = mySpacing->mBorderPadding.top; - aState.availSize.width -= - (mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right); - aState.availSize.height -= - (mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom); - } else { - aState.borderPadding.SizeTo(0, 0, 0, 0); - } - - // Setup initial list ordinal value - nsIAtom* tag = mContent->GetTag(); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - nsHTMLValue value; - if (eContentAttr_HasValue == - ((nsIHTMLContent*)mContent)->GetAttribute(nsHTMLAtoms::start, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - aState.nextListOrdinal = value.GetIntValue(); - } - } - } - NS_RELEASE(tag); - - mCurrentState = &aState; -} - -#include "nsUnitConversion.h"/* XXX */ -NS_METHOD nsBlockFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - return DoResizeReflow(aCX, state, aDesiredRect, aStatus); -} - -nsresult nsBlockFrame::DoResizeReflow(nsIPresContext* aCX, - nsBlockReflowState& aState, - nsRect& aDesiredRect, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height)); - DumpFlow(); -#endif - - // Zap old line data - if (nsnull != mLines) { - delete mLines; - mLines = nsnull; - } - mNumLines = 0; - - // Check for an overflow list - MoveOverflowToChildList(); - - // Before we start reflowing, cache a pointer to our state structure - // so that inline frames can find it. - nsIPresShell* shell = aCX->GetShell(); - shell->PutCachedData(this, &aState); - - // First reflow any existing frames - PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aCX, aState); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } - - if (reflowMappedOK) { - // Any space left? - nscoord yb = aState.borderPadding.top + aState.availSize.height; - if ((nsnull != mFirstChild) && (aState.y >= yb)) { - // No space left. Don't try to pull-up children or reflow - // unmapped. We need to return the correct completion status, - // so see if there is more to reflow. - if (MoreToReflow(aCX)) { - aStatus = frNotComplete; - } - } else if (MoreToReflow(aCX)) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || PullUpChildren(aCX, aState)) { - // If we still have unmapped children then create some new frames - if (MoreToReflow(aCX)) { - aStatus = ReflowAppendedChildren(aCX, aState); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Deal with last line - make sure it gets vertically and - // horizontally aligned. This also updates the state's y coordinate - // which is good because that's how we size ourselves. - if (0 != aState.lineLength) { - if (!AdvanceToNextLine(aCX, aState)) { - // The last line of output doesn't fit. Push all of the kids to - // the next in flow and change our reflow status to not complete - // so that we are continued. -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids since last line doesn't fit\n"); -#endif - - PushKids(aState); - aStatus = frNotComplete; - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there is room for it. - nscoord margin = aState.prevMaxPosBottomMargin - - aState.prevMaxNegBottomMargin; - nscoord y = aState.y + margin; - if (y <= aState.borderPadding.top + aState.availSize.height) { - aState.y = y; - } - } - - // Now that reflow has finished, remove the cached pointer - shell->RemoveCachedData(this); - NS_RELEASE(shell); - - // Translate state.lineLengths into an integer array - mNumLines = aState.lineLengths.Count(); - if (mNumLines > 0) { - mLines = new PRInt32[mNumLines]; - for (PRInt32 i = 0; i < mNumLines; i++) { - PRInt32 ll = (PRInt32) aState.lineLengths.ElementAt(i); - mLines[i] = ll; - } - } - - if (!aState.unconstrainedWidth && aState.justifying) { - // Perform justification now that we know how many lines we have. - JustifyLines(aCX, aState); - } - - // Return our desired rect and our status - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = aState.kidXMost + aState.borderPadding.right; - if (!aState.unconstrainedWidth) { - // Make sure we're at least as wide as the max size we were given - nscoord maxWidth = aState.availSize.width + aState.borderPadding.left + - aState.borderPadding.right; - - if (aDesiredRect.width < maxWidth) { - aDesiredRect.width = maxWidth; - } - } - aState.y += aState.borderPadding.bottom; - aDesiredRect.height = aState.y; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow %g,%g %scomplete [%d,%d,%c]\n", - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aState.availSize.height), - ((status == frNotComplete) ? "NOT " : ""), - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F') - ); - DumpFlow(); -#endif - mCurrentState = nsnull; - return NS_OK; -} - -void nsBlockFrame::JustifyLines(nsIPresContext* aCX, - nsBlockReflowState& aState) -{ - // XXX we don't justify the last line; what if we are continued, - // should we do it then? - nsIFrame* kid = mFirstChild; - for (PRInt32 i = 0; i < mNumLines; i++) { - nsIFrame* lineStart = kid; - PRInt32 lineLength = mLines[i]; - if (i < mNumLines - 1) { - if (1 == lineLength) { - // For lines with one element on them we can take a shortcut and - // let them do the justification. Note that we still call - // JustifyReflow even if the available space is zero in case the - // child is a hunk of text that ends in whitespace. The whitespace - // will be distributed elsewhere causing a proper flush right look - // for the last word. - nsRect r; - kid->GetRect(r); - nscoord maxWidth = aState.availSize.width; - nscoord availableSpace = maxWidth - r.width; - nscoord maxAvailSpace = nscoord(maxWidth * 0.1f); - if ((availableSpace >= 0) && (availableSpace < maxAvailSpace)) { - kid->JustifyReflow(aCX, availableSpace); - kid->SizeTo(r.width + availableSpace, r.height); - } - kid->GetNextSibling(kid); - } else { - // XXX Get justification of multiple elements working - while (--lineLength >= 0) { - kid->GetNextSibling(kid); - } - } - } - - // Finally, now that the in-flow positions of the line's frames are - // known we can apply relative positioning if any of them need it. - nsCSSLayout::RelativePositionChildren(aCX, this, lineStart, mLines[i]); - } -} - -NS_METHOD nsBlockFrame::IsSplittable(SplittableType& aIsSplittable) const -{ - aIsSplittable = frSplittableNonRectangular; - return NS_OK; -} - -NS_METHOD nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD nsBlockFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - - if (aReflowCommand.GetTarget() == this) { - // XXX for now, just do a complete reflow mapped (it'll kinda - // work, but it's slow) - - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, nsnull, aSpaceManager); - PRBool reflowMappedOK = ReflowMappedChildren(aCX, state); - if (!reflowMappedOK) { - aStatus = frNotComplete; - } - } else { - // XXX not yet implemented - NS_ABORT(); - // XXX work to compute initial state goes *HERE* - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = 0; - aDesiredRect.height = 0; - } - - mCurrentState = nsnull; - return NS_OK; -} - -PRBool nsBlockFrame::IsLeftMostChild(nsIFrame* aFrame) -{ - do { - nsIFrame* parent; - - aFrame->GetGeometricParent(parent); - - // See if there are any non-zero sized child frames that precede aFrame - // in the child list - nsIFrame* child; - - parent->FirstChild(child); - while ((nsnull != child) && (aFrame != child)) { - nsSize size; - - // Is the child zero-sized? - child->GetSize(size); - if ((size.width > 0) || (size.height > 0)) { - // We found a non-zero sized child frame that precedes aFrame - return PR_FALSE; - } - - child->GetNextSibling(child); - } - - // aFrame is the left-most non-zero sized frame in its geometric parent. - // Walk up one level and check that its parent is left-most as well - aFrame = parent; - } while (aFrame != this); - - return PR_TRUE; -} - -PRBool nsBlockFrame::AddFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // Get the frame associated with the space manager, and get its nsIAnchoredItems - // interface - nsIFrame* frame = mCurrentState->spaceManager->GetFrame(); - nsIAnchoredItems* anchoredItems = nsnull; - - frame->QueryInterface(kIAnchoredItemsIID, (void**)&anchoredItems); - NS_ASSERTION(nsnull != anchoredItems, "no anchored items interface"); - - if (nsnull != anchoredItems) { - anchoredItems->AddAnchoredItem(aFloater, nsIAnchoredItems::anHTMLFloater, this); - PlaceFloater(aCX, aFloater, aPlaceholder); - return PR_TRUE; - } - - return PR_FALSE; -} - -// XXX The size of the floater needs to be taken into consideration if we're -// computing a maximum element size -void nsBlockFrame::PlaceFloater(nsIPresContext* aCX, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) -{ - // If the floater is the left-most non-zero size child frame then insert - // it before the current line; otherwise add it to the below-current-line - // todo list and we'll handle it when we flush out the line - if (IsLeftMostChild(aPlaceholder)) { - // Get the type of floater - nsIStyleContextPtr styleContext; - - aFloater->GetStyleContext(aCX, styleContext.AssignRef()); - nsStyleDisplay* floaterDisplay = (nsStyleDisplay*) - styleContext->GetData(kStyleDisplaySID); - - if (!mCurrentState->isInline) { - // Get the current band for this line - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } - - // Commit some space in the space manager - nsRect region; - - aFloater->GetRect(region); - region.y = mCurrentState->currentBand->availSpace.y; - - if (NS_STYLE_FLOAT_LEFT == floaterDisplay->mFloats) { - region.x = mCurrentState->currentBand->availSpace.x; - } else { - NS_ASSERTION(NS_STYLE_FLOAT_RIGHT == floaterDisplay->mFloats, "bad float type"); - region.x = mCurrentState->currentBand->availSpace.XMost() - region.width; - } - - // XXX Don't forget the floater's margins... - mCurrentState->spaceManager->Translate(mCurrentState->borderPadding.left, 0); - mCurrentState->spaceManager->AddRectRegion(region, aFloater); - - // Set the origin of the floater in world coordinates - nscoord worldX, worldY; - - mCurrentState->spaceManager->GetTranslation(worldX, worldY); - aFloater->MoveTo(region.x + worldX, region.y + worldY); - mCurrentState->spaceManager->Translate(-mCurrentState->borderPadding.left, 0); - - // Update the band of available space to reflect space taken up by the floater - GetAvailableSpaceBand(*mCurrentState, mCurrentState->y + mCurrentState->topMargin); - } else { - // Add the floater to our to-do list - mCurrentState->floaterToDo.AppendElement(aFloater); - } -} - -NS_METHOD nsBlockFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last-in-flow - nsBlockFrame* flow = (nsBlockFrame*)GetLastInFlow(); - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - -#if 0 - nsIFrame* kidFrame = nsnull; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Resolve style for the kid - nsIStyleContextPtr kidSC = aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidSC->GetData(kStyleDisplaySID); - - // Is it a floater? - if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - // Create initial frame for the child - nsIContentDelegate* kidDel; - nsresult fr; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Pseudo block frames do not contain other block elements - // unless the block element would be the first child. - if (IsPseudoFrame()) { - // Update last content offset now that we are done drawing - // children from our parent. - SetLastContentOffset(prevKidFrame); - - // It better be true that we are not being asked to flow a - // block element as our first child. That means the body - // decided it needed a pseudo-frame when it shouldn't have. - NS_ASSERTION(nsnull != mFirstChild, "bad body"); - - return NS_OK; - } - // FALL THROUGH (and create frame) - - case NS_STYLE_DISPLAY_INLINE: - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - } - kidFrame->SetStyleContext(kidSC); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* nextSibling; - - prevKidFrame->GetNextSibling(nextSibling); - NS_ASSERTION(nsnull == nextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - kidIndex++; - mChildCount++; - } - SetLastContentOffset(prevKidFrame); -#endif - - // If this is a pseudo-frame then our parent will generate the - // reflow command. Otherwise, if the container is us then we should - // generate the reflow command because we were directly called. - if (!IsPseudoFrame() && (aContainer == mContent)) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} - -PRIntn nsBlockFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - -nsHTMLFrameType nsBlockFrame::GetFrameType() const -{ - return eHTMLFrame_Block; -} - -NS_METHOD nsBlockFrame::ListTag(FILE* out) const -{ - if ((nsnull != mGeometricParent) && IsPseudoFrame()) { - fprintf(out, "*block<"); - nsIAtom* atom = mContent->GetTag(); - if (nsnull != atom) { - nsAutoString tmp; - atom->ToString(tmp); - fputs(tmp, out); - } - fprintf(out, ">(%d)@%p", mIndexInParent, this); - } else { - nsHTMLContainerFrame::ListTag(out); - } - return NS_OK; -} - -#ifdef NS_DEBUG -void nsBlockFrame::DumpFlow() const -{ -#ifdef NOISY_FLOW - nsBlockFrame* flow = (nsBlockFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsBlockFrame*) flow->mNextInFlow; - } -#endif -} -#endif diff --git a/mozilla/layout/html/base/src/nsBodyFrame.cpp b/mozilla/layout/html/base/src/nsBodyFrame.cpp deleted file mode 100644 index 6160c1fde90..00000000000 --- a/mozilla/layout/html/base/src/nsBodyFrame.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsBodyFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsBlockFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsIViewManager.h" -#include "nsIDeviceContext.h" -#include "nsColumnFrame.h" -#include "nsSpaceManager.h" - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kIAnchoredItemsIID, NS_IANCHOREDITEMS_IID); - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -nsresult nsBodyFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsBodyFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsBodyFrame::nsBodyFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParentFrame) -{ - mSpaceManager = new SpaceManager(this); - NS_ADDREF(mSpaceManager); -} - -nsBodyFrame::~nsBodyFrame() -{ - NS_RELEASE(mSpaceManager); -} - -nsresult -nsBodyFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIAnchoredItemsIID)) { - *aInstancePtr = (void*) ((nsIAnchoredItems*) this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -void nsBodyFrame::CreateColumnFrame(nsIPresContext* aPresContext) -{ - // Do we have a prev-in-flow? - if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame - mFirstChild = new ColumnFrame(mContent, mIndexInParent, this); - mChildCount = 1; - - // Resolve style and set the style context - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(mContent, this); - mFirstChild->SetStyleContext(styleContext); - NS_RELEASE(styleContext); - } else { - nsBodyFrame* prevBody = (nsBodyFrame*)mPrevInFlow; - - nsIFrame* prevColumn = prevBody->mFirstChild; - NS_ASSERTION(prevBody->ChildIsPseudoFrame(prevColumn), "bad previous column"); - - // Create a continuing column - prevColumn->CreateContinuingFrame(aPresContext, this, mFirstChild); - mChildCount = 1; - } -} - -nsSize nsBodyFrame::GetColumnAvailSpace(nsIPresContext* aPresContext, - nsStyleSpacing* aSpacing, - const nsSize& aMaxSize) -{ - nsSize result(aMaxSize); - - // If we're not being used as a pseudo frame then make adjustments - // for border/padding and a vertical scrollbar - if (!IsPseudoFrame()) { - // If our width is constrained then subtract for the border/padding - if (aMaxSize.width != NS_UNCONSTRAINEDSIZE) { - result.width -= aSpacing->mBorderPadding.left + - aSpacing->mBorderPadding.right; - if (! aPresContext->IsPaginated()) { - nsIDeviceContext* dc = aPresContext->GetDeviceContext(); - result.width -= NS_TO_INT_ROUND(dc->GetScrollBarWidth()); - NS_RELEASE(dc); - } - } - // If our height is constrained then subtract for the border/padding - if (aMaxSize.height != NS_UNCONSTRAINEDSIZE) { - result.height -= aSpacing->mBorderPadding.top + - aSpacing->mBorderPadding.bottom; - } - } - - return result; -} - -NS_METHOD nsBodyFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - aStatus = frComplete; // initialize out parameter - - // Do we have any children? - if (nsnull == mFirstChild) { - // No, create a column frame - CreateColumnFrame(aPresContext); - } - - // Reflow the column - if (nsnull != mFirstChild) { - // Clear any regions that are marked as unavailable - mSpaceManager->ClearRegions(); - - // Get our border/padding info - nsStyleSpacing* mySpacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - - // Compute the column's max size - nsSize columnMaxSize = GetColumnAvailSpace(aPresContext, mySpacing, - aMaxSize); - - // XXX Style code should be dealing with this... - PRBool isPseudoFrame = IsPseudoFrame(); - nscoord leftInset = 0, topInset = 0; - if (!isPseudoFrame) { - leftInset = mySpacing->mBorderPadding.left; - topInset = mySpacing->mBorderPadding.top; - } - - // Get the column's desired rect - nsRect desiredRect; - nsIRunaround* reflowRunaround; - - mSpaceManager->Translate(leftInset, topInset); - mFirstChild->QueryInterface(kIRunaroundIID, (void**)&reflowRunaround); - reflowRunaround->ResizeReflow(aPresContext, mSpaceManager, columnMaxSize, - desiredRect, aMaxElementSize, aStatus); - mSpaceManager->Translate(-leftInset, -topInset); - - // Place and size the column - desiredRect.x += leftInset; - desiredRect.y += topInset; - mFirstChild->SetRect(desiredRect); - - // Set our last content offset and whether the last content is complete - // based on the state of the pseudo frame - SetLastContentOffset(mFirstChild); - - // Return our desired size. Take into account the y-most floater -#if 0 - aDesiredSize.width = desiredRect.XMost(); - aDesiredSize.height = PR_MAX(desiredRect.YMost(), mSpaceManager->YMost()); - - if (!isPseudoFrame) { - aDesiredSize.width += mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right; - aDesiredSize.height += mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom; - } -#else - aDesiredSize.height = PR_MAX(desiredRect.YMost(), mSpaceManager->YMost()); - if (isPseudoFrame) { - aDesiredSize.width = desiredRect.XMost(); - } - else { - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height += mySpacing->mBorderPadding.top + - mySpacing->mBorderPadding.bottom; - } -#endif - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; - } - - return NS_OK; -} - -NS_METHOD nsBodyFrame::VerifyTree() const -{ -#ifdef NS_DEBUG - // Check our child count - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - nsIFrame* lastChild; - - LastChild(lastChild); - if (len != 0) { - NS_ASSERTION(nsnull != lastChild, "bad last child"); - } - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - - // Make sure our content offsets are sane - NS_ASSERTION(mFirstContentOffset <= mLastContentOffset, "bad offsets"); - - // Verify child content offsets - nsIFrame* child = mFirstChild; - while (nsnull != child) { - // Make sure that the child's tree is valid - child->VerifyTree(); - child->GetNextSibling(child); - } - - // Make sure that our flow blocks offsets are all correct - if (nsnull == mPrevInFlow) { - PRInt32 nextOffset = NextChildOffset(); - nsBodyFrame* nextInFlow = (nsBodyFrame*) mNextInFlow; - while (nsnull != nextInFlow) { - NS_ASSERTION(0 != nextInFlow->mChildCount, "empty next-in-flow"); - NS_ASSERTION(nextInFlow->GetFirstContentOffset() == nextOffset, - "bad next-in-flow first offset"); - nextOffset = nextInFlow->NextChildOffset(); - nextInFlow = (nsBodyFrame*) nextInFlow->mNextInFlow; - } - } -#endif - return NS_OK; -} - -NS_METHOD nsBodyFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // Get our border/padding info - nsStyleSpacing* mySpacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - - // XXX Style code should be dealing with this... - PRBool isPseudoFrame = IsPseudoFrame(); - nscoord leftInset = 0, topInset = 0; - if (!isPseudoFrame) { - leftInset = mySpacing->mBorderPadding.left; - topInset = mySpacing->mBorderPadding.top; - } - - // XXX Clear the list of regions. This fixes a problem with the way reflow - // appended is currently working (we're reflowing some framems twice) - mSpaceManager->ClearRegions(); - mSpaceManager->Translate(leftInset, topInset); - - // Is the reflow command targeted for us? - if (aReflowCommand.GetTarget() == this) { - // Currently we only support appended content - if (aReflowCommand.GetType() != nsReflowCommand::FrameAppended) { - NS_NOTYETIMPLEMENTED("unexpected reflow command"); - } - - // Compute the column's max size - nsSize columnMaxSize = GetColumnAvailSpace(aPresContext, mySpacing, - aMaxSize); - - // Pass the command along to our column pseudo frame - nsIRunaround* reflowRunaround; - nsRect aDesiredRect; - - NS_ASSERTION(nsnull != mFirstChild, "no first child"); - mFirstChild->QueryInterface(kIRunaroundIID, (void**)&reflowRunaround); - reflowRunaround->IncrementalReflow(aPresContext, mSpaceManager, - columnMaxSize, aDesiredRect, aReflowCommand, aStatus); - - // Place and size the column - aDesiredRect.x += leftInset; - aDesiredRect.y += topInset; - mFirstChild->SetRect(aDesiredRect); - - // Set our last content offset and whether the last content is complete - // based on the state of the pseudo frame - SetLastContentOffset(mFirstChild); - - // Return our desired size -#if 0 - aDesiredSize.width = aDesiredRect.XMost(); - aDesiredSize.height = aDesiredRect.YMost(); - if (!isPseudoFrame) { - aDesiredSize.width += mySpacing->mBorderPadding.left + mySpacing->mBorderPadding.right; - aDesiredSize.height += mySpacing->mBorderPadding.top + mySpacing->mBorderPadding.bottom; - } -#else - aDesiredSize.height = PR_MAX(aDesiredRect.YMost(), mSpaceManager->YMost()); - if (isPseudoFrame) { - aDesiredSize.width = aDesiredRect.XMost(); - } - else { - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height += mySpacing->mBorderPadding.top + - mySpacing->mBorderPadding.bottom; - } - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; -#endif - } else { - NS_NOTYETIMPLEMENTED("unexpected reflow command"); - nsRect desiredRect; - nsIFrame* child; - - aStatus = aReflowCommand.Next(mSpaceManager, desiredRect, aMaxSize, child); - - // XXX Deal with next in flow, adjusting of siblings, adjusting the - // content length... - - // Return our desired size - aDesiredSize.width = 0; - aDesiredSize.height = 0; - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; - } - - mSpaceManager->Translate(-leftInset, -topInset); - return NS_OK; -} - -NS_METHOD nsBodyFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - NS_ASSERTION(mContent == aContainer, "bad content-appended target"); - - // Get the last-in-flow - nsBodyFrame* flow = (nsBodyFrame*)GetLastInFlow(); - - // Since body frame's have only a single pseudo-frame in them, - // pass on the content-appended call to the pseudo-frame - PRInt32 oldLastContentOffset = mLastContentOffset; - flow->mFirstChild->ContentAppended(aShell, aPresContext, aContainer); - - // Now generate a frame reflow command aimed at flow - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - oldLastContentOffset); - aShell->AppendReflowCommand(rc); - return NS_OK; -} - -void nsBodyFrame::AddAnchoredItem(nsIFrame* aAnchoredItem, - AnchoringPosition aPosition, - nsIFrame* aContainer) -{ - aAnchoredItem->SetGeometricParent(this); - // Add the item to the end of the child list - nsIFrame* lastChild; - - LastChild(lastChild); - lastChild->SetNextSibling(aAnchoredItem); - aAnchoredItem->SetNextSibling(nsnull); - mChildCount++; -} - -void nsBodyFrame::RemoveAnchoredItem(nsIFrame* aAnchoredItem) -{ - NS_PRECONDITION(IsChild(aAnchoredItem), "bad anchored item"); - NS_ASSERTION(aAnchoredItem != mFirstChild, "unexpected anchored item"); - // Remove the anchored item from the child list - // XXX Implement me - mChildCount--; -} - -NS_METHOD nsBodyFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsBodyFrame* cf = new nsBodyFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -// XXX use same logic as block frame? -PRIntn nsBodyFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_TOP; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} diff --git a/mozilla/layout/html/base/src/nsBodyFrame.h b/mozilla/layout/html/base/src/nsBodyFrame.h deleted file mode 100644 index 87380909df2..00000000000 --- a/mozilla/layout/html/base/src/nsBodyFrame.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsBodyFrame_h___ -#define nsBodyFrame_h___ - -#include "nsHTMLContainerFrame.h" -#include "nsIAnchoredItems.h" - -struct nsBodyReflowState; -class SpaceManager; -struct nsStyleSpacing; - -class nsBodyFrame : public nsHTMLContainerFrame, public nsIAnchoredItems { -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - virtual void AddAnchoredItem(nsIFrame* aAnchoredItem, - AnchoringPosition aPosition, - nsIFrame* aContainer); - - virtual void RemoveAnchoredItem(nsIFrame* aAnchoredItem); - - NS_IMETHOD VerifyTree() const; - -protected: - nsBodyFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - ~nsBodyFrame(); - - virtual PRIntn GetSkipSides() const; - -private: - SpaceManager* mSpaceManager; - - void CreateColumnFrame(nsIPresContext* aPresContext); - nsSize GetColumnAvailSpace(nsIPresContext* aPresContext, - nsStyleSpacing* aSpacing, - const nsSize& aMaxSize); -}; - -#endif /* nsBodyFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsBodyPart.cpp b/mozilla/layout/html/base/src/nsBodyPart.cpp deleted file mode 100644 index 3fb848829a8..00000000000 --- a/mozilla/layout/html/base/src/nsBodyPart.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsBodyFrame.h" -#include "nsIPresContext.h" -#include "nsHTMLIIDs.h" - -class BodyPart : public nsHTMLContainer { -public: - BodyPart(nsIAtom* aTag); - - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - -protected: - virtual ~BodyPart(); -}; - -BodyPart::BodyPart(nsIAtom* aTag) - : nsHTMLContainer(aTag) -{ -} - -BodyPart::~BodyPart() -{ -} - -nsrefcnt BodyPart::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt BodyPart::Release(void) -{ - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} - -nsIFrame* BodyPart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv; - nsresult status = nsBodyFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - return rv; -} - -nsresult -NS_NewBodyPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new BodyPart(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsColumnFrame.cpp b/mozilla/layout/html/base/src/nsColumnFrame.cpp deleted file mode 100644 index 72f70cd81a3..00000000000 --- a/mozilla/layout/html/base/src/nsColumnFrame.cpp +++ /dev/null @@ -1,1352 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsColumnFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsBlockFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsIViewManager.h" -#include "nsIDeviceContext.h" -#include "nsISpaceManager.h" -#include "nsIPtr.h" -#include "nsAbsoluteFrame.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_FLOW -#else -#undef NOISY -#undef NOISY_FLOW -#endif - -static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct ColumnReflowState { - // The space manager to use - nsISpaceManager* spaceManager; - - // The body's available size (computed from the body's parent) - nsSize availSize; - - // The running max child x-most (used to size our frame when done). - // This includes the child's right margin. - nscoord kidXMost; - - // Running y-offset - nscoord y; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - ColumnReflowState(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize) - { - spaceManager = aSpaceManager; - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - kidXMost = 0; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - // Since we're always used as a pseudo frame we have no border/padding - y = 0; - } - - ~ColumnReflowState() { - } -}; - -ColumnFrame::ColumnFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParentFrame) -{ - NS_PRECONDITION(IsPseudoFrame(), "can only be used as a pseudo frame"); -} - -ColumnFrame::~ColumnFrame() -{ -} - -nsresult ColumnFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(0 != aInstancePtr, "null ptr"); - if (nsnull == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIRunaroundIID)) { - *aInstancePtr = (void**)((nsIRunaround*)this); - return NS_OK; - } - return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr); -} - -// Collapse child's top margin with previous bottom margin -nscoord ColumnFrame::GetTopMarginFor(nsIPresContext* aCX, - ColumnReflowState& aState, - nsIFrame* aKidFrame, - nsStyleSpacing* aKidSpacing) -{ - // Does the frame have a prev-in-flow? - nsIFrame* kidPrevInFlow; - - aKidFrame->GetPrevInFlow(kidPrevInFlow); - - if (nsnull == kidPrevInFlow) { - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - - // XXX Style system should be zero'ing out margins for pseudo frames... - if (!ChildIsPseudoFrame(aKidFrame)) { - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; - } else { - return 0; - } -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void ColumnFrame::PlaceChild(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsIFrame* aKidFrame, - nsStyleSpacing* aKidSpacing, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - aState.spaceManager->Translate(0, aKidRect.height); - - // Update the x-most - nscoord xMost = aKidRect.XMost() + aKidSpacing->mMargin.right; - if (xMost > aState.kidXMost) { - aState.kidXMost = xMost; - } - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - // Update the maximum element size - if (nsnull != aMaxElementSize) { - if (aKidMaxElementSize.width > aMaxElementSize->width) { - aMaxElementSize->width = aKidMaxElementSize.width; - } - if (aKidMaxElementSize.height > aMaxElementSize->height) { - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool ColumnFrame::ReflowMappedChildren(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - ColumnFrame* flow = (ColumnFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (ColumnFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool lastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - nsRect kidRect; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, - kidFrame, kidSpacing); - - // XXX Style system should do this... - nscoord bottomMargin = ChildIsPseudoFrame(kidFrame) - ? 0 - : kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - // - // Note: don't subtract off for the child's left/right margins. ReflowChild() - // will do that when it determines the current left/right edge - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - - // Only skip the reflow if this is not our first child and we are - // out of space. - if ((kidFrame == mFirstChild) || (kidAvailSize.height > 0)) { - // Reflow the child into the available space - aState.spaceManager->Translate(0, topMargin); - status = ReflowChild(kidFrame, aPresContext, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(0, -topMargin); - } - - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (kidRect.YMost() > kidAvailSize.height))) - { - // The child's height is too big to fit at all in our remaining space, - // and it's not our first child. - // - // Note that if the width is too big that's okay and we allow the - // child to extend horizontally outside of the reflow area - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete, too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - - // Our mLastContentIsComplete was already set by the last kid we - // reflowed reflow's status - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - aState.spaceManager->Translate(0, topMargin); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidSpacing, - kidRect, aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - // Special handling for incomplete children - if (frNotComplete == status) { - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // No the child isn't complete, and it doesn't have a next in flow so - // create a continuing frame. This hooks the child into the flow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Insert the frame. We'll reflow it next pass through the loop - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - } - - // Get the next child - prevKidFrame = kidFrame; - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count - mChildCount = childCount; - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - // Set the last content offset based on the last child we mapped. - NS_ASSERTION(IsLastChild(prevKidFrame), "unexpected last child"); - SetLastContentOffset(prevKidFrame); - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - ColumnFrame* flow = (ColumnFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (ColumnFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool ColumnFrame::PullUpChildren(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - ColumnFrame* flow = (ColumnFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (ColumnFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mNextInFlow, "null next-in-flow"); - ColumnFrame* nextInFlow = (ColumnFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - - // The frame previous to the current frame we are reflowing. This - // starts out initially as our last frame. - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsRect kidRect; - nsSize kidAvailSize(aState.availSize); - - // Get first available frame from the next-in-flow - nsIFrame* kidFrame = PullUpOneChild(nextInFlow, prevKidFrame); - if (nsnull == kidFrame) { - // We've pulled up all the children from that next-in-flow, so - // move to the next next-in-flow. - nextInFlow = (ColumnFrame*) nextInFlow->mNextInFlow; - continue; - } - - // Get top margin for this kid - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, - kidFrame, kidSpacing); - - // XXX Style system should do this... - nscoord bottomMargin = ChildIsPseudoFrame(kidFrame) - ? 0 - : kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - // - // Note: don't subtract off for the child's left/right margins. ReflowChild() - // will do that when it determines the current left/right edge - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - - ReflowStatus status; - do { - // Only skip the reflow if this is not our first child and we are - // out of space. - if ((kidFrame == mFirstChild) || (kidAvailSize.height > 0)) { - aState.spaceManager->Translate(0, topMargin); - status = ReflowChild(kidFrame, aPresContext, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(0, -topMargin); - } - - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (kidRect.YMost() > kidAvailSize.height))) - { - // The child's height is too big to fit at all in our remaining space, - // and it wouldn't have been our first child. - // - // Note that if the width is too big that's okay and we allow the - // child to extend horizontally outside of the reflow area - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastComplete = PRBool(nsnull == kidNextInFlow); - PushChildren(kidFrame, prevKidFrame, lastComplete); - mLastContentIsComplete = prevLastContentIsComplete; - mChildCount--; - result = PR_FALSE; - goto push_done; - } - - // Place the child - aState.y += topMargin; - aState.spaceManager->Translate(0, topMargin); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidSpacing, - kidRect, aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - mLastContentIsComplete = PRBool(status == frComplete); - -#ifdef NOISY - ListTag(stdout); - printf(": pulled up "); - ((nsFrame*)kidFrame)->ListTag(stdout); - printf("\n"); -#endif - - // Is the child we just pulled up complete? - if (frNotComplete == status) { - // No the child isn't complete. - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Add the continuing frame to our sibling list. - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - kidFrame = continuingFrame; - mChildCount++; - } else { - // The child has a next-in-flow, but it's not one of ours. - // It *must* be in one of our next-in-flows. Collect it - // then. - NS_ASSERTION(!IsChild(kidNextInFlow), "busted kid next-in-flow"); - break; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - } - - push_done:; - // Update our last content index - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (ColumnFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - ColumnFrame* flow = (ColumnFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (ColumnFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -ColumnFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - ColumnFrame* prev = (ColumnFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - // Place our children, one at a time, until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); // XXX remember this... - - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - break; - } - - // Resolve style - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidStyleContext->GetData(kStyleSpacingSID); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidStyleContext->GetData(kStyleDisplaySID); - nsStylePosition* kidPosition = (nsStylePosition*) - kidStyleContext->GetData(kStylePositionSID); - - nsBlockFrame* pseudoFrame = nsnull; - nsIFrame* kidFrame; - nsRect kidRect; - ReflowStatus status; - - // Create a child frame - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidStyleContext); - } else if (nsnull == kidPrevInFlow) { - // Figure out how to treat the content - nsIContentDelegate* kidDel = nsnull; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_NONE: - // Create a placeholder frame that takes up no space - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Get the content delegate to use. We'll need this to create a frame - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - case NS_STYLE_DISPLAY_INLINE: - // Inline elements are wrapped in a block pseudo frame; that way the - // body doesn't have to deal with 2D layout - nsBlockFrame::NewFrame(&kidFrame, mContent, mIndexInParent, this); - - // Set the content offset for the pseudo frame, so it knows - // which content to begin with - pseudoFrame = (nsBlockFrame*) kidFrame; - pseudoFrame->SetFirstContentOffset(kidIndex); - break; - } - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - if (ChildIsPseudoFrame(kidFrame)) { - pseudoFrame = (nsBlockFrame*) kidFrame; - } - } - - // Get the child's margins - nscoord topMargin = GetTopMarginFor(aPresContext, aState, - kidFrame, kidSpacing); - - // XXX Style system should do this... - nscoord bottomMargin = ChildIsPseudoFrame(kidFrame) - ? 0 - : kidSpacing->mMargin.bottom; - - // Link the child frame into the list of children and update the - // child count - if (nsnull != prevKidFrame) { -#ifdef NS_DEBUG - nsIFrame* prevNextSibling; - - prevKidFrame->GetNextSibling(prevNextSibling); - NS_ASSERTION(nsnull == prevNextSibling, "bad append"); -#endif - prevKidFrame->SetNextSibling(kidFrame); - } else { - NS_ASSERTION(nsnull == mFirstChild, "bad create"); - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } - mChildCount++; - - do { - nsSize kidAvailSize(aState.availSize); - - // Figure out the amount of available size for the child (subtract - // off the margin we are going to apply to it) - // - // Note: don't subtract off for the child's left/right margins. ReflowChild() - // will do that when it determines the current left/right edge - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing - if (kidAvailSize.height > 0) { - aState.spaceManager->Translate(0, topMargin); - status = ReflowChild(kidFrame, aPresContext, aState.spaceManager, - kidAvailSize, kidRect, pKidMaxElementSize); - aState.spaceManager->Translate(0, -topMargin); - } - - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (kidRect.YMost() > kidAvailSize.height))) { - // The child's height is too big to fit in our remaining - // space, and it's not our first child. - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - NS_ASSERTION(nsnull == mNextInFlow, "whoops"); - - // Chop off the part of our child list that's being overflowed -#ifdef NS_DEBUG - nsIFrame* prevNextSibling; - - prevKidFrame->GetNextSibling(prevNextSibling); - NS_ASSERTION(prevNextSibling == kidFrame, "bad list"); -#endif - prevKidFrame->SetNextSibling(nsnull); - - // Create overflow list - mOverflowList = kidFrame; - - // Fixup child count by subtracting off the number of children - // that just ended up on the reflow list. - PRInt32 overflowKids = 0; - nsIFrame* f = kidFrame; - while (nsnull != f) { - overflowKids++; - f->GetNextSibling(f); - } - mChildCount -= overflowKids; - goto done; - } - - // Advance y by the topMargin between children. Zero out the - // topMargin in case this frame is continued because - // continuations do not have a top margin. Update the prev - // bottom margin state in the body reflow state so that we can - // apply the bottom margin when we hit the next child (or - // finish). - aState.y += topMargin; - aState.spaceManager->Translate(0, topMargin); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidSpacing, - kidRect, aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - topMargin = 0; - - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // Child didn't complete so create a continuing frame - kidPrevInFlow = kidFrame; - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Add the continuing frame to the sibling list - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - continuingFrame->SetNextSibling(kidNextSibling); - kidFrame->SetNextSibling(continuingFrame); - prevKidFrame = kidFrame; - kidFrame = continuingFrame; - mChildCount++; - - if (nsnull != pseudoFrame) { - pseudoFrame = (nsBlockFrame*) kidFrame; - } - } - } while (frNotComplete == status); - - prevKidFrame = kidFrame; - kidPrevInFlow = nsnull; - - // Update the kidIndex - if (nsnull != pseudoFrame) { - // Adjust kidIndex to reflect the number of children mapped by - // the pseudo frame - kidIndex = pseudoFrame->NextChildOffset(); - } else { - kidIndex++; - } - } - -done: - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - if (0 != mChildCount) { - SetLastContentOffset(prevKidFrame); - } -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif - return result; -} - -NS_METHOD ColumnFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); - - nscoord txIn, tyIn; - aSpaceManager->GetTranslation(txIn, tyIn); -#endif - //XXX NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "unexpected max size"); - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; // initialize out parameter - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - // Initialize body reflow state - ColumnReflowState state(aPresContext, aSpaceManager, aMaxSize); - - // Check for an overflow list - MoveOverflowToChildList(); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = - ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if ((nsnull != mFirstChild) && (state.availSize.height <= 0)) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if ((nsnull == mNextInFlow) || - PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = - ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - // Restore the coordinate space - aSpaceManager->Translate(0, -state.y); - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = state.kidXMost; - aDesiredRect.height = state.y; - - // Our desired width is always at least as big as our parent's width - // even though we reflowed our children to a narrower width. - if (!state.unconstrainedWidth && (aDesiredRect.width < aMaxSize.width)) { - aDesiredRect.width = aMaxSize.width; - } - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); - - // Verify we properly restored the coordinate space - nscoord txOut, tyOut; - - aSpaceManager->GetTranslation(txOut, tyOut); - NS_POSTCONDITION((txIn == txOut) && (tyIn == tyOut), "bad translation"); -#endif - return NS_OK; -} - -NS_METHOD ColumnFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - nscoord txIn, tyIn; - aSpaceManager->GetTranslation(txIn, tyIn); -#endif - - // Who's the reflow command targeted for? - if (aReflowCommand.GetTarget() == mGeometricParent) { - // It's targeted for our parent frame which passed the reflow - // command along to us. - // - // Currently we only support appended content, but this could also - // be an inserted reflow command. - if (aReflowCommand.GetType() != nsReflowCommand::FrameAppended) { - NS_NOTYETIMPLEMENTED("unexpected reflow command"); - } - -#if 0 - // Initialize body reflow state - ColumnReflowState state(aPresContext, aSpaceManager, aMaxSize); - - // Get to the frame that we should begin reflowing (where the - // append occured). - PRInt32 startOffset = aReflowCommand.GetIndex(); - nsIFrame* kidFrame = mFirstChild; - nsIFrame* prevKidFrame = nsnull; - PRInt32 kidIndex = mFirstContentOffset; - for (;;) { - if (ChildIsPseudoFrame(kidFrame)) { - nsBlockFrame* pseudo = (nsBlockFrame*) kidFrame; - PRInt32 fco = pseudo->GetFirstContentOffset(); - PRInt32 lco = pseudo->GetLastContentOffset(); - /* XXX <=? mLastContentIsComplete? */ - if ((fco <= startOffset) && (startOffset <= lco)) { - break; - } - } else { - PRInt32 kidIndexInParent; - - kidFrame->GetIndexInParent(kidIndexInParent); - if (kidIndexInParent == startOffset) { - break; - } - } - prevKidFrame = kidFrame; - kidFrame->GetNextSibling(kidFrame); - } - - // Factor in the previous kid's bottom margin information - // XXX inline version of RecoverState - if (nsnull != prevKidFrame) { - // When we have a previous kid frame, get it's y most coordinate - // and then setup the state so that the starting y is correct - // and the previous kid's bottom margin information is correct. - nsRect startKidRect; - prevKidFrame->GetRect(startKidRect); - - // Get style info - nsIStyleContextPtr kidSC; - - prevKidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - // XXX Style system should do this... - nscoord bottomMargin = ChildIsPseudoFrame(prevKidFrame) - ? 0 - : kidSpacing->mMargin.bottom; - - state.y = startKidRect.YMost(); - if (bottomMargin < 0) { - state.prevMaxNegBottomMargin = -bottomMargin; - } else { - state.prevMaxPosBottomMargin = bottomMargin; - } - } else { - state.prevMaxNegBottomMargin = 0; - state.prevMaxPosBottomMargin = 0; - state.y = 0; - } - - aSpaceManager->Translate(0, state.y); - - // XXX This nees to be computed the hard way. This value will be - // wrong because it includes our previous border+padding - // values. Since those values may have changed we need to - // recalculate our maxChildWidth based on our children and then we - // can add back in order border+padding - - // XXX subtract out old border+padding? - state.kidXMost = mRect.width; - - // Now ResizeReflow the appended frames - while (nsnull != kidFrame) { - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, state, - kidFrame, kidSpacing); - - nsRect kidRect; - nsSize kidAvailSize(state.availSize); - - if (PR_FALSE == state.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - - // Reflow the child - state.spaceManager->Translate(0, topMargin); - aStatus = ReflowChild(kidFrame, aPresContext, state.spaceManager, - kidAvailSize, kidRect, nsnull); - state.spaceManager->Translate(0, -topMargin); - - // Did it fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (kidRect.YMost() > kidAvailSize.height))) - { - // No, it didn't fit. This means we need to push this child - // to our next-in-flow and get it to reflow the appended - // children. - // XXX write me - NS_ABORT(); - } - - // Place the child - state.y += topMargin; - state.spaceManager->Translate(0, topMargin); - nsSize kidMaxElementSize; // XXX unused - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += state.y; - PlaceChild(aPresContext, state, kidFrame, kidSpacing, - kidRect, nsnull, kidMaxElementSize); - - // XXX Style system should do this... - nscoord bottomMargin = ChildIsPseudoFrame(kidFrame) - ? 0 - : kidSpacing->mMargin.bottom; - if (bottomMargin < 0) { - state.prevMaxNegBottomMargin = -bottomMargin; - } else { - state.prevMaxPosBottomMargin = bottomMargin; - } - - // Is the child complete? - if (frNotComplete == aStatus) { - // No. Create a continuing frame - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Insert the frame. We'll reflow it next pass through the loop - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - continuingFrame->SetNextSibling(nextSibling); - kidFrame->SetNextSibling(continuingFrame); - mChildCount++; - } - - // Get the next child frame - prevKidFrame = kidFrame; - kidFrame->GetNextSibling(kidFrame); - } - SetLastContentOffset(prevKidFrame); - - // Restore the coordinate space - aSpaceManager->Translate(0, -state.y); - - // Return our desired size - // XXX What about adding in the bottom margin from our last child like we - // did in ResizeReflow()? - aDesiredRect.x = 0; - aDesiredRect.y = 0; - aDesiredRect.width = state.kidXMost;/* XXX */ - aDesiredRect.height = state.y; -#endif - return ResizeReflow(aPresContext, aSpaceManager, aMaxSize, aDesiredRect, - nsnull, aStatus); - } else if (aReflowCommand.GetTarget() == this) { - // The reflow command is targeted for us. This could be a deleted or - // changed reflow command - NS_NOTYETIMPLEMENTED("unexpected reflow command"); - } else { - NS_NOTYETIMPLEMENTED("unexpected reflow command"); - } - -#ifdef NS_DEBUG - // Verify we properly restored the coordinate space - nscoord txOut, tyOut; - - aSpaceManager->GetTranslation(txOut, tyOut); - NS_POSTCONDITION((txIn == txOut) && (tyIn == tyOut), "bad translation"); -#endif - return NS_OK; -} - -// XXX factor nicely with reflow-unmapped -NS_METHOD ColumnFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ -#if 0 - // We must only be called by the body frame since we are a - // pseudo-frame; the body frame makes sure that it's dealing with - // it's last-in-flow therefore we must also be a last-in-flow - NS_ASSERTION(nsnull == mNextInFlow, "improper content-appended"); - NS_ASSERTION(mLastContentIsComplete == PR_TRUE, "huh?"); - - // Get index of where the content has been appended - PRInt32 kidIndex = NextChildOffset(); - PRInt32 startIndex = kidIndex; - nsIContent* content = mContent; - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - nsBlockFrame* pseudoFrame = nsnull; - if ((nsnull != prevKidFrame) && ChildIsPseudoFrame(prevKidFrame)) { - pseudoFrame = (nsBlockFrame*) prevKidFrame; - } - - // Create frames for each new child - for (;;) { - // Get the next content object - nsIContentPtr kid = content->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - // Get style context for the kid - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - nsStyleDisplay* kidDisplay = (nsStyleDisplay*) - kidStyleContext->GetData(kStyleDisplaySID); - nsStylePosition* kidPosition = (nsStylePosition*) - kidStyleContext->GetData(kStylePositionSID); - - // See what display mode it has - nsIFrame* kidFrame; - nsIContentDelegate* del; - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - } else { - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_NONE: - // Create place holder frame - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidStyleContext); - - // Append it to the child list - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - mFirstContentOffset = kidIndex; - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - mChildCount++; - prevKidFrame = kidFrame; - pseudoFrame = nsnull; - kidIndex++; - mLastContentOffset = kidIndex; - break; - - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - // Block and list-item's don't go into our pseudo-frames - // therefore we just make a frame. - del = kid->GetDelegate(aPresContext); - kidFrame = del->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(del); - kidFrame->SetStyleContext(kidStyleContext); - - // Append it to the child list - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - mFirstContentOffset = kidIndex; - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - mChildCount++; - prevKidFrame = kidFrame; - pseudoFrame = nsnull; - kidIndex++; - mLastContentOffset = kidIndex; - break; - - case NS_STYLE_DISPLAY_INLINE: - if (nsnull == pseudoFrame) { - // Inline elements are wrapped in a block pseudo frame; that - // way the body doesn't have to deal with 2D layout - nsBlockFrame::NewFrame(&kidFrame, mContent, mIndexInParent, this); - - // Resolve style for the pseudo-frame (kid's style won't do) - kidStyleContext = aPresContext->ResolveStyleContextFor(mContent, this); - kidFrame->SetStyleContext(kidStyleContext); - - // Append the pseudo frame to the child list - pseudoFrame = (nsBlockFrame*) kidFrame; - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - mFirstContentOffset = kidIndex; - } else { - prevKidFrame->SetNextSibling(pseudoFrame); - } - mChildCount++; - - // Set the content offset for the pseudo frame, so it knows - // which content to begin with - pseudoFrame->SetFirstContentOffset(kidIndex); - pseudoFrame->SetLastContentOffset(kidIndex); - prevKidFrame = pseudoFrame; - } - - // The child frame needs to belong to the pseudo-frame (or one - // of it's pseudos). Let it do the content appended frame - // creation. - pseudoFrame->ContentAppended(aShell, aPresContext, aContainer); - - // Update *our* last content offset since this child is our last - // child and it just consumed one or more of the appended - // children. - #ifdef NS_DEBUG - if (pseudoFrame == mFirstChild) { - PRInt32 pfco = pseudoFrame->GetFirstContentOffset(); - NS_ASSERTION(mFirstContentOffset == pfco, "bad pseudo first offset"); - } - #endif - mLastContentOffset = pseudoFrame->GetLastContentOffset(); - - // Pick up where it stopped - kidIndex = NextChildOffset(); - break; - } - } - } - SetLastContentOffset(prevKidFrame); - // Note: Column frames *never* directly generate reflow commands - // because they are always pseudo-frames for bodies. -#endif - return NS_OK; -} - -NS_METHOD ColumnFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - ColumnFrame* cf = new ColumnFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -PRIntn ColumnFrame::GetSkipSides() const -{ - // Because we're only ever used as a pseudo frame we shouldn't have any borders - // or padding. But just to be safe... - return 0x0F; -} - -NS_METHOD ColumnFrame::ListTag(FILE* out) const -{ - fprintf(out, "*COLUMN@%p", this); - return NS_OK; -} - diff --git a/mozilla/layout/html/base/src/nsColumnFrame.h b/mozilla/layout/html/base/src/nsColumnFrame.h deleted file mode 100644 index 148abb9e67a..00000000000 --- a/mozilla/layout/html/base/src/nsColumnFrame.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsColumnFrame_h___ -#define nsColumnFrame_h___ - -#include "nsHTMLContainerFrame.h" -#include "nsIRunaround.h" - -struct nsStyleSpacing; - -struct ColumnReflowState; - -class ColumnFrame : public nsHTMLContainerFrame, public nsIRunaround { -public: - ColumnFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - // Debugging - NS_IMETHOD ListTag(FILE* out = stdout) const; - -protected: - ~ColumnFrame(); - - virtual PRIntn GetSkipSides() const; - - nscoord GetTopMarginFor(nsIPresContext* aCX, - ColumnReflowState& aState, - nsIFrame* aKidFrame, - nsStyleSpacing* aKidSpacing); - - void PlaceChild(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsIFrame* aKidFrame, - nsStyleSpacing* aKidSpacing, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsSize* aMaxElementSize); - - PRBool PullUpChildren(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsSize* aMaxElementSize); - - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - ColumnReflowState& aState, - nsSize* aMaxElementSize); -}; - -#endif /* nsColumnFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsDOMAttributes.cpp b/mozilla/layout/html/base/src/nsDOMAttributes.cpp deleted file mode 100644 index 1c099143e3e..00000000000 --- a/mozilla/layout/html/base/src/nsDOMAttributes.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsDOMAttributes.h" -#include "nsIContent.h" -#include "nsIHTMLContent.h" -#include "nsString.h" -#include "nsIAtom.h" -#include "nsISupportsArray.h" - -nsDOMAttribute::nsDOMAttribute(nsString &aName, nsString &aValue) -{ - mName = new nsString(aName); - mValue = new nsString(aValue); - mRefCnt = 1; - mScriptObject = nsnull; -} - -nsDOMAttribute::~nsDOMAttribute() -{ - NS_PRECONDITION(nsnull != mName && nsnull != mValue, "attribute must be valid"); - delete mName; - delete mValue; -} - -nsresult nsDOMAttribute::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kIDOMAttributeIID, NS_IDOMATTRIBUTE_IID); - static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); - if (aIID.Equals(kIDOMAttributeIID)) { - *aInstancePtr = (void*)(nsIDOMAttribute*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIScriptObjectOwnerIID)) { - *aInstancePtr = (void*)(nsIScriptObjectOwner*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*)(nsISupports*)(nsIDOMAttribute*)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(nsDOMAttribute) - -NS_IMPL_RELEASE(nsDOMAttribute) - - -nsresult nsDOMAttribute::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - nsresult res = NS_OK; - if (nsnull == mScriptObject) { - res = NS_NewScriptAttribute(aContext, this, nsnull, (JSObject**)&mScriptObject); - } - *aScriptObject = mScriptObject; - return res; -} - -nsresult nsDOMAttribute::ResetScriptObject() -{ - mScriptObject = nsnull; - return NS_OK; -} - -// -// nsIDOMAttribute interface -// -nsresult nsDOMAttribute::GetName(nsString &aName) -{ - aName = *mName; - return NS_OK; -} - -nsresult nsDOMAttribute::GetValue(nsString &aValue) -{ - aValue = *mValue; - return NS_OK; -} - -nsresult nsDOMAttribute::SetValue(nsString &aValue) -{ - delete mValue; - mValue = new nsString(aValue); - return NS_OK; -} - -nsresult nsDOMAttribute::GetSpecified() -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDOMAttribute::SetSpecified(PRBool specified) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDOMAttribute::ToString(nsString &aString) -{ - aString = *mName; - aString += " = "; - aString += *mValue; - return NS_OK; -} - - - -// -// nsDOMAttributeList interface -// -nsDOMAttributeList::nsDOMAttributeList(nsIHTMLContent &aContent) : - mContent(aContent) -{ - mRefCnt = 1; - mContent.AddRef(); - mScriptObject = nsnull; -} - -nsDOMAttributeList::~nsDOMAttributeList() -{ - mContent.Release(); -} - -nsresult nsDOMAttributeList::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kIDOMAttributeListIID, NS_IDOMATTRIBUTELIST_IID); - static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); - if (aIID.Equals(kIDOMAttributeListIID)) { - *aInstancePtr = (void*)(nsIDOMAttributeList*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIScriptObjectOwnerIID)) { - *aInstancePtr = (void*)(nsIScriptObjectOwner*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*)(nsISupports*)(nsIDOMAttributeList*)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(nsDOMAttributeList) - -NS_IMPL_RELEASE(nsDOMAttributeList) - -nsresult nsDOMAttributeList::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - nsresult res = NS_OK; - if (nsnull == mScriptObject) { - res = NS_NewScriptAttributeList(aContext, this, nsnull, (JSObject**)&mScriptObject); - } - *aScriptObject = mScriptObject; - return res; -} - -nsresult nsDOMAttributeList::ResetScriptObject() -{ - mScriptObject = nsnull; - return NS_OK; -} - -nsresult nsDOMAttributeList::GetAttribute(nsString &aAttrName, nsIDOMAttribute** aAttribute) -{ - nsAutoString value; - mContent.GetAttribute(aAttrName, value); - *aAttribute = new nsDOMAttribute(aAttrName, value); - return NS_OK; -} - -nsresult nsDOMAttributeList::SetAttribute(nsIDOMAttribute *aAttribute) -{ - nsAutoString name, value; - aAttribute->GetName(name); - aAttribute->GetValue(value); - mContent.SetAttribute(name, value); - return NS_OK; -} - -nsresult nsDOMAttributeList::Remove(nsString &attrName, nsIDOMAttribute** aAttribute) -{ - nsAutoString name, upper; - (*aAttribute)->GetName(name); - name.ToUpperCase(upper); - nsIAtom* attr = NS_NewAtom(upper); - mContent.UnsetAttribute(attr); - return NS_OK; -} - -nsresult nsDOMAttributeList::Item(PRUint32 aIndex, nsIDOMAttribute** aAttribute) -{ - nsresult res = NS_ERROR_FAILURE; - nsAutoString name, value; - nsISupportsArray *attributes = nsnull; - if (NS_OK == NS_NewISupportsArray(&attributes)) { - PRInt32 count = mContent.GetAllAttributeNames(attributes); - if (count > 0) { - if ((PRInt32)aIndex < count) { - nsISupports *att = attributes->ElementAt(aIndex); - static NS_DEFINE_IID(kIAtom, NS_IATOM_IID); - nsIAtom *atName = nsnull; - if (nsnull != att && NS_OK == att->QueryInterface(kIAtom, (void**)&atName)) { - atName->ToString(name); - if (eContentAttr_NotThere != mContent.GetAttribute(name, value)) { - *aAttribute = new nsDOMAttribute(name, value); - res = NS_OK; - } - NS_RELEASE(atName); - } - } - } - NS_RELEASE(attributes); - } - - return res; -} - -nsresult nsDOMAttributeList::GetLength(PRUint32 *aLength) -{ - *aLength = mContent.GetAttributeCount(); - return NS_OK; -} - - - diff --git a/mozilla/layout/html/base/src/nsDOMAttributes.h b/mozilla/layout/html/base/src/nsDOMAttributes.h deleted file mode 100644 index 2a3ad1934a5..00000000000 --- a/mozilla/layout/html/base/src/nsDOMAttributes.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsDOMAttributes_h__ -#define nsDOMAttributes_h__ - -#include "nsIDOMAttribute.h" -#include "nsIScriptObjectOwner.h" - -class nsIContent; -class nsIHTMLContent; - -class nsDOMAttribute : public nsIDOMAttribute, public nsIScriptObjectOwner { -public: - nsDOMAttribute(nsString &aName, nsString &aValue); - virtual ~nsDOMAttribute(); - - NS_DECL_ISUPPORTS - - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - virtual nsresult ResetScriptObject(); - - // nsIDOMAttribute interface - virtual nsresult GetName(nsString &aName); - virtual nsresult GetValue(nsString &aValue); - virtual nsresult SetValue(nsString &aValue); - virtual nsresult GetSpecified(); - virtual nsresult SetSpecified(PRBool specified); - virtual nsresult ToString(nsString &aString); - -private: - nsString *mName; - nsString *mValue; - void *mScriptObject; -}; - - -class nsDOMAttributeList : public nsIDOMAttributeList, public nsIScriptObjectOwner { -public: - nsDOMAttributeList(nsIHTMLContent &aContent); - virtual ~nsDOMAttributeList(); - - NS_DECL_ISUPPORTS - - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - virtual nsresult ResetScriptObject(); - - // nsIDOMAttributeList interface - virtual nsresult GetAttribute(nsString &aAttrName, nsIDOMAttribute** aAttribute); - virtual nsresult SetAttribute(nsIDOMAttribute *aAttribute); - virtual nsresult Remove(nsString &attrName, nsIDOMAttribute** aAttribute); - virtual nsresult Item(PRUint32 aIndex, nsIDOMAttribute** aAttribute); - virtual nsresult GetLength(PRUint32 *aLength); - -private: - nsIHTMLContent &mContent; - void *mScriptObject; -}; - - -#endif - diff --git a/mozilla/layout/html/base/src/nsDOMIterator.cpp b/mozilla/layout/html/base/src/nsDOMIterator.cpp deleted file mode 100644 index 5edfdb89d57..00000000000 --- a/mozilla/layout/html/base/src/nsDOMIterator.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsDOMIterator.h" -#include "nsIDOMNode.h" - -static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); - -nsDOMIterator::nsDOMIterator(nsIContent &aContent) : mContent(aContent) -{ - mRefCnt = 1; - - // keep the content alive so the array of children - // does not go away without "this" to know - mContent.AddRef(); - - mPosition = -1; - mScriptObject = nsnull; -} - -nsDOMIterator::~nsDOMIterator() -{ - mContent.Release(); -} - -nsresult nsDOMIterator::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kIDOMNodeIteratorIID, NS_IDOMNODEITERATOR_IID); - static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); - if (aIID.Equals(kIDOMNodeIteratorIID)) { - *aInstancePtr = (void*)(nsIDOMNodeIterator*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIScriptObjectOwnerIID)) { - *aInstancePtr = (void*)(nsIScriptObjectOwner*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*)(nsISupports*)(nsIDOMNodeIterator*)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(nsDOMIterator) - -NS_IMPL_RELEASE(nsDOMIterator) - - -nsresult nsDOMIterator::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - nsresult res = NS_OK; - if (nsnull == mScriptObject) { - res = NS_NewScriptNodeIterator(aContext, this, nsnull, (JSObject**)&mScriptObject); - } - *aScriptObject = mScriptObject; - return res; -} - -nsresult nsDOMIterator::ResetScriptObject() -{ - mScriptObject = nsnull; - return NS_OK; -} - -// nsIDOMIterator interface -nsresult nsDOMIterator::SetFilter(PRInt32 aFilter, PRBool aFilterOn) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsDOMIterator::GetLength(PRUint32 *aLength) -{ - *aLength = mContent.ChildCount(); - return NS_OK; -} - -nsresult nsDOMIterator::GetCurrentNode(nsIDOMNode **aNode) -{ - nsIContent *content = nsnull; - nsresult res = NS_ERROR_FAILURE; - content = mContent.ChildAt(mPosition); - if (nsnull != content) { - res = content->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_RELEASE(content); - } - - return res; -} - -nsresult nsDOMIterator::GetNextNode(nsIDOMNode **aNode) -{ - nsIContent *content = nsnull; - nsresult res = NS_ERROR_FAILURE; - content = mContent.ChildAt(++mPosition); - if (nsnull != content) { - res = content->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_RELEASE(content); - } - else mPosition = mContent.ChildCount(); - - return res; -} - -nsresult nsDOMIterator::GetPreviousNode(nsIDOMNode **aNode) -{ - nsIContent *content = nsnull; - nsresult res = NS_ERROR_FAILURE; - content = mContent.ChildAt(--mPosition); - if (nsnull != content) { - res = content->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_RELEASE(content); - } - else mPosition = -1; - - return res; -} - -nsresult nsDOMIterator::ToFirst(nsIDOMNode **aNode) -{ - nsIContent *content = nsnull; - nsresult res = NS_ERROR_FAILURE; - mPosition = 0; - content = mContent.ChildAt(mPosition); - if (nsnull != content) { - res = content->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_RELEASE(content); - } - - return res; -} - -nsresult nsDOMIterator::ToLast(nsIDOMNode **aNode) -{ - nsIContent *content = nsnull; - nsresult res = NS_ERROR_FAILURE; - mPosition = mPosition = mContent.ChildCount(); - content = mContent.ChildAt(mPosition); - if (nsnull != content) { - res = content->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_RELEASE(content); - } - - return res; -} - -nsresult nsDOMIterator::MoveTo(int aNth, nsIDOMNode **aNode) -{ - mPosition = aNth; - return GetCurrentNode(aNode); -} - - diff --git a/mozilla/layout/html/base/src/nsDOMIterator.h b/mozilla/layout/html/base/src/nsDOMIterator.h deleted file mode 100644 index 2f08981ffdd..00000000000 --- a/mozilla/layout/html/base/src/nsDOMIterator.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsDOMIterator_h__ -#define nsDOMIterator_h__ - -#include "nsIDOMIterators.h" -#include "nsIContent.h" -#include "nsIScriptObjectOwner.h" - -class nsDOMIterator : public nsIDOMNodeIterator, public nsIScriptObjectOwner { -public: - nsDOMIterator(nsIContent &aContent); - virtual ~nsDOMIterator(); - - NS_DECL_ISUPPORTS - - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - virtual nsresult ResetScriptObject(); - - // nsIDOMIterator interface - virtual nsresult SetFilter(PRInt32 aFilter, PRBool aFilterOn); - virtual nsresult GetLength(PRUint32 *aLength); - virtual nsresult GetCurrentNode(nsIDOMNode **aNode); - virtual nsresult GetNextNode(nsIDOMNode **aNode); - virtual nsresult GetPreviousNode(nsIDOMNode **aNode); - virtual nsresult ToFirst(nsIDOMNode **aNode); - virtual nsresult ToLast(nsIDOMNode **aNode); - virtual nsresult MoveTo(int aNth, nsIDOMNode **aNode); - -private: - nsIContent &mContent; - PRInt32 mPosition; - void *mScriptObject; -}; - - -#endif - diff --git a/mozilla/layout/html/base/src/nsGlobalVariables.cpp b/mozilla/layout/html/base/src/nsGlobalVariables.cpp deleted file mode 100644 index 6fb5a24d9c1..00000000000 --- a/mozilla/layout/html/base/src/nsGlobalVariables.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsGlobalVariables.h" - -nsGlobalVariables* nsGlobalVariables::gInstance; - -nsGlobalVariables::nsGlobalVariables() -{ - mPresentationContext = nsnull; - mBeveledLines=PR_TRUE; - mBlackLines=PR_FALSE; - mBlackText=PR_FALSE; -} - -nsGlobalVariables::~nsGlobalVariables() -{} - -/** -* -* WARNING: This should only be called when the program exits -* No attemp to release this prior to termination will have -* disastrous consequences. -* -**/ -void nsGlobalVariables::Release() -{ - if (gInstance != nsnull) - delete gInstance; - gInstance = nsnull; -} - -nsGlobalVariables * nsGlobalVariables::Instance() -{ - if (nsnull==gInstance) - gInstance = new nsGlobalVariables(); - return gInstance; -} - -PRBool nsGlobalVariables::GetPrinting(nsIPresContext * aPresentationContext) -{ - return (PRBool) (aPresentationContext == mPresentationContext); -} - -void nsGlobalVariables::SetPrinting(nsIPresContext * aPresentationContext) -{ - mPresentationContext = aPresentationContext; -} - -PRBool nsGlobalVariables::GetBeveledLines() -{ - return mBeveledLines; -} - -void nsGlobalVariables::SetBeveledLines(PRBool aBeveledLines) -{ - mBeveledLines = aBeveledLines; -} - -PRBool nsGlobalVariables::GetBlackLines() -{ - return mBlackLines; -} - -void nsGlobalVariables::SetBlackLines(PRBool aBlackLines) -{ - mBlackLines = aBlackLines; -} - -PRBool nsGlobalVariables::GetBlackText() -{ - return mBlackText; -} - -void nsGlobalVariables::SetBlackText(PRBool aBlackText) -{ - mBlackText = aBlackText; -} - -PRBool nsGlobalVariables::GetBackground() -{ - return mBackground; -} - -void nsGlobalVariables::SetBackground(PRBool aBackground) -{ - mBackground = aBackground; -} diff --git a/mozilla/layout/html/base/src/nsGlobalVariables.h b/mozilla/layout/html/base/src/nsGlobalVariables.h deleted file mode 100644 index 36049f78b2f..00000000000 --- a/mozilla/layout/html/base/src/nsGlobalVariables.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef globalvariables_h___ -#define globalvariables_h___ - -#include "nslayout.h" - -// forward declarations -class nsIPresContext; -class nsGlobalVariables; - -/** - * The objective is to emulate the Dogbert page setup control over printing - * behavior. The initial implementation used the style system. However, Kipp - * pointed out that the net result is that exactly one class used it and the - * weight to the system was probably around >2kb for what's really a simple - * PRBool property that only the rendering code uses - can you say bloatware! - * - * Hence, this class. - */ -class nsGlobalVariables -{ -private: - /** The PRBools below are only valid if the rendering presentation context - * is the printing presentation context. - */ - nsIPresContext * mPresentationContext; - - /** mBeveledLines == true means print all HRs as though they have set the - * NOSHADE attribute. - */ - PRBool mBeveledLines; - - /** mBlackLines == true means print all HR and table ruling lines black, - * ignoring whatever color attribute has been set. - */ - PRBool mBlackLines; - - /** mBlackText == true means print all text black, ignoring whatever color - * attribute has been set. - */ - PRBool mBlackText; - - /** mBackground == true means print the background. - */ - PRBool mBackground; - - /** mInstance is the one-and-only instantiation of this class. - * It is accessable only through Instance - */ - static nsGlobalVariables *gInstance; - - /** constructor - */ - nsGlobalVariables(); - -public: - - /** destructor - */ - virtual ~nsGlobalVariables(); - - /** public way to release global instance variables. - * WARNING: This should only be called when the program exits - * No attemp to release this prior to termination will have - * disastrous consequences. - */ - static NS_HTML void Release(); - - /** public accessor. - * This is the ONLY way to get the one-and-only GlobalVariable object. - * I own the storage for the returned pointer, so do not delete it when you're done! - */ - static nsGlobalVariables * Instance(); - - /** - */ - PRBool GetPrinting(nsIPresContext * aPresentationContext); - - /** - */ - void SetPrinting(nsIPresContext * aPresentationContext); - - /** - */ - PRBool GetBeveledLines(); - - /** - */ - void SetBeveledLines(PRBool aBeveledLines); - - /** - */ - PRBool GetBlackLines(); - - /** - */ - void SetBlackLines(PRBool aBlackLines); - - /** - */ - PRBool GetBlackText(); - - /** - */ - void SetBlackText(PRBool aBlackText); - - /** - */ - PRBool GetBackground(); - - /** - */ - void SetBackground(PRBool aBackground); - -}; - -#endif diff --git a/mozilla/layout/html/base/src/nsHRPart.cpp b/mozilla/layout/html/base/src/nsHRPart.cpp deleted file mode 100644 index 29ee02c424e..00000000000 --- a/mozilla/layout/html/base/src/nsHRPart.cpp +++ /dev/null @@ -1,443 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLTagContent.h" -#include "nsLeafFrame.h" -#include "nsIRenderingContext.h" -#include "nsGlobalVariables.h" -#include "nsIStyleContext.h" -#include "nsColor.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsHTMLIIDs.h" -#include "nsHTMLAtoms.h" -#include "nsIFontMetrics.h" -#include "nsIHTMLAttributes.h" -#include "nsStyleConsts.h" - -#undef DEBUG_HR_REFCNT - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -// Default alignment value (so we can tell an unset value from a set value) -#define ALIGN_UNSET PRUint8(-1) - -class HRulePart : public nsHTMLTagContent { -public: - HRulePart(nsIAtom* aTag); - -#ifdef DEBUG_HR_REFCNT - virtual nsrefcnt AddRef(void); - virtual nsrefcnt Release(void); -#endif - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - virtual void UnsetAttribute(nsIAtom* aAttribute); - - PRInt32 mThickness; // in pixels - PRPackedBool mNoShade; - PRUint8 mAlign; - -protected: - virtual ~HRulePart(); - virtual nsContentAttr AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const; -}; - -class HRuleFrame : public nsLeafFrame { -public: - HRuleFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - NS_METHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - -protected: - virtual ~HRuleFrame(); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize); - - // Weird color computing code stolen from winfe which was stolen - // from the xfe which was written originally by Eric Bina. So there. - static void Get3DColors(nscolor aResult[2], nscolor aColor); - static const int RED_LUMINOSITY; - static const int GREEN_LUMINOSITY; - static const int BLUE_LUMINOSITY; - static const int INTENSITY_FACTOR; - static const int LIGHT_FACTOR; - static const int LUMINOSITY_FACTOR; - static const int MAX_COLOR; - static const int COLOR_DARK_THRESHOLD; - static const int COLOR_LIGHT_THRESHOLD; -}; - -HRuleFrame::HRuleFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsLeafFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -HRuleFrame::~HRuleFrame() -{ -} - -NS_METHOD HRuleFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - float p2t = aPresContext.GetPixelsToTwips(); - nscoord thickness = nscoord(p2t * ((HRulePart*)mContent)->mThickness); - - // Get style data - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nsStyleColor* color = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nscoord x0 = spacing->mBorderPadding.left; - nscoord y0 = spacing->mBorderPadding.top; - nscoord width = mRect.width - - (spacing->mBorderPadding.left + spacing->mBorderPadding.right); - nscoord height = mRect.height - - (spacing->mBorderPadding.top + spacing->mBorderPadding.bottom); - - // Center hrule vertically within the available space - y0 += (height - thickness) / 2; - height = thickness; - - // To shade or not to shade, that is the question. Begin by collecting the - // three decision criteria: rendering to the printer or the display, is the - // "Beveled Lines" checkbox set in the page setup dialog, and does the tag - // have the NOSHADE attribute set. - PRBool printing = nsGlobalVariables::Instance()->GetPrinting(&aPresContext); - - PRBool bevel = nsGlobalVariables::Instance()->GetBeveledLines(); - - PRBool noShadeAttribute = PRBool(((HRulePart*)mContent)->mNoShade); - - // Now that we have the data to make the shading criteria, we next - // collect the decision criteria for rending in solid black: - // printing (which we already have) and the "Black Lines" setting in - // the page setup dialog - - PRBool blackLines = nsGlobalVariables::Instance()->GetBlackLines(); - nscolor colors[2]; - // Get the background color that applies to this HR - if (printing && blackLines) - { - colors[0] = NS_RGB(0,0,0); - colors[1] = colors[0]; - } - else - { - // XXX Get correct color by finding the first parent that actually - // specifies a color. - Get3DColors(colors, color->mBackgroundColor); - } - - // Draw a "shadowed" box around the rule area - if (!noShadeAttribute && ((printing && bevel) || !printing)) { - // Lines render inclusively on the both the starting and ending - // coordinate, so reduce the end coordinates by one pixel. - nscoord x1 = nscoord(x0 + width - p2t); - nscoord y1 = nscoord(y0 + height - p2t); - - // Draw top and left lines - aRenderingContext.SetColor (colors[0]); - aRenderingContext.DrawLine (x0, y1, x0, y0); - aRenderingContext.DrawLine (x0, y0, x1, y0); - - // Draw bottom and right lines - aRenderingContext.SetColor (colors[1]); - aRenderingContext.DrawLine (x1, y0, x1, y1); - aRenderingContext.DrawLine (x1, y1, x0, y1); - } else { - // When a rule is not shaded, then we use a uniform color and - // draw half-circles on the end points. - aRenderingContext.SetColor (colors[0]); - nscoord diameter = height; - if ((diameter > width) || (diameter < nscoord(p2t * 3))) { - // The half-circles on the ends of the rule aren't going to - // look right so don't bother drawing them. - aRenderingContext.FillRect(x0, y0, width, height); - } else { - nscoord pix = NS_POINTS_TO_TWIPS_INT(1); - aRenderingContext.FillArc(x0, y0, diameter, diameter, 90.0f, 180.0f); - aRenderingContext.FillArc(x0 + width - diameter, y0, - diameter, diameter, 270.0f, 180.0f); - aRenderingContext.FillRect(x0 + diameter/2, y0, - width - diameter, height); - } - } - return NS_OK; -} - -// Weird color computing code stolen from winfe which was stolen -// from the xfe which was written originally by Eric Bina. So there. - -const int HRuleFrame::RED_LUMINOSITY = 30; -const int HRuleFrame::GREEN_LUMINOSITY = 59; -const int HRuleFrame::BLUE_LUMINOSITY = 11; -const int HRuleFrame::INTENSITY_FACTOR = 25; -const int HRuleFrame::LIGHT_FACTOR = 0; -const int HRuleFrame::LUMINOSITY_FACTOR = 75; -const int HRuleFrame::MAX_COLOR = 255; -const int HRuleFrame::COLOR_DARK_THRESHOLD = 51; -const int HRuleFrame::COLOR_LIGHT_THRESHOLD = 204; - - -void HRuleFrame::Get3DColors(nscolor aResult[2], nscolor aColor) -{ - int rb = NS_GET_R(aColor); - int gb = NS_GET_G(aColor); - int bb = NS_GET_B(aColor); - int intensity = (rb + gb + bb) / 3; - int luminosity = - ((RED_LUMINOSITY * rb) / 100) + - ((GREEN_LUMINOSITY * gb) / 100) + - ((BLUE_LUMINOSITY * bb) / 100); - int brightness = ((intensity * INTENSITY_FACTOR) + - (luminosity * LUMINOSITY_FACTOR)) / 100; - int f0, f1; - if (brightness < COLOR_DARK_THRESHOLD) { - f0 = 30; - f1 = 50; - } else if (brightness > COLOR_LIGHT_THRESHOLD) { - f0 = 45; - f1 = 50; - } else { - f0 = 30 + (brightness * (45 - 30) / MAX_COLOR); - f1 = f0; - } - int r = rb - (f0 * rb / 100); - int g = gb - (f0 * gb / 100); - int b = bb - (f0 * bb / 100); - aResult[0] = NS_RGB(r, g, b); - r = rb + (f1 * (MAX_COLOR - rb) / 100); - if (r > 255) r = 255; - g = gb + (f1 * (MAX_COLOR - gb) / 100); - if (g > 255) g = 255; - b = bb + (f1 * (MAX_COLOR - bb) / 100); - if (b > 255) b = 255; - aResult[1] = NS_RGB(r, g, b); -} - -void HRuleFrame::GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) -{ - // Get style data - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - - if (aMaxSize.width == NS_UNCONSTRAINEDSIZE) { - aDesiredSize.width = 1; - } else { - // XXX look at width property; use percentage, etc. - // XXX apply centering using our align property - aDesiredSize.width = aMaxSize.width; - } - - // Get the thickness of the rule (this is not css's height property) - float p2t = aPresContext->GetPixelsToTwips(); - nscoord thickness = nscoord(p2t * ((HRulePart*)mContent)->mThickness); - - // Compute height of "line" that hrule will layout within - nscoord lineHeight = thickness + nscoord(p2t * 2); - nsIFontMetrics* fm = aPresContext->GetMetricsFor(font->mFont); - nscoord defaultLineHeight = fm->GetHeight(); - NS_RELEASE(fm); - if (lineHeight < defaultLineHeight) { - lineHeight = defaultLineHeight; - } - - aDesiredSize.height = lineHeight; - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; -} - -//---------------------------------------------------------------------- - -HRulePart::HRulePart(nsIAtom* aTag) - : nsHTMLTagContent(aTag) -{ - mAlign = ALIGN_UNSET; -} - -HRulePart::~HRulePart() -{ -} - -#ifdef DEBUG_HR_REFCNT -nsrefcnt HRulePart::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt HRulePart::Release(void) -{ - NS_PRECONDITION(mRefCnt != 0, "too many release's"); - if (--mRefCnt == 0) { - if (mInHeap) { - delete this; - } - } - return mRefCnt; -} -#endif - -//---------------------------------------------------------------------- -// Attributes - -static nsHTMLTagContent::EnumTable kAlignTable[] = { - { "left", NS_STYLE_TEXT_ALIGN_LEFT }, - { "right", NS_STYLE_TEXT_ALIGN_RIGHT }, - { "center", NS_STYLE_TEXT_ALIGN_CENTER }, - { 0 } -}; - -void HRulePart::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::width) { - nsHTMLValue val; - ParseValueOrPercent(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::size) { - nsHTMLValue val; - ParseValue(aValue, 1, 100, val); - mThickness = val.GetIntValue(); - return; - } - if (aAttribute == nsHTMLAtoms::noshade) { - mNoShade = PR_TRUE; - return; - } - if (aAttribute == nsHTMLAtoms::align) { - nsHTMLValue val; - if (ParseEnumValue(aValue, kAlignTable, val)) { - mAlign = val.GetIntValue(); - } else { - mAlign = ALIGN_UNSET; - } - return; - } - - // Use default attribute catching code - nsHTMLTagContent::SetAttribute(aAttribute, aValue); -} - -nsContentAttr HRulePart::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - nsContentAttr ca = eContentAttr_NotThere; - if (aAttribute == nsHTMLAtoms::size) { - aResult.Reset(); - if (0 != mThickness) { - aResult.Set(mThickness, eHTMLUnit_Absolute); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::noshade) { - aResult.Reset(); - if (mNoShade) { - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::align) { - aResult.Reset(); - if (ALIGN_UNSET != mAlign) { - aResult.Set(mAlign, eHTMLUnit_Enumerated); - ca = eContentAttr_HasValue; - } - } - else { - ca = nsHTMLTagContent::GetAttribute(aAttribute, aResult); - } - return ca; -} - -void HRulePart::UnsetAttribute(nsIAtom* aAttribute) -{ - if (aAttribute == nsHTMLAtoms::noshade) { - mNoShade = PR_FALSE; - } - else if (aAttribute == nsHTMLAtoms::size) { - mThickness = 0; - } - else if (aAttribute == nsHTMLAtoms::align) { - mAlign = ALIGN_UNSET; - } - else { - // Use default attribute catching code - nsHTMLTagContent::UnsetAttribute(aAttribute); - } -} - -nsContentAttr HRulePart::AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const -{ - nsContentAttr ca = eContentAttr_NotThere; - if (aAttribute == nsHTMLAtoms::align) { - if ((eHTMLUnit_Enumerated == aValue.GetUnit()) && - (ALIGN_UNSET != aValue.GetIntValue())) { - EnumValueToString(aValue, kAlignTable, aResult); - ca = eContentAttr_HasValue; - } - } - return ca; -} - -//---------------------------------------------------------------------- - -nsIFrame* HRulePart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new HRuleFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -nsresult -NS_NewHRulePart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new HRulePart(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsHTMLAtoms.cpp b/mozilla/layout/html/base/src/nsHTMLAtoms.cpp deleted file mode 100644 index aaeffa659be..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLAtoms.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLAtoms.h" - -nsIAtom* nsHTMLAtoms::a; -nsIAtom* nsHTMLAtoms::above; -nsIAtom* nsHTMLAtoms::action; -nsIAtom* nsHTMLAtoms::align; -nsIAtom* nsHTMLAtoms::alink; -nsIAtom* nsHTMLAtoms::alt; -nsIAtom* nsHTMLAtoms::archive; -nsIAtom* nsHTMLAtoms::background; -nsIAtom* nsHTMLAtoms::below; -nsIAtom* nsHTMLAtoms::bgcolor; -nsIAtom* nsHTMLAtoms::body; -nsIAtom* nsHTMLAtoms::border; -nsIAtom* nsHTMLAtoms::bordercolor; -nsIAtom* nsHTMLAtoms::bottompadding; -nsIAtom* nsHTMLAtoms::br; -nsIAtom* nsHTMLAtoms::cellpadding; -nsIAtom* nsHTMLAtoms::cellspacing; -nsIAtom* nsHTMLAtoms::checked; -nsIAtom* nsHTMLAtoms::kClass; -nsIAtom* nsHTMLAtoms::classid; -nsIAtom* nsHTMLAtoms::clear; -nsIAtom* nsHTMLAtoms::clip; -nsIAtom* nsHTMLAtoms::code; -nsIAtom* nsHTMLAtoms::codebase; -nsIAtom* nsHTMLAtoms::color; -nsIAtom* nsHTMLAtoms::cols; -nsIAtom* nsHTMLAtoms::colspan; -nsIAtom* nsHTMLAtoms::compact; -nsIAtom* nsHTMLAtoms::coords; -nsIAtom* nsHTMLAtoms::data; -nsIAtom* nsHTMLAtoms::dir; -nsIAtom* nsHTMLAtoms::div; -nsIAtom* nsHTMLAtoms::dl; -nsIAtom* nsHTMLAtoms::encoding; -nsIAtom* nsHTMLAtoms::face; -nsIAtom* nsHTMLAtoms::font; -nsIAtom* nsHTMLAtoms::fontWeight; -nsIAtom* nsHTMLAtoms::frameborder; -nsIAtom* nsHTMLAtoms::gutter; -nsIAtom* nsHTMLAtoms::h1; -nsIAtom* nsHTMLAtoms::h2; -nsIAtom* nsHTMLAtoms::h3; -nsIAtom* nsHTMLAtoms::h4; -nsIAtom* nsHTMLAtoms::h5; -nsIAtom* nsHTMLAtoms::h6; -nsIAtom* nsHTMLAtoms::height; -nsIAtom* nsHTMLAtoms::hidden; -nsIAtom* nsHTMLAtoms::href; -nsIAtom* nsHTMLAtoms::hspace; -nsIAtom* nsHTMLAtoms::httpEquiv; -nsIAtom* nsHTMLAtoms::id; -nsIAtom* nsHTMLAtoms::ismap; -nsIAtom* nsHTMLAtoms::language; -nsIAtom* nsHTMLAtoms::li; -nsIAtom* nsHTMLAtoms::link; -nsIAtom* nsHTMLAtoms::left; -nsIAtom* nsHTMLAtoms::leftpadding; -nsIAtom* nsHTMLAtoms::lowsrc; -nsIAtom* nsHTMLAtoms::marginheight; -nsIAtom* nsHTMLAtoms::marginwidth; -nsIAtom* nsHTMLAtoms::maxlength; -nsIAtom* nsHTMLAtoms::mayscript; -nsIAtom* nsHTMLAtoms::menu; -nsIAtom* nsHTMLAtoms::method; -nsIAtom* nsHTMLAtoms::multicol; -nsIAtom* nsHTMLAtoms::multiple; -nsIAtom* nsHTMLAtoms::name; -nsIAtom* nsHTMLAtoms::noresize; -nsIAtom* nsHTMLAtoms::noshade; -nsIAtom* nsHTMLAtoms::nowrap; -nsIAtom* nsHTMLAtoms::ol; -nsIAtom* nsHTMLAtoms::onblur; -nsIAtom* nsHTMLAtoms::onfocus; -nsIAtom* nsHTMLAtoms::onload; -nsIAtom* nsHTMLAtoms::onunload; -nsIAtom* nsHTMLAtoms::overflow; -nsIAtom* nsHTMLAtoms::p; -nsIAtom* nsHTMLAtoms::pagex; -nsIAtom* nsHTMLAtoms::pagey; -nsIAtom* nsHTMLAtoms::pointSize; -nsIAtom* nsHTMLAtoms::pre; -nsIAtom* nsHTMLAtoms::prompt; -nsIAtom* nsHTMLAtoms::rel; -nsIAtom* nsHTMLAtoms::rightpadding; -nsIAtom* nsHTMLAtoms::rows; -nsIAtom* nsHTMLAtoms::rowspan; -nsIAtom* nsHTMLAtoms::scrolling; -nsIAtom* nsHTMLAtoms::selected; -nsIAtom* nsHTMLAtoms::shape; -nsIAtom* nsHTMLAtoms::size; -nsIAtom* nsHTMLAtoms::src; -nsIAtom* nsHTMLAtoms::start; -nsIAtom* nsHTMLAtoms::suppress; -nsIAtom* nsHTMLAtoms::table; -nsIAtom* nsHTMLAtoms::tabstop; -nsIAtom* nsHTMLAtoms::target; -nsIAtom* nsHTMLAtoms::text; -nsIAtom* nsHTMLAtoms::top; -nsIAtom* nsHTMLAtoms::toppadding; -nsIAtom* nsHTMLAtoms::type; -nsIAtom* nsHTMLAtoms::ul; -nsIAtom* nsHTMLAtoms::usemap; -nsIAtom* nsHTMLAtoms::valign; -nsIAtom* nsHTMLAtoms::value; -nsIAtom* nsHTMLAtoms::variable; -nsIAtom* nsHTMLAtoms::visibility; -nsIAtom* nsHTMLAtoms::vlink; -nsIAtom* nsHTMLAtoms::vspace; -nsIAtom* nsHTMLAtoms::width; -nsIAtom* nsHTMLAtoms::wrap; -nsIAtom* nsHTMLAtoms::zindex; - - -static nsrefcnt gRefCnt; - -void nsHTMLAtoms::AddrefAtoms() -{ - if (0 == gRefCnt) { - a = NS_NewAtom("A"); - above = NS_NewAtom("ABOVE"); - action = NS_NewAtom("ACTION"); - align = NS_NewAtom("ALIGN"); - alink = NS_NewAtom("ALINK"); - alt = NS_NewAtom("ALT"); - archive = NS_NewAtom("ARCHIVE"); - background = NS_NewAtom("BACKGROUND"); - below = NS_NewAtom("BELOW"); - bgcolor = NS_NewAtom("BGCOLOR"); - body = NS_NewAtom("BODY"); - border = NS_NewAtom("BORDER"); - bordercolor = NS_NewAtom("BORDERCOLOR"); - bottompadding = NS_NewAtom("BOTTOMPADDING"); - br = NS_NewAtom("BR"); - cellpadding = NS_NewAtom("CELLPADDING"); - cellspacing = NS_NewAtom("CELLSPACING"); - checked = NS_NewAtom("CHECKED"); - kClass = NS_NewAtom("CLASS"); - classid = NS_NewAtom("CLASSID"); - clear = NS_NewAtom("CLEAR"); - clip = NS_NewAtom("CLIP"); - code = NS_NewAtom("CODE"); - codebase = NS_NewAtom("CODEBASE"); - color = NS_NewAtom("COLOR"); - cols = NS_NewAtom("COLS"); - colspan = NS_NewAtom("COLSPAN"); - compact = NS_NewAtom("COMPACT"); - coords = NS_NewAtom("COORDS"); - dir = NS_NewAtom("DIR"); - div = NS_NewAtom("DIV"); - dl = NS_NewAtom("DL"); - data = NS_NewAtom("DATA"); - encoding = NS_NewAtom("ENCODING"); - face = NS_NewAtom("FACE"); - font = NS_NewAtom("FONT"); - fontWeight = NS_NewAtom("FONT-WEIGHT"); - frameborder = NS_NewAtom("FRAMEBORDER"); - gutter = NS_NewAtom("GUTTER"); - h1 = NS_NewAtom("H1"); - h2 = NS_NewAtom("H2"); - h3 = NS_NewAtom("H3"); - h4 = NS_NewAtom("H4"); - h5 = NS_NewAtom("H5"); - h6 = NS_NewAtom("H6"); - height = NS_NewAtom("HEIGHT"); - hidden = NS_NewAtom("HIDDEN"); - href = NS_NewAtom("HREF"); - hspace = NS_NewAtom("HSPACE"); - httpEquiv = NS_NewAtom("HTTP-EQUIV"); - id = NS_NewAtom("ID"); - ismap = NS_NewAtom("ISMAP"); - language = NS_NewAtom("LANGUAGE"); - li = NS_NewAtom("LI"); - link = NS_NewAtom("LINK"); - left = NS_NewAtom("LEFT"); - leftpadding = NS_NewAtom("LEFTPADDING"); - lowsrc = NS_NewAtom("LOWSRC"); - marginheight = NS_NewAtom("MARGINHEIGHT"); - marginwidth = NS_NewAtom("MARGINWIDTH"); - maxlength = NS_NewAtom("MAXLENGTH"); - mayscript = NS_NewAtom("MAYSCRIPT"); - menu = NS_NewAtom("MENU"); - method = NS_NewAtom("METHOD"); - multicol = NS_NewAtom("MULTICOL"); - multiple = NS_NewAtom("MULTIPLE"); - name = NS_NewAtom("NAME"); - noresize = NS_NewAtom("NORESIZE"); - noshade = NS_NewAtom("NOSHADE"); - nowrap = NS_NewAtom("NOWRAP"); - ol = NS_NewAtom("OL"); - onblur = NS_NewAtom("ONBLUR"); - onfocus = NS_NewAtom("ONFOCUS"); - onload = NS_NewAtom("ONLOAD"); - onunload = NS_NewAtom("ONUNLOAD"); - overflow = NS_NewAtom("OVERFLOW"); - p = NS_NewAtom("P"); - pagex = NS_NewAtom("PAGEX"); - pagey = NS_NewAtom("PAGEY"); - pointSize = NS_NewAtom("POINT-SIZE"); - pre = NS_NewAtom("PRE"); - prompt = NS_NewAtom("PROMPT"); - rel = NS_NewAtom("REL"); - rightpadding = NS_NewAtom("RIGHTPADDING"); - rows = NS_NewAtom("ROWS"); - rowspan = NS_NewAtom("ROWSPAN"); - scrolling = NS_NewAtom("SCROLLING"); - selected = NS_NewAtom("SELECTED"); - shape = NS_NewAtom("SHAPE"); - size = NS_NewAtom("SIZE"); - src = NS_NewAtom("SRC"); - start = NS_NewAtom("START"); - suppress = NS_NewAtom("SUPPRESS"); - table = NS_NewAtom("TABLE"); - tabstop = NS_NewAtom("TABSTOP"); - target = NS_NewAtom("TARGET"); - text = NS_NewAtom("TEXT"); - top = NS_NewAtom("TOP"); - toppadding = NS_NewAtom("TOPPADDING"); - type = NS_NewAtom("TYPE"); - ul = NS_NewAtom("UL"); - usemap = NS_NewAtom("USEMAP"); - valign = NS_NewAtom("VALIGN"); - value = NS_NewAtom("VALUE"); - variable = NS_NewAtom("VARIABLE"); - visibility = NS_NewAtom("VISIBILITY"); - vlink = NS_NewAtom("VLINK"); - vspace = NS_NewAtom("VSPACE"); - width = NS_NewAtom("WIDTH"); - wrap = NS_NewAtom("WRAP"); - zindex = NS_NewAtom("ZINDEX"); - } - ++gRefCnt; -} - -void nsHTMLAtoms::ReleaseAtoms() -{ - NS_PRECONDITION(gRefCnt != 0, "bad release atoms"); - if (--gRefCnt == 0) { - NS_RELEASE(a); - NS_RELEASE(above); - NS_RELEASE(action); - NS_RELEASE(align); - NS_RELEASE(alink); - NS_RELEASE(alt); - NS_RELEASE(archive); - NS_RELEASE(background); - NS_RELEASE(below); - NS_RELEASE(bgcolor); - NS_RELEASE(body); - NS_RELEASE(border); - NS_RELEASE(bordercolor); - NS_RELEASE(bottompadding); - NS_RELEASE(br); - NS_RELEASE(cellpadding); - NS_RELEASE(cellspacing); - NS_RELEASE(checked); - NS_RELEASE(kClass); - NS_RELEASE(classid); - NS_RELEASE(clear); - NS_RELEASE(clip); - NS_RELEASE(code); - NS_RELEASE(codebase); - NS_RELEASE(color); - NS_RELEASE(cols); - NS_RELEASE(colspan); - NS_RELEASE(compact); - NS_RELEASE(coords); - NS_RELEASE(dir); - NS_RELEASE(div); - NS_RELEASE(dl); - NS_RELEASE(data); - NS_RELEASE(encoding); - NS_RELEASE(face); - NS_RELEASE(font); - NS_RELEASE(fontWeight); - NS_RELEASE(frameborder); - NS_RELEASE(gutter); - NS_RELEASE(h1); - NS_RELEASE(h2); - NS_RELEASE(h3); - NS_RELEASE(h4); - NS_RELEASE(h5); - NS_RELEASE(h6); - NS_RELEASE(height); - NS_RELEASE(hidden); - NS_RELEASE(href); - NS_RELEASE(hspace); - NS_RELEASE(httpEquiv); - NS_RELEASE(id); - NS_RELEASE(ismap); - NS_RELEASE(language); - NS_RELEASE(li); - NS_RELEASE(link); - NS_RELEASE(left); - NS_RELEASE(leftpadding); - NS_RELEASE(lowsrc); - NS_RELEASE(marginheight); - NS_RELEASE(marginwidth); - NS_RELEASE(maxlength); - NS_RELEASE(mayscript); - NS_RELEASE(menu); - NS_RELEASE(method); - NS_RELEASE(multicol); - NS_RELEASE(multiple); - NS_RELEASE(name); - NS_RELEASE(noresize); - NS_RELEASE(noshade); - NS_RELEASE(nowrap); - NS_RELEASE(ol); - NS_RELEASE(onblur); - NS_RELEASE(onfocus); - NS_RELEASE(onload); - NS_RELEASE(onunload); - NS_RELEASE(overflow); - NS_RELEASE(p); - NS_RELEASE(pagex); - NS_RELEASE(pagey); - NS_RELEASE(pointSize); - NS_RELEASE(pre); - NS_RELEASE(prompt); - NS_RELEASE(rel); - NS_RELEASE(rightpadding); - NS_RELEASE(rows); - NS_RELEASE(rowspan); - NS_RELEASE(scrolling); - NS_RELEASE(selected); - NS_RELEASE(shape); - NS_RELEASE(size); - NS_RELEASE(src); - NS_RELEASE(start); - NS_RELEASE(suppress); - NS_RELEASE(table); - NS_RELEASE(tabstop); - NS_RELEASE(target); - NS_RELEASE(text); - NS_RELEASE(top); - NS_RELEASE(toppadding); - NS_RELEASE(type); - NS_RELEASE(ul); - NS_RELEASE(usemap); - NS_RELEASE(valign); - NS_RELEASE(value); - NS_RELEASE(variable); - NS_RELEASE(visibility); - NS_RELEASE(vlink); - NS_RELEASE(vspace); - NS_RELEASE(width); - NS_RELEASE(wrap); - NS_RELEASE(zindex); - } -} - diff --git a/mozilla/layout/html/base/src/nsHTMLAtoms.h b/mozilla/layout/html/base/src/nsHTMLAtoms.h deleted file mode 100644 index 0a27ab5ace2..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLAtoms.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLAtoms_h___ -#define nsHTMLAtoms_h___ - -#include "nsIAtom.h" - -/** - * This class wraps up the creation (and destruction) of the standard - * set of html atoms used during normal html handling. This objects - * are created when the first html content object is created and they - * are destroyed when the last html content object is destroyed. - */ -class nsHTMLAtoms { -public: - - static void AddrefAtoms(); - static void ReleaseAtoms(); - - // Alphabetical list of html attribute atoms - static nsIAtom* a; - static nsIAtom* above; - static nsIAtom* action; - static nsIAtom* align; - static nsIAtom* alink; - static nsIAtom* alt; - static nsIAtom* archive; - - static nsIAtom* background; - static nsIAtom* below; - static nsIAtom* bgcolor; - static nsIAtom* body; - static nsIAtom* border; - static nsIAtom* bordercolor; - static nsIAtom* bottompadding; - static nsIAtom* br; - - static nsIAtom* cellpadding; - static nsIAtom* cellspacing; - static nsIAtom* checked; - static nsIAtom* kClass; - static nsIAtom* classid; - static nsIAtom* clear; - static nsIAtom* clip; - static nsIAtom* code; - static nsIAtom* codebase; - static nsIAtom* color; - static nsIAtom* cols; - static nsIAtom* colspan; - static nsIAtom* compact; - static nsIAtom* coords; - - static nsIAtom* data; - static nsIAtom* dir; - static nsIAtom* div; - static nsIAtom* dl; - - static nsIAtom* encoding; - - static nsIAtom* face; - static nsIAtom* font; - static nsIAtom* fontWeight; - static nsIAtom* frameborder; - - static nsIAtom* gutter; - - static nsIAtom* h1; - static nsIAtom* h2; - static nsIAtom* h3; - static nsIAtom* h4; - static nsIAtom* h5; - static nsIAtom* h6; - static nsIAtom* height; - static nsIAtom* hidden; - static nsIAtom* href; - static nsIAtom* hspace; - static nsIAtom* httpEquiv; - - static nsIAtom* id; - static nsIAtom* ismap; - - static nsIAtom* language; - static nsIAtom* li; - static nsIAtom* link; - static nsIAtom* left; - static nsIAtom* leftpadding; - static nsIAtom* lowsrc; - - static nsIAtom* marginheight; - static nsIAtom* marginwidth; - static nsIAtom* maxlength; - static nsIAtom* mayscript; - static nsIAtom* menu; - static nsIAtom* method; - static nsIAtom* multicol; - static nsIAtom* multiple; - - static nsIAtom* name; - static nsIAtom* noresize; - static nsIAtom* noshade; - static nsIAtom* nowrap; - - static nsIAtom* ol; - static nsIAtom* onblur; - static nsIAtom* onfocus; - static nsIAtom* onload; - static nsIAtom* onunload; - static nsIAtom* overflow; - - static nsIAtom* p; - static nsIAtom* pagex; - static nsIAtom* pagey; - static nsIAtom* pointSize; - static nsIAtom* pre; - static nsIAtom* prompt; - - static nsIAtom* rel; - static nsIAtom* rightpadding; - static nsIAtom* rows; - static nsIAtom* rowspan; - - static nsIAtom* scrolling; - static nsIAtom* selected; - static nsIAtom* shape; - static nsIAtom* size; - static nsIAtom* src; - static nsIAtom* start; - static nsIAtom* suppress; - - static nsIAtom* table; - static nsIAtom* tabstop; - static nsIAtom* target; - static nsIAtom* text; - static nsIAtom* top; - static nsIAtom* toppadding; - static nsIAtom* type; - - static nsIAtom* ul; - static nsIAtom* usemap; - - static nsIAtom* valign; - static nsIAtom* value; - static nsIAtom* variable; - static nsIAtom* visibility; - static nsIAtom* vlink; - static nsIAtom* vspace; - - static nsIAtom* width; - static nsIAtom* wrap; - - static nsIAtom* zindex; -}; - -#endif /* nsHTMLAtoms_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLContainer.cpp b/mozilla/layout/html/base/src/nsHTMLContainer.cpp deleted file mode 100644 index dd7af9a4975..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLContainer.cpp +++ /dev/null @@ -1,851 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsIDocument.h" -#include "nsIAtom.h" -#include "nsIArena.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsBlockFrame.h" -#include "nsInlineFrame.h" -#include "nsListItemFrame.h" -#include "nsIPresContext.h" -#include "nsHTMLIIDs.h" -#include "nsHTMLAtoms.h" -#include "nsIHTMLAttributes.h" -#include "nsDOMIterator.h" -#include "nsUnitConversion.h" -#include "nsIURL.h" -#include "prprf.h" - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -nsresult -NS_NewHTMLContainer(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - nsHTMLContainer* it = new nsHTMLContainer(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} - -nsresult -NS_NewHTMLContainer(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, nsIAtom* aTag) -{ - nsHTMLContainer* it = new(aArena) nsHTMLContainer(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} - -nsHTMLContainer::nsHTMLContainer() -{ -} - -nsHTMLContainer::nsHTMLContainer(nsIAtom* aTag) - : nsHTMLTagContent(aTag) -{ -} - -nsHTMLContainer::~nsHTMLContainer() -{ - PRInt32 n = mChildren.Count(); - for (PRInt32 i = 0; i < n; i++) { - nsIContent* kid = (nsIContent*) mChildren.ElementAt(i); - NS_RELEASE(kid); - } -} - -PRBool nsHTMLContainer::CanContainChildren() const -{ - return PR_TRUE; -} - -PRInt32 nsHTMLContainer::ChildCount() const -{ - return mChildren.Count(); -} - -nsIContent* nsHTMLContainer::ChildAt(PRInt32 aIndex) const -{ - nsIContent *child = (nsIContent*) mChildren.ElementAt(aIndex); - if (nsnull != child) { - NS_ADDREF(child); - } - return child; -} - -PRInt32 nsHTMLContainer::IndexOf(nsIContent* aPossibleChild) const -{ - NS_PRECONDITION(nsnull != aPossibleChild, "null ptr"); - return mChildren.IndexOf(aPossibleChild); -} - -PRBool nsHTMLContainer::InsertChildAt(nsIContent* aKid, PRInt32 aIndex) -{ - NS_PRECONDITION(nsnull != aKid, "null ptr"); - PRBool rv = mChildren.InsertElementAt(aKid, aIndex); - if (rv) { - NS_ADDREF(aKid); - aKid->SetParent(this); - nsIDocument* doc = mDocument; - if (nsnull != doc) { - aKid->SetDocument(doc); - doc->ContentInserted(this, aKid, aIndex); - } - } - return rv; -} - -PRBool nsHTMLContainer::ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex) -{ - NS_PRECONDITION(nsnull != aKid, "null ptr"); - nsIContent* oldKid = (nsIContent*) mChildren.ElementAt(aIndex); - PRBool rv = mChildren.ReplaceElementAt(aKid, aIndex); - if (rv) { - NS_ADDREF(aKid); - aKid->SetParent(this); - nsIDocument* doc = mDocument; - if (nsnull != doc) { - aKid->SetDocument(doc); - doc->ContentReplaced(this, oldKid, aKid, aIndex); - } - oldKid->SetDocument(nsnull); - oldKid->SetParent(nsnull); - NS_RELEASE(oldKid); - } - return rv; -} - -PRBool nsHTMLContainer::AppendChild(nsIContent* aKid) -{ - NS_PRECONDITION(nsnull != aKid, "null ptr"); - PRBool rv = mChildren.AppendElement(aKid); - if (rv) { - NS_ADDREF(aKid); - aKid->SetParent(this); - nsIDocument* doc = mDocument; - if (nsnull != doc) { - aKid->SetDocument(doc); - doc->ContentAppended(this); - } - } - return rv; -} - -PRBool nsHTMLContainer::RemoveChildAt(PRInt32 aIndex) -{ - nsIContent* oldKid = (nsIContent*) mChildren.ElementAt(aIndex); - if (nsnull != oldKid ) { - nsIDocument* doc = mDocument; - if (nsnull != doc) { - doc->ContentWillBeRemoved(this, oldKid, aIndex); - } - PRBool rv = mChildren.RemoveElementAt(aIndex); - if (nsnull != doc) { - doc->ContentHasBeenRemoved(this, oldKid, aIndex); - } - oldKid->SetDocument(nsnull); - oldKid->SetParent(nsnull); - NS_RELEASE(oldKid); - return rv; - } - return PR_FALSE; -} - -void nsHTMLContainer::Compact() -{ - //XXX I'll turn this on in a bit... mChildren.Compact(); -} - -nsIFrame* nsHTMLContainer::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - // Resolve style for the piece of content - // XXX The caller has also resolved the style context, which means we're - // resolving it more than once. That's inefficient, and we need to fix it... - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(this, aParentFrame); - nsStyleDisplay* styleDisplay = - (nsStyleDisplay*)styleContext->GetData(kStyleDisplaySID); - - // Use style to choose what kind of frame to create - nsIFrame* rv; - nsresult fr; - switch (styleDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - fr = nsBlockFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame); - break; - case NS_STYLE_DISPLAY_INLINE: - fr = nsInlineFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame); - break; - case NS_STYLE_DISPLAY_LIST_ITEM: - fr = nsListItemFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame); - break; - default: - // Create an empty frame for holding content that is not being - // reflowed. - fr = nsFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame); - break; - } - - rv->SetStyleContext(styleContext); - NS_RELEASE(styleContext); - return rv; -} - -//---------------------------------------------------------------------- - -static nsHTMLTagContent::EnumTable kListTypeTable[] = { - { "none", NS_STYLE_LIST_STYLE_NONE }, - { "disc", NS_STYLE_LIST_STYLE_DISC }, - { "circle", NS_STYLE_LIST_STYLE_CIRCLE }, - { "round", NS_STYLE_LIST_STYLE_CIRCLE }, - { "square", NS_STYLE_LIST_STYLE_SQUARE }, - { "decimal", NS_STYLE_LIST_STYLE_DECIMAL }, - { "lower-roman", NS_STYLE_LIST_STYLE_LOWER_ROMAN }, - { "upper-roman", NS_STYLE_LIST_STYLE_UPPER_ROMAN }, - { "lower-alpha", NS_STYLE_LIST_STYLE_LOWER_ALPHA }, - { "upper-alpha", NS_STYLE_LIST_STYLE_UPPER_ALPHA }, - { "A", NS_STYLE_LIST_STYLE_UPPER_ALPHA }, - { "a", NS_STYLE_LIST_STYLE_LOWER_ALPHA }, - { "I", NS_STYLE_LIST_STYLE_UPPER_ROMAN }, - { "i", NS_STYLE_LIST_STYLE_LOWER_ROMAN }, - { 0 } -}; - -static nsHTMLTagContent::EnumTable kListItemTypeTable[] = { - { "circle", NS_STYLE_LIST_STYLE_CIRCLE }, - { "round", NS_STYLE_LIST_STYLE_CIRCLE }, - { "square", NS_STYLE_LIST_STYLE_SQUARE }, - { "A", NS_STYLE_LIST_STYLE_UPPER_ALPHA }, - { "a", NS_STYLE_LIST_STYLE_LOWER_ALPHA }, - { "I", NS_STYLE_LIST_STYLE_UPPER_ROMAN }, - { "i", NS_STYLE_LIST_STYLE_LOWER_ROMAN }, - { 0 } -}; - -void nsHTMLContainer::SetAttribute(nsIAtom* aAttribute, - const nsString& aValue) -{ - // Special handling code for various html container attributes; note - // that if an attribute doesn't require special handling then we - // fall through and use the default base class implementation. - - nsHTMLValue val; - if (mTag == nsHTMLAtoms::p) { - if ((aAttribute == nsHTMLAtoms::align) && - ParseDivAlignParam(aValue, val)) { - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if (mTag == nsHTMLAtoms::a) { - if (aAttribute == nsHTMLAtoms::href) { - nsAutoString href(aValue); - href.StripWhitespace(); - nsHTMLTagContent::SetAttribute(aAttribute, href); - return; - } - if (aAttribute == nsHTMLAtoms::suppress) { - if (aValue.EqualsIgnoreCase("true")) { - nsHTMLValue val; - val.Set(1, eHTMLUnit_Absolute); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - // XXX PRE? - } - else if (mTag == nsHTMLAtoms::font) { - if ((aAttribute == nsHTMLAtoms::size) || - (aAttribute == nsHTMLAtoms::pointSize) || - (aAttribute == nsHTMLAtoms::fontWeight)) { - nsAutoString tmp(aValue); - PRInt32 ec, v = tmp.ToInteger(&ec); - tmp.CompressWhitespace(PR_TRUE, PR_FALSE); - PRUnichar ch = tmp.First(); - val.Set(v, ((ch == '+') || (ch == '-')) ? - eHTMLUnit_Absolute : eHTMLUnit_Enumerated); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::color) { - ParseColor(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if ((mTag == nsHTMLAtoms::div) || (mTag == nsHTMLAtoms::multicol)) { - if ((mTag == nsHTMLAtoms::div) && (aAttribute == nsHTMLAtoms::align) && - ParseDivAlignParam(aValue, val)) { - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::cols) { - ParseValue(aValue, 0, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - - // Note: These attributes only apply when cols > 1 - if (aAttribute == nsHTMLAtoms::gutter) { - ParseValue(aValue, 1, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::width) { - ParseValueOrPercent(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if ((mTag == nsHTMLAtoms::h1) || (mTag == nsHTMLAtoms::h2) || - (mTag == nsHTMLAtoms::h3) || (mTag == nsHTMLAtoms::h4) || - (mTag == nsHTMLAtoms::h5) || (mTag == nsHTMLAtoms::h6)) { - if ((aAttribute == nsHTMLAtoms::align) && - ParseDivAlignParam(aValue, val)) { - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if (mTag == nsHTMLAtoms::pre) { - if ((aAttribute == nsHTMLAtoms::wrap) || - (aAttribute == nsHTMLAtoms::variable)) { - val.Set(1, eHTMLUnit_Absolute); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::cols) { - ParseValue(aValue, 0, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::tabstop) { - PRInt32 ec, tabstop = aValue.ToInteger(&ec); - if (tabstop <= 0) { - tabstop = 8; - } - val.Set(tabstop, eHTMLUnit_Absolute); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if (mTag == nsHTMLAtoms::li) { - if (aAttribute == nsHTMLAtoms::type) { - if (ParseEnumValue(aValue, kListItemTypeTable, val)) { - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - // Illegal type values are left as is for the dom - } - if (aAttribute == nsHTMLAtoms::value) { - ParseValue(aValue, 1, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if ((mTag == nsHTMLAtoms::ul) || (mTag == nsHTMLAtoms::ol) || - (mTag == nsHTMLAtoms::menu) || (mTag == nsHTMLAtoms::dir)) { - if (aAttribute == nsHTMLAtoms::type) { - if (!ParseEnumValue(aValue, kListTypeTable, val)) { - val.Set(NS_STYLE_LIST_STYLE_BASIC, eHTMLUnit_Enumerated); - } - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::start) { - ParseValue(aValue, 1, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - if (aAttribute == nsHTMLAtoms::compact) { - val.Set(1, eHTMLUnit_Absolute); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if (mTag == nsHTMLAtoms::dl) { - if (aAttribute == nsHTMLAtoms::compact) { - val.Set(1, eHTMLUnit_Absolute); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - else if (mTag == nsHTMLAtoms::body) { - if (aAttribute == nsHTMLAtoms::background) { - nsAutoString href(aValue); - href.StripWhitespace(); - nsHTMLTagContent::SetAttribute(aAttribute, href); - return; - } - if (aAttribute == nsHTMLAtoms::bgcolor) { - ParseColor(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - } - - // Use default attribute catching code - nsHTMLTagContent::SetAttribute(aAttribute, aValue); -} - -nsContentAttr nsHTMLContainer::AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const -{ - nsContentAttr ca = eContentAttr_NotThere; - if (aValue.GetUnit() == eHTMLUnit_Enumerated) { - if (aAttribute == nsHTMLAtoms::align) { - DivAlignParamToString(aValue, aResult); - ca = eContentAttr_HasValue; - } - else if (mTag == nsHTMLAtoms::li) { - if (aAttribute == nsHTMLAtoms::type) { - EnumValueToString(aValue, kListItemTypeTable, aResult); - ca = eContentAttr_HasValue; - } - } - else if ((mTag == nsHTMLAtoms::ul) || (mTag == nsHTMLAtoms::ol) || - (mTag == nsHTMLAtoms::menu) || (mTag == nsHTMLAtoms::dir)) { - if (aAttribute == nsHTMLAtoms::type) { - EnumValueToString(aValue, kListTypeTable, aResult); - ca = eContentAttr_HasValue; - } - } - else if (mTag == nsHTMLAtoms::font) { - if ((aAttribute == nsHTMLAtoms::size) || - (aAttribute == nsHTMLAtoms::pointSize) || - (aAttribute == nsHTMLAtoms::fontWeight)) { - aResult.Truncate(); - aResult.Append(aValue.GetIntValue(), 10); - ca = eContentAttr_HasValue; - } - } - } - return ca; -} - -void nsHTMLContainer::MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ - if (nsnull != mAttributes) { - nsHTMLValue value; - - if (mTag == nsHTMLAtoms::p) { - // align: enum - GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) { - nsStyleText* text = (nsStyleText*)aContext->GetData(kStyleTextSID); - text->mTextAlign = value.GetIntValue(); - } - } - else if (mTag == nsHTMLAtoms::a) { - // suppress: bool (absolute) - GetAttribute(nsHTMLAtoms::suppress, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set suppress - } - } - else if (mTag == nsHTMLAtoms::font) { - nsStyleFont* font = (nsStyleFont*)aContext->GetData(kStyleFontSID); - nsStyleFont* parentFont = font; - nsIStyleContext* parentContext = aContext->GetParent(); - if (nsnull != parentContext) { - parentFont = (nsStyleFont*)parentContext->GetData(kStyleFontSID); - } - - // face: string list - GetAttribute(nsHTMLAtoms::face, value); - if (value.GetUnit() == eHTMLUnit_String) { - nsAutoString familyList; - value.GetStringValue(familyList); - // XXX needs font support to determine usable fonts - // parse up the string & remove the quotes - // XXX only does first until we can tell what are installed fonts - nsAutoString family; - PRInt32 index = familyList.Find(PRUnichar(',')); - if (-1 < index) { - familyList.Left(family, index); - } - else { - family.Append(familyList); - } - family.StripChars("\""); - family.StripWhitespace(); - - font->mFont.name = family; - } - - // pointSize: abs, enum - GetAttribute(nsHTMLAtoms::pointSize, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX should probably sanitize value - font->mFont.size = parentFont->mFont.size + NS_POINTS_TO_TWIPS_INT(value.GetIntValue()); - } - else if (value.GetUnit() == eHTMLUnit_Enumerated) { - font->mFont.size = NS_POINTS_TO_TWIPS_INT(value.GetIntValue()); - } - else { - // size: abs, enum - GetAttribute(nsHTMLAtoms::size, value); - if ((value.GetUnit() == eHTMLUnit_Absolute) || (value.GetUnit() == eHTMLUnit_Enumerated)) { - static float kFontScale[7] = { - 0.7f, - 0.8f, - 1.0f, - 1.2f, - 1.5f, - 2.0f, - 3.0f - }; - PRInt32 size = value.GetIntValue(); - - const nsFont& normal = aPresContext->GetDefaultFont(); // XXX should be BASEFONT - - if (value.GetUnit() == eHTMLUnit_Enumerated) { - size = ((0 < size) ? ((size < 8) ? size : 7) : 0); - font->mFont.size = (nscoord)((float)normal.size * kFontScale[size - 1]); - } - else { // enum (+/-) - if ((0 < size) && (size <= 7)) { // + - PRInt32 index; - for (index = 0; index < 6; index++) - if (parentFont->mFont.size < (nscoord)((float)normal.size * kFontScale[index])) - break; - size = ((index - 1) + size); - if (7 < size) size = 7; - font->mFont.size = (nscoord)((float)normal.size * kFontScale[size]); - } - else if ((-7 <= size) && (size < 0)) { - PRInt32 index; - for (index = 6; index > 0; index--) - if (parentFont->mFont.size > (nscoord)((float)normal.size * kFontScale[index])) - break; - size = ((index + 1) + size); - if (size < 0) size = 0; - font->mFont.size = (nscoord)((float)normal.size * kFontScale[size]); - } - else if (0 == size) { - font->mFont.size = parentFont->mFont.size; - } - } - } - } - - // fontWeight: abs, enum - GetAttribute(nsHTMLAtoms::fontWeight, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { // +/- - PRInt32 weight = parentFont->mFont.weight + value.GetIntValue(); - font->mFont.weight = ((100 < weight) ? ((weight < 700) ? weight : 700) : 100); - } - else if (value.GetUnit() == eHTMLUnit_Enumerated) { - PRInt32 weight = value.GetIntValue(); - weight = ((100 < weight) ? ((weight < 700) ? weight : 700) : 100); - font->mFont.weight = weight; - } - - // color: color - GetAttribute(nsHTMLAtoms::color, value); - if (value.GetUnit() == eHTMLUnit_Color) { - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - color->mColor = value.GetColorValue(); - } - else if (value.GetUnit() == eHTMLUnit_String) { - nsAutoString buffer; - value.GetStringValue(buffer); - char cbuf[40]; - buffer.ToCString(cbuf, sizeof(cbuf)); - - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - NS_ColorNameToRGB(cbuf, &(color->mColor)); - } - - NS_IF_RELEASE(parentContext); - } - else if ((mTag == nsHTMLAtoms::div) || (mTag == nsHTMLAtoms::multicol)) { - if (mTag == nsHTMLAtoms::div) { - // align: enum - GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) { - // XXX set align - } - } - - PRInt32 numCols = 1; - // cols: int - GetAttribute(nsHTMLAtoms::cols, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - numCols = value.GetIntValue(); - // XXX - } - - // Note: These attributes only apply when cols > 1 - if (1 < numCols) { - // gutter: int - GetAttribute(nsHTMLAtoms::gutter, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - - // width: int, % - GetAttribute(nsHTMLAtoms::width, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - else if (value.GetUnit() == eHTMLUnit_Enumerated) { - // XXX set - } - } - } - else if ((mTag == nsHTMLAtoms::h1) || (mTag == nsHTMLAtoms::h2) || - (mTag == nsHTMLAtoms::h3) || (mTag == nsHTMLAtoms::h4) || - (mTag == nsHTMLAtoms::h5) || (mTag == nsHTMLAtoms::h6)) { - // align: enum - GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) { - // XXX set - } - } - else if (mTag == nsHTMLAtoms::pre) { - // wrap: flag (abs==1) - GetAttribute(nsHTMLAtoms::wrap, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - - // variable: flag (abs==1) - GetAttribute(nsHTMLAtoms::variable, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - - // cols: int - GetAttribute(nsHTMLAtoms::cols, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - - // tabstop: int - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - } - else if (mTag == nsHTMLAtoms::li) { - nsStyleList* list = (nsStyleList*)aContext->GetData(kStyleListSID); - - // type: enum - GetAttribute(nsHTMLAtoms::type, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) { - list->mListStyleType = value.GetIntValue(); - } - } - else if ((mTag == nsHTMLAtoms::ul) || (mTag == nsHTMLAtoms::ol) || - (mTag == nsHTMLAtoms::menu) || (mTag == nsHTMLAtoms::dir)) { - nsStyleList* list = (nsStyleList*)aContext->GetData(kStyleListSID); - - // type: enum - GetAttribute(nsHTMLAtoms::type, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) { - list->mListStyleType = value.GetIntValue(); - } - - // compact: flag (abs==1) - GetAttribute(nsHTMLAtoms::compact, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - } - else if (mTag == nsHTMLAtoms::dl) { - // compact: flag (abs==1) - GetAttribute(nsHTMLAtoms::compact, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - // XXX set - } - } - else if (mTag == nsHTMLAtoms::body) { - MapBackgroundAttributesInto(aContext, aPresContext); - } - } -} - - -void -nsHTMLContainer::MapBackgroundAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ - nsHTMLValue value; - - // background - if (eContentAttr_HasValue == GetAttribute(nsHTMLAtoms::background, value)) { - if (eHTMLUnit_String == value.GetUnit()) { - // Resolve url to an absolute url - nsIURL* docURL = nsnull; - nsIDocument* doc = mDocument; - if (nsnull != doc) { - docURL = doc->GetDocumentURL(); - } - - nsAutoString absURLSpec; - nsAutoString spec; - value.GetStringValue(spec); - nsresult rv = NS_MakeAbsoluteURL(docURL, "", spec, absURLSpec); - if (nsnull != docURL) { - NS_RELEASE(docURL); - } - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - color->mBackgroundImage = absURLSpec; - color->mBackgroundFlags &= ~NS_STYLE_BG_IMAGE_NONE; - color->mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY; - } - } - - // bgcolor - if (eContentAttr_HasValue == GetAttribute(nsHTMLAtoms::bgcolor, value)) { - if (eHTMLUnit_Color == value.GetUnit()) { - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - color->mBackgroundColor = value.GetColorValue(); - color->mBackgroundFlags &= ~NS_STYLE_BG_COLOR_TRANSPARENT; - } - else if (eHTMLUnit_String == value.GetUnit()) { - nsAutoString buffer; - value.GetStringValue(buffer); - char cbuf[40]; - buffer.ToCString(cbuf, sizeof(cbuf)); - - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - NS_ColorNameToRGB(cbuf, &(color->mBackgroundColor)); - color->mBackgroundFlags &= ~NS_STYLE_BG_COLOR_TRANSPARENT; - } - } -} - - -// nsIDOMNode interface -static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); -static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID); - -nsresult nsHTMLContainer::GetChildNodes(nsIDOMNodeIterator **aIterator) -{ - NS_PRECONDITION(nsnull != aIterator, "null pointer"); - *aIterator = new nsDOMIterator(*this); - return NS_OK; -} - -nsresult nsHTMLContainer::HasChildNodes() -{ - if (0 != mChildren.Count()) { - return NS_OK; - } - else { - return NS_ERROR_FAILURE; - } -} - -nsresult nsHTMLContainer::GetFirstChild(nsIDOMNode **aNode) -{ - nsIDOMNode* node = nsnull; - nsIContent *child = (nsIContent*) mChildren.ElementAt(0); - if (nsnull != child) { - nsresult res = child->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); // must be a DOM Node - - return res; - } - - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContainer::InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild) -{ - nsIContent* content = nsnull; - nsresult res = refChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { - PRInt32 pos = IndexOf(content); - if (pos >= 0) { - nsIContent* newContent = nsnull; - res = newChild->QueryInterface(kIContentIID, (void**)&newContent); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { - if (PR_FALSE == InsertChildAt(newContent, pos)) { - res = NS_ERROR_FAILURE; - } - NS_RELEASE(newContent); - } - } - NS_RELEASE(content); - } - - return res; -} - -nsresult nsHTMLContainer::ReplaceChild(nsIDOMNode *newChild, - nsIDOMNode *oldChild) -{ - nsIContent* content = nsnull; - nsresult res = oldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { - PRInt32 pos = IndexOf(content); - if (pos >= 0) { - nsIContent* newContent = nsnull; - nsresult res = newChild->QueryInterface(kIContentIID, (void**)&newContent); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { - if (PR_FALSE == ReplaceChildAt(newContent, pos)) { - res = NS_ERROR_FAILURE; - } - NS_RELEASE(newContent); - } - } - NS_RELEASE(content); - } - - return res; -} - -nsresult nsHTMLContainer::RemoveChild(nsIDOMNode *oldChild) -{ - nsIDOMNode* oldNode = nsnull; - nsIContent* content = nsnull; - nsresult res = oldChild->QueryInterface(kIContentIID, (void**)&content); - NS_ASSERTION(NS_OK == res, "Must be an nsIContent"); - if (NS_OK == res) { - PRInt32 pos = IndexOf(content); - if (pos >= 0) { - if (PR_TRUE == RemoveChildAt(pos)) { - res = NS_ERROR_FAILURE; - } - } - NS_RELEASE(content); - } - - return res; -} - diff --git a/mozilla/layout/html/base/src/nsHTMLContainer.h b/mozilla/layout/html/base/src/nsHTMLContainer.h deleted file mode 100644 index 56f78a9dea9..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLContainer.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLContainer_h___ -#define nsHTMLContainer_h___ - -#include "nsHTMLTagContent.h" -#include "nsVoidArray.h" - -// Generic HTML container class. This code manages an array of -// children nodes that can be any kind of nsIContent -class nsHTMLContainer : public nsHTMLTagContent { -public: - nsHTMLContainer(nsIAtom* aTag); - - virtual PRBool CanContainChildren() const; - virtual PRInt32 ChildCount() const; - virtual nsIContent* ChildAt(PRInt32 aIndex) const; - virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const; - virtual PRBool InsertChildAt(nsIContent* aKid, PRInt32 aIndex); - virtual PRBool ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex); - virtual PRBool AppendChild(nsIContent* aKid); - virtual PRBool RemoveChildAt(PRInt32 aIndex); - - virtual void Compact(); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - - virtual nsresult GetChildNodes(nsIDOMNodeIterator **aIterator); - virtual nsresult HasChildNodes(); - virtual nsresult GetFirstChild(nsIDOMNode **aNode); - virtual nsresult InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild); - virtual nsresult ReplaceChild(nsIDOMNode *newChild, - nsIDOMNode *oldChild); - virtual nsresult RemoveChild(nsIDOMNode *oldChild); - -protected: - nsHTMLContainer(); - virtual ~nsHTMLContainer(); - - virtual nsContentAttr AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const; - - /** - * Helper method that maps "background" and "bgcolor" into - * the style context. - */ - void MapBackgroundAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - - nsVoidArray mChildren; -}; - -#endif /* nsHTMLContainer_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp deleted file mode 100644 index 7ea228ca7b2..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLContainerFrame.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsCSSRendering.h" -#include "nsIContent.h" -#include "nsHTMLAtoms.h" -#include "nsIWidget.h" -#include "nsILinkHandler.h" -#include "nsHTMLValue.h" -#include "nsGUIEvent.h" -#include "nsIDocument.h" -#include "nsIURL.h" - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); - -nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -nsHTMLContainerFrame::~nsHTMLContainerFrame() -{ -} - -NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // Do not paint ourselves if we are a pseudo-frame - if (PR_FALSE == IsPseudoFrame()) { - PRIntn skipSides = GetSkipSides(); - nsStyleColor* color = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* border = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *color); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *border, skipSides); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - return NS_OK; -} - -void nsHTMLContainerFrame::TriggerLink(nsIPresContext& aPresContext, - const nsString& aBase, - const nsString& aURLSpec, - const nsString& aTargetSpec) -{ - nsILinkHandler* handler; - if (NS_OK == aPresContext.GetLinkHandler(&handler)) { - // Resolve url to an absolute url - nsIURL* docURL = nsnull; - nsIDocument* doc = mContent->GetDocument(); - if (nsnull != doc) { - docURL = doc->GetDocumentURL(); - NS_RELEASE(doc); - } - - nsAutoString absURLSpec; - nsresult rv = NS_MakeAbsoluteURL(docURL, aBase, aURLSpec, absURLSpec); - if (nsnull != docURL) { - NS_RELEASE(docURL); - } - - // Now pass on absolute url to the click handler - handler->OnLinkClick(this, absURLSpec, aTargetSpec); - } -} - -NS_METHOD nsHTMLContainerFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ - aEventStatus = nsEventStatus_eIgnore; - switch (aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_UP: - if (nsEventStatus_eIgnore == - nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus)) { - // If our child didn't take the click then since we are an - // anchor, we take the click. - nsIAtom* tag = mContent->GetTag(); - if (tag == nsHTMLAtoms::a) { - nsAutoString base, href, target; - mContent->GetAttribute("href", href); - mContent->GetAttribute("target", target); - TriggerLink(aPresContext, base, href, target); - aEventStatus = nsEventStatus_eConsumeNoDefault; - } - NS_IF_RELEASE(tag); - } - break; - - case NS_MOUSE_RIGHT_BUTTON_DOWN: - // XXX Bring up a contextual menu provided by the application - break; - - default: - nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus); - break; - } - return NS_OK; -} - -NS_METHOD nsHTMLContainerFrame::GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) -{ - // Get my cursor - nsStyleColor* styleColor = (nsStyleColor*) - mStyleContext->GetData(kStyleColorSID); - PRInt32 myCursor = styleColor->mCursor; - - // Get child's cursor, if any - nsresult rv = nsContainerFrame::GetCursorAt(aPresContext, aPoint, aFrame, - aCursor); - if (NS_OK != rv) return rv; - if (aCursor != NS_STYLE_CURSOR_INHERIT) { - nsIAtom* tag = mContent->GetTag(); - if (nsHTMLAtoms::a == tag) { - // Anchor tags override their child cursors in some cases. - if ((NS_STYLE_CURSOR_IBEAM == aCursor) && - (NS_STYLE_CURSOR_INHERIT != myCursor)) { - aCursor = myCursor; - } - } - NS_RELEASE(tag); - return rv; - } - - if (NS_STYLE_CURSOR_INHERIT != myCursor) { - // If this container has a particular cursor, use it, otherwise - // let the child decide. - *aFrame = this; - aCursor = myCursor; - return NS_OK; - } - - // No specific cursor for us - aCursor = NS_STYLE_CURSOR_INHERIT; - return NS_OK; -} - -#if 0 -nsIFrame::ReflowStatus -nsHTMLContainerFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 0. Get to the correct flow block for this frame that applies to - // the effected frame. If the reflow command is not for us or it's - // deleted or changed then "child" is the child being - // effected. Otherwise child is the child before the effected - // content child (or null if the effected child is our first child) - * flow = FindFlowBlock(aReflowCommand, &child); - - // 1. Recover reflow state - State state; - RecoverState(aPresContext, ..., state); - - // 2. Put state into presentation shell cache so child frames can find - // it. - - if (aReflowCommand.GetTarget() == this) { - // Apply reflow command to the flow frame; one of it's immediate - // children has changed state. - ReflowStatus status; - switch (aReflowCommand.GetType()) { - case nsReflowCommand::rcContentAppended: - status = ReflowAppended(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcContentInserted: - status = ReflowInserted(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcContentDeleted: - status = ReflowDeleted(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcContentChanged: - status = ReflowChanged(aPresContext, aDesiredSize, aMaxSize, - aSpaceManager, state, flow); - break; - case nsReflowCommand::rcUserDefined: - switch ( - break; - default: - // Ignore all other reflow commands - status = frComplete; - break; - } - } else { - // Reflow command applies to one of our children. We need to - // figure out which child because it's going to change size most - // likely and we need to be prepared to deal with it. - nsIFrame* kid = nsnull; - status = aReflowCommand.Next(aDesiredSize, aMaxSize, aSpaceManager, kid); - - // Execute the ReflowChanged post-processing code that deals with - // the child frame's size change; next-in-flows, overflow-lists, - // etc. - } - - // 4. Remove state from presentation shell cache - - return status; -} - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowAppended(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including new content w/o reflowing - // everything that's already been flowed - - // 2. if this container uses pseudo-frames then 2b, else 2a - - // 2a. start a reflow-unmapped of the new children - - // 2b. reflow-mapped the last-child if it's a pseudo as it might - // pickup the new children; smarter containers can avoid this if - // they can determine that the last-child won't pickup the new - // children up. Once reflowing the last-child is complete then if - // the status is frComplete then and only then try reflowing any - // remaining unmapped children - - // 2c. For inline and column code the result of a reflow mapped - // cannot impact any previously reflowed children. For block this - // is not true so block needs to reconstruct the line and then - // proceed as if the line were being reflowed for the first time - // (skipping over the existing children, of course). The line still - // needs to be flushed out, vertically aligned, etc, which may cause - // it to not fit. - - // 3. we may end up pushing kids to next-in-flow or stopping before - // all children have been mapped because we are out of room. parent - // needs to look at our return status and create a next-in-flow for - // us; the currently implemented reflow-unmapped code will do the - // right thing in that a child that is being appended and reflowed - // will get it's continuations created by us; if we run out of room - // we return an incomplete status to our parent and it does the same - // to us. -} - -// use a custom reflow command when we push or create an overflow list; - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowInserted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including new content w/o reflowing - // everything that's already been flowed - - // 2. Content insertion implies a new child of this container; the - // content inserted may need special attention (see - // ContentAppended). The same rules apply. However, if the - // pseudo-frame doesn't pullup the child then we need to - // ResizeReflow the addition (We cannot go through the - // reflow-unmapped path because the child frame(s) will need to be - // inserted into the list). - - // 2a if reflow results in a push then go through push reflow - // command path else go through deal-with-size-change -} - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowDeleted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including deleted content w/o reflowing - // everything that's already been flowed - - // 2. remove all of the child frames that belong to the deleted - // child; this includes next-in-flows. mark all of our next-in-flows - // that are impacted by this as dirty (or generate another reflow - // command) - - // 3. Run reflow-mapped code starting at the deleted child point; - // return the usual status to the parent. - - - // Generate reflow commands for my next-in-flows if they are - // impacted by deleting my child's next-in-flows -} - -// Meta point about ReflowChanged; we will factor out the change so -// that only stylistic changes that actually require a reflow end up -// at this frame. The style system will differentiate between -// rendering-only changes and reflow changes. - -nsIFrame::ReflowStatus -nsHTMLContainerFrame::ReflowChanged(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand) -{ - // 1. compute state up to but not including deleted content w/o reflowing - // everything that's already been flowed - - // 2. delete the frame that corresponds to the changed child (and - // it's next-in-flows, etc.) - - // 3. run the ReflowInserted code on the content -} -#endif diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h deleted file mode 100644 index 9364e3f870b..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLContainerFrame_h___ -#define nsHTMLContainerFrame_h___ - -#include "nsContainerFrame.h" -class nsString; - -// Base class for html container frames that provides common -// functionality. -class nsHTMLContainerFrame : public nsContainerFrame { -public: - nsHTMLContainerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); - - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor); - -#if 0 - virtual ReflowStatus IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); -#endif - -protected: - virtual ~nsHTMLContainerFrame(); - - virtual PRIntn GetSkipSides() const = 0; - - void TriggerLink(nsIPresContext& aPresContext, - const nsString& aBase, - const nsString& aURLSpec, - const nsString& aTargetSpec); - -#if 0 - virtual ReflowStatus ReflowAppended(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); - - virtual ReflowStatus ReflowInserted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); - - virtual ReflowStatus ReflowDeleted(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); - - virtual ReflowStatus ReflowChanged(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsISpaceManager* aSpaceManager, - nsReflowCommand& aReflowCommand); -#endif -}; - -#endif /* nsHTMLContainerFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLContent.cpp b/mozilla/layout/html/base/src/nsHTMLContent.cpp deleted file mode 100644 index d2a64f7a89b..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLContent.cpp +++ /dev/null @@ -1,510 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLContent.h" -#include "nsString.h" -#include "nsIArena.h" -#include "nsIAtom.h" -#include "nsIHTMLAttributes.h" -#include "nsIContentDelegate.h" -#include "nsFrame.h" -#include "nsHTMLIIDs.h" -#include "nsISupportsArray.h" -#include "nsCRT.h" -#include "nsIDocument.h" - -static NS_DEFINE_IID(kIContentDelegateIID, NS_ICONTENTDELEGATE_IID); -static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID); -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); -static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); - -static nsIContentDelegate* gContentDelegate; - -/** - * THE html content delegate. There is exactly one instance of this - * class and it's used for all html content. It just turns around - * and asks the content object to create the frame. - */ -class ContentDelegate : public nsIContentDelegate { -public: - ContentDelegate(); - NS_DECL_ISUPPORTS - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); -protected: - ~ContentDelegate(); -}; - -ContentDelegate::ContentDelegate() -{ - NS_INIT_REFCNT(); -} - -NS_IMPL_ISUPPORTS(ContentDelegate, kIContentDelegateIID); - -ContentDelegate::~ContentDelegate() -{ -} - -nsIFrame* ContentDelegate::CreateFrame(nsIPresContext* aPresContext, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - NS_PRECONDITION(nsnull != aContent, "null ptr"); - - // Make sure the content is html content - nsIHTMLContent* hc; - nsIFrame* rv; - nsresult status = aContent->QueryInterface(kIHTMLContentIID, (void**) &hc); - if (NS_OK != status) { - // This means that *somehow* somebody which is not an html - // content object got ahold of this delegate and tried to - // create a frame with it. Give them back an nsFrame. - status = nsFrame::NewFrame(&rv, aContent, aIndexInParent, aParentFrame); - return rv; - } - - // Ask the content object to create the frame - rv = hc->CreateFrame(aPresContext, aIndexInParent, aParentFrame); - NS_RELEASE(hc); - return rv; -} - -//---------------------------------------------------------------------- - -void* nsHTMLContent::operator new(size_t size) -{ - nsHTMLContent* rv = (nsHTMLContent*) ::operator new(size); - nsCRT::zero(rv, size); - rv->mInHeap = 1; - return (void*) rv; -} - -void* nsHTMLContent::operator new(size_t size, nsIArena* aArena) -{ - nsHTMLContent* rv = (nsHTMLContent*) aArena->Alloc(PRInt32(size)); - nsCRT::zero(rv, size); - return (void*) rv; -} - -void nsHTMLContent::operator delete(void* ptr) -{ - NS_PRECONDITION(nsnull != ptr, "null ptr"); - nsHTMLContent* hc = (nsHTMLContent*) ptr; - if (nsnull != hc) { - if (hc->mInHeap) { - ::delete ptr; - } - } -} - -nsHTMLContent::nsHTMLContent() -{ - // Create shared content delegate if this is the first html content - // object being created. - if (nsnull == gContentDelegate) { - gContentDelegate = new ContentDelegate(); - } - - // Add a reference to the shared content delegate object - NS_ADDREF(gContentDelegate); -} - -nsHTMLContent::~nsHTMLContent() -{ - NS_PRECONDITION(nsnull != gContentDelegate, "null content delegate"); - if (nsnull != gContentDelegate) { - // Remove our reference to the shared content delegate object. If - // the last reference just went away, null out gContentDelegate. - nsrefcnt rc = gContentDelegate->Release(); - if (0 == rc) { - gContentDelegate = nsnull; - } - } -} - -NS_IMPL_ADDREF(nsHTMLContent) -NS_IMPL_RELEASE(nsHTMLContent) - -nsresult nsHTMLContent::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLContentIID)) { - *aInstancePtrResult = (void*) ((nsIHTMLContent*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIContentIID)) { - *aInstancePtrResult = (void*) ((nsIContent*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*)(nsISupports*)(nsIContent*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIDOMNodeIID)) { - *aInstancePtrResult = (void*)(nsIDOMNode*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIScriptObjectOwnerIID)) { - *aInstancePtrResult = (void*)(nsIScriptObjectOwner*)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -void nsHTMLContent::Compact() -{ -} - -nsIDocument* nsHTMLContent::GetDocument() const -{ - NS_IF_ADDREF(mDocument); - return mDocument; -} - -void nsHTMLContent::SetDocument(nsIDocument* aDocument) -{ - mDocument = aDocument; -} - -nsIContent* nsHTMLContent::GetParent() const -{ - NS_IF_ADDREF(mParent); - return mParent; -} - -void nsHTMLContent::SetParent(nsIContent* aParent) -{ - mParent = aParent; -} - -PRBool nsHTMLContent::CanContainChildren() const -{ - return PR_FALSE; -} - -PRInt32 nsHTMLContent::ChildCount() const -{ - return 0; -} - -nsIContent* nsHTMLContent::ChildAt(PRInt32 aIndex) const -{ - return nsnull; -} - -PRInt32 nsHTMLContent::IndexOf(nsIContent* aPossibleChild) const -{ - return -1; -} - -PRBool nsHTMLContent::InsertChildAt(nsIContent* aKid, PRInt32 aIndex) -{ - return PR_FALSE; -} - -PRBool nsHTMLContent::ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex) -{ - return PR_FALSE; -} - -PRBool nsHTMLContent::AppendChild(nsIContent* aKid) -{ - return PR_FALSE; -} - -PRBool nsHTMLContent::RemoveChildAt(PRInt32 aIndex) -{ - return PR_FALSE; -} - -void nsHTMLContent::SetAttribute(const nsString& aName, const nsString& aValue) -{ -} - -nsContentAttr nsHTMLContent::GetAttribute(const nsString& aName, - nsString& aResult) const -{ - aResult.SetLength(0); - return eContentAttr_NotThere; -} - -void nsHTMLContent::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ -} - -void nsHTMLContent::SetAttribute(nsIAtom* aAttribute, const nsHTMLValue& aValue) -{ -} - -void nsHTMLContent::UnsetAttribute(nsIAtom* aAttribute) -{ -} - -nsContentAttr nsHTMLContent::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const -{ - aValue.Reset(); - return eContentAttr_NotThere; -} - -PRInt32 nsHTMLContent::GetAllAttributeNames(nsISupportsArray* aArray) const -{ - return 0; -} - -PRInt32 nsHTMLContent::GetAttributeCount(void) const -{ - return 0; -} - -void nsHTMLContent::SetID(nsIAtom* aID) -{ -} - -nsIAtom* nsHTMLContent::GetID(void) const -{ - return nsnull; -} - -void nsHTMLContent::SetClass(nsIAtom* aClass) -{ -} - -nsIAtom* nsHTMLContent::GetClass(void) const -{ - return nsnull; -} - -nsIStyleRule* nsHTMLContent::GetStyleRule(void) -{ - return nsnull; -} - -void nsHTMLContent::MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ -} - - -void nsHTMLContent::ListAttributes(FILE* out) const -{ - nsISupportsArray* attrs; - if (NS_OK == NS_NewISupportsArray(&attrs)) { - GetAllAttributeNames(attrs); - PRInt32 count = attrs->Count(); - PRInt32 index; - for (index = 0; index < count; index++) { - nsIAtom* attr = (nsIAtom*)attrs->ElementAt(index); - nsAutoString buffer; - attr->ToString(buffer); -#if 0 // use nsHTMLValue api - nsHTMLValue value; - GetAttribute(attr, value); -#else // use string api - nsAutoString value; - GetAttribute(buffer, value); -#endif - buffer.Append("="); -#if 0 - value.AppendToString(buffer); -#else - buffer.Append(value); -#endif - fputs(" ", out); - fputs(buffer, out); - NS_RELEASE(attr); - } - NS_RELEASE(attrs); - } -} - -void nsHTMLContent::List(FILE* out, PRInt32 aIndent) const -{ - NS_PRECONDITION(nsnull != mDocument, "bad content"); - - PRInt32 index; - for (index = aIndent; --index >= 0; ) fputs(" ", out); - - nsIAtom* tag = GetTag(); - if (tag != nsnull) { - nsAutoString buf; - tag->ToString(buf); - fputs(buf, out); - NS_RELEASE(tag); - } - - ListAttributes(out); - - fprintf(out, " RefCount=%d<\n", mRefCnt); - - if (CanContainChildren()) { - PRInt32 kids = ChildCount(); - for (index = 0; index < kids; index++) { - nsIContent* kid = ChildAt(index); - kid->List(out, aIndent + 1); - NS_RELEASE(kid); - } - } - - for (index = aIndent; --index >= 0; ) fputs(" ", out); - fputs(">\n", out); -} - -PRUint32 nsHTMLContent::SizeOf(nsISizeofHandler* aHandler) const -{ - return 0; -} - -nsIAtom* nsHTMLContent::GetTag() const -{ - return nsnull; -} - -void nsHTMLContent::ToHTML(FILE* out) const -{ - nsAutoString tmp; - ToHTMLString(tmp); - fputs(tmp, out); -} - -nsIContentDelegate* nsHTMLContent::GetDelegate(nsIPresContext* aCX) -{ - gContentDelegate->AddRef(); - return gContentDelegate; -} - -void nsHTMLContent::NewGlobalAtom(const char* aString, nsIAtom** aAtomResult) -{ - if (nsnull == *aAtomResult) { - *aAtomResult = NS_NewAtom(aString); - } else { - NS_ADDREF(*aAtomResult); - } -} - -void nsHTMLContent::ReleaseGlobalAtom(nsIAtom** aAtomResult) -{ - nsIAtom* atom = *aAtomResult; - if (nsnull != atom) { - if (0 == atom->Release()) { - *aAtomResult = nsnull; - } - } -} - -nsresult nsHTMLContent::ResetScriptObject() -{ - mScriptObject = nsnull; - return NS_OK; -} - -// nsIDOMNode interface -nsresult nsHTMLContent::GetParentNode(nsIDOMNode **aNode) -{ - if (nsnull != mParent) { - nsresult res = mParent->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); - return res; - } - - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::GetChildNodes(nsIDOMNodeIterator **aIterator) -{ - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::HasChildNodes() -{ - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::GetFirstChild(nsIDOMNode **aNode) -{ - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::GetPreviousSibling(nsIDOMNode **aNode) -{ - if (nsnull != mParent) { - PRInt32 pos = mParent->IndexOf(this); - if (pos > -1) { - nsIContent* prev = mParent->ChildAt(--pos); - if (nsnull != prev) { - nsresult res = prev->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); - - NS_RELEASE(prev); // balance the AddRef in ChildAt() - - return res; - } - } - } - - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::GetNextSibling(nsIDOMNode **aNode) -{ - if (nsnull != mParent) { - PRInt32 pos = mParent->IndexOf(this); - if (pos > -1 ) { - nsIContent* prev = mParent->ChildAt(++pos); - if (nsnull != prev) { - nsresult res = prev->QueryInterface(kIDOMNodeIID, (void**)aNode); - NS_ASSERTION(NS_OK == res, "Must be a DOM Node"); - NS_RELEASE(prev); // balance the AddRef in ChildAt() - - return res; - } - } - } - - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild) -{ - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::ReplaceChild(nsIDOMNode *newChild, - nsIDOMNode *oldChild) -{ - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLContent::RemoveChild(nsIDOMNode *oldChild) -{ - return NS_ERROR_FAILURE; -} - diff --git a/mozilla/layout/html/base/src/nsHTMLContent.h b/mozilla/layout/html/base/src/nsHTMLContent.h deleted file mode 100644 index 5a65670ba55..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLContent.h +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLContent_h___ -#define nsHTMLContent_h___ - -#include "nsIHTMLContent.h" -#include "nsIDOMNode.h" -#include "nsIScriptObjectOwner.h" -class nsIArena; -class nsIAtom; - -/** - * Abstract base class for un-tagged html content objects. Supports - * allocation from the malloc heap as well as from an arena. Note - * that instances of this object are created with zero'd memory. - */ -class nsHTMLContent : public nsIHTMLContent, public nsIDOMNode, public nsIScriptObjectOwner { -public: - /** - * This new method allocates memory from the standard malloc heap - * and zeros out the content object. - */ - void* operator new(size_t size); - - /** - * This new method allocates memory from the given arena and - * and zeros out the content object. - */ - void* operator new(size_t size, nsIArena* aArena); - - /** - * Release the memory associated with the content object. If the - * object was allocated from an arena then nothing happens. - */ - void operator delete(void* ptr); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual nsIDocument* GetDocument() const; - virtual void SetDocument(nsIDocument* aDocument); - - virtual nsIContent* GetParent() const; - virtual void SetParent(nsIContent* aParent); - - virtual PRBool CanContainChildren() const; - virtual PRInt32 ChildCount() const; - virtual nsIContent* ChildAt(PRInt32 aIndex) const; - virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const; - virtual PRBool InsertChildAt(nsIContent* aKid, PRInt32 aIndex); - virtual PRBool ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex); - virtual PRBool AppendChild(nsIContent* aKid); - virtual PRBool RemoveChildAt(PRInt32 aIndex); - - virtual void Compact(); - - virtual void SetAttribute(const nsString& aName, const nsString& aValue); - virtual nsContentAttr GetAttribute(const nsString& aName, - nsString& aResult) const; - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - virtual void SetAttribute(nsIAtom* aAttribute, - const nsHTMLValue& aValue = nsHTMLValue::kNull); - virtual void UnsetAttribute(nsIAtom* aAttribute); - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const; - virtual PRInt32 GetAllAttributeNames(nsISupportsArray* aArray) const; - virtual PRInt32 GetAttributeCount(void) const; - - virtual void SetID(nsIAtom* aID); - virtual nsIAtom* GetID(void) const; - virtual void SetClass(nsIAtom* aClass); // XXX this will have to change for CSS2 - virtual nsIAtom* GetClass(void) const; // XXX this will have to change for CSS2 - - virtual nsIStyleRule* GetStyleRule(void); - - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - - virtual void List(FILE* out, PRInt32 aIndent) const; - - virtual PRUint32 SizeOf(nsISizeofHandler* aHandler) const; - - virtual nsIAtom* GetTag() const; - - virtual void ToHTML(FILE* out) const; - - virtual nsIContentDelegate* GetDelegate(nsIPresContext* aCX); - - static void NewGlobalAtom(const char* aString, nsIAtom** aAtomResult); - - static void ReleaseGlobalAtom(nsIAtom** aAtomResult); - -public: - virtual nsresult ResetScriptObject(); - - // nsIDOMNode interface - virtual nsresult GetParentNode(nsIDOMNode **aNode); - virtual nsresult GetChildNodes(nsIDOMNodeIterator **aIterator); - virtual nsresult HasChildNodes(); - virtual nsresult GetFirstChild(nsIDOMNode **aNode); - virtual nsresult GetPreviousSibling(nsIDOMNode **aNode); - virtual nsresult GetNextSibling(nsIDOMNode **aNode); - virtual nsresult InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild); - virtual nsresult ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild); - virtual nsresult RemoveChild(nsIDOMNode *oldChild); - -protected: - nsHTMLContent(); - virtual ~nsHTMLContent(); - virtual void ListAttributes(FILE* out) const; - - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - nsIDocument* mDocument; - nsIContent* mParent; - void* mScriptObject; -}; - -#endif /* nsHTMLContent_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLIIDs.cpp b/mozilla/layout/html/base/src/nsHTMLIIDs.cpp deleted file mode 100644 index 64f39328acc..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLIIDs.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLIIDs.h" -#include "nsIHTMLContent.h" -#include "nsIHTMLFrameType.h" - -const nsIID kIHTMLContentIID = NS_IHTMLCONTENT_IID; -const nsIID kIHTMLFrameTypeIID = NS_IHTMLFRAMETYPE_IID; diff --git a/mozilla/layout/html/base/src/nsHTMLIIDs.h b/mozilla/layout/html/base/src/nsHTMLIIDs.h deleted file mode 100644 index 8a4e3e694ca..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLIIDs.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLIIDs_h___ -#define nsHTMLIIDs_h___ - -#include "nsISupports.h" - -extern const nsIID kIHTMLContentIID; -extern const nsIID kIHTMLFrameTypeIID; - -#endif /* nsHTMLIIDs_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLImage.cpp b/mozilla/layout/html/base/src/nsHTMLImage.cpp deleted file mode 100644 index 50d1aca142d..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLImage.cpp +++ /dev/null @@ -1,595 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLTagContent.h" -#include "nsString.h" -#include "nsLeafFrame.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsHTMLIIDs.h" -#include "nsIImage.h" -#include "nsIWidget.h" -#include "nsIImage.h" -#include "nsHTMLAtoms.h" -#include "nsIHTMLAttributes.h" -#include "nsIDocument.h" -#include "nsIHTMLDocument.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIImageMap.h" -#include "nsILinkHandler.h" -#include "nsIURL.h" - -static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -class ImageFrame : public nsLeafFrame { -public: - ImageFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_METHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); - - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor); - -protected: - virtual ~ImageFrame(); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize); - - nsIImage* GetImage(nsIPresContext& aPresContext); - - nsIImageMap* GetImageMap(); - - void TriggerLink(nsIPresContext& aPresContext, - const nsString& aURLSpec, - const nsString& aTargetSpec); -}; - -class ImagePart : public nsHTMLTagContent { -public: - ImagePart(nsIAtom* aTag); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - virtual void UnsetAttribute(nsIAtom* aAttribute); - - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - - PRPackedBool mIsMap; - PRUint8 mSuppress; - PRUint8 mAlign; - nsString* mAltText; - nsString* mSrc; - nsString* mLowSrc; - nsString* mUseMap; - -protected: - virtual ~ImagePart(); - - virtual nsContentAttr AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const; -}; - -// Value's for mSuppress -#define SUPPRESS_UNSET 0 -#define DONT_SUPPRESS 1 -#define SUPPRESS 2 -#define DEFAULT_SUPPRESS 3 - -// Default alignment value (so we can tell an unset value from a set value) -#define ALIGN_UNSET PRUint8(-1) - -//---------------------------------------------------------------------- - -ImageFrame::ImageFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsLeafFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -ImageFrame::~ImageFrame() -{ -} - -nsIImage* ImageFrame::GetImage(nsIPresContext& aPresContext) -{ - nsAutoString src; - if (eContentAttr_HasValue == mContent->GetAttribute("SRC", src)) { - return aPresContext.LoadImage(src, this); - } - return nsnull; -} - -NS_METHOD ImageFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsIImage* image = GetImage(aPresContext); - if (nsnull == image) { - return NS_OK; - } - - // First paint background and borders - nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect); - - // Now render the image into our inner area (the area without the - // borders and padding) - nsRect inner; - GetInnerArea(&aPresContext, inner); - aRenderingContext.DrawImage(image, inner); - - if (GetShowFrameBorders()) { - nsIImageMap* map = GetImageMap(); - if (nsnull != map) { - aRenderingContext.SetColor(NS_RGB(0, 0, 0)); - map->Draw(aPresContext, aRenderingContext); - } - } - - return NS_OK; -} - -nsIImageMap* ImageFrame::GetImageMap() -{ - ImagePart* part = (ImagePart*)mContent; - if (nsnull == part->mUseMap) { - return nsnull; - } - - nsIDocument* doc = mContent->GetDocument(); - if (nsnull == doc) { - return nsnull; - } - - nsAutoString mapName(*part->mUseMap); - if (mapName.First() == '#') { - mapName.Cut(0, 1); - } - nsIHTMLDocument* hdoc; - nsresult rv = doc->QueryInterface(kIHTMLDocumentIID, (void**)&hdoc); - NS_RELEASE(doc); - if (NS_OK == rv) { - nsIImageMap* map; - rv = hdoc->GetImageMap(mapName, &map); - NS_RELEASE(hdoc); - if (NS_OK == rv) { - return map; - } - } - - return nsnull; -} - -void ImageFrame::TriggerLink(nsIPresContext& aPresContext, - const nsString& aURLSpec, - const nsString& aTargetSpec) -{ - nsILinkHandler* handler; - if (NS_OK == aPresContext.GetLinkHandler(&handler)) { - // Now pass on absolute url to the click handler - handler->OnLinkClick(this, aURLSpec, aTargetSpec); - } -} - -// XXX what about transparent pixels? -NS_METHOD ImageFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ - aEventStatus = nsEventStatus_eIgnore; - - switch (aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_UP: - { - nsIImageMap* map = GetImageMap(); - if (nsnull != map) { - nsIURL* docURL = nsnull; - nsIDocument* doc = mContent->GetDocument(); - if (nsnull != doc) { - docURL = doc->GetDocumentURL(); - NS_RELEASE(doc); - } - - // Translate coordinates to pixels - float t2p = aPresContext.GetTwipsToPixels(); - nscoord x = nscoord(t2p * aEvent->point.x); - nscoord y = nscoord(t2p * aEvent->point.y); - - // Ask map if the x,y coordinates are in a clickable area - PRBool suppress; - nsAutoString absURL, target, altText; - nsresult r = map->IsInside(x, y, docURL, absURL, target, altText, - &suppress); - NS_IF_RELEASE(docURL); - NS_RELEASE(map); - if (NS_OK == r) { - // We hit a clickable area. Time to go somewhere... - TriggerLink(aPresContext, absURL, target); - aEventStatus = nsEventStatus_eConsumeNoDefault; - } - break; - } - } - // FALL THROUGH - - default: - // Let default event handler deal with it - return nsLeafFrame::HandleEvent(aPresContext, aEvent, aEventStatus); - } - - return NS_OK; -} - -NS_METHOD ImageFrame::GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) -{ - // The default cursor is to have no cursor - aCursor = NS_STYLE_CURSOR_INHERIT; - - nsStyleColor* styleColor = (nsStyleColor*) - mStyleContext->GetData(kStyleColorSID); - if (styleColor->mCursor != NS_STYLE_CURSOR_INHERIT) { - // If we have a particular cursor, use it - *aFrame = this; - aCursor = (PRInt32) styleColor->mCursor; - } - - nsIImageMap* map = GetImageMap(); - if (nsnull != map) { - aCursor = NS_STYLE_CURSOR_DEFAULT; - float t2p = aPresContext.GetTwipsToPixels(); - nscoord x = nscoord(t2p * aPoint.x); - nscoord y = nscoord(t2p * aPoint.y); - if (NS_OK == map->IsInside(x, y)) { - aCursor = NS_STYLE_CURSOR_HAND; - } - NS_RELEASE(map); - } - - return NS_OK; -} - -void ImageFrame::GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) -{ - // XXX temporary hack: Get width & height from attributes - nscoord width = -1; - nscoord height = -1; - ImagePart* part = (ImagePart*) mContent; - nsHTMLValue value; - nsContentAttr ca; - ca = part->nsHTMLTagContent::GetAttribute(nsHTMLAtoms::width, value); - if (eContentAttr_HasValue == ca) { - // XXX Percents - width = value.GetIntValue(); - } - ca = part->nsHTMLTagContent::GetAttribute(nsHTMLAtoms::height, value); - if (eContentAttr_HasValue == ca) { - // XXX Percents - height = value.GetIntValue(); - } - - float p2t = aPresContext->GetPixelsToTwips(); - if ((0 < width) && (0 < height)) { - // Use dimensions from style attributes - aDesiredSize.width = nscoord(width * p2t); - aDesiredSize.height = nscoord(height * p2t); - } else { - nsIImage* image = GetImage(*aPresContext); - if (nsnull == image) { - // XXX Here is where we trigger a resize-reflow later on; or block - // layout or whatever our policy wants to be - aDesiredSize.width = nscoord(50 * p2t); - aDesiredSize.height = nscoord(50 * p2t); - } else { - aDesiredSize.width = nscoord(image->GetWidth() * p2t); - aDesiredSize.height = nscoord(image->GetHeight() * p2t); - } - } -} - -//---------------------------------------------------------------------- - -ImagePart::ImagePart(nsIAtom* aTag) - : nsHTMLTagContent(aTag) -{ - mAlign = ALIGN_UNSET; - mSuppress = SUPPRESS_UNSET; -} - -ImagePart::~ImagePart() -{ - if (nsnull != mAltText) delete mAltText; - if (nsnull != mSrc) delete mSrc; - if (nsnull != mLowSrc) delete mLowSrc; - if (nsnull != mUseMap) delete mUseMap; -} - -void ImagePart::SetAttribute(nsIAtom* aAttribute, const nsString& aString) -{ - if (aAttribute == nsHTMLAtoms::ismap) { - mIsMap = PR_TRUE; - return; - } - if (aAttribute == nsHTMLAtoms::usemap) { - nsAutoString src(aString); - src.StripWhitespace(); - if (nsnull == mUseMap) { - mUseMap = new nsString(src); - } else { - *mUseMap = src; - } - return; - } - if (aAttribute == nsHTMLAtoms::align) { - nsHTMLValue val; - if (ParseAlignParam(aString, val)) { - mAlign = val.GetIntValue(); - // Reflect the attribute into the syle system - nsHTMLTagContent::SetAttribute(aAttribute, val); - } else { - mAlign = ALIGN_UNSET; - } - return; - } - if (aAttribute == nsHTMLAtoms::src) { - nsAutoString src(aString); - src.StripWhitespace(); - if (nsnull == mSrc) { - mSrc = new nsString(src); - } else { - *mSrc = src; - } - return; - } - if (aAttribute == nsHTMLAtoms::lowsrc) { - nsAutoString src(aString); - src.StripWhitespace(); - if (nsnull == mLowSrc) { - mLowSrc = new nsString(src); - } else { - *mLowSrc = src; - } - return; - } - if (aAttribute == nsHTMLAtoms::alt) { - if (nsnull == mAltText) { - mAltText = new nsString(aString); - } else { - *mAltText = aString; - } - return; - } - if (aAttribute == nsHTMLAtoms::suppress) { - if (aString.EqualsIgnoreCase("true")) { - mSuppress = SUPPRESS; - } else if (aString.EqualsIgnoreCase("false")) { - mSuppress = DONT_SUPPRESS; - } else { - mSuppress = DEFAULT_SUPPRESS; - } - return; - } - - // Try other attributes - nsHTMLValue val; - if (ParseImageProperty(aAttribute, aString, val)) { - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - - // Use default attribute catching code - nsHTMLTagContent::SetAttribute(aAttribute, aString); -} - -nsContentAttr ImagePart::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - nsContentAttr ca = eContentAttr_NotThere; - aResult.Reset(); - if (aAttribute == nsHTMLAtoms::ismap) { - if (mIsMap) { - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::usemap) { - if (nsnull != mUseMap) { - aResult.Set(*mUseMap); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::align) { - if (ALIGN_UNSET != mAlign) { - aResult.Set(mAlign, eHTMLUnit_Enumerated); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::src) { - if (nsnull != mSrc) { - aResult.Set(*mSrc); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::lowsrc) { - if (nsnull != mLowSrc) { - aResult.Set(*mLowSrc); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::alt) { - if (nsnull != mAltText) { - aResult.Set(*mAltText); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::suppress) { - if (SUPPRESS_UNSET != mSuppress) { - switch (mSuppress) { - case SUPPRESS: aResult.Set(1, eHTMLUnit_Absolute); break; - case DONT_SUPPRESS: aResult.Set(0, eHTMLUnit_Absolute); break; - case DEFAULT_SUPPRESS: aResult.Reset(); break; - } - ca = eContentAttr_HasValue; - } - } - else { - ca = nsHTMLTagContent::GetAttribute(aAttribute, aResult); - } - return ca; -} - -void ImagePart::UnsetAttribute(nsIAtom* aAttribute) -{ - nsContentAttr ca = eContentAttr_NotThere; - if (aAttribute == nsHTMLAtoms::ismap) { - mIsMap = PR_FALSE; - } - else if (aAttribute == nsHTMLAtoms::usemap) { - if (nsnull != mUseMap) { - delete mUseMap; - mUseMap = nsnull; - } - } - else if (aAttribute == nsHTMLAtoms::align) { - mAlign = ALIGN_UNSET; - } - else if (aAttribute == nsHTMLAtoms::src) { - if (nsnull != mSrc) { - delete mSrc; - mSrc = nsnull; - } - } - else if (aAttribute == nsHTMLAtoms::lowsrc) { - if (nsnull != mLowSrc) { - delete mLowSrc; - mSrc = nsnull; - } - } - else if (aAttribute == nsHTMLAtoms::alt) { - if (nsnull != mAltText) { - delete mAltText; - mAltText = nsnull; - } - } - else if (aAttribute == nsHTMLAtoms::suppress) { - mSuppress = SUPPRESS_UNSET; - } - else { - nsHTMLTagContent::UnsetAttribute(aAttribute); - } -} - -nsContentAttr ImagePart::AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const -{ - nsContentAttr ca = eContentAttr_NotThere; - if (aAttribute == nsHTMLAtoms::align) { - if ((eHTMLUnit_Enumerated == aValue.GetUnit()) && - (ALIGN_UNSET != aValue.GetIntValue())) { - AlignParamToString(aValue, aResult); - ca = eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::suppress) { - if (SUPPRESS_UNSET != mSuppress) { - aResult.SetLength(0); - switch (mSuppress) { - case SUPPRESS: aResult.Append("true"); break; - case DONT_SUPPRESS: aResult.Append("false"); break; - case DEFAULT_SUPPRESS: break; - } - ca = eContentAttr_HasValue; - } - } - else if (ImagePropertyToString(aAttribute, aValue, aResult)) { - ca = eContentAttr_HasValue; - } - return ca; -} - -void ImagePart::MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ - if (ALIGN_UNSET != mAlign) { - nsStyleDisplay* display = (nsStyleDisplay*) - aContext->GetData(kStyleDisplaySID); - nsStyleText* text = (nsStyleText*) - aContext->GetData(kStyleTextSID); - switch (mAlign) { - case NS_STYLE_TEXT_ALIGN_LEFT: - display->mFloats = NS_STYLE_FLOAT_LEFT; - break; - case NS_STYLE_TEXT_ALIGN_RIGHT: - display->mFloats = NS_STYLE_FLOAT_RIGHT; - break; - default: - text->mVerticalAlign.Set(mAlign, eStyleUnit_Enumerated); - break; - } - } -} - -nsIFrame* ImagePart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - ImageFrame* rv = new ImageFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -nsresult -NS_NewHTMLImage(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* img = new ImagePart(aTag); - if (nsnull == img) { - return NS_ERROR_OUT_OF_MEMORY; - } - return img->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsHTMLParts.h b/mozilla/layout/html/base/src/nsHTMLParts.h deleted file mode 100644 index 4004a300b13..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLParts.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLParts_h___ -#define nsHTMLParts_h___ - -#include "nscore.h" -#include "nsISupports.h" -class nsIArena; -class nsIAtom; -class nsIContent; -class nsIDocument; -class nsIHTMLContent; -class nsIHTMLContentSink; -class nsITextContent; -class nsIURL; -class nsString; - -// XXX naming consistency puhleeze! - -extern nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult, - nsIDocument* aDoc, - nsIURL* aURL); - -// Create an html root part -extern nsresult - NS_NewRootPart(nsIHTMLContent** aInstancePtrResult, - nsIDocument* aDocument); - -// Create an html body part -extern nsresult - NS_NewBodyPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -// Create a new generic html container (e.g. P, DIV, SPAN, B, I, etc). -// Not used for tables or framesets (see below). -extern nsresult - NS_NewHTMLContainer(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); -extern nsresult - NS_NewHTMLContainer(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, nsIAtom* aTag); - -extern nsresult - NS_NewHTMLBreak(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag); - -extern nsresult - NS_NewHTMLWordBreak(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag); - -extern nsresult - NS_NewHTMLSpacer(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag); - -// Create a new text content object. The memory for the unicode string -// will be allocated from the heap. The object returned will support -// the nsIHTMLContent interface as well as the nsITextContent -// interface -extern nsresult - NS_NewHTMLText(nsIHTMLContent** aInstancePtrResult, - const PRUnichar* us, PRInt32 uslen = 0); -extern nsresult - NS_NewHTMLText(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, const PRUnichar* us, PRInt32 uslen = 0); - -// Create a new text content object. The memory for the unicode string -// is allocated by the caller. The caller is responsible for -// deallocating the memory (e.g. use an nsIArena). The object returned -// will support the nsIHTMLContent interface as well as the -// nsITextContent interface -extern nsresult - NS_NewSharedHTMLText(nsIHTMLContent** aInstancePtrResult, - PRUnichar* us, PRInt32 uslen = 0); -extern nsresult - NS_NewSharedHTMLText(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, PRUnichar* us, PRInt32 uslen = 0); - -/** Create a new horizontal rule content object (e.g
    .) */ -extern nsresult -NS_NewHRulePart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table content object */ -extern nsresult -NS_NewTablePart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table row group object */ -extern nsresult -NS_NewTableRowGroupPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table row content object */ -extern nsresult -NS_NewTableRowPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table column group content object */ -extern nsresult -NS_NewTableColGroupPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table column content object */ -extern nsresult -NS_NewTableColPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table cell content object - - - - - - - - diff --git a/mozilla/parser/htmlparser/tests/html/list002.html b/mozilla/parser/htmlparser/tests/html/list002.html deleted file mode 100644 index f5c31fb4079..00000000000 --- a/mozilla/parser/htmlparser/tests/html/list002.html +++ /dev/null @@ -1,15 +0,0 @@ - -Welcome to Hewlett-Packard - - - -This file was created on 9/16/97 for bug #85117, assert in parser -when closing dd tag. - - -abcd efg - - - - - diff --git a/mozilla/parser/htmlparser/tests/html/list003.html b/mozilla/parser/htmlparser/tests/html/list003.html deleted file mode 100644 index c47e5ab5094..00000000000 --- a/mozilla/parser/htmlparser/tests/html/list003.html +++ /dev/null @@ -1,19 +0,0 @@ - - - -text line 1 - -Text after font color=red -
      -
    • first list item -

      still in list item. -

    • . second list item. - ... -
    - -Text after list, still in font color=red -
    -Text after font color=red. -text at tend. - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/newlines.html b/mozilla/parser/htmlparser/tests/html/newlines.html deleted file mode 100644 index a949cc70e90..00000000000 --- a/mozilla/parser/htmlparser/tests/html/newlines.html +++ /dev/null @@ -1,3 +0,0 @@ -#1: This is a line of input terminated by a \n -#2: This is another line of input terminated by a \r\n -#3: This is a line of input terminated by a \r #4: This is the last line diff --git a/mozilla/parser/htmlparser/tests/html/obj001.html b/mozilla/parser/htmlparser/tests/html/obj001.html deleted file mode 100644 index 823b1939d43..00000000000 --- a/mozilla/parser/htmlparser/tests/html/obj001.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - Java applet that plays a welcoming sound. - - - diff --git a/mozilla/parser/htmlparser/tests/html/obj002.html b/mozilla/parser/htmlparser/tests/html/obj002.html deleted file mode 100644 index b0805ba8eae..00000000000 --- a/mozilla/parser/htmlparser/tests/html/obj002.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/mozilla/parser/htmlparser/tests/html/obj003.html b/mozilla/parser/htmlparser/tests/html/obj003.html deleted file mode 100644 index e7cb0f03ee2..00000000000 --- a/mozilla/parser/htmlparser/tests/html/obj003.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - object element with no attributes. - object element with lang attribute set to en. - object element with dir attribute set to ltr. - - param element with no attributes:
    - -
    - - param element with the name attribute and an end tag:
    - -
    - - diff --git a/mozilla/parser/htmlparser/tests/html/param001.html b/mozilla/parser/htmlparser/tests/html/param001.html deleted file mode 100644 index 5085d70b008..00000000000 --- a/mozilla/parser/htmlparser/tests/html/param001.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - param element with no attributes:
    - -
    - - diff --git a/mozilla/parser/htmlparser/tests/html/param002.html b/mozilla/parser/htmlparser/tests/html/param002.html deleted file mode 100644 index 84658e60664..00000000000 --- a/mozilla/parser/htmlparser/tests/html/param002.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - test case for Object and Param tags. - - param element with - the name attribute, and an illeagal end tag:
    - -
    - PARAM element out side OBJECT, ignored. - - - diff --git a/mozilla/parser/htmlparser/tests/html/pre001.html b/mozilla/parser/htmlparser/tests/html/pre001.html deleted file mode 100644 index a64eef6fe27..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre001.html +++ /dev/null @@ -1,9 +0,0 @@ - - -Hi -
    -  text line in    pre    tag.
    -
    -There - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/pre002.html b/mozilla/parser/htmlparser/tests/html/pre002.html deleted file mode 100644 index e7bca5ab929..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre002.html +++ /dev/null @@ -1,11 +0,0 @@ - - -Only new lines in PRE block. -
    -
    -
    -
    -
    -There - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/pre003.html b/mozilla/parser/htmlparser/tests/html/pre003.html deleted file mode 100644 index e7f4647dc94..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre003.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Empty PRE block. -
    -
    -There - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/pre004.html b/mozilla/parser/htmlparser/tests/html/pre004.html deleted file mode 100644 index 360c3dce93b..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre004.html +++ /dev/null @@ -1,18 +0,0 @@ - - -Pre tag can contain many things, inclusing P tag. - -
    -First   text line in PRE block. You     can see
    -the     spaces       between words      not compressed.
    -

    - Text line after P tag. - bold text and italic text. - and many more. There is a empty line at the end - of PRE block. - -

    -Text outside PRE block. - - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/pre005.html b/mozilla/parser/htmlparser/tests/html/pre005.html deleted file mode 100644 index 5568d8e2769..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre005.html +++ /dev/null @@ -1,53 +0,0 @@ - - -use a PRE tag for C or JAVA source code. -
    The lt and gt signes are problematic. - - -
    -  cc = 123;
    -  // test lt
    -  if( cc < hhh ) {
    -    if(cc gh) {
    -        //do womthing here;
    -    }
    -  }
    -  if( cc <= iii ) {
    -    if(cc<=yyy) {
    -    if(cc<-yyy) {
    -    if(cc<+yyy) {
    -    if(cc<3) {
    -    if(cc<33) {
    -    if(cc<_abc) {
    -        //do womthing here;
    -    }
    -  }
    -  // test gt
    -  if( cc > rrr ) {
    -    if(cc>eee) {
    -        //do womthing here;
    -    }
    -  }
    -  if( cc >= www ) {
    -    if(cc>=qqq) {
    -        //do womthing here;
    -    }
    -  }
    -  // what if the variable name is a valid tag name.
    -  if( cc < B && cc > kk ) {
    -    if(cc gg) {
    -        //do womthing here;
    -    }
    -  }
    -  cc = aa<>3;
    -  gt = true;
    -  for(a=0,gt=true; (a>0)&> a++) {
    -  }
    -  a = 0x0004;
    -  lt = 0x0002;
    -  for(; a< ) {
    -  }
    -
    - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/pre006.html b/mozilla/parser/htmlparser/tests/html/pre006.html deleted file mode 100644 index a6f0d605cab..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre006.html +++ /dev/null @@ -1,28 +0,0 @@ -Test of PRE tag - - - -
    -This      is some preformatted text.
    -
    - -

    Before PRE -

    some        preformatted text.
    -    
    - After PRE. -

    - -

    Before PRE -

    some     preformatted text.
    -        
    This     is nested preformatted (In Nav4.0, green and formatted)
    -        
    - This is still preformatted? (Not in Nav4.0) -
    - After PRE. -

    - -

    End of test

    diff --git a/mozilla/parser/htmlparser/tests/html/pre007.html b/mozilla/parser/htmlparser/tests/html/pre007.html deleted file mode 100644 index ec0698a2232..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre007.html +++ /dev/null @@ -1,12 +0,0 @@ -

    Here is a paragraph where the image that is -floated left is the first piece of content of the paragraph... -

    -
    -This is a     pre section
    -Boldis    a nice thing.
    -
    - -
    -This is      some pre text
    -la de da

    More text

    And more text - what is the vertical space look like? -

    diff --git a/mozilla/parser/htmlparser/tests/html/pre012.html b/mozilla/parser/htmlparser/tests/html/pre012.html deleted file mode 100644 index a05f2d11f15..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre012.html +++ /dev/null @@ -1,22 +0,0 @@ -The following is copied from test tag002.html
    -Broken tags are shown, only if no gt sign can be found. - - -ccccccc -Now wrapped with a PRE tag. -
    -Broken tags are shown, only if no gt sign can be found.
    -
    -
    -ccccccc
    -
    \ No newline at end of file
    diff --git a/mozilla/parser/htmlparser/tests/html/pre015.html b/mozilla/parser/htmlparser/tests/html/pre015.html
    deleted file mode 100644
    index f07de01c753..00000000000
    --- a/mozilla/parser/htmlparser/tests/html/pre015.html
    +++ /dev/null
    @@ -1,18 +0,0 @@
    -The following is copied from test tag005.html
    -first line -
    empty brakets are displayed as text -This -and this eat next br tag. -and another one. -Last text. -
    Now wrapped with a PRE tag. -
    -first line
    -
    empty brakets are displayed as text -This -and this eat next br tag. -and another one. -Last text. -
    \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/pre016.html b/mozilla/parser/htmlparser/tests/html/pre016.html deleted file mode 100644 index cfd595dce40..00000000000 --- a/mozilla/parser/htmlparser/tests/html/pre016.html +++ /dev/null @@ -1,17 +0,0 @@ -The following is copied from test tag006.html
    -first line -
    invalide tags are ignored by 4.0 -
    */ -extern nsresult -NS_NewTableCellPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -/** Create a new table caption content object
    */ -extern nsresult -NS_NewTableCaptionPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -extern nsresult -NS_NewHTMLImage(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - -#endif /* nsHTMLParts_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLTagContent.cpp b/mozilla/layout/html/base/src/nsHTMLTagContent.cpp deleted file mode 100644 index 50fdb672c56..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLTagContent.cpp +++ /dev/null @@ -1,669 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLTagContent.h" -#include "nsIDocument.h" -#include "nsIHTMLAttributes.h" -#include "nsIStyleRule.h" -#include "nsHTMLAtoms.h" -#include "nsStyleConsts.h" -#include "nsString.h" -#include "prprf.h" -#include "nsDOMAttributes.h" - -static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID); -static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID); -static NS_DEFINE_IID(kIScriptObjectOwner, NS_ISCRIPTOBJECTOWNER_IID); - -nsHTMLTagContent::nsHTMLTagContent() -{ -} - -nsHTMLTagContent::nsHTMLTagContent(nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aTag, "null ptr"); - mTag = aTag; - NS_IF_ADDREF(mTag); -} - -nsHTMLTagContent::~nsHTMLTagContent() -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mAttributes); -} - -nsresult nsHTMLTagContent::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - nsresult res = nsHTMLContent::QueryInterface(aIID, aInstancePtr); - if (NS_NOINTERFACE == res) { - if (aIID.Equals(kIDOMElementIID)) { - *aInstancePtr = (void*)(nsIDOMElement*)this; - AddRef(); - return NS_OK; - } - } - - return res; -} - -nsrefcnt nsHTMLTagContent::AddRef(void) -{ - return nsHTMLContent::AddRef(); -} - -nsrefcnt nsHTMLTagContent::Release(void) -{ - return nsHTMLContent::Release(); -} - -nsIAtom* nsHTMLTagContent::GetTag() const -{ - NS_IF_ADDREF(mTag); - return mTag; -} - -void nsHTMLTagContent::ToHTMLString(nsString& aBuf) const -{ - aBuf.SetLength(0); - aBuf.Append('<'); - - nsIAtom* tag = GetTag(); - if (nsnull != tag) { - nsAutoString tmp; - tag->ToString(tmp); - aBuf.Append(tmp); - } else { - aBuf.Append("?NULL"); - } - aBuf.Append('>'); -} - -void nsHTMLTagContent::SetAttribute(const nsString& aName, - const nsString& aValue) -{ - nsAutoString upper; - aName.ToUpperCase(upper); - nsIAtom* attr = NS_NewAtom(upper); - SetAttribute(attr, aValue); - NS_RELEASE(attr); -} - -nsContentAttr nsHTMLTagContent::GetAttribute(const nsString& aName, - nsString& aResult) const -{ - nsAutoString upper; - aName.ToUpperCase(upper); - nsIAtom* attr = NS_NewAtom(upper); - - nsHTMLValue value; - nsContentAttr result = GetAttribute(attr, value); - - char cbuf[20]; - nscolor color; - if (eContentAttr_HasValue == result) { - // Try subclass conversion routine first - if (eContentAttr_HasValue == AttributeToString(attr, value, aResult)) { - return result; - } - - // Provide default conversions for most everything - switch (value.GetUnit()) { - case eHTMLUnit_String: - case eHTMLUnit_Null: - value.GetStringValue(aResult); - break; - - case eHTMLUnit_Absolute: - case eHTMLUnit_Pixel: - aResult.SetLength(0); - aResult.Append(value.GetIntValue(), 10); - break; - - case eHTMLUnit_Percent: - aResult.SetLength(0); - aResult.Append(PRInt32(value.GetFloatValue() * 100.0f), 10); - break; - - case eHTMLUnit_Color: - color = nscolor(value.GetColorValue()); - PR_snprintf(cbuf, sizeof(cbuf), "#%02x%02x%02x", - NS_GET_R(color), NS_GET_G(color), NS_GET_B(color)); - aResult.SetLength(0); - aResult.Append(cbuf); - break; - - case eHTMLUnit_Enumerated: - NS_NOTREACHED("no default enumerated value to string conversion"); - result = eContentAttr_NotThere; - break; - } - } - - NS_RELEASE(attr); - return result; -} - -nsContentAttr nsHTMLTagContent::AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const -{ - aResult.Truncate(); - return eContentAttr_NotThere; -} - -// XXX subclasses should override to parse the value string -void nsHTMLTagContent::SetAttribute(nsIAtom* aAttribute, - const nsString& aValue) -{ - if (nsnull == mAttributes) { - NS_NewHTMLAttributes(&mAttributes, this); - } - if (nsnull != mAttributes) { - mAttributes->SetAttribute(aAttribute, aValue); - } -} - -void nsHTMLTagContent::SetAttribute(nsIAtom* aAttribute, - const nsHTMLValue& aValue) -{ - if (nsnull == mAttributes) { - NS_NewHTMLAttributes(&mAttributes, this); - } - if (nsnull != mAttributes) { - mAttributes->SetAttribute(aAttribute, aValue); - } -} - -void nsHTMLTagContent::UnsetAttribute(nsIAtom* aAttribute) -{ - if (nsnull != mAttributes) { - PRInt32 count = mAttributes->UnsetAttribute(aAttribute); - if (0 == count) { - NS_RELEASE(mAttributes); - } - } -} - -nsContentAttr nsHTMLTagContent::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const -{ - if (nsnull != mAttributes) { - return mAttributes->GetAttribute(aAttribute, aValue); - } - aValue.Reset(); - return eContentAttr_NotThere; -} - -PRInt32 nsHTMLTagContent::GetAllAttributeNames(nsISupportsArray* aArray) const -{ - if (nsnull != mAttributes) { - return mAttributes->GetAllAttributeNames(aArray); - } - return 0; -} - -PRInt32 nsHTMLTagContent::GetAttributeCount(void) const -{ - if (nsnull != mAttributes) { - return mAttributes->Count(); - } - return 0; -} - -void nsHTMLTagContent::SetID(nsIAtom* aID) -{ - if (nsnull != aID) { - if (nsnull == mAttributes) { - NS_NewHTMLAttributes(&mAttributes, this); - } - if (nsnull != mAttributes) { - mAttributes->SetID(aID); - } - } - else { - if (nsnull != mAttributes) { - PRInt32 count = mAttributes->SetID(nsnull); - if (0 == count) { - NS_RELEASE(mAttributes); - } - } - } -} - -nsIAtom* nsHTMLTagContent::GetID(void) const -{ - if (nsnull != mAttributes) { - return mAttributes->GetID(); - } - return nsnull; -} - -void nsHTMLTagContent::SetClass(nsIAtom* aClass) -{ - if (nsnull != aClass) { - if (nsnull == mAttributes) { - NS_NewHTMLAttributes(&mAttributes, this); - } - if (nsnull != mAttributes) { - mAttributes->SetClass(aClass); - } - } - else { - if (nsnull != mAttributes) { - PRInt32 count = mAttributes->SetClass(nsnull); - if (0 == count) { - NS_RELEASE(mAttributes); - } - } - } -} - -nsIAtom* nsHTMLTagContent::GetClass(void) const -{ - if (nsnull != mAttributes) { - return mAttributes->GetClass(); - } - return nsnull; -} - - -nsIStyleRule* nsHTMLTagContent::GetStyleRule(void) -{ - nsIStyleRule* result = nsnull; - - if (nsnull != mAttributes) { - mAttributes->QueryInterface(kIStyleRuleIID, (void**)&result); - } - return result; -} - -nsresult nsHTMLTagContent::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - nsresult res = NS_OK; - if (nsnull == mScriptObject) { - *aScriptObject = nsnull; - if (nsnull != mParent) { - nsIScriptObjectOwner *parent; - if (NS_OK == mParent->QueryInterface(kIScriptObjectOwner, (void**)&parent)) { - parent->GetScriptObject(aContext, aScriptObject); - NS_RELEASE(parent); - } - } - res = NS_NewScriptElement(aContext, this, (JSObject*)*aScriptObject, (JSObject**)&mScriptObject); - } - *aScriptObject = mScriptObject; - return res; -} - -nsresult nsHTMLTagContent::GetNodeType(PRInt32 *aType) -{ - *aType = nsHTMLContent::ELEMENT; - return NS_OK; -} - -nsresult nsHTMLTagContent::GetParentNode(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetParentNode(aNode); -} - -nsresult nsHTMLTagContent::GetChildNodes(nsIDOMNodeIterator **aIterator) -{ - return nsHTMLContent::GetChildNodes(aIterator); -} - -nsresult nsHTMLTagContent::HasChildNodes() -{ - return nsHTMLContent::HasChildNodes(); -} - -nsresult nsHTMLTagContent::GetFirstChild(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetFirstChild(aNode); -} - -nsresult nsHTMLTagContent::GetPreviousSibling(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetPreviousSibling(aNode); -} - -nsresult nsHTMLTagContent::GetNextSibling(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetNextSibling(aNode); -} - -nsresult nsHTMLTagContent::InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild) -{ - return nsHTMLContent::InsertBefore(newChild, refChild); -} - -nsresult nsHTMLTagContent::ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild) -{ - return nsHTMLContent::ReplaceChild(newChild, oldChild); -} - -nsresult nsHTMLTagContent::RemoveChild(nsIDOMNode *oldChild) -{ - return nsHTMLContent::RemoveChild(oldChild); -} - -nsresult nsHTMLTagContent::GetTagName(nsString &aName) -{ - NS_ASSERTION(nsnull != mTag, "no tag"); - mTag->ToString(aName); - return NS_OK; -} - -nsresult nsHTMLTagContent::GetAttributes(nsIDOMAttributeList **aAttributeList) -{ - NS_PRECONDITION(nsnull != aAttributeList, "null pointer argument"); - if (nsnull != mAttributes) { - *aAttributeList = new nsDOMAttributeList(*this); - return NS_OK; - } - - return NS_ERROR_FAILURE; -} - -nsresult nsHTMLTagContent::GetDOMAttribute(nsString &aName, nsString &aValue) -{ - GetAttribute(aName, aValue); - return NS_OK; -} - -nsresult nsHTMLTagContent::SetDOMAttribute(nsString &aName, nsString &aValue) -{ - SetAttribute(aName, aValue); - return NS_OK; -} - -nsresult nsHTMLTagContent::RemoveAttribute(nsString &aName) -{ - nsAutoString upper; - aName.ToUpperCase(upper); - nsIAtom* attr = NS_NewAtom(upper); - UnsetAttribute(attr); - return NS_OK; -} - -nsresult nsHTMLTagContent::GetAttributeNode(nsString &aName, nsIDOMAttribute **aAttribute) -{ - nsAutoString value; - if(eContentAttr_NotThere != GetAttribute(aName, value)) { - *aAttribute = new nsDOMAttribute(aName, value); - } - - return NS_OK; -} - -nsresult nsHTMLTagContent::SetAttributeNode(nsIDOMAttribute *aAttribute) -{ - NS_PRECONDITION(nsnull != aAttribute, "null attribute"); - - nsresult res = NS_ERROR_FAILURE; - - if (nsnull != aAttribute) { - nsString name, value; - res = aAttribute->GetName(name); - if (NS_OK == res) { - res = aAttribute->GetValue(value); - if (NS_OK == res) { - SetAttribute(name, value); - } - } - } - - return res; -} - -nsresult nsHTMLTagContent::RemoveAttributeNode(nsIDOMAttribute *aAttribute) -{ - NS_PRECONDITION(nsnull != aAttribute, "null attribute"); - - nsresult res = NS_ERROR_FAILURE; - - if (nsnull != aAttribute) { - nsAutoString name; - res = aAttribute->GetName(name); - if (NS_OK == res) { - nsAutoString upper; - name.ToUpperCase(upper); - nsIAtom* attr = NS_NewAtom(upper); - UnsetAttribute(attr); - } - } - - return res; -} - -nsresult nsHTMLTagContent::Normalize() -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult nsHTMLTagContent::GetElementsByTagName(nsString &aName,nsIDOMNodeIterator **aIterator) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - -//---------------------------------------------------------------------- - -// Attribute parsing utility methods - -PRBool nsHTMLTagContent::ParseEnumValue(const nsString& aValue, - EnumTable* aTable, - nsHTMLValue& aResult) -{ - while (nsnull != aTable->tag) { - if (aValue.EqualsIgnoreCase(aTable->tag)) { - aResult.Set(aTable->value, eHTMLUnit_Enumerated); - return PR_TRUE; - } - aTable++; - } - return PR_FALSE; -} - -PRBool nsHTMLTagContent::EnumValueToString(const nsHTMLValue& aValue, - EnumTable* aTable, - nsString& aResult) -{ - aResult.SetLength(0); - if (aValue.GetUnit() == eHTMLUnit_Enumerated) { - PRInt32 v = aValue.GetIntValue(); - while (nsnull != aTable->tag) { - if (aTable->value == v) { - aResult.Append(aTable->tag); - return PR_TRUE; - } - aTable++; - } - } - return PR_FALSE; -} - -// XXX check all mappings against ebina's usage -static nsHTMLTagContent::EnumTable kAlignTable[] = { - { "left", NS_STYLE_TEXT_ALIGN_LEFT }, - { "right", NS_STYLE_TEXT_ALIGN_RIGHT }, - { "texttop", NS_STYLE_VERTICAL_ALIGN_TEXT_TOP }, - { "baseline", NS_STYLE_VERTICAL_ALIGN_BASELINE }, - { "center", NS_STYLE_TEXT_ALIGN_CENTER }, - { "bottom", NS_STYLE_VERTICAL_ALIGN_BOTTOM }, - { "top", NS_STYLE_VERTICAL_ALIGN_TOP }, - { "middle", NS_STYLE_VERTICAL_ALIGN_MIDDLE }, - { "absbottom", NS_STYLE_VERTICAL_ALIGN_BOTTOM }, - { "abscenter", NS_STYLE_VERTICAL_ALIGN_MIDDLE }, - { "absmiddle", NS_STYLE_VERTICAL_ALIGN_MIDDLE }, - { 0 } -}; - -PRBool nsHTMLTagContent::ParseAlignParam(const nsString& aString, - nsHTMLValue& aResult) -{ - return ParseEnumValue(aString, kAlignTable, aResult); -} - -PRBool nsHTMLTagContent::AlignParamToString(const nsHTMLValue& aValue, - nsString& aResult) -{ - return EnumValueToString(aValue, kAlignTable, aResult); -} - -static nsHTMLTagContent::EnumTable kDivAlignTable[] = { - { "left", NS_STYLE_TEXT_ALIGN_LEFT }, - { "right", NS_STYLE_TEXT_ALIGN_RIGHT }, - { "center", NS_STYLE_TEXT_ALIGN_CENTER }, - { "justify", NS_STYLE_TEXT_ALIGN_JUSTIFY }, - { 0 } -}; - -PRBool nsHTMLTagContent::ParseDivAlignParam(const nsString& aString, - nsHTMLValue& aResult) -{ - return ParseEnumValue(aString, kDivAlignTable, aResult); -} - -PRBool nsHTMLTagContent::DivAlignParamToString(const nsHTMLValue& aValue, - nsString& aResult) -{ - return EnumValueToString(aValue, kDivAlignTable, aResult); -} - -void nsHTMLTagContent::ParseValueOrPercent(const nsString& aString, - nsHTMLValue& aResult) -{ - nsAutoString tmp(aString); - tmp.CompressWhitespace(PR_TRUE, PR_TRUE); - PRInt32 ec, val = tmp.ToInteger(&ec); - if (tmp.Last() == '%') {/* XXX not 100% compatible with ebina's code */ - if (val < 0) val = 0; - if (val > 100) val = 100; - aResult.Set(float(val)/100.0f, eHTMLUnit_Percent); - } else { - aResult.Set(val, eHTMLUnit_Absolute); - } -} - -PRBool nsHTMLTagContent::ValueOrPercentToString(const nsHTMLValue& aValue, - nsString& aResult) -{ - aResult.SetLength(0); - switch (aValue.GetUnit()) { - case eHTMLUnit_Absolute: - aResult.Append(aValue.GetIntValue(), 10); - return PR_TRUE; - case eHTMLUnit_Percent: - aResult.Append(PRInt32(aValue.GetFloatValue() * 100.0f), 10); - aResult.Append('%'); - return PR_TRUE; - } - return PR_FALSE; -} - -void nsHTMLTagContent::ParseValue(const nsString& aString, PRInt32 aMin, - nsHTMLValue& aResult) -{ - PRInt32 ec, val = aString.ToInteger(&ec); - if (val < aMin) val = aMin; - aResult.Set(val, eHTMLUnit_Absolute); -} - -void nsHTMLTagContent::ParseValue(const nsString& aString, PRInt32 aMin, - PRInt32 aMax, - nsHTMLValue& aResult) -{ - PRInt32 ec, val = aString.ToInteger(&ec); - if (val < aMin) val = aMin; - if (val > aMax) val = aMax; - aResult.Set(val, eHTMLUnit_Absolute); -} - -PRBool nsHTMLTagContent::ParseImageProperty(nsIAtom* aAttribute, - const nsString& aString, - nsHTMLValue& aResult) -{ - if ((aAttribute == nsHTMLAtoms::width) || - (aAttribute == nsHTMLAtoms::height)) { - ParseValueOrPercent(aString, aResult); - return PR_TRUE; - } else if ((aAttribute == nsHTMLAtoms::border) || - (aAttribute == nsHTMLAtoms::hspace) || - (aAttribute == nsHTMLAtoms::vspace)) { - ParseValue(aString, 0, aResult); - return PR_TRUE; - } - return PR_FALSE; -} - -PRBool nsHTMLTagContent::ImagePropertyToString(nsIAtom* aAttribute, - const nsHTMLValue& aValue, - nsString& aResult) -{ - if ((aAttribute == nsHTMLAtoms::width) || - (aAttribute == nsHTMLAtoms::height) || - (aAttribute == nsHTMLAtoms::border) || - (aAttribute == nsHTMLAtoms::hspace) || - (aAttribute == nsHTMLAtoms::vspace)) { - return ValueOrPercentToString(aValue, aResult); - } - return PR_FALSE; -} - -PRBool nsHTMLTagContent::ParseColor(const nsString& aString, - nsHTMLValue& aResult) -{ - char cbuf[40]; - aString.ToCString(cbuf, sizeof(cbuf)); - if (aString.Length() > 0) { - nscolor color; - if (cbuf[0] == '#') { - if (NS_HexToRGB(cbuf, &color)) { - aResult.Set(color); - return PR_TRUE; - } - } else { - if (NS_ColorNameToRGB(cbuf, &color)) { - aResult.Set(aString); - return PR_TRUE; - } - } - } - - // Illegal values are mapped to 0 - aResult.Set(0, eHTMLUnit_Absolute); - return PR_FALSE; -} - -PRBool nsHTMLTagContent::ColorToString(const nsHTMLValue& aValue, - nsString& aResult) -{ - if (aValue.GetUnit() == eHTMLUnit_Absolute) { - nscolor v = (nscolor) aValue.GetIntValue(); - char buf[10]; - PR_snprintf(buf, sizeof(buf), "#%02x%02x%02x", - NS_GET_R(v), NS_GET_G(v), NS_GET_B(v)); - aResult.SetLength(0); - aResult.Append(buf); - return PR_TRUE; - } - if (aValue.GetUnit() == eHTMLUnit_String) { - aValue.GetStringValue(aResult); - return PR_TRUE; - } - return PR_FALSE; -} diff --git a/mozilla/layout/html/base/src/nsHTMLTagContent.h b/mozilla/layout/html/base/src/nsHTMLTagContent.h deleted file mode 100644 index 0bc1507088d..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLTagContent.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLTagContent_h___ -#define nsHTMLTagContent_h___ - -#include "nsHTMLContent.h" -#include "nsIDOMElement.h" - -class nsIHTMLAttributes; - -/** - * Base class for tagged html content objects, holds attributes. - */ -class nsHTMLTagContent : public nsHTMLContent, public nsIDOMElement { -public: - /** - * Return nsnull if no tag set. - */ - virtual nsIAtom* GetTag() const; - - /** - * Translate the content object into it's source html format - */ - virtual void ToHTMLString(nsString& out) const; - - /** - * Generic implementation of SetAttribute that translates aName into - * an uppercase'd atom and invokes SetAttribute(atom, aValue). - */ - virtual void SetAttribute(const nsString& aName, const nsString& aValue); - - /** - * Generic implementation of GetAttribute that knows how to map - * nsHTMLValue's to string's. Note that it cannot map enumerated - * values directly, but will use AttributeToString to supply a - * conversion. Subclasses must override AttributeToString to map - * enumerates to strings and return eContentAttr_HasValue when a - * conversion is succesful. Subclasses should also override this - * method if the default string conversions used don't apply - * correctly to the given attribute. - */ - virtual nsContentAttr GetAttribute(const nsString& aName, - nsString& aResult) const; - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsHTMLValue& aValue); - virtual void UnsetAttribute(nsIAtom* aAttribute); - - /** - * Subclasses must override to fill the value object for values that - * are not stored in mAttributes. If the returned value is of an - * enumerated type then the subclass must also override the - * AttributeToString method (see the comment on the other GetAttribute - * method) - */ - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const; - - virtual PRInt32 GetAllAttributeNames(nsISupportsArray* aArray) const; - virtual PRInt32 GetAttributeCount(void) const; - - virtual void SetID(nsIAtom* aID); - virtual nsIAtom* GetID(void) const; - virtual void SetClass(nsIAtom* aClass); // XXX this will have to change for CSS2 - virtual nsIAtom* GetClass(void) const; // XXX this will have to change for CSS2 - - virtual nsIStyleRule* GetStyleRule(void); - - // nsIScriptObjectOwner interface - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - - // nsIDOMElement interface - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - virtual nsresult GetNodeType(PRInt32 *aType); - virtual nsresult GetParentNode(nsIDOMNode **aNode); - virtual nsresult GetChildNodes(nsIDOMNodeIterator **aIterator); - virtual nsresult HasChildNodes(); - virtual nsresult GetFirstChild(nsIDOMNode **aNode); - virtual nsresult GetPreviousSibling(nsIDOMNode **aNode); - virtual nsresult GetNextSibling(nsIDOMNode **aNode); - virtual nsresult InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild); - virtual nsresult ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild); - virtual nsresult RemoveChild(nsIDOMNode *oldChild); - virtual nsresult GetTagName(nsString &aName); - virtual nsresult GetAttributes(nsIDOMAttributeList **aAttributeList); - virtual nsresult GetDOMAttribute(nsString &aName, nsString &aValue); - virtual nsresult SetDOMAttribute(nsString &aName, nsString &aValue); - virtual nsresult RemoveAttribute(nsString &aName); - virtual nsresult GetAttributeNode(nsString &aName, nsIDOMAttribute **aAttribute); - virtual nsresult SetAttributeNode(nsIDOMAttribute *aAttribute); - virtual nsresult RemoveAttributeNode(nsIDOMAttribute *aAttribute); - virtual nsresult GetElementsByTagName(nsString &aName,nsIDOMNodeIterator **aIterator); - virtual nsresult Normalize(); - - // Utility routines for making attribute parsing easier - - struct EnumTable { - const char* tag; - PRInt32 value; - }; - - static PRBool ParseEnumValue(const nsString& aValue, - EnumTable* aTable, - nsHTMLValue& aResult); - - static PRBool EnumValueToString(const nsHTMLValue& aValue, - EnumTable* aTable, - nsString& aResult); - - static void ParseValueOrPercent(const nsString& aString, - nsHTMLValue& aResult); - - static PRBool ValueOrPercentToString(const nsHTMLValue& aValue, - nsString& aResult); - - static void ParseValue(const nsString& aString, PRInt32 aMin, - nsHTMLValue& aResult); - - static void ParseValue(const nsString& aString, PRInt32 aMin, PRInt32 aMax, - nsHTMLValue& aResult); - - static PRBool ParseColor(const nsString& aString, nsHTMLValue& aResult); - - static PRBool ColorToString(const nsHTMLValue& aValue, - nsString& aResult); - - /** - * Parse width, height, border, hspace, vspace. Returns PR_TRUE if - * the aAttribute is one of the listed attributes. - */ - static PRBool ParseImageProperty(nsIAtom* aAttribute, - const nsString& aString, - nsHTMLValue& aResult); - - static PRBool ImagePropertyToString(nsIAtom* aAttribute, - const nsHTMLValue& aValue, - nsString& aResult); - - static PRBool ParseAlignParam(const nsString& aString, nsHTMLValue& aResult); - - static PRBool AlignParamToString(const nsHTMLValue& aValue, - nsString& aResult); - - static PRBool ParseDivAlignParam(const nsString& aString, nsHTMLValue& aRes); - - static PRBool DivAlignParamToString(const nsHTMLValue& aValue, - nsString& aResult); - -protected: - nsHTMLTagContent(); - - nsHTMLTagContent(nsIAtom* aTag); - - virtual ~nsHTMLTagContent(); - - /** - * Helper method used by GetAttribute to map an attribute - * to a string value. - */ - virtual nsContentAttr AttributeToString(nsIAtom* aAttribute, - nsHTMLValue& aValue, - nsString& aResult) const; - - nsIAtom* mTag; - nsIHTMLAttributes* mAttributes; -}; - -#endif /* nsHTMLTagContent_h___ */ diff --git a/mozilla/layout/html/base/src/nsHTMLTagIDs.h b/mozilla/layout/html/base/src/nsHTMLTagIDs.h deleted file mode 100644 index 52645a0375c..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLTagIDs.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Do not edit - generated by genhash.pl */ -#define TAG_A 0 -#define TAG_ADDRESS 1 -#define TAG_APPLET 2 -#define TAG_AREA 3 -#define TAG_B 4 -#define TAG_BASE 5 -#define TAG_BASEFONT 6 -#define TAG_BIG 7 -#define TAG_BLINK 8 -#define TAG_BLOCKQUOTE 9 -#define TAG_BODY 10 -#define TAG_BR 11 -#define TAG_CAPTION 12 -#define TAG_CENTER 13 -#define TAG_CERTIFICATE 14 -#define TAG_CITE 15 -#define TAG_CODE 16 -#define TAG_DD 17 -#define TAG_DIR 18 -#define TAG_DIV 19 -#define TAG_DL 20 -#define TAG_DT 21 -#define TAG_EM 22 -#define TAG_EMBED 23 -#define TAG_FONT 24 -#define TAG_FORM 25 -#define TAG_FRAME 26 -#define TAG_FRAMESET 27 -#define TAG_H1 28 -#define TAG_H2 29 -#define TAG_H3 30 -#define TAG_H4 31 -#define TAG_H5 32 -#define TAG_H6 33 -#define TAG_HEAD 34 -#define TAG_HR 35 -#define TAG_HTML 36 -#define TAG_I 37 -#define TAG_IFRAME 38 -#define TAG_ILAYER 39 -#define TAG_IMG 40 -#define TAG_INPUT 41 -#define TAG_ISINDEX 42 -#define TAG_KBD 43 -#define TAG_KEYGEN 44 -#define TAG_LAYER 45 -#define TAG_LI 46 -#define TAG_LINK 47 -#define TAG_LISTING 48 -#define TAG_MAP 49 -#define TAG_MENU 50 -#define TAG_META 51 -#define TAG_MULTICOL 52 -#define TAG_NOBR 53 -#define TAG_NOEMBED 54 -#define TAG_NOFRAMES 55 -#define TAG_NOLAYER 56 -#define TAG_NOSCRIPT 57 -#define TAG_OBJECT 58 -#define TAG_OL 59 -#define TAG_OPTION 60 -#define TAG_P 61 -#define TAG_PARAM 62 -#define TAG_PLAINTEXT 63 -#define TAG_PRE 64 -#define TAG_S 65 -#define TAG_SAMP 66 -#define TAG_SCRIPT 67 -#define TAG_SELECT 68 -#define TAG_SERVER 69 -#define TAG_SMALL 70 -#define TAG_SPACER 71 -#define TAG_SPAN 72 -#define TAG_STRIKE 73 -#define TAG_STRONG 74 -#define TAG_STYLE 75 -#define TAG_SUB 76 -#define TAG_SUP 77 -#define TAG_TABLE 78 -#define TAG_TD 79 -#define TAG_TEXTAREA 80 -#define TAG_TH 81 -#define TAG_TITLE 82 -#define TAG_TR 83 -#define TAG_TT 84 -#define TAG_U 85 -#define TAG_UL 86 -#define TAG_VAR 87 -#define TAG_WBR 88 -#define TAG_XMP 89 -#define TAG_MAX 90 diff --git a/mozilla/layout/html/base/src/nsHTMLTags.cpp b/mozilla/layout/html/base/src/nsHTMLTags.cpp deleted file mode 100644 index ecf33024cd2..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLTags.cpp +++ /dev/null @@ -1,377 +0,0 @@ - -/* -** This is a generated file, do not edit it. This file is created by -** genhash.pl -*/ - -#include "plstr.h" -#include "nsHTMLTags.h" -#define TOTAL_KEYWORDS 90 -#define MIN_WORD_LENGTH 1 -#define MAX_WORD_LENGTH 11 -#define MIN_HASH_VALUE 1 -#define MAX_HASH_VALUE 264 -/* maximum key range = 264, duplicates = 0 */ - - -struct StaticNameTable { - char* tag; - PRInt32 id; -}; - -static const unsigned char kLowerLookup[256] = { - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64, - 97,98,99,100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -#define MYLOWER(x) kLowerLookup[((x) & 0x7f)] - -/** - * Map a name to an ID or -1 - */ -PRInt32 nsHTMLTags::LookupName(const char* str) -{ - static unsigned short asso_values[] = - { - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 5, - 20, 65, 70, 75, 80, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 0, 35, 100, - 40, 0, 15, 60, 30, 40, 0, 45, 10, 40, - 0, 120, 45, 265, 0, 15, 5, 85, 15, 0, - 10, 0, 265, 265, 265, 265, 265, 265, - }; - static unsigned char lengthtable[] = - { - 0, 1, 0, 0, 4, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 2, 3, 0, 5, 6, 0, 8, 0, 5, 6, 0, - 8, 0, 0, 1, 2, 0, 0, 0, 6, 2, 3, 0, 0, 0, - 2, 0, 0, 5, 0, 0, 3, 4, 0, 6, 2, 0, 4, 5, - 6, 0, 0, 0, 0, 6, 2, 8, 4, 0, 6, 2, 0, 9, - 5, 1, 2, 0, 4, 0, 0, 0, 0, 0, 0, 1, 2, 3, - 0, 0, 6, 2, 0, 4, 5, 1, 2, 0, 0, 5, 0, 0, - 0, 4, 0, 6, 7, 0, 4, 0, 6, 2, 0, 0, 0, 11, - 7, 3, 0, 0, 0, 0, 0, 0, 5, 0, 2, 0, 0, 0, - 6, 0, 0, 4, 0, 0, 7, 3, 0, 5, 0, 7, 0, 0, - 0, 0, 2, 3, 4, 0, 0, 0, 8, 4, 0, 0, 7, 8, - 0, 0, 0, 0, 8, 4, 0, 0, 2, 3, 0, 0, 6, 7, - 0, 0, 0, 1, 2, 3, 0, 10, 6, 0, 0, 4, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, - 0, 0, 3, 4, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, - }; - static struct StaticNameTable wordlist[] = - { - {"",}, - {"a", 0}, - {"",}, {"",}, - {"area", 3}, - {"",}, {"",}, - {"tr", 83}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"layer", 45}, - {"",}, - {"tt", 84}, - {"var", 87}, - {"",}, - {"frame", 26}, - {"server", 69}, - {"",}, - {"textarea", 80}, - {"",}, - {"style", 75}, - {"strike", 73}, - {"",}, - {"frameset", 27}, - {"",}, {"",}, - {"s", 65}, - {"hr", 35}, - {"",}, {"",}, {"",}, - {"select", 68}, - {"br", 11}, - {"wbr", 88}, - {"",}, {"",}, {"",}, - {"h1", 28}, - {"",}, {"",}, - {"table", 78}, - {"",}, {"",}, - {"pre", 64}, - {"meta", 51}, - {"",}, - {"keygen", 44}, - {"dt", 21}, - {"",}, - {"base", 5}, - {"title", 82}, - {"ilayer", 39}, - {"",}, {"",}, {"",}, {"",}, - {"iframe", 38}, - {"dl", 20}, - {"basefont", 6}, - {"span", 72}, - {"",}, - {"spacer", 71}, - {"th", 81}, - {"",}, - {"plaintext", 63}, - {"small", 70}, - {"b", 4}, - {"h2", 29}, - {"",}, - {"head", 34}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"i", 37}, - {"em", 22}, - {"dir", 18}, - {"",}, {"",}, - {"strong", 74}, - {"td", 79}, - {"",}, - {"html", 36}, - {"param", 62}, - {"p", 61}, - {"li", 46}, - {"",}, {"",}, - {"input", 41}, - {"",}, {"",}, {"",}, - {"link", 47}, - {"",}, - {"applet", 2}, - {"address", 1}, - {"",}, - {"samp", 66}, - {"",}, - {"center", 13}, - {"ul", 86}, - {"",}, {"",}, {"",}, - {"certificate", 14}, - {"isindex", 42}, - {"div", 19}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"embed", 23}, - {"",}, - {"dd", 17}, - {"",}, {"",}, {"",}, - {"script", 67}, - {"",}, {"",}, - {"menu", 50}, - {"",}, {"",}, - {"listing", 48}, - {"map", 49}, - {"",}, - {"blink", 8}, - {"",}, - {"nolayer", 56}, - {"",}, {"",}, {"",}, {"",}, - {"ol", 59}, - {"xmp", 89}, - {"font", 24}, - {"",}, {"",}, {"",}, - {"noscript", 57}, - {"cite", 15}, - {"",}, {"",}, - {"caption", 12}, - {"multicol", 52}, - {"",}, {"",}, {"",}, {"",}, - {"noframes", 55}, - {"nobr", 53}, - {"",}, {"",}, - {"h3", 30}, - {"kbd", 43}, - {"",}, {"",}, - {"object", 58}, - {"noembed", 54}, - {"",}, {"",}, {"",}, - {"u", 85}, - {"h4", 31}, - {"sub", 76}, - {"",}, - {"blockquote", 9}, - {"option", 60}, - {"",}, {"",}, - {"form", 25}, - {"",}, {"",}, - {"h5", 32}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"h6", 33}, - {"sup", 77}, - {"",}, {"",}, {"",}, {"",}, - {"big", 7}, - {"body", 10}, - {"",}, {"",}, {"",}, - {"img", 40}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"code", 16}, - }; - - if (str != NULL) { - int len = PL_strlen(str); - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int hval = len; - - switch (hval) - { - default: - case 3: - hval += asso_values[MYLOWER(str[2])]; - case 2: - hval += asso_values[MYLOWER(str[1])]; - case 1: - hval += asso_values[MYLOWER(str[0])]; - break; - } - hval += asso_values[MYLOWER(str[len - 1])]; - if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) { - if (len == lengthtable[hval]) { - register const char *tag = wordlist[hval].tag; - - /* - ** While not at the end of the string, if they ever differ - ** they are not equal. We know "tag" is already lower case. - */ - while ((*tag != '\0')&&(*str != '\0')) { - if (*tag != (char) MYLOWER(*str)) { - return -1; - } - tag++; - str++; - } - - /* - ** One of the strings has ended, if they are both ended, then they - ** are equal, otherwise not. - */ - if ((*tag == '\0')&&(*str == '\0')) { - return wordlist[hval].id; - } - } - } - } - } - return -1; -} - -const nsHTMLTags::NameTableEntry nsHTMLTags::kNameTable[] = { - { "a", 0 }, - { "address", 1 }, - { "applet", 2 }, - { "area", 3 }, - { "b", 4 }, - { "base", 5 }, - { "basefont", 6 }, - { "big", 7 }, - { "blink", 8 }, - { "blockquote", 9 }, - { "body", 10 }, - { "br", 11 }, - { "caption", 12 }, - { "center", 13 }, - { "certificate", 14 }, - { "cite", 15 }, - { "code", 16 }, - { "dd", 17 }, - { "dir", 18 }, - { "div", 19 }, - { "dl", 20 }, - { "dt", 21 }, - { "em", 22 }, - { "embed", 23 }, - { "font", 24 }, - { "form", 25 }, - { "frame", 26 }, - { "frameset", 27 }, - { "h1", 28 }, - { "h2", 29 }, - { "h3", 30 }, - { "h4", 31 }, - { "h5", 32 }, - { "h6", 33 }, - { "head", 34 }, - { "hr", 35 }, - { "html", 36 }, - { "i", 37 }, - { "iframe", 38 }, - { "ilayer", 39 }, - { "img", 40 }, - { "input", 41 }, - { "isindex", 42 }, - { "kbd", 43 }, - { "keygen", 44 }, - { "layer", 45 }, - { "li", 46 }, - { "link", 47 }, - { "listing", 48 }, - { "map", 49 }, - { "menu", 50 }, - { "meta", 51 }, - { "multicol", 52 }, - { "nobr", 53 }, - { "noembed", 54 }, - { "noframes", 55 }, - { "nolayer", 56 }, - { "noscript", 57 }, - { "object", 58 }, - { "ol", 59 }, - { "option", 60 }, - { "p", 61 }, - { "param", 62 }, - { "plaintext", 63 }, - { "pre", 64 }, - { "s", 65 }, - { "samp", 66 }, - { "script", 67 }, - { "select", 68 }, - { "server", 69 }, - { "small", 70 }, - { "spacer", 71 }, - { "span", 72 }, - { "strike", 73 }, - { "strong", 74 }, - { "style", 75 }, - { "sub", 76 }, - { "sup", 77 }, - { "table", 78 }, - { "td", 79 }, - { "textarea", 80 }, - { "th", 81 }, - { "title", 82 }, - { "tr", 83 }, - { "tt", 84 }, - { "u", 85 }, - { "ul", 86 }, - { "var", 87 }, - { "wbr", 88 }, - { "xmp", 89 }, -}; diff --git a/mozilla/layout/html/base/src/nsHTMLTags.h b/mozilla/layout/html/base/src/nsHTMLTags.h deleted file mode 100644 index 4c294cf87ad..00000000000 --- a/mozilla/layout/html/base/src/nsHTMLTags.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLTags_h___ -#define nsHTMLTags_h___ - -#include "nslayout.h" -#include "nsHTMLTagIDs.h" - -class NS_LAYOUT nsHTMLTags { -public: - // Given a null terminated string of 7 bit characters, return the - // tag id (see nsHTMLTagIDs.h) for the tag or -1 if the tag is not - // known. The lookup function uses a perfect hash. - static PRInt32 LookupName(const char* str); - - struct NameTableEntry { - const char* name; - PRInt32 id; - }; - - // A table whose index is the tag id (from LookupName) - static const NameTableEntry kNameTable[]; -}; - -#endif /* nsHTMLTags_h___ */ diff --git a/mozilla/layout/html/base/src/nsIAnchoredItems.h b/mozilla/layout/html/base/src/nsIAnchoredItems.h deleted file mode 100644 index 2a754f6eb2b..00000000000 --- a/mozilla/layout/html/base/src/nsIAnchoredItems.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIAnchoredItems_h___ -#define nsIAnchoredItems_h___ - -#include -#include "nsISupports.h" - -// IID for the nsIAnchoredItems interface {7327A0A0-BC8D-11d1-8539-00A02468FAB6} -#define NS_IANCHOREDITEMS_IID \ -{ 0x7327a0a0, 0xbc8d, 0x11d1, \ - {0x85, 0x39, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}} - -/** - * An interface for managing anchored items. Note that this interface is not - * an nsISupports interface, and therefore you cannot QueryInterface() back - */ -class nsIAnchoredItems -{ -public: - enum AnchoringPosition {anHTMLFloater}; - - /** - * Request to add an anchored item to this geometric parent. This is for handling - * anchored items that are not displayed inline (at the current point). - */ - virtual void AddAnchoredItem(nsIFrame* aAnchoredItem, - AnchoringPosition aPosition, - nsIFrame* aContainer) = 0; - - /** - * Called to remove an anchored item, most likely because the associated - * piece of content has been removed. - **/ - virtual void RemoveAnchoredItem(nsIFrame* aAnchoredItem) = 0; -}; - -#endif /* nsIAnchoredItems_h___ */ diff --git a/mozilla/layout/html/base/src/nsIFloaterContainer.h b/mozilla/layout/html/base/src/nsIFloaterContainer.h deleted file mode 100644 index e0f84f206e2..00000000000 --- a/mozilla/layout/html/base/src/nsIFloaterContainer.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIFloaterContainer_h___ -#define nsIFloaterContainer_h___ - -#include -class PlaceholderFrame; -class nsIPresContext; - -// IID for the nsIFloaterContainer interface {5A305EE0-CB55-11d1-8556-00A02468FAB6} -#define NS_IFLOATERCONTAINER_IID \ -{ 0x5a305ee0, 0xcb55, 0x11d1, \ - {0x85, 0x56, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}} - -/** - * An interface for communicating with the enclosing block-level container - * about floating elements. Note that this interface is not an nsISupports - * interface, and therefore you cannot QueryInterface() back - */ -class nsIFloaterContainer -{ -public: - /** - * Notification of a newly created floating element. - * - * @param aFloater the floating element - * @param aPlaceholder the placeholder frame associated with the floating - * element. - */ - virtual PRBool AddFloater(nsIPresContext* aPresContext, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) = 0; - - /** - * Call to place the floating element, because the placeholder frame has been - * reflowed. - * - * XXX This is kind of hokey and unreliable, because it relies on the placeholder - * getting reflowed. That won't necessarily happen if its geometric parent just - * decides to move it... It would probably be better if the implementor of this - * interface managed the tracking of the placeholder within the containing line - **/ - virtual void PlaceFloater(nsIPresContext* aPresContext, - nsIFrame* aFloater, - PlaceholderFrame* aPlaceholder) = 0; -}; - -#endif /* nsIFloaterContainer_h___ */ diff --git a/mozilla/layout/html/base/src/nsIHTMLContent.h b/mozilla/layout/html/base/src/nsIHTMLContent.h deleted file mode 100644 index 339132b4a31..00000000000 --- a/mozilla/layout/html/base/src/nsIHTMLContent.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIHTMLContent_h___ -#define nsIHTMLContent_h___ - -#include "nsIContent.h" -#include "nsHTMLValue.h" -class nsString; -class nsIFrame; -class nsISupportsArray; -class nsIStyleRule; -class nsIStyleContext; -class nsIPresContext; - -// IID for the nsIHTMLContent class -#define NS_IHTMLCONTENT_IID \ -{ 0xb9e110b0, 0x94d6, 0x11d1, \ - {0x89, 0x5c, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} } - -// Abstract interface for all html content -class nsIHTMLContent : public nsIContent { -public: - /** - * If this html content is a container, then compact asks it to minimize - * it's storage usage. - */ - virtual void Compact() = 0; - - virtual void SetAttribute(const nsString& aName, const nsString& aValue) = 0; - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue) = 0; - virtual void SetAttribute(nsIAtom* aAttribute, - const nsHTMLValue& aValue=nsHTMLValue::kNull) = 0; - - virtual void UnsetAttribute(nsIAtom* aAttribute) = 0; - - virtual nsContentAttr GetAttribute(const nsString& aName, - nsString& aResult) const = 0; - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const = 0; - virtual PRInt32 GetAllAttributeNames(nsISupportsArray* aArray) const = 0; - virtual PRInt32 GetAttributeCount(void) const = 0; - - virtual void SetID(nsIAtom* aID) = 0; - virtual nsIAtom* GetID(void) const = 0; - virtual void SetClass(nsIAtom* aClass) = 0; // XXX this will have to change for CSS2 - virtual nsIAtom* GetClass(void) const = 0; // XXX this will have to change for CSS2 - - virtual nsIStyleRule* GetStyleRule(void) = 0; - - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) = 0; - - /** - * Translate this piece of content to html. Note that this only - * translates this content object, not any children it might - * have. The caller is responsible for recursing down the - * hierarchy. - */ - // XXX add in output character set information so that we know how - // to encode non 7 bit characters - virtual void ToHTMLString(nsString& aResult) const = 0; - - virtual void ToHTML(FILE* out) const = 0; - - /** - * Used by the html content's delegate to create a frame - * for the content. - */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) = 0; -}; - -#endif /* nsIHTMLContent_h___ */ diff --git a/mozilla/layout/html/base/src/nsIHTMLFrameType.h b/mozilla/layout/html/base/src/nsIHTMLFrameType.h deleted file mode 100644 index c009fae04f0..00000000000 --- a/mozilla/layout/html/base/src/nsIHTMLFrameType.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIHTMLFrameType_h___ -#define nsIHTMLFrameType_h___ - -#include "nsISupports.h" - -enum nsHTMLFrameType { - eHTMLFrame_Block, -}; - -// Interface for nsIHTMLFrameType -#define NS_IHTMLFRAMETYPE_IID \ -{ /* 0e2554e0-b2c8-11d1-9328-00805f8add32 */ \ - 0x0e2554e0, 0xb2c8, 0x11d1, \ - {0x93, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -// IHTMLFrameType interface. Note that this interface is not an -// nsISupports interface and therefore you cannot queryinterface back -// to the original object. -class nsIHTMLFrameType { -public: - virtual nsHTMLFrameType GetFrameType() const = 0; -}; - -#endif /* nsIHTMLFrameType_h___ */ diff --git a/mozilla/layout/html/base/src/nsIImageMap.h b/mozilla/layout/html/base/src/nsIImageMap.h deleted file mode 100644 index 58581ddcbb4..00000000000 --- a/mozilla/layout/html/base/src/nsIImageMap.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIImageMap_h___ -#define nsIImageMap_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsCoord.h" -class nsIAtom; -class nsIPresContext; -class nsIRenderingContext; -class nsIURL; -class nsString; - -/* db6ca200-d0a6-11d1-89b1-006008911b81 */ -#define NS_IIMAGEMAP_IID \ -{0xdb6ca200, 0xd0a6, 0x11d1, {0x89, 0xb1, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}} - -class nsIImageMap : public nsISupports { -public: - NS_IMETHOD SetName(const nsString& aMapName) = 0; - - NS_IMETHOD GetName(nsString& aResult) = 0; - - NS_IMETHOD AddArea(const nsString& aBaseURL, - const nsString& aShape, - const nsString& aCoords, - const nsString& aHREF, - const nsString& aTarget, - const nsString& aAltText, - PRBool aSuppress) = 0; - - /** - * See if the given aX,aY pixel coordinates are in the image - * map. If they are then NS_OK is returned and aAbsURL, aTarget, - * aAltText, aSuppress are filled in with the values from the - * underlying area tag. If the coordinates are not in the map - * then NS_NOT_INSIDE is returned. - */ - NS_IMETHOD IsInside(nscoord aX, nscoord aY, - nsIURL* aDocURL, - nsString& aAbsURL, - nsString& aTarget, - nsString& aAltText, - PRBool* aSuppress) = 0; - - /** - * See if the given aX,aY pixel coordinates are in the image - * map. If they are then NS_OK is returned otherwise NS_NOT_INSIDE - * is returned. - */ - NS_IMETHOD IsInside(nscoord aX, nscoord aY) = 0; - - NS_IMETHOD Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) = 0; -}; - -// XXX get an error space to alloc from -#define NS_NOT_INSIDE 1 - -extern NS_HTML nsresult NS_NewImageMap(nsIImageMap** aInstancePtrResult, - nsIAtom* aAtom); - -#endif /* nsIImageMap_h___ */ diff --git a/mozilla/layout/html/base/src/nsImageMap.cpp b/mozilla/layout/html/base/src/nsImageMap.cpp deleted file mode 100644 index 3bca969fa62..00000000000 --- a/mozilla/layout/html/base/src/nsImageMap.cpp +++ /dev/null @@ -1,710 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIImageMap.h" -#include "nsString.h" -#include "nsVoidArray.h" -#include "nsCoord.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIURL.h" - -#undef SCALE -#define SCALE(a,b) nscoord((a) * (b)) - -class Area { -public: - Area(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - virtual ~Area(); - - void ParseCoords(const nsString& aSpec); - - virtual PRBool IsInside(nscoord x, nscoord y) = 0; - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC) = 0; - virtual void GetShapeName(nsString& aResult) = 0; - - void ToHTML(nsString& aResult); - - const nsString& GetBase() const { return mBase; } - const nsString& GetHREF() const { return mHREF; } - const nsString& GetTarget() const { return mTarget; } - const nsString& GetAltText() const { return mAltText; } - PRBool GetSuppress() const { return mSuppressFeedback; } - - nsString mBase; - nsString mHREF; - nsString mTarget; - nsString mAltText; - nscoord* mCoords; - PRInt32 mNumCoords; - PRBool mSuppressFeedback; -}; - -Area::Area(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : mBase(aBaseURL), mHREF(aHREF), mTarget(aTarget), mAltText(aAltText), - mSuppressFeedback(aSuppress) -{ - mCoords = nsnull; - mNumCoords = 0; -} - -Area::~Area() -{ - delete [] mCoords; -} - -// XXX move into nsCRT -#define XP_IS_SPACE(_ch) \ - (((_ch) == ' ') || ((_ch) == '\t') || ((_ch) == '\r') || ((_ch) == '\n')) - -#include -#define XP_ATOI(_s) ::atoi(_s) - -// XXX straight copy from laymap.c -static nscoord* lo_parse_coord_list(char *str, PRInt32* value_cnt) -{ - char *tptr; - char *n_str; - PRInt32 i, cnt; - PRInt32 *value_list; - - /* - * Nothing in an empty list - */ - *value_cnt = 0; - if ((str == NULL)||(*str == '\0')) - { - return((PRInt32 *)NULL); - } - - /* - * Skip beginning whitespace, all whitespace is empty list. - */ - n_str = str; - while (XP_IS_SPACE(*n_str)) - { - n_str++; - } - if (*n_str == '\0') - { - return((PRInt32 *)NULL); - } - - /* - * Make a pass where any two numbers separated by just whitespace - * are given a comma separator. Count entries while passing. - */ - cnt = 0; - while (*n_str != '\0') - { - PRBool has_comma; - - /* - * Skip to a separator - */ - tptr = n_str; - while ((!XP_IS_SPACE(*tptr))&&(*tptr != ',')&&(*tptr != '\0')) - { - tptr++; - } - n_str = tptr; - - /* - * If no more entries, break out here - */ - if (*n_str == '\0') - { - break; - } - - /* - * Skip to the end of the separator, noting if we have a - * comma. - */ - has_comma = PR_FALSE; - while ((XP_IS_SPACE(*tptr))||(*tptr == ',')) - { - if (*tptr == ',') - { - if (has_comma == PR_FALSE) - { - has_comma = PR_TRUE; - } - else - { - break; - } - } - tptr++; - } - /* - * If this was trailing whitespace we skipped, we are done. - */ - if ((*tptr == '\0')&&(has_comma == PR_FALSE)) - { - break; - } - /* - * Else if the separator is all whitespace, and this is not the - * end of the string, add a comma to the separator. - */ - else if (has_comma == PR_FALSE) - { - *n_str = ','; - } - - /* - * count the entry skipped. - */ - cnt++; - - n_str = tptr; - } - /* - * count the last entry in the list. - */ - cnt++; - - *value_cnt = cnt; - - /* - * Allocate space for the coordinate array. - */ - value_list = new nscoord[cnt]; - if (value_list == NULL) - { - return((PRInt32 *)NULL); - } - - /* - * Second pass to copy integer values into list. - */ - tptr = str; - for (i=0; i'); -} - -//---------------------------------------------------------------------- - -class DefaultArea : public Area { -public: - DefaultArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~DefaultArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -DefaultArea::DefaultArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -DefaultArea::~DefaultArea() -{ -} - -PRBool DefaultArea::IsInside(nscoord x, nscoord y) -{ - return PR_TRUE; -} - -void DefaultArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ -} - -void DefaultArea::GetShapeName(nsString& aResult) -{ - aResult.Append("default"); -} - -//---------------------------------------------------------------------- - -class RectArea : public Area { -public: - RectArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~RectArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -RectArea::RectArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -RectArea::~RectArea() -{ -} - -PRBool RectArea::IsInside(nscoord x, nscoord y) -{ - if (mNumCoords >= 4) { // Note: > is for nav compatabilty - nscoord x1 = mCoords[0]; - nscoord y1 = mCoords[1]; - nscoord x2 = mCoords[2]; - nscoord y2 = mCoords[3]; - if ((x1 > x2)|| (y1 > y2)) { - // Can't be inside a screwed up rect - return PR_FALSE; - } - if ((x >= x1) && (x <= x2) && (y >= y1) && (y <= y2)) { - return PR_TRUE; - } - } - return PR_FALSE; -} - -void RectArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - if (mNumCoords >= 4) { - float p2t = aCX.GetPixelsToTwips(); - nscoord x1 = SCALE(p2t, mCoords[0]); - nscoord y1 = SCALE(p2t, mCoords[1]); - nscoord x2 = SCALE(p2t, mCoords[2]); - nscoord y2 = SCALE(p2t, mCoords[3]); - if ((x1 > x2)|| (y1 > y2)) { - return; - } - aRC.DrawRect(x1, y1, x2 - x1, y2 - y1); - } -} - -void RectArea::GetShapeName(nsString& aResult) -{ - aResult.Append("rect"); -} - -//---------------------------------------------------------------------- - -class PolyArea : public Area { -public: - PolyArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~PolyArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -PolyArea::PolyArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -PolyArea::~PolyArea() -{ -} - -PRBool PolyArea::IsInside(nscoord x, nscoord y) -{ - if (mNumCoords >= 6) { - PRInt32 intersects = 0; - nscoord wherex = x; - nscoord wherey = y; - PRInt32 totalv = mNumCoords / 2; - PRInt32 totalc = totalv * 2; - nscoord xval = mCoords[totalc - 2]; - nscoord yval = mCoords[totalc - 1]; - PRInt32 end = totalc; - PRInt32 pointer = 1; - - if ((yval >= wherey) != (mCoords[pointer] >= wherey)) - if ((xval >= wherex) == (mCoords[0] >= wherex)) - intersects += (xval >= wherex) ? 1 : 0; - else - intersects += ((xval - (yval - wherey) * - (mCoords[0] - xval) / - (mCoords[pointer] - yval)) >= wherex) ? 1 : 0; - - // XXX I wonder what this is doing; this is a translation of ptinpoly.c - while (pointer < end) { - yval = mCoords[pointer]; - pointer += 2; - if (yval >= wherey) { - while((pointer < end) && (mCoords[pointer] >= wherey)) - pointer+=2; - if (pointer >= end) - break; - if ((mCoords[pointer-3] >= wherex) == - (mCoords[pointer-1] >= wherex)) { - intersects += (mCoords[pointer-3] >= wherex) ? 1 : 0; - } else { - intersects += - ((mCoords[pointer-3] - (mCoords[pointer-2] - wherey) * - (mCoords[pointer-1] - mCoords[pointer-3]) / - (mCoords[pointer] - mCoords[pointer - 2])) >= wherex) ? 1:0; - } - } else { - while((pointer < end) && (mCoords[pointer] < wherey)) - pointer+=2; - if (pointer >= end) - break; - if ((mCoords[pointer-3] >= wherex) == - (mCoords[pointer-1] >= wherex)) { - intersects += (mCoords[pointer-3] >= wherex) ? 1:0; - } else { - intersects += - ((mCoords[pointer-3] - (mCoords[pointer-2] - wherey) * - (mCoords[pointer-1] - mCoords[pointer-3]) / - (mCoords[pointer] - mCoords[pointer - 2])) >= wherex) ? 1:0; - } - } - } - if ((intersects & 1) != 0) { - return PR_TRUE; - } - } - return PR_FALSE; -} - -void PolyArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - if (mNumCoords >= 6) { - float p2t = aCX.GetPixelsToTwips(); - nscoord x0 = SCALE(p2t, mCoords[0]); - nscoord y0 = SCALE(p2t, mCoords[1]); - for (PRInt32 i = 2; i < mNumCoords; i += 2) { - nscoord x1 = SCALE(p2t, mCoords[i]); - nscoord y1 = SCALE(p2t, mCoords[i+1]); - aRC.DrawLine(x0, y0, x1, y1); - x0 = x1; - y0 = y1; - } - aRC.DrawLine(x0, y0, mCoords[0], mCoords[1]); - } -} - -void PolyArea::GetShapeName(nsString& aResult) -{ - aResult.Append("polygon"); -} - -//---------------------------------------------------------------------- - -class CircleArea : public Area { -public: - CircleArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress); - ~CircleArea(); - - virtual PRBool IsInside(nscoord x, nscoord y); - virtual void Draw(nsIPresContext& aCX, - nsIRenderingContext& aRC); - virtual void GetShapeName(nsString& aResult); -}; - -CircleArea::CircleArea(const nsString& aBaseURL, const nsString& aHREF, - const nsString& aTarget, const nsString& aAltText, - PRBool aSuppress) - : Area(aBaseURL, aHREF, aTarget, aAltText, aSuppress) -{ -} - -CircleArea::~CircleArea() -{ -} - -PRBool CircleArea::IsInside(nscoord x, nscoord y) -{ - // Note: > is for nav compatabilty - if (mNumCoords >= 3) { - nscoord x1 = mCoords[0]; - nscoord y1 = mCoords[1]; - nscoord radius = mCoords[2]; - if (radius < 0) { - return PR_FALSE; - } - nscoord dx = x1 - x; - nscoord dy = y1 - y; - nscoord dist = (dx * dx) + (dy * dy); - if (dist <= (radius * radius)) { - return PR_TRUE; - } - } - return PR_FALSE; -} - -void CircleArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - if (mNumCoords >= 3) { - float p2t = aCX.GetPixelsToTwips(); - nscoord x1 = SCALE(p2t, mCoords[0]); - nscoord y1 = SCALE(p2t, mCoords[1]); - nscoord radius = SCALE(p2t, mCoords[2]); - if (radius < 0) { - return; - } - nscoord x = x1 - radius / 2; - nscoord y = y1 - radius / 2; - nscoord w = 2 * radius; - aRC.DrawEllipse(x, y, w, w); - } -} - -void CircleArea::GetShapeName(nsString& aResult) -{ - aResult.Append("circle"); -} - -//---------------------------------------------------------------------- - -static NS_DEFINE_IID(kIImageMapIID, NS_IIMAGEMAP_IID); - -class ImageMapImpl : public nsIImageMap { -public: - ImageMapImpl(nsIAtom* aTag); - ~ImageMapImpl(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD SetName(const nsString& aMapName); - - NS_IMETHOD GetName(nsString& aResult); - - NS_IMETHOD AddArea(const nsString& aBaseURL, - const nsString& aShape, - const nsString& aCoords, - const nsString& aHREF, - const nsString& aTarget, - const nsString& aAltText, - PRBool aSuppress); - - NS_IMETHOD IsInside(nscoord aX, nscoord aY, - nsIURL* aDocURL, - nsString& aAbsURL, - nsString& aTarget, - nsString& aAltText, - PRBool* aSuppress); - - NS_IMETHOD IsInside(nscoord aX, nscoord aY); - - NS_IMETHOD Draw(nsIPresContext& aCX, nsIRenderingContext& aRC); - - nsString mName; - nsIAtom* mTag; - nsVoidArray mAreas; -}; - -ImageMapImpl::ImageMapImpl(nsIAtom* aTag) -{ - mTag = aTag; - NS_IF_ADDREF(aTag); -} - -ImageMapImpl::~ImageMapImpl() -{ - NS_IF_RELEASE(mTag); - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - delete area; - } -} - -NS_IMPL_ISUPPORTS(ImageMapImpl, kIImageMapIID); - -NS_IMETHODIMP ImageMapImpl::SetName(const nsString& aMapName) -{ - mName = aMapName; - return NS_OK; -} - -NS_IMETHODIMP ImageMapImpl::GetName(nsString& aResult) -{ - aResult = mName; - return NS_OK; -} - -NS_IMETHODIMP ImageMapImpl::AddArea(const nsString& aBaseURL, - const nsString& aShape, - const nsString& aCoords, - const nsString& aHREF, - const nsString& aTarget, - const nsString& aAltText, - PRBool aSuppress) -{ - Area* area; - if ((0 == aShape.Length()) || aShape.EqualsIgnoreCase("rect")) { - area = new RectArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } else if (aShape.EqualsIgnoreCase("poly") || - aShape.EqualsIgnoreCase("polygon")) { - area = new PolyArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } else if (aShape.EqualsIgnoreCase("circle")) { - area = new CircleArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } - else { - area = new DefaultArea(aBaseURL, aHREF, aTarget, aAltText, aSuppress); - } - area->ParseCoords(aCoords); - mAreas.AppendElement(area); - return NS_OK; -} - -NS_IMETHODIMP ImageMapImpl::IsInside(nscoord aX, nscoord aY, - nsIURL* aDocURL, - nsString& aAbsURL, - nsString& aTarget, - nsString& aAltText, - PRBool* aSuppress) -{ - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - if (area->IsInside(aX, aY)) { - NS_MakeAbsoluteURL(aDocURL, area->mBase, area->mHREF, aAbsURL); - aTarget = area->mTarget; - aAltText = area->mAltText; - *aSuppress = area->mSuppressFeedback; - return NS_OK; - } - } - return NS_NOT_INSIDE; -} - -NS_IMETHODIMP ImageMapImpl::IsInside(nscoord aX, nscoord aY) -{ - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - if (area->IsInside(aX, aY)) { - return NS_OK; - } - } - return NS_NOT_INSIDE; -} - -NS_IMETHODIMP ImageMapImpl::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) -{ - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - area->Draw(aCX, aRC); - } - return NS_OK; -} - -NS_HTML nsresult NS_NewImageMap(nsIImageMap** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - ImageMapImpl* it = new ImageMapImpl(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIImageMapIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsInlineFrame.cpp b/mozilla/layout/html/base/src/nsInlineFrame.cpp deleted file mode 100644 index 27734eb6e3f..00000000000 --- a/mozilla/layout/html/base/src/nsInlineFrame.cpp +++ /dev/null @@ -1,1113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsInlineFrame.h" -#include "nsSize.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsCSSLayout.h" -#include "nsPlaceholderFrame.h" -#include "nsReflowCommand.h" -#include "nsHTMLAtoms.h" -#include "nsAbsoluteFrame.h" - -// XXX To Do: -// 2. horizontal child margins -// 3. borders/padding and splitting -// 4. child relative positioning -// 5. absolutely positioned children -// 6. direction support -// 7. CSS line-height property - -/* XXX */ -#include "nsHTMLIIDs.h" -#include "nsBlockFrame.h" - -#define DEFAULT_ASCENT_LEN 10 - -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -class nsInlineState -{ -public: - nsStyleFont* font; // style font - nsStyleSpacing* spacing; // style spacing - nsSize availSize; // available space in which to reflow (starts as max size minus insets) - nsSize* maxElementSize; // maximum element size (may be null) - nscoord x; // running x-offset (starts at left inner edge) - const nscoord y; // y-offset (top inner edge) - nscoord maxAscent; // max child ascent - nscoord maxDescent; // max child descent - nscoord* ascents; // ascent information for each child - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Constructor - nsInlineState(nsStyleFont* aStyleFont, - nsStyleSpacing* aSpacing, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) - : x(aSpacing->mBorderPadding.left), // determined by inner edge - y(aSpacing->mBorderPadding.top) // determined by inner edge - { - font = aStyleFont; - spacing = aSpacing; - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - - // If we're constrained adjust the available size so it excludes space - // needed for border/padding - availSize.width = aMaxSize.width; - if (PR_FALSE == unconstrainedWidth) { - availSize.width -= aSpacing->mBorderPadding.left + aSpacing->mBorderPadding.right; - } - availSize.height = aMaxSize.height; - if (PR_FALSE == unconstrainedHeight) { - availSize.height -= aSpacing->mBorderPadding.top + aSpacing->mBorderPadding.bottom; - } - - // Initialize max element size - maxElementSize = aMaxElementSize; - if (nsnull != maxElementSize) { - maxElementSize->SizeTo(0, 0); - } - - ascents = ascentBuf; - maxAscent = 0; - maxDescent = 0; - } - - void SetNumAscents(PRIntn aNumAscents) { - // We keep around ascent information so that we can vertically align - // children after we figure out how many children fit. - if (aNumAscents > DEFAULT_ASCENT_LEN) { - ascents = new nscoord[aNumAscents]; - } - } - - // Destructor - ~nsInlineState() { - if (ascents != ascentBuf) { - delete ascents; - } - } - -private: - nscoord ascentBuf[DEFAULT_ASCENT_LEN]; -}; - -///////////////////////////////////////////////////////////////////////////// -// - -nsresult nsInlineFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsInlineFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsInlineFrame::nsInlineFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsHTMLContainerFrame(aContent, aIndexInParent, aParent) -{ - NS_PRECONDITION(!IsPseudoFrame(), "can not be a pseudo frame"); -} - -nsInlineFrame::~nsInlineFrame() -{ -} - -void nsInlineFrame::PlaceChild(nsIFrame* aChild, - PRInt32 aIndex, - nsInlineState& aState, - const nsReflowMetrics& aChildSize, - const nsSize* aChildMaxElementSize) -{ - // Set the child's rect - aChild->SetRect(nsRect(aState.x, aState.y, aChildSize.width, aChildSize.height)); - - // Adjust the running x-offset - aState.x += aChildSize.width; - - // Update the array of ascents and the max ascent and descent - aState.ascents[aIndex] = aChildSize.ascent; - if (aChildSize.ascent > aState.maxAscent) { - aState.maxAscent = aChildSize.ascent; - } - if (aChildSize.descent > aState.maxDescent) { - aState.maxDescent = aChildSize.descent; - } - - // If we're constrained then update the available width - if (!aState.unconstrainedWidth) { - aState.availSize.width -= aChildSize.width; - } - - // Update the maximum element size - if (nsnull != aChildMaxElementSize) { - if (aChildMaxElementSize->width > aState.maxElementSize->width) { - aState.maxElementSize->width = aChildMaxElementSize->width; - } - if (aChildMaxElementSize->height > aState.maxElementSize->height) { - aState.maxElementSize->height = aChildMaxElementSize->height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsInlineFrame::ReflowMappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool originalLastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.width > aState.availSize.width) && (kidFrame != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - result = PR_FALSE; - break; - } - - // Place and size the child. We'll deal with vertical alignment when - // we're all done - PlaceChild(kidFrame, childCount, aState, kidSize, pKidMaxElementSize); - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Is the child complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No, the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Get the next child frame - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count member data - mChildCount = childCount; -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, - nsInlineState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsInlineFrame* nextInFlow = (nsInlineFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list - NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow = (nsInlineFrame*)nextInFlow->mNextInFlow; - continue; - } - } - - // XXX if the frame being pulled up is not appropriate (e.g. a block - // frame) then we should stop! If we have an inline BR tag we should - // stop too! - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - if ((kidFrameSize.width > aState.availSize.width) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Place and size the child. We'll deal with vertical alignment when - // we're all done - PlaceChild(kidFrame, mChildCount, aState, kidSize, pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsInlineFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow = (nsInlineFrame*)nextInFlow->mNextInFlow; - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsInlineFrame* prev = (nsInlineFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aState.maxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - PRBool breakAfter = PR_FALSE; - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContent* kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.width <= 0) { - // Note: return status was set to frNotComplete above... - NS_RELEASE(kid); - break; - } - - // Resolve style for the child - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - - // Figure out how we should treat the child - nsIFrame* kidFrame; - nsStyleDisplay* kidDisplay = - (nsStyleDisplay*)kidStyleContext->GetData(kStyleDisplaySID); - nsStylePosition* kidPosition = (nsStylePosition*) - kidStyleContext->GetData(kStylePositionSID); - - // Check whether it wants to floated or absolutely positioned - if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) { - AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidStyleContext); - } else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) { - PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this); - kidFrame->SetStyleContext(kidStyleContext); - } else if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel; - switch (kidDisplay->mDisplay) { - case NS_STYLE_DISPLAY_BLOCK: - case NS_STYLE_DISPLAY_LIST_ITEM: - if (kidIndex != mFirstContentOffset) { - // We don't allow block elements to be placed in us anywhere - // other than at our left margin. - NS_RELEASE(kidStyleContext); - NS_RELEASE(kid); - goto done; - } - // FALLTHROUGH - - case NS_STYLE_DISPLAY_INLINE: - // XXX temporary hack to make plain BR's in inlines "work" - // get style for break-before-after; get break-type (line, page, etc.) - { - nsIAtom* tag = kid->GetTag(); - if (nsHTMLAtoms::br == tag) { - // Set break-after flag so we stop mapping children (we - // will end up being continued if there are more children) - breakAfter = PR_TRUE; - - // Get cached state for containing block frame - // XXX how about QueryInterface(kIHTMLBlockFrameIID)? DOH! - nsBlockReflowState* state = nsnull; - nsIFrame* parent = mGeometricParent; - while (nsnull != parent) { - nsIHTMLFrameType* ft; - nsresult status = - parent->QueryInterface(kIHTMLFrameTypeIID, (void**) &ft); - if (NS_OK == status) { - nsHTMLFrameType type = ft->GetFrameType(); - if (eHTMLFrame_Block == type) { - break; - } - } - parent->GetGeometricParent(parent); - } - if (nsnull != parent) { - nsIPresShell* shell = aPresContext->GetShell(); - state = (nsBlockReflowState*) shell->GetCachedData(parent); - // XXX Of course this won't work if the inline span is nested - // in another inline span! - state->breakAfterChild = PR_TRUE; - NS_RELEASE(shell); - } - } - NS_IF_RELEASE(tag); - } - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - break; - - default: - NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); - break; - } - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - NS_RELEASE(kid); - NS_RELEASE(kidStyleContext); - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - // Place and size the child. We'll deal with vertical alignment when - // we're all done - PlaceChild(kidFrame, mChildCount, aState, kidSize, pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - - // If we need to break after the kidFrame, then do so now - if (breakAfter) { - break; - } - } - -done:; - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - -NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif -//XXX not now NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "unexpected max size"); - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; // initialize out parameter - - // Get the style molecule - nsStyleFont* styleFont = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsStyleSpacing* styleSpacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - - // Check for an overflow list - MoveOverflowToChildList(); - - // Initialize our reflow state. We must wait until after we've processed - // the overflow list, because our first content offset might change - nsInlineState state(styleFont, styleSpacing, aMaxSize, aMaxElementSize); - state.SetNumAscents(mContent->ChildCount() - mFirstContentOffset); - - // Reflow any existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state); - - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.width <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = ReflowUnmappedChildren(aPresContext, state); - } - } else { - // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; - } - } - } - - const nsMargin& insets = styleSpacing->mBorderPadding; - - // Vertically align the children - nscoord lineHeight = - nsCSSLayout::VerticallyAlignChildren(aPresContext, this, styleFont, - insets.top, mFirstChild, mChildCount, - state.ascents, state.maxAscent); - - // XXX I don't think our return size properly accounts for the lineHeight - // (which may not == state.maxAscent + state.maxDescent) - // Return our size and our status - aDesiredSize.width = state.x + insets.right; - aDesiredSize.ascent = insets.top + state.maxAscent; - aDesiredSize.descent = state.maxDescent + insets.bottom; - aDesiredSize.height = aDesiredSize.ascent + aDesiredSize.descent; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - return NS_OK; -} - -///////////////////////////////////////////////////////////////////////////// - -PRIntn nsInlineFrame::GetSkipSides() const -{ - PRIntn skip = 0; - if (nsnull != mPrevInFlow) { - skip |= 1 << NS_SIDE_LEFT; - } - if (nsnull != mNextInFlow) { - skip |= 1 << NS_SIDE_RIGHT; - } - return skip; -} - -///////////////////////////////////////////////////////////////////////////// - -// Incremental reflow support - -NS_METHOD nsInlineFrame::GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics) -{ - nscoord maxAscent = 0; - nscoord maxDescent = 0; - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsReflowMetrics kidMetrics; - kid->GetReflowMetrics(aPresContext, kidMetrics); - if (kidMetrics.ascent > maxAscent) maxAscent = kidMetrics.ascent; - if (kidMetrics.descent > maxDescent) maxDescent = kidMetrics.descent; - kid->GetNextSibling(kid); - } - - // XXX what about border & padding - aMetrics.width = mRect.width; - aMetrics.height = mRect.height; - aMetrics.ascent = maxAscent; - aMetrics.descent = maxDescent; - - return NS_OK; -} - -/** - * Setup aState to the state it would have had we just reflowed our - * children up to, but not including, aSkipChild. Return the index - * of aSkipChild in our list of children. - */ -PRIntn nsInlineFrame::RecoverState(nsIPresContext* aPresContext, - nsInlineState& aState, - nsIFrame* aSkipChild) -{ - // Get ascent & descent info for all the children up to but not - // including aSkipChild. Also compute the x coordinate for where - // aSkipChild will be place after it is reflowed. - PRIntn i = 0; - nsIFrame* kid = mFirstChild; - nscoord x = aState.x; - nscoord maxAscent = 0; - nscoord maxDescent = 0; - while (kid != aSkipChild) { - nsReflowMetrics kidMetrics; - kid->GetReflowMetrics(aPresContext, kidMetrics); - aState.ascents[i] = kidMetrics.ascent; - if (kidMetrics.ascent > maxAscent) maxAscent = kidMetrics.ascent; - if (kidMetrics.descent > maxDescent) maxDescent = kidMetrics.descent; - - // XXX Factor in left and right margins - x += kidMetrics.width; - - kid->GetNextSibling(kid); - i++; - } - aState.maxAscent = maxAscent; - aState.maxDescent = maxDescent; - aState.x = x; - return (nsnull == aSkipChild) ? 0 : i; -} - -NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; // initialize out parameter - -#if 0 - if (aReflowCommand.GetTarget() == this) { - // NOTE: target frame is first in flow even when reflow commands - // applies to some piece of content in any of the next-in-flows - nsInlineFrame* flow = this; - - switch (aReflowCommand.GetType()) { - case nsReflowCommand::rcContentAppended: - // Get to last-in-flow where the append is occuring - while (nsnull != flow->mNextInFlow) { - flow = flow->mNextInFlow; - } - aStatus = flow->ReflowUnmappedChildren(...); - break; - - case nsReflowCommand::rcContentInserted: - // XXX where did the insertion point go? - - // Get to correct next-in-flow - // XXX this is more complicated when dealing with pseudo children - PRInt32 contentIndex = 0; - while (nsnull != flow->mNextInFlow) { - // XXX the last child we have may be continued into our - // next-in-flow which means that endIndex is wrong??? - PRInt32 endIndex = contentIndex + mChildCount; - if ((contentIndex <= aIndexInParent) && (aIndexInParent < endIndex)) { - break; - } - flow = flow->mNextInFlow; - contentIndex = endIndex; - } - - // Create frame and insert it into the sibling list at the right - // spot. Reflow it. Adjust position of siblings including - // pushing frames that don't fit. - flow->ReflowUnmappedChild(..., index information); - break; - - case nsReflowCommand::rcContentDeleted: - // XXX what about will-delete, did-delete? - - // Find the affected flow blocks and remove the child and any - // continuations it has from the flow. Every flow block except - // the first one will recieve a reflow command to cleanup after - // the first flow block does it's clean up. Except for the - // post-processing (impacting sibling frames) the code is - // generic across container types. - break; - - case nsReflowCommand::rcContentChanged: - // XXX The piece of content affected may change stylistically - // from inline to block. If it does and it's not our first kid - // then we just push it and let our next-in-flow reflow it. - - // Either: a) delete the old frame, create a new frame, reflow -or- - // b) ResizeReflow the affected child - - // If the reflow status is incomplete then the remaining - // children on the line get pushed; else only push children that - // don't fit. If no pushing occurs then maybe we can pullup a - // child; if we do then generate reflow commands for our - // next-in-flows to deal with a pull event. - break; - } - - } else { - // XXX Tuneup? if we save the child's continuation status and its - // current bounding rect and then pass the command down and it - // comes back with the same bounds in aDesiredSize and with the - // same continuation status then we are done, right? - - // Get the next frame that the reflow command is targeted at. - // This will be one of my children. - nsIFrame* nextInChain = aReflowCommand.GetNext(); - NS_ASSERTION(this == nextInChain->GetGeometricParent(), "bad reflow cmd"); - - // Recover the reflow state as if we had reflowed our children up - // to but not including the child that is next in the reflow chain - nsInlineState state(aMaxSize, nsnull); - state.SetNumAscents(mChildCount); - PRIntn nextIndex = RecoverState(aPresContext, state, nextInChain); - - // Save away the current location and size of the child which the - // reflow command is targeted towards. This isn't strictly - // necessary, but our child might tamper with it's x/y - // XXX bother? - nsRect oldBounds; - nextInChain->GetRect(oldBounds); - - // Now pass reflow command down to our child to handle - nsReflowMetrics kidMetrics; - aStatus = aReflowCommand.Next(kidMetrics, aMaxSize, kid); - // XXX what do we do when the nextInChain's completion status changes? - // XXX if kid == LastChild() then mLastContentIsComplete needs updating - - // Update placement information for the impacted child frame and - // any other frames following the child frame. - if ((oldBounds.width == kidMetrics.width) && - (oldBounds.height == kidMetrics.height)) { - // The child didn't change as far as we can tell. Nobody needs - // to be moved. - - // XXX what about a child who's shape is the same but who's - // reflow status is frNotComplete? - - // Note: a child that used to be continued and is no longer - // continued and whose size is unchanged: we don't care because - // as far as we are concerned nothing happened to us. However, - // our next-in-flow might get torched (our parent will deal with - // that). - - // XXX figure out the right status to return - } else { - // Factor in ascent information from the updated child - state.ascents[nextIndex] = kidMetrics.ascent; - if (kidMetrics.ascent > state.maxAscent) { - state.maxAscent = kidMetrics.ascent; - } - if (kidMetrics.descent > state.maxDescent) { - state.maxDescent = kidMetrics.descent; - } - - // Update other children that are impacted by the change in - // nextInChain. In addition, re-apply vertical alignment and - // relative positioning to the children on the line. - aStatus = AdjustChildren(aPresContext, aDesiredSize, aState, kid, - kidMetrics, aStatus); - } - } -#endif - - return NS_OK; -} - - -// In order to execute the vertical alignment code after incremental -// reflow of the inline frame, we need to reposition any child frames -// that were relatively positioned back to their computed x origin. -// This should probably be done as a pre-alignment computation (and it -// can be avoided if there are no relatively positioned children). - -/** - * Adjust the position of all the children in this frame. - * - * The children after aKid in the list of children are slid over by - * dx. - * - * Once the x and y coordinates have been set, then the vertical - * alignment code is executed to place the children vertically and to - * compute the final height of our frame. - * - * If one of our children spills over the end then push it to the - * next-in-flow or to our overflow list. - */ -nsIFrame::ReflowStatus -nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsInlineState& aState, - nsIFrame* aKid, - nsReflowMetrics& aKidMetrics, - ReflowStatus aKidReflowStatus) -{ - nsStyleSpacing* spacing = aState.spacing; - nscoord xr = aState.availSize.width + spacing->mBorderPadding.left; - nscoord remainingSpace = xr - aState.x; - nscoord x = aState.x; - - // Slide all of the children over following aKid - nsIFrame* kid = aKid; - nsRect r; - while (nsnull != kid) { - kid->GetRect(r); - if (r.x != x) { - kid->MoveTo(x, r.y); - } - x += r.width; - // XXX factor in left and right margins - kid->GetNextSibling(kid); - } - - // Vertically align the children - const nsMargin& insets = spacing->mBorderPadding; - nsCSSLayout::VerticallyAlignChildren(aPresContext, this, aState.font, - insets.top, mFirstChild, mChildCount, - aState.ascents, aState.maxAscent); - - // XXX relative position children, if any - - // XXX adjust mLastContentOffset if we push - // XXX if we push, generate a reflow command - - return frComplete; -} - -// My container has new content at the end of it. Create frames for -// the appended content and then generate an incremental reflow -// command for ourselves. -NS_METHOD nsInlineFrame::ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) -{ - // Get the last in flow - nsInlineFrame* flow = (nsInlineFrame*)GetLastInFlow(); - - // Get index of where the content has been appended - PRInt32 kidIndex = flow->NextChildOffset(); - PRInt32 startIndex = kidIndex; - nsIFrame* prevKidFrame; - - flow->LastChild(prevKidFrame); - // Create frames for each new child - for (;;) { - // Get the next content object - nsIContent* kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { - break; - } - - nsIContentDelegate* del = kid->GetDelegate(aPresContext); - nsIFrame* kidFrame = del->CreateFrame(aPresContext, kid, kidIndex, flow); - NS_RELEASE(del); - NS_RELEASE(kid); - - // Append kidFrame to the sibling list - prevKidFrame->SetNextSibling(kidFrame); - prevKidFrame = kidFrame; - kidIndex++; - } - flow->SetLastContentOffset(prevKidFrame); - - // Now generate a reflow command for flow - if (aContainer == mContent) { - nsReflowCommand* rc = - new nsReflowCommand(aPresContext, flow, nsReflowCommand::FrameAppended, - startIndex); - aShell->AppendReflowCommand(rc); - } - return NS_OK; -} diff --git a/mozilla/layout/html/base/src/nsLeafFrame.cpp b/mozilla/layout/html/base/src/nsLeafFrame.cpp deleted file mode 100644 index 912178cb2db..00000000000 --- a/mozilla/layout/html/base/src/nsLeafFrame.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsLeafFrame.h" -#include "nsIStyleContext.h" -#include "nsCSSRendering.h" - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); - -nsLeafFrame::nsLeafFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsLeafFrame::~nsLeafFrame() -{ -} - -NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - return NS_OK; -} - -NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - // XXX add in code to check for width/height being set via css - // and if set use them instead of calling GetDesiredSize. - - GetDesiredSize(aPresContext, aDesiredSize, aMaxSize); - AddBordersAndPadding(aPresContext, aDesiredSize); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aDesiredSize.width; - aMaxElementSize->height = aDesiredSize.height; - } - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // XXX Unless the reflow command is a style change, we should - // just return the current size, otherwise we should invoke - // GetDesiredSize - - // XXX add in code to check for width/height being set via css - // and if set use them instead of calling GetDesiredSize. - GetDesiredSize(aPresContext, aDesiredSize, aMaxSize); - AddBordersAndPadding(aPresContext, aDesiredSize); - - aStatus = frComplete; - return NS_OK; -} - -// XXX how should border&padding effect baseline alignment? -// => descent = borderPadding.bottom for example -void nsLeafFrame::AddBordersAndPadding(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize) -{ - nsStyleSpacing* space = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - aDesiredSize.width += space->mBorderPadding.left + space->mBorderPadding.right; - aDesiredSize.height += space->mBorderPadding.top + space->mBorderPadding.bottom; - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; -} - -void nsLeafFrame::GetInnerArea(nsIPresContext* aPresContext, - nsRect& aInnerArea) const -{ - nsStyleSpacing* space = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - aInnerArea.x = space->mBorderPadding.left; - aInnerArea.y = space->mBorderPadding.top; - aInnerArea.width = mRect.width - - (space->mBorderPadding.left + space->mBorderPadding.right); - aInnerArea.height = mRect.height - - (space->mBorderPadding.top + space->mBorderPadding.bottom); -} - -NS_METHOD nsLeafFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - NS_NOTREACHED("Attempt to split the unsplittable"); - aContinuingFrame = nsnull; - return NS_OK; -} diff --git a/mozilla/layout/html/base/src/nsLeafFrame.h b/mozilla/layout/html/base/src/nsLeafFrame.h deleted file mode 100644 index e979cc2aa06..00000000000 --- a/mozilla/layout/html/base/src/nsLeafFrame.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsLeafFrame_h___ -#define nsLeafFrame_h___ - -#include "nsFrame.h" - -/** - * Abstract class that provides simple fixed-size layout for leaf objects - * (e.g. images, form elements, etc.). Deriviations provide the implementation - * of the GetDesiredSize method. The rendering method knows how to render - * borders and backgrounds. - */ -class nsLeafFrame : public nsFrame { -public: - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - -protected: - nsLeafFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - virtual ~nsLeafFrame(); - - /** - * Return the desired size of the frame. Note that this method - * doesn't need to deal with padding or borders (the caller will - * deal with it). In addition, the ascent will be set to the height - * and the descent will be set to zero. - */ - virtual void GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) = 0; - - /** - * Get the inner rect of this frame. This takes the outer size (mRect) - * and subtracts off the borders and padding. - */ - void GetInnerArea(nsIPresContext* aPresContext, nsRect& aInnerArea) const; - - /** - * Subroutine to add in borders and padding - */ - void AddBordersAndPadding(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize); -}; - -#endif /* nsLeafFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsListItemFrame.cpp b/mozilla/layout/html/base/src/nsListItemFrame.cpp deleted file mode 100644 index 0fd883d8785..00000000000 --- a/mozilla/layout/html/base/src/nsListItemFrame.cpp +++ /dev/null @@ -1,687 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsListItemFrame.h" -#include "nsIStyleContext.h" -#include "nsFrame.h" -#include "nsString.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIFontMetrics.h" -#include "nsStyleConsts.h" -#include "nsUnitConversion.h" -#include "nsIContent.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLValue.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" -#include "nsIPresShell.h" -#include "prprf.h" -#include "nsIView.h" - -// XXX TODO: -// 1. If container is RTL then place bullets on the right side -// 2. list-style-image -// 3. proper ascent alignment -// 4. number bullets correctly when dealing with
  • -// 5. size and render circle, square, disc bullets like nav4 does - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID); - -/** - * A pseudo-frame class that reflows the list item bullet. - */ -class BulletFrame : public nsContainerFrame { -public: - BulletFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - virtual ~BulletFrame(); - - NS_IMETHOD Paint(nsIPresContext &aCX, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - void GetBulletSize(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize); - - PRInt32 GetListItemOrdinal(nsIPresContext* aCX, nsStyleList& aMol); - - void GetListItemText(nsIPresContext* aCX, nsString& aResult, - nsStyleList& aMol); - - PRPackedBool mOrdinalValid; - PRInt32 mOrdinal; -}; - -BulletFrame::BulletFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -BulletFrame::~BulletFrame() -{ -} - -// XXX padding for around the bullet; should come from style system -#define PAD_DISC NS_POINTS_TO_TWIPS_INT(1) - -NS_METHOD BulletFrame::Paint(nsIPresContext& aCX, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsStyleFont* myFont = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleList* myList = - (nsStyleList*)mStyleContext->GetData(kStyleListSID); - nsIFontMetrics* fm = aCX.GetMetricsFor(myFont->mFont); - - nscoord pad; - - nsAutoString text; - switch (myList->mListStyleType) { - case NS_STYLE_LIST_STYLE_NONE: - break; - - case NS_STYLE_LIST_STYLE_DISC: - case NS_STYLE_LIST_STYLE_CIRCLE: - case NS_STYLE_LIST_STYLE_SQUARE: - pad = PAD_DISC; - aRenderingContext.SetColor(myColor->mColor); - aRenderingContext.FillRect(pad, pad, mRect.width - (pad + pad), - mRect.height - (pad + pad));/* XXX */ - break; - - case NS_STYLE_LIST_STYLE_DECIMAL: - case NS_STYLE_LIST_STYLE_LOWER_ROMAN: - case NS_STYLE_LIST_STYLE_UPPER_ROMAN: - case NS_STYLE_LIST_STYLE_LOWER_ALPHA: - case NS_STYLE_LIST_STYLE_UPPER_ALPHA: - GetListItemText(&aCX, text, *myList); - aRenderingContext.SetColor(myColor->mColor); - aRenderingContext.SetFont(myFont->mFont); - aRenderingContext.DrawString(text, 0, 0, fm->GetWidth(text)); - break; - } - NS_RELEASE(fm); - return NS_OK; -} - -NS_METHOD BulletFrame::ResizeReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - GetBulletSize(aCX, aDesiredSize, aMaxSize); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aDesiredSize.width; - aMaxElementSize->height = aDesiredSize.height; - } - - // This is done so that our containers VerifyTree code will work - // correctly. Otherwise it will think that the child that follows - // the bullet must be mapping the second content object instead of - // mapping the first content object. - mLastContentIsComplete = PR_FALSE; - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD BulletFrame::IncrementalReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // XXX Unless the reflow command is a style change, we should - // just return the current size, otherwise we should invoke - // GetBulletSize - GetBulletSize(aCX, aDesiredSize, aMaxSize); - - aStatus = frComplete; - return NS_OK; -} - -PRInt32 BulletFrame::GetListItemOrdinal(nsIPresContext* aCX, - nsStyleList& aListStyle) -{ - if (mOrdinalValid) { - return mOrdinal; - } - - PRInt32 ordinal = 0; - - // Get block reflow state for the list container - nsListItemFrame* listItem = (nsListItemFrame*) mGeometricParent; - nsBlockReflowState* state = listItem->GetListContainerReflowState(aCX); - - // Try to get value directly from the list-item, if it specifies a - // value attribute. - nsHTMLValue value; - nsIHTMLContent* html = (nsIHTMLContent*) mContent; - if (eContentAttr_HasValue == html->GetAttribute(nsHTMLAtoms::value, value)) { - if (eHTMLUnit_Absolute == value.GetUnit()) { - ordinal = value.GetIntValue(); - if (nsnull != state) { - state->nextListOrdinal = ordinal + 1; - } - goto done; - } - } - - // Get ordinal from block reflow state - if (nsnull != state) { - ordinal = state->nextListOrdinal; - if (ordinal < 0) { - // This is the first list item and the list container doesn't - // have a "start" attribute. Get the starting ordinal value - // correctly set. - switch (aListStyle.mListStyleType) { - case NS_STYLE_LIST_STYLE_DECIMAL: - ordinal = 1; - break; - default: - ordinal = 0; - break; - } - } - state->nextListOrdinal = ordinal + 1; - } - - done: - mOrdinal = ordinal; - mOrdinalValid = PR_TRUE; - return ordinal; -} - -static const char* gLowerRomanCharsA = "ixcm"; -static const char* gUpperRomanCharsA = "IXCM"; -static const char* gLowerRomanCharsB = "vld?"; -static const char* gUpperRomanCharsB = "VLD?"; -static const char* gLowerAlphaChars = "abcdefghijklmnopqrstuvwxyz"; -static const char* gUpperAlphaChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - -void -BulletFrame::GetListItemText(nsIPresContext* aCX, - nsString& result, - nsStyleList& aListStyle) -{ - PRInt32 ordinal = GetListItemOrdinal(aCX, aListStyle); - char cbuf[40]; - switch (aListStyle.mListStyleType) { - case NS_STYLE_LIST_STYLE_DECIMAL: - PR_snprintf(cbuf, sizeof(cbuf), "%ld", ordinal); - result.Append(cbuf); - break; - - case NS_STYLE_LIST_STYLE_LOWER_ROMAN: - case NS_STYLE_LIST_STYLE_UPPER_ROMAN: - { - // XXX deal with an ordinal of ZERO - nsAutoString addOn; - nsAutoString decStr; - decStr.Append(ordinal, 10); - const PRUnichar* dp = decStr.GetUnicode(); - const PRUnichar* end = dp + decStr.Length(); - - PRIntn len=decStr.Length(); - PRIntn romanPos=len; - PRIntn n; - PRBool negative=PRBool(ordinal<0); - - const char* achars; - const char* bchars; - if (aListStyle.mListStyleType == NS_STYLE_LIST_STYLE_LOWER_ROMAN) { - achars = gLowerRomanCharsA; - bchars = gLowerRomanCharsB; - } else { - achars = gUpperRomanCharsA; - bchars = gUpperRomanCharsB; - } - ordinal=(ordinal < 0) ? -ordinal : ordinal; - if (ordinal < 0) { - // XXX max negative int - break; - } - for (; dp < end; dp++) - { - romanPos--; - addOn.SetLength(0); - switch(*dp) - { - case '3': addOn.Append(achars[romanPos]); - case '2': addOn.Append(achars[romanPos]); - case '1': addOn.Append(achars[romanPos]); - break; - - case '4': - addOn.Append(achars[romanPos]); - - case '5': case '6': - case '7': case '8': - addOn.Append(bchars[romanPos]); - for(n=0;n<(*dp-'5');n++) { - addOn.Append(achars[romanPos]); - } - break; - case '9': - addOn.Append(achars[romanPos]); - addOn.Append(achars[romanPos+1]); - break; - default: - break; - } - result.Append(addOn); - } - } - break; - - case NS_STYLE_LIST_STYLE_LOWER_ALPHA: - case NS_STYLE_LIST_STYLE_UPPER_ALPHA: - { - PRInt32 anOffset = -1; - PRInt32 aBase = 26; - PRInt32 ndex=0; - PRInt32 root=1; - PRInt32 next=aBase; - PRInt32 expn=1; - const char* chars = - (aListStyle.mListStyleType == NS_STYLE_LIST_STYLE_LOWER_ALPHA) - ? gLowerAlphaChars : gUpperAlphaChars; - - // must be positive here... - ordinal = (ordinal < 0) ? -ordinal : ordinal; - if (ordinal < 0) { - // XXX max negative int - break; - } - while (next<=ordinal) // scale up in baseN; exceed current value. - { - root=next; - next*=aBase; - expn++; - } - - while(0!=(expn--)) - { - ndex = ((root<=ordinal) && (0!=root)) ? (ordinal/root): 0; - ordinal %= root; - if (root>1) - result.Append(chars[ndex+anOffset]); - else - result.Append(chars[ndex]); - root /= aBase; - } - } - break; - } - result.Append("."); -} - -void BulletFrame::GetBulletSize(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) -{ - nsStyleList* myList = - (nsStyleList*)mStyleContext->GetData(kStyleListSID); - nsStyleFont* myFont = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - - nscoord pad; - - nsIFontMetrics* fm = aCX->GetMetricsFor(myFont->mFont); - nsAutoString text; - switch (myList->mListStyleType) { - case NS_STYLE_LIST_STYLE_NONE: - aDesiredSize.width = 0; - aDesiredSize.height = 0; - aDesiredSize.ascent = 0; - aDesiredSize.descent = 0; - break; - - case NS_STYLE_LIST_STYLE_DISC: - case NS_STYLE_LIST_STYLE_CIRCLE: - case NS_STYLE_LIST_STYLE_SQUARE: - /* XXX match navigator */ - pad = PAD_DISC; - aDesiredSize.width = pad + pad + fm->GetWidth('x'); - aDesiredSize.height = pad + pad + fm->GetWidth('x'); - aDesiredSize.ascent = pad + fm->GetWidth('x'); - aDesiredSize.descent = pad; - break; - - case NS_STYLE_LIST_STYLE_DECIMAL: - case NS_STYLE_LIST_STYLE_LOWER_ROMAN: - case NS_STYLE_LIST_STYLE_UPPER_ROMAN: - case NS_STYLE_LIST_STYLE_LOWER_ALPHA: - case NS_STYLE_LIST_STYLE_UPPER_ALPHA: - GetListItemText(aCX, text, *myList); - if (NS_STYLE_LIST_STYLE_POSITION_INSIDE == myList->mListStylePosition) { - // Inside bullets need some extra width to get the padding - // between the list item and the content that follows. - pad = fm->GetHeight() / 2; // From old layout engine - } else { - // Outside bullets get there padding by placement not by sizing - pad = 0; - } - aDesiredSize.width = pad + fm->GetWidth(text); - aDesiredSize.height = fm->GetHeight(); - aDesiredSize.ascent = fm->GetMaxAscent(); - aDesiredSize.descent = fm->GetMaxDescent(); - break; - } - NS_RELEASE(fm); -} - -//---------------------------------------------------------------------- - -nsresult nsListItemFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsListItemFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -nsListItemFrame::nsListItemFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsBlockFrame(aContent, aIndexInParent, aParent) -{ -} - -nsListItemFrame::~nsListItemFrame() -{ -} - -nsIFrame* nsListItemFrame::CreateBullet() -{ - // Create bullet. The bullet shares the same style context as - // ourselves. - nsIFrame* bullet = new BulletFrame(mContent, mIndexInParent, this); - bullet->SetStyleContext(mStyleContext); - return bullet; -} - -void nsListItemFrame::PlaceOutsideBullet(nsIFrame* aBullet, - nsIPresContext* aCX) -{ - nsSize maxSize(0, 0); - nsReflowMetrics bulletSize; - - // Size the bullet - ReflowChild(aBullet, aCX, bulletSize, maxSize, nsnull); - - // We can only back the bullet over so far XXX what does nav do with - // a big bullet in a blockquote? does the bullet leak out of the - // blockquote or what? - nscoord minX = -mRect.x; - - // Get bullet style (which is our style) - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsIFontMetrics* fm = aCX->GetMetricsFor(font->mFont); - nscoord kidAscent = fm->GetMaxAscent(); - nscoord dx = fm->GetHeight() / 2; // from old layout engine - NS_RELEASE(fm); - - // Find the bullet x,y - nscoord x = 0; - nscoord y = 0; -#if 0 - nsIFrame* firstKid = mFirstChild; - if (nsnull != firstKid) { - nsIContent* kidContent = firstKid->GetContent(); - nsIStyleContext* kidStyleContext = firstKid->GetStyleContext(aCX); - nsStyleFont* kidFont = - (nsStyleFont*)kidStyleContext->GetData(kStyleFontSID); - nsPoint origin; - firstKid->GetOrigin(origin); - // XXX this is wrong if the first kid was relative positioned! - x = origin.x; - y = origin.y; - // XXX This is an approximation. If the kid has borders and - // padding then this value will be wrong. If the kid is a - // container then margins may mess it up as well. - nsIFontMetrics* fm = aCX->GetMetricsFor(kidFont->mFont); - kidAscent = fm->GetMaxAscent(); - NS_RELEASE(fm); - - NS_RELEASE(kidStyleContext); - NS_RELEASE(kidContent); - } -#endif - - x = x - dx - bulletSize.width; -#if XXX - // XXX can't do this yet: 1. our mRect value is not right on the - // first reflow; 2. it's the wrong limiter: nav4 compares against - // the window min x. - if (x < minX) { - x = minX; - } -#endif - y = y + kidAscent - bulletSize.ascent; - - aBullet->SetRect(nsRect(x, y, bulletSize.width, bulletSize.height)); -} - -// Return the reflow state for the list container that contains this -// list item frame. There may be no list container (a dangling LI) -// therefore this may return nsnull. -nsBlockReflowState* -nsListItemFrame::GetListContainerReflowState(nsIPresContext* aCX) -{ - nsBlockReflowState* state = nsnull; - nsIFrame* parent = mGeometricParent; - while (nsnull != parent) { - nsIHTMLFrameType* ft; - nsresult status = parent->QueryInterface(kIHTMLFrameTypeIID, (void**) &ft); - if (NS_OK == status) { - nsHTMLFrameType type = ft->GetFrameType(); - if (eHTMLFrame_Block == type) { - // The parent is a block. See if its content object is a list - // container. Only UL, OL, MENU or DIR can be list containers. - // XXX need something more flexible, say style? - nsIContent* parentContent; - - parent->GetContent(parentContent); - nsIAtom* tag = parentContent->GetTag(); - NS_RELEASE(parentContent); - if ((tag == nsHTMLAtoms::ul) || (tag == nsHTMLAtoms::ol) || - (tag == nsHTMLAtoms::menu) || (tag == nsHTMLAtoms::dir)) { - NS_RELEASE(tag); - break; - } - NS_RELEASE(tag); - } - } - parent->GetGeometricParent(parent); - } - if (nsnull != parent) { - nsIPresShell* shell = aCX->GetShell(); - state = (nsBlockReflowState*) shell->GetCachedData(parent); - NS_RELEASE(shell); - } - return state; -} - -/** - * The basic approach here is pretty simple: let our base class do all - * the hard work, and after it's done, get the bullet placed. We only - * have a bullet if we are not a continuation. - */ -// XXX we may need to grow to accomodate the bullet -// XXX check for compatability:
  • dah dah

    where is bullet? -NS_METHOD nsListItemFrame::ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - PRBool insideBullet = PR_FALSE; - - // Get bullet style (which is our style) - nsStyleList* myList = - (nsStyleList*)mStyleContext->GetData(kStyleListSID); - if (NS_STYLE_LIST_STYLE_POSITION_INSIDE == myList->mListStylePosition) { - insideBullet = PR_TRUE; - } - - nsIFrame* bullet = nsnull; - if (nsnull == mPrevInFlow) { - if (insideBullet) { - if (nsnull == mFirstChild) { - // Inside bullets get placed on the list immediately so that - // the regular reflow logic can place them. - bullet = CreateBullet(); - mFirstChild = bullet; - mChildCount++; - } else { - // We already have a first child. It's the bullet (check?) - // so we don't need to do anything here - } - } else { - if (nsnull == mFirstChild) { - // Create outside bullet the first time through - bullet = CreateBullet(); - } else { - // Pull bullet off list (we'll put it back later) - bullet = mFirstChild; - bullet->GetNextSibling(mFirstChild); - mChildCount--; - } - } - } - - // Let base class do things first - nsBlockReflowState state; - SetupState(aCX, state, aMaxSize, aMaxElementSize, aSpaceManager); - state.firstChildIsInsideBullet = insideBullet; - DoResizeReflow(aCX, state, aDesiredRect, aStatus); - - // Now place the bullet and put it at the head of the list of children - if (!insideBullet && (nsnull != bullet)) { - // XXX Change PlaceOutsideBullet to just size the bullet frame, then let - // the normal vertical alignment code run. The reason it's not - // implemented yet is that I don't have the ascent/descent - // information for the first line. - PlaceOutsideBullet(bullet, aCX); - bullet->SetNextSibling(mFirstChild); - mFirstChild = bullet; - mChildCount++; - if (nsnull == mLines) { - mLines = new PRInt32[1]; - mLines[0] = 1; - mNumLines = 1; - } else { - mLines[0]++; - } - } - return NS_OK; -} - -// XXX we may need to grow to accomodate the bullet -NS_METHOD nsListItemFrame::IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsListItemFrame::CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsListItemFrame* cf = new nsListItemFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aCX, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -// aDirtyRect is in our coordinate system -// child rect's are also in our coordinate system -void nsListItemFrame::PaintChildren(nsIPresContext& aCX, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsIView *pView; - - kid->GetView(pView); - if (nsnull == pView) { - nsRect kidRect; - kid->GetRect(kidRect); - nsRect damageArea; - PRBool overlap = damageArea.IntersectRect(aDirtyRect, kidRect); - // Note the special check here for our first child. We do this - // because we sometimes position bullets (our first child) outside - // of our frame. - if (overlap || (kid == mFirstChild)) { - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - aRenderingContext.PushState(); - aRenderingContext.Translate(kidRect.x, kidRect.y); - kid->Paint(aCX, aRenderingContext, kidDamageArea); - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, kidRect.width, kidRect.height); - } - aRenderingContext.PopState(); - } - } else { - NS_RELEASE(pView); - } - kid->GetNextSibling(kid); - } -} diff --git a/mozilla/layout/html/base/src/nsListItemFrame.h b/mozilla/layout/html/base/src/nsListItemFrame.h deleted file mode 100644 index c0369ecda63..00000000000 --- a/mozilla/layout/html/base/src/nsListItemFrame.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsListItemFrame_h___ -#define nsListItemFrame_h___ - -#include "nsBlockFrame.h" - -class nsListItemFrame : public nsBlockFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD ResizeReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aCX, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** - * Return the reflow state for the list container that contains this - * list item frame. There may be no list container (a dangling LI) - * therefore this may return nsnull. - */ - nsBlockReflowState* GetListContainerReflowState(nsIPresContext* aCX); - -protected: - nsListItemFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~nsListItemFrame(); - - nsIFrame* CreateBullet(); - - virtual void PaintChildren(nsIPresContext& aCX, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - void PlaceOutsideBullet(nsIFrame* aBullet, - nsIPresContext* aCX); -}; - -#endif /* nsListItemFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsPageFrame.cpp b/mozilla/layout/html/base/src/nsPageFrame.cpp deleted file mode 100644 index 7da6ddc801b..00000000000 --- a/mozilla/layout/html/base/src/nsPageFrame.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPageFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsReflowCommand.h" -#include "nsIRenderingContext.h" - -PageFrame::PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent) - : nsContainerFrame(aContent, aIndexInParent, aParent) -{ -} - -void PageFrame::CreateFirstChild(nsIPresContext* aPresContext) -{ - // Create a frame for our one and only content child - if (mContent->ChildCount() > 0) { - nsIContent* child = mContent->ChildAt(0); - - if (nsnull != child) { - // Create a frame - nsIContentDelegate* cd = child->GetDelegate(aPresContext); - if (nsnull != cd) { - mFirstChild = cd->CreateFrame(aPresContext, child, 0, this); - if (nsnull != mFirstChild) { - mChildCount = 1; - mLastContentOffset = mFirstContentOffset; - - // Resolve style and set the style context - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(child, this); - mFirstChild->SetStyleContext(kidStyleContext); - NS_RELEASE(kidStyleContext); - } - NS_RELEASE(cd); - } - NS_RELEASE(child); - } - } -} - -NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - aStatus = frComplete; // initialize out parameter - - // Do we have any children? - if (nsnull == mFirstChild) { - if (nsnull == mPrevInFlow) { - // Create the first child frame - CreateFirstChild(aPresContext); - } else { - PageFrame* prevPage = (PageFrame*)mPrevInFlow; - - NS_ASSERTION(!prevPage->mLastContentIsComplete, "bad continuing page"); - nsIFrame* prevLastChild; - prevPage->LastChild(prevLastChild); - - // Create a continuing child of the previous page's last child - prevLastChild->CreateContinuingFrame(aPresContext, this, mFirstChild); - mChildCount = 1; - mLastContentOffset = mFirstContentOffset; - } - } - - // Resize our frame allowing it only to be as big as we are - // XXX Pay attention to the page's border and padding... - if (nsnull != mFirstChild) { - // Get the child's desired size - aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize, - aMaxElementSize); - mLastContentIsComplete = PRBool(aStatus == frComplete); - - // Make sure the child is at least as tall as our max size (the containing window) - if (aDesiredSize.height < aMaxSize.height) { - aDesiredSize.height = aMaxSize.height; - } - - // Place and size the child - nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); - mFirstChild->SetRect(rect); - - // Is the frame complete? - if (frComplete == aStatus) { - nsIFrame* childNextInFlow; - - mFirstChild->GetNextInFlow(childNextInFlow); - NS_ASSERTION(nsnull == childNextInFlow, "bad child flow list"); - } - } - - // Return our desired size - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = aMaxSize.height; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - return NS_OK; -} - -// XXX Do something sensible in page mode... -NS_METHOD PageFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // We don't expect the target of the reflow command to be page frame - NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target"); - - nsSize maxSize(aMaxSize.width, NS_UNCONSTRAINEDSIZE); - nsIFrame* child; - - // Dispatch the reflow command to our pseudo frame. Allow it to be as high - // as it wants - aStatus = aReflowCommand.Next(aDesiredSize, maxSize, child); - - // Place and size the child. Make sure the child is at least as - // tall as our max size (the containing window) - if (nsnull != child) { - NS_ASSERTION(child == mFirstChild, "unexpected reflow command frame"); - if (aDesiredSize.height < aMaxSize.height) { - aDesiredSize.height = aMaxSize.height; - } - - nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); - child->SetRect(rect); - } - - return NS_OK; -} - -NS_METHOD PageFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - PageFrame* cf = new PageFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -NS_METHOD PageFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsContainerFrame::Paint(aPresContext, aRenderingContext, aDirtyRect); - - // For the time being paint a border around the page so we know - // where each page begins and ends - aRenderingContext.SetColor(NS_RGB(0, 0, 0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - return NS_OK; -} - -NS_METHOD PageFrame::ListTag(FILE* out) const -{ - fprintf(out, "*PAGE@%p", this); - return NS_OK; -} - diff --git a/mozilla/layout/html/base/src/nsPageFrame.h b/mozilla/layout/html/base/src/nsPageFrame.h deleted file mode 100644 index aaee82d3952..00000000000 --- a/mozilla/layout/html/base/src/nsPageFrame.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsPageFrame_h___ -#define nsPageFrame_h___ - -#include "nsHTMLContainerFrame.h" - -// Pseudo frame created by the root content frame -class PageFrame : public nsContainerFrame { -public: - PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - // Debugging - NS_IMETHOD ListTag(FILE* out = stdout) const; - -protected: - void CreateFirstChild(nsIPresContext* aPresContext); -}; - -#endif /* nsPageFrame_h___ */ - diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp deleted file mode 100644 index 902c2f2603f..00000000000 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsPlaceholderFrame.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIFloaterContainer.h" - -static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID); - -nsresult -PlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new PlaceholderFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -PlaceholderFrame::PlaceholderFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsFrame(aContent, aIndexInParent, aParent) -{ - mAnchoredItem = nsnull; -} - -PlaceholderFrame::~PlaceholderFrame() -{ -} - -NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - // Get the floater container in which we're inserted - nsIFloaterContainer* container = nsnull; - - for (nsIFrame* parent = mGeometricParent; parent; parent->GetGeometricParent(parent)) { - if (NS_OK == parent->QueryInterface(kIFloaterContainerIID, (void**)&container)) { - break; - } - } - NS_ASSERTION(nsnull != container, "no floater container"); - - // Have we created the anchored item yet? - if (nsnull == mAnchoredItem) { - // Create the anchored item - nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext); - - mAnchoredItem = delegate->CreateFrame(aPresContext, mContent, mIndexInParent, - mGeometricParent); - NS_RELEASE(delegate); - - // Set the style context for the frame - mAnchoredItem->SetStyleContext(mStyleContext); - - // Resize reflow the anchored item into the available space - // XXX Check for complete? - mAnchoredItem->ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - mAnchoredItem->SizeTo(aDesiredSize.width, aDesiredSize.height); - - // Now notify our containing block that there's a new floater - container->AddFloater(aPresContext, mAnchoredItem, this); - } else { - container->PlaceFloater(aPresContext, mAnchoredItem, this); - } - - return nsFrame::ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, aStatus); -} - -NS_METHOD PlaceholderFrame::ListTag(FILE* out) const -{ - fputs("*placeholder", out); - fprintf(out, "(%d)@%p", mIndexInParent, this); - return NS_OK; -} diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.h b/mozilla/layout/html/base/src/nsPlaceholderFrame.h deleted file mode 100644 index 6cae7e1c546..00000000000 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsPlaceholderFrame_h___ -#define nsPlaceholderFrame_h___ - -#include "nsFrame.h" - -// Implementation of a frame that's used as a placeholder for an anchored item -class PlaceholderFrame : public nsFrame -{ -public: - /** - * Create a new placeholder frame - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - // Returns the associated anchored item - nsIFrame* GetAnchoredItem() const {return mAnchoredItem;} - - // Resize reflow methods - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - NS_IMETHOD ListTag(FILE* out = stdout) const; - -protected: - // Constructor. Takes as arguments the content object, the index in parent, - // and the Frame for the content parent - PlaceholderFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - virtual ~PlaceholderFrame(); - - nsIFrame* mAnchoredItem; -}; - -#endif /* nsPlaceholderFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsRootPart.cpp b/mozilla/layout/html/base/src/nsRootPart.cpp deleted file mode 100644 index 55d1b4ab2f6..00000000000 --- a/mozilla/layout/html/base/src/nsRootPart.cpp +++ /dev/null @@ -1,507 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsContainerFrame.h" -#include "nsIDocument.h" -#include "nsReflowCommand.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsViewsCID.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsIContentDelegate.h" -#include "nsIWidget.h" -#include "nsHTMLIIDs.h" -#include "nsPageFrame.h" -#include "nsIRenderingContext.h" -#include "nsIDeviceContext.h" -#include "nsGUIEvent.h" -#include "nsStyleConsts.h" -#include "nsIViewManager.h" - -class RootFrame : public nsContainerFrame { -public: - RootFrame(nsIContent* aContent); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); -}; - -// Pseudo frame created by the root frame -class RootContentFrame : public nsContainerFrame { -public: - RootContentFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - -protected: - void CreateFirstChild(nsIPresContext* aPresContext); -}; - -//---------------------------------------------------------------------- - -RootFrame::RootFrame(nsIContent* aContent) - : nsContainerFrame(aContent, -1, nsnull) -{ -} - -NS_METHOD RootFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - aStatus = frComplete; - - // Do we have any children? - if (nsnull == mFirstChild) { - // No. Create a pseudo frame - mFirstChild = new RootContentFrame(mContent, mIndexInParent, this); - mChildCount = 1; - nsIStyleContext* style = aPresContext->ResolveStyleContextFor(mContent, this); - mFirstChild->SetStyleContext(style); - NS_RELEASE(style); - } - - // Resize the pseudo frame passing it our max size. It will choose whatever - // height its child frame wants... - if (nsnull != mFirstChild) { - nsReflowMetrics desiredSize; - - aStatus = ReflowChild(mFirstChild, aPresContext, desiredSize, aMaxSize, - aMaxElementSize); - - // Place and size the child - nsRect rect(0, 0, desiredSize.width, desiredSize.height); - mFirstChild->SetRect(rect); - } - mLastContentOffset = ((RootContentFrame*)mFirstChild)->GetLastContentOffset(); - - // Return the max size as our desired size - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = aMaxSize.height; - aDesiredSize.ascent = aMaxSize.height; - aDesiredSize.descent = 0; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - return NS_OK; -} - -NS_METHOD RootFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // We don't expect the target of the reflow command to be the root frame - NS_ASSERTION(aReflowCommand.GetTarget() != this, "root frame is reflow command target"); - - nsReflowMetrics desiredSize; - nsIFrame* child; - - // Dispatch the reflow command to our pseudo frame - aStatus = aReflowCommand.Next(desiredSize, aMaxSize, child); - - // Place and size the child - if (nsnull != child) { - NS_ASSERTION(child == mFirstChild, "unexpected reflow command frame"); - - nsRect rect(0, 0, desiredSize.width, desiredSize.height); - child->SetRect(rect); - } - - // Return the max size as our desired size - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = aMaxSize.height; - aDesiredSize.ascent = aMaxSize.height; - aDesiredSize.descent = 0; - return NS_OK; -} - -NS_METHOD RootFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ - switch (aEvent->message) { - case NS_MOUSE_MOVE: - case NS_MOUSE_ENTER: - { - nsIFrame* target = this; - PRInt32 cursor; - - GetCursorAt(aPresContext, aEvent->point, &target, cursor); - if (cursor == NS_STYLE_CURSOR_INHERIT) { - cursor = NS_STYLE_CURSOR_DEFAULT; - } - nsCursor c; - switch (cursor) { - default: - case NS_STYLE_CURSOR_DEFAULT: - c = eCursor_standard; - break; - case NS_STYLE_CURSOR_HAND: - c = eCursor_hyperlink; - break; - case NS_STYLE_CURSOR_IBEAM: - c = eCursor_select; - break; - } - nsIWidget* window; - target->GetWindow(window); - window->SetCursor(c); - } - break; - } - - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; -} - -//---------------------------------------------------------------------- - -RootContentFrame::RootContentFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsContainerFrame(aContent, aIndexInParent, aParent) -{ - // Create a view - nsIFrame* parent; - nsIView* view; - - GetParentWithView(parent); - NS_ASSERTION(parent, "GetParentWithView failed"); - nsIView* parView; - - parent->GetView(parView); - NS_ASSERTION(parView, "no parent with view"); - - // Create a view - static NS_DEFINE_IID(kViewCID, NS_VIEW_CID); - static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - - nsresult result = NSRepository::CreateInstance(kViewCID, - nsnull, - kIViewIID, - (void **)&view); - if (NS_OK == result) { - nsIView* rootView = parView; - nsIViewManager* viewManager = rootView->GetViewManager(); - - // Initialize the view - NS_ASSERTION(nsnull != viewManager, "null view manager"); - - view->Init(viewManager, mRect, rootView); - viewManager->InsertChild(rootView, view, 0); - - NS_RELEASE(viewManager); - - // Remember our view - SetView(view); - NS_RELEASE(view); - } - NS_RELEASE(parView); -} - -void RootContentFrame::CreateFirstChild(nsIPresContext* aPresContext) -{ - // Are we paginated? - if (aPresContext->IsPaginated()) { - // Yes. Create the first page frame - mFirstChild = new PageFrame(mContent, mIndexInParent, this); - mChildCount = 1; - mLastContentOffset = mFirstContentOffset; - - } else { - // Create a frame for our one and only content child - if (mContent->ChildCount() > 0) { - nsIContent* child = mContent->ChildAt(0); - - if (nsnull != child) { - // Create a frame - nsIContentDelegate* cd = child->GetDelegate(aPresContext); - if (nsnull != cd) { - mFirstChild = cd->CreateFrame(aPresContext, child, 0, this); - if (nsnull != mFirstChild) { - mChildCount = 1; - mLastContentOffset = mFirstContentOffset; - - // Resolve style and set the style context - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(child, this); - mFirstChild->SetStyleContext(kidStyleContext); - NS_RELEASE(kidStyleContext); - } - NS_RELEASE(cd); - } - NS_RELEASE(child); - } - } - } -} - -// XXX Hack -#define PAGE_SPACING 100 - -NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - aStatus = frComplete; - - // Do we have any children? - if (nsnull == mFirstChild) { - // No, create the first child frame - CreateFirstChild(aPresContext); - } - - // Resize our frames - if (nsnull != mFirstChild) { - if (aPresContext->IsPaginated()) { - nscoord y = PAGE_SPACING; - nsReflowMetrics kidSize; - nsSize pageSize(aPresContext->GetPageWidth(), - aPresContext->GetPageHeight()); - - // Tile the pages vertically - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - // Reflow the page - ReflowStatus status = ReflowChild(kidFrame, aPresContext, kidSize, - pageSize, aMaxElementSize); - - // Place and size the page. If the page is narrower than our max width then - // center it horizontally - nsIDeviceContext *dx = aPresContext->GetDeviceContext(); - PRInt32 extra = aMaxSize.width - kidSize.width - NS_TO_INT_ROUND(dx->GetScrollBarWidth()); - NS_RELEASE(dx); - kidFrame->SetRect(nsRect(extra > 0 ? extra / 2 : 0, y, kidSize.width, kidSize.height)); - y += kidSize.height; - - // Leave a slight gap between the pages - y += PAGE_SPACING; - - // Is the page complete? - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { - NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); - } else if (nsnull == kidNextInFlow) { - // The page isn't complete and it doesn't have a next-in-flow so - // create a continuing page - nsIFrame* continuingPage; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingPage); - - // Add it to our child list -#ifdef NS_DEBUG - nsIFrame* kidNextSibling; - - kidFrame->GetNextSibling(kidNextSibling); - NS_ASSERTION(nsnull == kidNextSibling, "unexpected sibling"); -#endif - kidFrame->SetNextSibling(continuingPage); - mChildCount++; - } - - // Get the next page - kidFrame->GetNextSibling(kidFrame); - } - - // Return our desired size - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = y; - - } else { - // Allow the frame to be as wide as our max width, and as high - // as it wants to be. - nsSize maxSize(aMaxSize.width, NS_UNCONSTRAINEDSIZE); - - // Get the child's desired size. Our child's desired height is our - // desired size - aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, maxSize, - aMaxElementSize); - NS_ASSERTION(frComplete == aStatus, "bad status"); - - // Place and size the child. Make sure the child is at least as - // tall as our max size (the containing window) - if (aDesiredSize.height < aMaxSize.height) { - aDesiredSize.height = aMaxSize.height; - } - - // Place and size the child - nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); - mFirstChild->SetRect(rect); - } - } - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - return NS_OK; -} - -// XXX Do something sensible for page mode... -NS_METHOD RootContentFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - // We don't expect the target of the reflow command to be the root - // content frame - NS_ASSERTION(aReflowCommand.GetTarget() != this, "root content frame is reflow command target"); - - nsSize maxSize(aMaxSize.width, NS_UNCONSTRAINEDSIZE); - nsIFrame* child; - - // Dispatch the reflow command to our pseudo frame. Allow it to be as high - // as it wants - aStatus = aReflowCommand.Next(aDesiredSize, maxSize, child); - - // Place and size the child. Make sure the child is at least as - // tall as our max size (the containing window) - if (nsnull != child) { - NS_ASSERTION(child == mFirstChild, "unexpected reflow command frame"); - if (aDesiredSize.height < aMaxSize.height) { - aDesiredSize.height = aMaxSize.height; - } - - nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height); - child->SetRect(rect); - } - - return NS_OK; -} - -NS_METHOD RootContentFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // If we're paginated then fill the dirty rect with white - if (aPresContext.IsPaginated()) { - // Cross hatching would be nicer... - aRenderingContext.SetColor(NS_RGB(255,255,255)); - aRenderingContext.FillRect(aDirtyRect); - } - - nsContainerFrame::Paint(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -//---------------------------------------------------------------------- - -class RootPart : public nsHTMLContainer { -public: - RootPart(nsIDocument* aDoc); - - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - -protected: - virtual ~RootPart(); -}; - -RootPart::RootPart(nsIDocument* aDoc) -{ - NS_PRECONDITION(nsnull != aDoc, "null ptr"); - mDocument = aDoc; - mTag = NS_NewAtom("HTML"); -} - -RootPart::~RootPart() -{ -} - -nsrefcnt RootPart::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt RootPart::Release(void) -{ - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} - -nsIFrame* RootPart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new RootFrame(this); - return rv; -} - -nsresult -NS_NewRootPart(nsIHTMLContent** aInstancePtrResult, - nsIDocument* aDocument) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* root = new RootPart(aDocument); - if (nsnull == root) { - return NS_ERROR_OUT_OF_MEMORY; - } - aDocument->SetRootContent(root); - return root->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsSpacerPart.cpp b/mozilla/layout/html/base/src/nsSpacerPart.cpp deleted file mode 100644 index 6cd6152b1e1..00000000000 --- a/mozilla/layout/html/base/src/nsSpacerPart.cpp +++ /dev/null @@ -1,307 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLTagContent.h" -#include "nsBlockFrame.h" -#include "nsHTMLIIDs.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsHTMLAtoms.h" -#if 0 -#include "nsStyleConsts.h" -#include "nsIHTMLAttributes.h" -#endif - -// Spacer type's -#define TYPE_WORD 0 // horizontal space -#define TYPE_LINE 1 // line-break + vertical space -#define TYPE_IMAGE 2 // acts like a sized image with nothing to see - -class SpacerFrame : public nsFrame -{ -public: - SpacerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual ReflowStatus ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); -protected: - virtual ~SpacerFrame(); -}; - -class SpacerPart : public nsHTMLTagContent { -public: - SpacerPart(nsIAtom* aTag); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const; - - virtual nsContentAttr GetAttribute(const nsString& aName, - nsString& aResult) const; - - PRUint8 mType; - -protected: - virtual ~SpacerPart(); -}; - -//---------------------------------------------------------------------- - -SpacerFrame::SpacerFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -SpacerFrame::~SpacerFrame() -{ -} - -nsIFrame::ReflowStatus -SpacerFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - // Get cached state for containing block frame - nsBlockReflowState* state = nsnull; - nsIFrame* parent = mGeometricParent; - while (nsnull != parent) { - nsIHTMLFrameType* ft; - nsresult status = parent->QueryInterface(kIHTMLFrameTypeIID, (void**) &ft); - if (NS_OK == status) { - nsHTMLFrameType type = ft->GetFrameType(); - if (eHTMLFrame_Block == type) { - break; - } - } - parent->GetGeometricParent(parent); - } - if (nsnull != parent) { - nsIPresShell* shell = aPresContext->GetShell(); - state = (nsBlockReflowState*) shell->GetCachedData(parent); - NS_RELEASE(shell); - } - - // By default, we have no area - aDesiredSize.width = 0; - aDesiredSize.height = 0; - aDesiredSize.ascent = 0; - aDesiredSize.descent = 0; - - if (nsnull == state) { - // We don't do anything unless we are in a block container somewhere - return frComplete; - } - - nscoord width = 0; - nscoord height = 0; - SpacerPart* part = (SpacerPart*) mContent; - PRUint8 type = part->mType; - nsContentAttr ca; - if (type != TYPE_IMAGE) { - nsHTMLValue val; - ca = part->GetAttribute(nsHTMLAtoms::size, val); - if (eContentAttr_HasValue == ca) { - width = val.GetIntValue(); - } - } else { - nsHTMLValue val; - ca = part->GetAttribute(nsHTMLAtoms::width, val); - if (eContentAttr_HasValue == ca) { - if (eHTMLUnit_Absolute == val.GetUnit()) { - width = val.GetIntValue(); - } - else if (eHTMLUnit_Percent == val.GetUnit()) { - // XXX percent of what? - } - } - ca = part->GetAttribute(nsHTMLAtoms::height, val); - if (eContentAttr_HasValue == ca) { - if (eHTMLUnit_Absolute == val.GetUnit()) { - height = val.GetIntValue(); - } - else if (eHTMLUnit_Percent == val.GetUnit()) { - // XXX percent of what? - } - } - } - - float p2t = aPresContext->GetPixelsToTwips(); - switch (type) { - case TYPE_WORD: - if (0 != width) { - aDesiredSize.width = nscoord(width * p2t); - } - else { - // XXX navigator ignores spacers of size 0 and won't cause a word - // break; we need a keepWithPrevious flag to fix this bug - } - break; - - case TYPE_LINE: - if (0 != width) { - state->breakBeforeChild = PR_TRUE; - state->breakAfterChild = PR_TRUE; - aDesiredSize.height = nscoord(width * p2t); - aDesiredSize.ascent = aDesiredSize.height; - } - else { - // XXX navigator ignores spacers of size 0 and won't cause a word - // break; we need a keepWithPrevious flag to fix this bug - } - break; - - case TYPE_IMAGE: - aDesiredSize.width = nscoord(width * p2t); - aDesiredSize.height = nscoord(height * p2t); - aDesiredSize.ascent = aDesiredSize.height; - break; - } - - return frComplete; -} - -//---------------------------------------------------------------------- - -SpacerPart::SpacerPart(nsIAtom* aTag) - : nsHTMLTagContent(aTag) -{ -} - -SpacerPart::~SpacerPart() -{ -} - -nsIFrame* SpacerPart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new SpacerFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -void SpacerPart::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::type) { - PRUint8 type = TYPE_WORD; - if (aValue.EqualsIgnoreCase("line") || - aValue.EqualsIgnoreCase("vert") || - aValue.EqualsIgnoreCase("vertical")) { - type = TYPE_LINE; - } - else if (aValue.EqualsIgnoreCase("block")) { - type = TYPE_IMAGE; - } - mType = type; - } - else if (aAttribute == nsHTMLAtoms::size) { - nsHTMLValue val; - ParseValue(aValue, 0, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - } - else if (aAttribute == nsHTMLAtoms::align) { - nsHTMLValue val; - ParseAlignParam(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - } - else if ((aAttribute == nsHTMLAtoms::width) || - (aAttribute == nsHTMLAtoms::height)) { - nsHTMLValue val; - ParseValueOrPercent(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - } -} - -nsContentAttr SpacerPart::GetAttribute(const nsString& aName, - nsString& aResult) const -{ - aResult.SetLength(0); - nsIAtom* atom = NS_NewAtom(aName); - nsContentAttr ca = eContentAttr_NotThere; - nsHTMLValue value; - if (atom == nsHTMLAtoms::type) { - switch (mType) { - case TYPE_WORD: - break; - case TYPE_LINE: - aResult.Append("line"); - ca = eContentAttr_HasValue; - break; - case TYPE_IMAGE: - aResult.Append("block"); - ca = eContentAttr_HasValue; - break; - } - } - else if ((atom == nsHTMLAtoms::size) || - (atom == nsHTMLAtoms::width) || - (atom == nsHTMLAtoms::height)) { - if (eContentAttr_HasValue == nsHTMLTagContent::GetAttribute(atom, value)) { - ValueOrPercentToString(value, aResult); - ca = eContentAttr_HasValue; - } - } - else if (atom == nsHTMLAtoms::align) { - if (eContentAttr_HasValue == nsHTMLTagContent::GetAttribute(atom, value)) { - AlignParamToString(value, aResult); - ca = eContentAttr_HasValue; - } - } - NS_RELEASE(atom); - return ca; -} - -nsContentAttr SpacerPart::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const -{ - aValue.Reset(); - if ((mType != TYPE_IMAGE) && - ((aAttribute == nsHTMLAtoms::width) || - (aAttribute == nsHTMLAtoms::height) || - (aAttribute == nsHTMLAtoms::align))) { - // Pretend that these attributes are not present when the spacer - // is not a block spacer. - return eContentAttr_NotThere; - } - return nsHTMLTagContent::GetAttribute(aAttribute, aValue); -} - -nsresult -NS_NewHTMLSpacer(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* it = new SpacerPart(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsTextContent.cpp b/mozilla/layout/html/base/src/nsTextContent.cpp deleted file mode 100644 index efe14b4bcc8..00000000000 --- a/mozilla/layout/html/base/src/nsTextContent.cpp +++ /dev/null @@ -1,1540 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsCRT.h" -#include "nsSplittableFrame.h" -#include "nsHTMLContent.h" -#include "nsString.h" -#include "nsIPresContext.h" -#include "nsStyleConsts.h" -#include "nsIStyleContext.h" -#include "nsCoord.h" -#include "nsIFontMetrics.h" -#include "nsIRenderingContext.h" -#include "nsHTMLIIDs.h" -#include "nsIPresShell.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsITimerCallback.h" -#include "nsITimer.h" -#include "nsBlockFrame.h" -#include "prtime.h" -#include "prprf.h" -#include "nsIDOMText.h" - -#ifdef NS_DEBUG -#undef NOISY -#undef NOISY_BLINK -#else -#undef NOISY -#undef NOISY_BLINK -#endif - -// XXX TODO: -// 0. tune justified text -// 1. add in a rendering method that can render justified text -// 2. text renderer should negotiate with rendering context/font -// metrics to see what it can handle; for example, if the renderer can -// automatically deal with underlining, strikethrough, justification, -// etc, then the text renderer should let the rc do the work; -// otherwise there should be XP fallback code here. - -// XXX Speedup ideas -// 1. justified text can use word width information during resize reflows -// 2. when we are doing an unconstrained reflow we know we are going to -// get reflowed again; collect up the word widths we are computing as we -// do this and then save them in the mWords; later on when we get reflowed -// again we can destroy them -// 3. when pulling up text get word width information from next-in-flow - -// XXX temporary -#define XP_IS_SPACE(_ch) \ - (((_ch) == ' ') || ((_ch) == '\t') || ((_ch) == '\n')) - -// XXX need more of this in nsIFontMetrics.GetWidth -#define CH_NBSP 160 - -// XXX use a PreTextFrame for pre-formatted text? - -#if 0 -static NS_DEFINE_IID(kITextContentIID, NS_ITEXTCONTENT_IID); -#endif - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kIScriptObjectOwner, NS_ISCRIPTOBJECTOWNER_IID); - -class TextFrame; - -class TextTimer : public nsITimerCallback { -public: - TextTimer(); - ~TextTimer(); - - NS_DECL_ISUPPORTS - - void AddFrame(TextFrame* aFrame); - - PRBool RemoveFrame(TextFrame* aFrame); - - PRInt32 FrameCount(); - - void Start(); - - void Stop(); - - virtual void Notify(nsITimer *timer); - - nsITimer* mTimer; - nsVoidArray mFrames; -}; - -class TextFrame : public nsSplittableFrame { -public: - TextFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, - nsReflowMetrics& aMetrics); - - NS_IMETHOD JustifyReflow(nsIPresContext* aCX, - nscoord aAvailableSpace); - - NS_IMETHOD GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor); - - NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; - -protected: - virtual ~TextFrame(); - - void PaintRegularText(nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - nscoord dx, nscoord dy); - - void PaintJustifiedText(nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - nscoord dx, nscoord dy); - - ReflowStatus ReflowPre(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsStyleFont& aFont, - PRInt32 aStartingOffset, - nsBlockReflowState* aState); - - ReflowStatus ReflowNormal(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsStyleFont& aFont, - nsStyleText& aTextStyle, - PRInt32 aStartingOffset, - nsBlockReflowState* aState); - -public: - PRInt32 mContentOffset; - PRInt32 mContentLength; - PRUint16 mFlags; - PRUint16 mColumn; - - // When this text frame is justified, this pointer is not null - // and points to data about each word/space in the text - PRUint32* mWords; -#ifdef DEBUG_JUSTIFY - PRInt32 mNumWords; -#endif -}; - -// Flag information used by rendering code. This information is -// computed by the ResizeReflow code. Remaining bits are used by the -// tab count. -#define TEXT_SKIP_LEADING_WS 0x1 -#define TEXT_HAS_MULTIBYTE 0x2 -#define TEXT_IS_PRE 0x4 -#define TEXT_BLINK_ON 0x8 - -#define TEXT_GET_TAB_COUNT(_mf) ((_mf) >> 4) -#define TEXT_SET_TAB_COUNT(_mf,_tabs) (_mf) = (_mf) | ((_tabs)<< 4) - -// mWords bit definitions -#define WORD_IS_WORD 0x80000000L -#define WORD_IS_SPACE 0x00000000L -#define WORD_LENGTH_MASK 0x000000FFL -#define WORD_LENGTH_SHIFT 0 -#define WORD_WIDTH_MASK 0x7FFFFF00L -#define WORD_WIDTH_SHIFT 8 -#define MAX_WORD_LENGTH 256 -#define MAX_WORD_WIDTH 0x7FFFFFL - -#define GET_WORD_LENGTH(_wi) \ - ((PRIntn) (((_wi) & WORD_LENGTH_MASK)/* >> WORD_LENGTH_SHIFT*/)) -#define GET_WORD_WIDTH(_wi) \ - ((nscoord) ((PRUint32(_wi) & WORD_WIDTH_MASK) >> WORD_WIDTH_SHIFT)) - -class Text : public nsHTMLContent, public nsIDOMText { -public: - Text(const PRUnichar* aText, PRInt32 aLength); - - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - -#if 0 - virtual PRInt32 GetLength(); - virtual void GetText(nsStringBuf* aBuf, PRInt32 aOffset, PRInt32 aCount); -#endif - - virtual void List(FILE* out, PRInt32 aIndent) const; - - virtual void ToHTMLString(nsString& aBuf) const; - - virtual nsIFrame* CreateFrame(nsIPresContext* aCX, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - // nsIScriptObjectOwner interface - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - - // nsIDOMText interface - virtual nsresult GetNodeType(PRInt32 *aType); - virtual nsresult GetParentNode(nsIDOMNode **aNode); - virtual nsresult GetChildNodes(nsIDOMNodeIterator **aIterator); - virtual nsresult HasChildNodes(); - virtual nsresult GetFirstChild(nsIDOMNode **aNode); - virtual nsresult GetPreviousSibling(nsIDOMNode **aNode); - virtual nsresult GetNextSibling(nsIDOMNode **aNode); - virtual nsresult InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild); - virtual nsresult ReplaceChild(nsIDOMNode *newChild, - nsIDOMNode *oldChild); - virtual nsresult RemoveChild(nsIDOMNode *oldChild); - virtual nsresult GetData(nsString &aString); - virtual nsresult SetData(nsString &aString); - virtual nsresult Append(nsString &aData); - virtual nsresult Insert(int offset, nsString &aData); - virtual nsresult Delete(int offset, int count); - virtual nsresult Replace(int offset, int count, nsString &aData); - virtual nsresult Splice(nsIDOMElement *element, int offset, int count); - - void ToCString(nsString& aBuf, PRInt32 aOffset, PRInt32 aLen) const; - - PRUnichar* mText; - PRInt32 mLength; - -protected: - Text(); - virtual ~Text(); -}; - -//---------------------------------------------------------------------- - -static PRBool gBlinkTextOff; -static TextTimer* gTextBlinker; -#ifdef NOISY_BLINK -static PRTime gLastTick; -#endif - -TextTimer::TextTimer() -{ - NS_INIT_REFCNT(); - mTimer = nsnull; -} - -TextTimer::~TextTimer() -{ - Stop(); -} - -void TextTimer::Start() -{ - nsresult rv = NS_NewTimer(&mTimer); - if (NS_OK == rv) { - mTimer->Init(this, 750); - } -} - -void TextTimer::Stop() -{ - NS_IF_RELEASE(mTimer); -} - -static NS_DEFINE_IID(kITimerCallbackIID, NS_ITIMERCALLBACK_IID); -NS_IMPL_ISUPPORTS(TextTimer, kITimerCallbackIID); - -void TextTimer::AddFrame(TextFrame* aFrame) { - mFrames.AppendElement(aFrame); - if (1 == mFrames.Count()) { - Start(); - } -printf("%d blinking frames [add %p]\n", mFrames.Count(), aFrame); -} - -PRBool TextTimer::RemoveFrame(TextFrame* aFrame) { - PRBool rv = mFrames.RemoveElement(aFrame); - if (0 == mFrames.Count()) { - Stop(); - } -printf("%d blinking frames [remove %p] [%s]\n", - mFrames.Count(), aFrame, rv ? "true" : "FALSE"); - return rv; -} - -PRInt32 TextTimer::FrameCount() { - return mFrames.Count(); -} - -void TextTimer::Notify(nsITimer *timer) -{ - // Toggle blink state bit so that text code knows whether or not to - // render. All text code shares the same flag so that they all blink - // in unison. - gBlinkTextOff = PRBool(!gBlinkTextOff); - - // XXX hack to get auto-repeating timers; restart before doing - // expensive work so that time between ticks is more even - Stop(); - Start(); - -#ifdef NOISY_BLINK - PRTime now = PR_Now(); - char buf[50]; - PRTime delta; - LL_SUB(delta, now, gLastTick); - gLastTick = now; - PR_snprintf(buf, sizeof(buf), "%lldusec", delta); - printf("%s\n", buf); -#endif - - PRInt32 i, n = mFrames.Count(); - for (i = 0; i < n; i++) { - TextFrame* text = (TextFrame*) mFrames.ElementAt(i); - - // Determine damaged area and tell view manager to redraw it - nsPoint offset; - nsRect bounds; - text->GetRect(bounds); - nsIView* view; - text->GetOffsetFromView(offset, view); - nsIViewManager* vm = view->GetViewManager(); - bounds.x = offset.x; - bounds.y = offset.y; - vm->UpdateView(view, bounds, 0); - NS_RELEASE(vm); - NS_RELEASE(view); - } -} - -//---------------------------------------------------------------------- - -TextFrame::TextFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsSplittableFrame(aContent, aIndexInParent, aParentFrame) -{ - if (nsnull == gTextBlinker) { - // Create text timer the first time out - gTextBlinker = new TextTimer(); - } - NS_ADDREF(gTextBlinker); -} - -TextFrame::~TextFrame() -{ - if (0 != (mFlags & TEXT_BLINK_ON)) { - NS_ASSERTION(nsnull != gTextBlinker, "corrupted blinker"); - gTextBlinker->RemoveFrame(this); - } - if (0 == gTextBlinker->Release()) { - // Release text timer when the last text frame is gone - gTextBlinker = nsnull; - } - if (nsnull != mWords) { - delete mWords; - } -} - -NS_METHOD TextFrame::GetCursorAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - PRInt32& aCursor) -{ - aCursor = NS_STYLE_CURSOR_IBEAM; - return NS_OK; -} - -// XXX it would be nice to use a method pointer here, but I don't want -// to pay for the storage. - -NS_METHOD TextFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - if ((0 != (mFlags & TEXT_BLINK_ON)) && gBlinkTextOff) { - return NS_OK; - } - - // Get style data - nsStyleColor* color = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - - // Set font and color - aRenderingContext.SetColor(color->mColor); - aRenderingContext.SetFont(font->mFont); - - if (nsnull != mWords) { - PaintJustifiedText(aRenderingContext, aDirtyRect, 0, 0); - if (font->mThreeD) { - nscoord onePixel = nscoord(1.0f * aPresContext.GetPixelsToTwips()); - aRenderingContext.SetColor(color->mBackgroundColor); - PaintJustifiedText(aRenderingContext, aDirtyRect, onePixel, onePixel); - } - return NS_OK; - } - PaintRegularText(aRenderingContext, aDirtyRect, 0, 0); - if (font->mThreeD) { - nscoord onePixel = nscoord(1.0f * aPresContext.GetPixelsToTwips()); - aRenderingContext.SetColor(color->mBackgroundColor); - PaintRegularText(aRenderingContext, aDirtyRect, onePixel, onePixel); - } - - return NS_OK; -} - -void TextFrame::PaintRegularText(nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - nscoord dx, nscoord dy) -{ - // Skip leading space if necessary - Text* txt = (Text*) mContent; - const PRUnichar* cp = txt->mText + mContentOffset; - const PRUnichar* end = cp + mContentLength; - if ((mFlags & TEXT_SKIP_LEADING_WS) != 0) { - while (cp < end) { - PRUnichar ch = *cp++; - if (!XP_IS_SPACE(ch)) { - cp--; - break; - } - } - } - - if ((mFlags & TEXT_IS_PRE) != 0) { - if ((mFlags & TEXT_HAS_MULTIBYTE) != 0) { - // XXX to be written - } else { - PRIntn tabs = TEXT_GET_TAB_COUNT(mFlags); - - // Make a copy of the text we are to render, translating tabs - // into whitespace. - char buf[100]; - char* s = buf; - char* s0 = s; - PRInt32 maxLen = (end - cp) + 8*tabs; - if (maxLen > sizeof(buf)) { - s0 = s = new char[maxLen]; - } - - // Translate tabs into whitespace; translate other whitespace into - // spaces. - PRIntn col = (PRIntn) mColumn; - while (cp < end) { - PRUint8 ch = (PRUint8) *cp++; - if (XP_IS_SPACE(ch)) { - if (ch == '\t') { - PRIntn spaces = 8 - (col & 7); - col += spaces; - while (--spaces >= 0) { - *s++ = ' '; - } - continue; - } else { - *s++ = ' '; - } - } else if (ch == CH_NBSP) { - *s++ = ' '; - } else { - *s++ = ch; - } - col++; - } - - // Strip trailing whitespace - if (s != s0) { - if (s[-1] == ' ') { - s--; - } - } - - // Render the text - aRenderingContext.DrawString(s0, s - s0, dx, dy, mRect.width); - - if (s0 != buf) { - delete s0; - } - } - } else { - if ((mFlags & TEXT_HAS_MULTIBYTE) != 0) { - // XXX to be written - } else { - // Make a copy of the text we are to render, compressing out - // whitespace; translating whitespace to literal spaces; - // eliminating trailing whitespace. - char buf[100]; - char* s = buf; - char* s0 = s; - PRInt32 maxLen = end - cp; - if (maxLen > sizeof(buf)) { - s0 = s = new char[maxLen]; - } - - // Compress down the whitespace - while (cp < end) { - PRUint8 ch = (PRUint8) *cp++; - if (XP_IS_SPACE(ch)) { - while (cp < end) { - ch = (PRUint8) *cp++; - if (!XP_IS_SPACE(ch)) { - cp--; - break; - } - } - *s++ = ' '; - } else { - *s++ = ch; - } - } - - // Strip trailing whitespace - if (s != s0) { - if (s[-1] == ' ') { - s--; - } - } - - // Render the text - aRenderingContext.DrawString(s0, s - s0, dx, dy, mRect.width); - - if (s0 != buf) { - delete s0; - } - } - } -} - -void TextFrame::PaintJustifiedText(nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect, - nscoord dx, nscoord dy) -{ - Text* txt = (Text*) mContent; - const PRUnichar* cp = txt->mText + mContentOffset; - const PRUnichar* end = cp + mContentLength; - - // Get a word buffer that's big enough to hold all of the text in - // case all of the text happens to be a word (not possible given how - // the justification workds, but it's the fastest check that gets us - // a big enough buffer). We only do this if we aren't going to use - // multibyte rendering. - char buf[100]; - char* s0 = buf; - if ((mFlags & TEXT_HAS_MULTIBYTE) == 0) { - PRInt32 maxLen = end - cp; - if (maxLen > sizeof(buf)) { - s0 = new char[maxLen]; - } - } - - // XXX justified text doesn't render underlines (etc) over spaces - // while regular text does...fix this? - PRUint32* wp = mWords; - PRInt32 total = mContentLength; - nscoord x = dx; -#ifdef DEBUG_JUSTIFY - PRIntn numWords = mNumWords; -#endif - while (total != 0) { -#ifdef DEBUG_JUSTIFY - NS_ASSERTION(numWords > 0, "bad word data"); -#endif - PRUint32 wordInfo = *wp++; - nscoord wordWidth = GET_WORD_WIDTH(wordInfo); - PRIntn wordLen = GET_WORD_LENGTH(wordInfo); - if (wordInfo & WORD_IS_WORD) { - if (mFlags & TEXT_HAS_MULTIBYTE) { - aRenderingContext.DrawString(cp, wordLen, x, dy, mRect.width); - cp += wordLen; - } else { - char* s = s0; - char* es = s + wordLen; - while (s < es) { - PRUint8 ch = (PRUint8) *cp++; - *s++ = ch; - } - aRenderingContext.DrawString(s0, s - s0, x, dy, mRect.width); - } - } else { - // skip over space characters in text array - cp += wordLen; - } - x += wordWidth; - total -= wordLen; -#ifdef DEBUG_JUSTIFY - --numWords; - NS_ASSERTION(total >= 0, "bad word data"); -#endif - } - - if (s0 != buf) { - delete s0; - } -} - -NS_METHOD TextFrame::GetReflowMetrics(nsIPresContext* aCX, - nsReflowMetrics& aMetrics) -{ - aMetrics.width = mRect.width; - aMetrics.height = mRect.height; - - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsIFontMetrics* fm = aCX->GetMetricsFor(font->mFont); - aMetrics.ascent = fm->GetMaxAscent(); - aMetrics.descent = fm->GetMaxDescent(); - NS_RELEASE(fm); - return NS_OK; -} - -NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ -#ifdef NOISY - ListTag(stdout); - printf(": resize reflow into %g,%g\n", - NS_TWIPS_TO_POINTS_FLOAT(aMaxSize.width), - NS_TWIPS_TO_POINTS_FLOAT(aMaxSize.height)); -#endif - - // Wipe out old justification information since it's going to change - if (nsnull != mWords) { - delete mWords; - mWords = nsnull; - } -#ifdef DEBUG_JUSTIFY - mNumWords = 0; -#endif - - // Get starting offset into the content - PRInt32 startingOffset = 0; - if (nsnull != mPrevInFlow) { - TextFrame* prev = (TextFrame*) mPrevInFlow; - startingOffset = prev->mContentOffset + prev->mContentLength; - } - - // Get cached state for containing block frame - nsBlockReflowState* state = nsnull; - nsIFrame* parent = mGeometricParent; - while (nsnull != parent) { - nsIHTMLFrameType* ft; - nsresult status = parent->QueryInterface(kIHTMLFrameTypeIID, (void**) &ft); - if (NS_OK == status) { - nsHTMLFrameType type = ft->GetFrameType(); - if (eHTMLFrame_Block == type) { - break; - } - } - parent->GetGeometricParent(parent); - } - if (nsnull != parent) { - nsIPresShell* shell = aCX->GetShell(); - state = (nsBlockReflowState*) shell->GetCachedData(parent); - NS_RELEASE(shell); - } - - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - - // Initialize mFlags (without destroying the TEXT_BLINK_ON bit) bits - // that are filled in by the reflow routines. - mFlags &= TEXT_BLINK_ON; - if (font->mFont.decorations & NS_STYLE_TEXT_DECORATION_BLINK) { - if (0 == (mFlags & TEXT_BLINK_ON)) { - mFlags |= TEXT_BLINK_ON; - gTextBlinker->AddFrame(this); - } - } - - nsStyleText* text = - (nsStyleText*)mStyleContext->GetData(kStyleTextSID); - - if (NS_STYLE_WHITESPACE_PRE == text->mWhiteSpace) { - // Use a specialized routine for pre-formatted text - aStatus = ReflowPre(aCX, aDesiredSize, aMaxSize, - aMaxElementSize, *font, startingOffset, state); - } else { - // Use normal wrapping routine for non-pre text (this includes - // text that is not wrapping) - aStatus = ReflowNormal(aCX, aDesiredSize, aMaxSize, - aMaxElementSize, *font, *text, - startingOffset, state); - } - -#ifdef NOISY - ListTag(stdout); - printf(": reflow %scomplete [flags=%x]\n", - ((aStatus == frComplete) ? "" : "not "), mFlags); -#endif - return NS_OK; -} - -// Reflow normal text (stuff that doesn't have to deal with horizontal -// tabs). Normal text reflow may or may not wrap depending on the -// "whiteSpace" style property. -nsIFrame::ReflowStatus -TextFrame::ReflowNormal(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsStyleFont& aFont, - nsStyleText& aTextStyle, - PRInt32 aStartingOffset, - nsBlockReflowState* aState) -{ - Text* txt = (Text*) mContent; - const PRUnichar* cp = txt->mText + aStartingOffset; - const PRUnichar* end = cp + txt->mLength - aStartingOffset; - const PRUnichar* cpStart = cp; - mContentOffset = aStartingOffset; - - nsIFontMetrics* fm = aCX->GetMetricsFor(aFont.mFont); - PRInt32 spaceWidth = fm->GetWidth(' '); - PRBool atLeftMargin = PR_TRUE; - PRBool wrapping = PR_TRUE; - if (NS_STYLE_WHITESPACE_NORMAL != aTextStyle.mWhiteSpace) { - wrapping = PR_FALSE; - } - - // Set whitespace skip flag - PRBool skipWhitespace = PR_FALSE; - if (nsnull != aState) { - if (!aState->allowLeadingWhitespace) { - skipWhitespace = PR_TRUE; - mFlags |= TEXT_SKIP_LEADING_WS; - } - } - - // Try to fit as much of the text as possible. Note that if we are - // at the left margin then the first word always fits. In addition, - // we compute the size of the largest word that we contain. If we - // end up containing nothing (because there isn't enough space for - // the first word) then we still compute the size of that first - // non-fitting word. - - // XXX XP_IS_SPACE must not return true for the unicode   character - // XXX what about &zwj and it's cousins? - nscoord x = 0; - nscoord maxWidth = aMaxSize.width; - nscoord maxWordWidth = 0; - const PRUnichar* lastWordEnd = cpStart; - PRBool hasMultibyte = PR_FALSE; - PRBool endsInWhitespace = PR_FALSE; - while (cp < end) { - PRUnichar ch = *cp++; - PRBool isWhitespace; - nscoord width; - if (XP_IS_SPACE(ch)) { - // Compress whitespace down to a single whitespace - while (cp < end) { - ch = *cp; - if (XP_IS_SPACE(ch)) { - cp++; - continue; - } - break; - } - if (skipWhitespace) { - skipWhitespace = PR_FALSE; - continue; - } - width = spaceWidth; - isWhitespace = PR_TRUE; - } else { - // The character is not a space character. Find the end of the - // word and then measure it. - if (ch >= 256) { - hasMultibyte = PR_TRUE; - } - const PRUnichar* wordStart = cp - 1; - while (cp < end) { - ch = *cp; - if (ch >= 256) { - hasMultibyte = PR_TRUE; - } - if (!XP_IS_SPACE(ch)) { - cp++; - continue; - } - break; - } - width = fm->GetWidth(wordStart, PRUint32(cp - wordStart)); - skipWhitespace = PR_FALSE; - isWhitespace = PR_FALSE; - } - - // Now that we have the end of the word or whitespace, see if it - // will fit. - if (!atLeftMargin && wrapping && (x + width > maxWidth)) { - // The word/whitespace will not fit. - cp = lastWordEnd; - if (x == 0) { - // Nothing fit at all. In this case, we still may want to know - // the maxWordWidth so compute it right now. - maxWordWidth = width; - } - break; - } - - // The word fits. Add it to the run of text. - x += width; - if (width > maxWordWidth) { - maxWordWidth = width; - } - atLeftMargin = PR_FALSE; - lastWordEnd = cp; - endsInWhitespace = isWhitespace; - } - if (hasMultibyte) { - mFlags |= TEXT_HAS_MULTIBYTE; - } - - if (nsnull != aState) { - if (0 == x) { - // Since we collapsed into nothingness (all our whitespace - // is ignored) leave the aState->allowLeadingWhitespace - // flag alone since it doesn't want leading whitespace - } else { - aState->allowLeadingWhitespace = !endsInWhitespace; - } - } - - // Now we know our content length - mContentLength = lastWordEnd - cpStart; - if (0 == mContentLength) { - if (cp == end) { - // The entire chunk of text was whitespace that we skipped over. - aDesiredSize.width = 0; - aDesiredSize.height = 0; - aDesiredSize.ascent = 0; - aDesiredSize.descent = 0; - mContentLength = end - cpStart; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - NS_RELEASE(fm); - return frComplete; - } - } - - // Set desired size to the computed size - aDesiredSize.width = x; - aDesiredSize.height = fm->GetHeight(); - aDesiredSize.ascent = fm->GetMaxAscent(); - aDesiredSize.descent = fm->GetMaxDescent(); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = maxWordWidth; - aMaxElementSize->height = fm->GetHeight(); - } - NS_RELEASE(fm); - return (cp == end) ? frComplete : frNotComplete; -} - -nsIFrame::ReflowStatus -TextFrame::ReflowPre(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsStyleFont& aFont, - PRInt32 aStartingOffset, - nsBlockReflowState* aState) -{ - Text* txt = (Text*) mContent; - const PRUnichar* cp = txt->mText + aStartingOffset; - const PRUnichar* cpStart = cp; - const PRUnichar* end = cp + txt->mLength - aStartingOffset; - - mFlags |= TEXT_IS_PRE; - nsIFontMetrics* fm = aCX->GetMetricsFor(aFont.mFont); - const PRInt32* widths = fm->GetWidths(); - PRInt32 width = 0; - PRBool hasMultibyte = PR_FALSE; - PRUint16 tabs = 0; - PRIntn col = 0; - if (nsnull != aState) { - col = aState->column; - } - mColumn = (PRUint16) col; - nscoord spaceWidth = widths[' ']; - while (cp < end) { - PRUnichar ch = *cp++; - if (ch == '\n') { - if (nsnull != aState) { - aState->breakAfterChild = PR_TRUE; - } - break; - } - if (ch == '\t') { - // Advance to next tab stop - PRIntn spaces = 8 - (col & 7); - width += spaces * spaceWidth; - col += spaces; - tabs++; - continue; - } - if (ch == CH_NBSP) { - width += spaceWidth; - col++; - continue; - } - if (ch < 256) { - width += widths[ch]; - } else { - widths += fm->GetWidth(ch); - hasMultibyte = PR_TRUE; - } - col++; - } - if (nsnull != aState) { - aState->column = col; - } - if (hasMultibyte) { - mFlags |= TEXT_HAS_MULTIBYTE; - } - TEXT_SET_TAB_COUNT(mFlags, tabs); - - mContentOffset = aStartingOffset; - mContentLength = cp - cpStart; - aDesiredSize.width = width; - aDesiredSize.height = fm->GetHeight(); - aDesiredSize.ascent = fm->GetMaxAscent(); - aDesiredSize.descent = fm->GetMaxDescent(); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aDesiredSize.width; - aMaxElementSize->height = aDesiredSize.height; - } - NS_RELEASE(fm); - return (cp == end) ? frComplete : frNotComplete; -} - -#define NUM_WORDS 20 - -NS_METHOD TextFrame::JustifyReflow(nsIPresContext* aCX, nscoord aAvailableSpace) -{ - if (mFlags & TEXT_IS_PRE) { - // no way - return NS_OK; - } - - nsStyleFont* font = - (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - nsIFontMetrics* fm = aCX->GetMetricsFor(font->mFont); - PRInt32 spaceWidth = fm->GetWidth(' '); - - PRUint32 words[NUM_WORDS]; - PRUint32* wp0 = words; - PRIntn maxWords = NUM_WORDS; - - PRBool skipWhitespace = PRBool((mFlags & TEXT_SKIP_LEADING_WS) != 0); - - // Count the number of spaces and words in the text we are going to - // justify. Also measure each word in the text and skip over leading - // space and compress down whitespace. - Text* txt = (Text*) mContent; - const PRUnichar* cp = txt->mText + mContentOffset; - const PRUnichar* end = cp + mContentLength; - PRUint32* wp = wp0; - PRUint32* wpend = wp0 + maxWords; - PRIntn spaceCount = 0; - PRIntn total = 0; - while (cp < end) { - if (wp == wpend) { - // Make space for more words - PRUint32 numWords = wp - wp0; - maxWords = maxWords * 2; - PRUint32* newwp0 = new PRUint32[maxWords]; - if (nsnull == newwp0) { - goto bail; - } - nsCRT::memcpy(newwp0, wp0, sizeof(PRUint32) * numWords); - if (wp0 != words) { - delete wp0; - } - wp0 = newwp0; - wp = wp0 + numWords; - wpend = wp0 + maxWords; - } - - PRUint32 wordInfo; - PRUint32 wordLen; - nscoord wordWidth; - const PRUnichar* wordStart = cp; - PRUnichar ch = *cp++; - if (XP_IS_SPACE(ch)) { - // Compress whitespace down to a single whitespace - while (cp < end) { - ch = *cp; - if (XP_IS_SPACE(ch)) { - cp++; - continue; - } - break; - } - // Use wordWidth as a flag for spaces to indicate which spaces - // we give zero space to and which we don't. - if (skipWhitespace) { - wordWidth = 0; - } else { - wordWidth = spaceWidth; - spaceCount++; - } - wordInfo = WORD_IS_SPACE; - wordLen = cp - wordStart; - } else { - while (cp < end) { - ch = *cp; - if (!XP_IS_SPACE(ch)) { - cp++; - continue; - } - break; - } - wordLen = cp - wordStart; - wordWidth = fm->GetWidth(wordStart, wordLen); - skipWhitespace = PR_FALSE; - wordInfo = WORD_IS_WORD; - } - if ((wordWidth > MAX_WORD_WIDTH) || (wordLen > MAX_WORD_LENGTH)) { - // We can't fit the information about this word into our - // bitfield. Bail. - goto bail; - } - wordInfo = wordInfo | - (wordLen << WORD_LENGTH_SHIFT) | - (wordWidth << WORD_WIDTH_SHIFT); - *wp++ = wordInfo; - total += wordLen; - } - NS_ASSERTION(total == mContentLength, "bad total"); - - // Now that we know where all the words and spaces are, and we have - // measured the words, divy up the aAvailableSpace to each of the - // spaces. - if (spaceCount != 0) { - /* - * See if the last word is a space. If it is, don't count it as a space - * and give it's space to the available space. - */ - PRUint32 wordInfo = wp[-1]; - if ((wordInfo & WORD_IS_WORD) == 0) { - if (--spaceCount == 0) { - // Never mind: the one and only space was at the end. Harumph. - goto bail; - } - aAvailableSpace += spaceWidth; - // Update wordInfo to have a zero width for the trailing space - wp[-1] = WORD_IS_SPACE | (wordInfo & WORD_LENGTH_MASK); - } - nscoord add = aAvailableSpace / spaceCount; - if (add == 0) { - add = 1; - } - PRIntn numWords = wp - wp0; - mWords = new PRUint32[numWords]; - if (nsnull == mWords) { - goto bail; - } - wp = wp0; - PRUint32* tp = mWords; - PRUint32* tpend = tp + numWords; - total = 0; -#ifdef DEBUG_JUSTIFY - mNumWords = numWords; -#endif - while (--numWords >= 0) { - wordInfo = *wp++; - if (wordInfo & WORD_IS_WORD) { - // We already know about the word - *tp++ = wordInfo; - total += GET_WORD_LENGTH(wordInfo); - continue; - } else { - nscoord spaceWidth = GET_WORD_WIDTH(wordInfo); - if (spaceWidth == 0) { - // This is leading space that doesn't count - *tp++ = wordInfo; - total += GET_WORD_LENGTH(wordInfo); - continue; - } - // This is a space that gets some of the available space - if (add > aAvailableSpace) { - add = aAvailableSpace; - } - spaceWidth += add; - aAvailableSpace -= add; - if (aAvailableSpace == 0) { - // We used it all up already so stop adding - add = 0; - } - if (--spaceCount == 0) { - // Give the last space the remaining available space - spaceWidth += aAvailableSpace; - aAvailableSpace = 0; - } - if (spaceWidth > MAX_WORD_WIDTH) { - // Sad but true; leave it be. Maybe the next word can use it - *tp++ = wordInfo; - total += GET_WORD_LENGTH(wordInfo); - continue; - } - wordInfo = (wordInfo & ~WORD_WIDTH_MASK) | - (spaceWidth << WORD_WIDTH_SHIFT); - *tp++ = wordInfo; - total += GET_WORD_LENGTH(wordInfo); - } - } - NS_ASSERTION(aAvailableSpace == 0, "bad divy up"); - NS_ASSERTION(tp == tpend, "bad tp"); - NS_ASSERTION(total == mContentLength, "bad total"); - } - -bail: - if (wp0 != words) { - delete wp0; - } - NS_RELEASE(fm); - return NS_OK; -} -#undef NUM_WORDS - -NS_METHOD TextFrame::List(FILE* out, PRInt32 aIndent) const -{ - PRInt32 i; - for (i = aIndent; --i >= 0; ) fputs(" ", out); - fprintf(out, "Text(%d)@%p[%d,%d] ", - mIndexInParent, this, - mContentOffset, mContentOffset+mContentLength-1); - out << mRect; - aIndent++; - - for (i = aIndent; --i >= 0; ) fputs(" ", out); - Text* txt = (Text*) mContent; - nsAutoString tmp; - txt->ToCString(tmp, mContentOffset, mContentLength); - fputs("\"", out); - fputs(tmp, out); - fputs("\"\n", out); - - aIndent--; - for (i = aIndent; --i >= 0; ) fputs(" ", out); - fputs(">\n", out); - -#ifdef NOISY - if (nsnull != mWords) { - for (i = aIndent; --i >= 0; ) fputs(" ", out); - fputs(" @words ", out); - PRUint32* wp = mWords; - PRInt32 total = mContentLength; - while (total != 0) { - PRUint32 wordInfo = *wp++; - nscoord wordWidth = GET_WORD_WIDTH(wordInfo); - PRIntn wordLen = GET_WORD_LENGTH(wordInfo); - fprintf(out, "%c-%d-%d ", - ((wordInfo & WORD_IS_WORD) ? 'w' : 's'), - wordWidth, wordLen); - total -= wordLen; - NS_ASSERTION(total >= 0, "bad word data"); - } - fputs("\n", out); - } -#endif - return NS_OK; -} - -//---------------------------------------------------------------------- -static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID); -static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); - - -Text::Text(const PRUnichar* aText, PRInt32 aLength) -{ - if (0 == aLength) { - aLength = nsCRT::strlen(aText); - } - mLength = aLength; - mText = new PRUnichar[aLength]; - nsCRT::memcpy(mText, aText, aLength * sizeof(PRUnichar)); -} - -Text::Text() -{ - mText = nsnull; - mLength = 0; -} - -Text::~Text() -{ - if (nsnull != mText) { - delete mText; - mText = nsnull; - } - mLength = 0; -} - -nsresult Text::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - NS_PRECONDITION(nsnull != aInstancePtr, "null pointer"); - - if (nsnull == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aIID.Equals(kIDOMTextIID)) { - *aInstancePtr = (void*)(nsIDOMText*)this; - nsHTMLContent::AddRef(); - return NS_OK; - } - if (aIID.Equals(kIDOMNodeIID)) { - *aInstancePtr = (void*)(nsIDOMNode*)(nsIDOMText*)this; - nsHTMLContent::AddRef(); - return NS_OK; - } - - return nsHTMLContent::QueryInterface(aIID, aInstancePtr); -} - -nsrefcnt Text::AddRef(void) -{ - return nsHTMLContent::AddRef(); -} - -nsrefcnt Text::Release(void) -{ - return nsHTMLContent::Release(); -} - -void Text::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - fputs("Text", out); - ListAttributes(out); - fprintf(out, " RefCnt=%d<\"", mRefCnt); - - nsAutoString tmp; - ToCString(tmp, 0, mLength); - fputs(tmp, out); - - fputs("\">\n", out); -} - -void Text::ToHTMLString(nsString& aBuf) const -{ - aBuf.SetLength(0); - aBuf.Append(mText, mLength); -} - -void Text::ToCString(nsString& aBuf, PRInt32 aOffset, PRInt32 aLen) const -{ - PRUnichar* cp = mText + aOffset; - PRUnichar* end = cp + aLen; - while (cp < end) { - PRUnichar ch = *cp++; - if (ch == '\r') { - aBuf.Append("\\r"); - } else if (ch == '\n') { - aBuf.Append("\\n"); - } else if (ch == '\t') { - aBuf.Append("\\t"); - } else if ((ch < ' ') || (ch >= 127)) { - aBuf.Append("\\0"); - aBuf.Append((PRInt32)ch, 8); - } else { - aBuf.Append(ch); - } - } -} - -#if 0 -// From nsITextContent; might want this later -PRInt32 Text::GetLength() -{ - return mLength; -} - -void Text::GetText(nsString& aBuf, PRInt32 aOffset, PRInt32 aCount) -{ - aBuf.SetLength(0); - if ((PRUint32(aOffset) >= PRUint32(mLength)) || - (aCount <= 0)) { - return; - } - if (aOffset + aCount > mLength) { - aCount = mLength - aOffset; - } - aBuf.Append(mText + aOffset, aCount); -} -#endif - -nsIFrame* Text::CreateFrame(nsIPresContext* aCX, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new TextFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -nsresult Text::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - nsresult res = NS_OK; - if (nsnull == mScriptObject) { - *aScriptObject = nsnull; - if (nsnull != mParent) { - nsIScriptObjectOwner *parent; - if (NS_OK == mParent->QueryInterface(kIScriptObjectOwner, (void**)&parent)) { - parent->GetScriptObject(aContext, aScriptObject); - NS_RELEASE(parent); - } - } - res = NS_NewScriptText(aContext, this, (JSObject*)*aScriptObject, (JSObject**)&mScriptObject); - } - *aScriptObject = mScriptObject; - return res; -} - -// -// nsIDOMText interface -// -nsresult Text::GetNodeType(PRInt32 *aType) -{ - *aType = nsHTMLContent::TEXT; - return NS_OK; -} - -nsresult Text::GetParentNode(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetParentNode(aNode); -} - -nsresult Text::GetChildNodes(nsIDOMNodeIterator **aIterator) -{ - return nsHTMLContent::GetChildNodes(aIterator); -} - -nsresult Text::HasChildNodes() -{ - return nsHTMLContent::HasChildNodes(); -} - -nsresult Text::GetFirstChild(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetFirstChild(aNode); -} - -nsresult Text::GetPreviousSibling(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetPreviousSibling(aNode); -} - -nsresult Text::GetNextSibling(nsIDOMNode **aNode) -{ - return nsHTMLContent::GetNextSibling(aNode); -} - -nsresult Text::InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild) -{ - return nsHTMLContent::InsertBefore(newChild, refChild); -} - -nsresult Text::ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild) -{ - return nsHTMLContent::ReplaceChild(newChild, oldChild); -} - -nsresult Text::RemoveChild(nsIDOMNode *oldChild) -{ - return nsHTMLContent::RemoveChild(oldChild); -} - -nsresult Text::GetData(nsString &aString) -{ - if (nsnull != mText) { - aString.SetString(mText, mLength); - } - - return NS_OK; -} - -nsresult Text::SetData(nsString &aString) -{ - if (mText) delete[] mText; - - mLength = aString.Length(); - mText = aString.ToNewUnicode(); - return NS_OK; -} - -nsresult Text::Append(nsString &aData) -{ - PRUint32 length = aData.Length(); - PRUnichar *text = new PRUnichar[mLength + length]; - nsCRT::memcpy(text, mText, mLength * sizeof(PRUnichar)); - nsCRT::memcpy(text + mLength * sizeof(PRUnichar), aData.GetUnicode(), length * sizeof(PRUnichar)); - - if (mText) delete[] mText; - mLength += length; - mText = text; - - return NS_OK; -} - -nsresult Text::Insert(int offset, nsString &aData) -{ - if (offset < mLength) { - PRInt32 length = aData.Length(); - PRUnichar *text = new PRUnichar[mLength + length]; - PRUnichar *data = aData.GetUnicode(); - PRInt32 i; - - for (i = 0; i < offset; i++) { - *(text++) = *(mText++); - } - for (i = 0; i < length; i++) { - *(text++) = *(data++); - } - for (i = 0; i < mLength - offset; i++) { - *(text++) = *(mText++); - } - - if (mText) delete[] (mText - mLength); - mLength += length; - mText = text - mLength; - } - - return NS_OK; -} - -nsresult Text::Delete(int offset, int count) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult Text::Replace(int offset, int count, nsString &aData) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult Text::Splice(nsIDOMElement *element, int offset, int count) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult -NS_NewHTMLText(nsIHTMLContent** aInstancePtrResult, - const PRUnichar* us, PRInt32 uslen) -{ - nsIHTMLContent* it = new Text(us, uslen); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} - -nsresult -NS_NewHTMLText(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, const PRUnichar* us, PRInt32 uslen) -{ - nsIHTMLContent* it = new(aArena) Text(us, uslen); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} - -//---------------------------------------------------------------------- - -class SharedText : public Text { -public: - SharedText(PRUnichar* aText, PRInt32 aLength); - -protected: - virtual ~SharedText(); -}; - -SharedText::SharedText(PRUnichar* aText, PRInt32 aLength) - : Text() -{ - if (0 == aLength) { - aLength = nsCRT::strlen(aText); - } - mText = aText; - mLength = aLength; -} - -SharedText::~SharedText() -{ - mText = nsnull; -} - -nsresult -NS_NewSharedHTMLText(nsIHTMLContent** aInstancePtrResult, - PRUnichar* us, PRInt32 uslen) -{ - nsIHTMLContent* it = new SharedText(us, uslen); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} - -nsresult -NS_NewSharedHTMLText(nsIHTMLContent** aInstancePtrResult, - nsIArena* aArena, PRUnichar* us, PRInt32 uslen) -{ - nsIHTMLContent* it = new(aArena) SharedText(us, uslen); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/base/src/nsWBRPart.cpp b/mozilla/layout/html/base/src/nsWBRPart.cpp deleted file mode 100644 index 9aaf833f41f..00000000000 --- a/mozilla/layout/html/base/src/nsWBRPart.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLTagContent.h" -#include "nsFrame.h" -#include "nsHTMLIIDs.h" - -class WBRPart : public nsHTMLTagContent { -public: - WBRPart(nsIAtom* aTag); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - -protected: - virtual ~WBRPart(); -}; - -WBRPart::WBRPart(nsIAtom* aTag) - : nsHTMLTagContent(aTag) -{ -} - -WBRPart::~WBRPart() -{ -} - -nsIFrame* WBRPart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* frame; - nsresult rv = nsFrame::NewFrame(&frame, this, aIndexInParent, aParentFrame); - if (NS_OK == rv) { - return frame; - } - return nsnull; -} - -nsresult -NS_NewHTMLWordBreak(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* it = new WBRPart(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/html/document/Makefile b/mozilla/layout/html/document/Makefile deleted file mode 100644 index b0ff7c06fd4..00000000000 --- a/mozilla/layout/html/document/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -DIRS = src - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/document/makefile.win b/mozilla/layout/html/document/makefile.win deleted file mode 100644 index d4bfe31b9cf..00000000000 --- a/mozilla/layout/html/document/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -DIRS=src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/html/document/src/Makefile b/mozilla/layout/html/document/src/Makefile deleted file mode 100644 index 4191d6508b2..00000000000 --- a/mozilla/layout/html/document/src/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -include $(DEPTH)/config/config.mk - -LIBRARY_NAME = raptorhtmldoc_s - -DEFINES += -D_IMPL_NS_HTML - -INCLUDES += \ - -I../../base/src \ - -I../../forms/src \ - -I../../style/src \ - -I../../table/src \ - -I../../dom \ - $(NULL) - -# Note the sophisticated alphabetical ordering :-| -CPPSRCS = \ - nsHTMLContentSink.cpp \ - nsHTMLDocument.cpp \ - $(NULL) - -EXPORTS = \ - nsIHTMLDocument.h \ - $(NULL) - -INCLUDES += \ - -I../../base/src -I../../forms/src \ - -I../../style/src -I../../table/src \ - -I../../../base/src - -MODULE = raptor - -REQUIRES = xpcom raptor dom - -include $(DEPTH)/config/rules.mk - diff --git a/mozilla/layout/html/document/src/makefile.win b/mozilla/layout/html/document/src/makefile.win deleted file mode 100644 index a83ad5b80d7..00000000000 --- a/mozilla/layout/html/document/src/makefile.win +++ /dev/null @@ -1,54 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -LIBRARY_NAME=raptorhtmldoc_s -MODULE=raptor -REQUIRES=xpcom raptor - -DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN - -CPPSRCS=nsHTMLContentSink.cpp nsHTMLDocument.cpp - -CPP_OBJS=.\$(OBJDIR)\nsHTMLContentSink.obj \ - .\$(OBJDIR)\nsHTMLDocument.obj - -EXPORTS = \ - nsIHTMLDocument.h \ - $(NULL) - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \ - -I..\..\base\src -I..\..\forms\src \ - -I..\..\style\src -I..\..\table\src -I$(PUBLIC)\dom \ - -I..\..\..\base\src - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - $(MAKE_INSTALL) ua.css $(DIST)\bin\res - -clobber:: - rm -f $(DIST)\lib\$(LIBRARY_NAME).lib - rm -f $(DIST)\bin\res\ua.css diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp deleted file mode 100644 index dd5cfc470ac..00000000000 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ /dev/null @@ -1,1315 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIHTMLContentSink.h" -#include "nsIStyleSheet.h" -#include "nsIUnicharInputStream.h" -#include "nsIHTMLContent.h" -#include "nsIURL.h" -#include "nsHTMLDocument.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsHTMLTokens.h" -#include "nsCRT.h" -#include "prtime.h" -#include "prlog.h" - -#include "nsHTMLParts.h" -#include "nsTablePart.h" -#include "nsTableRow.h" -#include "nsTableCell.h" - -#include "nsHTMLForms.h" -#include "nsIFormManager.h" -#include "nsIImageMap.h" - -#include "nsRepository.h" - -// XXX attribute values have entities in them - use the parsers expander! - -// XXX Go through a factory for this one -#include "nsICSSParser.h" - -#ifdef NS_DEBUG - -static PRInt32 gLogLevel = 0; - -#define NOISY_SINK_TRACE(_msg,_node) \ -{ \ - char buf[200]; \ - (_node).GetText().ToCString(buf, sizeof(buf)); \ - if (gLogLevel >= PR_LOG_WARNING) { \ - PR_LogPrint("%s; [%s]", _msg, buf); \ - } \ -} - -#define REALLY_NOISY_SINK_TRACE(_msg,_node) \ -{ \ - char buf[200]; \ - (_node).GetText().ToCString(buf, sizeof(buf)); \ - if (gLogLevel >= PR_LOG_DEBUG) { \ - PR_LogPrint("%s; [%s]", _msg, buf); \ - } \ -} - -#else /* !NOISY_SINK */ - -#define NOISY_SINK_TRACE(_a,_node) -#define REALLY_NOISY_SINK_TRACE(_a,_node) - -#endif /* NOISY_SINK */ - -//---------------------------------------------------------------------- - -static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTMLCONTENTSINK_IID); - -class HTMLContentSink : public nsIHTMLContentSink { -public: - - NS_DECL_ISUPPORTS - - HTMLContentSink(); - ~HTMLContentSink(); - - void* operator new(size_t size) { - void* rv = ::operator new(size); - nsCRT::zero(rv, size); - return (void*) rv; - } - - nsresult Init(nsIDocument* aDoc, nsIURL* aURL); - nsIHTMLContent* GetCurrentContainer(eHTMLTags* aType); - - virtual PRBool SetTitle(const nsString& aValue); - - // Called when Opening or closing the main HTML container - virtual PRBool OpenHTML(const nsIParserNode& aNode); - virtual PRBool CloseHTML(const nsIParserNode& aNode); - - // Called when Opening or closing the main HEAD container - virtual PRBool OpenHead(const nsIParserNode& aNode); - virtual PRBool CloseHead(const nsIParserNode& aNode); - - // Called when Opening or closing the main BODY container - virtual PRBool OpenBody(const nsIParserNode& aNode); - virtual PRBool CloseBody(const nsIParserNode& aNode); - - // Called when Opening or closing FORM containers - virtual PRBool OpenForm(const nsIParserNode& aNode); - virtual PRBool CloseForm(const nsIParserNode& aNode); - - // Called when Opening or closing the main FRAMESET container - virtual PRBool OpenFrameset(const nsIParserNode& aNode); - virtual PRBool CloseFrameset(const nsIParserNode& aNode); - - // Called when Opening or closing a general container - // This includes: OL,UL,DIR,SPAN,TABLE,H[1..6],etc. - // Until proven otherwise, I also plan to toss STYLE, - // FORMS, FRAME, SCRIPT, etc. here too! - virtual PRBool OpenContainer(const nsIParserNode& aNode); - virtual PRBool CloseContainer(const nsIParserNode& aNode); - virtual PRBool CloseTopmostContainer(); - - // Called for text, comments and so on... - virtual PRBool AddLeaf(const nsIParserNode& aNode); - -protected: - - void StartLayout(); - - void ReflowNewContent(); - - //---------------------------------------------------------------------- - // Leaf tag handler routines that translate a leaf tag into a - // content object, processing all of the tag attributes. - - nsresult ProcessAREATag(const nsIParserNode& aNode); - nsresult ProcessBASETag(const nsIParserNode& aNode); - nsresult ProcessSTYLETag(const nsIParserNode& aNode); - - nsresult ProcessBRTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessHRTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessINPUTTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessIMGTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessSPACERTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessTEXTAREATag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessWBRTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - - //---------------------------------------------------------------------- - - nsresult ProcessOpenSELECTTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode); - nsresult ProcessCloseSELECTTag(const nsIParserNode& aNode); - nsresult ProcessOpenOPTIONTag(const nsIParserNode& aNode); - nsresult ProcessCloseOPTIONTag(const nsIParserNode& aNode); - nsresult ProcessOPTIONTagContent(const nsIParserNode& aNode); - - //---------------------------------------------------------------------- - - void GetAttributeValueAt(const nsIParserNode& aNode, - PRInt32 aIndex, - nsString& aResult); - - PRBool FindAttribute(const nsIParserNode& aNode, - const nsString& aKeyName, - nsString& aResult); - - nsresult AddAttributes(const nsIParserNode& aNode, - nsIHTMLContent* aInstancePtrResult); - - nsresult LoadStyleSheet(nsIURL* aURL, - nsIUnicharInputStream* aUIN); - - nsIDocument* mDocument; - nsIURL* mDocumentURL; - - eHTMLTags mNodeStack[100];/* XXX */ - nsIHTMLContent* mContainerStack[100];/* XXX */ - PRInt32 mStackPos; - nsString* mTitle; - nsString mBaseHREF; - nsString mBaseTarget; - nsIStyleSheet* mStyleSheet; - nsIFormManager* mCurrentForm; - nsIImageMap* mCurrentMap; -#if XXX_chris_karnaze_writes_this_part - nsHTMLOptionList* mCurrentSelect; - nsHTMLOption* mCurrentOption; -#endif - - nsIHTMLContent* mRoot; - nsIHTMLContent* mBody; - - PRTime mLastUpdateTime; - PRTime mUpdateDelta; - PRBool mLayoutStarted; -}; - -// Note: operator new zeros our memory -HTMLContentSink::HTMLContentSink() -{ -#if 0 - if (nsnull == gSinkLog) { - gSinkLog = PR_NewLogModule("HTMLContentSink"); - } -#endif - - // Set the first update delta to be 50ms - LL_I2L(mUpdateDelta, PR_USEC_PER_MSEC * 50); -} - -HTMLContentSink::~HTMLContentSink() -{ - NS_IF_RELEASE(mBody); - NS_IF_RELEASE(mRoot); - NS_IF_RELEASE(mDocument); - NS_IF_RELEASE(mDocumentURL); - NS_IF_RELEASE(mStyleSheet); - NS_IF_RELEASE(mCurrentForm); - NS_IF_RELEASE(mCurrentMap); -#if XXX_chris_karnaze_writes_this_part - NS_IF_RELEASE(mCurrentSelect); - NS_IF_RELEASE(mCurrentOption); -#endif - if (nsnull != mTitle) { - delete mTitle; - } -} - -nsresult HTMLContentSink::Init(nsIDocument* aDoc, nsIURL* aDocURL) -{ - NS_IF_RELEASE(mDocument); - mDocument = aDoc; - NS_IF_ADDREF(mDocument); - - NS_IF_RELEASE(mDocumentURL); - mDocumentURL = aDocURL; - NS_IF_ADDREF(mDocumentURL); - - // Make root part - NS_IF_RELEASE(mRoot); - nsresult rv = NS_NewRootPart(&mRoot, aDoc); - if (NS_OK == rv) { - } - - return rv; -} - -NS_IMPL_ISUPPORTS(HTMLContentSink,kIHTMLContentSinkIID) - -PRBool HTMLContentSink::OpenHTML(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("OpenHTML", aNode) - NS_PRECONDITION(0 == mStackPos, "bad stack pos"); - - mNodeStack[0] = (eHTMLTags)aNode.GetNodeType(); - mContainerStack[0] = mRoot; - mStackPos = 1; - - return PR_TRUE; -} - -PRBool HTMLContentSink::CloseHTML(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("CloseHTML", aNode) - - NS_ASSERTION(mStackPos > 0, "bad bad"); - mNodeStack[--mStackPos] = eHTMLTag_unknown; - - PRInt32 i, ns = mDocument->GetNumberOfShells(); - for (i = 0; i < ns; i++) { - nsIPresShell* shell = mDocument->GetShellAt(i); - if (nsnull != shell) { - shell->BeginObservingDocument(); - NS_RELEASE(shell); - } - } - NS_IF_RELEASE(mCurrentForm); - - return PR_TRUE; -} - -PRBool HTMLContentSink::OpenHead(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("OpenHead", aNode) - - mNodeStack[mStackPos++] = (eHTMLTags)aNode.GetNodeType(); - return PR_TRUE; -} - -PRBool HTMLContentSink::CloseHead(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("CloseHead", aNode) - - NS_ASSERTION(mStackPos > 0, "bad bad"); - mNodeStack[--mStackPos] = eHTMLTag_unknown; - return PR_TRUE; -} - -PRBool HTMLContentSink::SetTitle(const nsString& aValue) -{ - if (nsnull == mTitle) { - mTitle = new nsString(aValue); - } - else { - *mTitle = aValue; - } - mTitle->CompressWhitespace(PR_TRUE, PR_TRUE); - ((nsHTMLDocument*)mDocument)->SetTitle(*mTitle); - return PR_TRUE; -} - -PRBool HTMLContentSink::OpenBody(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("OpenBody", aNode) - - PRBool startLayout = PR_FALSE; - if (nsnull == mBody) { - nsIAtom* atom = NS_NewAtom("BODY"); - nsresult rv = NS_NewBodyPart(&mBody, atom); - if (NS_OK == rv) { - mRoot->AppendChild(mBody); - startLayout = PR_TRUE; - } - NS_RELEASE(atom); - } - - mNodeStack[mStackPos] = (eHTMLTags)aNode.GetNodeType(); - mContainerStack[mStackPos] = mBody; - mStackPos++; - - // Add attributes to the body content object, but only if it's really a body - // tag that is triggering the OpenBody. - if (aNode.GetText().EqualsIgnoreCase("body")) { - AddAttributes(aNode, mBody); - // XXX If the body already existed and has been reflowed somewhat - // then we need to trigger a style change - } - - if (startLayout) { - // XXX This has to be done now that the body is in because we - // don't know how to handle a content-appended reflow if the - // root has no children - StartLayout(); - } - - return PR_TRUE; -} - -PRBool HTMLContentSink::CloseBody(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("CloseBody", aNode) - - NS_ASSERTION(mStackPos > 0, "bad bad"); - mNodeStack[--mStackPos] = eHTMLTag_unknown; - - // Reflow any lingering content - ReflowNewContent(); - - return PR_TRUE; -} - -static NS_DEFINE_IID(kIFormManagerIID, NS_IFORMMANAGER_IID); - -PRBool HTMLContentSink::OpenForm(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("OpenForm", aNode) - - // Close out previous form if it's there - if (nsnull != mCurrentForm) { - NS_RELEASE(mCurrentForm); - mCurrentForm = nsnull; - } - - nsresult rv; - nsAutoString classID; - if (FindAttribute(aNode, "classid", classID)) { - // Translate classid string into an nsID - char cbuf[50]; - classID.ToCString(cbuf, sizeof(cbuf)); - nsID clid; - if (clid.Parse(cbuf)) { - // Create a form manager using the repository - nsIFactory* fac; - rv = NSRepository::FindFactory(clid, &fac); - if (NS_OK == rv) { - rv = fac->CreateInstance(nsnull, kIFormManagerIID, - (void**)&mCurrentForm); -#ifdef NS_DEBUG - if (NS_OK != rv) { - printf("OpenForm: can't create form manager instance: %d\n", rv); - } -#endif - NS_RELEASE(fac); - } - else { -#ifdef NS_DEBUG - printf("OpenForm: can't find '%s' in the repository\n", cbuf); -#endif - } - } - else { -#ifdef NS_DEBUG - printf("OpenForm: classID is invalid: '%s'\n", cbuf); -#endif - } - } - - if (nsnull == mCurrentForm) { - // Create new form - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - rv = NS_NewHTMLForm(&mCurrentForm, atom); - NS_RELEASE(atom); - } - - if (NS_OK == rv) { - // Add tag attributes to the form - nsAutoString k, v; - PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { - // Get upper-cased key - const nsString& key = aNode.GetKeyAt(i); - k.SetLength(0); - k.Append(key); - k.ToUpperCase(); - - // Get value and remove mandatory quotes - GetAttributeValueAt(aNode, i, v); - mCurrentForm->SetAttribute(k, v); - } - } - - return PR_TRUE; -} - -PRBool HTMLContentSink::CloseForm(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("CloseForm", aNode) - - if (nsnull != mCurrentForm) { - NS_RELEASE(mCurrentForm); - mCurrentForm = nsnull; - } - return PR_TRUE; -} - -PRBool HTMLContentSink::OpenFrameset(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("OpenFrameset", aNode) - - mNodeStack[mStackPos++] = (eHTMLTags)aNode.GetNodeType(); - return PR_TRUE; -} - -PRBool HTMLContentSink::CloseFrameset(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("CloseFrameset", aNode) - - mNodeStack[--mStackPos] = eHTMLTag_unknown; - return PR_TRUE; -} - -PRBool HTMLContentSink::OpenContainer(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("OpenContainer", aNode) - - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - - eHTMLTags parentType; - nsIHTMLContent* parent = GetCurrentContainer(&parentType); - switch (parentType) { - case eHTMLTag_select: - break; - case eHTMLTag_option: - break; - } - - nsresult rv; - nsIHTMLContent* container = nsnull; - if (aNode.GetTokenType() == eToken_start) { - switch (aNode.GetNodeType()) { - case eHTMLTag_map: - NS_IF_RELEASE(mCurrentMap); - rv = NS_NewImageMap(&mCurrentMap, atom); - if (NS_OK == rv) { - // Look for name attribute and set the map name - nsAutoString name; - if (FindAttribute(aNode, "name", name)) { - name.StripWhitespace(); // XXX leading, trailing, interior non=-space ws is removed - mCurrentMap->SetName(name); - } - // Add the map to the document - ((nsHTMLDocument*)mDocument)->AddImageMap(mCurrentMap); - } - return PR_TRUE; - - case eHTMLTag_table: - rv = NS_NewTablePart(&container, atom); - break; - - case eHTMLTag_caption: - rv = NS_NewTableCaptionPart(&container, atom); - break; - - case eHTMLTag_tr: - rv = NS_NewTableRowPart(&container, atom); - break; - - case eHTMLTag_tbody: - case eHTMLTag_thead: - case eHTMLTag_tfoot: - rv = NS_NewTableRowGroupPart(&container, atom); - break; - - case eHTMLTag_colgroup: - rv = NS_NewTableColGroupPart(&container, atom); - break; - - case eHTMLTag_col: - rv = NS_NewTableColPart(&container, atom); - break; - - case eHTMLTag_td: - case eHTMLTag_th: - rv = NS_NewTableCellPart(&container, atom); - break; - - case eHTMLTag_select: - rv = ProcessOpenSELECTTag(&container, aNode); - break; - - case eHTMLTag_option: - rv = ProcessOpenOPTIONTag(aNode); - break; - - default: - rv = NS_NewHTMLContainer(&container, atom); - break; - } - } - - // XXX for now assume that if it's a container, it's a simple container - mNodeStack[mStackPos] = (eHTMLTags) aNode.GetNodeType(); - mContainerStack[mStackPos] = container; - - if (nsnull != container) { - container->SetDocument(mDocument); - rv = AddAttributes(aNode, container); - mStackPos++; - } - - NS_RELEASE(atom); - return PR_TRUE; -} - -PRBool HTMLContentSink::CloseContainer(const nsIParserNode& aNode) -{ - NOISY_SINK_TRACE("CloseContainer", aNode) - - switch (aNode.GetNodeType()) { - case eHTMLTag_map: - NS_IF_RELEASE(mCurrentMap); - return PR_TRUE; - } - - // XXX we could assert things about the top tag name == aNode.getText - if (0 == mStackPos) { - // Can't pop empty stack - return PR_TRUE; - } - - --mStackPos; - nsIHTMLContent* container = mContainerStack[mStackPos]; - mNodeStack[mStackPos] = eHTMLTag_unknown; - mContainerStack[mStackPos] = nsnull; - - - switch (aNode.GetNodeType()) { - case eHTMLTag_option: - ProcessCloseOPTIONTag(aNode); - break; - - case eHTMLTag_select: - ProcessCloseSELECTTag(aNode); - break; - - default: - if (nsnull != container) { - // Now that this container is complete, append it to it's parent - eHTMLTags parentType; - nsIHTMLContent* parent = GetCurrentContainer(&parentType); - container->Compact(); - - if(parent) { - parent->AppendChild(container); - if (parent == mBody) { - // We just closed a child of the body off. Trigger a - // content-appended reflow if enough time has elapsed - PRTime now = PR_Now(); - if (now - mLastUpdateTime >= mUpdateDelta) { - mLastUpdateTime = now; - mUpdateDelta += mUpdateDelta; - ReflowNewContent(); - } - } - } - NS_RELEASE(container); - } - break; - } - - return PR_TRUE; -} - -void HTMLContentSink::StartLayout() -{ - if (!mLayoutStarted) { - PRInt32 i, ns = mDocument->GetNumberOfShells(); - for (i = 0; i < ns; i++) { - nsIPresShell* shell = mDocument->GetShellAt(i); - if (nsnull != shell) { - nsIPresContext* cx = shell->GetPresContext(); - nsRect r = cx->GetVisibleArea(); - shell->ResizeReflow(r.width, r.height); - NS_RELEASE(cx); - NS_RELEASE(shell); - } - } - mLayoutStarted = PR_TRUE; - } -} - -void HTMLContentSink::ReflowNewContent() -{ - printf("reflow body\n"); - - // Trigger reflows in each of the presentation shells - PRInt32 i, ns = mDocument->GetNumberOfShells(); - for (i = 0; i < ns; i++) { - nsIPresShell* shell = mDocument->GetShellAt(i); - if (nsnull != shell) { - shell->ContentAppended(mBody); - NS_RELEASE(shell); - } - } -} - -PRBool HTMLContentSink::CloseTopmostContainer() -{ - return PR_TRUE; -} - -nsIHTMLContent* HTMLContentSink::GetCurrentContainer(eHTMLTags* aType) -{ - nsIHTMLContent* parent; - if (mStackPos <= 2) { // assume HTML and BODY are on the stack - parent = mBody; - *aType = eHTMLTag_body; - } else { - parent = mContainerStack[mStackPos - 1]; - *aType = mNodeStack[mStackPos - 1]; - } - return parent; -} - -//---------------------------------------------------------------------- - -// Leaf tag handling code - -PRBool HTMLContentSink::AddLeaf(const nsIParserNode& aNode) -{ - REALLY_NOISY_SINK_TRACE("AddLeaf", aNode) - - // Check for nodes that require special handling - switch (aNode.GetNodeType()) { - case eHTMLTag_style: - ProcessSTYLETag(aNode); - return PR_TRUE; - - case eHTMLTag_script: - return PR_TRUE; - - case eHTMLTag_area: - ProcessAREATag(aNode); - return PR_TRUE; - } - - eHTMLTags parentType; - nsIHTMLContent* parent = GetCurrentContainer(&parentType); - -/* switch (parentType) { - case eHTMLTag_table: - case eHTMLTag_tr: - case eHTMLTag_tbody: - case eHTMLTag_thead: - case eHTMLTag_tfoot: - // XXX Discard leaf content (those annoying \n's really) in - // table's or table rows - return PR_TRUE; - - case eHTMLTag_option: - ProcessOPTIONTagContent(aNode); - return PR_TRUE; - - case eHTMLTag_select: - // Discard content in a select that's not an option - if (eHTMLTag_option != aNode.GetNodeType()) { - return PR_TRUE; - } - break; - } -*/ - nsresult rv = NS_OK; - nsIHTMLContent* leaf = nsnull; - switch (aNode.GetTokenType()) { - case eToken_start: - switch (aNode.GetNodeType()) { - case eHTMLTag_br: - rv = ProcessBRTag(&leaf, aNode); - break; - case eHTMLTag_hr: - rv = ProcessHRTag(&leaf, aNode); - break; - case eHTMLTag_input: - rv = ProcessINPUTTag(&leaf, aNode); - break; - case eHTMLTag_img: - rv = ProcessIMGTag(&leaf, aNode); - break; - case eHTMLTag_spacer: - rv = ProcessSPACERTag(&leaf, aNode); - break; - case eHTMLTag_textarea: - ProcessTEXTAREATag(&leaf, aNode); - break; - } - break; - - case eToken_text: - case eToken_whitespace: - { - nsAutoString tmp; - tmp.Append(aNode.GetText()); - rv = NS_NewHTMLText(&leaf, tmp.GetUnicode(), tmp.Length()); - } - break; - - // XXX ick - case eToken_newline: - { - nsAutoString tmp; - tmp.Append('\n'); - rv = NS_NewHTMLText(&leaf, tmp.GetUnicode(), tmp.Length()); - } - break; - - case eToken_entity: - { - nsAutoString tmp; - nsAutoString tmp2(""); - PRInt32 unicode = aNode.TranslateToUnicodeStr(tmp2); - if (unicode < 0) { - tmp.Append(aNode.GetText()); - } else { - tmp+=tmp2; - } - rv = NS_NewHTMLText(&leaf, tmp.GetUnicode(), tmp.Length()); - } - break; - - case eToken_skippedcontent: - break; - } - - if (NS_OK == rv) { - if (nsnull != leaf) { - if (nsnull != parent) { - parent->AppendChild(leaf); - } else { - // XXX drop stuff on the floor that doesn't have a container! - // Bad parser! - } - } - } - NS_IF_RELEASE(leaf); - - return PR_TRUE; -} - -void HTMLContentSink::GetAttributeValueAt(const nsIParserNode& aNode, - PRInt32 aIndex, - nsString& aResult) -{ - // Copy value - const nsString& value = aNode.GetValueAt(aIndex); - aResult.Truncate(); - aResult.Append(value); - - // strip quotes if present - PRUnichar first = aResult.First(); - if ((first == '"') || (first == '\'')) { - if (aResult.Last() == first) { - aResult.Cut(0, 1); - PRInt32 pos = aResult.Length() - 1; - if (pos >= 0) { - aResult.Cut(pos, 1); - } - } else { - // Mismatched quotes - leave them in - } - } -} - -PRBool HTMLContentSink::FindAttribute(const nsIParserNode& aNode, - const nsString& aKeyName, - nsString& aResult) -{ - PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { - const nsString& key = aNode.GetKeyAt(i); - if (key.EqualsIgnoreCase(aKeyName)) { - // Get value and remove mandatory quotes - GetAttributeValueAt(aNode, i, aResult); - return PR_TRUE; - } - } - return PR_FALSE; -} - -nsresult HTMLContentSink::AddAttributes(const nsIParserNode& aNode, - nsIHTMLContent* aInstancePtrResult) -{ - nsIContent* content = (nsIContent*) aInstancePtrResult; - - // Add tag attributes to the content attributes - nsAutoString k, v; - PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { - // Get upper-cased key - const nsString& key = aNode.GetKeyAt(i); - k.Truncate(); - k.Append(key); - k.ToUpperCase(); - - // Get value and remove mandatory quotes - GetAttributeValueAt(aNode, i, v); - - content->SetAttribute(k, v); - } - - return NS_OK; -} - -nsresult HTMLContentSink::ProcessAREATag(const nsIParserNode& aNode) -{ - if (nsnull != mCurrentMap) { - nsAutoString shape, coords, href, target(mBaseTarget), alt; - PRInt32 ac = aNode.GetAttributeCount(); - PRBool suppress = PR_FALSE; - for (PRInt32 i = 0; i < ac; i++) { - // Get upper-cased key - const nsString& key = aNode.GetKeyAt(i); - if (key.EqualsIgnoreCase("shape")) { - GetAttributeValueAt(aNode, i, shape); - } - else if (key.EqualsIgnoreCase("coords")) { - GetAttributeValueAt(aNode, i, coords); - } - else if (key.EqualsIgnoreCase("href")) { - GetAttributeValueAt(aNode, i, href); - href.StripWhitespace(); - } - else if (key.EqualsIgnoreCase("target")) { - GetAttributeValueAt(aNode, i, target); - } - else if (key.EqualsIgnoreCase("alt")) { - GetAttributeValueAt(aNode, i, alt); - } - else if (key.EqualsIgnoreCase("suppress")) { - suppress = PR_TRUE; - } - } - mCurrentMap->AddArea(mBaseHREF, shape, coords, href, target, alt, - suppress); - } - return NS_OK; -} - -nsresult HTMLContentSink::ProcessBASETag(const nsIParserNode& aNode) -{ - PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { - const nsString& key = aNode.GetKeyAt(i); - if (key.EqualsIgnoreCase("href")) { - const nsString& href = aNode.GetValueAt(i); - if (href.Length() > 0) { - mBaseHREF = href; - } - } else if (key.EqualsIgnoreCase("target")) { - - const nsString& target= aNode.GetValueAt(i); - if (target.Length() > 0) { - mBaseTarget = target; - } - } - } - return NS_OK; -} - -nsresult HTMLContentSink::ProcessBRTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsresult rv = NS_OK; - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - rv = NS_NewHTMLBreak(aInstancePtrResult, atom); - if (NS_OK == rv) { - rv = AddAttributes(aNode, *aInstancePtrResult); - } - NS_RELEASE(atom); - return rv; -} - -nsresult HTMLContentSink::ProcessHRTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsresult rv = NS_OK; - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - rv = NS_NewHRulePart(aInstancePtrResult, atom); - if (NS_OK == rv) { - rv = AddAttributes(aNode, *aInstancePtrResult); - } - NS_RELEASE(atom); - return rv; -} - -nsresult HTMLContentSink::ProcessIMGTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - nsresult rv = NS_NewHTMLImage(aInstancePtrResult, atom); - if (NS_OK == rv) { - rv = AddAttributes(aNode, *aInstancePtrResult); - // XXX get base url to image - } - NS_RELEASE(atom); - return rv; -} - -nsresult HTMLContentSink::ProcessSPACERTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - nsresult rv = NS_NewHTMLSpacer(aInstancePtrResult, atom); - if (NS_OK == rv) { - rv = AddAttributes(aNode, *aInstancePtrResult); - } - NS_RELEASE(atom); - return rv; -} - -// 3 ways to load a style sheet: inline, style src=, link tag - // XXX What does nav do if we have SRC= and some style data inline? -nsresult HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode) -{ - nsresult rv = NS_OK; - PRInt32 i, ac = aNode.GetAttributeCount(); - - nsString* src = nsnull; - for (i = 0; i < ac; i++) { - const nsString& key = aNode.GetKeyAt(i); - if (key.EqualsIgnoreCase("src")) { - src = new nsString(aNode.GetValueAt(i)); - } - } - - // The skipped content contains the inline style data - const nsString& content = aNode.GetSkippedContent(); - - nsIURL* url = nsnull; - nsIUnicharInputStream* uin = nsnull; - if (nsnull == src) { - // Create a string to hold the data and wrap it up in a unicode - // input stream. - rv = NS_NewStringUnicharInputStream(&uin, new nsString(content)); - if (NS_OK != rv) { - return rv; - } - - // Use the document's url since the style data came from there - url = mDocumentURL; - NS_IF_ADDREF(url); - } else { - // src with immediate style data doesn't add up - // XXX what does nav do? - char* spec = src->ToNewCString(); - rv = NS_NewURL(&url, nsnull, spec); - delete spec; - delete src; - if (NS_OK != rv) { - return rv; - } - PRInt32 ec; - nsIInputStream* iin = url->Open(&ec); - if (nsnull == iin) { - NS_RELEASE(url); - return (nsresult) ec;/* XXX fix url->Open */ - } - rv = NS_NewConverterStream(&uin, nsnull, iin); - NS_RELEASE(iin); - if (NS_OK != rv) { - NS_RELEASE(url); - return rv; - } - } - - // Now that we have a url and a unicode input stream, parse the - // style sheet. - rv = LoadStyleSheet(url, uin); - NS_RELEASE(uin); - NS_RELEASE(url); - - return rv; -} - -nsresult HTMLContentSink::LoadStyleSheet(nsIURL* aURL, - nsIUnicharInputStream* aUIN) -{ - /* XXX use repository */ - nsICSSParser* parser; - nsresult rv = NS_NewCSSParser(&parser); - if (NS_OK == rv) { - PRInt32 ec; - if (nsnull != mStyleSheet) { - parser->SetStyleSheet(mStyleSheet); - // XXX we do probably need to trigger a style change reflow - // when we are finished if this is adding data to the same sheet - } - nsIStyleSheet* sheet = parser->Parse(&ec, aUIN, mDocumentURL); - if (nsnull != sheet) { - if (nsnull == mStyleSheet) { - // Add in the sheet the first time; if we update the sheet - // with new data (mutliple style tags in the same document) - // then the sheet will be updated by the css parser and - // therefore we don't need to add it to the document) - mDocument->AddStyleSheet(sheet); - mStyleSheet = sheet; - } - rv = NS_OK; - } else { - rv = NS_ERROR_OUT_OF_MEMORY;/* XXX */ - } - NS_RELEASE(parser); - } - return rv; -} - - -nsresult HTMLContentSink::ProcessINPUTTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - - nsresult rv = NS_ERROR_NOT_INITIALIZED; - - // Find type attribute and then create the appropriate form element - nsAutoString val; - if (FindAttribute(aNode, "type", val)) { - if (val.EqualsIgnoreCase("submit")) { - rv = NS_NewHTMLInputSubmit(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("reset")) { - rv = NS_NewHTMLInputReset(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("button")) { - rv = NS_NewHTMLInputButton(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("checkbox")) { - rv = NS_NewHTMLInputCheckbox(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("file")) { - rv = NS_NewHTMLInputFile(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("hidden")) { - rv = NS_NewHTMLInputHidden(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("image")) { - rv = NS_NewHTMLInputImage(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("password")) { - rv = NS_NewHTMLInputPassword(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("radio")) { - rv = NS_NewHTMLInputRadio(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("text")) { - rv = NS_NewHTMLInputText(aInstancePtrResult, atom, mCurrentForm); - } - else if (val.EqualsIgnoreCase("select1")) { // TEMP hack - rv = NS_NewHTMLSelect(aInstancePtrResult, atom, mCurrentForm, 1); - } - else if (val.EqualsIgnoreCase("select2")) { // TEMP hack - rv = NS_NewHTMLSelect(aInstancePtrResult, atom, mCurrentForm, 2); - } - else if (val.EqualsIgnoreCase("select3")) { // TEMP hack - rv = NS_NewHTMLSelect(aInstancePtrResult, atom, mCurrentForm, 3); - } - else { - rv = NS_NewHTMLInputSubmit(aInstancePtrResult, atom, mCurrentForm); - } - } - - if (NS_ERROR_NOT_INITIALIZED == rv) { - // Create textfield when no type is specified - rv = NS_NewHTMLInputText(aInstancePtrResult, atom, mCurrentForm); - } - - if ((NS_OK == rv) && (nsnull != *aInstancePtrResult)) { - // Add remaining attributes from the tag - rv = AddAttributes(aNode, *aInstancePtrResult); - } - - NS_RELEASE(atom); - return rv; -} - -nsresult -HTMLContentSink::ProcessTEXTAREATag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - - const nsString& content = aNode.GetSkippedContent(); - - nsresult rv = NS_NewHTMLTextArea(aInstancePtrResult, atom, mCurrentForm); - if ((NS_OK == rv) && (nsnull != *aInstancePtrResult)) { - // Add remaining attributes from the tag - rv = AddAttributes(aNode, *aInstancePtrResult); - //if (0 < content.Length()) { - // ((nsTextArea*)*aInstancePtrResult)->SetContent(content); - //} - } - - NS_RELEASE(atom); - return rv; -} - -nsresult -HTMLContentSink::ProcessOpenSELECTTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - -#if XXX_chris_karnaze_writes_this_part - if (nsnull != mCurrentSelect) { - mCurrentSelect->Close(); - NS_RELEASE(mCurrentSelect); - } - nsresult rv = NS_NewHTMLOptionList(&mCurrentSelect, atom, mCurrentForm); - if ((NS_OK == rv) && (nsnull != mCurrentSelect)) { - // Add remaining attributes from the tag - rv = AddAttributes(aNode, mCurrentSelect); - *aInstancePtrResult = mCurrentSelect; - } -#else - nsAutoString foo("SELECT tag goes here"); - nsresult rv = NS_NewHTMLText(aInstancePtrResult, foo.GetUnicode(), foo.Length()); -#endif - - NS_RELEASE(atom); - return rv; -} - -nsresult -HTMLContentSink::ProcessCloseSELECTTag(const nsIParserNode& aNode) -{ -#if XXX_chris_karnaze_writes_this_part - if (nsnull != mCurrentSelect) { - mCurrentSelect->Close(); - NS_RELEASE(mCurrentSelect); - } -#endif - return NS_OK; -} - -nsresult -HTMLContentSink::ProcessOpenOPTIONTag(const nsIParserNode& aNode) -{ - nsresult rv = NS_OK; -#if XXX_chris_karnaze_writes_this_part - if (nsnull != mCurrentSelect) { - if (nsnull != mCurrentOption) { - mCurrentOption->Close(); - NS_RELEASE(mCurrentOption); - } - - nsAutoString value, selected; - PRBool hasValue = FindAttribute(aNode, "value", value); - PRBool hasSelected = FindAttribute(aNode, "selected", selected); - rv = NS_NewHTMLOption(&mCurrentOption, value, hasSelected); - } -#endif - return rv; -} - -nsresult -HTMLContentSink::ProcessCloseOPTIONTag(const nsIParserNode& aNode) -{ -#if XXX_chris_karnaze_writes_this_part - if (nsnull != mCurrentSelect) { - if (nsnull != mCurrentOption) { - mCurrentSelect->AddOption(mCurrentOption); - NS_RELEASE(mCurrentOption); - } - } -#endif - return NS_OK; -} - -nsresult -HTMLContentSink::ProcessOPTIONTagContent(const nsIParserNode& aNode) -{ -#if XXX_chris_karnaze_writes_this_part - if (nsnull != mCurrentSelect) { - nsAutoString currentText; - mCurrentOption->GetOptionText(currentText); - - switch (aNode.GetTokenType()) { - case eToken_text: - case eToken_whitespace: - case eToken_newline: - currentText.Append(aNode.GetText()); - break; - - case eToken_entity: - { - nsAutoString tmp2(""); - PRInt32 unicode = aNode.TranslateToUnicodeStr(tmp2); - if (unicode < 0) { - currentText.Append(aNode.GetText()); - } else { - currentText.Append(tmp2); - } - } - break; - } - - mCurrentOption->SetOptionText(currentText); - } -#endif - return NS_OK; -} - -nsresult HTMLContentSink::ProcessWBRTag(nsIHTMLContent** aInstancePtrResult, - const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - nsresult rv = NS_NewHTMLWordBreak(aInstancePtrResult, atom); - if (NS_OK == rv) { - rv = AddAttributes(aNode, *aInstancePtrResult); - } - NS_RELEASE(atom); - return rv; -} - -//---------------------------------------------------------------------- - -nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult, - nsIDocument* aDoc, - nsIURL* aURL) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - HTMLContentSink* it = new HTMLContentSink(); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - nsresult rv = it->Init(aDoc, aURL); - if (NS_OK != rv) { - delete it; - return rv; - } - return it->QueryInterface(kIHTMLContentSinkIID, (void **)aInstancePtrResult); -} diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp deleted file mode 100644 index f9ba236cbf4..00000000000 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLDocument.h" -#include "nsIParser.h" -#include "nsIHTMLContentSink.h" -#include "nsHTMLParts.h" -#include "nsIHTMLStyleSheet.h" -#include "nsIStyleSet.h" -#include "nsIDocumentObserver.h" -#include "nsHTMLAtoms.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsIImageMap.h" - -static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID); -static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID); - -NS_LAYOUT nsresult -NS_NewHTMLDocument(nsIDocument** aInstancePtrResult) -{ - nsHTMLDocument* doc = new nsHTMLDocument(); - return doc->QueryInterface(kIDocumentIID, (void**) aInstancePtrResult); -} - -nsHTMLDocument::nsHTMLDocument() - : nsDocument(), - mAttrStyleSheet(nsnull) -{ - nsHTMLAtoms::AddrefAtoms(); -} - -nsHTMLDocument::~nsHTMLDocument() -{ - NS_IF_RELEASE(mAttrStyleSheet); - nsHTMLAtoms::ReleaseAtoms(); -} - -NS_IMETHODIMP nsHTMLDocument::QueryInterface(REFNSIID aIID, - void** aInstancePtr) -{ - NS_PRECONDITION(nsnull != aInstancePtr, "null ptr"); - if (nsnull == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIHTMLDocumentIID)) { - AddRef(); - *aInstancePtr = (void**) &mIHTMLDocument; - return NS_OK; - } - return nsDocument::QueryInterface(aIID, aInstancePtr); -} - -void nsHTMLDocument::LoadURL(nsIURL* aURL) -{ - NS_IF_RELEASE(mAttrStyleSheet); - NS_IF_RELEASE(mDocumentURL); - if (nsnull != mDocumentTitle) { - delete mDocumentTitle; - mDocumentTitle = nsnull; - } - - mDocumentURL = aURL; - NS_ADDREF(aURL); - - nsIParser* parser; - nsresult rv = NS_NewHTMLParser(&parser); - if (NS_OK == rv) { - nsIHTMLContentSink* sink; - rv = NS_NewHTMLContentSink(&sink, this, aURL); - if (NS_OK == rv) { - if (NS_OK == NS_NewHTMLStyleSheet(&mAttrStyleSheet, aURL)) { - AddStyleSheet(mAttrStyleSheet); // tell the world about our new style sheet - } - - parser->SetContentSink(sink); - parser->Parse(aURL); - NS_RELEASE(sink); - } - NS_RELEASE(parser); - } - //XXX return NS_OK; -} - -static NS_DEFINE_IID(kIDocumentObserverIID, NS_IDOCUMENTOBSERVER_IID); - -NS_IMETHODIMP nsHTMLDocument::SetTitle(const nsString& aTitle) -{ - if (nsnull == mDocumentTitle) { - mDocumentTitle = new nsString(aTitle); - } - else { - *mDocumentTitle = aTitle; - } - - // Pass on title to observers - PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { - nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i]; - observer->SetTitle(*mDocumentTitle); - } - - // Pass on to any interested containers - n = mPresShells.Count(); - for (i = 0; i < n; i++) { - nsIPresShell* shell = (nsIPresShell*) mPresShells.ElementAt(i); - nsIPresContext* cx = shell->GetPresContext(); - nsISupports* container; - if (NS_OK == cx->GetContainer(&container)) { - if (nsnull != container) { - nsIDocumentObserver* docob; - if (NS_OK == container->QueryInterface(kIDocumentObserverIID, - (void**) &docob)) { - docob->SetTitle(aTitle); - NS_RELEASE(docob); - } - NS_RELEASE(container); - } - } - NS_RELEASE(cx); - } - - return NS_OK; -} - -NS_IMETHODIMP nsHTMLDocument::AddImageMap(nsIImageMap* aMap) -{ - NS_PRECONDITION(nsnull != aMap, "null ptr"); - if (nsnull == aMap) { - return NS_ERROR_NULL_POINTER; - } - if (mImageMaps.AppendElement(aMap)) { - NS_ADDREF(aMap); - return NS_OK; - } - return NS_ERROR_OUT_OF_MEMORY; -} - -NS_IMETHODIMP nsHTMLDocument::GetImageMap(const nsString& aMapName, - nsIImageMap** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - - nsAutoString name; - PRInt32 i, n = mImageMaps.Count(); - for (i = 0; i < n; i++) { - nsIImageMap* map = (nsIImageMap*) mImageMaps.ElementAt(i); - if (NS_OK == map->GetName(name)) { - if (name.EqualsIgnoreCase(aMapName)) { - *aResult = map; - NS_ADDREF(map); - return NS_OK; - } - } - } - - return 1;/* XXX NS_NOT_FOUND */ -} - -void nsHTMLDocument::AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet) -{ - if ((nsnull != mAttrStyleSheet) && (aSheet != mAttrStyleSheet)) { - aSet->InsertDocStyleSheetBefore(aSheet, mAttrStyleSheet); - } - else { - aSet->AppendDocStyleSheet(aSheet); - } -} - -//---------------------------------------------------------------------- - -// Aggregation class to give nsHTMLDocument the nsIHTMLDocument interface - -#define GET_OUTER() \ - ((nsHTMLDocument*) ((char*)this - nsHTMLDocument::GetOuterOffset())) - -nsHTMLDocument::AggIHTMLDocument::AggIHTMLDocument() { - NS_INIT_REFCNT(); -} - -nsHTMLDocument::AggIHTMLDocument::~AggIHTMLDocument() { } - -NS_IMETHODIMP_(nsrefcnt) nsHTMLDocument::AggIHTMLDocument::AddRef() { - return GET_OUTER()->AddRef(); -} - -NS_IMETHODIMP_(nsrefcnt) nsHTMLDocument::AggIHTMLDocument::Release() { - return GET_OUTER()->Release(); -} - -NS_IMETHODIMP nsHTMLDocument::AggIHTMLDocument::QueryInterface(REFNSIID aIID, - void** aInstancePtr) -{ - return GET_OUTER()->QueryInterface(aIID, aInstancePtr); -} - -NS_IMETHODIMP nsHTMLDocument::AggIHTMLDocument::SetTitle(const nsString& aTitle) { - return GET_OUTER()->SetTitle(aTitle); -} - -NS_IMETHODIMP nsHTMLDocument::AggIHTMLDocument::AddImageMap(nsIImageMap* aMap) { - return GET_OUTER()->AddImageMap(aMap); -} - -NS_IMETHODIMP nsHTMLDocument::AggIHTMLDocument::GetImageMap(const nsString& aMapName, - nsIImageMap** aResult) { - return GET_OUTER()->GetImageMap(aMapName, aResult); -} diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.h b/mozilla/layout/html/document/src/nsHTMLDocument.h deleted file mode 100644 index 9505de62920..00000000000 --- a/mozilla/layout/html/document/src/nsHTMLDocument.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLDocument_h___ -#define nsHTMLDocument_h___ - -#include "nsDocument.h" -#include "nsIHTMLDocument.h" - -class nsIHTMLStyleSheet; - -class nsHTMLDocument : public nsDocument { -public: - nsHTMLDocument(); - virtual ~nsHTMLDocument(); - - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - - virtual void LoadURL(nsIURL* aURL); - - NS_IMETHOD SetTitle(const nsString& aTitle); - - NS_IMETHOD AddImageMap(nsIImageMap* aMap); - - NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult); - - static PRInt32 GetOuterOffset() { - return offsetof(nsHTMLDocument,mIHTMLDocument); - } - -protected: - virtual void AddStyleSheetToSet(nsIStyleSheet* aSheet, nsIStyleSet* aSet); - - class AggIHTMLDocument : public nsIHTMLDocument { - public: - AggIHTMLDocument(); - ~AggIHTMLDocument(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD SetTitle(const nsString& aTitle); - - NS_IMETHOD AddImageMap(nsIImageMap* aMap); - - NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult); - }; - - AggIHTMLDocument mIHTMLDocument; - nsIHTMLStyleSheet* mAttrStyleSheet; - nsVoidArray mImageMaps; -}; - -#endif /* nsHTMLDocument_h___ */ diff --git a/mozilla/layout/html/document/src/nsIHTMLDocument.h b/mozilla/layout/html/document/src/nsIHTMLDocument.h deleted file mode 100644 index b6d9cd8a6b1..00000000000 --- a/mozilla/layout/html/document/src/nsIHTMLDocument.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIHTMLDocument_h___ -#define nsIHTMLDocument_h___ - -#include "nsISupports.h" -class nsIImageMap; -class nsString; - -/* b2a848b0-d0a9-11d1-89b1-006008911b81 */ -#define NS_IHTMLDOCUMENT_IID \ -{0xb2a848b0, 0xd0a9, 0x11d1, {0x89, 0xb1, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}} - -/** - * HTML document extensions to nsIDocument. - */ -class nsIHTMLDocument : public nsISupports { -public: - NS_IMETHOD SetTitle(const nsString& aTitle) = 0; - - NS_IMETHOD AddImageMap(nsIImageMap* aMap) = 0; - - NS_IMETHOD GetImageMap(const nsString& aMapName, nsIImageMap** aResult) = 0; -}; - -#endif /* nsIHTMLDocument_h___ */ diff --git a/mozilla/layout/html/document/src/ua.css b/mozilla/layout/html/document/src/ua.css deleted file mode 100644 index 2ad6eb38372..00000000000 --- a/mozilla/layout/html/document/src/ua.css +++ /dev/null @@ -1,292 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -// It's probably cheaper to have a single rule per tag than to have to -// merge rules - -// XXX I'm starting to believe that this portion of the style sheet -// comes from the PresentationContext. - -// XXX temporary hack -IMPLICITP { - display: block; - margin-top: 0pt; - margin-bottom: 2pt; -} - -BODY { - font-family: "Times Roman", serif; - font-style: normal; - font-variant: normal; - font-weight: normal; - font-size: 11pt; - line-height: 1.1; - background: rgb(255,255,255); -// background: rgb(192,192,192); - color: black; - padding: 12px; - display: block; - cursor: arrow; -} - -// XXX Use this! -FRAMESET { - font-family: "Times Roman", serif; - font-style: normal; - font-variant: normal; - font-weight: normal; - font-size: medium; - background: rgb(192,192,192); - color: black; - margin: 0px; - display: block; -} - -// XXX Used when PagePreview'ing -PAGE { - margin: 10px; - background: white; - border: black solid 1px; - display: block; -} - -//---------------------------------------------------------------------- - -// This part of the ua.css is junk taken from the css1 spec and used as -// a temporary style sheet. - -UL, OL, DL { display: block; } -DT, DD { display: block; } -LI { display: list-item; } -IMG { display: inline; } -SPACER { display: inline; } -WBR { display: inline; } - -// Default list-style-type styles. -// The Navigator 3.0 rule is: -// Zeroth-level: small disc. (Needs to be handled by parser.) -// First level: disc -// second level: circle -// third and higher levels: square. -// -// These style rules assume that MENU and DIR have been mapped to UL. - -UL { - list-style-type: disc; -} - -OL UL, UL UL { - list-style-type: circle; -} - -UL UL UL, UL OL UL, OL UL UL, OL OL UL { - list-style-type: square; -} - -OL { - list-style-type: decimal; -} - -UL, OL { - padding-left: 40px; /* nav4's value */ -} - -DT { margin-bottom: 0 } -DD { margin-top: 0; margin-left: .25in; } - -A:link { color: blue; text-decoration: underline; cursor: hand; } -A:visited { color: purple; text-decoration: underline; cursor: hand; } -A:active { color: lime; text-decoration: underline; cursor: hand; } -A:out-of-date { color: red; text-decoration: underline; cursor: hand; } - -A:link IMG { border: 2px solid blue; text-decoration: underline } -A:visited IMG { border: 2px solid purple; text-decoration: underline } -A:active IMG { border: 2px solid lime; text-decoration: underline } -A:out-of-date IMG { border: 2px solid red; text-decoration: underline } - -IMG { border-style: solid; border-color: blue; } -//INPUT { border-style: solid; border-color: blue; } - -//---------------------------------------------------------------------- -// The real stuff - -HR { - display: block; - height: 3px; - margin-top: 5px; - margin-bottom: 5px; -} - -BR { - display: block; -} - -// Block tags -ADDRESS { - display: block; - font-style: italic; -} -BLOCKQUOTE { - display: block; - margin-left: .25in; - margin-right: .25in; -} -CENTER { - display: block; - text-align: center; -} -DIV { - display: block; -} -H1 { - display: block; - font-size: 22pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H2 { - display: block; - font-size: 16pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H3 { - display: block; - font-size: 13pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H4 { - display: block; - font-size: 12pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H5 { - display: block; - font-size: 9pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H6 { - display: block; - font-size: 8pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -LISTING { - display: block; - font-family: monospace; - font-size: small; - white-space: pre; -} -NOBR { - display: inline; - white-space: pre; // XXX approximation? -} -P { - display: block; - margin-top: 2pt; - margin-bottom: 2pt; -} -PLAINTEXT, XMP, PRE { - display: block; // Note: need before and after breaks - font-family: monospace; - white-space: pre; -} - -// Table tags -TABLE { - display: block; - border-style: outset; - border-color: #C0C0C0; - cell-spacing: 4px; -} -TD { - vertical-align: middle; - border-style: inset; - border-color: #C0C0C0; -} -TH { - vertical-align: middle; - text-align: center; - font-weight: bold; - border-style: inset; - border-color: #C0C0C0; -} -CAPTION { - text-align: center; -} - -// XXX Special rule to eliminate margin around for nav4 compatability -// XXX This isn't good enough because we only want the margin eliminated -// around the first paragraph! -/*TD P, TH P { - margin-top: 0; - margin-bottom: 0; -}*/ - -// Span tags -B, STRONG { - display: inline; - font-weight: bolder; -} -I, CITE, EM, VAR { - display: inline; - font-style: italic; -} -TT, CODE, KBD, SAMP { - display: inline; - font-family: monospace; -} -U { - display: inline; - text-decoration: underline; -} -S, STRIKE { - display: inline; - text-decoration: line-through; -} -BLINK { - display: inline; - text-decoration: blink; -} -BIG { - display: inline; - font-size: larger; -} -SMALL { - display: inline; - font-size: smaller; -} -DFN, SPAN { - display: inline; -} -SUB { - display: inline; - vertical-align: sub; -} -SUP { - display: inline; - vertical-align: super; -} diff --git a/mozilla/layout/html/forms/Makefile b/mozilla/layout/html/forms/Makefile deleted file mode 100644 index c650dc9b7ab..00000000000 --- a/mozilla/layout/html/forms/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -DIRS = public src - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/forms/makefile.win b/mozilla/layout/html/forms/makefile.win deleted file mode 100644 index c9c67f325a1..00000000000 --- a/mozilla/layout/html/forms/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -DIRS=public src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/html/forms/public/Makefile b/mozilla/layout/html/forms/public/Makefile deleted file mode 100644 index 07635497a87..00000000000 --- a/mozilla/layout/html/forms/public/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -EXPORTS = \ - nsIFormControl.h \ - nsIFormManager.h \ - $(NULL) - -MODULE = raptor - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/forms/public/makefile.win b/mozilla/layout/html/forms/public/makefile.win deleted file mode 100644 index 7508fed5452..00000000000 --- a/mozilla/layout/html/forms/public/makefile.win +++ /dev/null @@ -1,26 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -EXPORTS=nsIFormControl.h nsIFormManager.h - -MODULE=raptor - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/layout/html/forms/public/nsIFormControl.h b/mozilla/layout/html/forms/public/nsIFormControl.h deleted file mode 100644 index 173aa9c7280..00000000000 --- a/mozilla/layout/html/forms/public/nsIFormControl.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIFormControl_h___ -#define nsIFormControl_h___ - -#include "nsISupports.h" -class nsIFormManager; - -#define NS_IFORMCONTROL_IID \ -{ 0x282ff440, 0xcd7e, 0x11d1, \ - {0x89, 0xad, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} } - -/** - * Interface which all form controls (e.g. buttons, checkboxes, text, - * radio buttons, select, etc) implement. - **/ -class nsIFormControl : public nsISupports { -public: - - virtual void GetType(nsString& aType) const = 0; - virtual PRBool GetChecked(PRBool aGetInitialValue) const = 0; - virtual void SetChecked(PRBool aState, PRBool aSetInitialValue) = 0; - - /** - * Get the form manager which manages this control. - * @return the form manager - */ - virtual nsIFormManager* GetFormManager() const = 0; - - /** - * Get the max number of values that this control can have; the actual - * number of values may be less. - * @return the max number of values - */ - virtual PRInt32 GetMaxNumValues() = 0; - - /** - * Get the name of this control. Controls without names will not have any - * data submitted. - * @param aResult the nsString which will be set to the name (out parm) - * @return PR_TRUE if there was a name, PR_FALSE otherwise - */ - virtual PRBool GetName(nsString& aResult) const = 0; - - /** - * Get the number of references to this control by other objects. - * @return the ref count - */ - virtual nsrefcnt GetRefCount() const = 0; - - /** - * Get the vaules which this control could submit. - * @param aMaxNumValues the maximum number of values to set (in parm) - * @param aNumValues the actual number of values set (out parm) - * @param aValues an array of nsString which contains the values (out parm - * that is allocated by the caller) - * @return PR_TRUE if any values were set, PR_FALSE otherwise - */ - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues) = 0; - - /** - * Set this control back to its initial value - */ - virtual void Reset() = 0; - - /** - * Set the form manager for this control - * @param aFormMan the new form manager - * @param aDecrementRef if PR_TRUE, decrement the ref count to the existing - * form manager. This facilitates handling circular references. - */ - virtual void SetFormManager(nsIFormManager* aFormMan, PRBool aDecrementRef = PR_TRUE) = 0; - -}; - -#endif /* nsIFormControl_h___ */ diff --git a/mozilla/layout/html/forms/public/nsIFormManager.h b/mozilla/layout/html/forms/public/nsIFormManager.h deleted file mode 100644 index 770dd5c43dc..00000000000 --- a/mozilla/layout/html/forms/public/nsIFormManager.h +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIFormManager_h___ -#define nsIFormManager_h___ - -#include "nsISupports.h" -class nsIFormControl; -class nsIPresContext; -class nsIFrame; - -// IID for the nsIFormManager interface -#define NS_IFORMMANAGER_IID \ -{ 0x592daa01, 0xcb23, 0x11d1, \ - { 0x80, 0x2d, 0x0, 0x60, 0x8, 0x15, 0xa7, 0x91 } } - -/** - * Abstract form manager interface. Form managers are responsible for - * the management of form controls. This includes gathering of data - * for form submission, resetting form controls to their initial state, - * and other programmatic control during form processing. - **/ -class nsIFormManager : public nsISupports { -public: - // Event methods - - /** - * Respond to a radio button being checked. This form manager is responsible - * for radio group coordination. - * @param aRadio the radio button that was checked - */ - virtual void OnRadioChecked(nsIFormControl& aRadio) = 0; - - /** - * Reset the values of all of this manager's controls back to their - * initial values. This is in response to a reset button being pushed. - */ - virtual void OnReset() = 0; - - /** - * If there is a single text form control, this is identical to OnReset, - * otherwise do nothing. This in response to a carriage return being - * entered within a text control. - */ - virtual void OnReturn() = 0; - - /** - * Submit the values of this manager's controls depending on its action, - * method attributes. This in response to a submit button being clicked. - * @param aPresContext the presentation context - * @param aFrame the frame of the submit button - */ - virtual void OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame) = 0; - - /** - * This is tbd and is in repsonse to a tab key being entered in one - * of the controls. - */ - virtual void OnTab() = 0; - - // methods accessing controls - - /** - * Add a control to end of this manager's list of controls - * @param aFormControl the control to add - * @return PR_TRUE if the control was successfully added - */ - virtual PRBool AddFormControl(nsIFormControl* aFormControl) = 0; - - /** - * Get the number of controls that this manager has in its list - * @return the number of controls - */ - virtual PRInt32 GetFormControlCount() const = 0; - - /** - * Get the control at a specific position in this manager's list - * @param aIndex the position at which to get - * @return the control at that position - */ - virtual nsIFormControl* GetFormControlAt(PRInt32 aIndex) const = 0; - - /** - * Remove a control from this manager's list - * @param aFormControl thc control to remove - * @param aChildIsRef if PR_TRUE, the controls ref count will be decremented - * otherwise not. This is to facilitate circular references. - * @return PR_TRUE if the control was successfully removed. - */ - virtual PRBool RemoveFormControl(nsIFormControl* aFormControl, - PRBool aChildIsRef = PR_TRUE) = 0; - - // methods accessing attributes - - /** - * Get the named attribute of this manager - * @param aName the name of the attribute - * @param aResult the value of the attribute - * @return PR_TRUE if there is an attribute with name aName - */ - virtual PRBool GetAttribute(const nsString& aName, - nsString& aResult) const = 0; - /** - * Set the named attribute of this manager - * @param aName the name of the attribute - * @param aValue the value of the attribute - */ - virtual void SetAttribute(const nsString& aName, const nsString& aValue) = 0; - - // misc methods - - /** - * Initialize this form manager after all of the controls have been added - * This makes it possible to determine what the radio groups are. - * @param aReinit if PR_TRUE initialize even if Init has been called before. - */ - virtual void Init(PRBool aReinit) = 0; - - /** - * Get the number of references to this form manager by other objects. - * @return the ref count - */ - virtual nsrefcnt GetRefCount() const = 0; -}; - -#endif /* nsIFormManager_h___ */ diff --git a/mozilla/layout/html/forms/src/Makefile b/mozilla/layout/html/forms/src/Makefile deleted file mode 100644 index a4d1cec88f4..00000000000 --- a/mozilla/layout/html/forms/src/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -include $(DEPTH)/config/config.mk - -LIBRARY_NAME = raptorhtmlforms_s - -DEFINES += -D_IMPL_NS_HTML - -# Note the sophisticated alphabetical ordering :-| -CPPSRCS = \ - nsForm.cpp \ - nsInput.cpp \ - nsInputButton.cpp \ - nsInputCheckbox.cpp \ - nsInputFile.cpp \ - nsInputFrame.cpp \ - nsInputImage.cpp \ - nsInputRadio.cpp \ - nsInputText.cpp \ - nsSelect.cpp \ - $(NULL) - -MODULE = raptor - -INCLUDES += -I../../../base/src -I../../base/src -I../../style/src - -REQUIRES = xpcom raptor dom - -include $(DEPTH)/config/rules.mk - diff --git a/mozilla/layout/html/forms/src/makefile.win b/mozilla/layout/html/forms/src/makefile.win deleted file mode 100644 index 21265e6fbf4..00000000000 --- a/mozilla/layout/html/forms/src/makefile.win +++ /dev/null @@ -1,53 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -LIBRARY_NAME=raptorhtmlforms_s - -DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN -MODULE=raptor -REQUIRES=xpcom raptor - -CPPSRCS=nsForm.cpp nsInput.cpp nsInputButton.cpp nsInputCheckbox.cpp \ - nsInputFile.cpp nsInputFrame.cpp nsInputImage.cpp \ - nsInputRadio.cpp nsInputText.cpp nsSelect.cpp - -CPP_OBJS=.\$(OBJDIR)\nsForm.obj .\$(OBJDIR)\nsInput.obj \ - .\$(OBJDIR)\nsInputButton.obj .\$(OBJDIR)\nsInputCheckbox.obj \ - .\$(OBJDIR)\nsInputFile.obj .\$(OBJDIR)\nsInputFrame.obj \ - .\$(OBJDIR)\nsInputImage.obj .\$(OBJDIR)\nsInputRadio.obj \ - .\$(OBJDIR)\nsInputText.obj .\$(OBJDIR)\nsSelect.obj - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \ - -I..\..\base\src -I..\..\style\src \ - -I..\..\..\base\src \ - -I$(PUBLIC)\dom - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - -clobber:: - rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/layout/html/forms/src/nsForm.cpp b/mozilla/layout/html/forms/src/nsForm.cpp deleted file mode 100644 index 3f186f5ae6d..00000000000 --- a/mozilla/layout/html/forms/src/nsForm.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLForms.h" -#include "nsIFormManager.h" -#include "nsIFormControl.h" -#include "nsIAtom.h" -#include "nsHTMLIIDs.h" -#include "nsIRenderingContext.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsLeafFrame.h" -#include "nsCSSRendering.h" -#include "nsHTMLIIDs.h" -#include "nsDebug.h" -#include "nsIWidget.h" -#include "nsVoidArray.h" -#include "nsHTMLAtoms.h" -#include "nsIHTMLAttributes.h" -#include "nsCRT.h" -#include "nsIURL.h" -#include "nsIDocument.h" -#include "nsILinkHandler.h" -#include "nsInputRadio.h" -#include "nsIRadioButton.h" - -// netlib has a general function (netlib\modules\liburl\src\escape.c) -// which does url encoding. Since netlib is not yet available for raptor, -// the following will suffice. Convert space to +, don't convert alphanumeric, -// conver each non alphanumeric char to %XY where XY is the hexadecimal -// equavalent of the binary representation of the character. -// -void EscapeURLString(char* aInString, char* aOutString) -{ - if (nsnull == aInString) { - return; - } - static char *toHex = "0123456789ABCDEF"; - char* outChar = aOutString; - for (char* inChar = aInString; *inChar; inChar++) { - if(' ' == *inChar) { // convert space to + - *outChar++ = '+'; - } else if ( (((*inChar - '0') >= 0) && (('9' - *inChar) >= 0)) || // don't conver - (((*inChar - 'a') >= 0) && (('z' - *inChar) >= 0)) || // alphanumeric - (((*inChar - 'A') >= 0) && (('Z' - *inChar) >= 0)) ) { - *outChar++ = *inChar; - } else { // convert all else to hex - *outChar++ = '%'; - *outChar++ = toHex[(*inChar >> 4) & 0x0F]; - *outChar++ = toHex[*inChar & 0x0F]; - } - } - *outChar = 0; // terminate the string -} - -nsString* EscapeURLString(nsString& aString) -{ - char* inBuf = aString.ToNewCString(); - char* outBuf = new char[ (strlen(inBuf) * 3) + 1 ]; - EscapeURLString(inBuf, outBuf); - nsString* result = new nsString(outBuf); - delete [] outBuf; - delete [] inBuf; - return result; -} - - -//---------------------------------------------------------------------- - -static NS_DEFINE_IID(kIFormManagerIID, NS_IFORMMANAGER_IID); - -class nsForm : public nsIFormManager -{ -public: - // Construct a new Form Element with no attributes. This needs to be - // made private and have a static COM create method. - nsForm(nsIAtom* aTag); - virtual ~nsForm(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - virtual void OnRadioChecked(nsIFormControl& aRadio); - - // callback for reset button controls. - virtual void OnReset(); - - // callback for text and textarea controls. If there is a single - // text/textarea and a return is entered, then this is equavalent to - // a submit. - virtual void OnReturn(); - - // callback for submit button controls. - virtual void OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame); - - // callback for tabs on controls that can gain focus. This will - // eventually need to be handled at the document level to support - // the tabindex attribute. - virtual void OnTab(); - - virtual PRInt32 GetFormControlCount() const; - virtual nsIFormControl* GetFormControlAt(PRInt32 aIndex) const; - virtual PRBool AddFormControl(nsIFormControl* aFormControl); - virtual PRBool RemoveFormControl(nsIFormControl* aFormControl, - PRBool aChildIsRef = PR_TRUE); - - virtual void SetAttribute(const nsString& aName, const nsString& aValue); - - virtual PRBool GetAttribute(const nsString& aName, - nsString& aResult) const; - - virtual nsresult GetRefCount() const; - - virtual void Init(PRBool aReinit); - -protected: - void RemoveRadioGroups(); - - nsIAtom* mTag; - nsIHTMLAttributes* mAttributes; - nsVoidArray mChildren; - nsVoidArray mRadioGroups; - nsString* mAction; - nsString* mEncoding; - nsString* mTarget; - PRInt32 mMethod; - PRBool mInited; -}; - -#define METHOD_UNSET 0 -#define METHOD_GET 1 -#define METHOD_POST 2 - -// CLASS nsForm - -// Note: operator new zeros our memory -nsForm::nsForm(nsIAtom* aTag) -{ - NS_INIT_REFCNT(); - mTag = aTag; - NS_IF_ADDREF(aTag); - mInited = PR_FALSE; -} - -nsForm::~nsForm() -{ - NS_IF_RELEASE(mTag); - int numChildren = GetFormControlCount(); - for (int i = 0; i < numChildren; i++) { - nsIFormControl* child = GetFormControlAt(i); - RemoveFormControl(child, PR_FALSE); - child->SetFormManager(nsnull, PR_FALSE); - NS_RELEASE(child); - } - if (nsnull != mAction) delete mAction; - if (nsnull != mEncoding) delete mEncoding; - if (nsnull != mTarget) delete mTarget; - - RemoveRadioGroups(); -} - -NS_IMPL_QUERY_INTERFACE(nsForm,kIFormManagerIID); -NS_IMPL_ADDREF(nsForm); - -nsrefcnt nsForm::GetRefCount() const -{ - return mRefCnt; -} - -nsrefcnt nsForm::Release() -{ - --mRefCnt; - int numChildren = GetFormControlCount(); - PRBool externalRefsToChildren = PR_FALSE; // are there refs to any children besides my ref - for (int i = 0; i < numChildren; i++) { - nsIFormControl* child = GetFormControlAt(i); - if (child->GetRefCount() > 1) { - externalRefsToChildren = PR_TRUE; - break; - } - } - if (!externalRefsToChildren && ((int)mRefCnt == numChildren)) { - mRefCnt = 0; - delete this; - return 0; - } - return mRefCnt; -} - -PRInt32 -nsForm::GetFormControlCount() const -{ - return mChildren.Count(); -} - -nsIFormControl* -nsForm::GetFormControlAt(PRInt32 aIndex) const -{ - nsIFormControl* ctl = (nsIFormControl*) mChildren.ElementAt(aIndex); - NS_IF_ADDREF(ctl); - return ctl; -} - -PRBool -nsForm::AddFormControl(nsIFormControl* aChild) -{ - PRBool rv = mChildren.AppendElement(aChild); - if (rv) { - NS_ADDREF(aChild); - } - return rv; -} - -PRBool -nsForm::RemoveFormControl(nsIFormControl* aChild, PRBool aChildIsRef) -{ - PRBool rv = mChildren.RemoveElement(aChild); - if (rv && aChildIsRef) { - NS_RELEASE(aChild); - } - return rv; -} - -void -nsForm::OnReset() -{ - PRInt32 numChildren = mChildren.Count(); - for (int childX = 0; childX < numChildren; childX++) { - nsIFormControl* child = (nsIFormControl*) mChildren.ElementAt(childX); - child->Reset(); - } -} - -void -nsForm::OnReturn() -{ -} - -void -nsForm::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame) -{ - printf("\n YYYYYYYYYYYYY \n"); - // right now we only do "get" - nsAutoString method, href; - GetAttribute("method", method); - PRBool isPost = (method.EqualsIgnoreCase("post")) ? PR_TRUE : PR_FALSE; - GetAttribute("action", href); - - nsString data(href); // this could be more efficient, by allocating a larger buffer - data += '?'; - PRBool firstTime = PR_TRUE; - - PRInt32 numChildren = mChildren.Count(); - // collect and encode the data from the children controls - for (PRInt32 childX = 0; childX < numChildren; childX++) { - nsIFormControl* child = (nsIFormControl*) mChildren.ElementAt(childX); - nsString childName; - if (PR_TRUE == child->GetName(childName)) { - PRInt32 numValues = 0; - PRInt32 maxNumValues = child->GetMaxNumValues(); - if (maxNumValues <= 0) { - continue; - } - nsString* values = new nsString[maxNumValues]; - if (PR_TRUE == child->GetValues(maxNumValues, numValues, values)) { - for (int valueX = 0; valueX < numValues; valueX++) { - if (PR_TRUE == firstTime) { - firstTime = PR_FALSE; - } else { - data += "&"; - } - nsString* convName = EscapeURLString(childName); - data += *convName; - delete convName; - data += "="; - nsString* convValue = EscapeURLString(values[valueX]); - data += *convValue; - delete convValue; - } - } - delete [] values; - } - } - - // make the url string - nsILinkHandler* handler; - if (NS_OK == aPresContext->GetLinkHandler(&handler)) { - // Resolve url to an absolute url - nsIURL* docURL = nsnull; - nsIContent* content; - aFrame->GetContent(content); - if (nsnull != content) { - nsIDocument* doc = content->GetDocument(); - docURL = doc->GetDocumentURL(); - NS_RELEASE(doc); - NS_RELEASE(content); - } - - nsAutoString target, method; - GetAttribute("target", target); - - nsAutoString absURLSpec; - nsAutoString base; - nsresult rv = NS_MakeAbsoluteURL(docURL, base, data, absURLSpec); - NS_IF_RELEASE(docURL); - - // Now pass on absolute url to the click handler - handler->OnLinkClick(aFrame, absURLSpec, target); -printf("\nurl=%s\n", absURLSpec.ToNewCString()); - } -} - -void -nsForm::OnTab() -{ -} - -void nsForm::SetAttribute(const nsString& aName, const nsString& aValue) -{ - nsAutoString tmp(aName); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - - if (atom == nsHTMLAtoms::action) { - nsAutoString url(aValue); - url.StripWhitespace(); - if (nsnull == mAction) { - mAction = new nsString(url); - } - else { - *mAction = url; - } - } - else if (atom == nsHTMLAtoms::encoding) { - if (nsnull == mEncoding) { - mEncoding = new nsString(aValue); - } - else { - *mEncoding = aValue; - } - } - else if (atom == nsHTMLAtoms::target) { - if (nsnull == mTarget) { - mTarget = new nsString(aValue); - } - else { - *mTarget = aValue; - } - } - else if (atom == nsHTMLAtoms::method) { - if (aValue.EqualsIgnoreCase("post")) { - mMethod = METHOD_POST; - } - else { - mMethod = METHOD_GET; - } - } - else { - // Use default storage for unknown attributes - if (nsnull == mAttributes) { - NS_NewHTMLAttributes(&mAttributes, nsnull); - } - if (nsnull != mAttributes) { - mAttributes->SetAttribute(atom, aValue); - } - } - NS_RELEASE(atom); -} - -PRBool nsForm::GetAttribute(const nsString& aName, - nsString& aResult) const -{ - nsAutoString tmp(aName); - tmp.ToUpperCase(); - nsIAtom* atom = NS_NewAtom(tmp); - PRBool rv = PR_FALSE; - if (atom == nsHTMLAtoms::action) { - if (nsnull != mAction) { - aResult = *mAction; - rv = PR_TRUE; - } - } - else if (atom == nsHTMLAtoms::encoding) { - if (nsnull != mEncoding) { - aResult = *mEncoding; - rv = PR_TRUE; - } - } - else if (atom == nsHTMLAtoms::target) { - if (nsnull != mTarget) { - aResult = *mTarget; - rv = PR_TRUE; - } - } - else if (atom == nsHTMLAtoms::method) { - if (METHOD_UNSET != mMethod) { - if (METHOD_POST == mMethod) { - aResult = "post"; - } - else { - aResult = "get"; - } - rv = PR_TRUE; - } - } - else { - // Use default storage for unknown attributes - if (nsnull != mAttributes) { - nsHTMLValue value; - if (eContentAttr_HasValue == mAttributes->GetAttribute(atom, value)) { - if (value.GetUnit() == eHTMLUnit_String) { - value.GetStringValue(aResult); - rv = PR_TRUE; - } - } - } - } - - NS_RELEASE(atom); - return rv; -} - -void nsForm::RemoveRadioGroups() -{ - int numRadioGroups = mRadioGroups.Count(); - for (int i = 0; i < numRadioGroups; i++) { - nsInputRadioGroup* radioGroup = (nsInputRadioGroup *) mRadioGroups.ElementAt(i); - delete radioGroup; - mRadioGroups.RemoveElement(radioGroup); - } -} - -void nsForm::Init(PRBool aReinit) -{ - if (mInited && !aReinit) { - return; - } - mInited = PR_TRUE; - RemoveRadioGroups(); - - // determine which radio buttons belong to which radio groups, unnamed radio buttons - // don't go into any group since they can't be submitted - int numControls = GetFormControlCount(); - for (int i = 0; i < numControls; i++) { - nsIFormControl* control = (nsIFormControl *)GetFormControlAt(i); - nsString name; - PRBool hasName = control->GetName(name); - nsString type; - control->GetType(type); - if (hasName && (type.Equals(*nsInputRadio::kTYPE))) { - int numGroups = mRadioGroups.Count(); - PRBool added = PR_FALSE; - nsInputRadioGroup* group; - for (int j = 0; j < numGroups; j++) { - group = (nsInputRadioGroup *) mRadioGroups.ElementAt(j); - nsString name; - group->GetName(name); - if (name.Equals(name)) { - group->AddRadio(control); - added = PR_TRUE; - break; - } - } - if (!added) { - group = new nsInputRadioGroup(name); - mRadioGroups.AppendElement(group); - group->AddRadio(control); - } - // allow only one checked radio button - if (control->GetChecked(PR_TRUE)) { - if (nsnull == group->GetCheckedRadio()) { - group->SetCheckedRadio(control); - } - else { - control->SetChecked(PR_FALSE, PR_TRUE); - } - } - } - } -} - -void -nsForm::OnRadioChecked(nsIFormControl& aControl) -{ - nsString radioName; - if (!aControl.GetName(radioName)) { // don't consider a radio without a name - return; - } - - // locate the radio group with the name of aRadio - int numGroups = mRadioGroups.Count(); - for (int j = 0; j < numGroups; j++) { - nsInputRadioGroup* group = (nsInputRadioGroup *) mRadioGroups.ElementAt(j); - nsString groupName; - group->GetName(groupName); - nsIFormControl* checkedRadio = group->GetCheckedRadio(); - printf("\n group name=%s radio name=%s", groupName.ToNewCString(), radioName.ToNewCString()); - if (groupName.Equals(radioName) && (nsnull != checkedRadio) & (&aControl != checkedRadio)) { - checkedRadio->SetChecked(PR_FALSE, PR_FALSE); - group->SetCheckedRadio(&aControl); - } - } -} - -nsresult -NS_NewHTMLForm(nsIFormManager** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsForm* it = new nsForm(aTag); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - nsresult result = it->QueryInterface(kIFormManagerIID, (void**) aInstancePtrResult); - return result; -} - diff --git a/mozilla/layout/html/forms/src/nsFormElement.cpp b/mozilla/layout/html/forms/src/nsFormElement.cpp deleted file mode 100644 index 07cad0cf165..00000000000 --- a/mozilla/layout/html/forms/src/nsFormElement.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsHTMLParts.h" -#include "nsHTMLTagContent.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsLeafFrame.h" -#include "nsCSSRendering.h" -#include "nsHTMLIIDs.h" - -// this file is obsolete and will be removed - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); - -enum FormElementType { - eFormElementType_Submit, - eFormElementType_Reset, - eFormElementType_Text, - eFormElementType_Password, - eFormElementType_TextArea, -}; - -class FormElementFrame : public nsLeafFrame { -public: - FormElementFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - -protected: - virtual ~FormElementFrame(); - virtual void GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize); -}; - -class FormElementContent : public nsHTMLTagContent { -public: - FormElementContent(nsIAtom* aTag, FormElementType aType); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - -protected: - virtual ~FormElementContent(); - - FormElementType mType; -}; - -//---------------------------------------------------------------------- - -FormElementFrame::FormElementFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsLeafFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -FormElementFrame::~FormElementFrame() -{ -} - -// XXX it would be cool if form element used our rendering sw, then -// they could be blended, and bordered, and so on... -void FormElementFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); -} - -void FormElementFrame::GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) -{ - float p2t = aPresContext->GetPixelsToTwips(); - aDesiredSize.width = nscoord(75 * p2t); - aDesiredSize.height = nscoord(37 * p2t); -} - -//---------------------------------------------------------------------- - -FormElementContent::FormElementContent(nsIAtom* aTag, FormElementType aType) - : nsHTMLTagContent(aTag), - mType(aType) -{ -} - -FormElementContent::~FormElementContent() -{ -} - -nsIFrame* FormElementContent::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new FormElementFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -NS_HTML nsresult -NS_NewHTMLSubmitButton(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* it = new FormElementContent(aTag, eFormElementType_Submit); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -NS_HTML nsresult -NS_NewHTMLResetButton(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* it = new FormElementContent(aTag, eFormElementType_Reset); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/html/forms/src/nsHTMLForms.h b/mozilla/layout/html/forms/src/nsHTMLForms.h deleted file mode 100644 index f094b081df1..00000000000 --- a/mozilla/layout/html/forms/src/nsHTMLForms.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLForms_h___ -#define nsHTMLForms_h___ - -#include "nsIHTMLContent.h" -class nsIAtom; -class nsIFormManager; - -// fix this -#define CSS_NOTSET -1 -#define ATTR_NOTSET -1 - -// Form and Form Controls - -/** - * Construct an object implementing nsIFormManager - * @param aInstancePtrResult the address at which to place the - * address of the new instance. - * @param aTag the html tag which corresponds to the nsIFormManager - * @return NS_OK if the object was successfully constructed. - */ -extern nsresult -NS_NewHTMLForm(nsIFormManager** aInstancePtrResult, - nsIAtom* aTag); - -/** - * Construct an object with behavior of an html input button - * @param aInstancePtrResult the address at which to place the - * address of the new instance. - * @param aTag the html tag which corresponds to the nsIFormManager - * @param aManager the form manager which will manage the constructed object - * @return NS_OK if the object was successfully constructed. - */ -extern nsresult -NS_NewHTMLInputButton(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html reset button - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputReset(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html submit button - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputSubmit(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html checkbox - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputCheckbox(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html input file - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputFile(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html input hidden - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputHidden(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html input image - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputImage(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html select - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLOption(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag); - - -/** - * Construct an nsIHTMLContent with behavior of an html input password - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputPassword(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html input radio - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputRadio(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html select - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLSelect(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager, PRInt32 aHackIndex); - -/** - * Construct an nsIHTMLContent with behavior of an html input text - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLInputText(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -/** - * Construct an nsIHTMLContent with behavior of an html text area - * @see NS_NewHTMLInputButton for parameter and return values - */ -extern nsresult -NS_NewHTMLTextArea(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager); - -#endif /* nsHTMLForms_h___ */ diff --git a/mozilla/layout/html/forms/src/nsInput.cpp b/mozilla/layout/html/forms/src/nsInput.cpp deleted file mode 100644 index 125237c5245..00000000000 --- a/mozilla/layout/html/forms/src/nsInput.cpp +++ /dev/null @@ -1,469 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsInput.h" -#include "nsIFormManager.h" -#include "nsInputFrame.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsIRenderingContext.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsLeafFrame.h" -#include "nsCSSRendering.h" -#include "nsHTMLIIDs.h" -#include "nsHTMLAtoms.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsCoord.h" -#include "nsDebug.h" -#include "nsIWidget.h" -#include "nsHTMLForms.h" -#include "nsStyleConsts.h" - -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -// Note: we inherit a base class operator new that zeros our memory -nsInput::nsInput(nsIAtom* aTag, nsIFormManager* aManager) - : nsHTMLContainer(aTag), mControl() -{ - mFormMan = aManager; - if (nsnull != mFormMan) { - NS_ADDREF(mFormMan); - mFormMan->AddFormControl(&mControl); - } - mSize = ATTR_NOTSET; - mAlign = ATTR_NOTSET; -} - -nsInput::~nsInput() -{ - NS_IF_RELEASE(mWidget); - if (nsnull != mName) { - delete mName; - } - if (nsnull != mValue) { - delete mName; - } - if (nsnull != mFormMan) { - // prevent mFormMan from decrementing its ref count on us - mFormMan->RemoveFormControl(&mControl, PR_FALSE); - NS_RELEASE(mFormMan); - } -} - -void nsInput::MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ -#if 0 - if (ATTR_NOTSET != mAlign) { - nsStyleDisplay* display = (nsStyleDisplay*) - aContext->GetData(kStyleDisplaySID); - nsStyleText* text = (nsStyleText*) - aContext->GetData(kStyleTextSID); - switch (mAlign) { - case NS_STYLE_TEXT_ALIGN_LEFT: - display->mFloats = NS_STYLE_FLOAT_LEFT; - break; - case NS_STYLE_TEXT_ALIGN_RIGHT: - display->mFloats = NS_STYLE_FLOAT_RIGHT; - break; - default: - text->mVerticalAlignFlags = mAlign; - break; - } - } -#endif -} - -static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID); - -nsresult nsInput::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (aIID.Equals(kIFormControlIID)) { - AddRef(); - *aInstancePtr = (void**) &mControl; - return NS_OK; - } - return nsHTMLContainer::QueryInterface(aIID, aInstancePtr); -} - -nsrefcnt nsInput::Release() -{ - --mRefCnt; - int debugRefCnt = mRefCnt; - if (mRefCnt == 0) { - delete this; - return 0; - } - if ((mFormMan == nsnull) || (mRefCnt > 1)) { - return mRefCnt; - } - - int numSiblings = mFormMan->GetFormControlCount(); - PRBool externalRefs = PR_FALSE; // are there external refs to dad or any siblings - if ((int)mFormMan->GetRefCount() > numSiblings) { - externalRefs = PR_TRUE; - } else { - for (int i = 0; i < numSiblings; i++) { - nsIFormControl* sibling = mFormMan->GetFormControlAt(i); - if (sibling->GetRefCount() > 1) { - externalRefs = PR_TRUE; - break; - } - } - } - - if (!externalRefs) { - mRefCnt = 0; - delete this; - return 0; - } - - return mRefCnt; -} - - -nsIFrame* -nsInput::CreateFrame(nsIPresContext *aPresContext, - PRInt32 aIndexInParent, - nsIFrame *aParentFrame) -{ - NS_ASSERTION(0, "frames must be created by subclasses of Input"); - return nsnull; -} - -PRBool -nsInput::IsHidden() -{ - return PR_FALSE; -} - -void -nsInput::SetWidget(nsIWidget* aWidget) -{ - if (aWidget != mWidget) { - NS_IF_RELEASE(mWidget); - NS_IF_ADDREF(aWidget); - mWidget = aWidget; - } -} - -nsrefcnt nsInput::GetRefCount() const -{ - return mRefCnt; -} - -// this is for internal use and does not do an AddRef -nsIWidget* -nsInput::GetWidget() -{ - return mWidget; -} - -void -nsInput::SetFormManager(nsIFormManager* aFormMan, PRBool aDecrementRef) -{ - if (aDecrementRef) { - NS_IF_RELEASE(mFormMan); - } - mFormMan = aFormMan; - NS_IF_ADDREF(aFormMan); -} - -nsIFormManager* -nsInput::GetFormManager() const -{ - NS_IF_ADDREF(mFormMan); - return mFormMan; -} - -/** - * Get the name associated with this form element. If there is no name - * then return PR_FALSE (form elements without names are not submitable). - */ -PRBool -nsInput::GetName(nsString& aName) const -{ - if ((nsnull != mName) && (0 != mName->Length())) { - aName = *mName; - return PR_TRUE; - } - return PR_FALSE; -} - -void -nsInput::Reset() -{ -} - -PRInt32 -nsInput::GetMaxNumValues() -{ - return 0; -} - -PRBool -nsInput::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, nsString* aValues) -{ - aNumValues = 0; - return PR_FALSE; -} - -void nsInput::CacheAttribute(const nsString& aValue, nsString*& aLoc) -{ - if (nsnull == aLoc) { - aLoc = new nsString(aValue); - } else { - aLoc->SetLength(0); - aLoc->Append(aValue); - } -} - -void nsInput::CacheAttribute(const nsString& aValue, PRInt32 aMinValue, PRInt32& aLoc) -{ - PRInt32 status; - PRInt32 intVal = aValue.ToInteger(&status); - aLoc = ((NS_OK == status) && (intVal >= aMinValue)) ? intVal : aMinValue; -} - -void nsInput::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::type) { // You cannot set the type of a form element - return; - } - else if (aAttribute == nsHTMLAtoms::name) { - CacheAttribute(aValue, mName); - } - else if (aAttribute == nsHTMLAtoms::size) { - CacheAttribute(aValue, ATTR_NOTSET, mSize); - } - else if (aAttribute == nsHTMLAtoms::value) { - CacheAttribute(aValue, mValue); - } - else if (aAttribute == nsHTMLAtoms::align) { - CacheAttribute(aValue, ATTR_NOTSET, mAlign); - } - else { - super::SetAttribute(aAttribute, aValue); - } -} - -nsContentAttr nsInput::GetCacheAttribute(nsString* const& aLoc, nsHTMLValue& aValue) const -{ - aValue.Reset(); - if (nsnull == aLoc) { - return eContentAttr_NotThere; - } - else { - aValue.Set(*aLoc); - return eContentAttr_HasValue; - } -} - -nsContentAttr nsInput::GetCacheAttribute(PRInt32 aLoc, nsHTMLValue& aValue) const -{ - aValue.Reset(); - if (aLoc <= ATTR_NOTSET) { - return eContentAttr_NotThere; - } - else { - aValue.Set(aLoc); - return eContentAttr_HasValue; - } -} - -#if 0 -nsContentAttr nsInput::GetCacheAttribute(PRBool aLoc, nsHTMLValue& aValue) const -{ - aValue.Reset(); - if (aLoc) { - aValue.Set(1); - return eContentAttr_HasValue; - } - else { - return eContentAttr_NotThere; - } -} -#endif - -nsContentAttr nsInput::GetAttribute(nsIAtom* aAttribute, nsString& aValue) const -{ - nsHTMLValue htmlValue; - nsContentAttr result = GetAttribute(aAttribute, htmlValue); - if (eContentAttr_HasValue == result) { - htmlValue.GetStringValue(aValue); - return eContentAttr_HasValue; - } - else { - aValue = ""; - return eContentAttr_NoValue; - } -} - -nsContentAttr nsInput::GetAttribute(nsIAtom* aAttribute, PRInt32& aValue) const -{ - nsHTMLValue htmlValue; - nsContentAttr result = GetAttribute(aAttribute, htmlValue); - if (eContentAttr_HasValue == result) { - aValue = htmlValue.GetIntValue(); - return eContentAttr_HasValue; - } - else { - aValue = ATTR_NOTSET; - return eContentAttr_NoValue; - } -} - -#if 0 -nsContentAttr nsInput::GetAttribute(nsIAtom* aAttribute, PRBool& aValue) const -{ - PRInt32 intVal; - nsContentAttr result = GetAttribute(aAttribute, intVal); - if ((eContentAttr_HasValue == result) && (intVal > 0)) { - aValue = PR_TRUE; - return eContentAttr_HasValue; - } - else { - aValue = PR_FALSE; - return eContentAttr_NoValue; - } -} -#endif - -nsContentAttr nsInput::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const -{ - if (aAttribute == nsHTMLAtoms::type) { - nsAutoString tmp; - GetType(tmp); - if (tmp.Length() == 0) { // derivatives that don't support type return zero length string - return eContentAttr_NotThere; - } - else { - aValue.Set(tmp); - return eContentAttr_HasValue; - } - } - else if (aAttribute == nsHTMLAtoms::name) { - return GetCacheAttribute(mName, aValue); - } - else if (aAttribute == nsHTMLAtoms::size) { - return GetCacheAttribute(mSize, aValue); - } - else if (aAttribute == nsHTMLAtoms::value) { - return GetCacheAttribute(mValue, aValue); - } - else if (aAttribute == nsHTMLAtoms::align) { - return GetCacheAttribute(mAlign, aValue); - } - else { - return super::GetAttribute(aAttribute, aValue); - } -} - -PRBool nsInput::GetChecked(PRBool aGetInitialValue) const -{ - return PR_FALSE; -} - -void nsInput::SetChecked(PRBool aState, PRBool aSetInitialValue) -{ -} - - -//---------------------------------------------------------------------- - -#define GET_OUTER() ((nsInput*) ((char*)this - nsInput::GetOuterOffset())) - -nsInput::AggInputControl::AggInputControl() -{ -} - -nsInput::AggInputControl::~AggInputControl() -{ -} - -nsrefcnt nsInput::AggInputControl::AddRef() -{ - return GET_OUTER()->AddRef(); -} - -nsrefcnt nsInput::AggInputControl::Release() -{ - return GET_OUTER()->Release(); -} - -nsresult nsInput::AggInputControl::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - return GET_OUTER()->QueryInterface(aIID, aInstancePtr); -} - -PRBool nsInput::AggInputControl::GetName(nsString& aName) const -{ - return GET_OUTER()->GetName(aName); -} - -PRInt32 nsInput::AggInputControl::GetMaxNumValues() -{ - return GET_OUTER()->GetMaxNumValues(); -} - -PRBool nsInput::AggInputControl::GetValues(PRInt32 aMaxNumValues, - PRInt32& aNumValues, - nsString* aValues) -{ - return GET_OUTER()->GetValues(aMaxNumValues, aNumValues, aValues); -} - -void nsInput::AggInputControl::Reset() -{ - GET_OUTER()->Reset(); -} - -void nsInput::AggInputControl::SetFormManager(nsIFormManager* aFormMan, PRBool aDecrementRef) -{ - GET_OUTER()->SetFormManager(aFormMan, aDecrementRef); -} - -nsIFormManager* nsInput::AggInputControl::GetFormManager() const -{ - return GET_OUTER()->GetFormManager(); -} - -nsrefcnt nsInput::AggInputControl::GetRefCount() const -{ - return GET_OUTER()->GetRefCount(); -} - -PRBool nsInput::AggInputControl::GetChecked(PRBool aGetInitialValue) const -{ - return GET_OUTER()->GetChecked(aGetInitialValue); -} - -void nsInput::AggInputControl::SetChecked(PRBool aState, PRBool aSetInitialValue) -{ - GET_OUTER()->SetChecked(aState, aSetInitialValue); -} - -void nsInput::AggInputControl::GetType(nsString& aName) const -{ - GET_OUTER()->GetType(aName); -} - diff --git a/mozilla/layout/html/forms/src/nsInput.h b/mozilla/layout/html/forms/src/nsInput.h deleted file mode 100644 index 39be99dc5e0..00000000000 --- a/mozilla/layout/html/forms/src/nsInput.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInput_h___ -#define nsInput_h___ - -#include "nsHTMLContainer.h" -#include "nsIFormControl.h" -class nsIFormManager; -class nsIWidget; -class nsIView; -class nsIPresContext; - -/** - * nsInput represents an html Input element. This is a base class for - * the various Input types (button, checkbox, file, hidden, password, - * reset, radio, submit, text) - */ -class nsInput : public nsHTMLContainer { -public: - typedef nsHTMLContainer super; - /** - * main constructor - * @param aTag the html tag associated with this object - * @param aManager the form manager to manage this input - */ - nsInput(nsIAtom* aTag, nsIFormManager* aManager); - - /** - * @see nsIContentDelegate CreateFrame - */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - /** - * @see nsISupports QueryInterface - */ - NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - - /** - * @see nsISupports Release - */ - NS_IMETHOD_(nsrefcnt) Release(void); - - // nsIFormControl methods - - /** - * @see nsIFormControl GetFormManager - */ - virtual nsIFormManager* GetFormManager() const; - - /** - * @see nsIFormControl GetFormManager - */ - virtual PRInt32 GetMaxNumValues(); - - /** - * @see nsIFormControl GetFormManager - */ - virtual PRBool GetName(nsString& aName) const; - - /** - * @see nsIFormControl GetFormManager - */ - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - - virtual PRBool IsHidden(); - - /** - * @see nsIFormControl GetFormManager - */ - virtual void Reset(); - - /** - * @see nsIFormControl GetFormManager - */ - virtual void SetFormManager(nsIFormManager* aFormMan, PRBool aDecrementRef = PR_TRUE); - - // attribute methods - - /** - * Get a named attribute of this input - * @param aAttribute the name of the attribute - * @param aValue the value of the attribute - * @return eContentAttr_HasValue if there is a value, eContentAttr_NoValue - * if there is an attribute but no value, or eContentAttr_HasValue - * if there is no attribute. - */ - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const; - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, nsString& aValue) const; - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, PRInt32& aValue) const; -#if 0 - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, PRBool& aValue) const; -#endif - - /** - * Set the named attribute of this input - * @param aAttribute the name of the attribute - * @param aValue the value of the attribute - */ - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - - // misc methods - - /** - * Get the number of references to this input - * @return the number of references - **/ - virtual nsrefcnt GetRefCount() const; - - /** - * Get the widget associated with this input - * @return the widget, not a copy - **/ - nsIWidget* GetWidget(); - - /** - * Set the widget associated with this input - * @param aWidget the widget - **/ - void SetWidget(nsIWidget* aWidget); - - // this should not be public - static PRInt32 GetOuterOffset() { - return offsetof(nsInput,mControl); - } - - virtual void GetType(nsString& aResult) const = 0; - virtual PRBool GetChecked(PRBool aGetInitialValue) const; - virtual void SetChecked(PRBool aState, PRBool aSetInitialValue); - -protected: - virtual ~nsInput(); - - /** - * Get the type of this control - */ - nsIWidget* mWidget; - nsIFormManager* mFormMan; - - void CacheAttribute(const nsString& aValue, nsString*& aLoc); - void CacheAttribute(const nsString& aValue, PRInt32 aMinValue, PRInt32& aLoc); - nsContentAttr GetCacheAttribute(nsString* const& aLoc, nsHTMLValue& aValue) const; - nsContentAttr GetCacheAttribute(PRInt32 aLoc, nsHTMLValue& aValue) const; -#if 0 - nsContentAttr GetCacheAttribute(PRBool aLoc, nsHTMLValue& aValue) const; -#endif - - // Attributes common to all html form elements - nsString* mName; - nsString* mValue; - PRInt32 mSize; - PRInt32 mAlign; - - // Aggregator class and instance variable used to aggregate in the - // nsIFormControl interface to nsInput w/o using multiple - // inheritance. - class AggInputControl : public nsIFormControl { - public: - AggInputControl(); - ~AggInputControl(); - - // nsISupports - NS_DECL_ISUPPORTS - - // nsIFormControl - virtual PRBool GetName(nsString& aName) const; - virtual void GetType(nsString& aType) const; - virtual PRInt32 GetMaxNumValues(); - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - virtual void Reset(); - virtual void SetFormManager(nsIFormManager* aFormMan, PRBool aDecrementRef = PR_TRUE); - virtual nsIFormManager* GetFormManager() const; - virtual nsrefcnt GetRefCount() const; - virtual PRBool GetChecked(PRBool aGetInitialValue) const; - virtual void SetChecked(PRBool aState, PRBool aSetInitialValue); - }; - AggInputControl mControl; -}; - -#endif diff --git a/mozilla/layout/html/forms/src/nsInputButton.cpp b/mozilla/layout/html/forms/src/nsInputButton.cpp deleted file mode 100644 index 6acefade632..00000000000 --- a/mozilla/layout/html/forms/src/nsInputButton.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInput.h" -#include "nsInputFrame.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsIStyleContext.h" -#include "nsLeafFrame.h" -#include "nsCSSRendering.h" -#include "nsHTMLIIDs.h" -#include "nsIButton.h" -#include "nsIViewManager.h" -#include "nsISupports.h" -#include "nsHTMLAtoms.h" -#include "nsIButton.h" -#include "nsIView.h" -#include "nsViewsCID.h" -#include "nsWidgetsCID.h" -#include "nsIDeviceContext.h" -#include "nsIFontCache.h" -#include "nsIFontMetrics.h" -#include "nsIFormManager.h" - -enum nsInputButtonType { - kButton_InputButton, - kButton_Button, - kButton_InputReset, - kButton_InputSubmit, - kButton_InputHidden -}; - -class nsInputButton : public nsInput { -public: - nsInputButton (nsIAtom* aTag, nsIFormManager* aManager, - nsInputButtonType aType); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void GetDefaultLabel(nsString& aLabel); - - nsInputButtonType GetButtonType() { return mType; } - - virtual PRInt32 GetMaxNumValues(); - - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, nsString* aValues); - - virtual PRBool IsHidden(); - - protected: - virtual ~nsInputButton(); - - virtual void GetType(nsString& aResult) const; - - nsInputButtonType mType; -}; - -class nsInputButtonFrame : public nsInputFrame { -public: - nsInputButtonFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView* aView); - - virtual void MouseClicked(nsIPresContext* aPresContext); - - virtual const nsIID& GetCID(); - - virtual const nsIID& GetIID(); - - nsInputButtonType GetButtonType() const; - - -protected: - virtual ~nsInputButtonFrame(); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize); -}; - - -// nsInputButton Implementation - -nsInputButton::nsInputButton(nsIAtom* aTag, nsIFormManager* aManager, - nsInputButtonType aType) - : nsInput(aTag, aManager), mType(aType) -{ -} - -nsInputButton::~nsInputButton() -{ - if (nsnull != mValue) { - delete mValue; - } -} - -PRBool -nsInputButton::IsHidden() -{ - if (kButton_InputHidden == mType) { - return PR_TRUE; - } - else { - return PR_FALSE; - } -} - -void nsInputButton::GetType(nsString& aResult) const -{ - aResult.SetLength(0); - switch (mType) { - case kButton_InputButton: - case kButton_Button: - aResult.Append("button"); - break; - case kButton_InputReset: - aResult.Append("reset"); - break; - default: - case kButton_InputSubmit: - aResult.Append("submit"); - break; - } -} - -void -nsInputButton::GetDefaultLabel(nsString& aString) -{ - if (kButton_InputReset == mType) { - aString = "Reset"; - } else if (kButton_InputSubmit == mType) { - aString = "Submit"; - } else { - aString = "noname"; - } -} - -nsIFrame* -nsInputButton::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - if (kButton_InputHidden == mType) { - nsIFrame* frame; - nsFrame::NewFrame(&frame, this, aIndexInParent, aParentFrame); - return frame; - } - else { - return new nsInputButtonFrame(this, aIndexInParent, aParentFrame); - } - -} - -PRInt32 -nsInputButton::GetMaxNumValues() -{ - if ((kButton_InputSubmit == mType) || (kButton_InputHidden)) { - return 1; - } else { - return 0; - } -} - - -PRBool -nsInputButton::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues) -{ - if (aMaxNumValues <= 0) { - return PR_FALSE; - } - - if ((kButton_InputSubmit != mType) && (kButton_InputHidden != mType)) { - aNumValues = 0; - return PR_FALSE; - } - - if (nsnull != mValue) { - aValues[0].SetLength(0); - aValues[0].Append(*mValue); - aNumValues = 1; - return PR_TRUE; - } else { - aNumValues = 0; - return PR_FALSE; - } -} - -//---------------------------------------------------------------------- -// nsInputButtonFrame Implementation - -nsInputButtonFrame::nsInputButtonFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsInputButtonFrame::~nsInputButtonFrame() -{ -} - -nsInputButtonType -nsInputButtonFrame::GetButtonType() const -{ - nsInputButton* button = (nsInputButton *)mContent; - return button->GetButtonType(); -} - -void -nsInputButtonFrame::MouseClicked(nsIPresContext* aPresContext) -{ - nsInputButton* button = (nsInputButton *)mContent; - nsIFormManager* formMan = button->GetFormManager(); - if (nsnull != formMan) { - if (kButton_InputReset == button->GetButtonType()) { - formMan->OnReset(); - } else if (kButton_InputSubmit == button->GetButtonType()) { - //NS_ADDREF(this); - formMan->OnSubmit(aPresContext, this); - //NS_RELEASE(this); - } - NS_RELEASE(formMan); - } -} - -void -nsInputButtonFrame::GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize) -{ - if (kButton_InputHidden == GetButtonType()) { - aDesiredLayoutSize.width = 0; - aDesiredLayoutSize.height = 0; - aDesiredWidgetSize.width = 0; - aDesiredWidgetSize.height = 0; - return; - } - nsSize styleSize; - GetStyleSize(*aPresContext, aMaxSize, styleSize); - - nsSize size; - PRBool widthExplicit, heightExplicit; - PRInt32 ignore; - nsInputDimensionSpec spec(nsHTMLAtoms::size, PR_TRUE, nsHTMLAtoms::value, 1, - PR_FALSE, nsnull, 1); - CalculateSize(aPresContext, this, styleSize, spec, size, - widthExplicit, heightExplicit, ignore); - - if (!widthExplicit) { - size.width += 100; - } - if (!heightExplicit) { - size.height += 100; - } - - aDesiredLayoutSize.width = size.width; - aDesiredLayoutSize.height= size.height; - aDesiredWidgetSize.width = size.width; - aDesiredWidgetSize.height= size.height; -} - - -void -nsInputButtonFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ - nsIButton* button; - if (NS_OK == GetWidget(aView, (nsIWidget **)&button)) { - button->SetFont(GetFont(aPresContext)); - } - else { - NS_ASSERTION(0, "no widget in button control"); - } - - nsInputButton* content; - GetContent((nsIContent*&) content); - nsString value; - nsContentAttr status = content->GetAttribute(nsHTMLAtoms::value, value); - if (eContentAttr_HasValue == status) { - button->SetLabel(value); - } - else { - button->SetLabel(" "); - } - - NS_RELEASE(content); - NS_RELEASE(button); -} - -const nsIID& -nsInputButtonFrame::GetIID() -{ - static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID); - return kButtonIID; -} - -const nsIID& -nsInputButtonFrame::GetCID() -{ - static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); - return kButtonCID; -} - -nsresult -CreateButton(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager, - nsInputButtonType aType) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputButton(aTag, aManager, aType); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -nsresult -NS_NewHTMLInputButton(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - return CreateButton(aInstancePtrResult, aTag, aManager, kButton_InputButton); -} - -nsresult -NS_NewHTMLButton(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - return CreateButton(aInstancePtrResult, aTag, aManager, kButton_Button); -} - -nsresult -NS_NewHTMLInputSubmit(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - return CreateButton(aInstancePtrResult, aTag, aManager, kButton_InputSubmit); -} - -nsresult -NS_NewHTMLInputReset(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - return CreateButton(aInstancePtrResult, aTag, aManager, kButton_InputReset); -} - -nsresult -NS_NewHTMLInputHidden(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - return CreateButton(aInstancePtrResult, aTag, aManager, kButton_InputHidden); -} diff --git a/mozilla/layout/html/forms/src/nsInputCheckbox.cpp b/mozilla/layout/html/forms/src/nsInputCheckbox.cpp deleted file mode 100644 index 95fbcd9421c..00000000000 --- a/mozilla/layout/html/forms/src/nsInputCheckbox.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInputCheckbox.h" -#include "nsICheckButton.h" -#include "nsInputFrame.h" -#include "nsIContent.h" -#include "prtypes.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsIPresContext.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" -#include "nsWidgetsCID.h" -#include "nsIView.h" -#include "nsHTMLAtoms.h" - -class nsInputCheckboxFrame : public nsInputFrame { -public: - nsInputCheckboxFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - - virtual const nsIID& GetCID(); - - virtual const nsIID& GetIID(); - - virtual void MouseClicked(nsIPresContext* aPresContext); - virtual PRInt32 GetPadding() const; - NS_IMETHOD SetRect(const nsRect& aRect); - -protected: - virtual ~nsInputCheckboxFrame(); - PRBool mCacheState; - virtual void GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize); -}; - -nsInputCheckboxFrame::nsInputCheckboxFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsInputCheckboxFrame::~nsInputCheckboxFrame() -{ - mCacheState = PR_FALSE; -} - -NS_METHOD nsInputCheckboxFrame::SetRect(const nsRect& aRect) -{ - PRInt32 padding = GetPadding(); - MoveTo(aRect.x + padding, aRect.y); - SizeTo(aRect.width - (2 * padding), aRect.height); - return NS_OK; -} - -const nsIID& -nsInputCheckboxFrame::GetIID() -{ - static NS_DEFINE_IID(kCheckboxIID, NS_ICHECKBUTTON_IID); - return kCheckboxIID; -} - -const nsIID& -nsInputCheckboxFrame::GetCID() -{ - static NS_DEFINE_IID(kCheckboxCID, NS_CHECKBUTTON_CID); - return kCheckboxCID; -} - -PRInt32 nsInputCheckboxFrame::GetPadding() const -{ - return GetDefaultPadding(); -} - -void -nsInputCheckboxFrame::GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize) -{ - nsInputCheckbox* content = (nsInputCheckbox *)mContent; // this must be an nsCheckbox - - // get the intial state - nsHTMLValue value; - nsContentAttr result = content->GetAttribute(nsHTMLAtoms::checked, value); - if (result != eContentAttr_NotThere) { - mCacheState = PR_TRUE;/* XXX why cache state? */ - } - - float p2t = aPresContext->GetPixelsToTwips(); - aDesiredWidgetSize.width = (int)(12 * p2t); - aDesiredWidgetSize.height = (int)(12 * p2t); - PRInt32 padding = GetPadding(); - aDesiredLayoutSize.width = aDesiredWidgetSize.width + (2 * padding); - aDesiredLayoutSize.height = aDesiredWidgetSize.height; -} - -void -nsInputCheckboxFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ - nsICheckButton* checkbox; - if (NS_OK == GetWidget(aView, (nsIWidget **)&checkbox)) { - checkbox->SetState(mCacheState); - NS_RELEASE(checkbox); - } -} - -void -nsInputCheckboxFrame::MouseClicked(nsIPresContext* aPresContext) -{ - nsICheckButton* checkbox; - nsIView* view; - GetView(view); - if (NS_OK == GetWidget(view, (nsIWidget **)&checkbox)) { - PRBool newState = (checkbox->GetState()) ? PR_FALSE : PR_TRUE; - checkbox->SetState(newState); - NS_RELEASE(checkbox); - } - NS_RELEASE(view); -} - - - -// nsInputCheckbox - -nsInputCheckbox::nsInputCheckbox(nsIAtom* aTag, nsIFormManager* aManager) - : nsInput(aTag, aManager) -{ - mChecked = PR_FALSE; -} - -nsInputCheckbox::~nsInputCheckbox() -{ -} - - -PRInt32 -nsInputCheckbox::GetMaxNumValues() -{ - return 1; -} - - -PRBool -nsInputCheckbox::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues) -{ - if (aMaxNumValues <= 0) { - return PR_FALSE; - } - nsICheckButton* checkBox = (nsICheckButton *)GetWidget(); - PRBool state = checkBox->GetState(); - if(PR_TRUE != state) { - return PR_FALSE; - } - - if (nsnull == mValue) { - aValues[0] = "on"; - } else { - aValues[0] = *mValue; - } - aNumValues = 1; - - return PR_TRUE; -} - -void -nsInputCheckbox::Reset() -{ - nsICheckButton* checkbox = (nsICheckButton *)GetWidget(); - if (nsnull != checkbox) { - checkbox->SetState(mChecked); - } -} - -nsIFrame* -nsInputCheckbox::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new nsInputCheckboxFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -void nsInputCheckbox::GetType(nsString& aResult) const -{ - aResult = "checkbox"; -} - -void nsInputCheckbox::SetAttribute(nsIAtom* aAttribute, - const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::checked) { - mChecked = PR_TRUE; - } - else { - super::SetAttribute(aAttribute, aValue); - } -} - -nsContentAttr nsInputCheckbox::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - aResult.Reset(); - if (aAttribute == nsHTMLAtoms::checked) { - return GetCacheAttribute(mChecked, aResult); - } - else { - return super::GetAttribute(aAttribute, aResult); - } -} - -nsresult -NS_NewHTMLInputCheckbox(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputCheckbox(aTag, aManager); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - diff --git a/mozilla/layout/html/forms/src/nsInputCheckbox.h b/mozilla/layout/html/forms/src/nsInputCheckbox.h deleted file mode 100644 index ff1c99e0812..00000000000 --- a/mozilla/layout/html/forms/src/nsInputCheckbox.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInputCheckbox_h___ -#define nsInputCheckbox_h___ - -#include "nsInput.h" -class nsIAtom; -class nsString; - -class nsInputCheckbox : public nsInput { -public: - typedef nsInput super; - nsInputCheckbox (nsIAtom* aTag, nsIFormManager* aManager); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - - virtual PRInt32 GetMaxNumValues(); - - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - - virtual void Reset(); - -protected: - virtual ~nsInputCheckbox(); - - virtual void GetType(nsString& aResult) const; - - PRBool mChecked; // initial checked flag value -}; - -#endif diff --git a/mozilla/layout/html/forms/src/nsInputFile.cpp b/mozilla/layout/html/forms/src/nsInputFile.cpp deleted file mode 100644 index 85343603ed0..00000000000 --- a/mozilla/layout/html/forms/src/nsInputFile.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInputFile.h" -#include "nsInputFrame.h" -#include "nsIContent.h" -#include "prtypes.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsIPresContext.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" -#include "nsHTMLAtoms.h" - -class nsInputFileFrame : public nsInputFrame { -public: - nsInputFileFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - -protected: - virtual ~nsInputFileFrame(); -}; - -nsInputFileFrame::nsInputFileFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsInputFileFrame::~nsInputFileFrame() -{ -} - - -void -nsInputFileFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ -} - -//---------------------------------------------------------------------- -// nsInputFile - -nsInputFile::nsInputFile(nsIAtom* aTag, nsIFormManager* aManager) - : nsInput(aTag, aManager) -{ -} - -nsInputFile::~nsInputFile() -{ - if (nsnull != mValue) { - delete mValue; - } -} - -nsIFrame* -nsInputFile::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new nsInputFileFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -void nsInputFile::GetType(nsString& aResult) const -{ - aResult = "file"; -} - - -nsresult -NS_NewHTMLInputFile(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputFile(aTag, aManager); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - diff --git a/mozilla/layout/html/forms/src/nsInputFile.h b/mozilla/layout/html/forms/src/nsInputFile.h deleted file mode 100644 index 952f5f76259..00000000000 --- a/mozilla/layout/html/forms/src/nsInputFile.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInputFile_h___ -#define nsInputFile_h___ - -#include "nsInput.h" -class nsIAtom; -class nsString; - -// this class definition will move to nsInputFile.cpp - -class nsInputFile : public nsInput { -public: - typedef nsInput super; - nsInputFile (nsIAtom* aTag, nsIFormManager* aManager); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - -protected: - virtual ~nsInputFile(); - - virtual void GetType(nsString& aResult) const; - - nsString* mValue; - PRInt32 mSize; - PRInt32 mMaxLength; -}; - -#endif - - diff --git a/mozilla/layout/html/forms/src/nsInputFrame.cpp b/mozilla/layout/html/forms/src/nsInputFrame.cpp deleted file mode 100644 index d70b11a9917..00000000000 --- a/mozilla/layout/html/forms/src/nsInputFrame.cpp +++ /dev/null @@ -1,575 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInput.h" -#include "nsInputFrame.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsIRenderingContext.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsLeafFrame.h" -#include "nsCSSRendering.h" -#include "nsHTMLIIDs.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsCoord.h" -#include "nsWidgetsCID.h" -#include "nsViewsCID.h" -#include "nsRepository.h" -#include "nsGUIEvent.h" -#include "nsIFontCache.h" -#include "nsIFontMetrics.h" -#include "nsIFormManager.h" -#include "nsIDeviceContext.h" -#include "nsHTMLAtoms.h" -#include "nsIButton.h" // remove this when GetCID is pure virtual -#include "nsICheckButton.h" //remove this -#include "nsITextWidget.h" //remove this -#include "nsISupports.h" -#include "nsHTMLForms.h" -#include "nsStyleConsts.h" - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); - -struct nsInputCallbackData -{ - nsIPresContext* mPresContext; - nsInputFrame* mFrame; - nsInputCallbackData(nsIPresContext* aPresContext, nsInputFrame* aFrame) - :mPresContext(aPresContext), mFrame(aFrame) - { - } -}; - -nsInputFrame::nsInputFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsLeafFrame(aContent, aIndexInParent, aParentFrame) -{ - mCacheBounds.width = 0; - mCacheBounds.height = 0; - mLastMouseState = eMouseNone; -} - -nsInputFrame::~nsInputFrame() -{ -} - -NS_METHOD nsInputFrame::SetRect(const nsRect& aRect) -{ - return super::SetRect(aRect); -} - - -// XXX it would be cool if form element used our rendering sw, then -// they could be blended, and bordered, and so on... -NS_METHOD -nsInputFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); - - nsPoint offset; - nsIView *parent; - GetOffsetFromView(offset, parent); - - //offset.x += padding + GetPadding(); // add back the padding if present - - if (nsnull == parent) { // a problem - NS_ASSERTION(0, "parent view was null\n"); - } else { - nsIView* view; - GetView(view); - float t2p = aPresContext.GetTwipsToPixels(); - //nsIWidget *widget = view->GetWindow(); - nsIWidget* widget; - nsresult result = GetWidget(view, &widget); - if (NS_OK == result) { - nsRect vBounds; - view->GetBounds(vBounds); - - if ((vBounds.x != offset.x) || (vBounds.y != offset.y)) - view->SetPosition(offset.x, offset.y); - - // initially the widget was created as hidden - if (nsViewVisibility_kHide == view->GetVisibility()) { - nsInput* content; - GetContent((nsIContent *&) content); - content->GetFormManager()->Init(PR_FALSE); // this only inits the 1st time - NS_RELEASE(content); - - view->SetVisibility(nsViewVisibility_kShow); - PostCreateWidget(&aPresContext, view); - } - } else { - NS_ASSERTION(0, "could not get widget"); - } - NS_IF_RELEASE(widget); - NS_RELEASE(view); - NS_RELEASE(parent); - } - return NS_OK; -} - -PRBool -nsInputFrame::BoundsAreSet() -{ - if ((0 != mCacheBounds.width) || (0 != mCacheBounds.height)) { - return PR_TRUE; - } else { - return PR_FALSE; - } -} - -PRBool -nsInputFrame::IsHidden() -{ - nsInput* content = (nsInput *)mContent; - return content->IsHidden(); -} - -void -nsInputFrame::GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize) -{ - // get the css size and let the frame use or override it - nsSize styleSize; - GetStyleSize(*aPresContext, aMaxSize, styleSize); - - // subclasses should always override this method, but if not and no css, make it small - aDesiredLayoutSize.width = (styleSize.width > CSS_NOTSET) ? styleSize.width : 144; - aDesiredLayoutSize.height = (styleSize.height > CSS_NOTSET) ? styleSize.height : 144; - aDesiredWidgetSize.width = aDesiredLayoutSize.width; - aDesiredWidgetSize.height = aDesiredLayoutSize.height; -} - -void -nsInputFrame::GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize) -{ - nsSize ignore; - GetDesiredSize(aPresContext, aMaxSize, aDesiredSize, ignore); -} - -NS_METHOD -nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - nsIView* view; - GetView(view); - - if (nsnull == view) { - - static NS_DEFINE_IID(kViewCID, NS_VIEW_CID); - static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - - // make sure the style context is set - if (nsnull == mStyleContext) { - GetStyleContext(aPresContext, mStyleContext); - } - nsresult result = - NSRepository::CreateInstance(kViewCID, nsnull, kIViewIID, (void **)&view);// need to release - if (NS_OK != result) { - NS_ASSERTION(0, "Could not create view for button"); - aStatus = frNotComplete; - return NS_OK; - } - nsIPresShell *presShell = aPresContext->GetShell(); // need to release - nsIViewManager *viewMan = presShell->GetViewManager(); // need to release - - nsReflowMetrics layoutSize; - nsSize widgetSize; - GetDesiredSize(aPresContext, aMaxSize, layoutSize, widgetSize); - mCacheBounds.width = layoutSize.width; // YYY what about caching widget size? - mCacheBounds.height = layoutSize.height; - - nsRect boundBox(0, 0, widgetSize.width, widgetSize.height); - - nsIFrame* parWithView; - nsIView *parView; - - GetParentWithView(parWithView); - parWithView->GetView(parView); - - const nsIID& id = GetCID(); - nsInputWidgetData* initData = GetWidgetInitData(); // needs to be deleted - // initialize the view as hidden since we don't know the (x,y) until Paint - result = view->Init(viewMan, boundBox, parView, &id, initData, nsnull, 0, nsnull, - 1.0f, nsViewVisibility_kHide); - if (nsnull != initData) { - delete(initData); - } - if (NS_OK != result) { - NS_ASSERTION(0, "widget initialization failed"); - aStatus = frNotComplete; - return NS_OK; - } - - // set the content's widget, so it can get content modified by the widget - nsIWidget *widget; - result = GetWidget(view, &widget); - if (NS_OK == result) { - nsInput* content = (nsInput *)mContent; // change this cast to QueryInterface - content->SetWidget(widget); - NS_IF_RELEASE(widget); - } else { - NS_ASSERTION(0, "could not get widget"); - } - - viewMan->InsertChild(parView, view, 0); - SetView(view); - //PostCreateWidget(aPresContext, view); - - NS_IF_RELEASE(parView); - NS_IF_RELEASE(view); - NS_IF_RELEASE(viewMan); - NS_IF_RELEASE(presShell); - } - aDesiredSize.width = mCacheBounds.width; - aDesiredSize.height = mCacheBounds.height; - aDesiredSize.ascent = mCacheBounds.height; - aDesiredSize.descent = 0; - - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aDesiredSize.width; - aMaxElementSize->height = aDesiredSize.height; - } - - aStatus = frComplete; - return NS_OK; -} - -nsInputWidgetData* -nsInputFrame::GetWidgetInitData() -{ - return nsnull; -} - -PRInt32 nsInputFrame::GetPadding() const -{ - return 0; -} - -void -nsInputFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ -} - -nsresult -nsInputFrame::GetWidget(nsIView* aView, nsIWidget** aWidget) -{ - const nsIID id = GetIID(); - if (NS_OK == aView->QueryInterface(id, (void**)aWidget)) { - return NS_OK; - } else { - NS_ASSERTION(0, "The widget interface is invalid"); // need to print out more details of the widget - return NS_NOINTERFACE; - } -} - -const nsIID& -nsInputFrame::GetIID() -{ - static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID); - return kButtonIID; -} - -const nsIID& -nsInputFrame::GetCID() -{ - static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); - return kButtonCID; -} - -NS_METHOD nsInputFrame::HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus) -{ - // make sure that the widget in the event is this - static NS_DEFINE_IID(kSupportsIID, NS_ISUPPORTS_IID); - nsIWidget* thisWidget; - - nsIView* view; - GetView(view); - if (view == nsnull) { - return nsEventStatus_eIgnore; - } - - nsresult result = GetWidget(view, &thisWidget); - nsISupports* thisWidgetSup; - result = thisWidget->QueryInterface(kSupportsIID, (void **)&thisWidgetSup); - if (thisWidget == nsnull) { - return nsEventStatus_eIgnore; - } - nsISupports* eventWidgetSup; - result = aEvent->widget->QueryInterface(kSupportsIID, (void **)&eventWidgetSup); - - PRBool isOurEvent = (thisWidgetSup == eventWidgetSup) ? PR_TRUE : PR_FALSE; - - NS_RELEASE(eventWidgetSup); - NS_RELEASE(thisWidgetSup); - NS_IF_RELEASE(view); - NS_IF_RELEASE(thisWidget); - - if (!isOurEvent) { - aEventStatus = nsEventStatus_eIgnore; - return NS_OK; - } - - switch (aEvent->message) { - case NS_MOUSE_ENTER: - mLastMouseState = eMouseEnter; - break; - case NS_MOUSE_LEFT_BUTTON_DOWN: - mLastMouseState = - (eMouseEnter == mLastMouseState) ? eMouseDown : eMouseNone; - break; - case NS_MOUSE_LEFT_BUTTON_UP: - if (eMouseDown == mLastMouseState) { - /*nsIView* view = GetView(); - nsIWidget *widget = view->GetWindow(); - widget->SetFocus(); - NS_RELEASE(widget); - NS_RELEASE(view); */ - MouseClicked(&aPresContext); - //return PR_FALSE; - } - mLastMouseState = eMouseEnter; - break; - case NS_MOUSE_EXIT: - mLastMouseState = eMouseNone; - break; - } - return nsEventStatus_eConsumeDoDefault; -} - -void nsInputFrame::GetStyleSize(nsIPresContext& aPresContext, - const nsSize& aMaxSize, nsSize& aSize) -{ -#if 0 - nsInput* input; - GetContent((nsIContent *&) input); // this must be an nsInput - nsStylePosition* pos = (nsStylePosition*) - mStyleContext->GetData(kStylePositionSID); - - aSize.width = GetStyleDim(aPresContext, aMaxSize, - pos->mWidthFlags, pos->mWidth); - aSize.height = GetStyleDim(aPresContext, aMaxSize, - pos->mHeightFlags, pos->mHeight); - NS_RELEASE(input); -#endif - aSize.width = -1; - aSize.height = -1; -} - -PRInt32 -nsInputFrame::GetStyleDim(nsIPresContext& aPresContext, const nsSize& aMaxSize, - PRInt8 aFlags, PRInt32 aVal) -{ -#if 0 - PRInt32 result = 0; - switch (aFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - result = aVal; - break; - case NS_STYLE_POSITION_VALUE_PERCENT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - result = (aMaxSize.width * aVal) / 100; - break; - //default: - } - - if (result <= 0) { - result = -1; - } - - return result; -#endif - return -1; -} - -PRInt32 -nsInputFrame::GetTextSize(nsIPresContext& aPresContext, nsIFrame* aFrame, - const nsString& aString, nsSize& aSize) -{ - //printf("\n GetTextSize %s", aString.ToNewCString()); - nsIStyleContext* styleContext; - aFrame->GetStyleContext(&aPresContext, styleContext); - nsStyleFont* styleFont = (nsStyleFont*)styleContext->GetData(kStyleFontSID); - NS_RELEASE(styleContext); - nsIDeviceContext* deviceContext = aPresContext.GetDeviceContext(); - nsIFontCache* fontCache = deviceContext->GetFontCache(); - - nsIFontMetrics* fontMet = fontCache->GetMetricsFor(styleFont->mFont); - aSize.width = fontMet->GetWidth(aString); - aSize.height = fontMet->GetHeight() + fontMet->GetLeading(); - - PRInt32 charWidth = fontMet->GetWidth("W"); - - NS_RELEASE(fontMet); - NS_RELEASE(fontCache); - NS_RELEASE(deviceContext); - - return charWidth; -} - -PRInt32 -nsInputFrame::GetTextSize(nsIPresContext& aPresContext, nsIFrame* aFrame, - PRInt32 aNumChars, nsSize& aSize) -{ - nsAutoString val; - for (int i = 0; i < aNumChars; i++) { - val += 'e'; // use a typical char, what is the avg width character? - } - return GetTextSize(aPresContext, aFrame, val, aSize); -} - -PRInt32 -nsInputFrame::CalculateSize (nsIPresContext* aPresContext, nsInputFrame* aFrame, - const nsSize& aCSSSize, nsInputDimensionSpec& aSpec, - nsSize& aBounds, PRBool& aWidthExplicit, - PRBool& aHeightExplicit, PRInt32& aRowHeight) -{ - PRInt32 charWidth = 0; - PRInt32 numRows = 1; - aWidthExplicit = PR_FALSE; - aHeightExplicit = PR_FALSE; - - aBounds.width = CSS_NOTSET; - aBounds.height = CSS_NOTSET; - nsSize textSize(0,0); - - nsInput* content; - aFrame->GetContent((nsIContent *&) content); - nsAutoString valAttr; - nsContentAttr valStatus = eContentAttr_NotThere; - if (nsnull != aSpec.mColValueAttr) { - valStatus = content->GetAttribute(aSpec.mColValueAttr, valAttr); - } - PRInt32 colAttr; - nsContentAttr colStatus = eContentAttr_NotThere; - if (nsnull != aSpec.mColSizeAttr) { - colStatus = content->GetAttribute(aSpec.mColSizeAttr, colAttr); - } - - if (eContentAttr_HasValue == colStatus) { // col attr will provide width - if (aSpec.mColSizeAttrInPixels) { - float p2t = aPresContext->GetPixelsToTwips(); - aBounds.width = (int) (((float)colAttr) * p2t); - } - else { - charWidth = GetTextSize(*aPresContext, aFrame, colAttr, aBounds); - aRowHeight = aBounds.height; - } - if (aSpec.mColSizeAttrInPixels) { - aWidthExplicit = PR_TRUE; - } - } - else { - if (CSS_NOTSET != aCSSSize.width) { // css provides width - aBounds.width = aCSSSize.width; - aWidthExplicit = PR_TRUE; - } - else { - if (eContentAttr_HasValue == valStatus) { // use width of initial value if specified - charWidth = GetTextSize(*aPresContext, aFrame, valAttr, aBounds); - } - else if (aSpec.mColDefaultSizeInPixels) { // use default width in pixels - charWidth = GetTextSize(*aPresContext, aFrame, 1, aBounds); - aBounds.width = aSpec.mColDefaultSize; - } - else { // use default width in num characters - charWidth = GetTextSize(*aPresContext, aFrame, aSpec.mColDefaultSize, aBounds); - } - aRowHeight = aBounds.height; - } - } - - PRInt32 rowAttr = ATTR_NOTSET; - nsContentAttr rowStatus = eContentAttr_NotThere; - if (nsnull != aSpec.mRowSizeAttr) { - rowStatus = content->GetAttribute(aSpec.mRowSizeAttr, rowAttr); - } - - if (eContentAttr_HasValue == rowStatus) { // row attr will provide height - if (0 == charWidth) { - charWidth = GetTextSize(*aPresContext, aFrame, 1, textSize); - aBounds.height = textSize.height * rowAttr; - aRowHeight = textSize.height; - numRows = rowAttr; - } - else { - aBounds.height = aBounds.height * rowAttr; - } - } - else if (CSS_NOTSET != aCSSSize.height) { // css provides height - aBounds.height = aCSSSize.height; - aHeightExplicit = PR_TRUE; - } - else { // use default height in num lines - if (0 == charWidth) { - charWidth = GetTextSize(*aPresContext, aFrame, 1, textSize); - aBounds.height = textSize.height * aSpec.mRowDefaultSize; - aRowHeight = textSize.height; - } - else { - aBounds.height = aBounds.height * aSpec.mRowDefaultSize; - } - } - - if (0 == charWidth) { - charWidth = GetTextSize(*aPresContext, aFrame, 1, textSize); - aRowHeight = textSize.height; - } - - // add padding to width if width wasn't specified either from css or size attr - if (!aWidthExplicit) { - aBounds.width += charWidth; - } - - NS_RELEASE(content); - - return numRows; - -} - - -nsFont& -nsInputFrame::GetFont(nsIPresContext* aPresContext) -{ - nsStyleFont* styleFont = (nsStyleFont*)mStyleContext->GetData(kStyleFontSID); - - return styleFont->mFont; -} - - - - - diff --git a/mozilla/layout/html/forms/src/nsInputFrame.h b/mozilla/layout/html/forms/src/nsInputFrame.h deleted file mode 100644 index 31d035b5677..00000000000 --- a/mozilla/layout/html/forms/src/nsInputFrame.h +++ /dev/null @@ -1,213 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInputFrame_h___ -#define nsInputFrame_h___ - -#include "nsHTMLContainer.h" -#include "nsISupports.h" -#include "nsIWidget.h" -#include "nsLeafFrame.h" - -class nsIView; -class nsIPresContext; - -struct nsInputWidgetData { - PRInt32 arg1; - PRInt32 arg2; - PRInt32 arg3; - PRInt32 arg4; -}; - -/** - * Enumeration of possible mouse states used to detect mouse clicks - */ -enum nsMouseState { - eMouseNone, - eMouseEnter, - eMouseDown, - eMouseUp -}; - -struct nsInputDimensionSpec -{ - nsIAtom* mColSizeAttr; - PRBool mColSizeAttrInPixels; - nsIAtom* mColValueAttr; - PRInt32 mColDefaultSize; - PRBool mColDefaultSizeInPixels; - nsIAtom* mRowSizeAttr; - PRInt32 mRowDefaultSize; - - nsInputDimensionSpec(nsIAtom* aColSizeAttr, PRBool aColSizeAttrInPixels, - nsIAtom* aColValueAttr, PRInt32 aColDefaultSize, - PRBool aColDefaultSizeInPixels, - nsIAtom* aRowSizeAttr, PRInt32 aRowDefaultSize) - : mColSizeAttr(aColSizeAttr), mColSizeAttrInPixels(aColSizeAttrInPixels), - mColValueAttr(aColValueAttr), mColDefaultSize(aColDefaultSize), - mColDefaultSizeInPixels(aColDefaultSizeInPixels), - mRowSizeAttr(aRowSizeAttr), mRowDefaultSize(aRowDefaultSize) - { - } - -}; - -/** - * nsInputFrame is the base class for frames of form controls. It - * provides a uniform way of creating widgets, resizing, and painting. - * @see nsLeafFrame and its base classes for more info - */ -class nsInputFrame : public nsLeafFrame { - typedef nsLeafFrame super; -public: - /** - * Main constructor - * @param aContent the content representing this frame - * @param aIndexInParent the position in the parent frame's children which this frame occupies - * @param aParentFrame the parent frame - */ - nsInputFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - static PRInt32 CalculateSize (nsIPresContext* aPresContext, nsInputFrame* aFrame, - const nsSize& aCSSSize, nsInputDimensionSpec& aDimensionSpec, - nsSize& aBounds, PRBool& aWidthExplicit, - PRBool& aHeightExplicit, PRInt32& aRowSize); - // nsLeafFrame overrides - - /** - * Respond to a gui event - * @see nsIFrame::HandleEvent - */ - NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, - nsGUIEvent* aEvent, - nsEventStatus& aEventStatus); - - NS_IMETHOD SetRect(const nsRect& aRect); - - virtual PRBool IsHidden(); - - /** - * Draw this frame within the context of a presentation context and rendering context - * @see nsIFrame::Paint - */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** - * Respond to the request to resize and/or reflow - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - // new behavior - - /** - * Get the class id of the widget associated with this frame - * @return the class id - */ - virtual const nsIID& GetCID(); - - /** - * Get the interface id of widget associated with this frame - * @return the interface id - */ - virtual const nsIID& GetIID(); - - PRInt32 GetDefaultPadding() const { return 40; } - virtual PRInt32 GetPadding() const; - /** - * Get the widget associated with this frame - * @param aView the view associated with the frame. It is a convience parm. - * @param aWidget the address of address of where the widget will be placed. - * This method doses an AddRef on the widget. - */ - virtual nsresult GetWidget(nsIView* aView, nsIWidget** aWidget); - - /** - * Respond to a mouse click (e.g. mouse enter, mouse down, mouse up) - */ - virtual void MouseClicked(nsIPresContext* aPresContext) {} - - /** - * Perform opertations after the widget associated with this frame has been - * created. - */ - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - - /** - * Perform opertations before the widget associated with this frame has been - * created. - */ - virtual nsInputWidgetData* GetWidgetInitData(); - - static PRInt32 GetTextSize(nsIPresContext& aContext, nsIFrame* aFrame, - const nsString& aString, nsSize& aSize); - static PRInt32 GetTextSize(nsIPresContext& aContext, nsIFrame* aFrame, - PRInt32 aNumChars, nsSize& aSize); - -protected: - - virtual ~nsInputFrame(); - - /** - * Return PR_TRUE if the bounds of this frame have been set - */ - PRBool BoundsAreSet(); - - /** - * Get the size that this frame would occupy without any constraints - * @param aPresContext the presentation context - * @param aDesiredSize the size desired by this frame, to be set by this method - * @param aMaxSize the maximum size available for this frame - */ - virtual void GetDesiredSize(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize); - - nsFont& GetFont(nsIPresContext* aPresContext); - - /** - * Get the width and height of this control based on CSS - * @param aPresContext the presentation context - * @param aMaxSize the maximum size that this frame can have - * @param aSize the size that this frame wants, set by this method. values of -1 - * for aSize.width or aSize.height indicate unset values. - */ - void GetStyleSize(nsIPresContext& aContext, const nsSize& aMaxSize, nsSize& aSize); - - PRInt32 GetStyleDim(nsIPresContext& aPresContext, const nsSize& aMaxSize, - PRInt8 aFlags, PRInt32 aVal); - - nsSize mCacheBounds; - nsMouseState mLastMouseState; -}; - -#endif - diff --git a/mozilla/layout/html/forms/src/nsInputImage.cpp b/mozilla/layout/html/forms/src/nsInputImage.cpp deleted file mode 100644 index e8d37de61eb..00000000000 --- a/mozilla/layout/html/forms/src/nsInputImage.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInputImage.h" -#include "nsInputFrame.h" -#include "nsIContent.h" -#include "prtypes.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsIPresContext.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" - -class nsInputImageFrame : public nsInputFrame { -public: - nsInputImageFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - -protected: - virtual ~nsInputImageFrame(); -}; - -nsInputImageFrame::nsInputImageFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsInputImageFrame::~nsInputImageFrame() -{ -} - - -void -nsInputImageFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ -} - -//---------------------------------------------------------------------- -// nsInputImage - -nsInputImage::nsInputImage(nsIAtom* aTag, nsIFormManager* aManager) - : nsInput(aTag, aManager) -{ -} - -nsInputImage::~nsInputImage() -{ -} - -nsIFrame* -nsInputImage::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new nsInputImageFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -void nsInputImage::GetType(nsString& aResult) const -{ - aResult = "image"; -} - -nsresult -NS_NewHTMLInputImage(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputImage(aTag, aManager); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - diff --git a/mozilla/layout/html/forms/src/nsInputImage.h b/mozilla/layout/html/forms/src/nsInputImage.h deleted file mode 100644 index d4605dd1538..00000000000 --- a/mozilla/layout/html/forms/src/nsInputImage.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInputImage_h___ -#define nsInputImage_h___ - -#include "nsInput.h" -class nsIAtom; -class nsString; - -// this class definition will move to nsInputImage.cpp - -class nsInputImage : public nsInput { -public: - typedef nsInput super; - nsInputImage (nsIAtom* aTag, nsIFormManager* aManager); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); -protected: - - virtual ~nsInputImage(); - - virtual void GetType(nsString& aResult) const; -}; - -#endif - - diff --git a/mozilla/layout/html/forms/src/nsInputRadio.cpp b/mozilla/layout/html/forms/src/nsInputRadio.cpp deleted file mode 100644 index 7eea5df162a..00000000000 --- a/mozilla/layout/html/forms/src/nsInputRadio.cpp +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInputRadio.h" -#include "nsInputFrame.h" -#include "nsIContent.h" -#include "prtypes.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsIPresContext.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" -#include "nsIRadioButton.h" -#include "nsWidgetsCID.h" -#include "nsSize.h" -#include "nsHTMLAtoms.h" -#include "nsIFormManager.h" -#include "nsIView.h" - -class nsInputRadioFrame : public nsInputFrame { -public: - nsInputRadioFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - - virtual const nsIID& GetCID(); - - virtual const nsIID& GetIID(); - - virtual void MouseClicked(nsIPresContext* aPresContext); - virtual PRInt32 GetPadding() const; - NS_IMETHOD SetRect(const nsRect& aRect); - -protected: - - virtual ~nsInputRadioFrame(); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize); -}; - -nsInputRadioFrame::nsInputRadioFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsInputRadioFrame::~nsInputRadioFrame() -{ -} - - -PRInt32 nsInputRadioFrame::GetPadding() const -{ - return GetDefaultPadding(); -} - -NS_METHOD nsInputRadioFrame::SetRect(const nsRect& aRect) -{ - PRInt32 padding = GetPadding(); - MoveTo(aRect.x + padding, aRect.y); - SizeTo(aRect.width - (2 * padding), aRect.height); - return NS_OK; -} - -const nsIID& -nsInputRadioFrame::GetIID() -{ - static NS_DEFINE_IID(kRadioIID, NS_IRADIOBUTTON_IID); - return kRadioIID; -} - -const nsIID& -nsInputRadioFrame::GetCID() -{ - static NS_DEFINE_IID(kRadioCID, NS_RADIOBUTTON_CID); - return kRadioCID; -} - -void -nsInputRadioFrame::GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize) -{ - float p2t = aPresContext->GetPixelsToTwips(); - aDesiredWidgetSize.width = (int)(12 * p2t); - aDesiredWidgetSize.height = (int)(12 * p2t); - PRInt32 padding = GetPadding(); - aDesiredLayoutSize.width = aDesiredWidgetSize.width + (2 * padding); - aDesiredLayoutSize.height = aDesiredWidgetSize.height; -} - -void -nsInputRadioFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ - nsInputRadio* content = (nsInputRadio *)mContent; - PRInt32 checkedAttr; - nsContentAttr result = ((nsInput *)content)->GetAttribute(nsHTMLAtoms::checked, checkedAttr); - if ((result == eContentAttr_HasValue) && (PR_FALSE != checkedAttr)) { - nsIRadioButton* radio; - if (NS_OK == GetWidget(aView, (nsIWidget **)&radio)) { - radio->SetState(PR_TRUE); - NS_RELEASE(radio); - } - } -} - -// nsInputRadio - -const nsString* nsInputRadio::kTYPE = new nsString("radio"); - -nsInputRadio::nsInputRadio(nsIAtom* aTag, nsIFormManager* aManager) - : nsInput(aTag, aManager) -{ - mChecked = PR_FALSE; -} - -nsInputRadio::~nsInputRadio() -{ -} - -static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID); - -void -nsInputRadioFrame::MouseClicked(nsIPresContext* aPresContext) -{ - nsIRadioButton* radioWidget; - nsIView* view; - GetView(view); - if (NS_OK == GetWidget(view, (nsIWidget **)&radioWidget)) { - radioWidget->SetState(PR_TRUE); - NS_RELEASE(radioWidget); - nsInputRadio* radio; - GetContent((nsIContent *&) radio); - nsIFormControl* control; - nsresult status = radio->QueryInterface(kIFormControlIID, (void **)&control); - NS_ASSERTION(NS_OK == status, "nsInputRadio has no nsIFormControl interface"); - if (NS_OK == status) { - radio->GetFormManager()->OnRadioChecked(*control); - NS_RELEASE(radio); - } - } - NS_RELEASE(view); -} - -PRBool -nsInputRadio::GetChecked(PRBool aGetInitialValue) const -{ - if (aGetInitialValue) { - return mChecked; - } - else { - NS_ASSERTION(mWidget, "no widget for this nsInputRadio"); - return ((nsIRadioButton *)mWidget)->GetState(); - } -} - -void -nsInputRadio::SetChecked(PRBool aValue, PRBool aSetInitialValue) -{ - if (aSetInitialValue) { - mChecked = aValue; - } - NS_ASSERTION(mWidget, "no widget for this nsInputRadio"); - ((nsIRadioButton *)mWidget)->SetState(aValue); -} - - -nsIFrame* -nsInputRadio::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new nsInputRadioFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -void nsInputRadio::GetType(nsString& aResult) const -{ - aResult = "radio"; -} - -void nsInputRadio::SetAttribute(nsIAtom* aAttribute, - const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::checked) { - mChecked = PR_TRUE; - } - else { - super::SetAttribute(aAttribute, aValue); - } -} - -nsContentAttr nsInputRadio::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - aResult.Reset(); - if (aAttribute == nsHTMLAtoms::checked) { - return GetCacheAttribute(mChecked, aResult); - } - else { - return super::GetAttribute(aAttribute, aResult); - } -} - -PRBool -nsInputRadio::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues) -{ - if (aMaxNumValues <= 0) { - return PR_FALSE; - } - nsIRadioButton* radio = (nsIRadioButton *)GetWidget(); - PRBool state = radio->GetState(); - if(PR_TRUE != state) { - return PR_FALSE; - } - - if (nsnull == mValue) { - aValues[0] = "on"; - } else { - aValues[0] = *mValue; - } - aNumValues = 1; - - return PR_TRUE; -} - -void -nsInputRadio::Reset() -{ - nsIRadioButton* radio = (nsIRadioButton *)GetWidget(); - if (nsnull != radio) { - radio->SetState(mChecked); - } -} - -nsresult -NS_NewHTMLInputRadio(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputRadio(aTag, aManager); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -// CLASS nsInputRadioGroup - -nsInputRadioGroup::nsInputRadioGroup(nsString& aName) -:mName(aName), mCheckedRadio(nsnull) -{ -} - -nsInputRadioGroup::~nsInputRadioGroup() -{ - mCheckedRadio = nsnull; -} - -PRInt32 -nsInputRadioGroup::GetRadioCount() const -{ - return mRadios.Count(); -} - -nsIFormControl* -nsInputRadioGroup::GetRadioAt(PRInt32 aIndex) const -{ - return (nsIFormControl*) mRadios.ElementAt(aIndex); -} - -PRBool -nsInputRadioGroup::AddRadio(nsIFormControl* aRadio) -{ - return mRadios.AppendElement(aRadio); -} - -PRBool -nsInputRadioGroup::RemoveRadio(nsIFormControl* aRadio) -{ - return mRadios.RemoveElement(aRadio); -} - -nsIFormControl* -nsInputRadioGroup::GetCheckedRadio() -{ - return mCheckedRadio; -} - -void -nsInputRadioGroup::SetCheckedRadio(nsIFormControl* aRadio) -{ - mCheckedRadio = aRadio; -} - -void -nsInputRadioGroup::GetName(nsString& aNameResult) const -{ - aNameResult = mName; -} diff --git a/mozilla/layout/html/forms/src/nsInputRadio.h b/mozilla/layout/html/forms/src/nsInputRadio.h deleted file mode 100644 index 8d6b912583c..00000000000 --- a/mozilla/layout/html/forms/src/nsInputRadio.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInputRadio_h___ -#define nsInputRadio_h___ - -// this class defintion will be moved into nsInputRadio.cpp - -#include "nsInput.h" -#include "nsVoidArray.h" -class nsIAtom; -class nsString; - -class nsInputRadio : public nsInput -{ -public: - typedef nsInput super; - nsInputRadio (nsIAtom* aTag, nsIFormManager* aManager); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - - static const nsString* kTYPE; - - virtual PRBool GetChecked(PRBool aGetInitialValue) const; - virtual void SetChecked(PRBool aValue, PRBool aSetInitialValue); - - virtual PRInt32 GetMaxNumValues() { return 1; } - - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - - virtual void Reset(); - -protected: - virtual ~nsInputRadio(); - - virtual void GetType(nsString& aResult) const; - - PRBool mChecked; -}; - -class nsInputRadioGroup -{ -public: - nsInputRadioGroup(nsString& aName); - virtual ~nsInputRadioGroup(); - - PRBool AddRadio(nsIFormControl* aRadio); - PRInt32 GetRadioCount() const; - nsIFormControl* GetRadioAt(PRInt32 aIndex) const; - PRBool RemoveRadio(nsIFormControl* aRadio); - - nsIFormControl* GetCheckedRadio(); - void SetCheckedRadio(nsIFormControl* aRadio); - void GetName(nsString& aNameResult) const; - -protected: - nsString mName; - nsVoidArray mRadios; - nsIFormControl* mCheckedRadio; -}; - -#endif - - diff --git a/mozilla/layout/html/forms/src/nsInputText.cpp b/mozilla/layout/html/forms/src/nsInputText.cpp deleted file mode 100644 index 25d2e1bb97d..00000000000 --- a/mozilla/layout/html/forms/src/nsInputText.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsInputText.h" -#include "nsInputFrame.h" -#include "nsIContent.h" -#include "prtypes.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsIPresContext.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" -#include "nsITextWidget.h" -#include "nsITextAreaWidget.h" -#include "nsWidgetsCID.h" -#include "nsSize.h" -#include "nsString.h" -#include "nsHTMLAtoms.h" -#include "nsHTMLForms.h" - -class nsInputTextFrame : public nsInputFrame { -public: - nsInputTextFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual nsInputWidgetData* GetWidgetInitData(); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - - virtual const nsIID& GetCID(); - - virtual const nsIID& GetIID(); - -protected: - - virtual ~nsInputTextFrame(); - - nsInputTextType GetTextType(); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize); -}; - -nsInputTextFrame::nsInputTextFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsInputTextFrame::~nsInputTextFrame() -{ -} - -const nsIID& -nsInputTextFrame::GetIID() -{ - static NS_DEFINE_IID(kTextIID, NS_ITEXTWIDGET_IID); - static NS_DEFINE_IID(kTextAreaIID, NS_ITEXTAREAWIDGET_IID); - - if (kInputTextArea == GetTextType()) { - return kTextAreaIID; - } - else { - return kTextIID; - } -} - -const nsIID& -nsInputTextFrame::GetCID() -{ - static NS_DEFINE_IID(kTextCID, NS_TEXTFIELD_CID); - static NS_DEFINE_IID(kTextAreaCID, NS_TEXTAREA_CID); - - if (kInputTextArea == GetTextType()) { - return kTextAreaCID; - } - else { - return kTextCID; - } -} - -nsInputTextType -nsInputTextFrame::GetTextType() -{ - nsInputText* content; - GetContent((nsIContent *&) content); - nsInputTextType type = content->GetTextType(); - NS_RELEASE(content); - return type; -} - -void -nsInputTextFrame::GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize) -{ - // get the css size and let the frame use or override it - nsSize styleSize; - GetStyleSize(*aPresContext, aMaxSize, styleSize); - - nsSize size; - - PRBool widthExplicit, heightExplicit; - PRInt32 ignore; - if ((kInputTextText == GetTextType()) || (kInputTextPassword == GetTextType())) { - nsInputDimensionSpec textSpec(nsHTMLAtoms::size, PR_FALSE, nsHTMLAtoms::value, - 20, PR_FALSE, nsnull, 1); - CalculateSize(aPresContext, this, styleSize, textSpec, size, - widthExplicit, heightExplicit, ignore); - } - else { - nsInputDimensionSpec areaSpec(nsHTMLAtoms::cols, PR_FALSE, nsnull, 10, - PR_FALSE, nsHTMLAtoms::rows, 1); - CalculateSize(aPresContext, this, styleSize, areaSpec, size, - widthExplicit, heightExplicit, ignore); - } - if (!heightExplicit && (kInputTextArea != GetTextType())) { - size.height += 100; - } - - aDesiredLayoutSize.width = size.width; - aDesiredLayoutSize.height = size.height; - aDesiredWidgetSize.width = aDesiredLayoutSize.width; - aDesiredWidgetSize.height = aDesiredLayoutSize.height; -} - -nsInputWidgetData* -nsInputTextFrame::GetWidgetInitData() -{ - static NS_DEFINE_IID(kTextIID, NS_ITEXTWIDGET_IID); - - nsInputWidgetData* data = nsnull; - nsInputText* content; - GetContent((nsIContent *&) content); - if (kInputTextPassword == content->GetTextType()) { - data = new nsInputWidgetData(); - data->arg1 = 1; - } - NS_RELEASE(content); - - return data; -} - -void -nsInputTextFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ - nsITextWidget* text; - if (NS_OK == GetWidget(aView, (nsIWidget **)&text)) { - text->SetFont(GetFont(aPresContext)); - nsInputText* content; - GetContent((nsIContent *&) content); - nsAutoString valAttr; - nsContentAttr valStatus = ((nsInput *)content)->GetAttribute(nsHTMLAtoms::value, valAttr); - text->SetText(valAttr); - NS_RELEASE(content); - } -} - -//---------------------------------------------------------------------- -// nsInputText - -nsInputText::nsInputText(nsIAtom* aTag, nsIFormManager* aManager, nsInputTextType aType) - : nsInput(aTag, aManager), mType(aType) -{ - mMaxLength = ATTR_NOTSET; - mNumRows = ATTR_NOTSET; - mNumCols = ATTR_NOTSET; -} - -nsInputText::~nsInputText() -{ - if (nsnull != mValue) { - delete mValue; - } -} - -nsInputTextType -nsInputText::GetTextType() const -{ - return mType; -} - -nsIFrame* -nsInputText::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - return new nsInputTextFrame(this, aIndexInParent, aParentFrame); -} - -PRInt32 -nsInputText::GetMaxNumValues() -{ - return 1; -} - -PRBool -nsInputText::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues) -{ - if (aMaxNumValues <= 0) { - return PR_FALSE; - } - nsITextWidget* text = (nsITextWidget *)GetWidget(); - nsString value; - text->GetText(aValues[0], 0); // the last parm is not used - aNumValues = 1; - - return PR_TRUE; -} - - -void -nsInputText::Reset() -{ - nsITextWidget* text = (nsITextWidget *)GetWidget(); - if (nsnull == mValue) { - text->SetText(""); - } else { - text->SetText(*mValue); - } -} - -void nsInputText::GetType(nsString& aResult) const -{ - if (kInputTextText == mType) { - aResult = "text"; - } - else if (kInputTextPassword == mType) { - aResult = "password"; - } - else if (kInputTextArea == mType) { - aResult = ""; - } -} - -void nsInputText::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::maxlength) { - CacheAttribute(aValue, ATTR_NOTSET, mMaxLength); - } - else if ((aAttribute == nsHTMLAtoms::rows) && (kInputTextArea == mType)) { - CacheAttribute(aValue, ATTR_NOTSET, mNumRows); - } - else if ((aAttribute == nsHTMLAtoms::cols) && (kInputTextArea == mType)) { - CacheAttribute(aValue, ATTR_NOTSET, mNumCols); - } - else { - super::SetAttribute(aAttribute, aValue); - } -} - -nsContentAttr nsInputText::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - if (aAttribute == nsHTMLAtoms::maxlength) { - return GetCacheAttribute(mMaxLength, aResult); - } - else if ((aAttribute == nsHTMLAtoms::rows) && (kInputTextArea == mType)) { - return GetCacheAttribute(mNumRows, aResult); - } - else if ((aAttribute == nsHTMLAtoms::cols) && (kInputTextArea == mType)) { - return GetCacheAttribute(mNumCols, aResult); - } - else { - return super::GetAttribute(aAttribute, aResult); - } -} - -nsresult -NS_NewHTMLInputText(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputText(aTag, aManager, kInputTextText); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -nsresult -NS_NewHTMLInputPassword(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputText(aTag, aManager, kInputTextPassword); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -nsresult -NS_NewHTMLTextArea(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aManager) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsInputText(aTag, aManager, kInputTextArea); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/layout/html/forms/src/nsInputText.h b/mozilla/layout/html/forms/src/nsInputText.h deleted file mode 100644 index e30ede37b68..00000000000 --- a/mozilla/layout/html/forms/src/nsInputText.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsInputText_h___ -#define nsInputText_h___ - -#include "nsInput.h" -#include "nsString.h" -class nsIAtom; -class nsString; -class nsView; - -enum nsInputTextType { - kInputTextText, - kInputTextPassword, - kInputTextArea -}; - -// this class definition will move to nsInputText.cpp - -class nsInputText : public nsInput { -public: - typedef nsInput super; - nsInputText (nsIAtom* aTag, nsIFormManager* aManager, nsInputTextType aType); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - - virtual PRInt32 GetMaxNumValues(); - - nsInputTextType GetTextType() const; - - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - - virtual void Reset(); - -protected: - - virtual ~nsInputText(); - - virtual void GetType(nsString& aResult) const; - - nsInputTextType mType; - - PRInt32 mMaxLength; // text, password only - PRInt32 mNumRows; // textarea only - PRInt32 mNumCols; // textarea only - -}; - -#endif - - diff --git a/mozilla/layout/html/forms/src/nsSelect.cpp b/mozilla/layout/html/forms/src/nsSelect.cpp deleted file mode 100644 index 72b62a5b51e..00000000000 --- a/mozilla/layout/html/forms/src/nsSelect.cpp +++ /dev/null @@ -1,629 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -// YY need to pass isMultiple before create called - -#include "nsInputFrame.h" -#include "nsIContent.h" -#include "prtypes.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsIPresContext.h" -#include "nsIHTMLContent.h" -#include "nsHTMLIIDs.h" -#include "nsIRadioButton.h" -#include "nsWidgetsCID.h" -#include "nsSize.h" -#include "nsHTMLAtoms.h" -#include "nsIFormManager.h" -#include "nsIView.h" -#include "nsIListWidget.h" -#include "nsIComboBox.h" -#include "nsIListBox.h" -#include "nsInput.h" - -static NS_DEFINE_IID(kListWidgetIID, NS_ILISTWIDGET_IID); -static NS_DEFINE_IID(kComboBoxIID, NS_ICOMBOBOX_IID); -static NS_DEFINE_IID(kListBoxIID, NS_ILISTBOX_IID); - - -class nsSelectFrame : public nsInputFrame { -public: - nsSelectFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual nsInputWidgetData* GetWidgetInitData(); - - virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - - virtual const nsIID& GetCID(); - - virtual const nsIID& GetIID(); - - PRBool IsComboBox(); - -protected: - - virtual ~nsSelectFrame(); - - virtual void GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize); -}; - -class nsSelect : public nsInput -{ -public: - typedef nsInput super; - nsSelect (nsIAtom* aTag, nsIFormManager* aFormMan); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - - virtual PRInt32 GetMaxNumValues(); - - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - - PRBool IsMultiple() { return mMultiple; } - - PRBool IsComboBox(); - - virtual void Reset(); - -protected: - virtual ~nsSelect(); - - virtual void GetType(nsString& aResult) const; - - PRBool mMultiple; -}; - -class nsOption : public nsInput -{ -public: - typedef nsInput super; - - nsOption (nsIAtom* aTag); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const; - - virtual PRInt32 GetMaxNumValues(); - - virtual PRBool GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues); - - PRBool GetText(nsString& aString) const; - - void SetText(nsString& aString); - -protected: - virtual ~nsOption(); - - virtual void GetType(nsString& aResult) const; - - PRBool mSelected; - nsString* mText; -}; - - -nsSelectFrame::nsSelectFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsInputFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsSelectFrame::~nsSelectFrame() -{ -} - -PRBool -nsSelectFrame::IsComboBox() -{ - nsSelect* content = (nsSelect *) mContent; - return content->IsComboBox(); -} - -const nsIID& -nsSelectFrame::GetIID() -{ - if (IsComboBox()) { - return kComboBoxIID; - } - else { - return kListBoxIID; - } -} - -const nsIID& -nsSelectFrame::GetCID() -{ - static NS_DEFINE_IID(kComboCID, NS_COMBOBOX_CID); - static NS_DEFINE_IID(kListCID, NS_LISTBOX_CID); - - if (IsComboBox()) { - return kComboCID; - } - else { - return kListCID; - } -} - -void -nsSelectFrame::GetDesiredSize(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsReflowMetrics& aDesiredLayoutSize, - nsSize& aDesiredWidgetSize) -{ - nsSelect* select; - GetContent((nsIContent *&)select); - - // get the css size - nsSize styleSize; - GetStyleSize(*aPresContext, aMaxSize, styleSize); - - // get the size of the longest child - PRInt32 maxWidth = 1; - PRInt32 numChildren = select->ChildCount(); - for (int i = 0; i < numChildren; i++) { - nsOption* option = (nsOption*) select->ChildAt(i); // YYY this had better be an option - nsString text; - if (PR_FALSE == option->GetText(text)) { - continue; - } - nsSize textSize; - // use the style for the select rather that the option, since widgets don't support it - nsInputFrame::GetTextSize(*aPresContext, this, text, textSize); - if (textSize.width > maxWidth) { - maxWidth = textSize.width; - } - } - - PRInt32 rowHeight = 0; - nsSize calcSize, charSize; - PRBool widthExplicit, heightExplicit; - nsInputDimensionSpec textSpec(nsnull, PR_FALSE, nsnull, maxWidth, PR_TRUE, nsHTMLAtoms::size, 1); - PRInt32 numRows = CalculateSize(aPresContext, this, styleSize, textSpec, - calcSize, widthExplicit, heightExplicit, rowHeight); - - if (!heightExplicit) { - calcSize.height += 100; - } - - PRBool isCombo = IsComboBox(); - // account for vertical scrollbar, if present - aDesiredLayoutSize.width = ((numRows < select->ChildCount()) || isCombo) - ? calcSize.width + 350 : calcSize.width + 100; - aDesiredLayoutSize.height = calcSize.height; - - aDesiredWidgetSize.width = aDesiredLayoutSize.width; - aDesiredWidgetSize.height = - (isCombo && !heightExplicit) ? aDesiredLayoutSize.height + (rowHeight * numChildren) + 100 - : aDesiredLayoutSize.height; - - - NS_RELEASE(select); -} - -nsInputWidgetData* -nsSelectFrame::GetWidgetInitData() -{ - nsInputWidgetData* data = nsnull; - nsSelect* content; - GetContent((nsIContent *&) content); - if (content->IsMultiple()) { - data = new nsInputWidgetData(); - data->arg1 = 1; - } - NS_RELEASE(content); - - return data; -} - -void -nsSelectFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView) -{ - nsSelect* select; - GetContent((nsIContent *&)select); - - nsIView* view; - GetView(view); - - nsIListWidget* list; - nsresult stat = view->QueryInterface(kListWidgetIID, (void **) &list); - NS_ASSERTION((NS_OK == stat), "invalid widget"); - - PRBool isCombo = IsComboBox(); - PRInt32 numChildren = select->ChildCount(); - for (int i = 0; i < numChildren; i++) { - nsOption* option = (nsOption*) select->ChildAt(i); // YYY this had better be an option - nsString text; - if (PR_TRUE != option->GetText(text)) { - text = " "; - } -// if (isCombo) { -// printf("\n ** text = %s", text.ToNewCString()); -// list->AddItemAt(text, 1); -// } - printf("\n item=%s\n", text.ToNewCString()); - list->AddItemAt(text, i); - } - - NS_RELEASE(view); - - select->Reset(); // initializes selections -} - -// nsSelect - -nsSelect::nsSelect(nsIAtom* aTag, nsIFormManager* aFormMan) - : nsInput(aTag, aFormMan) -{ - mMultiple = PR_FALSE; -} - -nsSelect::~nsSelect() -{ -} - -void nsSelect::GetType(nsString& aResult) const -{ - aResult = "select"; -} - -nsIFrame* -nsSelect::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv = new nsSelectFrame(this, aIndexInParent, aParentFrame); - return rv; -} - -void nsSelect::SetAttribute(nsIAtom* aAttribute, - const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::multiple) { - mMultiple = PR_TRUE; - } - else { - super::SetAttribute(aAttribute, aValue); - } -} - -nsContentAttr nsSelect::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - aResult.Reset(); - if (aAttribute == nsHTMLAtoms::multiple) { - return GetCacheAttribute(mMultiple, aResult); - } - else { - return super::GetAttribute(aAttribute, aResult); - } -} - -PRBool -nsSelect::IsComboBox() -{ - PRBool multiple; - PRInt32 size; - - super::GetAttribute(nsHTMLAtoms::size, size); - super::GetAttribute(nsHTMLAtoms::multiple, multiple); - - PRBool result = (!multiple && (size <= 1)) ? PR_TRUE : PR_FALSE; - return result; -} - -PRInt32 -nsSelect::GetMaxNumValues() -{ - PRBool isMultiple; - super::GetAttribute(nsHTMLAtoms::multiple, isMultiple); - - if (isMultiple) { - return ChildCount(); - } - else { - return 1; - } -} - -PRBool -nsSelect::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, - nsString* aValues) -{ - if (aMaxNumValues <= 0) { - NS_ASSERTION(0, "invalid max num values"); - return PR_FALSE; - } - - if (!IsMultiple()) { - NS_ASSERTION(aMaxNumValues > 0, "invalid max num values"); - nsIListWidget* list; - nsresult stat = mWidget->QueryInterface(kListWidgetIID, (void **) &list); - NS_ASSERTION((NS_OK == stat), "invalid widget"); - PRInt32 index = list->GetSelectedIndex(); - if (index >= 0) { - nsOption* selected = (nsOption*)ChildAt(index); - selected->GetValues(aMaxNumValues, aNumValues, aValues); - return PR_TRUE; - } - else { - aNumValues = 0; - return PR_FALSE; - } - } - else { - nsIListBox* list; - nsresult stat = mWidget->QueryInterface(kListBoxIID, (void **) &list); - NS_ASSERTION((NS_OK == stat), "invalid widget"); - PRInt32 numSelections = list->GetSelectedCount(); - NS_ASSERTION(aMaxNumValues >= numSelections, "invalid max num values"); - if (numSelections >= 0) { - PRInt32* selections = new PRInt32[numSelections]; - list->GetSelectedIndices(selections, numSelections); - PRInt32 numValues; - aNumValues = 0; - for (int i = 0; i < numSelections; i++) { - nsOption* selected = (nsOption*)ChildAt(selections[i]); - selected->GetValues(aMaxNumValues - i, numValues, aValues + i); // options can only have 1 value - aNumValues += 1; - } - return PR_TRUE; - } - else { - aNumValues = 0; - return PR_FALSE; - } - } -} - - -void -nsSelect::Reset() -{ - PRBool allowMultiple; - super::GetAttribute(nsHTMLAtoms::multiple, allowMultiple); - PRBool haveSelection = PR_FALSE; - PRInt32 numChildren = ChildCount(); - - nsIListWidget* list; - nsresult stat = mWidget->QueryInterface(kListWidgetIID, (void **) &list); - NS_ASSERTION((NS_OK == stat), "invalid widget"); - - list->Deselect(); - - for (int i = 0; i < numChildren; i++) { - nsOption* option = (nsOption*)ChildAt(i); // YYY this had better be an option - PRBool selAttr; - ((nsInput *)option)->GetAttribute(nsHTMLAtoms::selected, selAttr); - if (selAttr) { - list->SelectItem(i); - if (!allowMultiple) { - break; - } - } - } -} - - -// nsOption - -nsOption::nsOption(nsIAtom* aTag) - : nsInput(aTag, nsnull) -{ - mText = nsnull; - mSelected = PR_FALSE; -} - -nsOption::~nsOption() -{ - if (nsnull != mText) { - delete mText; - } -} - -void nsOption::GetType(nsString& aResult) const -{ - aResult = "select"; -} - -nsIFrame* -nsOption::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* frame; - nsFrame::NewFrame(&frame, this, aIndexInParent, aParentFrame); - return frame; -} - -void nsOption::SetAttribute(nsIAtom* aAttribute, - const nsString& aValue) -{ - if (aAttribute == nsHTMLAtoms::selected) { - mSelected = PR_TRUE; - } - else { - super::SetAttribute(aAttribute, aValue); - } -} - -nsContentAttr nsOption::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aResult) const -{ - aResult.Reset(); - if (aAttribute == nsHTMLAtoms::selected) { - return GetCacheAttribute(mSelected, aResult); - } - else { - return super::GetAttribute(aAttribute, aResult); - } -} - -PRInt32 -nsOption::GetMaxNumValues() -{ - return 1; -} - -PRBool nsOption::GetText(nsString& aString) const -{ - if (nsnull == mText) { - return PR_FALSE; - } - else { - aString = *mText; - return PR_TRUE; - } -} - -void nsOption::SetText(nsString& aString) -{ - if (nsnull == mText) { - mText = new nsString(aString); - } - else { - *mText = aString; - } -} - -PRBool -nsOption::GetValues(PRInt32 aMaxNumValues, PRInt32& aNumValues, nsString* aValues) -{ - if (aMaxNumValues <= 0) { - NS_ASSERTION(aMaxNumValues > 0, "invalid max num values"); - return PR_FALSE; - } - - nsString valAttr; - nsContentAttr stat = super::GetAttribute(nsHTMLAtoms::value, valAttr); - if (eContentAttr_HasValue == stat) { - aValues[0] = valAttr; - aNumValues = 1; - return PR_TRUE; - } - else if (nsnull != mText) { - aValues[0] = *mText; - aNumValues = 1; - return PR_TRUE; - } - else { - aNumValues = 0; - return PR_FALSE; - } -} - -void HACK(nsSelect* aSel, PRInt32); - -// FACTORY functions - -nsresult -NS_NewHTMLSelect(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag, nsIFormManager* aFormMan, PRInt32 aHackIndex) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsSelect(aTag, aFormMan); - - HACK((nsSelect*)it, aHackIndex); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -nsresult -NS_NewHTMLOption(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIHTMLContent* it = new nsOption(aTag); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); -} - -void HACK(nsSelect* aSel, PRInt32 aIndex) -{ - char buf[100]; - - nsIAtom* nameAttr = NS_NewAtom("NAME"); - sprintf(&buf[0], "select %d", aIndex); - nsString name(&buf[0]); - aSel->SetAttribute(nameAttr, name); - nsIAtom* sizeAttr = NS_NewAtom("SIZE"); - int numOpt = 2; - if (aIndex == 1) { - nsString size("2"); - aSel->SetAttribute(sizeAttr, size); - } else if (aIndex == 2) { - nsString size("4"); - aSel->SetAttribute(sizeAttr, size); - nsIAtom* multAttr = NS_NewAtom("MULTIPLE"); - nsString mult("1"); - aSel->SetAttribute(multAttr, mult); - numOpt = 8; - } else { - nsString size("1"); - aSel->SetAttribute(sizeAttr, size); - } - - for (int i = 0; i < numOpt; i++) { - nsIAtom* atom = NS_NewAtom("OPTION"); - nsOption* option; - NS_NewHTMLOption((nsIHTMLContent**)&option, atom); - sprintf(&buf[0], "option %d", i); - nsString label(&buf[0]); - option->SetText(label); - aSel->AppendChild(option); - } -} - - - - diff --git a/mozilla/layout/html/makefile.win b/mozilla/layout/html/makefile.win deleted file mode 100644 index 97d8ffb0509..00000000000 --- a/mozilla/layout/html/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS = base document forms style table tests - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/html/style/Makefile b/mozilla/layout/html/style/Makefile deleted file mode 100644 index c650dc9b7ab..00000000000 --- a/mozilla/layout/html/style/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -DIRS = public src - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/style/makefile.win b/mozilla/layout/html/style/makefile.win deleted file mode 100644 index c9c67f325a1..00000000000 --- a/mozilla/layout/html/style/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -DIRS=public src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/html/style/public/Makefile b/mozilla/layout/html/style/public/Makefile deleted file mode 100644 index f81256b6295..00000000000 --- a/mozilla/layout/html/style/public/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -MODULE = raptor - -EXPORTS = \ - nsICSSParser.h \ - $(NULL) - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/style/public/makefile.win b/mozilla/layout/html/style/public/makefile.win deleted file mode 100644 index 91188cd8315..00000000000 --- a/mozilla/layout/html/style/public/makefile.win +++ /dev/null @@ -1,25 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -EXPORTS=nsICSSParser.h -MODULE=raptor - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/layout/html/style/public/nsICSSParser.h b/mozilla/layout/html/style/public/nsICSSParser.h deleted file mode 100644 index e9b21f10215..00000000000 --- a/mozilla/layout/html/style/public/nsICSSParser.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSS1Parser_h___ -#define nsCSS1Parser_h___ - -#include "nslayout.h" -#include "nsISupports.h" -class nsIStyleSheet; -class nsIUnicharInputStream; -class nsIURL; - -#define NS_ICSS_PARSER_IID \ -{ 0xcc9c0610, 0x968c, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -// Interface to the css parser. -class nsICSSParser : public nsISupports { -public: - // Return a mask of the various css standards that this parser - // supports. - virtual PRUint32 GetInfoMask() = 0; - - // Set a style sheet for the parser to fill in. The style sheet must - // implement the nsICSSStyleSheet interface - virtual nsresult SetStyleSheet(nsIStyleSheet* aSheet) = 0; - - virtual nsIStyleSheet* Parse(PRInt32* aErrorCode, - nsIUnicharInputStream* aInput, - nsIURL* aInputURL) = 0; -}; - -// Values or'd in the GetInfoMask; other bits are reserved -#define NS_CSS_GETINFO_CSS1 ((PRUint32) 0x00000001L) -#define NS_CSS_GETINFO_CSSP ((PRUint32) 0x00000002L) -#define NS_CSS_GETINFO_CSS2 ((PRUint32) 0x00000004L) -#define NS_CSS_GETINFO_CSS_FROSTING ((PRUint32) 0x00000008L) - -extern NS_HTML nsresult - NS_NewCSSParser(nsICSSParser** aInstancePtrResult); - -#endif /* nsCSS1Parser_h___ */ diff --git a/mozilla/layout/html/style/src/Makefile b/mozilla/layout/html/style/src/Makefile deleted file mode 100644 index 4af11530df7..00000000000 --- a/mozilla/layout/html/style/src/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -include $(DEPTH)/config/config.mk - -LIBRARY_NAME = raptorhtmlstyle_s - -DEFINES += -D_IMPL_NS_HTML - -# Note the sophisticated alphabetical ordering :-| -CPPSRCS = \ - nsCSSKeywords.cpp \ - nsCSSLayout.cpp \ - nsCSSDeclaration.cpp \ - nsCSSParser.cpp \ - nsCSSProps.cpp \ - nsCSSRendering.cpp \ - nsCSSScanner.cpp \ - nsCSSStyleRule.cpp \ - nsCSSStyleSheet.cpp \ - nsHTMLAttributes.cpp \ - nsHTMLStyleSheet.cpp \ - nsHTMLValue.cpp \ - $(NULL) - -MODULE = raptor - -INCLUDES += -I../../base/src -I../../../base/src -I. - -REQUIRES = xpcom raptor dom - -include $(DEPTH)/config/rules.mk - diff --git a/mozilla/layout/html/style/src/makefile.win b/mozilla/layout/html/style/src/makefile.win deleted file mode 100644 index 795368cbf29..00000000000 --- a/mozilla/layout/html/style/src/makefile.win +++ /dev/null @@ -1,54 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -LIBRARY_NAME=raptorhtmlstyle_s -MODULE=raptor -REQUIRES=xpcom raptor - -DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN - -CPPSRCS=nsCSSKeywords.cpp nsCSSLayout.cpp nsCSSDeclaration.cpp \ - nsCSSParser.cpp nsCSSProps.cpp nsCSSRendering.cpp nsCSSScanner.cpp \ - nsCSSStyleRule.cpp nsCSSStyleSheet.cpp nsHTMLAttributes.cpp \ - nsHTMLStyleSheet.cpp nsHTMLValue.cpp - -CPP_OBJS=.\$(OBJDIR)\nsCSSKeywords.obj .\$(OBJDIR)\nsCSSLayout.obj \ - .\$(OBJDIR)\nsCSSDeclaration.obj .\$(OBJDIR)\nsCSSParser.obj \ - .\$(OBJDIR)\nsCSSProps.obj .\$(OBJDIR)\nsCSSRendering.obj \ - .\$(OBJDIR)\nsCSSScanner.obj .\$(OBJDIR)\nsCSSStyleRule.obj \ - .\$(OBJDIR)\nsCSSStyleSheet.obj .\$(OBJDIR)\nsHTMLAttributes.obj \ - .\$(OBJDIR)\nsHTMLStyleSheet.obj .\$(OBJDIR)\nsHTMLValue.obj - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \ - -I..\..\..\base\src \ - -I..\..\base\src - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - -clobber:: - rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/layout/html/style/src/nsCSSDeclaration.cpp b/mozilla/layout/html/style/src/nsCSSDeclaration.cpp deleted file mode 100644 index 35ee0d46229..00000000000 --- a/mozilla/layout/html/style/src/nsCSSDeclaration.cpp +++ /dev/null @@ -1,1435 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSDeclaration.h" -#include "nsString.h" -#include "nsCRT.h" -#include "nsCSSProps.h" -#include "nsCSSPropIDs.h" -#include "nsUnitConversion.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID); -static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID); -static NS_DEFINE_IID(kCSSDisplaySID, NS_CSS_DISPLAY_SID); -static NS_DEFINE_IID(kCSSTextSID, NS_CSS_TEXT_SID); -static NS_DEFINE_IID(kCSSMarginSID, NS_CSS_MARGIN_SID); -static NS_DEFINE_IID(kCSSPositionSID, NS_CSS_POSITION_SID); -static NS_DEFINE_IID(kCSSListSID, NS_CSS_LIST_SID); -static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID); - - -nsCSSValue::nsCSSValue(void) - : mUnit(eCSSUnit_Null) -{ - mValue.mInt = 0; -} - -nsCSSValue::nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit) - : mUnit(aUnit) -{ - mValue.mInt = aValue; -} - -nsCSSValue::nsCSSValue(float aValue, nsCSSUnit aUnit) - : mUnit(aUnit) -{ - mValue.mFloat = aValue; -} - -nsCSSValue::nsCSSValue(const nsString& aValue) - : mUnit(eCSSUnit_String) -{ - mValue.mString = aValue.ToNewString(); -} - -nsCSSValue::nsCSSValue(nscolor aValue) - : mUnit(eCSSUnit_Color) -{ - mValue.mColor = aValue; -} - -nsCSSValue::nsCSSValue(const nsCSSValue& aCopy) - : mUnit(aCopy.mUnit) -{ - if (eCSSUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = (aCopy.mValue.mString)->ToNewString(); - } - else { - mValue.mString = nsnull; - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - mValue.mInt = aCopy.mValue.mInt; - } - else if (eCSSUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else { - mValue.mFloat = aCopy.mValue.mFloat; - } -} - -nsCSSValue::~nsCSSValue(void) -{ - Reset(); -} - -nsCSSValue& nsCSSValue::operator=(const nsCSSValue& aCopy) -{ - Reset(); - mUnit = aCopy.mUnit; - if (eCSSUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = (aCopy.mValue.mString)->ToNewString(); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - mValue.mInt = aCopy.mValue.mInt; - } - else if (eCSSUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else { - mValue.mFloat = aCopy.mValue.mFloat; - } - return *this; -} - -PRBool nsCSSValue::operator==(const nsCSSValue& aOther) const -{ - if (mUnit == aOther.mUnit) { - if (eCSSUnit_String == mUnit) { - if (nsnull == mValue.mString) { - if (nsnull == aOther.mValue.mString) { - return PR_TRUE; - } - } - else if (nsnull != aOther.mValue.mString) { - return mValue.mString->Equals(*(aOther.mValue.mString)); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit < eCSSUnit_Percent)) { - return PRBool(mValue.mInt == aOther.mValue.mInt); - } - else if (eCSSUnit_Color == mUnit){ - return PRBool(mValue.mColor == aOther.mValue.mColor); - } - else { - return PRBool(mValue.mFloat == aOther.mValue.mFloat); - } - } - return PR_FALSE; -} - -nscoord nsCSSValue::GetLengthTwips(void) const -{ - NS_ASSERTION(IsFixedLengthUnit(), "not a fixed length unit"); - - if (IsFixedLengthUnit()) { - switch (mUnit) { - case eCSSUnit_Inch: - return (nscoord)NS_INCHES_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Foot: - return (nscoord)NS_FEET_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Mile: - return (nscoord)NS_MILES_TO_TWIPS(mValue.mFloat); - - case eCSSUnit_Millimeter: - return (nscoord)NS_MILLIMETERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Centimeter: - return (nscoord)NS_CENTIMETERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Meter: - return (nscoord)NS_METERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Kilometer: - return (nscoord)NS_KILOMETERS_TO_TWIPS(mValue.mFloat); - - case eCSSUnit_Point: - return (nscoord)NS_POINTS_TO_TWIPS_FLOAT(mValue.mFloat); - case eCSSUnit_Pica: - return (nscoord)NS_PICAS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Didot: - return (nscoord)NS_DIDOTS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Cicero: - return (nscoord)NS_CICEROS_TO_TWIPS(mValue.mFloat); - } - } - return 0; -} - -void nsCSSValue::Reset(void) -{ - if ((eCSSUnit_String == mUnit) && (nsnull != mValue.mString)) { - delete mValue.mString; - } - mUnit = eCSSUnit_Null; - mValue.mInt = 0; -}; - -void nsCSSValue::Set(PRInt32 aValue, nsCSSUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mInt = aValue; -} - -void nsCSSValue::Set(float aValue, nsCSSUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mFloat = aValue; -} - -void nsCSSValue::Set(const nsString& aValue) -{ - Reset(); - mUnit = eCSSUnit_String; - mValue.mString = aValue.ToNewString(); -} - -void nsCSSValue::Set(nscolor aValue) -{ - Reset(); - mUnit = eCSSUnit_Color; - mValue.mColor = aValue; -} - -void nsCSSValue::AppendToString(nsString& aBuffer, PRInt32 aPropID) const -{ - if (eCSSUnit_Null == mUnit) { - return; - } - - if (-1 < aPropID) { - aBuffer.Append(nsCSSProps::kNameTable[aPropID].name); - aBuffer.Append(": "); - } - - if (eCSSUnit_String == mUnit) { - if (nsnull != mValue.mString) { - aBuffer.Append('"'); - aBuffer.Append(*(mValue.mString)); - aBuffer.Append('"'); - } - else { - aBuffer.Append("null str"); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - aBuffer.Append(mValue.mInt, 10); - aBuffer.Append("[0x"); - aBuffer.Append(mValue.mInt, 16); - aBuffer.Append(']'); - } - else if (eCSSUnit_Color == mUnit){ - aBuffer.Append("(0x"); - aBuffer.Append(NS_GET_R(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_G(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_B(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_A(mValue.mColor), 16); - aBuffer.Append(')'); - } - else if (eCSSUnit_Percent <= mUnit) { - aBuffer.Append(mValue.mFloat); - } - - switch (mUnit) { - case eCSSUnit_Null: break; - case eCSSUnit_Auto: aBuffer.Append("auto"); break; - case eCSSUnit_String: break; - case eCSSUnit_Absolute: aBuffer.Append("abs"); break; - case eCSSUnit_Enumerated: aBuffer.Append("enum"); break; - case eCSSUnit_Color: aBuffer.Append("rbga"); break; - case eCSSUnit_Percent: aBuffer.Append("%"); break; - case eCSSUnit_Number: aBuffer.Append("#"); break; - case eCSSUnit_Inch: aBuffer.Append("in"); break; - case eCSSUnit_Foot: aBuffer.Append("ft"); break; - case eCSSUnit_Mile: aBuffer.Append("mi"); break; - case eCSSUnit_Millimeter: aBuffer.Append("mm"); break; - case eCSSUnit_Centimeter: aBuffer.Append("cm"); break; - case eCSSUnit_Meter: aBuffer.Append("m"); break; - case eCSSUnit_Kilometer: aBuffer.Append("km"); break; - case eCSSUnit_Point: aBuffer.Append("pt"); break; - case eCSSUnit_Pica: aBuffer.Append("pc"); break; - case eCSSUnit_Didot: aBuffer.Append("dt"); break; - case eCSSUnit_Cicero: aBuffer.Append("cc"); break; - case eCSSUnit_EM: aBuffer.Append("em"); break; - case eCSSUnit_EN: aBuffer.Append("en"); break; - case eCSSUnit_XHeight: aBuffer.Append("ex"); break; - case eCSSUnit_CapHeight: aBuffer.Append("cap"); break; - case eCSSUnit_Pixel: aBuffer.Append("px"); break; - } - aBuffer.Append(' '); -} - -void nsCSSValue::ToString(nsString& aBuffer, PRInt32 aPropID) const -{ - aBuffer.SetLength(0); - AppendToString(aBuffer, aPropID); -} - -const nsID& nsCSSFont::GetID(void) -{ - return kCSSFontSID; -} - -void nsCSSFont::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mFamily.AppendToString(buffer, PROP_FONT_FAMILY); - mStyle.AppendToString(buffer, PROP_FONT_STYLE); - mVariant.AppendToString(buffer, PROP_FONT_VARIANT); - mWeight.AppendToString(buffer, PROP_FONT_WEIGHT); - mSize.AppendToString(buffer, PROP_FONT_SIZE); - fputs(buffer, out); -} - - -const nsID& nsCSSColor::GetID(void) -{ - return kCSSColorSID; -} - -void nsCSSColor::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mColor.AppendToString(buffer, PROP_COLOR); - mBackColor.AppendToString(buffer, PROP_BACKGROUND_COLOR); - mBackImage.AppendToString(buffer, PROP_BACKGROUND_IMAGE); - mBackRepeat.AppendToString(buffer, PROP_BACKGROUND_REPEAT); - mBackAttachment.AppendToString(buffer, PROP_BACKGROUND_ATTACHMENT); - mBackPositionX.AppendToString(buffer, PROP_BACKGROUND_X_POSITION); - mBackPositionY.AppendToString(buffer, PROP_BACKGROUND_Y_POSITION); - mBackFilter.AppendToString(buffer, PROP_BACKGROUND_FILTER); - mCursor.AppendToString(buffer, PROP_CURSOR); - mCursorImage.AppendToString(buffer, PROP_CURSOR_IMAGE); - fputs(buffer, out); -} - -const nsID& nsCSSText::GetID(void) -{ - return kCSSTextSID; -} - -void nsCSSText::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mWordSpacing.AppendToString(buffer, PROP_WORD_SPACING); - mLetterSpacing.AppendToString(buffer, PROP_LETTER_SPACING); - mDecoration.AppendToString(buffer, PROP_TEXT_DECORATION); - mVerticalAlign.AppendToString(buffer, PROP_VERTICAL_ALIGN); - mTextTransform.AppendToString(buffer, PROP_TEXT_TRANSFORM); - mTextAlign.AppendToString(buffer, PROP_TEXT_ALIGN); - mTextIndent.AppendToString(buffer, PROP_TEXT_INDENT); - mLineHeight.AppendToString(buffer, PROP_LINE_HEIGHT); - mWhiteSpace.AppendToString(buffer, PROP_WHITE_SPACE); - fputs(buffer, out); -} - -const nsID& nsCSSDisplay::GetID(void) -{ - return kCSSDisplaySID; -} - -void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mDirection.AppendToString(buffer, PROP_DIRECTION); - mDisplay.AppendToString(buffer, PROP_DISPLAY); - mFloat.AppendToString(buffer, PROP_FLOAT); - mClear.AppendToString(buffer, PROP_CLEAR); - fputs(buffer, out); -} - -void nsCSSRect::List(FILE* out, PRInt32 aPropID, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - if (-1 < aPropID) { - buffer.Append(nsCSSProps::kNameTable[aPropID].name); - buffer.Append(": "); - } - - mTop.AppendToString(buffer); - mRight.AppendToString(buffer); - mBottom.AppendToString(buffer); - mLeft.AppendToString(buffer); - fputs(buffer, out); -} - -nsCSSMargin::nsCSSMargin(void) - : mMargin(nsnull), mPadding(nsnull), mBorder(nsnull), mColor(nsnull), mStyle(nsnull) -{ -} - -nsCSSMargin::~nsCSSMargin(void) -{ - if (nsnull != mMargin) { - delete mMargin; - } - if (nsnull != mPadding) { - delete mPadding; - } - if (nsnull != mBorder) { - delete mBorder; - } - if (nsnull != mColor) { - delete mColor; - } - if (nsnull != mStyle) { - delete mStyle; - } -} - -const nsID& nsCSSMargin::GetID(void) -{ - return kCSSMarginSID; -} - -void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - if (nsnull != mMargin) { - mMargin->List(out, PROP_MARGIN, aIndent); - } - if (nsnull != mPadding) { - mPadding->List(out, PROP_PADDING, aIndent); - } - if (nsnull != mBorder) { - mBorder->List(out, PROP_BORDER_WIDTH, aIndent); - } - if (nsnull != mColor) { - mColor->List(out, PROP_BORDER_COLOR, aIndent); - } - if (nsnull != mStyle) { - mStyle->List(out, PROP_BORDER_STYLE, aIndent); - } -} - -nsCSSPosition::nsCSSPosition(void) - : mClip(nsnull) -{ -} - -nsCSSPosition::~nsCSSPosition(void) -{ - if (nsnull != mClip) { - delete mClip; - } -} - -const nsID& nsCSSPosition::GetID(void) -{ - return kCSSPositionSID; -} - -void nsCSSPosition::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mPosition.AppendToString(buffer, PROP_POSITION); - mWidth.AppendToString(buffer, PROP_WIDTH); - mHeight.AppendToString(buffer, PROP_HEIGHT); - mLeft.AppendToString(buffer, PROP_LEFT); - mTop.AppendToString(buffer, PROP_TOP); - fputs(buffer, out); - if (nsnull != mClip) { - mClip->List(out, PROP_CLIP); - } - buffer.SetLength(0); - mOverflow.AppendToString(buffer, PROP_OVERFLOW); - mZIndex.AppendToString(buffer, PROP_OVERFLOW); - mVisibility.AppendToString(buffer, PROP_VISIBILITY); - mFilter.AppendToString(buffer, PROP_FILTER); - fputs(buffer, out); -} - -const nsID& nsCSSList::GetID(void) -{ - return kCSSListSID; -} - -void nsCSSList::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mType.AppendToString(buffer, PROP_LIST_STYLE_TYPE); - mImage.AppendToString(buffer, PROP_LIST_STYLE_IMAGE); - mPosition.AppendToString(buffer, PROP_LIST_STYLE_POSITION); - fputs(buffer, out); -} - - - -class CSSDeclarationImpl : public nsICSSDeclaration { -public: - void* operator new(size_t size); - - CSSDeclarationImpl(void); - ~CSSDeclarationImpl(void); - - NS_DECL_ISUPPORTS - - nsresult GetData(const nsID& aSID, nsCSSStruct** aData); - nsresult EnsureData(const nsID& aSID, nsCSSStruct** aData); - - nsresult AddValue(const char* aProperty, const nsCSSValue& aValue); - nsresult AddValue(PRInt32 aProperty, const nsCSSValue& aValue); - nsresult GetValue(const char* aProperty, nsCSSValue& aValue); - nsresult GetValue(PRInt32 aProperty, nsCSSValue& aValue); - - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - CSSDeclarationImpl(const CSSDeclarationImpl& aCopy); - CSSDeclarationImpl& operator=(const CSSDeclarationImpl& aCopy); - PRBool operator==(const CSSDeclarationImpl& aCopy) const; - -protected: - nsCSSFont* mFont; - nsCSSColor* mColor; - nsCSSText* mText; - nsCSSMargin* mMargin; - nsCSSPosition* mPosition; - nsCSSList* mList; - nsCSSDisplay* mDisplay; -}; - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - - -void* CSSDeclarationImpl::operator new(size_t size) -{ - void* result = new char[size]; - - nsCRT::zero(result, size); - return result; -} - -CSSDeclarationImpl::CSSDeclarationImpl(void) -{ - NS_INIT_REFCNT(); -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + CSSDeclaration\n", gInstanceCount); -#endif -} - -CSSDeclarationImpl::~CSSDeclarationImpl(void) -{ - if (nsnull != mFont) { - delete mFont; - } - if (nsnull != mColor) { - delete mColor; - } - if (nsnull != mText) { - delete mText; - } - if (nsnull != mMargin) { - delete mMargin; - } - if (nsnull != mPosition) { - delete mPosition; - } - if (nsnull != mList) { - delete mList; - } - if (nsnull != mDisplay) { - delete mDisplay; - } -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - CSSDeclaration\n", gInstanceCount); -#endif -} - -NS_IMPL_ISUPPORTS(CSSDeclarationImpl, kICSSDeclarationIID); - -nsresult CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr) -{ - if (nsnull == aDataPtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aSID.Equals(kCSSFontSID)) { - *aDataPtr = mFont; - } - else if (aSID.Equals(kCSSColorSID)) { - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSDisplaySID)) { - *aDataPtr = mDisplay; - } - else if (aSID.Equals(kCSSTextSID)) { - *aDataPtr = mText; - } - else if (aSID.Equals(kCSSMarginSID)) { - *aDataPtr = mMargin; - } - else if (aSID.Equals(kCSSPositionSID)) { - *aDataPtr = mPosition; - } - else if (aSID.Equals(kCSSListSID)) { - *aDataPtr = mList; - } - else { - return NS_NOINTERFACE; - } - return NS_OK; -} - -nsresult CSSDeclarationImpl::EnsureData(const nsID& aSID, nsCSSStruct** aDataPtr) -{ - if (nsnull == aDataPtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aSID.Equals(kCSSFontSID)) { - if (nsnull == mFont) { - mFont = new nsCSSFont(); - } - *aDataPtr = mFont; - } - else if (aSID.Equals(kCSSColorSID)) { - if (nsnull == mColor) { - mColor = new nsCSSColor(); - } - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSDisplaySID)) { - if (nsnull == mDisplay) { - mDisplay = new nsCSSDisplay(); - } - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSTextSID)) { - if (nsnull == mText) { - mText = new nsCSSText(); - } - *aDataPtr = mText; - } - else if (aSID.Equals(kCSSMarginSID)) { - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - *aDataPtr = mMargin; - } - else if (aSID.Equals(kCSSPositionSID)) { - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - *aDataPtr = mPosition; - } - else if (aSID.Equals(kCSSListSID)) { - if (nsnull == mList) { - mList = new nsCSSList(); - } - *aDataPtr = mList; - } - else { - return NS_NOINTERFACE; - } - if (nsnull == *aDataPtr) { - return NS_ERROR_OUT_OF_MEMORY; - } - return NS_OK; -} - -nsresult CSSDeclarationImpl::AddValue(const char* aProperty, const nsCSSValue& aValue) -{ - return AddValue(nsCSSProps::LookupName(aProperty), aValue); -} - -nsresult CSSDeclarationImpl::AddValue(PRInt32 aProperty, const nsCSSValue& aValue) -{ - nsresult result = NS_OK; - - switch (aProperty) { - // nsCSSFont - case PROP_FONT_FAMILY: - case PROP_FONT_STYLE: - case PROP_FONT_VARIANT: - case PROP_FONT_WEIGHT: - case PROP_FONT_SIZE: - if (nsnull == mFont) { - mFont = new nsCSSFont(); - } - if (nsnull != mFont) { - switch (aProperty) { - case PROP_FONT_FAMILY: mFont->mFamily = aValue; break; - case PROP_FONT_STYLE: mFont->mStyle = aValue; break; - case PROP_FONT_VARIANT: mFont->mVariant = aValue; break; - case PROP_FONT_WEIGHT: mFont->mWeight = aValue; break; - case PROP_FONT_SIZE: mFont->mSize = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSColor - case PROP_COLOR: - case PROP_BACKGROUND_COLOR: - case PROP_BACKGROUND_IMAGE: - case PROP_BACKGROUND_REPEAT: - case PROP_BACKGROUND_ATTACHMENT: - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BACKGROUND_FILTER: - case PROP_CURSOR: - case PROP_CURSOR_IMAGE: - if (nsnull == mColor) { - mColor = new nsCSSColor(); - } - if (nsnull != mColor) { - switch (aProperty) { - case PROP_COLOR: mColor->mColor = aValue; break; - case PROP_BACKGROUND_COLOR: mColor->mBackColor = aValue; break; - case PROP_BACKGROUND_IMAGE: mColor->mBackImage = aValue; break; - case PROP_BACKGROUND_REPEAT: mColor->mBackRepeat = aValue; break; - case PROP_BACKGROUND_ATTACHMENT: mColor->mBackAttachment = aValue; break; - case PROP_BACKGROUND_X_POSITION: mColor->mBackPositionX = aValue; break; - case PROP_BACKGROUND_Y_POSITION: mColor->mBackPositionY = aValue; break; - case PROP_BACKGROUND_FILTER: mColor->mBackFilter = aValue; break; - case PROP_CURSOR: mColor->mCursor = aValue; break; - case PROP_CURSOR_IMAGE: mColor->mCursorImage = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSText - case PROP_WORD_SPACING: - case PROP_LETTER_SPACING: - case PROP_TEXT_DECORATION: - case PROP_VERTICAL_ALIGN: - case PROP_TEXT_TRANSFORM: - case PROP_TEXT_ALIGN: - case PROP_TEXT_INDENT: - case PROP_LINE_HEIGHT: - case PROP_WHITE_SPACE: - if (nsnull == mText) { - mText = new nsCSSText(); - } - if (nsnull != mText) { - switch (aProperty) { - case PROP_WORD_SPACING: mText->mWordSpacing = aValue; break; - case PROP_LETTER_SPACING: mText->mLetterSpacing = aValue; break; - case PROP_TEXT_DECORATION: mText->mDecoration = aValue; break; - case PROP_VERTICAL_ALIGN: mText->mVerticalAlign = aValue; break; - case PROP_TEXT_TRANSFORM: mText->mTextTransform = aValue; break; - case PROP_TEXT_ALIGN: mText->mTextAlign = aValue; break; - case PROP_TEXT_INDENT: mText->mTextIndent = aValue; break; - case PROP_LINE_HEIGHT: mText->mLineHeight = aValue; break; - case PROP_WHITE_SPACE: mText->mWhiteSpace = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSMargin - case PROP_MARGIN_TOP: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mMargin) { - mMargin->mMargin = new nsCSSRect(); - } - if (nsnull != mMargin->mMargin) { - switch (aProperty) { - case PROP_MARGIN_TOP: mMargin->mMargin->mTop = aValue; break; - case PROP_MARGIN_RIGHT: mMargin->mMargin->mRight = aValue; break; - case PROP_MARGIN_BOTTOM: mMargin->mMargin->mBottom = aValue; break; - case PROP_MARGIN_LEFT: mMargin->mMargin->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_PADDING_TOP: - case PROP_PADDING_RIGHT: - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mPadding) { - mMargin->mPadding = new nsCSSRect(); - } - if (nsnull != mMargin->mPadding) { - switch (aProperty) { - case PROP_PADDING_TOP: mMargin->mPadding->mTop = aValue; break; - case PROP_PADDING_RIGHT: mMargin->mPadding->mRight = aValue; break; - case PROP_PADDING_BOTTOM: mMargin->mPadding->mBottom = aValue; break; - case PROP_PADDING_LEFT: mMargin->mPadding->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mBorder) { - mMargin->mBorder = new nsCSSRect(); - } - if (nsnull != mMargin->mBorder) { - switch (aProperty) { - case PROP_BORDER_TOP_WIDTH: mMargin->mBorder->mTop = aValue; break; - case PROP_BORDER_RIGHT_WIDTH: mMargin->mBorder->mRight = aValue; break; - case PROP_BORDER_BOTTOM_WIDTH: mMargin->mBorder->mBottom = aValue; break; - case PROP_BORDER_LEFT_WIDTH: mMargin->mBorder->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mColor) { - mMargin->mColor = new nsCSSRect(); - } - if (nsnull != mMargin->mColor) { - switch (aProperty) { - case PROP_BORDER_TOP_COLOR: mMargin->mColor->mTop = aValue; break; - case PROP_BORDER_RIGHT_COLOR: mMargin->mColor->mRight = aValue; break; - case PROP_BORDER_BOTTOM_COLOR: mMargin->mColor->mBottom = aValue; break; - case PROP_BORDER_LEFT_COLOR: mMargin->mColor->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mStyle) { - mMargin->mStyle = new nsCSSRect(); - } - if (nsnull != mMargin->mStyle) { - switch (aProperty) { - case PROP_BORDER_TOP_STYLE: mMargin->mStyle->mTop = aValue; break; - case PROP_BORDER_RIGHT_STYLE: mMargin->mStyle->mRight = aValue; break; - case PROP_BORDER_BOTTOM_STYLE: mMargin->mStyle->mBottom = aValue; break; - case PROP_BORDER_LEFT_STYLE: mMargin->mStyle->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSPosition - case PROP_POSITION: - case PROP_WIDTH: - case PROP_HEIGHT: - case PROP_LEFT: - case PROP_TOP: - case PROP_OVERFLOW: - case PROP_Z_INDEX: - case PROP_VISIBILITY: - case PROP_FILTER: - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - if (nsnull != mPosition) { - switch (aProperty) { - case PROP_POSITION: mPosition->mPosition = aValue; break; - case PROP_WIDTH: mPosition->mWidth = aValue; break; - case PROP_HEIGHT: mPosition->mHeight = aValue; break; - case PROP_LEFT: mPosition->mLeft = aValue; break; - case PROP_TOP: mPosition->mTop = aValue; break; - case PROP_OVERFLOW: mPosition->mOverflow = aValue; break; - case PROP_Z_INDEX: mPosition->mZIndex = aValue; break; - case PROP_VISIBILITY: mPosition->mVisibility = aValue; break; - case PROP_FILTER: mPosition->mFilter = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_CLIP_TOP: - case PROP_CLIP_RIGHT: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - if (nsnull != mPosition) { - if (nsnull == mPosition->mClip) { - mPosition->mClip = new nsCSSRect(); - } - if (nsnull != mPosition->mClip) { - switch(aProperty) { - case PROP_CLIP_TOP: mPosition->mClip->mTop = aValue; break; - case PROP_CLIP_RIGHT: mPosition->mClip->mRight = aValue; break; - case PROP_CLIP_BOTTOM: mPosition->mClip->mBottom = aValue; break; - case PROP_CLIP_LEFT: mPosition->mClip->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSList - case PROP_LIST_STYLE_TYPE: - case PROP_LIST_STYLE_IMAGE: - case PROP_LIST_STYLE_POSITION: - if (nsnull == mList) { - mList = new nsCSSList(); - } - if (nsnull != mList) { - switch (aProperty) { - case PROP_LIST_STYLE_TYPE: mList->mType = aValue; break; - case PROP_LIST_STYLE_IMAGE: mList->mImage = aValue; break; - case PROP_LIST_STYLE_POSITION: mList->mPosition = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSDisplay - case PROP_FLOAT: - case PROP_CLEAR: - case PROP_DISPLAY: - case PROP_DIRECTION: - if (nsnull == mDisplay) { - mDisplay = new nsCSSDisplay(); - } - if (nsnull != mDisplay) { - switch (aProperty) { - case PROP_FLOAT: mDisplay->mFloat = aValue; break; - case PROP_CLEAR: mDisplay->mClear = aValue; break; - case PROP_DISPLAY: mDisplay->mDisplay = aValue; break; - case PROP_DIRECTION: mDisplay->mDirection = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BACKGROUND: - case PROP_BORDER: - case PROP_CLIP: - case PROP_FONT: - case PROP_LIST_STYLE: - case PROP_MARGIN: - case PROP_PADDING: - case PROP_BACKGROUND_POSITION: - case PROP_BORDER_TOP: - case PROP_BORDER_RIGHT: - case PROP_BORDER_BOTTOM: - case PROP_BORDER_LEFT: - case PROP_BORDER_COLOR: - case PROP_BORDER_STYLE: - case PROP_BORDER_WIDTH: - NS_ERROR("can't query for shorthand properties"); - default: - result = NS_ERROR_ILLEGAL_VALUE; - break; - } - return result; -} - -nsresult CSSDeclarationImpl::GetValue(const char* aProperty, nsCSSValue& aValue) -{ - return GetValue(nsCSSProps::LookupName(aProperty), aValue); -} - -nsresult CSSDeclarationImpl::GetValue(PRInt32 aProperty, nsCSSValue& aValue) -{ - nsresult result = NS_OK; - - switch (aProperty) { - // nsCSSFont - case PROP_FONT_FAMILY: - case PROP_FONT_STYLE: - case PROP_FONT_VARIANT: - case PROP_FONT_WEIGHT: - case PROP_FONT_SIZE: - if (nsnull != mFont) { - switch (aProperty) { - case PROP_FONT_FAMILY: aValue = mFont->mFamily; break; - case PROP_FONT_STYLE: aValue = mFont->mStyle; break; - case PROP_FONT_VARIANT: aValue = mFont->mVariant; break; - case PROP_FONT_WEIGHT: aValue = mFont->mWeight; break; - case PROP_FONT_SIZE: aValue = mFont->mSize; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSColor - case PROP_COLOR: - case PROP_BACKGROUND_COLOR: - case PROP_BACKGROUND_IMAGE: - case PROP_BACKGROUND_REPEAT: - case PROP_BACKGROUND_ATTACHMENT: - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BACKGROUND_FILTER: - case PROP_CURSOR: - case PROP_CURSOR_IMAGE: - if (nsnull != mColor) { - switch (aProperty) { - case PROP_COLOR: aValue = mColor->mColor; break; - case PROP_BACKGROUND_COLOR: aValue = mColor->mBackColor; break; - case PROP_BACKGROUND_IMAGE: aValue = mColor->mBackImage; break; - case PROP_BACKGROUND_REPEAT: aValue = mColor->mBackRepeat; break; - case PROP_BACKGROUND_ATTACHMENT: aValue = mColor->mBackAttachment; break; - case PROP_BACKGROUND_X_POSITION: aValue = mColor->mBackPositionX; break; - case PROP_BACKGROUND_Y_POSITION: aValue = mColor->mBackPositionY; break; - case PROP_BACKGROUND_FILTER: aValue = mColor->mBackFilter; break; - case PROP_CURSOR: aValue = mColor->mCursor; break; - case PROP_CURSOR_IMAGE: aValue = mColor->mCursorImage; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSText - case PROP_WORD_SPACING: - case PROP_LETTER_SPACING: - case PROP_TEXT_DECORATION: - case PROP_VERTICAL_ALIGN: - case PROP_TEXT_TRANSFORM: - case PROP_TEXT_ALIGN: - case PROP_TEXT_INDENT: - case PROP_LINE_HEIGHT: - case PROP_WHITE_SPACE: - if (nsnull != mText) { - switch (aProperty) { - case PROP_WORD_SPACING: aValue = mText->mWordSpacing; break; - case PROP_LETTER_SPACING: aValue = mText->mLetterSpacing; break; - case PROP_TEXT_DECORATION: aValue = mText->mDecoration; break; - case PROP_VERTICAL_ALIGN: aValue = mText->mVerticalAlign; break; - case PROP_TEXT_TRANSFORM: aValue = mText->mTextTransform; break; - case PROP_TEXT_ALIGN: aValue = mText->mTextAlign; break; - case PROP_TEXT_INDENT: aValue = mText->mTextIndent; break; - case PROP_LINE_HEIGHT: aValue = mText->mLineHeight; break; - case PROP_WHITE_SPACE: aValue = mText->mWhiteSpace; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSMargin - case PROP_MARGIN_TOP: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - if ((nsnull != mMargin) && (nsnull != mMargin->mMargin)) { - switch (aProperty) { - case PROP_MARGIN_TOP: aValue = mMargin->mMargin->mTop; break; - case PROP_MARGIN_RIGHT: aValue = mMargin->mMargin->mRight; break; - case PROP_MARGIN_BOTTOM: aValue = mMargin->mMargin->mBottom; break; - case PROP_MARGIN_LEFT: aValue = mMargin->mMargin->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_PADDING_TOP: - case PROP_PADDING_RIGHT: - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - if ((nsnull != mMargin) && (nsnull != mMargin->mPadding)) { - switch (aProperty) { - case PROP_PADDING_TOP: aValue = mMargin->mPadding->mTop; break; - case PROP_PADDING_RIGHT: aValue = mMargin->mPadding->mRight; break; - case PROP_PADDING_BOTTOM: aValue = mMargin->mPadding->mBottom; break; - case PROP_PADDING_LEFT: aValue = mMargin->mPadding->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - if ((nsnull != mMargin) && (nsnull != mMargin->mBorder)) { - switch (aProperty) { - case PROP_BORDER_TOP_WIDTH: aValue = mMargin->mBorder->mTop; break; - case PROP_BORDER_RIGHT_WIDTH: aValue = mMargin->mBorder->mRight; break; - case PROP_BORDER_BOTTOM_WIDTH: aValue = mMargin->mBorder->mBottom; break; - case PROP_BORDER_LEFT_WIDTH: aValue = mMargin->mBorder->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - if ((nsnull != mMargin) && (nsnull != mMargin->mColor)) { - switch (aProperty) { - case PROP_BORDER_TOP_COLOR: aValue = mMargin->mColor->mTop; break; - case PROP_BORDER_RIGHT_COLOR: aValue = mMargin->mColor->mRight; break; - case PROP_BORDER_BOTTOM_COLOR: aValue = mMargin->mColor->mBottom; break; - case PROP_BORDER_LEFT_COLOR: aValue = mMargin->mColor->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - if ((nsnull != mMargin) && (nsnull != mMargin->mStyle)) { - switch (aProperty) { - case PROP_BORDER_TOP_STYLE: aValue = mMargin->mStyle->mTop; break; - case PROP_BORDER_RIGHT_STYLE: aValue = mMargin->mStyle->mRight; break; - case PROP_BORDER_BOTTOM_STYLE: aValue = mMargin->mStyle->mBottom; break; - case PROP_BORDER_LEFT_STYLE: aValue = mMargin->mStyle->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSPosition - case PROP_POSITION: - case PROP_WIDTH: - case PROP_HEIGHT: - case PROP_LEFT: - case PROP_TOP: - case PROP_OVERFLOW: - case PROP_Z_INDEX: - case PROP_VISIBILITY: - case PROP_FILTER: - if (nsnull != mPosition) { - switch (aProperty) { - case PROP_POSITION: aValue = mPosition->mPosition; break; - case PROP_WIDTH: aValue = mPosition->mWidth; break; - case PROP_HEIGHT: aValue = mPosition->mHeight; break; - case PROP_LEFT: aValue = mPosition->mLeft; break; - case PROP_TOP: aValue = mPosition->mTop; break; - case PROP_OVERFLOW: aValue = mPosition->mOverflow; break; - case PROP_Z_INDEX: aValue = mPosition->mZIndex; break; - case PROP_VISIBILITY: aValue = mPosition->mVisibility; break; - case PROP_FILTER: aValue = mPosition->mFilter; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_CLIP_TOP: - case PROP_CLIP_RIGHT: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - if ((nsnull != mPosition) && (nsnull != mPosition->mClip)) { - switch(aProperty) { - case PROP_CLIP_TOP: aValue = mPosition->mClip->mTop; break; - case PROP_CLIP_RIGHT: aValue = mPosition->mClip->mRight; break; - case PROP_CLIP_BOTTOM: aValue = mPosition->mClip->mBottom; break; - case PROP_CLIP_LEFT: aValue = mPosition->mClip->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSList - case PROP_LIST_STYLE_TYPE: - case PROP_LIST_STYLE_IMAGE: - case PROP_LIST_STYLE_POSITION: - if (nsnull != mList) { - switch (aProperty) { - case PROP_LIST_STYLE_TYPE: aValue = mList->mType; break; - case PROP_LIST_STYLE_IMAGE: aValue = mList->mImage; break; - case PROP_LIST_STYLE_POSITION: aValue = mList->mPosition; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSDisplay - case PROP_FLOAT: - case PROP_CLEAR: - case PROP_DISPLAY: - case PROP_DIRECTION: - if (nsnull != mDisplay) { - switch (aProperty) { - case PROP_FLOAT: aValue = mDisplay->mFloat; break; - case PROP_CLEAR: aValue = mDisplay->mClear; break; - case PROP_DISPLAY: aValue = mDisplay->mDisplay; break; - case PROP_DIRECTION: aValue = mDisplay->mDirection; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BACKGROUND: - case PROP_BORDER: - case PROP_CLIP: - case PROP_FONT: - case PROP_LIST_STYLE: - case PROP_MARGIN: - case PROP_PADDING: - case PROP_BACKGROUND_POSITION: - case PROP_BORDER_TOP: - case PROP_BORDER_RIGHT: - case PROP_BORDER_BOTTOM: - case PROP_BORDER_LEFT: - case PROP_BORDER_COLOR: - case PROP_BORDER_STYLE: - case PROP_BORDER_WIDTH: - NS_ERROR("can't query for shorthand properties"); - default: - result = NS_ERROR_ILLEGAL_VALUE; - break; - } - return result; -} - -void CSSDeclarationImpl::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("{ ", out); - - if (nsnull != mFont) { - mFont->List(out); - } - if (nsnull != mColor) { - mColor->List(out); - } - if (nsnull != mText) { - mText->List(out); - } - if (nsnull != mMargin) { - mMargin->List(out); - } - if (nsnull != mPosition) { - mPosition->List(out); - } - if (nsnull != mList) { - mList->List(out); - } - if (nsnull != mDisplay) { - mDisplay->List(out); - } - - fputs("}", out); -} - -NS_HTML nsresult - NS_NewCSSDeclaration(nsICSSDeclaration** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSDeclarationImpl *it = new CSSDeclarationImpl(); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSDeclarationIID, (void **) aInstancePtrResult); -} - - -/* -font -=========== -font-family: string (list) -font-style: enum -font-variant: enum (ie: small caps) -font-weight: enum -font-size: abs, pct, enum, +-1 - - -color/background -============= -color: color -background-color: color -background-image: url(string) -background-repeat: enum -background-attachment: enum -background-position-x -y: abs, pct, enum (left/top center right/bottom (pct?)) -cursor: enum -cursor-image: url(string) - - -text -======= -word-spacing: abs, "normal" -letter-spacing: abs, "normal" -text-decoration: enum -vertical-align: enum, pct -text-transform: enum -text-align: enum -text-indent: abs, pct -line-height: "normal", abs, pct, number-factor -white-space: enum - -margin -======= -margin-top -right -bottom -left: "auto", abs, pct -padding-top -right -bottom -left: abs, pct -border-top -right -bottom -left-width: enum, abs -border-top -right -bottom -left-color: color -border-top -right -bottom -left-style: enum - -size -======= -position: enum -width: abs, pct, "auto" -height: abs, pct, "auto" -left: abs, pct, "auto" -top: abs, pct, "auto" -clip: shape, "auto" (shape: rect - abs, auto) -overflow: enum -z-index: int, auto -visibity: enum - -display -======= -float: enum -clear: enum -direction: enum -display: enum - -filter: string - -list -======== -list-style-type: enum -list-style-image: url, "none" -list-style-position: enum (bool? in/out) - -*/ - - - diff --git a/mozilla/layout/html/style/src/nsCSSKeywordIDs.h b/mozilla/layout/html/style/src/nsCSSKeywordIDs.h deleted file mode 100644 index 959eeb953db..00000000000 --- a/mozilla/layout/html/style/src/nsCSSKeywordIDs.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Do not edit - generated by genhash.pl */ -#define KEYWORD_ABSOLUTE 0 -#define KEYWORD_ARROW 1 -#define KEYWORD_AUTO 2 -#define KEYWORD_BASELINE 3 -#define KEYWORD_BLINK 4 -#define KEYWORD_BLOCK 5 -#define KEYWORD_BOLD 6 -#define KEYWORD_BOLDER 7 -#define KEYWORD_BOTH 8 -#define KEYWORD_BOTTOM 9 -#define KEYWORD_CAPITALIZE 10 -#define KEYWORD_CENTER 11 -#define KEYWORD_CIRCLE 12 -#define KEYWORD_CM 13 -#define KEYWORD_DASHED 14 -#define KEYWORD_DECIMAL 15 -#define KEYWORD_DISC 16 -#define KEYWORD_DOTTED 17 -#define KEYWORD_DOUBLE 18 -#define KEYWORD_EM 19 -#define KEYWORD_EX 20 -#define KEYWORD_FIXED 21 -#define KEYWORD_GROOVE 22 -#define KEYWORD_HAND 23 -#define KEYWORD_HIDDEN 24 -#define KEYWORD_IBEAM 25 -#define KEYWORD_IN 26 -#define KEYWORD_INHERIT 27 -#define KEYWORD_INLINE 28 -#define KEYWORD_INSET 29 -#define KEYWORD_INSIDE 30 -#define KEYWORD_ITALIC 31 -#define KEYWORD_JUSTIFY 32 -#define KEYWORD_LARGE 33 -#define KEYWORD_LARGER 34 -#define KEYWORD_LEFT 35 -#define KEYWORD_LIGHTER 36 -#define KEYWORD_LINE_THROUGH 37 -#define KEYWORD_LIST_ITEM 38 -#define KEYWORD_LOWER_ALPHA 39 -#define KEYWORD_LOWER_ROMAN 40 -#define KEYWORD_LOWERCASE 41 -#define KEYWORD_LTR 42 -#define KEYWORD_MEDIUM 43 -#define KEYWORD_MIDDLE 44 -#define KEYWORD_MM 45 -#define KEYWORD_NO_REPEAT 46 -#define KEYWORD_NONE 47 -#define KEYWORD_NORMAL 48 -#define KEYWORD_NOSHADE 49 -#define KEYWORD_NOWRAP 50 -#define KEYWORD_OBLIQUE 51 -#define KEYWORD_OUTSET 52 -#define KEYWORD_OUTSIDE 53 -#define KEYWORD_OVERLINE 54 -#define KEYWORD_PARAGRAPH 55 -#define KEYWORD_PC 56 -#define KEYWORD_PRE 57 -#define KEYWORD_PT 58 -#define KEYWORD_PX 59 -#define KEYWORD_RELATIVE 60 -#define KEYWORD_REPEAT 61 -#define KEYWORD_REPEAT_X 62 -#define KEYWORD_REPEAT_Y 63 -#define KEYWORD_RIDGE 64 -#define KEYWORD_RIGHT 65 -#define KEYWORD_RTL 66 -#define KEYWORD_SCROLL 67 -#define KEYWORD_SMALL 68 -#define KEYWORD_SMALL_CAPS 69 -#define KEYWORD_SMALLER 70 -#define KEYWORD_SOLID 71 -#define KEYWORD_SQUARE 72 -#define KEYWORD_STATIC 73 -#define KEYWORD_SUB 74 -#define KEYWORD_SUPER 75 -#define KEYWORD_TEXT_BOTTOM 76 -#define KEYWORD_TEXT_TOP 77 -#define KEYWORD_THICK 78 -#define KEYWORD_THIN 79 -#define KEYWORD_TOP 80 -#define KEYWORD_TRANSPARENT 81 -#define KEYWORD_UNDERLINE 82 -#define KEYWORD_UPPER_ALPHA 83 -#define KEYWORD_UPPER_ROMAN 84 -#define KEYWORD_UPPERCASE 85 -#define KEYWORD_VISIBLE 86 -#define KEYWORD_X_LARGE 87 -#define KEYWORD_X_SMALL 88 -#define KEYWORD_XX_LARGE 89 -#define KEYWORD_XX_SMALL 90 -#define KEYWORD_MAX 91 diff --git a/mozilla/layout/html/style/src/nsCSSKeywords.cpp b/mozilla/layout/html/style/src/nsCSSKeywords.cpp deleted file mode 100644 index eefdfa68880..00000000000 --- a/mozilla/layout/html/style/src/nsCSSKeywords.cpp +++ /dev/null @@ -1,399 +0,0 @@ - -/* -** This is a generated file, do not edit it. This file is created by -** genhash.pl -*/ - -#include "plstr.h" -#include "nsCSSKeywords.h" -#define TOTAL_KEYWORDS 91 -#define MIN_WORD_LENGTH 2 -#define MAX_WORD_LENGTH 12 -#define MIN_HASH_VALUE 12 -#define MAX_HASH_VALUE 312 -/* maximum key range = 301, duplicates = 0 */ - - -struct StaticNameTable { - char* tag; - PRInt32 id; -}; - -static const unsigned char kLowerLookup[256] = { - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64, - 97,98,99,100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -#define MYLOWER(x) kLowerLookup[((x) & 0x7f)] - -/** - * Map a name to an ID or -1 - */ -PRInt32 nsCSSKeywords::LookupName(const char* str) -{ - static unsigned short asso_values[] = - { - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 7, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 5, 125, 117, - 67, 0, 10, 55, 15, 20, 5, 35, 0, 25, - 75, 0, 10, 0, 106, 25, 0, 30, 10, 90, - 10, 0, 313, 313, 313, 313, 313, 313,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}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, - {"pt", 58}, - {"",}, - {"left", 35}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"ex", 20}, - {"top", 80}, - {"x-large", 87}, - {"",}, {"",}, {"",}, - {"text-top", 77}, - {"",}, {"",}, {"",}, - {"px", 59}, - {"",}, {"",}, - {"xx-small", 90}, - {"outset", 52}, - {"outside", 53}, - {"",}, - {"auto", 2}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"text-bottom", 76}, - {"",}, {"",}, - {"x-small", 88}, - {"",}, {"",}, - {"em", 19}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"small", 68}, - {"square", 72}, - {"visible", 86}, - {"",}, - {"uppercase", 85}, - {"",}, {"",}, - {"justify", 32}, - {"",}, {"",}, {"",}, - {"upper-alpha", 83}, - {"",}, {"",}, {"",}, - {"thick", 78}, - {"",}, - {"mm", 45}, - {"",}, - {"list-item", 38}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, - {"xx-large", 89}, - {"no-repeat", 46}, - {"",}, - {"overline", 54}, - {"",}, {"",}, {"",}, - {"solid", 71}, - {"",}, {"",}, {"",}, - {"inline", 28}, - {"",}, - {"double", 18}, - {"lowercase", 41}, - {"",}, {"",}, - {"noshade", 49}, - {"",}, - {"rtl", 66}, - {"",}, - {"lower-alpha", 39}, - {"fixed", 21}, - {"",}, - {"thin", 79}, - {"",}, - {"large", 33}, - {"inherit", 27}, - {"middle", 44}, - {"pre", 57}, - {"",}, {"",}, - {"repeat", 61}, - {"medium", 43}, - {"relative", 60}, - {"inset", 29}, - {"inside", 30}, - {"transparent", 81}, - {"",}, {"",}, {"",}, - {"repeat-y", 63}, - {"oblique", 51}, - {"",}, {"",}, {"",}, {"",}, - {"line-through", 37}, - {"",}, {"",}, - {"dotted", 17}, - {"repeat-x", 62}, - {"capitalize", 10}, - {"",}, - {"both", 8}, - {"",}, {"",}, {"",}, - {"italic", 31}, - {"",}, - {"paragraph", 55}, - {"",}, {"",}, - {"static", 73}, - {"none", 47}, - {"",}, - {"bottom", 9}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"absolute", 0}, - {"",}, - {"block", 5}, - {"hand", 23}, - {"groove", 22}, - {"",}, - {"cm", 13}, - {"dashed", 14}, - {"",}, - {"in", 26}, - {"",}, {"",}, - {"ibeam", 25}, - {"super", 75}, - {"",}, {"",}, {"",}, {"",}, - {"nowrap", 50}, - {"",}, - {"hidden", 24}, - {"",}, - {"blink", 4}, - {"right", 65}, - {"normal", 48}, - {"",}, {"",}, {"",}, - {"decimal", 15}, - {"",}, {"",}, {"",}, {"",}, - {"bold", 6}, - {"",}, - {"ridge", 64}, - {"",}, {"",}, - {"underline", 82}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"small-caps", 69}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"ltr", 42}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"larger", 34}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"disc", 16}, - {"",}, {"",}, {"",}, - {"bolder", 7}, - {"baseline", 3}, - {"",}, {"",}, {"",}, - {"upper-roman", 84}, - {"",}, {"",}, {"",}, - {"pc", 56}, - {"",}, {"",}, - {"circle", 12}, - {"",}, {"",}, {"",}, {"",}, - {"scroll", 67}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"smaller", 70}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"lower-roman", 40}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, - {"lighter", 36}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"center", 11}, - {"",}, {"",}, {"",}, - {"sub", 74}, - {"",}, {"",}, {"",}, - {"arrow", 1}, - }; - - if (str != NULL) { - int len = PL_strlen(str); - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int hval = len; - - switch (hval) - { - default: - case 7: - hval += asso_values[MYLOWER(str[6])]; - case 6: - case 5: - case 4: - case 3: - hval += asso_values[MYLOWER(str[2])]; - case 2: - hval += asso_values[MYLOWER(str[1])]; - case 1: - hval += asso_values[MYLOWER(str[0])]; - break; - } - hval += asso_values[MYLOWER(str[len - 1])]; - if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) { - if (len == lengthtable[hval]) { - register const char *tag = wordlist[hval].tag; - - /* - ** While not at the end of the string, if they ever differ - ** they are not equal. We know "tag" is already lower case. - */ - while ((*tag != '\0')&&(*str != '\0')) { - if (*tag != (char) MYLOWER(*str)) { - return -1; - } - tag++; - str++; - } - - /* - ** One of the strings has ended, if they are both ended, then they - ** are equal, otherwise not. - */ - if ((*tag == '\0')&&(*str == '\0')) { - return wordlist[hval].id; - } - } - } - } - } - return -1; -} - -const nsCSSKeywords::NameTableEntry nsCSSKeywords::kNameTable[] = { - { "absolute", 0 }, - { "arrow", 1 }, - { "auto", 2 }, - { "baseline", 3 }, - { "blink", 4 }, - { "block", 5 }, - { "bold", 6 }, - { "bolder", 7 }, - { "both", 8 }, - { "bottom", 9 }, - { "capitalize", 10 }, - { "center", 11 }, - { "circle", 12 }, - { "cm", 13 }, - { "dashed", 14 }, - { "decimal", 15 }, - { "disc", 16 }, - { "dotted", 17 }, - { "double", 18 }, - { "em", 19 }, - { "ex", 20 }, - { "fixed", 21 }, - { "groove", 22 }, - { "hand", 23 }, - { "hidden", 24 }, - { "ibeam", 25 }, - { "in", 26 }, - { "inherit", 27 }, - { "inline", 28 }, - { "inset", 29 }, - { "inside", 30 }, - { "italic", 31 }, - { "justify", 32 }, - { "large", 33 }, - { "larger", 34 }, - { "left", 35 }, - { "lighter", 36 }, - { "line-through", 37 }, - { "list-item", 38 }, - { "lower-alpha", 39 }, - { "lower-roman", 40 }, - { "lowercase", 41 }, - { "ltr", 42 }, - { "medium", 43 }, - { "middle", 44 }, - { "mm", 45 }, - { "no-repeat", 46 }, - { "none", 47 }, - { "normal", 48 }, - { "noshade", 49 }, - { "nowrap", 50 }, - { "oblique", 51 }, - { "outset", 52 }, - { "outside", 53 }, - { "overline", 54 }, - { "paragraph", 55 }, - { "pc", 56 }, - { "pre", 57 }, - { "pt", 58 }, - { "px", 59 }, - { "relative", 60 }, - { "repeat", 61 }, - { "repeat-x", 62 }, - { "repeat-y", 63 }, - { "ridge", 64 }, - { "right", 65 }, - { "rtl", 66 }, - { "scroll", 67 }, - { "small", 68 }, - { "small-caps", 69 }, - { "smaller", 70 }, - { "solid", 71 }, - { "square", 72 }, - { "static", 73 }, - { "sub", 74 }, - { "super", 75 }, - { "text-bottom", 76 }, - { "text-top", 77 }, - { "thick", 78 }, - { "thin", 79 }, - { "top", 80 }, - { "transparent", 81 }, - { "underline", 82 }, - { "upper-alpha", 83 }, - { "upper-roman", 84 }, - { "uppercase", 85 }, - { "visible", 86 }, - { "x-large", 87 }, - { "x-small", 88 }, - { "xx-large", 89 }, - { "xx-small", 90 }, -}; diff --git a/mozilla/layout/html/style/src/nsCSSKeywords.h b/mozilla/layout/html/style/src/nsCSSKeywords.h deleted file mode 100644 index 1db3cbe5ee3..00000000000 --- a/mozilla/layout/html/style/src/nsCSSKeywords.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSKeywords_h___ -#define nsCSSKeywords_h___ - -#include "nslayout.h" -#include "nsCSSKeywordIDs.h" - -class NS_LAYOUT nsCSSKeywords { -public: - // Given a null terminated string of 7 bit characters, return the - // tag id (see nsHTMLTagIDs.h) for the tag or -1 if the tag is not - // known. The lookup function uses a perfect hash. - static PRInt32 LookupName(const char* str); - - struct NameTableEntry { - const char* name; - PRInt32 id; - }; - - // A table whose index is the tag id (from LookupName) - static const NameTableEntry kNameTable[]; -}; - -#endif /* nsCSSKeywords_h___ */ diff --git a/mozilla/layout/html/style/src/nsCSSLayout.cpp b/mozilla/layout/html/style/src/nsCSSLayout.cpp deleted file mode 100644 index e9e1fe42219..00000000000 --- a/mozilla/layout/html/style/src/nsCSSLayout.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCSSLayout.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIContent.h" -#include "nsIFrame.h" -#include "nsIFontMetrics.h" -#include "nsIPresContext.h" -#include "nsRect.h" -#include "nsIPtr.h" - -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -// XXX what about ebina's center vs. ncsa-center? -/* - * Notes: It's a known fact that this doesn't do what ebina's layout - * engine does because his code did vertical alignment on the - * fly. Hopefully that's ok because his code generated surprising - * results in a number of unusual cases. - */ -nscoord nsCSSLayout::VerticallyAlignChildren(nsIPresContext* aCX, - nsIFrame* aContainer, - nsStyleFont* aContainerFont, - nscoord aY0, - nsIFrame* aFirstChild, - PRIntn aChildCount, - nscoord* aAscents, - nscoord aMaxAscent) -{ - // Determine minimum and maximum y values for the line and - // perform alignment of all children except those requesting bottom - // alignment. The second pass will align bottom children (if any) - nsIFontMetrics* fm = aCX->GetMetricsFor(aContainerFont->mFont); - nsIFrame* kid = aFirstChild; - nsRect kidRect; - nscoord minY = aY0; - nscoord maxY = aY0; - PRIntn pass2Kids = 0; - PRIntn kidCount = aChildCount; - while (--kidCount >= 0) { - nscoord kidAscent = *aAscents++; - nsIStyleContextPtr kidSC; - nsIContentPtr kidContent; - - kid->GetStyleContext(aCX, kidSC.AssignRef()); - kid->GetContent(kidContent.AssignRef()); - nsStyleText* textStyle = (nsStyleText*)kidSC->GetData(kStyleTextSID); - nsStyleUnit verticalAlignUnit = textStyle->mVerticalAlign.GetUnit(); - PRUint8 verticalAlignEnum = NS_STYLE_VERTICAL_ALIGN_BASELINE; - - kid->GetRect(kidRect); - - // Vertically align the child - nscoord kidYTop = 0; - - switch (verticalAlignUnit) { - case eStyleUnit_Twips: - kidYTop = aMaxAscent + textStyle->mVerticalAlign.GetCoordValue(); - break; - - case eStyleUnit_Percent: - pass2Kids++; - break; - - case eStyleUnit_Enumerated: - verticalAlignEnum = textStyle->mVerticalAlign.GetIntValue(); - switch (verticalAlignEnum) { - default: - case NS_STYLE_VERTICAL_ALIGN_BASELINE: - // Align the kid's baseline at the max baseline - kidYTop = aMaxAscent - kidAscent; - break; - - case NS_STYLE_VERTICAL_ALIGN_TOP: - // Align the top of the kid with the top of the line box - break; - - case NS_STYLE_VERTICAL_ALIGN_SUB: - // Move baseline by 1/2 the ascent of the child. - // NOTE: CSSx doesn't seem to specify what subscripting does - // so we are using ebina's logic - kidYTop = aMaxAscent + (kidAscent/2) - kidAscent; - break; - - case NS_STYLE_VERTICAL_ALIGN_SUPER: - // Move baseline by 1/2 the ascent of the child - // NOTE: CSSx doesn't seem to specify what superscripting does - // so we are using ebina's logic - kidYTop = aMaxAscent - (kidAscent/2) - kidAscent; - break; - - case NS_STYLE_VERTICAL_ALIGN_BOTTOM: - pass2Kids++; - break; - - case NS_STYLE_VERTICAL_ALIGN_MIDDLE: - // XXX spec says use the 'x' height but our font api doesn't give us - // that information. - kidYTop = aMaxAscent - (fm->GetHeight() / 2) - kidRect.height/2; - break; - - case NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM: - kidYTop = aMaxAscent + fm->GetMaxDescent() - kidRect.height; - break; - - case NS_STYLE_VERTICAL_ALIGN_TEXT_TOP: - kidYTop = aMaxAscent - fm->GetMaxAscent(); - break; - - } - break; - - default: - // Align the kid's baseline at the max baseline - kidYTop = aMaxAscent - kidAscent; - break; - } - - // Place kid and update min and max Y values - nscoord y = aY0 + kidYTop; - if (y < minY) minY = y; - kid->MoveTo(kidRect.x, y); - y += kidRect.height; - if (y > maxY) maxY = y; - - kid->GetNextSibling(kid); - } - - nscoord lineHeight = maxY - minY; - - if (0 != pass2Kids) { - // Position all of the bottom aligned children - kidCount = aChildCount; - kid = aFirstChild; - while (--kidCount >= 0) { - // Get kid's vertical align style data - nsIStyleContextPtr kidSC; - nsIContentPtr kidContent; - - kid->GetStyleContext(aCX, kidSC.AssignRef()); - kid->GetContent(kidContent.AssignRef()); - nsStyleText* textStyle = (nsStyleText*)kidSC->GetData(kStyleTextSID); - nsStyleUnit verticalAlignUnit = textStyle->mVerticalAlign.GetUnit(); - - if (eStyleUnit_Percent == verticalAlignUnit) { - nscoord kidYTop = aMaxAscent + - nscoord(textStyle->mVerticalAlign.GetFloatValue() * lineHeight); - kid->GetRect(kidRect); - kid->MoveTo(kidRect.x, aY0 + kidYTop); - if (--pass2Kids == 0) { - // Stop on last pass2 kid - break; - } - } - else if (verticalAlignUnit == eStyleUnit_Enumerated) { - PRUint8 verticalAlignEnum = textStyle->mVerticalAlign.GetIntValue(); - // Vertically align the child - if (NS_STYLE_VERTICAL_ALIGN_BOTTOM == verticalAlignEnum) { - // Place kid along the bottom - kid->GetRect(kidRect); - kid->MoveTo(kidRect.x, aY0 + lineHeight - kidRect.height); - if (--pass2Kids == 0) { - // Stop on last pass2 kid - break; - } - } - } - - kid->GetNextSibling(kid); - } - } - - NS_RELEASE(fm); - return lineHeight; -} - -/** - * Horizontally place the children in the container frame. - */ -void nsCSSLayout::HorizontallyPlaceChildren(nsIPresContext* aCX, - nsIFrame* aContainer, - nsStyleText* aContainerStyle, - nsIFrame* aFirstChild, - PRInt32 aChildCount, - nscoord aLineWidth, - nscoord aMaxWidth) -{ - PRIntn textAlign = aContainerStyle->mTextAlign; - nscoord dx = 0; - switch (textAlign) { - case NS_STYLE_TEXT_ALIGN_LEFT: - case NS_STYLE_TEXT_ALIGN_JUSTIFY: - // Default layout has everything aligned left - return; - - case NS_STYLE_TEXT_ALIGN_RIGHT: - dx = aMaxWidth - aLineWidth; - break; - - case NS_STYLE_TEXT_ALIGN_CENTER: - dx = (aMaxWidth - aLineWidth) / 2; - break; - } - - // Position children - nsPoint origin; - nsIFrame* kid = aFirstChild; - while (--aChildCount >= 0) { - kid->GetOrigin(origin); - kid->MoveTo(origin.x + dx, origin.y); - kid->GetNextSibling(kid); - } -} - -/** - * Apply css relative positioning to any child that requires it. - */ -void nsCSSLayout::RelativePositionChildren(nsIPresContext* aCX, - nsIFrame* aContainer, - nsIFrame* aFirstChild, - PRInt32 aChildCount) -{ - nsPoint origin; - nsIFrame* kid = aFirstChild; - while (--aChildCount >= 0) { - nsIContentPtr kidContent; - nsIStyleContextPtr kidSC; - - kid->GetContent(kidContent.AssignRef()); - kid->GetStyleContext(aCX, kidSC.AssignRef()); - nsStylePosition* kidPosition = (nsStylePosition*) - kidSC->GetData(kStylePositionSID); - if (NS_STYLE_POSITION_RELATIVE == kidPosition->mPosition) { - kid->GetOrigin(origin); - // XXX Check the flags: could be auto or percent (not just length) - nscoord dx = kidPosition->mLeftOffset; - nscoord dy = kidPosition->mTopOffset; - kid->MoveTo(origin.x + dx, origin.y + dy); - } - kid->GetNextSibling(kid); - } -} diff --git a/mozilla/layout/html/style/src/nsCSSLayout.h b/mozilla/layout/html/style/src/nsCSSLayout.h deleted file mode 100644 index d59fc94acd5..00000000000 --- a/mozilla/layout/html/style/src/nsCSSLayout.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSLayout_h___ -#define nsCSSLayout_h___ - -#include "nsCoord.h" -class nsIPresContext; -struct nsStyleFont; -struct nsStyleText; -class nsIFrame; - -class nsCSSLayout { -public: - /** - * Perform vertical alignment ala CSS. Return the height of the - * line. - */ - static nscoord VerticallyAlignChildren(nsIPresContext* aPresContext, - nsIFrame* aContainer, - nsStyleFont* aContainerFont, - nscoord aY0, - nsIFrame* aFirstChild, - PRInt32 aChildCount, - nscoord* aAscents, - nscoord aMaxAscent); - - /** - * Perform horizontal alignment ala CSS. - */ - static void HorizontallyPlaceChildren(nsIPresContext* aPresContext, - nsIFrame* aContainer, - nsStyleText* aContainerStyle, - nsIFrame* aFirstChild, - PRInt32 aChildCount, - nscoord aLineWidth, - nscoord aMaxWidth); - - /** - * Perform relative positioning ala CSS - */ - static void RelativePositionChildren(nsIPresContext* aPresContext, - nsIFrame* aContainer, - nsIFrame* aFirstChild, - PRInt32 aChildCount); -}; - -#endif /* nsCSSLayout_h___ */ diff --git a/mozilla/layout/html/style/src/nsCSSParser.cpp b/mozilla/layout/html/style/src/nsCSSParser.cpp deleted file mode 100644 index cd57f884ebf..00000000000 --- a/mozilla/layout/html/style/src/nsCSSParser.cpp +++ /dev/null @@ -1,2209 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSParser.h" -#include "nsCSSProps.h" -#include "nsCSSKeywords.h" -#include "nsCSSScanner.h" -#include "nsICSSStyleRule.h" -#include "nsIUnicharInputStream.h" -#include "nsIStyleSet.h" -#include "nsICSSStyleSheet.h" -#include "nsICSSDeclaration.h" -#include "nsStyleConsts.h" -#include "nsIURL.h" -#include "nsString.h" -#include "nsIAtom.h" -#include "nsVoidArray.h" -#include "nsColor.h" - -static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID); -static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID); - -// XXX url's spec'd in a style sheet are relative to the style sheet -// (this includes things like background-image!). -// XXX cell-padding, spacing, etc.??? - -struct Selector { - nsString mTag; // weight 1 - nsString mID; // weight 100 - nsString mClass; // weight 10 - nsString mPseudo; // weight 10 (== class) - PRUint32 mMask; // which fields have values - - Selector(); - ~Selector(); - - PRInt32 Weight() const; -#ifdef NS_DEBUG - void Dump() const; -#endif -}; - -#define SELECTOR_TAG 0x1 -#define SELECTOR_ID 0x2 -#define SELECTOR_CLASS 0x4 -#define SELECTOR_PSEUDO 0x8 - -#define SELECTOR_WEIGHT_BASE 10 - -Selector::Selector() -{ - mMask = 0; -} - -Selector::~Selector() -{ -} - -PRInt32 Selector::Weight() const -{ - return (((0 != (SELECTOR_TAG & mMask)) ? 1 : 0) + - ((0 != (SELECTOR_ID & mMask)) ? (SELECTOR_WEIGHT_BASE * SELECTOR_WEIGHT_BASE) : 0) + - ((0 != ((SELECTOR_CLASS | SELECTOR_PSEUDO) & mMask)) ? SELECTOR_WEIGHT_BASE : 0)); -} - -#ifdef NS_DEBUG -void Selector::Dump() const -{ - PRBool needSpace = PR_FALSE; - if (mTag.Length() > 0) { - fputs(mTag, stdout); - needSpace = PR_TRUE; - } - if (mID.Length() > 0) { - if (needSpace) fputs(" ", stdout); - fputs("#", stdout); - fputs(mID, stdout); - needSpace = PR_TRUE; - } - if (mClass.Length() > 0) { - if (needSpace) fputs(" ", stdout); - fputs(".", stdout); - fputs(mClass, stdout); - needSpace = PR_TRUE; - } - if (mPseudo.Length() > 0) { - if (needSpace) fputs(" ", stdout); - fputs(":", stdout); - fputs(mPseudo, stdout); - needSpace = PR_TRUE; - } -} -#endif - -// e.g. "P B, H1 B { ... }" has a selector list with two elements, -// each of which has two selectors. -struct SelectorList { - SelectorList* mNext; - nsVoidArray mSelectors; - - SelectorList(); - - void Destroy(); - - void AddSelector(Selector* aSelector) { - mSelectors.AppendElement(aSelector); - } - -#ifdef NS_DEBUG - void Dump(); -#endif - -private: - ~SelectorList(); -}; - -SelectorList::SelectorList() -{ - mNext = nsnull; -} - -SelectorList::~SelectorList() -{ - PRInt32 n = mSelectors.Count(); - for (PRInt32 i = 0; i < n; i++) { - Selector* sel = (Selector*) mSelectors.ElementAt(i); - delete sel; - } -} - -void SelectorList::Destroy() -{ - SelectorList* list = this; - while (nsnull != list) { - SelectorList* next = list->mNext; - delete list; - list = next; - } -} - -#ifdef NS_DEBUG -void SelectorList::Dump() -{ - PRInt32 n = mSelectors.Count(); - for (PRInt32 i = 0; i < n; i++) { - Selector* sel = (Selector*) mSelectors.ElementAt(i); - sel->Dump(); - fputs(" ", stdout); - } - if (mNext) { - fputs(", ", stdout); - mNext->Dump(); - } -} -#endif - -//---------------------------------------------------------------------- - -// Your basic top-down recursive descent style parser -class CSSParserImpl : public nsICSSParser { -public: - CSSParserImpl(); - CSSParserImpl(nsICSSStyleSheet* aSheet); - ~CSSParserImpl(); - - NS_DECL_ISUPPORTS - - virtual PRUint32 GetInfoMask(); - - virtual nsresult SetStyleSheet(nsIStyleSheet* aSheet); - - virtual nsIStyleSheet* Parse(PRInt32* aErrorCode, - nsIUnicharInputStream* aInput, - nsIURL* aInputURL); - -protected: - PRBool GetToken(PRInt32* aErrorCode, PRBool aSkipWS); - void UngetToken(); - - PRBool ExpectSymbol(PRInt32* aErrorCode, char aSymbol, PRBool aSkipWS); - nsString* NextIdent(PRInt32* aErrorCode); - void SkipUntil(PRInt32* aErrorCode, PRUnichar aStopSymbol); - void SkipRuleSet(PRInt32* aErrorCode); - void SkipDeclaration(PRInt32* aErrorCode); - - PRBool ParseRuleSet(PRInt32* aErrorCode); - PRBool ParseAtRule(PRInt32* aErrorCode); - PRBool ParseImportRule(PRInt32* aErrorCode); - - PRBool ParseSelectorGroup(PRInt32* aErrorCode, SelectorList* aListHead); - PRBool ParseSelectorList(PRInt32* aErrorCode, SelectorList* aListHead); - PRBool ParseSelector(PRInt32* aErrorCode, Selector* aSelectorResult); - nsICSSDeclaration* ParseDeclarationBlock(PRInt32* aErrorCode); - PRBool ParseDeclaration(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseProperty(PRInt32* aErrorCode, const char* aName, - nsICSSDeclaration* aDeclaration); - PRBool ParseProperty(PRInt32* aErrorCode, const char* aName, - nsICSSDeclaration* aDeclaration, PRInt32 aID); - - // Property specific parsing routines - PRBool ParseBackground(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBackgroundFilter(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseForegroundFilter(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseBackgroundPosition(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseBorder(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBorderColor(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBorderSide(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aWhichSide); - PRBool ParseBorderStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBorderWidth(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseClip(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseFont(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseFontFamily(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseFontWeight(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseListStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseMargin(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParsePadding(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseTextDecoration(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - - // Reused utility parsing routines - PRBool ParseBoxProperties(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[]); - PRInt32 ParseChoice(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aNumNames); - PRBool ParseColor(PRInt32* aErrorCode, nscolor* aColorResult); - PRBool ParseColorComponent(PRInt32* aErrorCode, PRUint8* aComponent, - char aStop); - PRBool ParseEnum(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName, PRInt32* aTable); - PRInt32 SearchKeywordTable(PRInt32 aID, PRInt32 aTable[]); - PRBool ParseVariant(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName, PRInt32 aVariant, - PRInt32* aTable); - PRBool TranslateLength(nsICSSDeclaration* aDeclaration, const char* aName, - float aNumber, const nsString& aDimension); - - void ProcessImport(const nsString& aURLSpec); - - // Current token. The value is valid after calling GetToken - nsCSSToken mToken; - - // After an UngetToken is done this flag is true. The next call to - // GetToken clears the flag. - PRBool mHavePushBack; - - nsCSSScanner* mScanner; - nsIURL* mURL; - nsICSSStyleSheet* mSheet; - - PRBool mInHead; -}; - -NS_HTML nsresult -NS_NewCSSParser(nsICSSParser** aInstancePtrResult) -{ - CSSParserImpl *it = new CSSParserImpl(); - - if (it == nsnull) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSParserIID, (void **) aInstancePtrResult); -} - -CSSParserImpl::CSSParserImpl() -{ - NS_INIT_REFCNT(); - mScanner = nsnull; - mSheet = nsnull; - mHavePushBack = PR_FALSE; -} - -CSSParserImpl::CSSParserImpl(nsICSSStyleSheet* aSheet) -{ - NS_INIT_REFCNT(); - mScanner = nsnull; - mSheet = aSheet; aSheet->AddRef(); - mHavePushBack = PR_FALSE; -} - -NS_IMPL_ISUPPORTS(CSSParserImpl,kICSSParserIID) - -CSSParserImpl::~CSSParserImpl() -{ - NS_IF_RELEASE(mSheet); -} - -PRUint32 CSSParserImpl::GetInfoMask() -{ - return NS_CSS_GETINFO_CSS1 | NS_CSS_GETINFO_CSSP; -} - -nsresult CSSParserImpl::SetStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null ptr"); - if (nsnull == aSheet) { - return NS_ERROR_NULL_POINTER; - } - - // Make sure the sheet supports the correct interface! - static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID); - nsICSSStyleSheet* cssSheet; - nsresult rv = aSheet->QueryInterface(kICSSStyleSheetIID, (void**)&cssSheet); - if (NS_OK != rv) { - return rv; - } - - // Switch to using the new sheet - NS_IF_RELEASE(mSheet); - mSheet = cssSheet; - - return NS_OK; -} - -nsIStyleSheet* CSSParserImpl::Parse(PRInt32* aErrorCode, - nsIUnicharInputStream* aInput, - nsIURL* aInputURL) -{ - if (nsnull == mSheet) { - NS_NewCSSStyleSheet(&mSheet, aInputURL); - } - - mScanner = new nsCSSScanner(); - mScanner->Init(aInput); - mURL = aInputURL; - if (nsnull != aInputURL) { - aInputURL->AddRef(); - } - mInHead = PR_TRUE; - nsCSSToken* tk = &mToken; - for (;;) { - // Get next non-whitespace token - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_AtKeyword == tk->mType) { - ParseAtRule(aErrorCode); - continue; - } else if (eCSSToken_Symbol == tk->mType) { - // Discard dangling semicolons. This is not part of the CSS1 - // forward compatible parsing spec, but it makes alot of sense. - if (';' == tk->mSymbol) { - continue; - } - } - mInHead = PR_FALSE; - UngetToken(); - ParseRuleSet(aErrorCode); - } - delete mScanner; - mScanner = nsnull; - NS_IF_RELEASE(mURL); - - nsIStyleSheet* rv = nsnull; - mSheet->QueryInterface(kIStyleSheetIID, (void**)&rv); - return rv; -} - -//---------------------------------------------------------------------- - -PRBool CSSParserImpl::GetToken(PRInt32* aErrorCode, PRBool aSkipWS) -{ - for (;;) { - if (!mHavePushBack) { - if (!mScanner->Next(aErrorCode, &mToken)) { - break; - } - } - mHavePushBack = PR_FALSE; - if (aSkipWS && (eCSSToken_WhiteSpace == mToken.mType)) { - continue; - } - return PR_TRUE; - } - return PR_FALSE; -} - -void CSSParserImpl::UngetToken() -{ - NS_PRECONDITION(mHavePushBack == PR_FALSE, "double pushback"); - mHavePushBack = PR_TRUE; -} - -PRBool CSSParserImpl::ExpectSymbol(PRInt32* aErrorCode, - char aSymbol, - PRBool aSkipWS) -{ - if (!GetToken(aErrorCode, aSkipWS)) { - return PR_FALSE; - } - nsCSSToken* tk = &mToken; - if ((eCSSToken_Symbol == tk->mType) && (aSymbol == tk->mSymbol)) { - return PR_TRUE; - } - UngetToken(); - return PR_FALSE; -} - -nsString* CSSParserImpl::NextIdent(PRInt32* aErrorCode) -{ - if (!GetToken(aErrorCode, PR_TRUE)) { - return nsnull; - } - if (eCSSToken_Ident != mToken.mType) { - UngetToken(); - return nsnull; - } - return &mToken.mIdent; -} - -// XXX @media type {, types } '{' rules '}' -// XXX @font-face -// XXX @page { :left | :right } '{' declarations '}' -PRBool CSSParserImpl::ParseAtRule(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - if (mInHead && tk->mIdent.EqualsIgnoreCase("import")) { - ParseImportRule(aErrorCode); - return PR_TRUE; - } - - // Skip over unsupported at rule - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if (symbol == ';') { - break; - } - if (symbol == '{') { - SkipUntil(aErrorCode, '}'); - break; - } else if (symbol == '(') { - SkipUntil(aErrorCode, ')'); - } else if (symbol == '[') { - SkipUntil(aErrorCode, ']'); - } - } - } - mInHead = PR_FALSE; - return PR_TRUE; -} - -// Parse a CSS1 import rule: "@import STRING | URL" -PRBool CSSParserImpl::ParseImportRule(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if ((eCSSToken_String == tk->mType) || (eCSSToken_URL == tk->mType)) { - if (ExpectSymbol(aErrorCode, ';', PR_TRUE)) { - ProcessImport(tk->mIdent); - return PR_TRUE; - } - if ((eCSSToken_Symbol != tk->mType) || (';' != tk->mSymbol)) { - SkipUntil(aErrorCode, ';'); - } - } - mInHead = PR_FALSE; - return PR_TRUE; -} - -void CSSParserImpl::ProcessImport(const nsString& aURLSpec) -{ - // XXX probably need a way to encode unicode junk for the part of - // the url that follows a "?" - char* cp = aURLSpec.ToNewCString(); - nsIURL* url; - nsresult rv = NS_NewURL(&url, mURL, cp); - delete cp; - if (NS_OK != rv) { - // import url is bad - // XXX log this somewhere for easier web page debugging - return; - } - - if (PR_FALSE == mSheet->ContainsStyleSheet(url)) { // don't allow circular references - - PRInt32 ec; - nsIInputStream* in = url->Open(&ec); - if (nsnull == in) { - // failure to make connection - // XXX log this somewhere for easier web page debugging - } - else { - - nsIUnicharInputStream* uin; - rv = NS_NewConverterStream(&uin, nsnull, in); - if (NS_OK != rv) { - // XXX no iso-latin-1 converter? out of memory? - NS_RELEASE(in); - } - else { - - NS_RELEASE(in); - - // Create a new parse to parse the import. - - if (NS_OK == rv) { - CSSParserImpl *parser = new CSSParserImpl(); - nsIStyleSheet* childSheet = parser->Parse(&ec, uin, url); - NS_RELEASE(parser); - if (nsnull != childSheet) { - nsICSSStyleSheet* cssChild = nsnull; - if (NS_OK == childSheet->QueryInterface(kICSSStyleSheetIID, (void**)&cssChild)) { - mSheet->AppendStyleSheet(cssChild); - NS_RELEASE(cssChild); - } - } - NS_RELEASE(childSheet); - } - NS_RELEASE(uin); - } - } - } - NS_RELEASE(url); -} - -void CSSParserImpl::SkipUntil(PRInt32* aErrorCode, PRUnichar aStopSymbol) -{ - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if (symbol == aStopSymbol) { - break; - } else if ('{' == symbol) { - SkipUntil(aErrorCode, '}'); - } else if ('[' == symbol) { - SkipUntil(aErrorCode, ']'); - } else if ('(' == symbol) { - SkipUntil(aErrorCode, ')'); - } - } - } -} - -void CSSParserImpl::SkipDeclaration(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if (';' == symbol) { - break; - } - if ('}' == symbol) { - UngetToken(); - break; - } - if ('{' == symbol) { - SkipUntil(aErrorCode, '}'); - } else if ('(' == symbol) { - SkipUntil(aErrorCode, ')'); - } else if ('[' == symbol) { - SkipUntil(aErrorCode, ']'); - } - } - } -} - -void CSSParserImpl::SkipRuleSet(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if ('{' == symbol) { - SkipUntil(aErrorCode, '}'); - break; - } - if ('(' == symbol) { - SkipUntil(aErrorCode, ')'); - } else if ('[' == symbol) { - SkipUntil(aErrorCode, ']'); - } - } - } -} - -PRBool CSSParserImpl::ParseRuleSet(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - - // First get the list of selectors for the rule - SelectorList *slist = new SelectorList(); - if (!ParseSelectorList(aErrorCode, slist)) { - SkipRuleSet(aErrorCode); - slist->Destroy(); - return PR_FALSE; - } - - // Next parse the declaration block - nsICSSDeclaration* declaration = ParseDeclarationBlock(aErrorCode); - if (nsnull == declaration) { - // XXX skip something here - slist->Destroy(); - return PR_FALSE; - } - -#if 0 - slist->Dump(); - fputs("{\n", stdout); - declaration->List(); - fputs("}\n", stdout); -#endif - - // Translate the selector list and declaration block into style data - - // XXX PSL working here - - SelectorList* list = slist; - nsCSSSelector selector; - nsICSSStyleRule* rule; - - while (nsnull != list) { - PRInt32 selIndex = list->mSelectors.Count(); - - Selector* sel = (Selector*)list->mSelectors[--selIndex]; - selector.Set(sel->mTag, sel->mID, sel->mClass, sel->mPseudo); - PRInt32 weight = sel->Weight(); - - if (NS_OK == NS_NewCSSStyleRule(&rule, selector)) { - while (--selIndex >= 0) { - Selector* sel = (Selector*)list->mSelectors[selIndex]; - selector.Set(sel->mTag, sel->mID, sel->mClass, sel->mPseudo); - - rule->AddSelector(selector); - weight += sel->Weight(); - } - rule->SetDeclaration(declaration); - rule->SetWeight(weight); -// rule->List(); - mSheet->AppendStyleRule(rule); - NS_RELEASE(rule); - } - - list = list->mNext; - } - - // XXX PSL working here - - // Release temporary storage - slist->Destroy(); - NS_RELEASE(declaration); - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseSelectorList(PRInt32* aErrorCode, - SelectorList* aListHead) -{ - if (!ParseSelectorGroup(aErrorCode, aListHead)) { - // must have at least one selector group - return PR_FALSE; - } - - // After that there must either be a "," or a "{" - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Symbol != tk->mType) { - UngetToken(); - return PR_FALSE; - } - if (',' == tk->mSymbol) { - // Another selector group must follow - SelectorList* newList = new SelectorList(); - if (!ParseSelectorGroup(aErrorCode, newList)) { - newList->Destroy(); - return PR_FALSE; - } - // add new list to the end of the selector list - aListHead->mNext = newList; - aListHead = newList; - continue; - } else if ('{' == tk->mSymbol) { - UngetToken(); - break; - } else { - UngetToken(); - return PR_FALSE; - } - } - - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseSelectorGroup(PRInt32* aErrorCode, - SelectorList* aList) -{ - for (;;) { - Selector* sel = new Selector(); - if (!ParseSelector(aErrorCode, sel)) { - delete sel; - break; - } - aList->AddSelector(sel); - } - return (PRBool) (aList->mSelectors.Count() > 0); -} - -/** - * These are the 15 possible kinds of CSS1 style selectors: - *
      - *
    • Tag - *
    • Tag#Id - *
    • Tag#Id.Class - *
    • Tag#Id.Class:Pseudo - *
    • Tag#Id:Pseudo - *
    • Tag.Class - *
    • Tag.Class:Pseudo - *
    • Tag:Pseudo - *
    • #Id - *
    • #Id.Class - *
    • #Id.Class:Pseudo - *
    • #Id:Pseudo - *
    • .Class - *
    • .Class:Pseudo - *
    • :Pseudo - *
    - */ -PRBool CSSParserImpl::ParseSelector(PRInt32* aErrorCode, - Selector* aSelectorResult) -{ - PRUint32 mask = 0; - aSelectorResult->mTag.SetLength(0); - aSelectorResult->mClass.SetLength(0); - aSelectorResult->mID.SetLength(0); - aSelectorResult->mPseudo.SetLength(0); - - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Ident == tk->mType) { - // tag - mask |= SELECTOR_TAG; - aSelectorResult->mTag.Append(tk->mIdent); - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof is ok (here!) - return PR_TRUE; - } - } - if (eCSSToken_ID == tk->mType) { - // #id - mask |= SELECTOR_ID; - aSelectorResult->mID.Append(tk->mIdent); - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof is ok (here!) - return PR_TRUE; - } - } - if ((eCSSToken_Symbol == tk->mType) && ('.' == tk->mSymbol)) { - // .class - mask |= SELECTOR_CLASS; - if (!GetToken(aErrorCode, PR_FALSE)) { - return PR_FALSE; - } - if (eCSSToken_Ident != tk->mType) { - // malformed selector - UngetToken(); - return PR_FALSE; - } - aSelectorResult->mClass.Append(tk->mIdent); - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof is ok (here!) - return PR_TRUE; - } - } - if ((eCSSToken_Symbol == tk->mType) && (':' == tk->mSymbol)) { - // :pseudo - mask |= SELECTOR_PSEUDO; - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof - return PR_FALSE; - } - if (eCSSToken_Ident != tk->mType) { - // malformed selector - UngetToken(); - return PR_FALSE; - } - aSelectorResult->mPseudo.Append(tk->mIdent); - tk = nsnull; - } - if (nsnull != tk) { - UngetToken(); - } - if (mask == 0) { - return PR_FALSE; - } - aSelectorResult->mMask = mask; - return PR_TRUE; -} - -nsICSSDeclaration* CSSParserImpl::ParseDeclarationBlock(PRInt32* aErrorCode) -{ - if (!ExpectSymbol(aErrorCode, '{', PR_TRUE)) { - return nsnull; - } - nsICSSDeclaration* declaration = nsnull; - if (NS_OK == NS_NewCSSDeclaration(&declaration)) { - for (;;) { - if (!ParseDeclaration(aErrorCode, declaration)) { - SkipDeclaration(aErrorCode); - if (ExpectSymbol(aErrorCode, '}', PR_TRUE)) { - break; - } - // Since the skipped declaration didn't end the block we parse - // the next declaration. - } - } - } - return declaration; -} - -PRBool CSSParserImpl::ParseColor(PRInt32* aErrorCode, nscolor* aColorResult) -{ - char cbuf[50]; - - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - - nsCSSToken* tk = &mToken; - switch (tk->mType) { - case eCSSToken_ID: - // #xxyyzz - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - if (NS_HexToRGB(cbuf, aColorResult)) { - return PR_TRUE; - } - break; - - case eCSSToken_Ident: - if (!tk->mIdent.EqualsIgnoreCase("rgb")) { - // named color (maybe!) - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - if (NS_ColorNameToRGB(cbuf, aColorResult)) { - return PR_TRUE; - } - } else { - // rgb ( component , component , component ) - PRUint8 r, g, b; - if (ExpectSymbol(aErrorCode, '(', PR_TRUE) && - ParseColorComponent(aErrorCode, &r, ',') && - ParseColorComponent(aErrorCode, &g, ',') && - ParseColorComponent(aErrorCode, &b, ')')) { - *aColorResult = NS_RGB(r,g,b); - return PR_TRUE; - } - } - break; - - default: - break; - } - - // It's not a color - UngetToken(); - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseColorComponent(PRInt32* aErrorCode, - PRUint8* aComponent, - char aStop) -{ - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - float value; - nsCSSToken* tk = &mToken; - switch (tk->mType) { - case eCSSToken_Number: - value = tk->mNumber; - break; - case eCSSToken_Percentage: - value = tk->mNumber * 255.0f; - break; - default: - UngetToken(); - return PR_FALSE; - } - if (ExpectSymbol(aErrorCode, aStop, PR_TRUE)) { - if (value < 0.0f) value = 0.0f; - if (value > 255.0f) value = 255.0f; - *aComponent = (PRUint8) value; - return PR_TRUE; - } - return PR_FALSE; -} - -//---------------------------------------------------------------------- - -PRBool CSSParserImpl::ParseDeclaration(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - // Get property name - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Ident == tk->mType) { - if (!ExpectSymbol(aErrorCode, ':', PR_TRUE)) { - return PR_FALSE; - } - break; - } - if ((eCSSToken_Symbol == tk->mType) && (';' == tk->mSymbol)) { - // dangling semicolons are skipped - continue; - } - - // Not a declaration... - UngetToken(); - return PR_FALSE; - } - - // Map property name to it's ID and then parse the property - char propertyName[100]; - tk->mIdent.ToCString(propertyName, sizeof(propertyName)); - if (!ParseProperty(aErrorCode, propertyName, aDeclaration)) { - return PR_FALSE; - } - - // Make sure valid property declaration is terminated with either a - // semicolon or a right-curly-brace. - if (!GetToken(aErrorCode, PR_TRUE)) { - // Premature eof is not ok - return PR_FALSE; - } - if (eCSSToken_Symbol == tk->mType) { - if (';' == tk->mSymbol) { - return PR_TRUE; - } - if ('}' == tk->mSymbol) { - UngetToken(); - return PR_TRUE; - } - } - return PR_FALSE; -} - -// Flags for ParseVariant method -#define VARIANT_KEYWORD 0x01 -#define VARIANT_LENGTH 0x02 -#define VARIANT_PERCENT 0x04 -#define VARIANT_COLOR 0x08 -#define VARIANT_URL 0x10 -#define VARIANT_NUMBER 0x20 -#define VARIANT_INTEGER 0x40 - -// Common combinations of variants -#define VARIANT_KL (VARIANT_KEYWORD | VARIANT_LENGTH) -#define VARIANT_KLP (VARIANT_KEYWORD | VARIANT_LENGTH | VARIANT_PERCENT) -#define VARIANT_KLPN (VARIANT_KLP | VARIANT_NUMBER) -#define VARIANT_KP (VARIANT_KEYWORD | VARIANT_PERCENT) -#define VARIANT_KI (VARIANT_KEYWORD | VARIANT_INTEGER) -#define VARIANT_LP (VARIANT_LENGTH | VARIANT_PERCENT) -#define VARIANT_CK (VARIANT_COLOR | VARIANT_KEYWORD) -#define VARIANT_C VARIANT_COLOR -#define VARIANT_UK (VARIANT_URL | VARIANT_KEYWORD) - -// Keyword id tables for variant/enum parsing -static PRInt32 kBackgroundAttachmentKTable[] = { - KEYWORD_FIXED, NS_STYLE_BG_ATTACHMENT_FIXED, - KEYWORD_SCROLL, NS_STYLE_BG_ATTACHMENT_SCROLL, - -1 -}; - -static PRInt32 kBackgroundColorKTable[] = { - KEYWORD_TRANSPARENT, NS_STYLE_BG_COLOR_TRANSPARENT, - -1 -}; - -static PRInt32 kBackgroundImageKTable[] = { - KEYWORD_NONE, NS_STYLE_BG_IMAGE_NONE, - -1 -}; - -static PRInt32 kBackgroundRepeatKTable[] = { - KEYWORD_NO_REPEAT, NS_STYLE_BG_REPEAT_OFF, - KEYWORD_REPEAT, NS_STYLE_BG_REPEAT_XY, - KEYWORD_REPEAT_X, NS_STYLE_BG_REPEAT_X, - KEYWORD_REPEAT_Y, NS_STYLE_BG_REPEAT_Y, - -1 -}; - -static PRInt32 kBorderStyleKTable[] = { - KEYWORD_NONE, NS_STYLE_BORDER_STYLE_NONE, - KEYWORD_DOTTED, NS_STYLE_BORDER_STYLE_DOTTED, - KEYWORD_DASHED, NS_STYLE_BORDER_STYLE_DASHED, - KEYWORD_SOLID, NS_STYLE_BORDER_STYLE_SOLID, - KEYWORD_DOUBLE, NS_STYLE_BORDER_STYLE_DOUBLE, - KEYWORD_GROOVE, NS_STYLE_BORDER_STYLE_GROOVE, - KEYWORD_RIDGE, NS_STYLE_BORDER_STYLE_RIDGE, - KEYWORD_INSET, NS_STYLE_BORDER_STYLE_INSET, - KEYWORD_OUTSET, NS_STYLE_BORDER_STYLE_OUTSET, - -1 -}; - -static PRInt32 kBorderWidthKTable[] = { - KEYWORD_THIN, NS_STYLE_BORDER_WIDTH_THIN, - KEYWORD_MEDIUM, NS_STYLE_BORDER_WIDTH_MEDIUM, - KEYWORD_THICK, NS_STYLE_BORDER_WIDTH_THICK, - -1 -}; - -static PRInt32 kClearKTable[] = { - KEYWORD_NONE, NS_STYLE_CLEAR_NONE, - KEYWORD_LEFT, NS_STYLE_CLEAR_LEFT, - KEYWORD_RIGHT, NS_STYLE_CLEAR_RIGHT, - KEYWORD_BOTH, NS_STYLE_CLEAR_LEFT_AND_RIGHT, - -1 -}; - -static PRInt32 kClipKTable[] = { - KEYWORD_AUTO, NS_STYLE_CLIP_AUTO, - -1 -}; - -static PRInt32 kCursorKTable[] = { - KEYWORD_INHERIT, NS_STYLE_CURSOR_INHERIT, - KEYWORD_IBEAM, NS_STYLE_CURSOR_IBEAM, - KEYWORD_ARROW, NS_STYLE_CURSOR_DEFAULT, - KEYWORD_HAND, NS_STYLE_CURSOR_HAND, - -1 -}; - -static PRInt32 kDirectionKTable[] = { - KEYWORD_LTR, NS_STYLE_DIRECTION_LTR, - KEYWORD_RTL, NS_STYLE_DIRECTION_RTL, - KEYWORD_INHERIT, NS_STYLE_DIRECTION_INHERIT, - -1 -}; - -static PRInt32 kDisplayKTable[] = { - KEYWORD_NONE, NS_STYLE_DISPLAY_NONE, - KEYWORD_BLOCK, NS_STYLE_DISPLAY_BLOCK, - KEYWORD_INLINE, NS_STYLE_DISPLAY_INLINE, - KEYWORD_LIST_ITEM, NS_STYLE_DISPLAY_LIST_ITEM, - -1 -}; - -static PRInt32 kFloatKTable[] = { - KEYWORD_NONE, NS_STYLE_FLOAT_NONE, - KEYWORD_LEFT, NS_STYLE_FLOAT_LEFT, - KEYWORD_RIGHT, NS_STYLE_FLOAT_RIGHT, - -1 -}; - -static PRInt32 kFontSizeKTable[] = { - KEYWORD_XX_SMALL, NS_STYLE_FONT_SIZE_XXSMALL, - KEYWORD_X_SMALL, NS_STYLE_FONT_SIZE_XSMALL, - KEYWORD_SMALL, NS_STYLE_FONT_SIZE_SMALL, - KEYWORD_MEDIUM, NS_STYLE_FONT_SIZE_MEDIUM, - KEYWORD_LARGE, NS_STYLE_FONT_SIZE_LARGE, - KEYWORD_X_LARGE, NS_STYLE_FONT_SIZE_XLARGE, - KEYWORD_XX_LARGE, NS_STYLE_FONT_SIZE_XXLARGE, - KEYWORD_LARGER, NS_STYLE_FONT_SIZE_LARGER, - KEYWORD_SMALLER, NS_STYLE_FONT_SIZE_SMALLER, - -1 -}; - -static PRInt32 kFontStyleKTable[] = { - KEYWORD_NORMAL, NS_STYLE_FONT_STYLE_NORMAL, - KEYWORD_ITALIC, NS_STYLE_FONT_STYLE_ITALIC, - KEYWORD_OBLIQUE, NS_STYLE_FONT_STYLE_OBLIQUE, - -1 -}; - -static PRInt32 kFontVariantKTable[] = { - KEYWORD_NORMAL, NS_STYLE_FONT_VARIANT_NORMAL, - KEYWORD_SMALL_CAPS, NS_STYLE_FONT_VARIANT_SMALL_CAPS, - -1 -}; - -static PRInt32 kLeftKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kHeightKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kLineHeightKTable[] = { - KEYWORD_NORMAL, NS_STYLE_LINE_HEIGHT_NORMAL, - -1 -}; - -static PRInt32 kListStyleImageKTable[] = { - KEYWORD_NONE, NS_STYLE_LIST_STYLE_IMAGE_NONE, - -1 -}; - -static PRInt32 kListStylePositionKTable[] = { - KEYWORD_INSIDE, NS_STYLE_LIST_STYLE_POSITION_INSIDE, - KEYWORD_OUTSIDE, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE, - -1 -}; - -static PRInt32 kListStyleKTable[] = { - KEYWORD_NONE, NS_STYLE_LIST_STYLE_NONE, - KEYWORD_DISC, NS_STYLE_LIST_STYLE_DISC, - KEYWORD_CIRCLE, NS_STYLE_LIST_STYLE_CIRCLE, - KEYWORD_SQUARE, NS_STYLE_LIST_STYLE_SQUARE, - KEYWORD_DECIMAL, NS_STYLE_LIST_STYLE_DECIMAL, - KEYWORD_LOWER_ROMAN, NS_STYLE_LIST_STYLE_LOWER_ROMAN, - KEYWORD_UPPER_ROMAN, NS_STYLE_LIST_STYLE_UPPER_ROMAN, - KEYWORD_LOWER_ALPHA, NS_STYLE_LIST_STYLE_LOWER_ALPHA, - KEYWORD_UPPER_ALPHA, NS_STYLE_LIST_STYLE_UPPER_ALPHA, - -1 -}; - -static PRInt32 kMarginSizeKTable[] = { - KEYWORD_AUTO, NS_STYLE_MARGIN_SIZE_AUTO, - -1 -}; - -static PRInt32 kSpacingKTable[] = { - KEYWORD_NORMAL, NS_STYLE_SPACING_NORMAL, - -1 -}; - -static PRInt32 kOverflowKTable[] = { - KEYWORD_VISIBLE, NS_STYLE_OVERFLOW_VISIBLE, - KEYWORD_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN, - KEYWORD_SCROLL, NS_STYLE_OVERFLOW_SCROLL, - KEYWORD_AUTO, NS_STYLE_OVERFLOW_AUTO, - -1 -}; - -static PRInt32 kPositionKTable[] = { - KEYWORD_STATIC, NS_STYLE_POSITION_STATIC, - KEYWORD_RELATIVE, NS_STYLE_POSITION_RELATIVE, - KEYWORD_ABSOLUTE, NS_STYLE_POSITION_ABSOLUTE, - -1 -}; - -static PRInt32 kTextAlignKTable[] = { - KEYWORD_LEFT, NS_STYLE_TEXT_ALIGN_LEFT, - KEYWORD_RIGHT, NS_STYLE_TEXT_ALIGN_RIGHT, - KEYWORD_CENTER, NS_STYLE_TEXT_ALIGN_CENTER, - KEYWORD_JUSTIFY, NS_STYLE_TEXT_ALIGN_JUSTIFY, - -1 -}; - -static PRInt32 kTextTransformKTable[] = { - KEYWORD_NONE, NS_STYLE_TEXT_TRANSFORM_NONE, - KEYWORD_CAPITALIZE, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE, - KEYWORD_LOWERCASE, NS_STYLE_TEXT_TRANSFORM_LOWERCASE, - KEYWORD_UPPERCASE, NS_STYLE_TEXT_TRANSFORM_UPPERCASE, - -1 -}; - -static PRInt32 kTopKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kVerticalAlignKTable[] = { - KEYWORD_BASELINE, NS_STYLE_VERTICAL_ALIGN_BASELINE, - KEYWORD_SUB, NS_STYLE_VERTICAL_ALIGN_SUB, - KEYWORD_SUPER, NS_STYLE_VERTICAL_ALIGN_SUPER, - KEYWORD_TOP, NS_STYLE_VERTICAL_ALIGN_TOP, - KEYWORD_TEXT_TOP, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP, - KEYWORD_MIDDLE, NS_STYLE_VERTICAL_ALIGN_MIDDLE, - KEYWORD_BOTTOM, NS_STYLE_VERTICAL_ALIGN_BOTTOM, - KEYWORD_TEXT_BOTTOM, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM, - -1 -}; - -static PRInt32 kVisibilityKTable[] = { - KEYWORD_INHERIT, NS_STYLE_VISIBILITY_INHERIT, - KEYWORD_VISIBLE, NS_STYLE_VISIBILITY_VISIBLE, - KEYWORD_HIDDEN, NS_STYLE_VISIBILITY_HIDDEN, - -1 -}; - -static PRInt32 kWhitespaceKTable[] = { - KEYWORD_NORMAL, NS_STYLE_WHITESPACE_NORMAL, - KEYWORD_PRE, NS_STYLE_WHITESPACE_PRE, - KEYWORD_NOWRAP, NS_STYLE_WHITESPACE_NOWRAP, - -1 -}; - -static PRInt32 kWidthKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kZIndexKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static const char* kBorderTopNames[] = { - "border-top-width", - "border-top-style", - "border-top-color", -}; -static const char* kBorderRightNames[] = { - "border-right-width", - "border-right-style", - "border-right-color", -}; -static const char* kBorderBottomNames[] = { - "border-bottom-width", - "border-bottom-style", - "border-bottom-color", -}; -static const char* kBorderLeftNames[] = { - "border-left-width", - "border-left-style", - "border-left-color", -}; - -PRInt32 CSSParserImpl::SearchKeywordTable(PRInt32 aID, PRInt32 aTable[]) -{ - PRInt32 i = 0; - for (;;) { - if (aTable[i] < 0) { - break; - } - if (aID == aTable[i]) { - return i; - } - i += 2; - } - return -1; -} - -PRBool CSSParserImpl::ParseEnum(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName, PRInt32* aTable) -{ - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - return PR_FALSE; - } - char cbuf[50]; - ident->ToCString(cbuf, sizeof(cbuf)); - PRInt32 id = nsCSSKeywords::LookupName(cbuf); - if (id >= 0) { - PRInt32 ix = SearchKeywordTable(id, aTable); - if (ix >= 0) { - aDeclaration->AddValue(aName, nsCSSValue(aTable[ix+1], eCSSUnit_Enumerated)); - return PR_TRUE; - } - } - - // Put the unknown identifier back and return - UngetToken(); - return PR_FALSE; -} - -PRBool CSSParserImpl::TranslateLength(nsICSSDeclaration* aDeclaration, - const char* aName, - float aNumber, - const nsString& aDimension) -{ - nsCSSUnit units; - if (0 != aDimension.Length()) { - char cbuf[50]; - aDimension.ToCString(cbuf, sizeof(cbuf)); - PRInt32 id = nsCSSKeywords::LookupName(cbuf); - switch (id) { - case KEYWORD_EM: units = eCSSUnit_EM; break; - case KEYWORD_EX: units = eCSSUnit_XHeight; break; - case KEYWORD_PX: units = eCSSUnit_Pixel; break; - case KEYWORD_IN: units = eCSSUnit_Inch; break; - case KEYWORD_CM: units = eCSSUnit_Centimeter; break; - case KEYWORD_MM: units = eCSSUnit_Millimeter; break; - case KEYWORD_PT: units = eCSSUnit_Point; break; - case KEYWORD_PC: units = eCSSUnit_Pica; break; - default: - // unknown dimension - return PR_FALSE; - } - } else { - // Must be a zero number... - units = eCSSUnit_Point; - } - aDeclaration->AddValue(aName, nsCSSValue(aNumber, units)); - return PR_TRUE; -} - - -PRBool CSSParserImpl::ParseVariant(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName, - PRInt32 aVariants, PRInt32* aTable) -{ - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (((aVariants & VARIANT_KEYWORD) != 0) && - (eCSSToken_Ident == tk->mType)) { - char cbuf[50]; - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - PRInt32 sid = nsCSSKeywords::LookupName(cbuf); - if (sid >= 0) { - PRInt32 ix = SearchKeywordTable(sid, aTable); - if (ix >= 0) { - aDeclaration->AddValue(aName, nsCSSValue(aTable[ix+1], eCSSUnit_Enumerated)); - return PR_TRUE; - } - } - } - if (((aVariants & VARIANT_LENGTH) != 0) && tk->isDimension()) { - return TranslateLength(aDeclaration, aName, tk->mNumber, tk->mIdent); - } - if (((aVariants & VARIANT_PERCENT) != 0) && - (eCSSToken_Percentage == tk->mType)) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Percent)); - return PR_TRUE; - } - if (((aVariants & VARIANT_NUMBER) != 0) && - (eCSSToken_Number == tk->mType)) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Number)); - return PR_TRUE; - } - if (((aVariants & VARIANT_INTEGER) != 0) && - (eCSSToken_Number == tk->mType) && tk->mIntegerValid) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mInteger, eCSSUnit_Absolute)); - return PR_TRUE; - } - if (((aVariants & VARIANT_URL) != 0) && - (eCSSToken_URL == tk->mType)) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mIdent)); - return PR_TRUE; - } - if ((aVariants & VARIANT_COLOR) != 0) { - if ((eCSSToken_ID == tk->mType) || (eCSSToken_Ident == tk->mType)) { - // Put token back so that parse color can get it - UngetToken(); - nscolor rgba; - // XXX This loses the original input format (e.g. a name which - // should be preserved when editing) - if (ParseColor(aErrorCode, &rgba)) { - aDeclaration->AddValue(aName, nsCSSValue(rgba)); - return PR_TRUE; - } - return PR_FALSE; - } - } - UngetToken(); - return PR_FALSE; -} - -PRInt32 CSSParserImpl::ParseChoice(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aNumNames) -{ - PRInt32 found = 0; - for (int i = 0; i < aNumNames; i++) { - // Try each property parser in order - for (int j = 0; j < aNumNames; j++) { - PRInt32 bit = 1 << j; - if ((found & bit) == 0) { - PRInt32 id = nsCSSProps::LookupName(aNames[j]); - if (ParseProperty(aErrorCode, aNames[j], aDeclaration, id)) { - found |= bit; - } - } - } - } - return found; -} - -/** - * Parse a "box" property. Box properties have 1 to 4 values. When less - * than 4 values are provided a standard mapping is used to replicate - * existing values. Note that the replication requires renaming the - * values. - */ -PRBool CSSParserImpl::ParseBoxProperties(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aNames[]) -{ - // Get up to four values for the property - PRInt32 count = 0; - for (int i = 0; i < 4; i++) { - PRInt32 id = nsCSSProps::LookupName(aNames[i]); - if (!ParseProperty(aErrorCode, aNames[i], aDeclaration, id)) { - break; - } - count++; - } - if (count == 0) { - return PR_FALSE; - } - - // Provide missing values by replicating some of the values found - nsCSSValue value; - switch (count) { - case 1: // Make right == top - aDeclaration->GetValue(aNames[0], value); - aDeclaration->AddValue(aNames[1], value); - case 2: // Make bottom == top - aDeclaration->GetValue(aNames[0], value); - aDeclaration->AddValue(aNames[2], value); - case 3: // Make left == right - aDeclaration->GetValue(aNames[1], value); - aDeclaration->AddValue(aNames[3], value); - } - - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseProperty(PRInt32* aErrorCode, - const char* aName, - nsICSSDeclaration* aDeclaration) -{ - PRInt32 id = nsCSSProps::LookupName(aName); - if (id < 0) { - return PR_FALSE; - } - - // Strip out properties we use internally. These properties are used - // by compound property parsing routines (e.g. "background-position"). - switch (id) { - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - case PROP_CLIP_RIGHT: - case PROP_CLIP_TOP: - // The user can't use these - return PR_FALSE; - } - - return ParseProperty(aErrorCode, aName, aDeclaration, id); -} - -PRBool CSSParserImpl::ParseProperty(PRInt32* aErrorCode, - const char* aName, - nsICSSDeclaration* aDeclaration, - PRInt32 aID) -{ - switch (aID) { - case PROP_BACKGROUND: - return ParseBackground(aErrorCode, aDeclaration); - case PROP_BACKGROUND_ATTACHMENT: - return ParseEnum(aErrorCode, aDeclaration, aName, kBackgroundAttachmentKTable); - case PROP_BACKGROUND_COLOR: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_CK, - kBackgroundColorKTable); - case PROP_BACKGROUND_FILTER: - return ParseBackgroundFilter(aErrorCode, aDeclaration, aName); - case PROP_BACKGROUND_IMAGE: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_UK, - kBackgroundImageKTable); - case PROP_BACKGROUND_POSITION: - return ParseBackgroundPosition(aErrorCode, aDeclaration, aName); - case PROP_BACKGROUND_REPEAT: - return ParseEnum(aErrorCode, aDeclaration, aName, kBackgroundRepeatKTable); - case PROP_BORDER: - return ParseBorder(aErrorCode, aDeclaration); - case PROP_BORDER_COLOR: - return ParseBorderColor(aErrorCode, aDeclaration); - case PROP_BORDER_STYLE: - return ParseBorderStyle(aErrorCode, aDeclaration); - case PROP_BORDER_BOTTOM: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderBottomNames, 0); - case PROP_BORDER_LEFT: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderLeftNames, 1); - case PROP_BORDER_RIGHT: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderRightNames, 2); - case PROP_BORDER_TOP: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderTopNames, 3); - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_TOP_COLOR: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_C, nsnull); - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_TOP_STYLE: - return ParseEnum(aErrorCode, aDeclaration, aName, kBorderStyleKTable); - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_TOP_WIDTH: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KL, - kBorderWidthKTable); - case PROP_BORDER_WIDTH: - return ParseBorderWidth(aErrorCode, aDeclaration); - case PROP_CLEAR: - return ParseEnum(aErrorCode, aDeclaration, aName, kClearKTable); - case PROP_CLIP: - return ParseClip(aErrorCode, aDeclaration); - case PROP_COLOR: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_COLOR, nsnull); - case PROP_CURSOR: - return ParseEnum(aErrorCode, aDeclaration, aName, kCursorKTable); - case PROP_DIRECTION: - return ParseEnum(aErrorCode, aDeclaration, aName, kDirectionKTable); - case PROP_DISPLAY: - return ParseEnum(aErrorCode, aDeclaration, aName, kDisplayKTable); - case PROP_FILTER: - return ParseForegroundFilter(aErrorCode, aDeclaration, aName); - case PROP_FLOAT: - return ParseEnum(aErrorCode, aDeclaration, aName, kFloatKTable); - case PROP_FONT: - return ParseFont(aErrorCode, aDeclaration, aName); - case PROP_FONT_FAMILY: - return ParseFontFamily(aErrorCode, aDeclaration, aName); - case PROP_FONT_SIZE: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, - kFontSizeKTable); - case PROP_FONT_STYLE: - return ParseEnum(aErrorCode, aDeclaration, aName, kFontStyleKTable); - case PROP_FONT_VARIANT: - return ParseEnum(aErrorCode, aDeclaration, aName, kFontVariantKTable); - case PROP_FONT_WEIGHT: - return ParseFontWeight(aErrorCode, aDeclaration, aName); - case PROP_HEIGHT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kHeightKTable); - case PROP_LEFT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kLeftKTable); - case PROP_LINE_HEIGHT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLPN, - kLineHeightKTable); - case PROP_LIST_STYLE: - return ParseListStyle(aErrorCode, aDeclaration); - case PROP_LIST_STYLE_IMAGE: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_UK, - kListStyleImageKTable); - case PROP_LIST_STYLE_POSITION: - return ParseEnum(aErrorCode, aDeclaration, aName, kListStylePositionKTable); - case PROP_LIST_STYLE_TYPE: - return ParseEnum(aErrorCode, aDeclaration, aName, kListStyleKTable); - case PROP_MARGIN: - return ParseMargin(aErrorCode, aDeclaration); - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_TOP: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, - kMarginSizeKTable); - case PROP_PADDING: - return ParsePadding(aErrorCode, aDeclaration); - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - case PROP_PADDING_RIGHT: - case PROP_PADDING_TOP: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_LP, nsnull); - case PROP_OVERFLOW: - return ParseEnum(aErrorCode, aDeclaration, aName, kOverflowKTable); - case PROP_POSITION: - return ParseEnum(aErrorCode, aDeclaration, aName, kPositionKTable); - case PROP_TEXT_ALIGN: - return ParseEnum(aErrorCode, aDeclaration, aName, kTextAlignKTable); - case PROP_TEXT_DECORATION: - return ParseTextDecoration(aErrorCode, aDeclaration, aName); - case PROP_TEXT_INDENT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_LP, nsnull); - case PROP_TEXT_TRANSFORM: - return ParseEnum(aErrorCode, aDeclaration, aName, kTextTransformKTable); - case PROP_TOP: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kTopKTable); - case PROP_VERTICAL_ALIGN: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KP, - kVerticalAlignKTable); - case PROP_VISIBILITY: - return ParseEnum(aErrorCode, aDeclaration, aName, kVisibilityKTable); - case PROP_WHITE_SPACE: - return ParseEnum(aErrorCode, aDeclaration, aName, kWhitespaceKTable); - case PROP_WIDTH: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kWidthKTable); - case PROP_LETTER_SPACING: - case PROP_WORD_SPACING: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KL, kSpacingKTable); - case PROP_Z_INDEX: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KI, kZIndexKTable); - } - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseBackground(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBackgroundNames[] = { - "background-color", - "background-image", - "background-repeat", - "background-attachment", - "background-position", - "background-filter", - }; - - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, kBackgroundNames, 6); - if (0 == found) { - return PR_FALSE; - } - - // Provide missing values - if ((found & 1) == 0) { - aDeclaration->AddValue(kBackgroundNames[0], - nsCSSValue(NS_STYLE_BG_COLOR_TRANSPARENT, - eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - aDeclaration->AddValue(kBackgroundNames[1], - nsCSSValue(NS_STYLE_BG_IMAGE_NONE, - eCSSUnit_Enumerated)); - } - if ((found & 4) == 0) { - aDeclaration->AddValue(kBackgroundNames[2], - nsCSSValue(NS_STYLE_BG_REPEAT_XY, - eCSSUnit_Enumerated)); - } - if ((found & 8) == 0) { - aDeclaration->AddValue(kBackgroundNames[3], - nsCSSValue(NS_STYLE_BG_ATTACHMENT_SCROLL, - eCSSUnit_Enumerated)); - } - if ((found & 16) == 0) { - aDeclaration->AddValue("background-x-position", nsCSSValue(0.0f, eCSSUnit_Percent)); - aDeclaration->AddValue("background-y-position", nsCSSValue(0.0f, eCSSUnit_Percent)); - } - - // XXX Note: no default for filter (yet) - return PR_TRUE; -} - -// Bits used in determining which background position info we have -#define BG_CENTER 0 -#define BG_TOP 1 -#define BG_BOTTOM 2 -#define BG_LEFT 4 -#define BG_RIGHT 8 -#define BG_CENTER1 16 -#define BG_CENTER2 32 - -PRBool CSSParserImpl::ParseBackgroundPosition(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static PRInt32 kBackgroundPositionNames[] = { - PROP_BACKGROUND_X_POSITION, - PROP_BACKGROUND_Y_POSITION, - }; - - // Note: Don't change this table unless you update - // parseBackgroundPosition! - - static PRInt32 kBackgroundXYPositionKTable[] = { - KEYWORD_CENTER, BG_CENTER, - KEYWORD_TOP, BG_TOP, - KEYWORD_BOTTOM, BG_BOTTOM, - KEYWORD_LEFT, BG_LEFT, - KEYWORD_RIGHT, BG_RIGHT, - -1, - }; - - const char* bxp = "background-x-position"; - const char* byp = "background-y-position"; - - // First try a number or a length value - if (ParseVariant(aErrorCode, aDeclaration, bxp, VARIANT_LP, nsnull)) { - // We have one number/length. Get the optional second number/length. - if (ParseVariant(aErrorCode, aDeclaration, byp, VARIANT_LP, nsnull)) { - // We have two numbers - return PR_TRUE; - } - - // We have one number which is the x position. Create an value for - // the vertical position which is of value 50% - aDeclaration->AddValue(byp, nsCSSValue(0.5f, eCSSUnit_Percent)); - // XXX shouldn't this be CENTER enum instead? - return PR_TRUE; - } - - // Now try keywords. We do this manually to allow for the first - // appearance of "center" to apply to the either the x or y - // position (it's ambiguous so we have to disambiguate). Each - // allowed keyword value is assigned it's own bit. We don't allow - // any duplicate keywords other than center. We try to get two - // keywords but it's okay if there is only one. - PRInt32 mask = 0; - PRInt32 centerBit = BG_CENTER1; - for (PRInt32 i = 0; i < 2; i++) { - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - break; - } - char cbuf[50]; - ident->ToCString(cbuf, sizeof(cbuf)); - PRInt32 ix = SearchKeywordTable(nsCSSKeywords::LookupName(cbuf), - kBackgroundXYPositionKTable); - if (ix >= 0) { - PRInt32 bit = kBackgroundXYPositionKTable[ix + 1]; - if (bit == 0) { - // Special hack for center bits: We can have two of them - mask |= centerBit; - centerBit <<= 1; - continue; - } else if ((mask & bit) != 0) { - // no duplicate values allowed (other than center) - return PR_FALSE; - } - mask |= bit; - } else { - UngetToken(); - break; - } - } - - // Check for bad input. Bad input consists of no matching keywords, - // or pairs of x keywords or pairs of y keywords. - if ((mask == 0) || (mask == (BG_TOP | BG_BOTTOM)) || - (mask == (BG_LEFT | BG_RIGHT))) { - return PR_FALSE; - } - - // Map good input - int xValue = 50; - if ((mask & (BG_LEFT | BG_RIGHT)) != 0) { - // We have an x value - xValue = ((mask & BG_LEFT) != 0) ? 0 : 100; - } - int yValue = 50; - if ((mask & (BG_TOP | BG_BOTTOM)) != 0) { - // We have a y value - yValue = ((mask & BG_TOP) != 0) ? 0 : 100; - } - - // Create style values - aDeclaration->AddValue(bxp, nsCSSValue(xValue, eCSSUnit_Enumerated)); - aDeclaration->AddValue(byp, nsCSSValue(yValue, eCSSUnit_Enumerated)); - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseBackgroundFilter(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - // XXX not yet supported - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseForegroundFilter(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - // XXX not yet supported - return PR_FALSE; -} - -// These must be in alphabetical order for aWhich based indexing to work -static const char* kBorderStyleNames[] = { - "border-bottom-style", - "border-left-style", - "border-right-style", - "border-top-style", -}; -static const char* kBorderWidthNames[] = { - "border-bottom-width", - "border-left-width", - "border-right-width", - "border-top-width", -}; - - -PRBool CSSParserImpl::ParseBorder(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBorderNames[] = { - "border-width", - "border-style", - "border-color" - }; - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, kBorderNames, 3); - if (0 == found) { - return PR_FALSE; - } - if (0 == (found & 1)) { - // provide missing border width's - for (int i = 0; i < 4; i++) { - aDeclaration->AddValue(kBorderWidthNames[i], - nsCSSValue(NS_STYLE_BORDER_WIDTH_MEDIUM, - eCSSUnit_Enumerated)); - } - } - if (0 == (found & 2)) { - // provide missing border style's - for (int i = 0; i < 4; i++) { - aDeclaration->AddValue(kBorderStyleNames[i], - nsCSSValue(NS_STYLE_BORDER_STYLE_NONE, - eCSSUnit_Enumerated)); - } - } - - // Do NOT provide a missing color value as the default is to be - // the color of the element itself which must be determined later. - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseBorderColor(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxBorderColorNames[] = { - "border-top-color", - "border-right-color", - "border-bottom-color", - "border-left-color", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxBorderColorNames); -} - -PRBool CSSParserImpl::ParseBorderSide(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aWhich) -{ - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, aNames, 3); - if (found == 0) return PR_FALSE; - if ((found & 1) == 0) { - // Provide default border-width - aDeclaration->AddValue(kBorderWidthNames[aWhich], - nsCSSValue(NS_STYLE_BORDER_WIDTH_MEDIUM, eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - // Provide default border-style - aDeclaration->AddValue(kBorderStyleNames[aWhich], - nsCSSValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated)); - } - - // Do NOT provide a missing color value as the default is to be - // the color of the element itself which must be determined later. - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseBorderStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - // in top, right, bottom, left order - static const char* kBoxBorderStyleNames[] = { - "border-top-style", - "border-right-style", - "border-bottom-style", - "border-left-style", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxBorderStyleNames); -} - -PRBool CSSParserImpl::ParseBorderWidth(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxBorderWidthNames[] = { - "border-top-width", - "border-right-width", - "border-bottom-width", - "border-left-width", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxBorderWidthNames); -} - -PRBool CSSParserImpl::ParseClip(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kClipNames[] = { - "clip-top", - "clip-right", - "clip-bottom", - "clip-left", - }; - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - return PR_FALSE; - } - if (ident->EqualsIgnoreCase("auto")) { - for (int i = 0; i < 4; i++) { - aDeclaration->AddValue(kClipNames[i], - nsCSSValue(NS_STYLE_CLIP_AUTO, eCSSUnit_Enumerated)); - } - return PR_TRUE; - } else if (ident->EqualsIgnoreCase("rect")) { - if (!ExpectSymbol(aErrorCode, '(', PR_TRUE)) { - return PR_FALSE; - } - for (int i = 0; i < 4; i++) { - if (!ParseVariant(aErrorCode, aDeclaration, kClipNames[i], VARIANT_KL, - kClipKTable)) { - return PR_FALSE; - } - if (3 != i) { - // skip optional commas between elements - ExpectSymbol(aErrorCode, ',', PR_TRUE); - } - } - if (!ExpectSymbol(aErrorCode, ')', PR_TRUE)) { - return PR_FALSE; - } - return PR_TRUE; - } else { - UngetToken(); - } - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseFont(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static const char* fontNames[] = { - "font-style", - "font-variant", - "font-weight", - }; - - // Get optional font-style, font-variant and font-weight (in any order) - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, fontNames, 3); - if ((found & 1) == 0) { - // Provide default font-style - aDeclaration->AddValue(fontNames[0], - nsCSSValue(NS_STYLE_FONT_STYLE_NORMAL, eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - // Provide default font-variant - aDeclaration->AddValue(fontNames[1], - nsCSSValue(NS_STYLE_FONT_VARIANT_NORMAL, eCSSUnit_Enumerated)); - } - if ((found & 4) == 0) { - // Provide default font-weight - aDeclaration->AddValue(fontNames[2], - nsCSSValue(NS_STYLE_FONT_WEIGHT_NORMAL, eCSSUnit_Enumerated)); - } - - // Get mandatory font-size - if (!ParseVariant(aErrorCode, aDeclaration, "font-size", - VARIANT_KLP, kFontSizeKTable)) { - return PR_FALSE; - } - - // Get optional "/" line-height - if (ExpectSymbol(aErrorCode, '/', PR_TRUE)) { - if (!ParseVariant(aErrorCode, aDeclaration, "line-height", - VARIANT_KLPN, kLineHeightKTable)) { - return PR_FALSE; - } - } - - // Get final mandatory font-family - return ParseFontFamily(aErrorCode, aDeclaration, "font-family"); -} - -PRBool CSSParserImpl::ParseFontFamily(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName) -{ - nsCSSToken* tk = &mToken; - nsAutoString family; - PRBool firstOne = PR_TRUE; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Ident == tk->mType) { - if (!firstOne) { - family.Append(PRUnichar(',')); - } - family.Append(PRUnichar('"')); - family.Append(tk->mIdent); - for (;;) { - if (!GetToken(aErrorCode, PR_FALSE)) { - break; - } - if (eCSSToken_Ident == tk->mType) { - family.Append(tk->mIdent); - } else if (eCSSToken_WhiteSpace == tk->mType) { - // Lookahead one token and drop whitespace if we ending the - // font name. - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Ident != tk->mType) { - UngetToken(); - break; - } - UngetToken(); - family.Append(PRUnichar(' ')); - } else { - UngetToken(); - break; - } - } - family.Append(PRUnichar('"')); - firstOne = PR_FALSE; - } else if (eCSSToken_String == tk->mType) { - if (!firstOne) { - family.Append(PRUnichar(',')); - } - family.Append(PRUnichar('"')); - family.Append(tk->mIdent); - family.Append(PRUnichar('"')); - firstOne = PR_FALSE; - } else if (eCSSToken_Symbol == tk->mType) { - if (',' != tk->mSymbol) { - UngetToken(); - break; - } - } else { - UngetToken(); - break; - } - } - if (family.Length() == 0) { - return PR_FALSE; - } - aDeclaration->AddValue(aName, nsCSSValue(family)); - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseFontWeight(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static PRInt32 kFontWeightKTable[] = { - KEYWORD_NORMAL, NS_STYLE_FONT_WEIGHT_NORMAL, - KEYWORD_BOLD, NS_STYLE_FONT_WEIGHT_BOLD, - KEYWORD_BOLDER, NS_STYLE_FONT_WEIGHT_BOLDER, - KEYWORD_LIGHTER, NS_STYLE_FONT_WEIGHT_LIGHTER, - -1, - }; - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Ident == tk->mType) { - char cbuf[50]; - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - PRInt32 kid = nsCSSKeywords::LookupName(cbuf); - PRInt32 ix = SearchKeywordTable(kid, kFontWeightKTable); - if (ix < 0) { - UngetToken(); - return PR_FALSE; - } - aDeclaration->AddValue(aName, nsCSSValue(kFontWeightKTable[ix+1], eCSSUnit_Enumerated)); - } else if (eCSSToken_Number == tk->mType) { - PRInt32 v = (PRInt32) tk->mNumber; - if (v < 100) v = 100; - else if (v > 900) v = 900; - v = v - (v % 100); - aDeclaration->AddValue(aName, nsCSSValue(v, eCSSUnit_Absolute)); - } else { - UngetToken(); - return PR_FALSE; - } - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseListStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - const char* lst = "list-style-type"; - const char* lsp = "list-style-position"; - const char* lsi = "list-style-image"; - int found = 0; - for (int i = 0; i < 3; i++) { - if (((found & 1) == 0) && - ParseEnum(aErrorCode, aDeclaration, lst, kListStyleKTable)) { - found |= 1; - continue; - } - if (((found & 2) == 0) && - ParseEnum(aErrorCode, aDeclaration, lsp, kListStylePositionKTable)) { - found |= 2; - continue; - } - if ((found & 4) == 0) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_URL == mToken.mType) { - aDeclaration->AddValue(lsi, nsCSSValue(mToken.mIdent)); - found |= 4; - continue; - } else { - if (eCSSToken_Symbol == mToken.mType) { - PRUnichar symbol = mToken.mSymbol; - if ((';' == symbol) || ('}' == symbol)) { - UngetToken(); - break; - } - } - - // We got something strange. That's an error. - UngetToken(); - return PR_FALSE; - } - } - } - if (found == 0) { - return PR_FALSE; - } - - // Provide default values - if ((found & 1) == 0) { - aDeclaration->AddValue(lst, nsCSSValue(NS_STYLE_LIST_STYLE_DISC, eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - aDeclaration->AddValue(lsp, nsCSSValue(NS_STYLE_LIST_STYLE_POSITION_OUTSIDE, eCSSUnit_Enumerated)); - } - if ((found & 4) == 0) { - aDeclaration->AddValue(lsi, nsCSSValue(NS_STYLE_LIST_STYLE_IMAGE_NONE, eCSSUnit_Enumerated)); - } - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseMargin(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxMarginSideNames[] = { - "margin-top", - "margin-right", - "margin-bottom", - "margin-left", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxMarginSideNames); -} - -PRBool CSSParserImpl::ParsePadding(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxPaddingSideNames[] = { - "padding-top", - "padding-right", - "padding-bottom", - "padding-left", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxPaddingSideNames); -} - -PRBool CSSParserImpl::ParseTextDecoration(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static PRInt32 kTextDecorationNoneKTable[] = { - KEYWORD_NONE, NS_STYLE_TEXT_DECORATION_NONE, - -1 - }; - static PRInt32 kTextDecorationKTable[] = { - KEYWORD_UNDERLINE, NS_STYLE_TEXT_DECORATION_UNDERLINE, - KEYWORD_OVERLINE, NS_STYLE_TEXT_DECORATION_OVERLINE, - KEYWORD_LINE_THROUGH, NS_STYLE_TEXT_DECORATION_LINE_THROUGH, - KEYWORD_BLINK, NS_STYLE_TEXT_DECORATION_BLINK, - -1, - }; - - if (ParseEnum(aErrorCode, aDeclaration, aName, kTextDecorationNoneKTable)) { - return PR_TRUE; - } - - PRInt32 decoration = 0; - for (int i = 0; i < 4; i++) { - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - break; - } - char cbuf[50]; - ident->ToCString(cbuf, sizeof(cbuf)); - PRInt32 id = nsCSSKeywords::LookupName(cbuf); - PRInt32 ix = SearchKeywordTable(id, kTextDecorationKTable); - if (ix < 0) { - UngetToken(); - break; - } - decoration |= kTextDecorationKTable[ix+1]; - } - if (0 == decoration) { - return PR_FALSE; - } - aDeclaration->AddValue(aName, nsCSSValue(decoration, eCSSUnit_Absolute)); - return PR_TRUE; -} diff --git a/mozilla/layout/html/style/src/nsCSSPropIDs.h b/mozilla/layout/html/style/src/nsCSSPropIDs.h deleted file mode 100644 index 1e3fd061ec4..00000000000 --- a/mozilla/layout/html/style/src/nsCSSPropIDs.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Do not edit - generated by genhash.pl */ -#define PROP_BACKGROUND 0 -#define PROP_BACKGROUND_ATTACHMENT 1 -#define PROP_BACKGROUND_COLOR 2 -#define PROP_BACKGROUND_FILTER 3 -#define PROP_BACKGROUND_IMAGE 4 -#define PROP_BACKGROUND_POSITION 5 -#define PROP_BACKGROUND_X_POSITION 6 -#define PROP_BACKGROUND_Y_POSITION 7 -#define PROP_BACKGROUND_REPEAT 8 -#define PROP_BORDER 9 -#define PROP_BORDER_BOTTOM 10 -#define PROP_BORDER_BOTTOM_COLOR 11 -#define PROP_BORDER_BOTTOM_STYLE 12 -#define PROP_BORDER_BOTTOM_WIDTH 13 -#define PROP_BORDER_COLOR 14 -#define PROP_BORDER_LEFT 15 -#define PROP_BORDER_LEFT_COLOR 16 -#define PROP_BORDER_LEFT_STYLE 17 -#define PROP_BORDER_LEFT_WIDTH 18 -#define PROP_BORDER_RIGHT 19 -#define PROP_BORDER_RIGHT_COLOR 20 -#define PROP_BORDER_RIGHT_STYLE 21 -#define PROP_BORDER_RIGHT_WIDTH 22 -#define PROP_BORDER_STYLE 23 -#define PROP_BORDER_TOP 24 -#define PROP_BORDER_TOP_COLOR 25 -#define PROP_BORDER_TOP_STYLE 26 -#define PROP_BORDER_TOP_WIDTH 27 -#define PROP_BORDER_WIDTH 28 -#define PROP_CLEAR 29 -#define PROP_CLIP 30 -#define PROP_CLIP_BOTTOM 31 -#define PROP_CLIP_LEFT 32 -#define PROP_CLIP_RIGHT 33 -#define PROP_CLIP_TOP 34 -#define PROP_COLOR 35 -#define PROP_CURSOR 36 -#define PROP_CURSOR_IMAGE 37 -#define PROP_DIRECTION 38 -#define PROP_DISPLAY 39 -#define PROP_FILTER 40 -#define PROP_FLOAT 41 -#define PROP_FONT 42 -#define PROP_FONT_FAMILY 43 -#define PROP_FONT_SIZE 44 -#define PROP_FONT_STYLE 45 -#define PROP_FONT_VARIANT 46 -#define PROP_FONT_WEIGHT 47 -#define PROP_HEIGHT 48 -#define PROP_LEFT 49 -#define PROP_LETTER_SPACING 50 -#define PROP_LINE_HEIGHT 51 -#define PROP_LIST_STYLE 52 -#define PROP_LIST_STYLE_IMAGE 53 -#define PROP_LIST_STYLE_POSITION 54 -#define PROP_LIST_STYLE_TYPE 55 -#define PROP_MARGIN 56 -#define PROP_MARGIN_BOTTOM 57 -#define PROP_MARGIN_LEFT 58 -#define PROP_MARGIN_RIGHT 59 -#define PROP_MARGIN_TOP 60 -#define PROP_OVERFLOW 61 -#define PROP_PADDING 62 -#define PROP_PADDING_BOTTOM 63 -#define PROP_PADDING_LEFT 64 -#define PROP_PADDING_RIGHT 65 -#define PROP_PADDING_TOP 66 -#define PROP_POSITION 67 -#define PROP_TEXT_ALIGN 68 -#define PROP_TEXT_DECORATION 69 -#define PROP_TEXT_INDENT 70 -#define PROP_TEXT_TRANSFORM 71 -#define PROP_TOP 72 -#define PROP_VERTICAL_ALIGN 73 -#define PROP_VISIBILITY 74 -#define PROP_WHITE_SPACE 75 -#define PROP_WIDTH 76 -#define PROP_WORD_SPACING 77 -#define PROP_Z_INDEX 78 -#define PROP_MAX 79 diff --git a/mozilla/layout/html/style/src/nsCSSProps.cpp b/mozilla/layout/html/style/src/nsCSSProps.cpp deleted file mode 100644 index 1363ffd53de..00000000000 --- a/mozilla/layout/html/style/src/nsCSSProps.cpp +++ /dev/null @@ -1,360 +0,0 @@ - -/* -** This is a generated file, do not edit it. This file is created by -** genhash.pl -*/ - -#include "plstr.h" -#include "nsCSSProps.h" -#define TOTAL_KEYWORDS 79 -#define MIN_WORD_LENGTH 3 -#define MAX_WORD_LENGTH 21 -#define MIN_HASH_VALUE 6 -#define MAX_HASH_VALUE 238 -/* maximum key range = 233, duplicates = 0 */ - - -struct StaticNameTable { - char* tag; - PRInt32 id; -}; - -static const unsigned char kLowerLookup[256] = { - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64, - 97,98,99,100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -#define MYLOWER(x) kLowerLookup[((x) & 0x7f)] - -/** - * Map a name to an ID or -1 - */ -PRInt32 nsCSSProps::LookupName(const char* str) -{ - static unsigned char asso_values[] = - { - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 35, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 45, 0, 85, - 80, 25, 5, 0, 80, 0, 239, 239, 25, 90, - 0, 0, 5, 239, 0, 65, 40, 35, 0, 80, - 10, 15, 5, 239, 239, 239, 239, 239, - }; - static unsigned char lengthtable[] = - { - 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 6, 12, 8, - 0, 10, 0, 0, 0, 19, 0, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, - 0, 0, 19, 0, 0, 0, 3, 4, 0, 11, 17, 0, 0, 0, - 0, 7, 18, 0, 0, 0, 12, 0, 14, 0, 11, 17, 0, 19, - 0, 0, 0, 0, 0, 5, 21, 17, 0, 0, 0, 21, 7, 18, - 0, 0, 16, 0, 0, 0, 5, 0, 12, 0, 4, 0, 0, 12, - 0, 19, 0, 16, 17, 13, 9, 10, 16, 0, 0, 0, 0, 0, - 0, 8, 19, 5, 11, 0, 0, 4, 10, 0, 0, 0, 14, 10, - 6, 0, 0, 9, 0, 16, 17, 0, 0, 10, 11, 0, 18, 0, - 0, 6, 12, 0, 0, 0, 16, 7, 0, 0, 10, 21, 0, 0, - 0, 0, 11, 12, 0, 0, 10, 0, 0, 8, 0, 5, 0, 0, - 0, 0, 15, 0, 12, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 12, 13, 9, 0, 11, 0, 0, 0, 0, 6, 0, 0, 14, 0, - 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 12, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, - 13, - }; - static struct StaticNameTable wordlist[] = - { - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"border", 9}, - {"",}, {"",}, {"",}, {"",}, - {"filter", 40}, - {"border-color", 14}, - {"position", 67}, - {"",}, - {"border-top", 24}, - {"",}, {"",}, {"",}, - {"border-bottom-color", 11}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"visibility", 74}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, - {"font-family", 43}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"border-bottom-style", 12}, - {"",}, {"",}, {"",}, - {"top", 72}, - {"font", 42}, - {"",}, - {"border-left", 15}, - {"border-left-color", 16}, - {"",}, {"",}, {"",}, {"",}, - {"padding", 62}, - {"border-right-color", 20}, - {"",}, {"",}, {"",}, - {"border-style", 23}, - {"",}, - {"letter-spacing", 50}, - {"",}, - {"padding-top", 66}, - {"background-filter", 3}, - {"",}, - {"background-position", 5}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"float", 41}, - {"background-x-position", 6}, - {"border-left-style", 17}, - {"",}, {"",}, {"",}, - {"background-y-position", 7}, - {"z-index", 78}, - {"border-right-style", 21}, - {"",}, {"",}, - {"background-image", 4}, - {"",}, {"",}, {"",}, - {"color", 35}, - {"",}, - {"border-right", 19}, - {"",}, - {"left", 49}, - {"",}, {"",}, - {"font-variant", 46}, - {"",}, - {"border-bottom-width", 13}, - {"",}, - {"border-top-color", 25}, - {"background-repeat", 8}, - {"border-bottom", 10}, - {"font-size", 44}, - {"font-style", 45}, - {"border-top-style", 26}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"overflow", 61}, - {"list-style-position", 54}, - {"clear", 29}, - {"text-indent", 70}, - {"",}, {"",}, - {"clip", 30}, - {"text-align", 68}, - {"",}, {"",}, {"",}, - {"vertical-align", 73}, - {"list-style", 52}, - {"cursor", 36}, - {"",}, {"",}, - {"direction", 38}, - {"",}, - {"list-style-image", 53}, - {"border-left-width", 18}, - {"",}, {"",}, - {"background", 0}, - {"font-weight", 47}, - {"",}, - {"border-right-width", 22}, - {"",}, {"",}, - {"margin", 56}, - {"padding-left", 64}, - {"",}, {"",}, {"",}, - {"background-color", 2}, - {"display", 39}, - {"",}, {"",}, - {"margin-top", 60}, - {"background-attachment", 1}, - {"",}, {"",}, {"",}, {"",}, - {"line-height", 51}, - {"word-spacing", 77}, - {"",}, {"",}, - {"clip-right", 33}, - {"",}, {"",}, - {"clip-top", 34}, - {"",}, - {"width", 76}, - {"",}, {"",}, {"",}, {"",}, - {"list-style-type", 55}, - {"",}, - {"border-width", 28}, - {"",}, {"",}, {"",}, - {"border-top-width", 27}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"cursor-image", 37}, - {"padding-right", 65}, - {"clip-left", 32}, - {"",}, - {"margin-left", 58}, - {"",}, {"",}, {"",}, {"",}, - {"height", 48}, - {"",}, {"",}, - {"padding-bottom", 63}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"text-decoration", 69}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"text-transform", 71}, - {"",}, - {"clip-bottom", 31}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"margin-right", 59}, - {"",}, {"",}, {"",}, - {"white-space", 75}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"margin-bottom", 57}, - }; - - if (str != NULL) { - int len = PL_strlen(str); - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int hval = len; - - switch (hval) - { - default: - case 12: - hval += asso_values[MYLOWER(str[11])]; - case 11: - case 10: - case 9: - case 8: - case 7: - case 6: - hval += asso_values[MYLOWER(str[5])]; - case 5: - case 4: - case 3: - case 2: - hval += asso_values[MYLOWER(str[1])]; - case 1: - hval += asso_values[MYLOWER(str[0])]; - break; - } - hval += asso_values[MYLOWER(str[len - 1])]; - if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) { - if (len == lengthtable[hval]) { - register const char *tag = wordlist[hval].tag; - - /* - ** While not at the end of the string, if they ever differ - ** they are not equal. We know "tag" is already lower case. - */ - while ((*tag != '\0')&&(*str != '\0')) { - if (*tag != (char) MYLOWER(*str)) { - return -1; - } - tag++; - str++; - } - - /* - ** One of the strings has ended, if they are both ended, then they - ** are equal, otherwise not. - */ - if ((*tag == '\0')&&(*str == '\0')) { - return wordlist[hval].id; - } - } - } - } - } - return -1; -} - -const nsCSSProps::NameTableEntry nsCSSProps::kNameTable[] = { - { "background", 0 }, - { "background-attachment", 1 }, - { "background-color", 2 }, - { "background-filter", 3 }, - { "background-image", 4 }, - { "background-position", 5 }, - { "background-x-position", 6 }, - { "background-y-position", 7 }, - { "background-repeat", 8 }, - { "border", 9 }, - { "border-bottom", 10 }, - { "border-bottom-color", 11 }, - { "border-bottom-style", 12 }, - { "border-bottom-width", 13 }, - { "border-color", 14 }, - { "border-left", 15 }, - { "border-left-color", 16 }, - { "border-left-style", 17 }, - { "border-left-width", 18 }, - { "border-right", 19 }, - { "border-right-color", 20 }, - { "border-right-style", 21 }, - { "border-right-width", 22 }, - { "border-style", 23 }, - { "border-top", 24 }, - { "border-top-color", 25 }, - { "border-top-style", 26 }, - { "border-top-width", 27 }, - { "border-width", 28 }, - { "clear", 29 }, - { "clip", 30 }, - { "clip-bottom", 31 }, - { "clip-left", 32 }, - { "clip-right", 33 }, - { "clip-top", 34 }, - { "color", 35 }, - { "cursor", 36 }, - { "cursor-image", 37 }, - { "direction", 38 }, - { "display", 39 }, - { "filter", 40 }, - { "float", 41 }, - { "font", 42 }, - { "font-family", 43 }, - { "font-size", 44 }, - { "font-style", 45 }, - { "font-variant", 46 }, - { "font-weight", 47 }, - { "height", 48 }, - { "left", 49 }, - { "letter-spacing", 50 }, - { "line-height", 51 }, - { "list-style", 52 }, - { "list-style-image", 53 }, - { "list-style-position", 54 }, - { "list-style-type", 55 }, - { "margin", 56 }, - { "margin-bottom", 57 }, - { "margin-left", 58 }, - { "margin-right", 59 }, - { "margin-top", 60 }, - { "overflow", 61 }, - { "padding", 62 }, - { "padding-bottom", 63 }, - { "padding-left", 64 }, - { "padding-right", 65 }, - { "padding-top", 66 }, - { "position", 67 }, - { "text-align", 68 }, - { "text-decoration", 69 }, - { "text-indent", 70 }, - { "text-transform", 71 }, - { "top", 72 }, - { "vertical-align", 73 }, - { "visibility", 74 }, - { "white-space", 75 }, - { "width", 76 }, - { "word-spacing", 77 }, - { "z-index", 78 }, -}; diff --git a/mozilla/layout/html/style/src/nsCSSProps.h b/mozilla/layout/html/style/src/nsCSSProps.h deleted file mode 100644 index 29bd8de6945..00000000000 --- a/mozilla/layout/html/style/src/nsCSSProps.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSProps_h___ -#define nsCSSProps_h___ - -#include "nslayout.h" -#include "nsCSSPropIDs.h" - -class NS_LAYOUT nsCSSProps { -public: - // Given a null terminated string of 7 bit characters, return the - // tag id (see nsCSSPropIDs.h) for the tag or -1 if the tag is not - // known. The lookup function uses a perfect hash. - static PRInt32 LookupName(const char* str); - - struct NameTableEntry { - const char* name; - PRInt32 id; - }; - - // A table whose index is the tag id (from nsCSSPropIDs) - static const NameTableEntry kNameTable[]; -}; - -#endif /* nsCSSProps_h___ */ diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp deleted file mode 100644 index 93535dd8ec9..00000000000 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ /dev/null @@ -1,785 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCSSRendering.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIImage.h" -#include "nsIFrame.h" -#include "nsPoint.h" -#include "nsRect.h" -#include "nsIViewManager.h" -#include "nsIPresShell.h" - -#define BORDER_FULL 0 //entire side -#define BORDER_INSIDE 1 //inside half -#define BORDER_OUTSIDE 2 //outside half - -//thickness of dashed line relative to dotted line -#define DOT_LENGTH 1 //square -#define DASH_LENGTH 3 //3 times longer than dot - -/** - * Special method to brighten a Color and have it shift to white when - * fully saturated. - */ -nscolor nsCSSRendering::Brighten(nscolor inColor) -{ - PRIntn r, g, b, max, over; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color increase across the board - r += 25; - g += 25; - b += 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we overflowed on this max color, increase - //other components by the overflow amount - if (max > 255) - { - over = max - 255; - - if (max == r) - { - g += over; - b += over; - } - else if (max == g) - { - r += over; - b += over; - } - else - { - r += over; - g += over; - } - } - - //clamp - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - -/** - * Special method to darken a Color and have it shift to black when - * darkest component underflows - */ -nscolor nsCSSRendering::Darken(nscolor inColor) -{ - PRIntn r, g, b, max; - - r = NS_GET_R(inColor); - g = NS_GET_G(inColor); - b = NS_GET_B(inColor); - - //10% of max color decrease across the board - r -= 25; - g -= 25; - b -= 25; - - //figure out which color is largest - if (r > g) - { - if (b > r) - max = b; - else - max = r; - } - else - { - if (b > g) - max = b; - else - max = g; - } - - //if we underflowed on this max color, decrease - //other components by the underflow amount - if (max < 0) - { - if (max == r) - { - g += max; - b += max; - } - else if (max == g) - { - r += max; - b += max; - } - else - { - r += max; - g += max; - } - } - - //clamp - if (r < 0) - r = 0; - if (g < 0) - g = 0; - if (b < 0) - b = 0; - - return NS_RGBA(r, g, b, NS_GET_A(inColor)); -} - -/** - * Make a bevel color - */ -nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style, - nscolor baseColor) -{ - nscolor theColor = baseColor; - - if ((style == NS_STYLE_BORDER_STYLE_OUTSET) || - (style == NS_STYLE_BORDER_STYLE_RIDGE)) { - // Flip colors for these two border style - switch (whichSide) { - case NS_SIDE_BOTTOM: whichSide = NS_SIDE_TOP; break; - case NS_SIDE_RIGHT: whichSide = NS_SIDE_LEFT; break; - case NS_SIDE_TOP: whichSide = NS_SIDE_BOTTOM; break; - case NS_SIDE_LEFT: whichSide = NS_SIDE_RIGHT; break; - } - } - - switch (whichSide) { - case NS_SIDE_BOTTOM: - theColor = Brighten(Brighten(baseColor)); - break; - case NS_SIDE_RIGHT: - theColor = Brighten(baseColor); - break; - case NS_SIDE_TOP: - theColor = Darken(Darken(baseColor)); - break; - case NS_SIDE_LEFT: - theColor = Darken(baseColor); - break; - } - return theColor; -} - -// Maximum poly points in any of the polygons we generate below -#define MAX_POLY_POINTS 4 - -// a nifty helper function to create a polygon representing a -// particular side of a border. This helps localize code for figuring -// mitered edges. It is mainly used by the solid, inset, and outset -// styles... -PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[], - nsIRenderingContext& aContext, - PRIntn whichSide, - const nsRect& inside, const nsRect& outside, - PRIntn borderPart, float borderFrac) -{ - float borderRest = 1.0f - borderFrac; - - // XXX QQQ We really should decide to do a bevel based on whether there - // is a side adjacent or not. This could let you join borders across - // block elements (paragraphs). - - PRIntn np = 0; - switch (whichSide) { - case NS_SIDE_TOP: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(inside.x, inside.y); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(inside.x, inside.y); - } else { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - } - break; - - case NS_SIDE_LEFT: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(inside.x, inside.y); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(outside.x, outside.YMost()); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(inside.x, inside.y); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - } else { - aPoints[np++].MoveTo(outside.x, outside.y); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - aPoints[np++].MoveTo(outside.x, outside.YMost()); - } - break; - - case NS_SIDE_BOTTOM: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(outside.x, outside.YMost()); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(nscoord(outside.x * borderFrac + - inside.x * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - aPoints[np++].MoveTo(inside.x, inside.YMost()); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - } else { - aPoints[np++].MoveTo(outside.x, outside.YMost()); - aPoints[np++].MoveTo(nscoord(inside.x * borderFrac + - outside.x * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - } - break; - - case NS_SIDE_RIGHT: - if (borderPart == BORDER_FULL) { - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - } else if (borderPart == BORDER_INSIDE) { - aPoints[np++].MoveTo(inside.XMost(), inside.y); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.y * borderFrac + - inside.y * borderRest)); - aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac + - inside.XMost() * borderRest), - nscoord(outside.YMost() * borderFrac + - inside.YMost() * borderRest)); - aPoints[np++].MoveTo(inside.XMost(), inside.YMost()); - } else { - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.y * borderFrac + - outside.y * borderRest)); - aPoints[np++].MoveTo(outside.XMost(), outside.y); - aPoints[np++].MoveTo(outside.XMost(), outside.YMost()); - aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac + - outside.XMost() * borderRest), - nscoord(inside.YMost() * borderFrac + - outside.YMost() * borderRest)); - } - break; - } - return np; -} - -void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, - PRIntn whichSide, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside) -{ - nsPoint theSide[MAX_POLY_POINTS]; - nscolor theColor = borderColors[whichSide]; - PRUint8 theStyle = borderStyles[whichSide]; - PRInt32 np; - switch (theStyle) { - case NS_STYLE_BORDER_STYLE_NONE: - case NS_STYLE_BORDER_STYLE_BLANK: - return; - - case NS_STYLE_BORDER_STYLE_DOTTED: //handled a special case elsewhere - case NS_STYLE_BORDER_STYLE_DASHED: //handled a special case elsewhere - break; // That was easy... - - case NS_STYLE_BORDER_STYLE_GROOVE: - case NS_STYLE_BORDER_STYLE_RIDGE: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_INSIDE, 0.5f); - aContext.SetColor ( MakeBevelColor (whichSide, theStyle, theColor)); - aContext.FillPolygon (theSide, np); - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_OUTSIDE, 0.5f); - aContext.SetColor ( MakeBevelColor (whichSide, - (theStyle == NS_STYLE_BORDER_STYLE_RIDGE) - ? NS_STYLE_BORDER_STYLE_GROOVE - : NS_STYLE_BORDER_STYLE_RIDGE, theColor)); - aContext.FillPolygon (theSide, np); - break; - - case NS_STYLE_BORDER_STYLE_SOLID: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_FULL, 1.0f); - aContext.SetColor (borderColors[whichSide]); - aContext.FillPolygon (theSide, np); - break; - - case NS_STYLE_BORDER_STYLE_DOUBLE: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_INSIDE, 0.333333f); - aContext.SetColor (borderColors[whichSide]); - aContext.FillPolygon (theSide, np); - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_OUTSIDE, 0.333333f); - aContext.FillPolygon (theSide, np); - break; - - case NS_STYLE_BORDER_STYLE_OUTSET: - case NS_STYLE_BORDER_STYLE_INSET: - np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, - BORDER_FULL, 1.0f); - aContext.SetColor ( MakeBevelColor (whichSide, theStyle, theColor)); - aContext.FillPolygon (theSide, np); - break; - } -} - -/** - * Draw a dotted/dashed sides of a box - */ -//XXX dashes which span more than two edges are not handled properly MMP -void nsCSSRendering::DrawDashedSides(PRIntn startSide, - nsIRenderingContext& aContext, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside, - PRIntn aSkipSides) -{ - PRIntn dashLength; - nsRect dashRect, firstRect, currRect; - - PRBool bSolid = PR_TRUE; - float over = 0.0f; - PRUint8 style = borderStyles[startSide]; - PRBool skippedSide = PR_FALSE; - for (PRIntn whichSide = startSide; whichSide < 4; whichSide++) { - PRUint8 prevStyle = style; - style = borderStyles[whichSide]; - if ((1< 0.0f) { - firstRect.x = dashRect.x; - firstRect.width = dashRect.width; - firstRect.height = nscoord(dashRect.height * over); - firstRect.y = dashRect.y + (dashRect.height - firstRect.height); - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.YMost() > borderInside.y) { - //clip if necessary - if (currRect.y < borderInside.y) { - over = float(borderInside.y - dashRect.y) / - float(dashRect.height); - currRect.height = currRect.height - (borderInside.y - currRect.y); - currRect.y = borderInside.y; - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.y = dashRect.y - currRect.height; - currRect = dashRect; - } - break; - - case NS_SIDE_TOP: - //if we are continuing a solid rect, fill in the corner first - if (bSolid) { - aContext.FillRect(borderOutside.x, borderOutside.y, - borderInside.x - borderOutside.x, - borderInside.y - borderOutside.y); - } - - dashRect.height = borderInside.y - borderOutside.y; - dashRect.width = dashRect.height * dashLength; - dashRect.x = borderInside.x; - dashRect.y = borderOutside.y; - - if (over > 0.0f) { - firstRect.x = dashRect.x; - firstRect.y = dashRect.y; - firstRect.width = nscoord(dashRect.width * over); - firstRect.height = dashRect.height; - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.x < borderInside.XMost()) { - //clip if necessary - if (currRect.XMost() > borderInside.XMost()) { - over = float(dashRect.XMost() - borderInside.XMost()) / - float(dashRect.width); - currRect.width = currRect.width - - (currRect.XMost() - borderInside.XMost()); - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.x = dashRect.x + currRect.width; - currRect = dashRect; - } - break; - - case NS_SIDE_RIGHT: - //if we are continuing a solid rect, fill in the corner first - if (bSolid) { - aContext.FillRect(borderInside.XMost(), borderOutside.y, - borderOutside.XMost() - borderInside.XMost(), - borderInside.y - borderOutside.y); - } - - dashRect.width = borderOutside.XMost() - borderInside.XMost(); - dashRect.height = nscoord(dashRect.width * dashLength); - dashRect.x = borderInside.XMost(); - dashRect.y = borderInside.y; - - if (over > 0.0f) { - firstRect.x = dashRect.x; - firstRect.y = dashRect.y; - firstRect.width = dashRect.width; - firstRect.height = nscoord(dashRect.height * over); - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.y < borderInside.YMost()) { - //clip if necessary - if (currRect.YMost() > borderInside.YMost()) { - over = float(dashRect.YMost() - borderInside.YMost()) / - float(dashRect.height); - currRect.height = currRect.height - - (currRect.YMost() - borderInside.YMost()); - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.y = dashRect.y + currRect.height; - currRect = dashRect; - } - break; - - case NS_SIDE_BOTTOM: - //if we are continuing a solid rect, fill in the corner first - if (bSolid) { - aContext.FillRect(borderInside.XMost(), borderInside.YMost(), - borderOutside.XMost() - borderInside.XMost(), - borderOutside.YMost() - borderInside.YMost()); - } - - dashRect.height = borderOutside.YMost() - borderInside.YMost(); - dashRect.width = nscoord(dashRect.height * dashLength); - dashRect.x = borderInside.XMost() - dashRect.width; - dashRect.y = borderInside.YMost(); - - if (over > 0.0f) { - firstRect.y = dashRect.y; - firstRect.width = nscoord(dashRect.width * over); - firstRect.height = dashRect.height; - firstRect.x = dashRect.x + (dashRect.width - firstRect.width); - over = 0.0f; - currRect = firstRect; - } else { - currRect = dashRect; - } - - while (currRect.XMost() > borderInside.x) { - //clip if necessary - if (currRect.x < borderInside.x) { - over = float(borderInside.x - dashRect.x) / float(dashRect.width); - currRect.width = currRect.width - (borderInside.x - currRect.x); - currRect.x = borderInside.x; - } - - //draw if necessary - if (bSolid) { - aContext.FillRect(currRect); - } - - //setup for next iteration - if (over == 0.0f) { - bSolid = PRBool(!bSolid); - } - dashRect.x = dashRect.x - currRect.width; - currRect = dashRect; - } - break; - } - } - skippedSide = PR_FALSE; - } -} - -// XXX improve this to constrain rendering to the damaged area -void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - nsIFrame* aForFrame, - const nsRect& aDirtyRect, - const nsRect& aBounds, - const nsStyleBorder& aStyle, - PRIntn aSkipSides) -{ - const nsMargin& border = aStyle.mSize; - if ((0 == border.left) && (0 == border.right) && - (0 == border.top) && (0 == border.bottom)) { - // Empty border area - return; - } - - nsRect inside(0, 0, aBounds.width, aBounds.height); - nsRect outside(inside); - outside.Deflate(border); - - //see if any sides are dotted or dashed - for (PRIntn cnt = 0; cnt < 4; cnt++) { - if ((aStyle.mStyle[cnt] == NS_STYLE_BORDER_STYLE_DOTTED) || - (aStyle.mStyle[cnt] == NS_STYLE_BORDER_STYLE_DASHED)) { - break; - } - } - if (cnt < 4) { - // Draw the dashed/dotted lines first - DrawDashedSides(cnt, aRenderingContext, aStyle.mStyle, - aStyle.mColor, inside, outside, - aSkipSides); - } - - // Draw all the other sides - if (0 == (aSkipSides & (1<NeedsBlend()) { - if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { - aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height); - } - } -#endif - - // Convert image dimensions into nscoord's - float p2t = aPresContext.GetPixelsToTwips(); - nscoord tileWidth = nscoord(p2t * image->GetWidth()); - nscoord tileHeight = nscoord(p2t * image->GetHeight()); - - PRIntn repeat = aColor.mBackgroundRepeat; - PRIntn xcount, ycount; - switch (aColor.mBackgroundRepeat) { - case NS_STYLE_BG_REPEAT_OFF: - default: - xcount = 0; - ycount = 0; - break; - case NS_STYLE_BG_REPEAT_X: - xcount = (PRIntn) (aBounds.width / tileWidth); - ycount = 0; - break; - case NS_STYLE_BG_REPEAT_Y: - xcount = 0; - ycount = (PRIntn) (aBounds.height / tileHeight); - break; - case NS_STYLE_BG_REPEAT_XY: - xcount = (PRIntn) (aBounds.width / tileWidth); - ycount = (PRIntn) (aBounds.height / tileHeight); - break; - } - - // Tile the background - nscoord xpos = 0, ypos = 0; - nscoord xpos0 = 0; -#if XXX - // XXX support offset positioning - PRIntn xPos = aColor.mBackgroundXPosition; - PRIntn yPos = aColor.mBackgroundXPosition; -#endif - aRenderingContext.PushState(); - aRenderingContext.SetClipRect(aDirtyRect, PR_TRUE); - PRIntn x, y; - for (y = 0; y <= ycount; ++y, ypos += tileHeight) { - for (x = 0, xpos = xpos0; x <= xcount; ++x, xpos += tileWidth) { - aRenderingContext.DrawImage(image, xpos, ypos); - } - } - aRenderingContext.PopState(); - } else { - if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { - // XXX This step can be avoided if we have an image and it doesn't - // have any transparent pixels and the image is tiled in both - // the x and the y - aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height); - } - } -} diff --git a/mozilla/layout/html/style/src/nsCSSRendering.h b/mozilla/layout/html/style/src/nsCSSRendering.h deleted file mode 100644 index 09181f85aef..00000000000 --- a/mozilla/layout/html/style/src/nsCSSRendering.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSRendering_h___ -#define nsCSSRendering_h___ - -#include "nsIRenderingContext.h" -#include "nsIStyleContext.h" -struct nsPoint; - -class nsCSSRendering { -public: - /** - * Render the border for an element using css rendering rules - * for borders. aSkipSides is a bitmask of the sides to skip - * when rendering. If 0 then no sides are skipped. - */ - static void PaintBorder(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - nsIFrame* aForFrame, - const nsRect& aDirtyRect, - const nsRect& aBounds, - const nsStyleBorder& aStyle, - PRIntn aSkipSides); - - /** - * Render the background for an element using css rendering rules - * for backgrounds. - */ - static void PaintBackground(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - nsIFrame* aForFrame, - const nsRect& aDirtyRect, - const nsRect& aBounds, - const nsStyleColor& aColor); - - /** - * Special method to brighten a Color and have it shift to white when - * fully saturated. - */ - static nscolor Brighten(nscolor inColor); - - /** - * Special method to darken a Color and have it shift to black when - * darkest component underflows - */ - static nscolor Darken(nscolor inColor); - -protected: - static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style, - nscolor baseColor); - - static PRIntn MakeSide(nsPoint aPoints[], - nsIRenderingContext& aContext, - PRIntn whichSide, - const nsRect& inside, const nsRect& outside, - PRIntn borderPart, float borderFrac); - - static void DrawSide(nsIRenderingContext& aContext, - PRIntn whichSide, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside); - - static void DrawDashedSides(PRIntn startSide, - nsIRenderingContext& aContext, - const PRUint8 borderStyles[], - const nscolor borderColors[], - const nsRect& borderOutside, - const nsRect& borderInside, - PRIntn aSkipSides); -}; - -#endif /* nsCSSRendering_h___ */ diff --git a/mozilla/layout/html/style/src/nsCSSScanner.cpp b/mozilla/layout/html/style/src/nsCSSScanner.cpp deleted file mode 100644 index 50f64a93f29..00000000000 --- a/mozilla/layout/html/style/src/nsCSSScanner.cpp +++ /dev/null @@ -1,585 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCSSScanner.h" -#include "nsIInputStream.h" -#include "nsIUnicharInputStream.h" -#include "nsString.h" -#include "nsCRT.h" - -#ifdef NS_DEBUG -static char* kNullPointer = "null pointer"; -#endif - -// Don't bother collecting whitespace characters in token's mIdent buffer -#undef COLLECT_WHITESPACE - -#define BUFFER_SIZE 256 - -static const PRUnichar CSS_ESCAPE = PRUnichar('\\'); - -static const PRUint8 IS_LATIN1 = 0x01; -static const PRUint8 IS_DIGIT = 0x02; -static const PRUint8 IS_HEX_DIGIT = 0x04; -static const PRUint8 IS_ALPHA = 0x08; -static const PRUint8 START_IDENT = 0x10; -static const PRUint8 IS_IDENT = 0x20; -static const PRUint8 IS_WHITESPACE = 0x40; - -static PRUint8* gLexTable; - -static void BuildLexTable() -{ - PRUint8* lt = new PRUint8[256]; - nsCRT::zero(lt, 256); - gLexTable = lt; - - int i; - lt[CSS_ESCAPE] = START_IDENT; - lt['-'] |= IS_IDENT; - // XXX add in other whitespace chars - lt[' '] |= IS_WHITESPACE; - lt['\t'] |= IS_WHITESPACE; - lt['\r'] |= IS_WHITESPACE; - lt['\n'] |= IS_WHITESPACE; - for (i = 161; i <= 255; i++) { - lt[i] |= IS_LATIN1 | IS_IDENT | START_IDENT; - } - for (i = '0'; i <= '9'; i++) { - lt[i] |= IS_DIGIT | IS_HEX_DIGIT | IS_IDENT; - } - for (i = 'A'; i <= 'Z'; i++) { - if ((i >= 'A') && (i <= 'F')) { - lt[i] |= IS_HEX_DIGIT; - lt[i+32] |= IS_HEX_DIGIT; - } - lt[i] |= IS_ALPHA | IS_IDENT | START_IDENT; - lt[i+32] |= IS_ALPHA | IS_IDENT | START_IDENT; - } -} - -nsCSSToken::nsCSSToken() -{ - mType = eCSSToken_Symbol; -} - -nsCSSScanner::nsCSSScanner() -{ - if (nsnull == gLexTable) { - // XXX need a monitor - BuildLexTable(); - } - mInput = nsnull; - mBuffer = new PRUnichar[BUFFER_SIZE]; - mOffset = 0; - mCount = 0; - mLookAhead = -1; -} - -nsCSSScanner::~nsCSSScanner() -{ - Close(); - if (nsnull != mBuffer) { - delete mBuffer; - mBuffer = nsnull; - } -} - -void nsCSSScanner::Init(nsIUnicharInputStream* aInput) -{ - NS_PRECONDITION(nsnull != aInput, kNullPointer); - Close(); - mInput = aInput; - if (nsnull != aInput) { - aInput->AddRef(); - } -} - -void nsCSSScanner::Close() -{ - NS_IF_RELEASE(mInput); -} - -// Returns -1 on error or eof -PRInt32 nsCSSScanner::Read(PRInt32* aErrorCode) -{ - PRInt32 rv; - if (mLookAhead >= 0) { - rv = mLookAhead; - mLookAhead = -1; - } else { - if (mCount < 0) { - return -1; - } - if (mOffset == mCount) { - mOffset = 0; - mCount = mInput->Read(aErrorCode, mBuffer, 0, BUFFER_SIZE); - if (mCount <= 0) { - return -1; - } - } - rv = PRInt32(mBuffer[mOffset++]); - } - mLastRead = rv; -//printf("Read => %x\n", rv); - return rv; -} - -PRInt32 nsCSSScanner::Peek(PRInt32* aErrorCode) -{ - if (mLookAhead < 0) { - mLookAhead = Read(aErrorCode); - if (mLookAhead < 0) { - return -1; - } - } -//printf("Peek => %x\n", mLookAhead); - return mLookAhead; -} - -void nsCSSScanner::Unread() -{ - NS_PRECONDITION((mLastRead >= 0) && (mLookAhead < 0), "double pushback"); - mLookAhead = mLastRead; - mLastRead = -1; -} - -PRBool nsCSSScanner::LookAhead(PRInt32* aErrorCode, PRUnichar aChar) -{ - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - if (ch == aChar) { - return PR_TRUE; - } - Unread(); - return PR_FALSE; -} - -PRBool nsCSSScanner::EatWhiteSpace(PRInt32* aErrorCode) -{ - PRBool eaten = PR_FALSE; - for (;;) { - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - break; - } - if ((ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t')) { - eaten = PR_TRUE; - continue; - } - Unread(); - break; - } - return eaten; -} - -PRBool nsCSSScanner::EatNewline(PRInt32* aErrorCode) -{ - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - PRBool eaten = PR_FALSE; - if (ch == '\r') { - eaten = PR_TRUE; - ch = Peek(aErrorCode); - if (ch == '\n') { - (void) Read(aErrorCode); - } - } else if (ch == '\n') { - eaten = PR_TRUE; - } else { - Unread(); - } - return eaten; -} - -PRBool nsCSSScanner::Next(PRInt32* aErrorCode, nsCSSToken* aToken) -{ - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - if (ch < 256) { - PRUint8* lexTable = gLexTable; - - // IDENT - if ((lexTable[ch] & START_IDENT) != 0) { - return ParseIdent(aErrorCode, ch, aToken); - } - - // AT_KEYWORD - if (ch == '@') { - PRInt32 nextChar = Peek(aErrorCode); - if ((nextChar >= 0) && (nextChar <= 255)) { - if ((lexTable[nextChar] & START_IDENT) != 0) { - return ParseAtKeyword(aErrorCode, ch, aToken); - } - } - } - - // NUMBER or DIM - if ((ch == '.') || (ch == '+') || (ch == '-')) { - PRInt32 nextChar = Peek(aErrorCode); - if ((nextChar >= 0) && (nextChar <= 255)) { - if ((lexTable[nextChar] & IS_DIGIT) != 0) { - return ParseNumber(aErrorCode, ch, aToken); - } - } - } - if ((lexTable[ch] & IS_DIGIT) != 0) { - return ParseNumber(aErrorCode, ch, aToken); - } - - // ID - if (ch == '#') { - return ParseID(aErrorCode, ch, aToken); - } - - // STRING - if ((ch == '"') || (ch == '\'')) { - return ParseString(aErrorCode, ch, aToken); - } - - // WS - if ((lexTable[ch] & IS_WHITESPACE) != 0) { - aToken->mType = eCSSToken_WhiteSpace; - aToken->mIdent.SetLength(0); - aToken->mIdent.Append(PRUnichar(ch)); - (void) EatWhiteSpace(aErrorCode); - return PR_TRUE; - } - if (ch == '/') { - PRInt32 nextChar = Peek(aErrorCode); - if (nextChar == '/') { - (void) Read(aErrorCode); - aToken->mIdent.SetLength(0); - aToken->mIdent.Append(PRUnichar(ch)); - aToken->mIdent.Append(PRUnichar(ch)); - return ParseEOLComment(aErrorCode, aToken); - } else if (nextChar == '*') { - (void) Read(aErrorCode); - aToken->mIdent.SetLength(0); - aToken->mIdent.Append(PRUnichar(ch)); - aToken->mIdent.Append(PRUnichar(nextChar)); - return ParseCComment(aErrorCode, aToken); - } - } - } - aToken->mType = eCSSToken_Symbol; - aToken->mSymbol = ch; - return PR_TRUE; -} - -PRInt32 nsCSSScanner::ParseEscape(PRInt32* aErrorCode) -{ - PRUint8* lexTable = gLexTable; - PRInt32 ch = Peek(aErrorCode); - if (ch < 0) { - return CSS_ESCAPE; - } - if ((ch <= 255) && ((lexTable[ch] & IS_HEX_DIGIT) != 0)) { - PRInt32 rv = 0; - for (int i = 0; i < 4; i++) { - ch = Read(aErrorCode); - if (ch < 0) { - // Whoops: error or premature eof - break; - } - if ((lexTable[ch] & IS_HEX_DIGIT) != 0) { - if ((lexTable[ch] & IS_DIGIT) != 0) { - rv = rv * 16 + (ch - '0'); - } else { - // Note: c&7 just keeps the low three bits which causes - // upper and lower case alphabetics to both yield their - // "relative to 10" value for computing the hex value. - rv = rv * 16 + (ch & 0x7) + 10; - } - } else { - Unread(); - break; - } - } - return rv; - } else { - // "Any character except a hexidecimal digit can be escaped to - // remove its special meaning by putting a backslash in front" - // -- CSS1 spec section 7.1 - (void) Read(aErrorCode); - return ch; - } -} - -/** - * Gather up the characters in an identifier. The identfier was - * started by "aChar" which will be appended to aIdent. The result - * will be aIdent with all of the identifier characters appended - * until the first non-identifier character is seen. The termination - * character is unread for the future re-reading. - */ -PRBool nsCSSScanner::GatherIdent(PRInt32* aErrorCode, PRInt32 aChar, - nsString& aIdent) -{ - if (aChar == CSS_ESCAPE) { - aChar = ParseEscape(aErrorCode); - } - for (;;) { - aChar = Read(aErrorCode); - if (aChar < 0) break; - if (aChar == CSS_ESCAPE) { - aChar = ParseEscape(aErrorCode); - aIdent.Append(PRUnichar(aChar)); - } else if ((aChar <= 255) && ((gLexTable[aChar] & IS_IDENT) != 0)) { - aIdent.Append(PRUnichar(aChar)); - } else { - Unread(); - break; - } - } - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseID(PRInt32* aErrorCode, - PRInt32 aChar, - nsCSSToken* aToken) -{ - aToken->mIdent.SetLength(0); - aToken->mType = eCSSToken_ID; - return GatherIdent(aErrorCode, aChar, aToken->mIdent); -} - -PRBool nsCSSScanner::ParseIdent(PRInt32* aErrorCode, - PRInt32 aChar, - nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - ident.SetLength(0); - ident.Append(PRUnichar(aChar)); - if (!GatherIdent(aErrorCode, aChar, ident)) { - return PR_FALSE; - } - - // Process a url lexical token. A CSS1 url token can contain - // characters beyond identifier characters (e.g. '/', ':', etc.) - // Because of this the normal rules for tokenizing the input don't - // apply very well. To simplify the parser and relax some of the - // requirements on the scanner we parse url's here. If we find a - // malformed URL then we emit a token of type "InvalidURL" so that - // the CSS1 parser can ignore the invalid input. We attempt to eat - // the right amount of input data when an invalid URL is presented. - nsCSSTokenType tokenType = eCSSToken_Ident; - if (ident.EqualsIgnoreCase("url")) { - tokenType = eCSSToken_InvalidURL; - if (LookAhead(aErrorCode, '(')) { - // Skip leading whitespace - (void) EatWhiteSpace(aErrorCode); - ident.SetLength(0); - - PRInt32 c = Read(aErrorCode); - if (c == ')') { - // empty url spec: this is invalid - } else if ((c == '"') || (c == '\'')) { - // start of a quoted url - if (!GatherString(aErrorCode, c, ident)) { - return PR_FALSE; - } - if (!EatWhiteSpace(aErrorCode)) { - return PR_FALSE; - } - if (LookAhead(aErrorCode, ')')) { - tokenType = eCSSToken_URL; - } - } else { - // start of a non-quoted url - Unread(); - PRBool ok = PR_TRUE; - for (;;) { - c = Read(aErrorCode); - if (c < 0) break; - if (c == CSS_ESCAPE) { - c = ParseEscape(aErrorCode); - ident.Append(PRUnichar(c)); - } else if ((c == '"') || (c == '\'') || (c == '(')) { - // This is an invalid URL spec - ok = PR_FALSE; - } else if ((256 >= c) && ((gLexTable[c] & IS_WHITESPACE) != 0)) { - // Whitespace is allowed at the end of the URL - (void) EatWhiteSpace(aErrorCode); - if (LookAhead(aErrorCode, ')')) { - // done! - break; - } - // Whitespace is followed by something other than a - // ")". This is an invalid url spec. - ok = PR_FALSE; - } else if (c == ')') { - // All done - break; - } else { - // A regular url character. - ident.Append(PRUnichar(c)); - } - } - - // If the result of the above scanning is ok then change the token - // type to a useful one. - if (ok) { - tokenType = eCSSToken_URL; - } - } - } - } - aToken->mType = tokenType; - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseAtKeyword(PRInt32* aErrorCode, PRInt32 aChar, - nsCSSToken* aToken) -{ - aToken->mIdent.SetLength(0); - aToken->mType = eCSSToken_AtKeyword; - return GatherIdent(aErrorCode, aChar, aToken->mIdent); -} - -PRBool nsCSSScanner::ParseNumber(PRInt32* aErrorCode, PRInt32 c, - nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - ident.SetLength(0); - PRBool gotDot = (c == '.') ? PR_TRUE : PR_FALSE; - if (c != '+') { - ident.Append(PRUnichar(c)); - } - - // Gather up characters that make up the number - PRUint8* lexTable = gLexTable; - for (;;) { - c = Read(aErrorCode); - if (c < 0) break; - if (!gotDot && (c == '.')) { - gotDot = PR_TRUE; - } else if ((c > 255) || ((lexTable[c] & IS_DIGIT) == 0)) { - break; - } - ident.Append(PRUnichar(c)); - } - - // Convert number to floating point - nsCSSTokenType type = eCSSToken_Number; - PRInt32 ec; - float value = ident.ToFloat(&ec); - - // Look at character that terminated the number - aToken->mIntegerValid = PR_FALSE; - if (c >= 0) { - if ((c <= 255) && ((lexTable[c] & START_IDENT) != 0)) { - ident.SetLength(0); - ident.Append(PRUnichar(c)); - if (!GatherIdent(aErrorCode, c, ident)) { - return PR_FALSE; - } - type = eCSSToken_Dimension; - } else if ('%' == c) { - type = eCSSToken_Percentage; - value = value / 100.0f; - } else { - // Put back character that stopped numeric scan - Unread(); - if (!gotDot) { - aToken->mInteger = ident.ToInteger(&ec); - aToken->mIntegerValid = PR_TRUE; - } - ident.SetLength(0); - } - } - aToken->mNumber = value; - aToken->mType = type; - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseCComment(PRInt32* aErrorCode, nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - for (;;) { - PRInt32 ch = Read(aErrorCode); - if (ch < 0) break; - if (ch == '*') { - if (LookAhead(aErrorCode, '/')) { - ident.Append(PRUnichar(ch)); - ident.Append('/'); - break; - } - } -#ifdef COLLECT_WHITESPACE - ident.Append(PRUnichar(ch)); -#endif - } - aToken->mType = eCSSToken_WhiteSpace; - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseEOLComment(PRInt32* aErrorCode, nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - ident.SetLength(0); - for (;;) { - if (EatNewline(aErrorCode)) { - break; - } - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - break; - } -#ifdef COLLECT_WHITESPACE - ident.Append(PRUnichar(ch)); -#endif - } - aToken->mType = eCSSToken_WhiteSpace; - return PR_TRUE; -} - -PRBool nsCSSScanner::GatherString(PRInt32* aErrorCode, PRInt32 aStop, - nsString& aBuffer) -{ - for (;;) { - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - if (ch == aStop) { - break; - } - if (ch == CSS_ESCAPE) { - ch = ParseEscape(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - } - aBuffer.Append(PRUnichar(ch)); - } - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseString(PRInt32* aErrorCode, PRInt32 aStop, - nsCSSToken* aToken) -{ - aToken->mIdent.SetLength(0); - aToken->mType = eCSSToken_String; - return GatherString(aErrorCode, aStop, aToken->mIdent); -} diff --git a/mozilla/layout/html/style/src/nsCSSScanner.h b/mozilla/layout/html/style/src/nsCSSScanner.h deleted file mode 100644 index afbe1da67fd..00000000000 --- a/mozilla/layout/html/style/src/nsCSSScanner.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSScanner_h___ -#define nsCSSScanner_h___ - -#include "nsString.h" -class nsIUnicharInputStream; - -// Token types -enum nsCSSTokenType { - // A css identifier (e.g. foo) - eCSSToken_Ident = 0, - - // A css at keyword (e.g. @foo) - eCSSToken_AtKeyword = 1, - - // A css number without a percentage or dimension; with percentage; - // without percentage but with a dimension - eCSSToken_Number = 2, - eCSSToken_Percentage = 3, - eCSSToken_Dimension = 4, - - // A css string (e.g. "foo" or 'foo') - eCSSToken_String = 5, - - // Whitespace (e.g. " " or "/* abc */" or "// foo ") - eCSSToken_WhiteSpace = 6, - - // A css symbol (e.g. ':', ';', '+', etc.) - eCSSToken_Symbol = 7, - - eCSSToken_URL = 8, // use getString - eCSSToken_InvalidURL = 9, // doesn't matter - - // A css1 id (e.g. #foo3) - eCSSToken_ID = 10, // use getString() -}; - -struct nsCSSToken { - nsCSSTokenType mType; - nsAutoString mIdent; - float mNumber; - PRInt32 mInteger; - PRUnichar mSymbol; - PRBool mIntegerValid; - - nsCSSToken(); - - PRBool isDimension() { - return (PRBool) - ((eCSSToken_Dimension == mType) || - ((eCSSToken_Number == mType) && (mNumber == 0.0f))); - } -}; - -// CSS Scanner API. Used to tokenize an input stream using the CSS -// forward compatible tokenization rules. This implementation is -// private to this package and is only used internally by the css -// parser. -class nsCSSScanner { - public: - nsCSSScanner(); - ~nsCSSScanner(); - - // Init the scanner. - void Init(nsIUnicharInputStream* aInput); - - // Get the next token. Return nsfalse on EOF or ERROR. aTokenResult - // is filled in with the data for the token. - PRBool Next(PRInt32* aErrorCode, nsCSSToken* aTokenResult); - -protected: - void Close(); - PRInt32 Read(PRInt32* aErrorCode); - PRInt32 Peek(PRInt32* aErrorCode); - void Unread(); - PRBool LookAhead(PRInt32* aErrorCode, PRUnichar aChar); - PRBool EatWhiteSpace(PRInt32* aErrorCode); - PRBool EatNewline(PRInt32* aErrorCode); - - PRInt32 ParseEscape(PRInt32* aErrorCode); - PRBool ParseIdent(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseAtKeyword(PRInt32* aErrorCode, PRInt32 aChar, - nsCSSToken* aResult); - PRBool ParseNumber(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseID(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseString(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseEOLComment(PRInt32* aErrorCode, nsCSSToken* aResult); - PRBool ParseCComment(PRInt32* aErrorCode, nsCSSToken* aResult); - - PRBool GatherString(PRInt32* aErrorCode, PRInt32 aStop, - nsString& aString); - PRBool GatherIdent(PRInt32* aErrorCode, PRInt32 aChar, nsString& aIdent); - - nsIUnicharInputStream* mInput; - PRUnichar* mBuffer; - PRInt32 mOffset; - PRInt32 mCount; - PRInt32 mLookAhead; - PRInt32 mLastRead; -}; - -#endif /* nsCSSScanner_h___ */ diff --git a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp deleted file mode 100644 index 6bb42cd4013..00000000000 --- a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp +++ /dev/null @@ -1,1047 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSStyleRule.h" -#include "nsICSSDeclaration.h" -#include "nsIStyleContext.h" -#include "nsIPresContext.h" -#include "nsIArena.h" -#include "nsIAtom.h" -#include "nsCRT.h" -#include "nsString.h" -#include "nsStyleConsts.h" -#include "nsUnitConversion.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID); -static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID); -static NS_DEFINE_IID(kICSSStyleRuleIID, NS_ICSS_STYLE_RULE_IID); - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID); -static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID); -static NS_DEFINE_IID(kCSSTextSID, NS_CSS_TEXT_SID); -static NS_DEFINE_IID(kCSSMarginSID, NS_CSS_MARGIN_SID); -static NS_DEFINE_IID(kCSSPositionSID, NS_CSS_POSITION_SID); -static NS_DEFINE_IID(kCSSListSID, NS_CSS_LIST_SID); -static NS_DEFINE_IID(kCSSDisplaySID, NS_CSS_DISPLAY_SID); - - -// -- nsCSSSelector ------------------------------- - -nsCSSSelector::nsCSSSelector() - : mTag(nsnull), mID(nsnull), mClass(nsnull), mPseudoClass(nsnull), - mNext(nsnull) -{ -} - -nsCSSSelector::nsCSSSelector(nsIAtom* aTag, nsIAtom* aID, nsIAtom* aClass, nsIAtom* aPseudoClass) - : mTag(aTag), mID(aID), mClass(aClass), mPseudoClass(aPseudoClass), - mNext(nsnull) -{ - NS_IF_ADDREF(mTag); - NS_IF_ADDREF(mID); - NS_IF_ADDREF(mClass); - NS_IF_ADDREF(mPseudoClass); -} - -nsCSSSelector::nsCSSSelector(const nsCSSSelector& aCopy) - : mTag(aCopy.mTag), mID(aCopy.mID), mClass(aCopy.mClass), mPseudoClass(aCopy.mPseudoClass), - mNext(nsnull) -{ // implmented to support extension to CSS2 (when we have to copy the array) - NS_IF_ADDREF(mTag); - NS_IF_ADDREF(mID); - NS_IF_ADDREF(mClass); - NS_IF_ADDREF(mPseudoClass); -} - -nsCSSSelector::~nsCSSSelector() -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); - NS_IF_RELEASE(mPseudoClass); -} - -nsCSSSelector& nsCSSSelector::operator=(const nsCSSSelector& aCopy) -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); - NS_IF_RELEASE(mPseudoClass); - mTag = aCopy.mTag; - mID = aCopy.mID; - mClass = aCopy.mClass; - mPseudoClass = aCopy.mPseudoClass; - NS_IF_ADDREF(mTag); - NS_IF_ADDREF(mID); - NS_IF_ADDREF(mClass); - NS_IF_ADDREF(mPseudoClass); - return *this; -} - -PRBool nsCSSSelector::Equals(const nsCSSSelector* aOther) const -{ - if (nsnull != aOther) { - return (PRBool)((aOther->mTag == mTag) && (aOther->mID == mID) && - (aOther->mClass == mClass) && (aOther->mPseudoClass == mPseudoClass)); - } - return PR_FALSE; -} - - -void nsCSSSelector::Set(const nsString& aTag, const nsString& aID, - const nsString& aClass, const nsString& aPseudoClass) -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); - NS_IF_RELEASE(mPseudoClass); - if (0 < aTag.Length()) { - mTag = NS_NewAtom(aTag); - } - if (0 < aID.Length()) { - mID = NS_NewAtom(aID); - } - if (0 < aClass.Length()) { - mClass = NS_NewAtom(aClass); - } - if (0 < aPseudoClass.Length()) { - mPseudoClass = NS_NewAtom(aPseudoClass); - } -} - -// -- nsCSSStyleRule ------------------------------- - -class CSSStyleRuleImpl : public nsICSSStyleRule { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - CSSStyleRuleImpl(const nsCSSSelector& aSelector); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRBool Equals(const nsIStyleRule* aRule) const; - virtual PRUint32 HashValue(void) const; - - virtual nsCSSSelector* FirstSelector(void); - virtual void AddSelector(const nsCSSSelector& aSelector); - virtual void DeleteSelector(nsCSSSelector* aSelector); - - virtual nsICSSDeclaration* GetDeclaration(void) const; - virtual void SetDeclaration(nsICSSDeclaration* aDeclaration); - - virtual PRInt32 GetWeight(void) const; - virtual void SetWeight(PRInt32 aWeight); - - virtual nscoord CalcLength(const nsCSSValue& aValue, nsStyleFont* aFont, - nsIPresContext* aPresContext); - virtual void MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext); - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - // These are not supported and are not implemented! - CSSStyleRuleImpl(const CSSStyleRuleImpl& aCopy); - CSSStyleRuleImpl& operator=(const CSSStyleRuleImpl& aCopy); - -protected: - virtual ~CSSStyleRuleImpl(); - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsCSSSelector mSelector; - nsICSSDeclaration* mDeclaration; - PRInt32 mWeight; -#ifdef DEBUG_REFS - PRInt32 mInstance; -#endif -}; - - -void* CSSStyleRuleImpl::operator new(size_t size) -{ - CSSStyleRuleImpl* rv = (CSSStyleRuleImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* CSSStyleRuleImpl::operator new(size_t size, nsIArena* aArena) -{ - CSSStyleRuleImpl* rv = (CSSStyleRuleImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void CSSStyleRuleImpl::operator delete(void* ptr) -{ - CSSStyleRuleImpl* rule = (CSSStyleRuleImpl*) ptr; - if (nsnull != rule) { - if (rule->mInHeap) { - ::delete ptr; - } - } -} - - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -static const PRInt32 kInstrument = 1075; -#endif - -CSSStyleRuleImpl::CSSStyleRuleImpl(const nsCSSSelector& aSelector) - : mSelector(aSelector), mDeclaration(nsnull), mWeight(0) -{ - NS_INIT_REFCNT(); -#ifdef DEBUG_REFS - mInstance = gInstanceCount++; - fprintf(stdout, "%d of %d + CSSStyleRule\n", mInstance, gInstanceCount); -#endif -} - -CSSStyleRuleImpl::~CSSStyleRuleImpl() -{ - nsCSSSelector* next = mSelector.mNext; - - while (nsnull != next) { - nsCSSSelector* selector = next; - next = selector->mNext; - delete selector; - } - NS_IF_RELEASE(mDeclaration); -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d of %d - CSSStyleRule\n", mInstance, gInstanceCount); -#endif -} - -#ifdef DEBUG_REFS -nsrefcnt CSSStyleRuleImpl::AddRef(void) -{ - if (mInstance == kInstrument) { - fprintf(stdout, "%d AddRef CSSStyleRule\n", mRefCnt + 1); - } - return ++mRefCnt; -} - -nsrefcnt CSSStyleRuleImpl::Release(void) -{ - if (mInstance == kInstrument) { - fprintf(stdout, "%d Release CSSStyleRule\n", mRefCnt - 1); - } - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} -#else -NS_IMPL_ADDREF(CSSStyleRuleImpl) -NS_IMPL_RELEASE(CSSStyleRuleImpl) -#endif - -nsresult CSSStyleRuleImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kICSSStyleRuleIID)) { - *aInstancePtrResult = (void*) ((nsICSSStyleRule*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleRuleIID)) { - *aInstancePtrResult = (void*) ((nsIStyleRule*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - - -PRBool CSSStyleRuleImpl::Equals(const nsIStyleRule* aRule) const -{ - nsICSSStyleRule* iCSSRule; - - if (this == aRule) { - return PR_TRUE; - } - - if ((nsnull != aRule) && - (NS_OK == ((nsIStyleRule*)aRule)->QueryInterface(kICSSStyleRuleIID, (void**) &iCSSRule))) { - - CSSStyleRuleImpl* rule = (CSSStyleRuleImpl*)iCSSRule; - const nsCSSSelector* local = &mSelector; - const nsCSSSelector* other = &(rule->mSelector); - PRBool result = PR_TRUE; - - while ((PR_TRUE == result) && (nsnull != local) && (nsnull != other)) { - if (! local->Equals(other)) { - result = PR_FALSE; - } - local = local->mNext; - other = other->mNext; - } - if ((nsnull != local) || (nsnull != other)) { // more were left - result = PR_FALSE; - } - if ((rule->mDeclaration != mDeclaration) || - (rule->mWeight != mWeight)) { - result = PR_FALSE; - } - NS_RELEASE(iCSSRule); - return result; - } - return PR_FALSE; -} - -PRUint32 CSSStyleRuleImpl::HashValue(void) const -{ - return (PRUint32)this; -} - -nsCSSSelector* CSSStyleRuleImpl::FirstSelector(void) -{ - return &mSelector; -} - -void CSSStyleRuleImpl::AddSelector(const nsCSSSelector& aSelector) -{ - nsCSSSelector* selector = new nsCSSSelector(aSelector); - nsCSSSelector* last = &mSelector; - - while (nsnull != last->mNext) { - last = last->mNext; - } - last->mNext = selector; -} - - -void CSSStyleRuleImpl::DeleteSelector(nsCSSSelector* aSelector) -{ - if (nsnull != aSelector) { - if (&mSelector == aSelector) { // handle first selector - mSelector = *aSelector; // assign value - mSelector.mNext = aSelector->mNext; - delete aSelector; - } - else { - nsCSSSelector* selector = &mSelector; - - while (nsnull != selector->mNext) { - if (aSelector == selector->mNext) { - selector->mNext = aSelector->mNext; - delete aSelector; - return; - } - selector = selector->mNext; - } - } - } -} - -nsICSSDeclaration* CSSStyleRuleImpl::GetDeclaration(void) const -{ - NS_IF_ADDREF(mDeclaration); - return mDeclaration; -} - -void CSSStyleRuleImpl::SetDeclaration(nsICSSDeclaration* aDeclaration) -{ - NS_IF_RELEASE(mDeclaration); - mDeclaration = aDeclaration; - NS_IF_ADDREF(mDeclaration); -} - -PRInt32 CSSStyleRuleImpl::GetWeight(void) const -{ - return mWeight; -} - -void CSSStyleRuleImpl::SetWeight(PRInt32 aWeight) -{ - mWeight = aWeight; -} - -nscoord CSSStyleRuleImpl::CalcLength(const nsCSSValue& aValue, - nsStyleFont* aFont, - nsIPresContext* aPresContext) -{ - NS_ASSERTION(aValue.IsLengthUnit(), "not a length unit"); - if (aValue.IsFixedLengthUnit()) { - return aValue.GetLengthTwips(); - } - nsCSSUnit unit = aValue.GetUnit(); - switch (unit) { - case eCSSUnit_EM: - return aFont->mFont.size; - case eCSSUnit_EN: - return (aFont->mFont.size / 2); - case eCSSUnit_XHeight: - NS_NOTYETIMPLEMENTED("x height unit"); - return ((aFont->mFont.size / 3) * 2); // XXX HACK! - case eCSSUnit_CapHeight: - NS_NOTYETIMPLEMENTED("cap height unit"); - return ((aFont->mFont.size / 3) * 2); // XXX HACK! - - case eCSSUnit_Pixel: - return (nscoord)(aPresContext->GetPixelsToTwips() * aValue.GetFloatValue()); - } - return 0; -} - -void CSSStyleRuleImpl::MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) -{ - if (nsnull != mDeclaration) { - nsStyleFont* font = (nsStyleFont*)aContext->GetData(kStyleFontSID); - - nsCSSFont* ourFont; - if (NS_OK == mDeclaration->GetData(kCSSFontSID, (nsCSSStruct**)&ourFont)) { - if (nsnull != ourFont) { - nsStyleFont* parentFont = font; - nsIStyleContext* parentContext = aContext->GetParent(); - if (nsnull != parentContext) { - parentFont = (nsStyleFont*)parentContext->GetData(kStyleFontSID); - } - - // font-family: string list - if (ourFont->mFamily.GetUnit() == eCSSUnit_String) { - nsAutoString familyList; - ourFont->mFamily.GetStringValue(familyList); - // XXX meeds font support to determine usable fonts - // parse up the CSS string & remove the quotes - // XXX only does first until we can tell what are installed fonts - nsAutoString family; - PRInt32 index = familyList.Find(PRUnichar(',')); - if (-1 < index) { - familyList.Left(family, index); - } - else { - family.Append(familyList); - } - family.StripChars("\""); - family.StripWhitespace(); - - font->mFont.name = family; - } - - // font-style: enum - if (ourFont->mStyle.GetUnit() == eCSSUnit_Enumerated) { - font->mFont.style = ourFont->mStyle.GetIntValue(); - } - - // font-variant: enum - if (ourFont->mVariant.GetUnit() == eCSSUnit_Enumerated) { - font->mFont.variant = ourFont->mVariant.GetIntValue(); - } - - // font-weight: abs, enum - if (ourFont->mWeight.GetUnit() == eCSSUnit_Absolute) { - font->mFont.style = ourFont->mWeight.GetIntValue(); - } - else if (ourFont->mWeight.GetUnit() == eCSSUnit_Enumerated) { - PRInt32 value = ourFont->mWeight.GetIntValue(); - switch (value) { - case NS_STYLE_FONT_WEIGHT_NORMAL: - case NS_STYLE_FONT_WEIGHT_BOLD: - font->mFont.weight = value; - break; - case NS_STYLE_FONT_WEIGHT_BOLDER: - case NS_STYLE_FONT_WEIGHT_LIGHTER: - font->mFont.weight = (parentFont->mFont.weight + value); - break; - } - } - - // font-size: enum, length, percent - if (ourFont->mSize.GetUnit() == eCSSUnit_Enumerated) { - static float kFontScale[7] = { - 0.5f, // xx-small - 0.666667f, // x-small - 0.833333f, // small - 1.0f, // medium - 1.5f, // large - 1.5f * 1.5f, // x-large - 1.5f * 1.5f * 1.5f, // xx-large - }; - PRInt32 value = ourFont->mSize.GetIntValue(); - - const nsFont& normal = aPresContext->GetDefaultFont(); // use normal font or body font?? - if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) && - (value <= NS_STYLE_FONT_SIZE_XXLARGE)) { - font->mFont.size = (nscoord)((float)normal.size * kFontScale[value]); - } - else if (NS_STYLE_FONT_SIZE_LARGER == value) { - PRInt32 index; - for (index = NS_STYLE_FONT_SIZE_XXSMALL; - index < NS_STYLE_FONT_SIZE_XXLARGE; index++) - if (parentFont->mFont.size < (nscoord)((float)normal.size * kFontScale[index])) - break; - font->mFont.size = (nscoord)((float)normal.size * kFontScale[index]); - } - else if (NS_STYLE_FONT_SIZE_SMALLER == value) { - PRInt32 index; - for (index = NS_STYLE_FONT_SIZE_XXLARGE; - index > NS_STYLE_FONT_SIZE_XXSMALL; index--) - if (parentFont->mFont.size > (nscoord)((float)normal.size * kFontScale[index])) - break; - font->mFont.size = (nscoord)((float)normal.size * kFontScale[index]); - } - } - else if (ourFont->mSize.IsLengthUnit()) { - font->mFont.size = CalcLength(ourFont->mSize, parentFont, aPresContext); - } - else if (ourFont->mSize.GetUnit() == eCSSUnit_Percent) { - font->mFont.size = (nscoord)((float)(parentFont->mFont.size) * ourFont->mSize.GetFloatValue()); - } - - NS_IF_RELEASE(parentContext); - } - } - - nsCSSText* ourText; - if (NS_OK == mDeclaration->GetData(kCSSTextSID, (nsCSSStruct**)&ourText)) { - if (nsnull != ourText) { - // Get our text style and our parent's text style - nsStyleText* text = (nsStyleText*) aContext->GetData(kStyleTextSID); - - // letter-spacing - if (ourText->mLetterSpacing.IsLengthUnit()) { - text->mLetterSpacing.Set(CalcLength(ourText->mLetterSpacing, - font, aPresContext)); - } - else if (ourText->mLetterSpacing.GetUnit() == eCSSUnit_Enumerated) { - text->mLetterSpacing.SetAuto(); - } - - // line-height - if (ourText->mLineHeight.IsLengthUnit()) { - text->mLineHeight.Set(CalcLength(ourText->mLineHeight, - font, aPresContext)); - } - else if (ourText->mLineHeight.GetUnit() == eCSSUnit_Enumerated) { - text->mLineHeight.SetAuto(); - } - else if (ourText->mLineHeight.GetUnit() == eCSSUnit_Percent) { - text->mLineHeight.Set(ourText->mLineHeight.GetFloatValue()); - } - - // text-align - if (ourText->mTextAlign.GetUnit() == eCSSUnit_Enumerated) { - text->mTextAlign = ourText->mTextAlign.GetIntValue(); - } - - // text-indent - if (ourText->mTextIndent.IsLengthUnit()) { - text->mTextIndent.Set(CalcLength(ourText->mTextIndent, - font, aPresContext)); - } - else if (ourText->mTextIndent.GetUnit() == eCSSUnit_Percent) { - text->mTextIndent.Set(ourText->mTextIndent.GetFloatValue()); - } - - // text-decoration: enum, absolute (bit field) - if ((ourText->mDecoration.GetUnit() == eCSSUnit_Enumerated) || - (ourText->mDecoration.GetUnit() == eCSSUnit_Absolute)) { - PRInt32 td = ourText->mDecoration.GetIntValue(); - font->mFont.decorations = td; - text->mTextDecoration = td; - } - - // text-transform - if (ourText->mTextTransform.GetUnit() == eCSSUnit_Enumerated) { - text->mTextTransform = ourText->mTextTransform.GetIntValue(); - } - - // vertical-align - if (ourText->mVerticalAlign.IsLengthUnit()) { - text->mVerticalAlign.Set(CalcLength(ourText->mVerticalAlign, - font, aPresContext)); - } - else if (ourText->mVerticalAlign.GetUnit() == eCSSUnit_Enumerated) { - text->mVerticalAlign.Set(ourText->mVerticalAlign.GetIntValue(), eStyleUnit_Enumerated); - } - else if (ourText->mVerticalAlign.GetUnit() == eCSSUnit_Percent) { - text->mVerticalAlign.Set(ourText->mVerticalAlign.GetFloatValue()); - } - - // white-space - if (ourText->mWhiteSpace.GetUnit() == eCSSUnit_Enumerated) { - text->mWhiteSpace = ourText->mWhiteSpace.GetIntValue(); - } - - // word-spacing - if (ourText->mWordSpacing.IsLengthUnit()) { - text->mWordSpacing.Set(CalcLength(ourText->mWordSpacing, - font, aPresContext)); - } - else if (ourText->mWordSpacing.GetUnit() == eCSSUnit_Enumerated) { - text->mWordSpacing.SetAuto(); - } - } - } - - nsCSSDisplay* ourDisplay; - if (NS_OK == mDeclaration->GetData(kCSSDisplaySID, (nsCSSStruct**)&ourDisplay)) { - if (nsnull != ourDisplay) { - // Get our style and our parent's style - nsStyleDisplay* display = (nsStyleDisplay*) - aContext->GetData(kStyleDisplaySID); - - // display - display->mDisplay = NS_STYLE_DISPLAY_INLINE; - if (ourDisplay->mDisplay.GetUnit() == eCSSUnit_Enumerated) { - display->mDisplay = ourDisplay->mDisplay.GetIntValue(); - } - - // direction: enum - display->mDirection = NS_STYLE_DIRECTION_LTR; - if (ourDisplay->mDirection.GetUnit() == eCSSUnit_Enumerated) { - display->mDirection = ourDisplay->mDirection.GetIntValue(); - } - - // clear: enum - if (ourDisplay->mClear.GetUnit() == eCSSUnit_Enumerated) { - display->mBreakType = ourDisplay->mClear.GetIntValue(); - } - - // float: enum - if (ourDisplay->mFloat.GetUnit() == eCSSUnit_Enumerated) { - display->mFloats = ourDisplay->mFloat.GetIntValue(); - } - } - } - - - nsCSSColor* ourColor; - if (NS_OK == mDeclaration->GetData(kCSSColorSID, (nsCSSStruct**)&ourColor)) { - if (nsnull != ourColor) { - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - - // color: color - if (ourColor->mColor.GetUnit() == eCSSUnit_Color) { - color->mColor = ourColor->mColor.GetColorValue(); - } - - // cursor: enum - if (ourColor->mCursor.GetUnit() == eCSSUnit_Enumerated) { - color->mCursor = ourColor->mCursor.GetIntValue(); - } - - // cursor-image: string - if (ourColor->mCursorImage.GetUnit() == eCSSUnit_String) { - ourColor->mCursorImage.GetStringValue(color->mCursorImage); - } - - // background-color: color, enum (flags) - if (ourColor->mBackColor.GetUnit() == eCSSUnit_Color) { - color->mBackgroundColor = ourColor->mBackColor.GetColorValue(); - color->mBackgroundFlags &= ~NS_STYLE_BG_COLOR_TRANSPARENT; - } - else if (ourColor->mBackColor.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundFlags |= NS_STYLE_BG_COLOR_TRANSPARENT; - } - - // background-image: string, enum (flags) - if (ourColor->mBackImage.GetUnit() == eCSSUnit_String) { - ourColor->mBackImage.GetStringValue(color->mBackgroundImage); - color->mBackgroundFlags &= ~NS_STYLE_BG_IMAGE_NONE; - } - else if (ourColor->mBackImage.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundFlags |= NS_STYLE_BG_IMAGE_NONE; - } - - // background-repeat: enum - if (ourColor->mBackRepeat.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundRepeat = ourColor->mBackRepeat.GetIntValue(); - } - - // background-attachment: enum - if (ourColor->mBackAttachment.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundAttachment = ourColor->mBackAttachment.GetIntValue(); - } - - // background-position: length, percent (flags) - if (ourColor->mBackPositionX.GetUnit() == eCSSUnit_Percent) { - color->mBackgroundXPosition = (nscoord)(TWIPS_CONST_FLOAT * ourColor->mBackPositionX.GetFloatValue()); - color->mBackgroundFlags |= NS_STYLE_BG_X_POSITION_PERCENT; - color->mBackgroundFlags &= ~NS_STYLE_BG_X_POSITION_LENGTH; - } - else if (ourColor->mBackPositionX.IsLengthUnit()) { - color->mBackgroundXPosition = CalcLength(ourColor->mBackPositionX, - font, aPresContext); - color->mBackgroundFlags |= NS_STYLE_BG_X_POSITION_LENGTH; - color->mBackgroundFlags &= ~NS_STYLE_BG_X_POSITION_PERCENT; - } - if (ourColor->mBackPositionY.GetUnit() == eCSSUnit_Percent) { - color->mBackgroundYPosition = (nscoord)(TWIPS_CONST_FLOAT * ourColor->mBackPositionY.GetFloatValue()); - color->mBackgroundFlags |= NS_STYLE_BG_Y_POSITION_PERCENT; - color->mBackgroundFlags &= ~NS_STYLE_BG_Y_POSITION_LENGTH; - } - else if (ourColor->mBackPositionY.IsLengthUnit()) { - color->mBackgroundYPosition = CalcLength(ourColor->mBackPositionY, - font, aPresContext); - color->mBackgroundFlags |= NS_STYLE_BG_Y_POSITION_LENGTH; - color->mBackgroundFlags &= ~NS_STYLE_BG_Y_POSITION_PERCENT; - } - - // XXX: NYI nsCSSValue mBackFilter; - } - } - - nsCSSMargin* ourMargin; - if (NS_OK == mDeclaration->GetData(kCSSMarginSID, (nsCSSStruct**)&ourMargin)) { - if (nsnull != ourMargin) { - nsStyleSpacing* spacing = (nsStyleSpacing*) - aContext->GetData(kStyleSpacingSID); - nsStyleBorder* border = (nsStyleBorder*) - aContext->GetData(kStyleBorderSID); - - // margin - if (nsnull != ourMargin->mMargin) { - if (ourMargin->mMargin->mLeft.IsLengthUnit()) { - spacing->mMargin.left = CalcLength(ourMargin->mMargin->mLeft, font, aPresContext); - } else if (ourMargin->mMargin->mLeft.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.left = (nscoord)ourMargin->mMargin->mLeft.GetFloatValue(); - } - if (ourMargin->mMargin->mTop.IsLengthUnit()) { - spacing->mMargin.top = CalcLength(ourMargin->mMargin->mTop, font, aPresContext); - } else if (ourMargin->mMargin->mTop.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.top = (nscoord)ourMargin->mMargin->mTop.GetFloatValue(); - } - if (ourMargin->mMargin->mRight.IsLengthUnit()) { - spacing->mMargin.right = CalcLength(ourMargin->mMargin->mRight, font, aPresContext); - } else if (ourMargin->mMargin->mRight.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.right = (nscoord)ourMargin->mMargin->mRight.GetFloatValue(); - } - if (ourMargin->mMargin->mBottom.IsLengthUnit()) { - spacing->mMargin.bottom = CalcLength(ourMargin->mMargin->mBottom, font, aPresContext); - } else if (ourMargin->mMargin->mBottom.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.bottom = (nscoord)ourMargin->mMargin->mBottom.GetFloatValue(); - } - } - - // padding - if (nsnull != ourMargin->mPadding) { - if (ourMargin->mPadding->mLeft.IsLengthUnit()) { - spacing->mPadding.left = CalcLength(ourMargin->mPadding->mLeft, font, aPresContext); - } else if (ourMargin->mPadding->mLeft.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.left = (nscoord)ourMargin->mPadding->mLeft.GetFloatValue(); - } - if (ourMargin->mPadding->mTop.IsLengthUnit()) { - spacing->mPadding.top = CalcLength(ourMargin->mPadding->mTop, font, aPresContext); - } else if (ourMargin->mPadding->mTop.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.top = (nscoord)ourMargin->mPadding->mTop.GetFloatValue(); - } - if (ourMargin->mPadding->mRight.IsLengthUnit()) { - spacing->mPadding.right = CalcLength(ourMargin->mPadding->mRight, font, aPresContext); - } else if (ourMargin->mPadding->mRight.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.right = (nscoord)ourMargin->mPadding->mRight.GetFloatValue(); - } - if (ourMargin->mPadding->mBottom.IsLengthUnit()) { - spacing->mPadding.bottom = CalcLength(ourMargin->mPadding->mBottom, font, aPresContext); - } else if (ourMargin->mPadding->mBottom.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.bottom = (nscoord)ourMargin->mPadding->mBottom.GetFloatValue(); - } - } - - // border-size - if (nsnull != ourMargin->mBorder) { - nsCSSRect* ourBorder = ourMargin->mBorder; - // XXX thin, thick, medium - if (ourBorder->mLeft.IsLengthUnit()) { - border->mSize.left = CalcLength(ourBorder->mLeft, font, aPresContext); - } else if (ourBorder->mLeft.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.left = (nscoord)ourBorder->mLeft.GetFloatValue(); - } - if (ourBorder->mTop.IsLengthUnit()) { - border->mSize.top = CalcLength(ourBorder->mTop, font, aPresContext); - } else if (ourBorder->mTop.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.top = (nscoord)ourBorder->mTop.GetFloatValue(); - } - if (ourBorder->mRight.IsLengthUnit()) { - border->mSize.right = CalcLength(ourBorder->mRight, font, aPresContext); - } else if (ourBorder->mRight.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.right = (nscoord)ourBorder->mRight.GetFloatValue(); - } - if (ourBorder->mBottom.IsLengthUnit()) { - border->mSize.bottom = CalcLength(ourBorder->mBottom, font, aPresContext); - } else if (ourBorder->mBottom.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.bottom = (nscoord)ourBorder->mBottom.GetFloatValue(); - } - } - - // border-style - if (nsnull != ourMargin->mStyle) { - nsCSSRect* ourStyle = ourMargin->mStyle; - if (ourStyle->mTop.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_TOP] = ourStyle->mTop.GetIntValue(); - } - if (ourStyle->mRight.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_RIGHT] = ourStyle->mRight.GetIntValue(); - } - if (ourStyle->mBottom.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_BOTTOM] = ourStyle->mBottom.GetIntValue(); - } - if (ourStyle->mLeft.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_LEFT] = ourStyle->mLeft.GetIntValue(); - } - } - - // border-color - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - if (nsnull != ourMargin->mColor) { - nsCSSRect* ourColor = ourMargin->mColor; - if (ourColor->mTop.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_TOP] = ourColor->mTop.GetColorValue(); - } - if (ourColor->mRight.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_RIGHT] = ourColor->mRight.GetColorValue(); - } - if (ourColor->mBottom.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_BOTTOM] = ourColor->mBottom.GetColorValue(); - } - if (ourColor->mLeft.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_LEFT] = ourColor->mLeft.GetColorValue(); - } - } - } - } - - nsCSSPosition* ourPosition; - if (NS_OK == mDeclaration->GetData(kCSSPositionSID, (nsCSSStruct**)&ourPosition)) { - if (nsnull != ourPosition) { - nsStylePosition* position = (nsStylePosition*)aContext->GetData(kStylePositionSID); - - // positioning scheme - if (ourPosition->mPosition.GetUnit() == eCSSUnit_Enumerated) { - position->mPosition = ourPosition->mPosition.GetIntValue(); - } - - // overflow - if (ourPosition->mOverflow.GetUnit() == eCSSUnit_Enumerated) { - position->mOverflow = ourPosition->mOverflow.GetIntValue(); - } - - // box offsets. note: default value is auto so we don't check for it here - if (ourPosition->mLeft.IsLengthUnit()) { - position->mLeftOffset = CalcLength(ourPosition->mLeft, font, aPresContext); - position->mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mHeight.GetUnit() == eCSSUnit_Percent) { - position->mLeftOffset = (nscoord)(100 * ourPosition->mLeft.GetFloatValue()); - position->mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - if (ourPosition->mTop.IsLengthUnit()) { - position->mTopOffset = CalcLength(ourPosition->mTop, font, aPresContext); - position->mTopOffsetFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mHeight.GetUnit() == eCSSUnit_Percent) { - position->mTopOffset = (nscoord)(100 * ourPosition->mTop.GetFloatValue()); - position->mTopOffsetFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - if (ourPosition->mWidth.IsLengthUnit()) { - position->mWidth = CalcLength(ourPosition->mWidth, font, aPresContext); - position->mWidthFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mWidth.GetUnit() == eCSSUnit_Percent) { - position->mWidth = (nscoord)(100 * ourPosition->mWidth.GetFloatValue()); - position->mWidthFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - if (ourPosition->mHeight.IsLengthUnit()) { - position->mHeight = CalcLength(ourPosition->mHeight, font, aPresContext); - position->mHeightFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mHeight.GetUnit() == eCSSUnit_Percent) { - position->mHeight = (nscoord)(100 * ourPosition->mHeight.GetFloatValue()); - position->mHeightFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - - // z-index - if (ourPosition->mZIndex.GetUnit() == eCSSUnit_Enumerated) { - position->mPosition = ourPosition->mPosition.GetIntValue(); - } else if (ourPosition->mZIndex.GetUnit() == eCSSUnit_Absolute) { - position->mZIndex = ourPosition->mZIndex.GetIntValue(); - } - - // clip property - if (nsnull != ourPosition->mClip) { - position->mClipFlags = NS_STYLE_CLIP_RECT; - - if (ourPosition->mClip->mTop.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.top = ourPosition->mClip->mTop.GetIntValue(); - } else if (ourPosition->mClip->mTop.IsLengthUnit()) { - position->mClip.top = CalcLength(ourPosition->mClip->mTop, font, aPresContext); - } - if (ourPosition->mClip->mRight.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.right = ourPosition->mClip->mRight.GetIntValue(); - } else if (ourPosition->mClip->mRight.IsLengthUnit()) { - position->mClip.right = CalcLength(ourPosition->mClip->mRight, font, aPresContext); - } - if (ourPosition->mClip->mBottom.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.bottom = ourPosition->mClip->mBottom.GetIntValue(); - } else if (ourPosition->mClip->mBottom.IsLengthUnit()) { - position->mClip.bottom = CalcLength(ourPosition->mClip->mBottom, font, aPresContext); - } - if (ourPosition->mClip->mLeft.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.left = ourPosition->mClip->mLeft.GetIntValue(); - } else if (ourPosition->mClip->mLeft.IsLengthUnit()) { - position->mClip.left = CalcLength(ourPosition->mClip->mLeft, font, aPresContext); - } - } - } - } - - nsCSSList* ourList; - if (NS_OK == mDeclaration->GetData(kCSSListSID, (nsCSSStruct**)&ourList)) { - if (nsnull != ourList) { - nsStyleList* list = (nsStyleList*)aContext->GetData(kStyleListSID); - - // list-style-type: enum - if (ourList->mType.GetUnit() == eCSSUnit_Enumerated) { - list->mListStyleType = ourList->mType.GetIntValue(); - } - - if (ourList->mImage.GetUnit() == eCSSUnit_String) { - // list-style-image: string - ourList->mImage.GetStringValue(list->mListStyleImage); - } - else if (ourList->mImage.GetUnit() == eCSSUnit_Enumerated) { - // list-style-image: none - list->mListStyleImage = ""; - } - - // list-style-position: enum - if (ourList->mPosition.GetUnit() == eCSSUnit_Enumerated) { - list->mListStylePosition = ourList->mPosition.GetIntValue(); - } - } - } - } -} - - - -static void ListSelector(FILE* out, const nsCSSSelector* aSelector) -{ - nsAutoString buffer; - - if (nsnull != aSelector->mTag) { - aSelector->mTag->ToString(buffer); - fputs(buffer, out); - } - if (nsnull != aSelector->mID) { - aSelector->mID->ToString(buffer); - fputs("#", out); - fputs(buffer, out); - } - if (nsnull != aSelector->mClass) { - aSelector->mClass->ToString(buffer); - fputs(".", out); - fputs(buffer, out); - } - if (nsnull != aSelector->mPseudoClass) { - aSelector->mPseudoClass->ToString(buffer); - fputs(":", out); - fputs(buffer, out); - } -} - -void CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const -{ - // Indent - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - const nsCSSSelector* selector = &mSelector; - - while (nsnull != selector) { - ListSelector(out, selector); - fputs(" ", out); - selector = selector->mNext; - } - - nsAutoString buffer; - - buffer.Append("weight: "); - buffer.Append(mWeight, 10); - buffer.Append(" "); - fputs(buffer, out); - if (nsnull != mDeclaration) { - mDeclaration->List(out); - } - else { - fputs("{ null declaration }", out); - } - fputs("\n", out); -} - -NS_HTML nsresult - NS_NewCSSStyleRule(nsICSSStyleRule** aInstancePtrResult, const nsCSSSelector& aSelector) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSStyleRuleImpl *it = new CSSStyleRuleImpl(aSelector); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSStyleRuleIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp deleted file mode 100644 index b0fce35d38c..00000000000 --- a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp +++ /dev/null @@ -1,368 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSStyleSheet.h" -#include "nsIArena.h" -#include "nsCRT.h" -#include "nsIAtom.h" -#include "nsIURL.h" -#include "nsISupportsArray.h" -#include "nsICSSStyleRule.h" -#include "nsIHTMLContent.h" -#include "nsIFrame.h" -#include "nsString.h" -#include "nsIPtr.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID); -static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID); - -NS_DEF_PTR(nsIHTMLContent); -NS_DEF_PTR(nsIContent); -NS_DEF_PTR(nsIStyleRule); -NS_DEF_PTR(nsICSSStyleRule); -NS_DEF_PTR(nsIURL); -NS_DEF_PTR(nsISupportsArray); -NS_DEF_PTR(nsICSSStyleSheet); - -class CSSStyleSheetImpl : public nsICSSStyleSheet { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - CSSStyleSheetImpl(nsIURL* aURL); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRBool SelectorMatches(nsCSSSelector* aSelector, - nsIContent* aContent); - virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults); - - virtual nsIURL* GetURL(void); - - virtual PRBool ContainsStyleSheet(nsIURL* aURL); - - virtual void AppendStyleSheet(nsICSSStyleSheet* aSheet); - - // XXX do these belong here or are they generic? - virtual void PrependStyleRule(nsICSSStyleRule* aRule); - virtual void AppendStyleRule(nsICSSStyleRule* aRule); - - // XXX style rule enumerations - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - // These are not supported and are not implemented! - CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy); - CSSStyleSheetImpl& operator=(const CSSStyleSheetImpl& aCopy); - -protected: - virtual ~CSSStyleSheetImpl(); - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsIURLPtr mURL; - nsICSSStyleSheetPtr mFirstChild; - nsISupportsArrayPtr mRules; - nsICSSStyleSheetPtr mNext; -}; - - -void* CSSStyleSheetImpl::operator new(size_t size) -{ - CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) -{ - CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void CSSStyleSheetImpl::operator delete(void* ptr) -{ - CSSStyleSheetImpl* sheet = (CSSStyleSheetImpl*) ptr; - if (nsnull != sheet) { - if (sheet->mInHeap) { - ::delete ptr; - } - } -} - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - -CSSStyleSheetImpl::CSSStyleSheetImpl(nsIURL* aURL) - : nsICSSStyleSheet(), - mURL(nsnull), mFirstChild(nsnull), mRules(nsnull), mNext(nsnull) -{ - NS_INIT_REFCNT(); - mURL.SetAddRef(aURL); -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + CSSStyleSheet size: %d\n", gInstanceCount, sizeof(*this)); -#endif -} - -CSSStyleSheetImpl::~CSSStyleSheetImpl() -{ -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - CSSStyleSheet\n", gInstanceCount); -#endif -} - -NS_IMPL_ADDREF(CSSStyleSheetImpl) -NS_IMPL_RELEASE(CSSStyleSheetImpl) - -nsresult CSSStyleSheetImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kICSSStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsICSSStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsIStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -PRBool CSSStyleSheetImpl::SelectorMatches(nsCSSSelector* aSelector, nsIContent* aContent) -{ - PRBool result = PR_FALSE; - - if ((nsnull == aSelector->mTag) || (aSelector->mTag == aContent->GetTag())) { - if ((nsnull != aSelector->mClass) || (nsnull != aSelector->mID)) { - nsIHTMLContentPtr htmlContent; - if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, htmlContent.Query())) { - if ((nsnull == aSelector->mClass) || (aSelector->mClass == htmlContent->GetClass())) { - if ((nsnull == aSelector->mID) || (aSelector->mID == htmlContent->GetID())) { - result = PR_TRUE; - } - } - } - } - else { - result = PR_TRUE; - } - } - return result; -} - -PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) -{ - NS_PRECONDITION(nsnull != aPresContext, "null arg"); - NS_PRECONDITION(nsnull != aContent, "null arg"); -// NS_PRECONDITION(nsnull != aParentFrame, "null arg"); - NS_PRECONDITION(nsnull != aResults, "null arg"); - - PRInt32 matchCount = 0; - nsICSSStyleSheet* child = mFirstChild; - while (nsnull != child) { - matchCount += child->RulesMatching(aPresContext, aContent, aParentFrame, aResults); - child = ((CSSStyleSheetImpl*)child)->mNext; - } - - PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); - - for (PRInt32 index = 0; index < count; index++) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - - nsCSSSelector* selector = rule->FirstSelector(); - if (SelectorMatches(selector, aContent)) { - selector = selector->mNext; - nsIFrame* frame = aParentFrame; - while ((nsnull != selector) && (nsnull != frame)) { // check compound selectors - nsIContentPtr content; - frame->GetContent(content.AssignRef()); - if (SelectorMatches(selector, content)) { - selector = selector->mNext; - } - frame->GetGeometricParent(frame); - } - if (nsnull == selector) { // ran out, it matched - nsIStyleRulePtr iRule; - if (NS_OK == rule->QueryInterface(kIStyleRuleIID, iRule.Query())) { - aResults->AppendElement(iRule); - matchCount++; - } - } - } - } - return matchCount; -} - -nsIURL* CSSStyleSheetImpl::GetURL(void) -{ - return mURL.AddRef(); -} - -PRBool CSSStyleSheetImpl::ContainsStyleSheet(nsIURL* aURL) -{ - NS_PRECONDITION(nsnull != aURL, "null arg"); - - PRBool result = (*mURL == *aURL); - - nsICSSStyleSheet* child = mFirstChild; - while ((PR_FALSE == result) && (nsnull != child)) { - result = child->ContainsStyleSheet(aURL); - child = ((CSSStyleSheetImpl*)child)->mNext; - } - return result; -} - -void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (mFirstChild.IsNull()) { - mFirstChild.SetAddRef(aSheet); - } - else { - nsICSSStyleSheet* child = mFirstChild; - while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) { - child = ((CSSStyleSheetImpl*)child)->mNext; - } - ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); - } -} - -void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) -{ - NS_PRECONDITION(nsnull != aRule, "null arg"); - //XXX replace this with a binary search? - PRInt32 weight = aRule->GetWeight(); - if (mRules.IsNull()) { - if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) - return; - } - PRInt32 index = mRules->Count(); - while (0 <= --index) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - if (rule->GetWeight() > weight) { // insert before rules with equal or lesser weight - break; - } - } - mRules->InsertElementAt(aRule, index + 1); -} - -void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) -{ - NS_PRECONDITION(nsnull != aRule, "null arg"); - - //XXX replace this with a binary search? - PRInt32 weight = aRule->GetWeight(); - if (mRules.IsNull()) { - if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) - return; - } - PRInt32 count = mRules->Count(); - PRInt32 index = -1; - while (++index < count) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - if (rule->GetWeight() < weight) { // insert after rules with equal or greater weight (before lower weight) - break; - } - } - mRules->InsertElementAt(aRule, index); -} - -void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const -{ - nsAutoString buffer; - PRInt32 index; - - // Indent - for (index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("CSS Style Sheet: ", out); - mURL->ToString(buffer); - fputs(buffer, out); - fputs("\n", out); - - const nsICSSStyleSheet* child = mFirstChild; - while (nsnull != child) { - child->List(out, aIndent + 1); - child = ((CSSStyleSheetImpl*)child)->mNext; - } - - PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); - - for (index = 0; index < count; index++) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - rule->List(out, aIndent); - } -} - -NS_HTML nsresult - NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURL* aURL) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSStyleSheetImpl *it = new CSSStyleSheetImpl(aURL); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSStyleSheetIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/style/src/nsHTMLAttributes.cpp b/mozilla/layout/html/style/src/nsHTMLAttributes.cpp deleted file mode 100644 index 895e98e277c..00000000000 --- a/mozilla/layout/html/style/src/nsHTMLAttributes.cpp +++ /dev/null @@ -1,672 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsIHTMLAttributes.h" -#include "nsIStyleRule.h" -#include "nsString.h" -#include "nsISupportsArray.h" -#include "nsCRT.h" -#include "nsIArena.h" -#include "nsIStyleContext.h" -#include "nsHTMLAtoms.h" -#include "nsIHTMLContent.h" - -static NS_DEFINE_IID(kIHTMLAttributesIID, NS_IHTML_ATTRIBUTES_IID); -static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID); - - -struct HTMLAttribute { - HTMLAttribute(nsIAtom* aAttribute, const nsString& aValue) - : mAttribute(aAttribute), - mValue(aValue), - mNext(nsnull) - { - NS_IF_ADDREF(mAttribute); - } - - HTMLAttribute(nsIAtom* aAttribute, const nsHTMLValue& aValue) - : mAttribute(aAttribute), - mValue(aValue), - mNext(nsnull) - { - NS_IF_ADDREF(mAttribute); - } - - HTMLAttribute(const HTMLAttribute& aCopy) - : mAttribute(aCopy.mAttribute), - mValue(aCopy.mValue), - mNext(nsnull) - { - NS_IF_ADDREF(mAttribute); - } - - ~HTMLAttribute(void) - { - NS_IF_RELEASE(mAttribute); - } - - HTMLAttribute& operator=(const HTMLAttribute& aCopy) - { - NS_IF_RELEASE(mAttribute); - mAttribute = aCopy.mAttribute; - NS_IF_ADDREF(mAttribute); - mValue = aCopy.mValue; - return *this; - } - - PRBool operator==(const HTMLAttribute& aOther) const - { - return PRBool((mAttribute == aOther.mAttribute) && - (mValue == aOther.mValue)); - } - - void Reset(void) - { - NS_IF_RELEASE(mAttribute); - mValue.Reset(); - } - - void AppendToString(nsString& aBuffer) const - { - if (nsnull != mAttribute) { - nsAutoString temp; - mAttribute->ToString(temp); - aBuffer.Append(temp); - if (eHTMLUnit_Null != mValue.GetUnit()) { - aBuffer.Append(" = "); - mValue.AppendToString(aBuffer); - } - } - else { - aBuffer.Append("null"); - } - } - - void ToString(nsString& aBuffer) const - { - if (nsnull != mAttribute) { - mAttribute->ToString(aBuffer); - if (eHTMLUnit_Null != mValue.GetUnit()) { - aBuffer.Append(" = "); - mValue.AppendToString(aBuffer); - } - } - else { - aBuffer.SetLength(0); - aBuffer.Append("null"); - } - } - - nsIAtom* mAttribute; - nsHTMLValue mValue; - HTMLAttribute* mNext; -}; - -// ---------------- - - -class HTMLAttributesImpl: public nsIHTMLAttributes, public nsIStyleRule { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - HTMLAttributesImpl(nsIHTMLContent* aContent); - ~HTMLAttributesImpl(void); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRBool Equals(const nsIStyleRule* aRule) const; - virtual PRUint32 HashValue(void) const; - - virtual PRInt32 SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - virtual PRInt32 SetAttribute(nsIAtom* aAttribute, - const nsHTMLValue& aValue = nsHTMLValue::kNull); - virtual PRInt32 UnsetAttribute(nsIAtom* aAttribute); - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const; - virtual PRInt32 GetAllAttributeNames(nsISupportsArray* aArray) const; - virtual PRInt32 Count(void) const; - - virtual PRInt32 SetID(nsIAtom* aID); - virtual nsIAtom* GetID(void) const; - virtual PRInt32 SetClass(nsIAtom* aClass); // XXX this will have to change for CSS2 - virtual nsIAtom* GetClass(void) const; // XXX this will have to change for CSS2 - - virtual void MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext); - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - HTMLAttributesImpl(const HTMLAttributesImpl& aCopy); - HTMLAttributesImpl& operator=(const HTMLAttributesImpl& aCopy); - PRBool operator==(const HTMLAttributesImpl& aCopy) const; - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsIHTMLContent* mContent; - PRInt32 mCount; - HTMLAttribute* mFirst; - nsIAtom* mID; - nsIAtom* mClass; -}; - -void* HTMLAttributesImpl::operator new(size_t size) -{ - HTMLAttributesImpl* rv = (HTMLAttributesImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* HTMLAttributesImpl::operator new(size_t size, nsIArena* aArena) -{ - HTMLAttributesImpl* rv = (HTMLAttributesImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void HTMLAttributesImpl::operator delete(void* ptr) -{ - HTMLAttributesImpl* attr = (HTMLAttributesImpl*) ptr; - if (nsnull != attr) { - if (attr->mInHeap) { - ::delete ptr; - } - } -} - - -HTMLAttributesImpl::HTMLAttributesImpl(nsIHTMLContent* aContent) - : mContent(aContent), // weak ref - mFirst(nsnull), - mCount(0), - mID(nsnull), - mClass(nsnull) -{ - NS_INIT_REFCNT(); -} - -HTMLAttributesImpl::~HTMLAttributesImpl(void) -{ - HTMLAttribute* next = mFirst; - while (nsnull != next) { - HTMLAttribute* attr = next; - next = next->mNext; - delete attr; - } - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); -} - -NS_IMPL_ADDREF(HTMLAttributesImpl) -NS_IMPL_RELEASE(HTMLAttributesImpl) - -nsresult HTMLAttributesImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIHTMLAttributesIID)) { - *aInstancePtrResult = (void*) ((nsIHTMLAttributes*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleRuleIID)) { - *aInstancePtrResult = (void*) ((nsIStyleRule*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)(nsIHTMLAttributes*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - - -PRBool HTMLAttributesImpl::Equals(const nsIStyleRule* aRule) const -{ - nsIHTMLAttributes* iHTMLAttr; - - if (this == aRule) { - return PR_TRUE; - } - - if ((nsnull != aRule) && - (NS_OK == ((nsIStyleRule*)aRule)->QueryInterface(kIHTMLAttributesIID, (void**) &iHTMLAttr))) { - - const HTMLAttributesImpl* other = (HTMLAttributesImpl*)iHTMLAttr; - PRBool result = PR_FALSE; - - if (mCount == other->mCount) { - if ((mID == other->mID) && (mClass == other->mClass)) { - const HTMLAttribute* attr = mFirst; - const HTMLAttribute* otherAttr = other->mFirst; - - result = PR_TRUE; - while (nsnull != attr) { - if (! ((*attr) == (*otherAttr))) { - result = PR_FALSE; - break; - } - attr = attr->mNext; - otherAttr = otherAttr->mNext; - } - } - } - - NS_RELEASE(iHTMLAttr); - return result; - } - return PR_FALSE; -} - -PRUint32 HTMLAttributesImpl::HashValue(void) const -{ - return (PRUint32)this; -} - -PRInt32 HTMLAttributesImpl::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ - if (nsHTMLAtoms::id == aAttribute) { - nsIAtom* id = NS_NewAtom(aValue); - PRInt32 result = SetID (id); - NS_RELEASE(id); - return result; - } - if (nsHTMLAtoms::kClass == aAttribute) { - nsIAtom* classA = NS_NewAtom(aValue); - PRInt32 result = SetClass (classA); - NS_RELEASE(classA); - return result; - } - - HTMLAttribute* last = nsnull; - HTMLAttribute* attr = mFirst; - - while (nsnull != attr) { - if (attr->mAttribute == aAttribute) { - attr->mValue.Set (aValue); - return mCount; - } - last = attr; - attr = attr->mNext; - } - - attr = new HTMLAttribute(aAttribute, aValue); - if (nsnull == last) { - mFirst = attr; - } - else { - last->mNext = attr; - } - return ++mCount; -} - -PRInt32 HTMLAttributesImpl::SetAttribute(nsIAtom* aAttribute, const nsHTMLValue& aValue) -{ - if (nsHTMLAtoms::id == aAttribute) { - nsAutoString buffer; - nsIAtom* id = NS_NewAtom(aValue.GetStringValue(buffer)); - PRInt32 result = SetID (id); - NS_RELEASE(id); - return result; - } - if (nsHTMLAtoms::kClass == aAttribute) { - nsAutoString buffer; - nsIAtom* classA = NS_NewAtom(aValue.GetStringValue(buffer)); - PRInt32 result = SetClass (classA); - NS_RELEASE(classA); - return result; - } - - HTMLAttribute* last = nsnull; - HTMLAttribute* attr = mFirst; - - while (nsnull != attr) { - if (attr->mAttribute == aAttribute) { - attr->mValue = aValue; - return mCount; - } - last = attr; - attr = attr->mNext; - } - - attr = new HTMLAttribute(aAttribute, aValue); - if (nsnull == last) { - mFirst = attr; - } - else { - last->mNext = attr; - } - return ++mCount; -} - -PRInt32 HTMLAttributesImpl::UnsetAttribute(nsIAtom* aAttribute) -{ - if (nsHTMLAtoms::id == aAttribute) { - return SetID (nsnull); - } - if (nsHTMLAtoms::kClass == aAttribute) { - return SetClass (nsnull); - } - - HTMLAttribute* prev = nsnull; - HTMLAttribute* attr = mFirst; - - while (nsnull != attr) { - if (attr->mAttribute == aAttribute) { - if (nsnull == prev) { - mFirst = attr->mNext; - } - else { - prev->mNext = attr->mNext; - } - delete attr; - mCount--; - break; - } - prev = attr; - attr = attr->mNext; - } - return mCount; -} - -nsContentAttr HTMLAttributesImpl::GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const -{ - aValue.Reset(); - if (nsHTMLAtoms::id == aAttribute) { - nsIAtom* id = GetID(); - if (nsnull != id) { - nsAutoString buffer; - id->ToString(buffer); - aValue.Set(buffer); - NS_RELEASE(id); - return eContentAttr_HasValue; - } - return eContentAttr_NotThere; - } - if (nsHTMLAtoms::kClass == aAttribute) { - nsIAtom* classA = GetClass(); - if (nsnull != classA) { - nsAutoString buffer; - classA->ToString(buffer); - aValue.Set(buffer); - NS_RELEASE(classA); - return eContentAttr_HasValue; - } - return eContentAttr_NotThere; - } - - HTMLAttribute* attr = mFirst; - - while (nsnull != attr) { - if (attr->mAttribute == aAttribute) { - aValue = attr->mValue; - return ((attr->mValue.GetUnit() == eHTMLUnit_Null) ? eContentAttr_NoValue : eContentAttr_HasValue); - } - attr = attr->mNext; - } - return eContentAttr_NotThere; -} - -PRInt32 HTMLAttributesImpl::GetAllAttributeNames(nsISupportsArray* aArray) const -{ - NS_ASSERTION(nsnull != aArray, "null arg"); - - if (nsnull == aArray) { - return 0; - } - - if (nsnull != mID) { - aArray->AppendElement((nsIAtom*)nsHTMLAtoms::id); - } - if (nsnull != mClass) { - aArray->AppendElement((nsIAtom*)nsHTMLAtoms::kClass); - } - - HTMLAttribute* attr = mFirst; - - while (nsnull != attr) { - aArray->AppendElement(attr->mAttribute); - attr = attr->mNext; - } - return mCount; -} - -PRInt32 HTMLAttributesImpl::Count(void) const -{ - return mCount; -} - -PRInt32 HTMLAttributesImpl::SetID(nsIAtom* aID) -{ - if (aID != mID) { - if (nsnull != mID) { - NS_RELEASE(mID); - mCount--; - } - mID = aID; - if (nsnull != mID) { - NS_ADDREF(mID); - mCount++; - } - } - return mCount; -} - -nsIAtom* HTMLAttributesImpl::GetID(void) const -{ - NS_IF_ADDREF(mID); - return mID; -} - -PRInt32 HTMLAttributesImpl::SetClass(nsIAtom* aClass) -{ - if (aClass != mClass) { - if (nsnull != mClass) { - NS_RELEASE(mClass); - mCount--; - } - mClass = aClass; - if (nsnull != mClass) { - NS_ADDREF(mClass); - mCount++; - } - } - return mCount; -} - -nsIAtom* HTMLAttributesImpl::GetClass(void) const -{ - NS_IF_ADDREF(mClass); - return mClass; -} - -void HTMLAttributesImpl::MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) -{ - if (nsnull != mContent) { - mContent->MapAttributesInto(aContext, aPresContext); - } -} - - -void HTMLAttributesImpl::List(FILE* out, PRInt32 aIndent) const -{ - HTMLAttribute* attr = mFirst; - nsString buffer; - - while (nsnull != attr) { - fputs("\n", out); - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - attr->ToString(buffer); - fputs(buffer, out); - attr = attr->mNext; - } -} - -extern NS_HTML nsresult - NS_NewHTMLAttributes(nsIHTMLAttributes** aInstancePtrResult, nsIHTMLContent* aContent) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - HTMLAttributesImpl *it = new HTMLAttributesImpl(aContent); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIHTMLAttributesIID, (void **) aInstancePtrResult); -} - - -#if 0 - - -marginwidth; marginheight: px - -border: px - -align(DIV): left, right, center, justify -align: left, right, center, abscenter -valign: baseline, top, bottom, middle, center -align(image): abscenter, left, right, texttop, absbottom, baseline, center, bottom, top, middle, absmiddle - -dir: rtl, ltr - -width: px, % -height: px, % - -vspace; hspace: px - -type(list): none, disc, (circle | round), square, decimal, lower-roman, upper-roman, lower-alpha, upper-alpha - -href: url -target: string -src: url(string?) -color: color -face: string -suppress: bool - -style: string -class: string (list) -id: string -name: string - -//a -link; vlink; alink: color - -//body -background: url -bgcolor: color -text: color - -//frameset -bordercolor: color - -//layer -background: url -bgcolor: color - -//q -lang: string - -//table -background: url -bgcolor: color -bordercolor: color -cellspacing: px -cellpadding: px -toppadding; leftpadding; bottompadding; rightpadding: px -cols: int - -//td -background: url -bgcolor: color -nowrap: bool -colspan; rowspan: int - -//tr -background: url -bgcolor: color - -//colgroup -span: int - -//col -repeat: int - -//ul;ol -compact: bool -start: int - -//li -value: int - -//hr;spacer -size: px - -//multicol -cols: int -gutter: px - -//input -type: string -value: string - -//factory methods: -GetStringData -GetBoolData -GetInvBoolData -GetPixelIntData -GetValueOrPctData -GetValueData - -//tag methods -getAttribute -getIntAttribute -getKeywordAttribute -getSignedAttribute -getValueOrPctAttribute - - -//notes -nsIAtom->value table - -#endif diff --git a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp deleted file mode 100644 index 687a1030ee4..00000000000 --- a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIHTMLStyleSheet.h" -#include "nsIArena.h" -#include "nsCRT.h" -#include "nsIAtom.h" -#include "nsIURL.h" -#include "nsISupportsArray.h" -#include "nsIHTMLContent.h" -#include "nsIStyleRule.h" - -static NS_DEFINE_IID(kIHTMLStyleSheetIID, NS_IHTML_STYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID); -static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID); - - -class HTMLStyleSheetImpl : public nsIHTMLStyleSheet { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - HTMLStyleSheetImpl(nsIURL* aURL); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults); - - virtual nsIURL* GetURL(void); - - // XXX style rule enumerations - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - // These are not supported and are not implemented! - HTMLStyleSheetImpl(const HTMLStyleSheetImpl& aCopy); - HTMLStyleSheetImpl& operator=(const HTMLStyleSheetImpl& aCopy); - -protected: - virtual ~HTMLStyleSheetImpl(); - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsIURL* mURL; -}; - - -void* HTMLStyleSheetImpl::operator new(size_t size) -{ - HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena) -{ - HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void HTMLStyleSheetImpl::operator delete(void* ptr) -{ - HTMLStyleSheetImpl* sheet = (HTMLStyleSheetImpl*) ptr; - if (nsnull != sheet) { - if (sheet->mInHeap) { - ::delete ptr; - } - } -} - - - -HTMLStyleSheetImpl::HTMLStyleSheetImpl(nsIURL* aURL) - : nsIHTMLStyleSheet(), - mURL(aURL) -{ - NS_INIT_REFCNT(); - NS_ADDREF(mURL); -} - -HTMLStyleSheetImpl::~HTMLStyleSheetImpl() -{ - NS_RELEASE(mURL); -} - -NS_IMPL_ADDREF(HTMLStyleSheetImpl) -NS_IMPL_RELEASE(HTMLStyleSheetImpl) - -nsresult HTMLStyleSheetImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIHTMLStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsIHTMLStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsIStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) -{ - NS_PRECONDITION(nsnull != aPresContext, "null arg"); - NS_PRECONDITION(nsnull != aContent, "null arg"); -// NS_PRECONDITION(nsnull != aParentFrame, "null arg"); - NS_PRECONDITION(nsnull != aResults, "null arg"); - - PRInt32 matchCount = 0; - - nsIHTMLContent* htmlContent; - - // for now, just get the one and only style rule from the content - // this may need some special handling for pseudo-frames - if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) { - nsIStyleRule* rule = htmlContent->GetStyleRule(); - - if (nsnull != rule) { - aResults->AppendElement(rule); - NS_RELEASE(rule); - matchCount++; - } - - NS_RELEASE(htmlContent); - } - - return matchCount; -} - -nsIURL* HTMLStyleSheetImpl::GetURL(void) -{ - NS_ADDREF(mURL); - return mURL; -} - -void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const -{ - nsAutoString buffer; - - // Indent - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("HTML Style Sheet: ", out); - mURL->ToString(buffer); - fputs(buffer, out); - fputs("\n", out); - -} - -NS_HTML nsresult - NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult, nsIURL* aURL) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - HTMLStyleSheetImpl *it = new HTMLStyleSheetImpl(aURL); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIHTMLStyleSheetIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/style/src/nsHTMLValue.cpp b/mozilla/layout/html/style/src/nsHTMLValue.cpp deleted file mode 100644 index ed2df9aaab5..00000000000 --- a/mozilla/layout/html/style/src/nsHTMLValue.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsHTMLValue.h" -#include "nsString.h" -#include "nsCRT.h" - -const nsHTMLValue nsHTMLValue::kNull; - -nsHTMLValue::nsHTMLValue(void) - : mUnit(eHTMLUnit_Null) -{ - mValue.mString = nsnull; -} - -nsHTMLValue::nsHTMLValue(PRInt32 aValue, nsHTMLUnit aUnit) - : mUnit(aUnit) -{ - mValue.mInt = aValue; -} - -nsHTMLValue::nsHTMLValue(float aValue, nsHTMLUnit aUnit) - : mUnit(aUnit) -{ - mValue.mFloat = aValue; -} - -nsHTMLValue::nsHTMLValue(const nsString& aValue) - : mUnit(eHTMLUnit_String) -{ - mValue.mString = aValue.ToNewString(); -} - -nsHTMLValue::nsHTMLValue(nsISupports* aValue) - : mUnit(eHTMLUnit_ISupports) -{ - mValue.mISupports = aValue; - NS_IF_ADDREF(mValue.mISupports); -} - -nsHTMLValue::nsHTMLValue(nscolor aValue) - : mUnit(eHTMLUnit_Color) -{ - mValue.mColor = aValue; -} - -nsHTMLValue::nsHTMLValue(const nsHTMLValue& aCopy) - : mUnit(aCopy.mUnit) -{ - if (eHTMLUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = aCopy.mValue.mString->ToNewString(); - } - else { - mValue.mString = nsnull; - } - } - else if (eHTMLUnit_ISupports == mUnit) { - mValue.mISupports = aCopy.mValue.mISupports; - NS_IF_ADDREF(mValue.mISupports); - } - else if (eHTMLUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else if (eHTMLUnit_Percent == mUnit) { - mValue.mFloat = aCopy.mValue.mFloat; - } - else { - mValue.mInt = aCopy.mValue.mInt; - } -} - -nsHTMLValue::~nsHTMLValue(void) -{ - Reset(); -} - -nsHTMLValue& nsHTMLValue::operator=(const nsHTMLValue& aCopy) -{ - Reset(); - mUnit = aCopy.mUnit; - if (eHTMLUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = aCopy.mValue.mString->ToNewString(); - } - } - else if (eHTMLUnit_ISupports == mUnit) { - mValue.mISupports = aCopy.mValue.mISupports; - NS_IF_ADDREF(mValue.mISupports); - } - else if (eHTMLUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else if (eHTMLUnit_Percent == mUnit) { - mValue.mFloat = aCopy.mValue.mFloat; - } - else { - mValue.mInt = aCopy.mValue.mInt; - } - return *this; -} - -PRBool nsHTMLValue::operator==(const nsHTMLValue& aOther) const -{ - if (mUnit == aOther.mUnit) { - if (eHTMLUnit_String == mUnit) { - if (nsnull == mValue.mString) { - if (nsnull == aOther.mValue.mString) { - return PR_TRUE; - } - } - else if (nsnull != aOther.mValue.mString) { - return mValue.mString->Equals(*(aOther.mValue.mString)); - } - } - else if (eHTMLUnit_ISupports == mUnit) { - return PRBool(mValue.mISupports == aOther.mValue.mISupports); - } - else if (eHTMLUnit_Color == mUnit){ - return PRBool(mValue.mColor == aOther.mValue.mColor); - } - else if (eHTMLUnit_Percent == mUnit) { - return PRBool(mValue.mFloat == aOther.mValue.mFloat); - } - else { - return PRBool(mValue.mInt == aOther.mValue.mInt); - } - } - return PR_FALSE; -} - -void nsHTMLValue::Reset(void) -{ - if (eHTMLUnit_String == mUnit) { - if (nsnull != mValue.mString) { - delete mValue.mString; - } - } - else if (eHTMLUnit_ISupports == mUnit) { - NS_IF_RELEASE(mValue.mISupports); - } - mUnit = eHTMLUnit_Null; - mValue.mString = nsnull; -} - - -void nsHTMLValue::Set(PRInt32 aValue, nsHTMLUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mInt = aValue; -} - -void nsHTMLValue::Set(float aValue, nsHTMLUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mFloat = aValue; -} - -void nsHTMLValue::Set(const nsString& aValue) -{ - Reset(); - mUnit = eHTMLUnit_String; - mValue.mString = aValue.ToNewString(); -} - -void nsHTMLValue::Set(nsISupports* aValue) -{ - Reset(); - mUnit = eHTMLUnit_ISupports; - mValue.mISupports = aValue; - NS_IF_ADDREF(mValue.mISupports); -} - -void nsHTMLValue::Set(nscolor aValue) -{ - Reset(); - mUnit = eHTMLUnit_Color; - mValue.mColor = aValue; -} - -void nsHTMLValue::AppendToString(nsString& aBuffer) const -{ - if (eHTMLUnit_Null == mUnit) { - return; - } - - if (eHTMLUnit_String == mUnit) { - if (nsnull != mValue.mString) { - aBuffer.Append('"'); - aBuffer.Append(*(mValue.mString)); - aBuffer.Append('"'); - } - else { - aBuffer.Append("null str"); - } - } - else if (eHTMLUnit_ISupports == mUnit) { - aBuffer.Append("0x"); - aBuffer.Append((PRInt32)mValue.mISupports, 16); - } - else if (eHTMLUnit_Color == mUnit){ - aBuffer.Append("(0x"); - aBuffer.Append(NS_GET_R(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_G(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_B(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_A(mValue.mColor), 16); - aBuffer.Append(')'); - } - else if (eHTMLUnit_Percent == mUnit) { - aBuffer.Append(mValue.mFloat); - } - else { - aBuffer.Append(mValue.mInt, 10); - aBuffer.Append("[0x"); - aBuffer.Append(mValue.mInt, 16); - aBuffer.Append(']'); - } - - switch (mUnit) { - case eHTMLUnit_Null: break; - case eHTMLUnit_String: break; - case eHTMLUnit_ISupports: aBuffer.Append("ptr"); break; - case eHTMLUnit_Absolute: break; - case eHTMLUnit_Enumerated: aBuffer.Append("enum"); break; - case eHTMLUnit_Color: aBuffer.Append("rbga"); break; - case eHTMLUnit_Percent: aBuffer.Append("%"); break; - case eHTMLUnit_Pixel: aBuffer.Append("px"); break; - } - aBuffer.Append(' '); -} - -void nsHTMLValue::ToString(nsString& aBuffer) const -{ - aBuffer.SetLength(0); - AppendToString(aBuffer); -} - diff --git a/mozilla/layout/html/style/src/nsHTMLValue.h b/mozilla/layout/html/style/src/nsHTMLValue.h deleted file mode 100644 index a2f5309e614..00000000000 --- a/mozilla/layout/html/style/src/nsHTMLValue.h +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsHTMLValue_h___ -#define nsHTMLValue_h___ - -#include "nscore.h" -#include "nsColor.h" -#include "nsString.h" -#include "nsISupports.h" - - -enum nsHTMLUnit { - eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified - eHTMLUnit_String = 10, // (nsString) a string value - eHTMLUnit_ISupports = 20, // (nsISupports*) a ref counted interface - eHTMLUnit_Absolute = 50, // (int) simple value - eHTMLUnit_Enumerated = 51, // (int) value has enumerated meaning - eHTMLUnit_Color = 80, // (color) an RGBA value - eHTMLUnit_Percent = 90, // (float) 1.0 == 100%) value is percentage of something - - // Screen relative measure - eHTMLUnit_Pixel = 600, // (int) screen pixels -}; - -class nsHTMLValue { -public: - nsHTMLValue(void); - nsHTMLValue(PRInt32 aValue, nsHTMLUnit aUnit = eHTMLUnit_Absolute); - nsHTMLValue(float aValue, nsHTMLUnit aUnit = eHTMLUnit_Pixel); - nsHTMLValue(const nsString& aValue); - nsHTMLValue(nsISupports* aValue); - nsHTMLValue(nscolor aValue); - nsHTMLValue(const nsHTMLValue& aCopy); - ~nsHTMLValue(void); - - nsHTMLValue& operator=(const nsHTMLValue& aCopy); - PRBool operator==(const nsHTMLValue& aOther) const; - - nsHTMLUnit GetUnit(void) const { return mUnit; } - PRInt32 GetIntValue(void) const; - float GetFloatValue(void) const; - nsString& GetStringValue(nsString& aBuffer) const; - nsISupports* GetISupportsValue(void) const; - nscolor GetColorValue(void) const; - - void Reset(void); - void Set(PRInt32 aValue, nsHTMLUnit aUnit = eHTMLUnit_Absolute); - void Set(float aValue, nsHTMLUnit aUnit = eHTMLUnit_Pixel); - void Set(const nsString& aValue); - void Set(nsISupports* aValue); - void Set(nscolor aValue); - - void AppendToString(nsString& aBuffer) const; - void ToString(nsString& aBuffer) const; - -protected: - nsHTMLUnit mUnit; - union { - PRInt32 mInt; - float mFloat; - nsString* mString; - nsISupports* mISupports; - nscolor mColor; - } mValue; - -public: - static const nsHTMLValue kNull; -}; - -inline PRInt32 nsHTMLValue::GetIntValue(void) const -{ - NS_ASSERTION((mUnit == eHTMLUnit_Absolute) || - (mUnit == eHTMLUnit_Enumerated) || - (mUnit == eHTMLUnit_Pixel), "not an int value"); - if ((mUnit == eHTMLUnit_Absolute) || - (mUnit == eHTMLUnit_Enumerated) || - (mUnit == eHTMLUnit_Pixel)) { - return mValue.mInt; - } - return 0; -} - -inline float nsHTMLValue::GetFloatValue(void) const -{ - NS_ASSERTION(mUnit == eHTMLUnit_Percent, "not a float value"); - if (mUnit == eHTMLUnit_Percent) { - return mValue.mFloat; - } - return 0.0f; -} - -inline nsString& nsHTMLValue::GetStringValue(nsString& aBuffer) const -{ - NS_ASSERTION((mUnit == eHTMLUnit_String) || (mUnit == eHTMLUnit_Null), "not a string value"); - aBuffer.SetLength(0); - if ((mUnit == eHTMLUnit_String) && (nsnull != mValue.mString)) { - aBuffer.Append(*(mValue.mString)); - } - return aBuffer; -} - -inline nsISupports* nsHTMLValue::GetISupportsValue(void) const -{ - NS_ASSERTION(mUnit == eHTMLUnit_ISupports, "not an ISupports value"); - if (mUnit == eHTMLUnit_ISupports) { - NS_IF_ADDREF(mValue.mISupports); - return mValue.mISupports; - } - return nsnull; -} - -inline nscolor nsHTMLValue::GetColorValue(void) const -{ - NS_ASSERTION(mUnit == eHTMLUnit_Color, "not a color value"); - if (mUnit == eHTMLUnit_Color) { - return mValue.mColor; - } - return NS_RGB(0,0,0); -} - - -#endif /* nsHTMLValue_h___ */ - diff --git a/mozilla/layout/html/style/src/nsICSSDeclaration.h b/mozilla/layout/html/style/src/nsICSSDeclaration.h deleted file mode 100644 index 2c3c0e68c37..00000000000 --- a/mozilla/layout/html/style/src/nsICSSDeclaration.h +++ /dev/null @@ -1,318 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsICSSDeclaration_h___ -#define nsICSSDeclaration_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsColor.h" -#include "stdio.h" -#include "nsString.h" -#include "nsCoord.h" - - -enum nsCSSUnit { - eCSSUnit_Null = 0, // (n/a) null unit, value is not specified - eCSSUnit_Auto = 1, // (n/a) value is algorithmic - eCSSUnit_String = 10, // (nsString) a string value - eCSSUnit_Absolute = 50, // (int) simple value - eCSSUnit_Enumerated = 51, // (int) value has enumerated meaning - eCSSUnit_Color = 80, // (color) an RGBA value - eCSSUnit_Percent = 90, // (float) 1.0 == 100%) value is percentage of something - eCSSUnit_Number = 91, // (float) value is numeric (usually multiplier, different behavior that percent) - - // US English - eCSSUnit_Inch = 100, // (float) Standard length - eCSSUnit_Foot = 101, // (float) 12 inches - eCSSUnit_Mile = 102, // (float) 5280 feet - - // Metric - eCSSUnit_Millimeter = 207, // (float) 1/1000 meter - eCSSUnit_Centimeter = 208, // (float) 1/100 meter - eCSSUnit_Meter = 210, // (float) Standard length - eCSSUnit_Kilometer = 213, // (float) 1000 meters - - // US Typographic - eCSSUnit_Point = 300, // (float) 1/72 inch - eCSSUnit_Pica = 301, // (float) 12 points == 1/6 inch - - // European Typographic - eCSSUnit_Didot = 400, // (float) 15 didots == 16 points - eCSSUnit_Cicero = 401, // (float) 12 didots - - // relative units - // Font relative measure - eCSSUnit_EM = 800, // (float) == current font size - eCSSUnit_EN = 801, // (float) .5 em - eCSSUnit_XHeight = 802, // (float) distance from top of lower case x to baseline - eCSSUnit_CapHeight = 803, // (float) distance from top of uppercase case H to baseline - - // Screen relative measure - eCSSUnit_Pixel = 900 // (float) -}; - -struct nsCSSStruct { - virtual const nsID& GetID(void) = 0; -}; - -class nsCSSValue { -public: - nsCSSValue(void); - nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit); - nsCSSValue(float aValue, nsCSSUnit aUnit); - nsCSSValue(const nsString& aValue); - nsCSSValue(nscolor aValue); - nsCSSValue(const nsCSSValue& aCopy); - ~nsCSSValue(void); - - nsCSSValue& operator=(const nsCSSValue& aCopy); - PRBool operator==(const nsCSSValue& aOther) const; - - nsCSSUnit GetUnit(void) const { return mUnit; }; - PRBool IsLengthUnit(void) const - { return PRBool(eCSSUnit_Inch <= mUnit); } - PRBool IsFixedLengthUnit(void) const - { return PRBool((eCSSUnit_Inch <= mUnit) && (mUnit < eCSSUnit_EM)); } - PRBool IsRelativeLengthUnit(void) const - { return PRBool(eCSSUnit_EM <= mUnit); } - - PRInt32 GetIntValue(void) const; - float GetFloatValue(void) const; - nsString& GetStringValue(nsString& aBuffer) const; - nscolor GetColorValue(void) const; - nscoord GetLengthTwips(void) const; - - void Reset(void); - void Set(PRInt32 aValue, nsCSSUnit aUnit); - void Set(float aValue, nsCSSUnit aUnit); - void Set(const nsString& aValue); - void Set(nscolor aValue); - - void AppendToString(nsString& aBuffer, PRInt32 aPropID = -1) const; - void ToString(nsString& aBuffer, PRInt32 aPropID = -1) const; - -protected: - nsCSSUnit mUnit; - union { - PRInt32 mInt; - float mFloat; - nsString* mString; - nscolor mColor; - } mValue; -}; - -inline PRInt32 nsCSSValue::GetIntValue(void) const -{ - NS_ASSERTION((mUnit == eCSSUnit_Absolute) || - (mUnit == eCSSUnit_Enumerated), "not an int value"); - if ((mUnit == eCSSUnit_Absolute) || - (mUnit == eCSSUnit_Enumerated)) { - return mValue.mInt; - } - return 0; -} - -inline float nsCSSValue::GetFloatValue(void) const -{ - NS_ASSERTION((mUnit != eCSSUnit_Null) && - (mUnit != eCSSUnit_Absolute) && - (mUnit != eCSSUnit_Enumerated) && - (mUnit != eCSSUnit_String) && - (mUnit != eCSSUnit_Color), "not a float value"); - if ((mUnit != eCSSUnit_Null) && - (mUnit != eCSSUnit_Absolute) && - (mUnit != eCSSUnit_Enumerated) && - (mUnit != eCSSUnit_String) && - (mUnit != eCSSUnit_Color)) { - return mValue.mFloat; - } - return 0.0f; -} - -inline nsString& nsCSSValue::GetStringValue(nsString& aBuffer) const -{ - NS_ASSERTION((mUnit == eCSSUnit_String), "not a string value"); - aBuffer.Truncate(); - if ((mUnit == eCSSUnit_String) && (nsnull != mValue.mString)) { - aBuffer.Append(*(mValue.mString)); - } - return aBuffer; -} - -inline nscolor nsCSSValue::GetColorValue(void) const -{ - NS_ASSERTION((mUnit == eCSSUnit_Color), "not a color value"); - if (mUnit == eCSSUnit_Color) { - return mValue.mColor; - } - return NS_RGB(0,0,0); -} - -// SID for the nsCSSFont struct {f645dbf8-b48a-11d1-9ca5-0060088f9ff7} -#define NS_CSS_FONT_SID \ -{0xf645dbf8, 0xb48a, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// SID for the nsCSSColor struct {fd825f22-b48a-11d1-9ca5-0060088f9ff7} -#define NS_CSS_COLOR_SID \ -{0xfd825f22, 0xb48a, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// SID for the nsCSSText struct {fe13ce94-b48a-11d1-9ca5-0060088f9ff7} -#define NS_CSS_TEXT_SID \ -{0xfe13ce94, 0xb48a, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// SID for the nsCSSDisplay struct {fe13ce95-b48a-11d1-9ca5-0060088f9ff7} -#define NS_CSS_DISPLAY_SID \ -{0xfe13ce95, 0xb48a, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// SID for the nsCSSMargin struct {fe6019d4-b48a-11d1-9ca5-0060088f9ff7} -#define NS_CSS_MARGIN_SID \ -{0xfe6019d4, 0xb48a, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// SID for the nsCSSPosition struct {fee33b2a-b48a-11d1-9ca5-0060088f9ff7} -#define NS_CSS_POSITION_SID \ -{0xfee33b2a, 0xb48a, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// SID for the nsCSSList struct {603f8266-b48b-11d1-9ca5-0060088f9ff7} -#define NS_CSS_LIST_SID \ -{0x603f8266, 0xb48b, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -// IID for the nsICSSDeclaration interface {7b36b9ac-b48d-11d1-9ca5-0060088f9ff7} -#define NS_ICSS_DECLARATION_IID \ -{0x7b36b9ac, 0xb48d, 0x11d1, {0x9c, 0xa5, 0x00, 0x60, 0x08, 0x8f, 0x9f, 0xf7}} - -struct nsCSSFont : public nsCSSStruct { - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSValue mFamily; - nsCSSValue mStyle; - nsCSSValue mVariant; - nsCSSValue mWeight; - nsCSSValue mSize; -}; - -struct nsCSSColor : public nsCSSStruct { - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSValue mColor; - nsCSSValue mBackColor; - nsCSSValue mBackImage; - nsCSSValue mBackRepeat; - nsCSSValue mBackAttachment; - nsCSSValue mBackPositionX; - nsCSSValue mBackPositionY; - nsCSSValue mBackFilter; - nsCSSValue mCursor; - nsCSSValue mCursorImage; -}; - -struct nsCSSText : public nsCSSStruct { - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSValue mWordSpacing; - nsCSSValue mLetterSpacing; - nsCSSValue mDecoration; - nsCSSValue mVerticalAlign; - nsCSSValue mTextTransform; - nsCSSValue mTextAlign; - nsCSSValue mTextIndent; - nsCSSValue mLineHeight; - nsCSSValue mWhiteSpace; -}; - -struct nsCSSDisplay : public nsCSSStruct { - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSValue mDirection; - nsCSSValue mDisplay; - nsCSSValue mFloat; - nsCSSValue mClear; -}; - -struct nsCSSRect { - void List(FILE* out = 0, PRInt32 aPropID = -1, PRInt32 aIndent = 0) const; - - nsCSSValue mTop; - nsCSSValue mRight; - nsCSSValue mBottom; - nsCSSValue mLeft; -}; - -struct nsCSSMargin : public nsCSSStruct { - nsCSSMargin(void); - ~nsCSSMargin(void); - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSRect* mMargin; - nsCSSRect* mPadding; - nsCSSRect* mBorder; - nsCSSRect* mColor; - nsCSSRect* mStyle; -}; - -struct nsCSSPosition : public nsCSSStruct { - nsCSSPosition(void); - ~nsCSSPosition(void); - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSValue mPosition; - nsCSSValue mWidth; - nsCSSValue mHeight; - nsCSSValue mLeft; - nsCSSValue mTop; - nsCSSRect* mClip; - nsCSSValue mOverflow; - nsCSSValue mZIndex; - nsCSSValue mVisibility; - nsCSSValue mFilter; -}; - -struct nsCSSList : public nsCSSStruct { - const nsID& GetID(void); - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - nsCSSValue mType; - nsCSSValue mImage; - nsCSSValue mPosition; -}; - - -class nsICSSDeclaration : public nsISupports { -public: - virtual nsresult GetData(const nsID& aIID, nsCSSStruct** aData) = 0; - virtual nsresult EnsureData(const nsID& aSID, nsCSSStruct** aData) = 0; - - virtual nsresult AddValue(const char* aProperty, const nsCSSValue& aValue) = 0; - virtual nsresult AddValue(PRInt32 aProperty, const nsCSSValue& aValue) = 0; -// XXX make nscolor a struct to avoid type conflicts - virtual nsresult GetValue(const char* aProperty, nsCSSValue& aValue) = 0; - virtual nsresult GetValue(PRInt32 aProperty, nsCSSValue& aValue) = 0; - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -extern NS_HTML nsresult - NS_NewCSSDeclaration(nsICSSDeclaration** aInstancePtrResult); - -#endif /* nsICSSDeclaration_h___ */ - diff --git a/mozilla/layout/html/style/src/nsICSSStyleRule.h b/mozilla/layout/html/style/src/nsICSSStyleRule.h deleted file mode 100644 index 153397fe876..00000000000 --- a/mozilla/layout/html/style/src/nsICSSStyleRule.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsICSSStyleRule_h___ -#define nsICSSStyleRule_h___ - -#include -#include "nslayout.h" -#include "nsIStyleRule.h" -class nsIAtom; -class nsIArena; -class nsString; -class nsICSSDeclaration; - - -struct nsCSSSelector { -public: - nsCSSSelector(); - nsCSSSelector(nsIAtom* aTag, nsIAtom* aID, nsIAtom* aClass, nsIAtom* aPseudoClass); - nsCSSSelector(const nsCSSSelector& aCopy); - ~nsCSSSelector(); - - nsCSSSelector& operator=(const nsCSSSelector& aCopy); - PRBool Equals(const nsCSSSelector* aOther) const; - - void Set(const nsString& aTag, const nsString& aID, const nsString& aClass, const nsString& aPseudoClass); - -public: - nsIAtom* mTag; - nsIAtom* mID; - nsIAtom* mClass; // this'll have to be an array for CSS2 - nsIAtom* mPseudoClass; - - nsCSSSelector* mNext; -}; - -// IID for the nsICSSStyleRule interface {7c277af0-af19-11d1-8031-006008159b5a} -#define NS_ICSS_STYLE_RULE_IID \ -{0x7c277af0, 0xaf19, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsICSSStyleRule : public nsIStyleRule { -public: - virtual PRBool Equals(const nsIStyleRule* aRule) const = 0; - virtual PRUint32 HashValue(void) const = 0; - - virtual nsCSSSelector* FirstSelector(void) = 0; - virtual void AddSelector(const nsCSSSelector& aSelector) = 0; - virtual void DeleteSelector(nsCSSSelector* aSelector) = 0; - - virtual nsICSSDeclaration* GetDeclaration(void) const = 0; - virtual void SetDeclaration(nsICSSDeclaration* aDeclaration) = 0; - - virtual PRInt32 GetWeight(void) const = 0; - virtual void SetWeight(PRInt32 aWeight) = 0; - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -extern NS_HTML nsresult - NS_NewCSSStyleRule(nsICSSStyleRule** aInstancePtrResult, const nsCSSSelector& aSelector); - -#endif /* nsICSSStyleRule_h___ */ diff --git a/mozilla/layout/html/style/src/nsICSSStyleSheet.h b/mozilla/layout/html/style/src/nsICSSStyleSheet.h deleted file mode 100644 index f16ed263ed6..00000000000 --- a/mozilla/layout/html/style/src/nsICSSStyleSheet.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsICSSStyleSheet_h___ -#define nsICSSStyleSheet_h___ - -#include "nslayout.h" -#include "nsIStyleSheet.h" - -class nsICSSStyleRule; - -// IID for the nsICSSStyleSheet interface {8f83b0f0-b21a-11d1-8031-006008159b5a} -#define NS_ICSS_STYLE_SHEET_IID \ -{0x8f83b0f0, 0xb21a, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsICSSStyleSheet : public nsIStyleSheet { -public: - virtual PRBool ContainsStyleSheet(nsIURL* aURL) = 0; - - virtual void AppendStyleSheet(nsICSSStyleSheet* aSheet) = 0; - - // XXX do these belong here or are they generic? - virtual void PrependStyleRule(nsICSSStyleRule* aRule) = 0; - virtual void AppendStyleRule(nsICSSStyleRule* aRule) = 0; - -}; - -extern NS_HTML nsresult - NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURL* aURL); - -#endif /* nsICSSStyleSheet_h___ */ diff --git a/mozilla/layout/html/style/src/nsIHTMLAttributes.h b/mozilla/layout/html/style/src/nsIHTMLAttributes.h deleted file mode 100644 index f3f2428401e..00000000000 --- a/mozilla/layout/html/style/src/nsIHTMLAttributes.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIHTMLAttributes_h___ -#define nsIHTMLAttributes_h___ - -#include "nslayout.h" -#include "nsISupports.h" -#include "nsHTMLValue.h" -#include "nsIContent.h" -class nsIAtom; -class nsISupportsArray; -class nsIHTMLContent; - - -// IID for the nsIHTMLAttributes interface {a18f85f0-c058-11d1-8031-006008159b5a} -#define NS_IHTML_ATTRIBUTES_IID \ -{0xa18f85f0, 0xc058, 0x11d1, \ - {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIHTMLAttributes : public nsISupports { -public: - virtual PRInt32 SetAttribute(nsIAtom* aAttribute, const nsString& aValue) = 0; - virtual PRInt32 SetAttribute(nsIAtom* aAttribute, - const nsHTMLValue& aValue = nsHTMLValue::kNull) = 0; - virtual PRInt32 UnsetAttribute(nsIAtom* aAttribute) = 0; - virtual nsContentAttr GetAttribute(nsIAtom* aAttribute, - nsHTMLValue& aValue) const = 0; - virtual PRInt32 GetAllAttributeNames(nsISupportsArray* aArray) const = 0; - - virtual PRInt32 Count(void) const = 0; - - virtual PRInt32 SetID(nsIAtom* aID) = 0; - virtual nsIAtom* GetID(void) const = 0; - virtual PRInt32 SetClass(nsIAtom* aClass) = 0; // XXX this will have to change for CSS2 - virtual nsIAtom* GetClass(void) const = 0; // XXX this will have to change for CSS2 - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -extern NS_HTML nsresult - NS_NewHTMLAttributes(nsIHTMLAttributes** aInstancePtrResult, nsIHTMLContent* aContent); - -#endif /* nsIHTMLAttributes_h___ */ - diff --git a/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h b/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h deleted file mode 100644 index 3e85e75c6b5..00000000000 --- a/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIHTMLStyleSheet_h___ -#define nsIHTMLStyleSheet_h___ - -#include "nslayout.h" -#include "nsIStyleSheet.h" - -// IID for the nsIHTMLStyleSheet interface {bddbd1b0-c5cc-11d1-8031-006008159b5a} -#define NS_IHTML_STYLE_SHEET_IID \ -{0xbddbd1b0, 0xc5cc, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIHTMLStyleSheet : public nsIStyleSheet { -public: - // no methods for now -}; - -extern NS_HTML nsresult - NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult, nsIURL* aURL); - -#endif /* nsIHTMLStyleSheet_h___ */ diff --git a/mozilla/layout/html/table/Makefile b/mozilla/layout/html/table/Makefile deleted file mode 100644 index b0ff7c06fd4..00000000000 --- a/mozilla/layout/html/table/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -DIRS = src - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/table/makefile.win b/mozilla/layout/html/table/makefile.win deleted file mode 100644 index d4bfe31b9cf..00000000000 --- a/mozilla/layout/html/table/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -DIRS=src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/html/table/src/Makefile b/mozilla/layout/html/table/src/Makefile deleted file mode 100644 index 8b5bf6d4aae..00000000000 --- a/mozilla/layout/html/table/src/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../../.. - -include $(DEPTH)/config/config.mk - -LIBRARY_NAME = raptorhtmltable_s - -# Note the sophisticated alphabetical ordering :-| -CPPSRCS = \ - nsCellLayoutData.cpp \ - nsCellMap.cpp \ - nsColLayoutData.cpp \ - nsTableCaption.cpp \ - nsTableCaptionFrame.cpp \ - nsTableCell.cpp \ - nsTableCellFrame.cpp \ - nsTableCol.cpp \ - nsTableColGroup.cpp \ - nsTableColGroupFrame.cpp \ - nsTableContent.cpp \ - nsTableFrame.cpp \ - nsTableOuterFrame.cpp \ - nsTablePart.cpp \ - nsTableRow.cpp \ - nsTableRowFrame.cpp \ - nsTableRowGroup.cpp \ - nsTableRowGroupFrame.cpp \ - $(NULL) - -MODULE = raptor - -REQUIRES = xpcom raptor dom - -INCLUDES += -I../../base/src -I../../style/src -I../../../base/src - -DEFINES += -D_IMPL_NS_HTML - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/layout/html/table/src/makefile.win b/mozilla/layout/html/table/src/makefile.win deleted file mode 100644 index 2040d70ea40..00000000000 --- a/mozilla/layout/html/table/src/makefile.win +++ /dev/null @@ -1,60 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -LIBRARY_NAME=raptorhtmltable_s -MODULE=raptor -REQUIRES=xpcom raptor - -DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN - -CPPSRCS=nsCellLayoutData.cpp nsCellMap.cpp nsColLayoutData.cpp \ - nsTableCaption.cpp nsTableCaptionFrame.cpp nsTableCell.cpp \ - nsTableCellFrame.cpp nsTableCol.cpp nsTableColGroup.cpp \ - nsTableColGroupFrame.cpp nsTableContent.cpp nsTableFrame.cpp \ - nsTableOuterFrame.cpp nsTablePart.cpp nsTableRow.cpp \ - nsTableRowFrame.cpp nsTableRowGroup.cpp nsTableRowGroupFrame.cpp - -CPP_OBJS=.\$(OBJDIR)\nsCellLayoutData.obj .\$(OBJDIR)\nsCellMap.obj \ - .\$(OBJDIR)\nsColLayoutData.obj .\$(OBJDIR)\nsTableCaption.obj \ - .\$(OBJDIR)\nsTableCaptionFrame.obj .\$(OBJDIR)\nsTableCell.obj \ - .\$(OBJDIR)\nsTableCellFrame.obj .\$(OBJDIR)\nsTableCol.obj \ - .\$(OBJDIR)\nsTableColGroup.obj .\$(OBJDIR)\nsTableColGroupFrame.obj \ - .\$(OBJDIR)\nsTableContent.obj .\$(OBJDIR)\nsTableFrame.obj \ - .\$(OBJDIR)\nsTableOuterFrame.obj .\$(OBJDIR)\nsTablePart.obj \ - .\$(OBJDIR)\nsTableRow.obj .\$(OBJDIR)\nsTableRowFrame.obj \ - .\$(OBJDIR)\nsTableRowGroup.obj .\$(OBJDIR)\nsTableRowGroupFrame.obj - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \ - -I..\..\base\src -I..\..\style\src \ - -I..\..\..\base\src \ - -I$(PUBLIC)\dom - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - -clobber:: - rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/layout/html/table/src/nsCellLayoutData.cpp b/mozilla/layout/html/table/src/nsCellLayoutData.cpp deleted file mode 100644 index 2e22a2327da..00000000000 --- a/mozilla/layout/html/table/src/nsCellLayoutData.cpp +++ /dev/null @@ -1,620 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCRT.h" -#include "nsCellLayoutData.h" -#include "nsSize.h" -#include "nsIFrame.h" -#include "nsTableCell.h" -#include "nsIStyleContext.h" -#include "nsIPtr.h" - -#include /* XXX */ // for printf - - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); - -NS_DEF_PTR(nsIStyleContext); - -nsCellLayoutData::nsCellLayoutData(nsTableCellFrame *aCellFrame, - nsReflowMetrics * aDesiredSize, nsSize * aMaxElementSize) - -{ - // IMPORTANT: Always intialize instance variables to null - mCellFrame = nsnull; - mMargin.top = mMargin.bottom = mMargin.left = mMargin.right = 0; - - for (PRInt32 i = 0; i < 4; i++) - mBorderStyle[i] = nsnull; - - // IMPORTANT: call setters: this - // guarentees addrefs/releases are called if needed - gpk - SetCellFrame(aCellFrame); - SetDesiredSize(aDesiredSize); - SetMaxElementSize(aMaxElementSize); -} - -// don't delete mCellFrame, I didn't allocate it -nsCellLayoutData::~nsCellLayoutData() -{ - mCellFrame = nsnull; - mColLayoutData = nsnull; -} - -nsTableCellFrame * nsCellLayoutData::GetCellFrame() -{ return mCellFrame; } - -void nsCellLayoutData::SetCellFrame(nsTableCellFrame * aCellFrame) -{ mCellFrame = aCellFrame; } - -nsReflowMetrics * nsCellLayoutData::GetDesiredSize() -{ return &mDesiredSize; } - -void nsCellLayoutData::SetDesiredSize(nsReflowMetrics * aDesiredSize) -{ - if (nsnull!=aDesiredSize) - mDesiredSize = *aDesiredSize; -} - -nsSize * nsCellLayoutData::GetMaxElementSize() -{ return &mMaxElementSize; } - -void nsCellLayoutData::SetMaxElementSize(nsSize * aMaxElementSize) -{ - if (nsnull!=aMaxElementSize) - mMaxElementSize = *aMaxElementSize; -} - -/** - * Get the style context for this object (determined, by - * asking for the frame - * - **/ -nsIStyleContext* nsCellLayoutData::GetStyleContext() -{ - if (mCellFrame != nsnull) { - nsIStyleContext* styleContext; - mCellFrame->GetStyleContext(nsnull, styleContext); - return styleContext; - } - return nsnull; -} - - - - - -/** - * Given a list of nsCellLayoutData and a index, get the style context for - * that element in the list - * - **/ -nsIStyleContext* nsCellLayoutData::GetStyleContextAt(nsVoidArray* aList, PRInt32 aIndex) -{ - nsIStyleContext* result = nsnull; - - if (aList != nsnull) - { - nsCellLayoutData* data = (nsCellLayoutData*)aList->ElementAt(aIndex); - if (data != nsnull) - result = data->GetStyleContext(); - } - return result; -} - -/** - * Given a style context and an edge, find the margin - * - **/ -nscoord nsCellLayoutData::GetMargin(nsIStyleContext* aStyle,PRUint8 aEdge) -{ - nscoord result = 0; - - if (aStyle) - { - nsStyleSpacing* spacing = (nsStyleSpacing*)aStyle->GetData(kStyleSpacingSID); - switch (aEdge) - { - - case NS_SIDE_TOP: - result = spacing->mMargin.top; - break; - - case NS_SIDE_RIGHT: - result = spacing->mMargin.right; - break; - - - case NS_SIDE_BOTTOM: - result = spacing->mMargin.bottom; - break; - - case NS_SIDE_LEFT: - result = spacing->mMargin.left; - break; - - } - } - return result; -} - - -/** - * Given a style context and an edge, find the border width - * - **/ -nscoord nsCellLayoutData::GetBorderWidth(nsIStyleContext* aStyle,PRUint8 aEdge) -{ - nscoord result = 0; - - if (aStyle) - { - nsStyleSpacing* spacing = (nsStyleSpacing*)aStyle->GetData(kStyleSpacingSID); - switch (aEdge) - { - case NS_SIDE_TOP: - result = spacing->mBorder.top; - break; - - case NS_SIDE_RIGHT: - result = spacing->mBorder.right; - break; - - - case NS_SIDE_BOTTOM: - result = spacing->mBorder.bottom; - break; - - case NS_SIDE_LEFT: - result = spacing->mBorder.left; - break; - - } - } - return result; -} - - -/** - * Given a style context and an edge, find the padding - * - **/ -nscoord nsCellLayoutData::GetPadding(nsIStyleContext* aStyle,PRUint8 aEdge) -{ - nscoord result = 0; - - if (aStyle) - { - nsStyleSpacing* spacing = (nsStyleSpacing*)aStyle->GetData(kStyleSpacingSID); - switch (aEdge) - { - case NS_SIDE_TOP: - result = spacing->mPadding.top; - break; - - case NS_SIDE_RIGHT: - result = spacing->mPadding.right; - break; - - case NS_SIDE_BOTTOM: - result = spacing->mPadding.bottom; - break; - - case NS_SIDE_LEFT: - result = spacing->mPadding.left; - break; - - } - } - return result; -} - - - -/** - * Given an Edge, find the opposing edge (top<-->bottom, left<-->right) - * - **/ -PRUint8 nsCellLayoutData::GetOpposingEdge(PRUint8 aEdge) -{ - PRUint8 result; - - switch (aEdge) - { - case NS_SIDE_LEFT: - result = NS_SIDE_RIGHT; - break; - - case NS_SIDE_RIGHT: - result = NS_SIDE_LEFT; - break; - - case NS_SIDE_TOP: - result = NS_SIDE_BOTTOM; - break; - - case NS_SIDE_BOTTOM: - result = NS_SIDE_TOP; - break; - - default: - result = NS_SIDE_TOP; - } - return result; -} - - -/* -* -* Determine border style for two cells. -* - 1.If the adjacent elements are of the same type, the wider of the two borders is used. - "Wider" takes into account the border-style of 'none', so a "1px solid" border - will take precedence over a "20px none" border. - - 2.If there are two or more with the same width, but different style, - then the one with a style near the start of the following list will be drawn: - - 'blank', 'double', 'solid', 'dashed', 'dotted', 'ridge', 'groove', 'none' - - 3.If the borders are of the same width, the border on the element occurring first is used. - - First is defined as aStyle for this method. - - NOTE: This assumes left-to-right, top-to-bottom bias. -- gpk - -* -*/ - - -nsIStyleContext* nsCellLayoutData::CompareCellBorders(nsIStyleContext* aStyle1, - PRUint8 aEdge1, - nsIStyleContext* aStyle2, - PRUint8 aEdge2) -{ - PRInt32 width1 = GetBorderWidth(aStyle1,aEdge1); - PRInt32 width2 = GetBorderWidth(aStyle2,aEdge2); - - nsIStyleContext* result = nsnull; - - if (width1 > width2) - result = aStyle1; - else if (width1 < width2) - result = aStyle2; - else // width1 == width2 - { - nsStyleBorder* border1 = (nsStyleBorder*)aStyle1->GetData(kStyleBorderSID); - nsStyleBorder* border2 = (nsStyleBorder*)aStyle2->GetData(kStyleBorderSID); - if (border1->mStyle[aEdge1] >= border2->mStyle[aEdge2]) - result = aStyle1; - else - result = aStyle2; - } - return result; -} - - -/** - * Given a List of cell layout data, compare the edges to see which has the - * border with the highest precidence. - * - **/ - -nsIStyleContext* nsCellLayoutData::FindHighestPrecedentBorder(nsVoidArray* aList, - PRUint8 aEdge) -{ - nsIStyleContext* result = nsnull; - PRInt32 index = 0; - PRInt32 count = 0; - - - NS_ASSERTION(aList,"a List must be valid"); - count = aList->Count(); - if (count) - { - nsIStyleContextPtr style; - nsIStyleContextPtr style2; - - style = GetStyleContextAt(aList,index++); - while (index < count) - { - style2 = GetStyleContextAt(aList,index++); - if (GetMargin(style2,aEdge) == 0) { - style.SetAddRef(CompareCellBorders(style,aEdge, style2,aEdge)); - } - } - if (style.IsNotNull() && (GetMargin(style,aEdge) != 0)) - result = style.AddRef(); - } - return result; -} - - - - -nsStyleSpacing* nsCellLayoutData::FindInnerBorder( nsIStyleContext* aStyle, - nsVoidArray* aList, - PRUint8 aEdge) -{ - nsStyleSpacing* result = nsnull; - PRUint8 opposite = GetOpposingEdge(aEdge); - - if (GetMargin(aStyle,aEdge) == 0) - { - nsIStyleContextPtr style; - nsIStyleContextPtr altStyle = FindHighestPrecedentBorder(aList,opposite); - if (altStyle.IsNotNull()) - style.SetAddRef(CompareCellBorders(aStyle,aEdge,altStyle,opposite)); - else - style.SetAddRef(aStyle); - result = (nsStyleSpacing*)style->GetData(kStyleSpacingSID); - } - - return result; -} - - -/* -* -* FindRelevantBorder recursively searches up the frame hierarchy for the border -* style that is applicable to the cell. If at any point the frame has a margin -* or the parent frame has padding, then the outer frame for this object takes -* presendence over the inner frame. - -1.Borders on 'table' elements take precedence over borders on any other table elements. -2.Borders on 'row-groups' take precedence over borders on 'rows', - and likewise borders on 'column-groups' take precedence over borders on 'columns'. -3.Borders on any other type of table element take precedence over 'table-cell' elements. - -* -* NOTE: This method assumes that the table cell potentially shares a border. -* It should not be called for internal cells -* -* NOTE: COLUMNS AND COLGROUPS NEED TO BE FIGURED INTO THE ALGORITHM -- GPK!!! -* -* -*/ -nsStyleSpacing* nsCellLayoutData::FindOuterBorder( nsTableFrame* aTableFrame, - nsIFrame* aFrame, - nsIStyleContext* aStyle, - PRUint8 aEdge) -{ - nsIStyleContextPtr style; - nsIFrame* frame = aFrame; - PRBool done = PR_FALSE; - - // By default, return the passed in style - style.SetAddRef(aStyle); - // The table frame is the outer most frame we test against - while (done == PR_FALSE) - { - done = PR_TRUE; // where done unless the frame's margin is zero - // and the parent's padding is zero - - nscoord margin = GetMargin(style,aEdge); - - // if the margin for this style is zero then check to see if the paddding - // for the parent frame is also zero - if (margin == 0) - { - nsIFrame* parentFrame; - nsIStyleContextPtr parentStyle; - - aFrame->GetGeometricParent(parentFrame); - aFrame->GetStyleContext(nsnull, parentStyle.AssignRef()); - - // if the padding for the parent style is zero just - // recursively call this routine - PRInt32 padding = GetPadding(parentStyle,aEdge); - if (parentStyle.IsNotNull() && (padding == 0)) - { - style = parentStyle; - frame = parentFrame; - // If this frame represents the table frame then - // the table style is used - done = PRBool(frame != (nsIFrame*)aTableFrame); - continue; - } - - } - } - nsStyleSpacing* result = (nsStyleSpacing*)style->GetData(kStyleSpacingSID); - return result; -} - - - -/* - - Border Resolution - 1.Borders on 'table' elements take precedence over borders on any other table elements. - 2.Borders on 'row-groups' take precedence over borders on 'rows', and likewise borders on 'column-groups' take - precedence over borders on 'columns'. - 3.Borders on any other type of table element take precedence over 'table-cell' elements. - 4.If the adjacent elements are of the same type, the wider of the two borders is used. "Wider" takes into account - the border-style of 'none', so a "1px solid" border will take precedence over a "20px none" border. - 5.If the borders are of the same width, the border on the element occurring first is used. - - - How to compare - 1.Those of the one or two cells that have an edge here. - Less than two can occur at the edge of the table, but also - at the edges of "holes" (unoccupied grid cells). - 2.Those of the columns that have an edge here. - 3.Those of the column groups that have an edge here. - 4.Those of the rows that have an edge here. - 5.Those of the row groups that have an edge here. - 6.Those of the table, if this is the edge of the table. - -* -* @param aIsFirst -- TRUE if this is the first cell in the row -* @param aIsLast -- TRUE if this is the last cell in the row -* @param aIsTop -- TRUE if this is the top cell in the column -* @param aIsBottom -- TRUE if this is the last cell in the column -*/ - -nsStyleSpacing* nsCellLayoutData::FindBorderStyle(nsTableFrame* aTableFrame, - nsIStyleContext* aCellStyle, - nsVoidArray* aList, - PRUint8 aEdge) -{ - nsStyleSpacing* style = nsnull; - - if (aList && aList->Count() == 0) - style = FindOuterBorder(aTableFrame,mCellFrame,aCellStyle,aEdge); - else - style = FindInnerBorder(aCellStyle,aList, aEdge); - - if (!style) - style = (nsStyleSpacing*)aCellStyle->GetData(kStyleSpacingSID); - - return style; -} - - -void nsCellLayoutData::CalculateBorders(nsTableFrame* aTableFrame, - nsIStyleContext* aCellStyle, - nsVoidArray* aBoundaryCells[4]) -{ - - for (PRInt32 edge = 0; edge < 4; edge++) - mBorderStyle[edge] = FindBorderStyle(aTableFrame,aCellStyle,aBoundaryCells[edge],edge); -} - - -/** - * Given a List of cell layout data, compare the edges to see which has the - * border with the highest precidence. - * - **/ - -nscoord nsCellLayoutData::FindLargestMargin(nsVoidArray* aList,PRUint8 aEdge) -{ - nscoord result = 0; - PRInt32 index = 0; - PRInt32 count = 0; - - - NS_ASSERTION(aList,"a List must be valid"); - count = aList->Count(); - if (count) - { - nsIStyleContextPtr style; - - nscoord value = 0; - while (index < count) - { - style = GetStyleContextAt(aList,index++); - value = GetMargin(style,aEdge); - if (value > result) - result = value; - } - } - return result; -} - - - - -void nsCellLayoutData::CalculateMargins(nsTableFrame* aTableFrame, - nsIStyleContext* aCellStyle, - nsVoidArray* aBoundaryCells[4]) -{ - // By default the margin is just the margin found in the - // table cells style - nsStyleSpacing* spacing = (nsStyleSpacing*)aCellStyle->GetData(kStyleSpacingSID); - mMargin = spacing->mMargin; - - // Left and Top Margins are collapsed with their neightbors - // Right and Bottom Margins are simple left as they are - nscoord value; - - // The left and top sides margins are the difference between - // their inherint value and the value of the margin of the - // object to the left or right of them. - - value = FindLargestMargin(aBoundaryCells[NS_SIDE_LEFT],NS_SIDE_RIGHT); - if (value > mMargin.left) - mMargin.left = 0; - else - mMargin.left -= value; - - value = FindLargestMargin(aBoundaryCells[NS_SIDE_TOP],NS_SIDE_BOTTOM); - if (value > mMargin.top) - mMargin.top = 0; - else - mMargin.top -= value; -} - - -void nsCellLayoutData::RecalcLayoutData(nsTableFrame* aTableFrame, - nsVoidArray* aBoundaryCells[4]) - -{ - nsIStyleContextPtr cellStyle; - - mCellFrame->GetStyleContext(nsnull, cellStyle.AssignRef()); - - CalculateBorders(aTableFrame,cellStyle,aBoundaryCells); - CalculateMargins(aTableFrame,cellStyle,aBoundaryCells); -} - - -void nsCellLayoutData::List(FILE* out, PRInt32 aIndent) const -{ - PRInt32 indent; - - nsTableCell* cell; - - mCellFrame->GetContent((nsIContent*&)cell); - if (cell != nsnull) - { - for (indent = aIndent; --indent >= 0; ) fputs(" ", out); - fprintf(out,"RowSpan = %d ColSpan = %d \n",cell->GetRowSpan(),cell->GetColSpan()); - - for (indent = aIndent; --indent >= 0; ) fputs(" ", out); - fprintf(out,"Margin -- Top: %d Left: %d Bottom: %d Right: %d \n", - NS_TWIPS_TO_POINTS_INT(mMargin.top), - NS_TWIPS_TO_POINTS_INT(mMargin.left), - NS_TWIPS_TO_POINTS_INT(mMargin.bottom), - NS_TWIPS_TO_POINTS_INT(mMargin.right)); - - - for (indent = aIndent; --indent >= 0; ) fputs(" ", out); - - nscoord top,left,bottom,right; - - top = (mBorderStyle[NS_SIDE_TOP] ? mBorderStyle[NS_SIDE_TOP]->mBorder.top : 0); - left = (mBorderStyle[NS_SIDE_LEFT] ? mBorderStyle[NS_SIDE_LEFT]->mBorder.left : 0); - bottom = (mBorderStyle[NS_SIDE_BOTTOM] ? mBorderStyle[NS_SIDE_BOTTOM]->mBorder.bottom : 0); - right = (mBorderStyle[NS_SIDE_RIGHT] ? mBorderStyle[NS_SIDE_RIGHT]->mBorder.right : 0); - - - fprintf(out,"Border -- Top: %d Left: %d Bottom: %d Right: %d \n", - NS_TWIPS_TO_POINTS_INT(top), - NS_TWIPS_TO_POINTS_INT(left), - NS_TWIPS_TO_POINTS_INT(bottom), - NS_TWIPS_TO_POINTS_INT(right)); - - - - cell->List(out,aIndent); - NS_RELEASE(cell); - } -} - diff --git a/mozilla/layout/html/table/src/nsCellLayoutData.h b/mozilla/layout/html/table/src/nsCellLayoutData.h deleted file mode 100644 index 145dc05c270..00000000000 --- a/mozilla/layout/html/table/src/nsCellLayoutData.h +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCellLayoutData_h__ -#define nsCellLayoutData_h__ - -#include "nscore.h" -#include "nsSize.h" -#include "nsIFrame.h" -#include "nsTableCellFrame.h" - -class nsColLayoutData; -class nsTableFrame; -class nsIStyleContext; -struct nsStyleSpacing; - - -/** Simple data class that represents in-process reflow information about a cell. - * Each cell is represented by a nsTableCellFrame together with the results - * of the "first pass" layout results (where "first pass" means the cell was told - * to lay itself out with unrestricted height and width.) - * There is one nsCellLayoutData object per nsTableFrame for each cell. - * - * TODO: All methods will be inline. - */ -class nsCellLayoutData -{ -public: - - /** public constructor. Does not allocate any of its own data. - * @param aCellFrame the frame representing the cell - * @param aDesiredSize the max size of the cell if given infinite height and width - * @param aMaxElementSize the min size of the largest indivisible element within the cell - */ - nsCellLayoutData(nsTableCellFrame *aCellFrame, - nsReflowMetrics * aDesiredSize, nsSize * aMaxElementSize); - - /** destructor, not responsible for destroying any of the stored data */ - virtual ~nsCellLayoutData(); - - /** return the frame mapping the cell */ - nsTableCellFrame * GetCellFrame(); - - /** set the frame mapping the cell */ - void SetCellFrame(nsTableCellFrame * aCellFrame); - - /** return the max size of the cell if given infinite height and width */ - nsReflowMetrics * GetDesiredSize(); - - /** set the max size of the cell if given infinite height and width. - * called after pass 1 of table reflow is complete. - */ - void SetDesiredSize(nsReflowMetrics * aDesiredSize); - - /** get the min size of the largest indivisible element within the cell */ - nsSize * GetMaxElementSize(); - - /** set the min size of the largest indivisible element within the cell. - * called after pass 1 of table reflow is complete. - */ - void SetMaxElementSize(nsSize * aMaxElementSize); - - /** debug method outputs data about this cell to FILE *out */ - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - /** returns the style context associated with this cell */ - nsIStyleContext* GetStyleContext(); - -private: - - // All these methods are support methods for RecalcLayoutData - nsIStyleContext* GetStyleContextAt(nsVoidArray* aList, PRInt32 aIndex); - - nscoord GetMargin(nsIStyleContext* aStyle,PRUint8 aEdge); - - nscoord GetBorderWidth(nsIStyleContext* aStyle,PRUint8 aEdge); - - nscoord GetPadding(nsIStyleContext* aStyle,PRUint8 aEdge); - - PRUint8 GetOpposingEdge(PRUint8 aEdge); - - nsIStyleContext* CompareCellBorders(nsIStyleContext* aStyle1, - PRUint8 aEdge1, - nsIStyleContext* aStyle2, - PRUint8 aEdge2); - - - nsIStyleContext* FindHighestPrecedentBorder(nsVoidArray* aList, - PRUint8 aEdge); - - - - nsStyleSpacing* FindInnerBorder( nsIStyleContext* aStyle, - nsVoidArray* aList, - PRUint8 aEdge); - - nsStyleSpacing* FindOuterBorder( nsTableFrame* aTableFrame, - nsIFrame* aFrame, - nsIStyleContext* aStyle, - PRUint8 aEdge); - - nsStyleSpacing* FindBorderStyle(nsTableFrame* aTableFrame, - nsIStyleContext* aCellStyle, - nsVoidArray* aCellList, - PRUint8 aEdge); - - void CalculateBorders(nsTableFrame* aTableFrame, - nsIStyleContext* aCellStyle, - nsVoidArray* aBoundaryCells[4]); - - nscoord FindLargestMargin(nsVoidArray* aList,PRUint8 aEdge); - - - void CalculateMargins(nsTableFrame* aTableFrame, - nsIStyleContext* aCellStyle, - nsVoidArray* aBoundaryCells[4]); - -public: - void RecalcLayoutData(nsTableFrame* aTableFrame, - nsVoidArray* aBoundaryCells[4]); - - -private: -#if 0 // these come on line when we do character-based cell content alignment - /** the kinds of width information stored */ - enum {WIDTH_NORMAL=0, WIDTH_LEFT_ALIGNED=1, WIDTH_RIGHT_ALIGNED=2}; - - /** the width information for a cell */ - PRInt32 mWidth[3]; -#endif - - nsColLayoutData *mColLayoutData; - nsTableCellFrame *mCellFrame; - nsReflowMetrics mDesiredSize; - nsSize mMaxElementSize; - - nsMargin mMargin; - nsStyleSpacing* mBorderStyle[4]; -}; - -#endif diff --git a/mozilla/layout/html/table/src/nsCellMap.cpp b/mozilla/layout/html/table/src/nsCellMap.cpp deleted file mode 100644 index 25fd456989d..00000000000 --- a/mozilla/layout/html/table/src/nsCellMap.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCRT.h" -#include "nsCellMap.h" -#include "nsTablePart.h" -#include /* XXX */ // for printf - -#ifdef NS_DEBUG -static PRBool gsDebug1 = PR_FALSE; -#else -static const PRBool gsDebug1 = PR_FALSE; -#endif - -static PRInt32 gBytesPerPointer = sizeof(PRInt32); - -nsCellMap::nsCellMap(int aRows, int aColumns) - : mRowCount(aRows), - mColCount(aColumns) -{ - mCells = nsnull; - Reset(aRows, aColumns); -} - -nsCellMap::~nsCellMap() -{ - for (int i=0;iCount(); - for (PRInt32 i = 0; i < count; i++) - { - nsCellLayoutData *data = (nsCellLayoutData *)(mCells->ElementAt(i)); - delete data; - } - delete mCells; - } - mCells = 0; -} - -nsTableCol * nsColLayoutData::GetCol() -{ - NS_IF_ADDREF(mCol); - return mCol; -}; - -void nsColLayoutData::SetCol(nsTableCol * aCol) -{ - if (aCol != mCol) - { - NS_IF_ADDREF(aCol); - NS_IF_RELEASE(mCol); - mCol = aCol; - } -}; - - -nsCellLayoutData* nsColLayoutData::ElementAt(PRInt32 aIndex) const -{ - return (nsCellLayoutData*)mCells->ElementAt(aIndex); -} - - -PRBool nsColLayoutData::AppendElement(nsCellLayoutData* aCellLayoutData) -{ - return mCells->AppendElement((void*)aCellLayoutData); -} - -PRBool nsColLayoutData::ReplaceElementAt(nsCellLayoutData* aCellLayoutData, PRInt32 aIndex) -{ - return mCells->ReplaceElementAt((void*)aCellLayoutData,aIndex); -} - -nsVoidArray * nsColLayoutData::GetCells() -{ return mCells; } - -PRInt32 nsColLayoutData::Count() const -{ return mCells->Count(); } - - -PRInt32 nsColLayoutData::IndexOf(nsCellLayoutData* aCellLayoutData) const -{ - return mCells->IndexOf((void*)aCellLayoutData); -} - -PRInt32 nsColLayoutData::IndexOf(nsTableCell* aTableCell) const -{ - PRInt32 count = this->Count(); - PRInt32 result = -1; - if (aTableCell != nsnull) - { - for (PRInt32 index = 0; index < count; index++) - { - nsCellLayoutData* cellData = ElementAt(index); - if (cellData != nsnull) - { - nsTableCellFrame* frame = cellData->GetCellFrame(); - if (frame != nsnull) - { - nsTableCell* cell; - - frame->GetContent((nsIContent*&)cell); - if (cell == aTableCell) - { - result = index; - NS_RELEASE(cell); - break; - } - NS_IF_RELEASE(cell); - } - } - } - } - return result; -} - - -nsCellLayoutData* nsColLayoutData::GetNext(nsCellLayoutData* aCellLayoutData) const -{ - PRInt32 index = IndexOf(aCellLayoutData); - if (index != -1) - return ElementAt(index+1); - return (nsCellLayoutData*)nsnull; -} - -nsCellLayoutData* nsColLayoutData::GetPrevious(nsCellLayoutData* aCellLayoutData) const -{ - PRInt32 index = IndexOf(aCellLayoutData); - if (index != -1) - return ElementAt(index-1); - return (nsCellLayoutData*)nsnull; -} - - -void nsColLayoutData::List(FILE* out, PRInt32 aIndent) const -{ - if (nsnull!=mCells) - { - PRInt32 count = mCells->Count(); - for (PRInt32 i = 0; i < count; i++) - { - for (PRInt32 indent = aIndent; --indent >= 0; ) fputs(" ", out); - fprintf(out,"Cell Data [%d] \n",i); - - nsCellLayoutData *data = (nsCellLayoutData *)(mCells->ElementAt(i)); - data->List(out,aIndent+1); - } - } -} - - diff --git a/mozilla/layout/html/table/src/nsColLayoutData.h b/mozilla/layout/html/table/src/nsColLayoutData.h deleted file mode 100644 index edfe9491ba4..00000000000 --- a/mozilla/layout/html/table/src/nsColLayoutData.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsColLayoutData_h__ -#define nsColLayoutData_h__ - -#include "nscore.h" -#include "nsSize.h" -#include "nsIFrame.h" -#include "nsTableCol.h" - -class nsVoidArray; -class nsCellLayoutData; -class nsTableFrame; - - -/** Simple data class that represents in-process reflow information about a column. - */ -class nsColLayoutData -{ -public: - nsColLayoutData(nsTableCol *aCol); - - // NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED - ~nsColLayoutData(); - - nsTableCol * GetCol(); - - void SetCol(nsTableCol * aCol); - - nsVoidArray * GetCells(); - - PRInt32 Count() const; - - nsCellLayoutData* ElementAt(PRInt32 aIndex) const; - - PRInt32 IndexOf(nsCellLayoutData* aCellLayoutData) const; - PRInt32 IndexOf(nsTableCell* aTableCell) const; - - nsCellLayoutData* GetNext(nsCellLayoutData* aCellLayoutData) const; - - nsCellLayoutData* GetPrevious(nsCellLayoutData* aCellLayoutData) const; - - - - PRBool AppendElement(nsCellLayoutData* aCellLayoutData); - - PRBool ReplaceElementAt(nsCellLayoutData* aCellLayoutData, PRInt32 aIndex); - - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - -private: - - nsTableCol *mCol; - nsVoidArray *mCells; - -}; - -#endif diff --git a/mozilla/layout/html/table/src/nsITableContent.h b/mozilla/layout/html/table/src/nsITableContent.h deleted file mode 100644 index 34e97848c11..00000000000 --- a/mozilla/layout/html/table/src/nsITableContent.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsITableContent_h__ -#define nsITableContent_h__ - -#include "nsISupports.h" -#include "nscore.h" - -class nsTablePart; - -#define NS_ITABLECONTENT_IID \ - { /* 34a59b40-a71d-11d1-8f2f-006008159b0c */ \ - 0x34a59b40, 0xa71d, 0x11d1, \ - {0x8f, 0x2f, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x0c} } - -/** - * nsITableContent is a concrete subclass for all content nodes contained directly - * within a table. - * - * @author sclark - * @see nsTablePart - */ -class nsITableContent : public nsISupports -{ - -public: - - /** constants representing well-known table content types */ - static const int kTableRowGroupType; - static const int kTableRowType; - static const int kTableColGroupType; - static const int kTableColType; - static const int kTableCaptionType; - static const int kTableCellType; - -protected: - /** protected constructor. Never create an object of type nsITableContent directly.*/ - nsITableContent (); - -public: - /** returns the TablePart that contains this content node. - * every table content has one and only one parent, - * and may not be replicated within different hierarchies. - */ - virtual nsTablePart *GetTable ()=0; - - /** set the parent of this table content object. - * @param aTable the new parent. May be null to disconnect this object from - * the hierarchy it is in. Note that we don't have formalized - * relationship objects, so the caller must also remove this - * from it's prarent's child list. - */ - virtual void SetTable (nsTablePart *aTable)=0; - - /** returns PR_TRUE if there is an actual input tag corresponding to - * this content object. - */ - virtual PRBool IsImplicit () const =0; - - /** returns PR_TRUE if this content object should NOT be written to the output stream. - * for example, we don't generally want to output implicit tags when saving. - */ - virtual PRBool SkipSelfForSaving ()=0; - - /** return the type of TableContent this object represents. */ - virtual int GetType()=0; - -}; - -#endif - diff --git a/mozilla/layout/html/table/src/nsTableCaption.cpp b/mozilla/layout/html/table/src/nsTableCaption.cpp deleted file mode 100644 index 1660193b378..00000000000 --- a/mozilla/layout/html/table/src/nsTableCaption.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableCaption.h" -#include "nsTableCaptionFrame.h" -#include "nsBodyFrame.h" -#include "nsTablePart.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsContainerFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsHTMLIIDs.h" - - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - - -nsTableCaption::nsTableCaption(nsIAtom* aTag) - : nsTableContent(aTag) -{ - mImplicit = PR_FALSE; -} - -nsTableCaption::nsTableCaption(PRBool aImplicit) - : nsTableContent(NS_NewAtom(nsTablePart::kCaptionTagString)) -{ - mImplicit = aImplicit; -} - -nsTableCaption::~nsTableCaption() -{ -} - -nsrefcnt nsTableCaption::AddRef(void) -{ - if (gsNoisyRefs) printf("Add Ref: %x, nsTableCaption cnt = %d \n",this, mRefCnt+1); - return ++mRefCnt; -} - -nsrefcnt nsTableCaption::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Release: %x, nsTableCaption cnt = %d \n",this, mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: %x, nsTableCaption \n",this); - delete this; - return 0; - } - return mRefCnt; -} - -int nsTableCaption::GetType() -{ - return nsITableContent::kTableCaptionType; -} - -nsIFrame* nsTableCaption::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); - nsIFrame* rv; - nsresult status = nsTableCaptionFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - NS_ASSERTION(nsnull!=rv, "bad arg"); - return rv; -} - - -nsresult -NS_NewTableCaptionPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new nsTableCaption(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/table/src/nsTableCaption.h b/mozilla/layout/html/table/src/nsTableCaption.h deleted file mode 100644 index f01a4fb056d..00000000000 --- a/mozilla/layout/html/table/src/nsTableCaption.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableCaption_h__ -#define nsTableCaption_h__ - -#include "nscore.h" -#include "nsTableContent.h" - -/** - * nsTableCaption is the content object that represents table captions - * (HTML tag CAPTION). This class cannot be reused - * outside of an nsTablePart. It assumes that its parent is an nsTablePart, and - * it has a single nsBodyPart child. - * - * @see nsTablePart - * @see nsTableRow - * @see nsBodyPart - * - * @author sclark - */ -class nsTableCaption : public nsTableContent -{ -public: - - /** constructor - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this caption. - */ - nsTableCaption (PRBool aImplicit); - - /** constructor - * @param aTag the HTML tag causing this caption to get constructed. - */ - nsTableCaption (nsIAtom* aTag); - - /** destructor, not responsible for any memory destruction itself */ - virtual ~nsTableCaption(); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - /** returns nsITableContent::kTableCaptionType */ - virtual int GetType(); - - /** @see nsIHTMLContent::CreateFrame */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - -}; - -#endif - - - diff --git a/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp b/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp deleted file mode 100644 index 0a2abc5e839..00000000000 --- a/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableCaptionFrame.h" -#include "nsBodyFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsCSSRendering.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsCSSLayout.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -/** - */ -nsTableCaptionFrame::nsTableCaptionFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mMinWidth(0), - mMaxWidth(0) -{ -} - -nsTableCaptionFrame::~nsTableCaptionFrame() -{ -} - -/** return the min legal width for this caption - * minWidth is the minWidth of it's content plus any insets - */ -PRInt32 nsTableCaptionFrame::GetMinWidth() -{ - return mMinWidth; -} - -/** return the max legal width for this caption - * maxWidth is the maxWidth of it's content when given an infinite space - * plus any insets - */ -PRInt32 nsTableCaptionFrame::GetMaxWidth() -{ - return mMaxWidth; -} - - -void nsTableCaptionFrame::CreatePsuedoFrame(nsIPresContext* aPresContext) -{ - // Do we have a prev-in-flow? - if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame - nsBodyFrame::NewFrame(&mFirstChild, mContent, mIndexInParent, this); - mChildCount = 1; - - // Resolve style and set the style context - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(mContent, this); // styleContext: ADDREF++ - mFirstChild->SetStyleContext(styleContext); - NS_RELEASE(styleContext); // styleContext: ADDREF-- - } else { - nsTableCaptionFrame* prevFrame = (nsTableCaptionFrame *)mPrevInFlow; - - nsIFrame* prevPseudoFrame = prevFrame->mFirstChild; - NS_ASSERTION(prevFrame->ChildIsPseudoFrame(prevPseudoFrame), "bad previous pseudo-frame"); - - // Create a continuing column - prevPseudoFrame->CreateContinuingFrame(aPresContext, this, mFirstChild); - mChildCount = 1; - } -} - -NS_METHOD nsTableCaptionFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - NS_ASSERTION(nsnull!=myColor, "bad style color"); - NS_ASSERTION(nsnull!=myBorder, "bad style border"); - if (nsnull==myBorder) return NS_OK; - - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - - - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(0,128,128)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -/** - * Align the frame's child frame within the caption - */ -void nsTableCaptionFrame::VerticallyAlignChild(nsIPresContext* aPresContext) -{ - - nsStyleText* textStyle = - (nsStyleText*)mStyleContext->GetData(kStyleTextSID); - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - - nscoord topInset = spacing->mBorderPadding.top; - nscoord bottomInset = spacing->mBorderPadding.bottom; - PRUint8 verticalAlignFlags = NS_STYLE_VERTICAL_ALIGN_MIDDLE; - - if (textStyle->mVerticalAlign.GetUnit() == eStyleUnit_Enumerated) { - verticalAlignFlags = textStyle->mVerticalAlign.GetIntValue(); - } - - nscoord height = mRect.height; - - nsRect kidRect; - mFirstChild->GetRect(kidRect); - nscoord childHeight = kidRect.height; - - - // Vertically align the child - nscoord kidYTop = 0; - switch (verticalAlignFlags) - { - case NS_STYLE_VERTICAL_ALIGN_BASELINE: - // Align the child's baseline at the max baseline - //kidYTop = aMaxAscent - kidAscent; - break; - - case NS_STYLE_VERTICAL_ALIGN_TOP: - // Align the top of the child frame with the top of the box, - // minus the top padding - kidYTop = topInset; - break; - - case NS_STYLE_VERTICAL_ALIGN_BOTTOM: - kidYTop = height - childHeight - bottomInset; - break; - - default: - case NS_STYLE_VERTICAL_ALIGN_MIDDLE: - kidYTop = height/2 - childHeight/2; - } - mFirstChild->MoveTo(kidRect.x, kidYTop); -} - -/** - */ -NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); - -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - aStatus = frComplete; - if (gsDebug==PR_TRUE) - printf("nsTableCaptionFrame::ResizeReflow %p: maxSize=%d,%d\n", - this, aMaxSize.width, aMaxSize.height); - - mFirstContentOffset = mLastContentOffset = 0; - - nsSize availSize(aMaxSize); - nsSize maxElementSize; - nsSize *pMaxElementSize = aMaxElementSize; - if (NS_UNCONSTRAINEDSIZE==aMaxSize.width) - pMaxElementSize = &maxElementSize; - nsReflowMetrics kidSize; - nscoord x = 0; - // SEC: what about ascent and decent??? - - // Compute the insets (sum of border and padding) - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nscoord topInset = spacing->mBorderPadding.top; - nscoord rightInset = spacing->mBorderPadding.right; - nscoord bottomInset = spacing->mBorderPadding.bottom; - nscoord leftInset = spacing->mBorderPadding.left; - - // reduce available space by insets - if (NS_UNCONSTRAINEDSIZE!=availSize.width) - availSize.width -= leftInset+rightInset; - if (NS_UNCONSTRAINEDSIZE!=availSize.height) - availSize.height -= topInset+bottomInset; - - mLastContentIsComplete = PR_TRUE; - - // get frame, creating one if needed - if (nsnull==mFirstChild) - { - CreatePsuedoFrame(aPresContext); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsSize maxKidElementSize; - if (gsDebug==PR_TRUE) - printf(" nsTableCaptionFrame::ResizeReflow calling ReflowChild with availSize=%d,%d\n", - availSize.width, availSize.height); - aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, availSize, pMaxElementSize); - - if (gsDebug==PR_TRUE) - { - if (nsnull!=pMaxElementSize) - printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\ - and maxElementSize=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", - kidSize.width, kidSize.height, - pMaxElementSize->width, pMaxElementSize->height); - else - printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\ - and maxElementSize=nsnull\n", - aStatus==frComplete?"Complete":"Not Complete", - kidSize.width, kidSize.height); - } - - SetFirstContentOffset(mFirstChild); - if (gsDebug) printf("CAPTION: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - SetLastContentOffset(mFirstChild); - if (gsDebug) printf("CAPTION: set last content offset to %d\n", GetLastContentOffset()); //@@@ - - // Place the child since some of it's content fit in us. - mFirstChild->SetRect(nsRect(leftInset + x, topInset, - kidSize.width, kidSize.height)); - - - if (frNotComplete == aStatus) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - } - - // Return our size and our result - PRInt32 kidWidth = kidSize.width; - if (NS_UNCONSTRAINEDSIZE!=kidSize.width) - kidWidth += leftInset + rightInset; - PRInt32 kidHeight = kidSize.height; - - // height can be set w/o being restricted by aMaxSize.height - if (NS_UNCONSTRAINEDSIZE!=kidSize.height) - kidHeight += topInset + bottomInset; - aDesiredSize.width = kidWidth; - aDesiredSize.height = kidHeight; - aDesiredSize.ascent = topInset; - aDesiredSize.descent = bottomInset; - - if (nsnull!=aMaxElementSize) - *aMaxElementSize = *pMaxElementSize; - - // in the UNCONSTRAINED case, cache the min and max widths - if (NS_UNCONSTRAINEDSIZE==aMaxSize.width) - { - mMaxWidth = kidWidth; - mMinWidth = pMaxElementSize->width; - if (PR_TRUE==gsDebug) - printf(" caption frame setting min/max to %d,%d\n", mMinWidth, mMaxWidth); - } - - if (gsDebug==PR_TRUE) - { - if (nsnull!=aMaxElementSize) - printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height, - aMaxElementSize->width, aMaxElementSize->height); - else - printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - - return NS_OK; -} - -NS_METHOD nsTableCaptionFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug == PR_TRUE) printf("nsTableCaptionFrame::IncrementalReflow\n"); - // total hack for now, just some hard-coded values - ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - return NS_OK; -} - -NS_METHOD nsTableCaptionFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - if (PR_TRUE==gsDebug) printf("nsTableCaptionFrame::CreateContinuingFrame called\n"); - nsTableCaptionFrame* cf = new nsTableCaptionFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -/* ----- static methods ----- */ - -nsresult nsTableCaptionFrame::NewFrame( nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableCaptionFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/html/table/src/nsTableCaptionFrame.h b/mozilla/layout/html/table/src/nsTableCaptionFrame.h deleted file mode 100644 index b40c4182d42..00000000000 --- a/mozilla/layout/html/table/src/nsTableCaptionFrame.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableCaptionFrame_h__ -#define nsTableCaptionFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" -#include "nsTableCaption.h" - -/** - * nsTableCaptionFrame - * data structure to maintain information about a single table caption geometry - * - * @author sclark - */ -class nsTableCaptionFrame : public nsContainerFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** - * @see nsContainerFrame - */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - virtual void VerticallyAlignChild(nsIPresContext* aPresContext); - - /** return the min legal width for this caption - * minWidth is the minWidth of it's content plus any insets - */ - virtual PRInt32 GetMinWidth(); - - /** return the max legal width for this caption - * maxWidth is the maxWidth of it's content when given an infinite space - * plus any insets - */ - virtual PRInt32 GetMaxWidth(); - - virtual ~nsTableCaptionFrame(); - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableCaptionFrame( nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** Create a psuedo-frame for this caption. Handles continuing frames as needed. - */ - virtual void CreatePsuedoFrame(nsIPresContext* aPresContext); - -private: - - PRInt32 mMinWidth; - PRInt32 mMaxWidth; - -}; - - -#endif diff --git a/mozilla/layout/html/table/src/nsTableCell.cpp b/mozilla/layout/html/table/src/nsTableCell.cpp deleted file mode 100644 index 60405ae1878..00000000000 --- a/mozilla/layout/html/table/src/nsTableCell.cpp +++ /dev/null @@ -1,342 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableCell.h" -#include "nsTableColGroup.h" -#include "nsTableRow.h" -#include "nsTablePart.h" -#include "nsTableCellFrame.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsHTMLIIDs.h" -#include "nsHTMLAtoms.h" - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLETEXT_SID); - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_TRUE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - -// nsTableContent checks aTag -nsTableCell::nsTableCell(nsIAtom* aTag) - : nsTableContent(aTag), - mRow(0), - mRowSpan(1), - mColSpan(1), - mColIndex(0) -{ - mImplicit = PR_FALSE; -} - -nsTableCell::nsTableCell(PRBool aImplicit) - : nsTableContent(NS_NewAtom(nsTablePart::kDataCellTagString)), - mRow(0), - mRowSpan(1), - mColSpan(1), - mColIndex(0) -{ - mImplicit = aImplicit; -} - -// nsTableContent checks aTag -nsTableCell::nsTableCell (nsIAtom* aTag, int aRowSpan, int aColSpan) - : nsTableContent(aTag), - mRow(0), - mRowSpan(aRowSpan), - mColSpan(aColSpan), - mColIndex(0) -{ - NS_ASSERTION(0GetAttribute(nsHTMLAtoms::cellpadding,padding_value); - spacing_result = mTable->GetAttribute(nsHTMLAtoms::cellspacing,spacing_value); - border_result = mTable->GetAttribute(nsHTMLAtoms::border,border_value); - - // check to see if cellpadding or cellspacing is defined - if (spacing_result == eContentAttr_HasValue || padding_result == eContentAttr_HasValue) - { - nscoord padding = 0; - nscoord spacing = 0; - nscoord border = 0; - - float p2t = aPresContext->GetPixelsToTwips(); - if (padding_result == eContentAttr_HasValue) - padding = p2t*(float)padding_value.GetIntValue(); - - if (spacing_result == eContentAttr_HasValue) - spacing = p2t*(float)spacing_value.GetIntValue(); - - nsStyleSpacing* spacingData = (nsStyleSpacing*)aContext->GetData(kStyleSpacingSID); - spacingData->mMargin.SizeTo(spacing,spacing,spacing,spacing); - spacingData->mPadding.top = - spacingData->mPadding.left = - spacingData->mPadding.bottom = - spacingData->mPadding.right = padding; - - nsStyleBorder& borderData = *(nsStyleBorder*)aContext->GetData(kStyleBorderSID); - if (border_result == eContentAttr_HasValue) - { - // The HTML rule is that if the table's border style is - // zero, then the cell's border width is also zero, - // otherwise the cell's border width is one - - PRInt32 intValue = border_value.GetIntValue(); - if (intValue > 0) - intValue = 1; - border = p2t*(float)intValue; - MapHTMLBorderStyle(borderData,border); - } - } -} - - - -void nsTableCell::MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ - NS_PRECONDITION(nsnull!=aContext, "bad style context arg"); - NS_PRECONDITION(nsnull!=aPresContext, "bad presentation context arg"); - - nsHTMLValue value; - - // align: enum - GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) { - nsStyleText* text = (nsStyleText*)aContext->GetData(kStyleTextSID); - text->mTextAlign = value.GetIntValue(); - } - - MapBorderMarginPaddingInto(aContext,aPresContext); - MapBackgroundAttributesInto(aContext, aPresContext); - - -} - -void nsTableCell::SetRowSpan(int aRowSpan) -{ - NS_ASSERTION(0ResetCellMap (); -} - -nsresult -NS_NewTableCellPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new nsTableCell(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/table/src/nsTableCell.h b/mozilla/layout/html/table/src/nsTableCell.h deleted file mode 100644 index 71b45ab316d..00000000000 --- a/mozilla/layout/html/table/src/nsTableCell.h +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableCell_h__ -#define nsTableCell_h__ - -#include "nsCoord.h" -#include "nscore.h" -#include "nsTableContent.h" -#include "nsTableRow.h" - -struct nsStyleBorder; - -/** - * nsTableCell is the content object that represents table cells - * (HTML tags TD and TH). This class cannot be reused - * outside of an nsTableRow. It assumes that its parent is an nsTableRow, and - * it has a single nsBodyPart child. - * - * @see nsTablePart - * @see nsTableRow - * @see nsBodyPart - * - * @author sclark - */ -class nsTableCell : public nsTableContent -{ - -private: - - /** parent pointer */ - nsTableRow * mRow; - - /** the number of rows spanned by this cell */ - int mRowSpan; - - /** the number of columns spanned by this cell */ - int mColSpan; - - /** the starting column for this cell */ - int mColIndex; - -public: - - /** constructor - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this cell. - */ - nsTableCell (PRBool aImplicit); - - /** constructor - * @param aTag the HTML tag causing this cell to get constructed. - */ - nsTableCell (nsIAtom* aTag); - - /** constructor - * @param aTag the HTML tag causing this caption to get constructed. - * @param aRowSpan the number of rows spanned - * @param aColSpan the number of columns spanned - */ - nsTableCell (nsIAtom* aTag, int aRowSpan, int aColSpan); - - /** destructor, not responsible for any memory destruction itself */ - virtual ~nsTableCell(); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - - /** returns nsITableContent::kTableCellType */ - virtual int GetType(); - - /** @see nsIHTMLContent::CreateFrame */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - - - virtual void MapHTMLBorderStyle(nsStyleBorder& aBorderStyle, nscoord aBorderWidth); - virtual void MapBorderMarginPaddingInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - - /** @return the number of rows spanned by this cell. Always >= 1 */ - virtual int GetRowSpan (); - - /** set the number of rows spanned. Must be >= 1 */ - virtual void SetRowSpan (int aRowSpan); - - /** @return the number of columns spanned by this cell. Always >= 1 */ - virtual int GetColSpan (); - - /** set the number of columns spanned. Must be >= 1 */ - virtual void SetColSpan (int aColSpan); - - /** return a pointer to this cell's parent, the row containing the cell */ - virtual nsTableRow * GetRow (); - - /** set this cell's parent. - * Note: Since mRow is the parent of the table cell, - * reference counting should not be done on - * this variable when setting the row. - * see /ns/raptor/doc/MemoryModel.html - */ - virtual void SetRow (nsTableRow * aRow); - - /** @return the starting column for this cell. Always >= 1 */ - virtual int GetColIndex (); - - /** set the starting column for this cell. Always >= 1 */ - virtual void SetColIndex (int aColIndex); - - virtual void ResetCellMap (); - -}; - -#endif diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp deleted file mode 100644 index 4925281e2ca..00000000000 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableCellFrame.h" -#include "nsBodyFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsCSSRendering.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsCSSLayout.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -#else -static const PRBool gsDebug = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -/** - */ -nsTableCellFrame::nsTableCellFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsTableCellFrame::~nsTableCellFrame() -{ -} - -NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - NS_ASSERTION(nsnull!=myColor, "bad style color"); - NS_ASSERTION(nsnull!=myBorder, "bad style border"); - - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - /* - printf("painting borders, size = %d %d %d %d\n", - myBorder->mSize.left, myBorder->mSize.top, - myBorder->mSize.right, myBorder->mSize.bottom); - */ - - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(0,128,128)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -/** -* -* Align the cell's child frame within the cell -* -**/ - -void nsTableCellFrame::VerticallyAlignChild(nsIPresContext* aPresContext) -{ - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nsStyleText* textStyle = - (nsStyleText*)mStyleContext->GetData(kStyleTextSID); - - nscoord topInset = spacing->mBorderPadding.top; - nscoord bottomInset = spacing->mBorderPadding.bottom; - PRUint8 verticalAlignFlags = NS_STYLE_VERTICAL_ALIGN_MIDDLE; - if (textStyle->mVerticalAlign.GetUnit() == eStyleUnit_Enumerated) { - verticalAlignFlags = textStyle->mVerticalAlign.GetIntValue(); - } - - nscoord height = mRect.height; - - nsRect kidRect; - mFirstChild->GetRect(kidRect); - nscoord childHeight = kidRect.height; - - - // Vertically align the child - nscoord kidYTop = 0; - switch (verticalAlignFlags) - { - case NS_STYLE_VERTICAL_ALIGN_BASELINE: - // Align the child's baseline at the max baseline - //kidYTop = aMaxAscent - kidAscent; - break; - - case NS_STYLE_VERTICAL_ALIGN_TOP: - // Align the top of the child frame with the top of the box, - // minus the top padding - kidYTop = topInset; - break; - - case NS_STYLE_VERTICAL_ALIGN_BOTTOM: - kidYTop = height - childHeight - bottomInset; - break; - - default: - case NS_STYLE_VERTICAL_ALIGN_MIDDLE: - kidYTop = height/2 - childHeight/2; - } - mFirstChild->MoveTo(kidRect.x, kidYTop); -} - -/** helper method to get the row span of this frame's content (which must be a cell) */ -PRInt32 nsTableCellFrame::GetRowSpan() -{ - PRInt32 result = 0; - nsTableCell *cellContent = (nsTableCell *)mContent; - if (nsnull!=cellContent) - { - result = cellContent->GetRowSpan(); - } - return result; -} - -/** helper method to get the col span of this frame's content (which must be a cell) */ -PRInt32 nsTableCellFrame::GetColSpan() -{ - PRInt32 result = 0; - nsTableCell *cellContent = (nsTableCell *)mContent; - if (nsnull!=cellContent) - { - result = cellContent->GetColSpan(); - } - return result; -} - -/** helper method to get the col index of this frame's content (which must be a cell) */ -PRInt32 nsTableCellFrame::GetColIndex() -{ - PRInt32 result = 0; - nsTableCell *cellContent = (nsTableCell *)mContent; - if (nsnull!=cellContent) - { - result = cellContent->GetColIndex(); - } - return result; -} - -void nsTableCellFrame::CreatePsuedoFrame(nsIPresContext* aPresContext) -{ - // Do we have a prev-in-flow? - if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame - nsBodyFrame::NewFrame(&mFirstChild, mContent, mIndexInParent, this); - mChildCount = 1; - - // Resolve style and set the style context - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(mContent, this); // styleContext: ADDREF++ - mFirstChild->SetStyleContext(styleContext); - NS_RELEASE(styleContext); // styleContext: ADDREF-- - } else { - nsTableCellFrame* prevFrame = (nsTableCellFrame *)mPrevInFlow; - - nsIFrame* prevPseudoFrame = prevFrame->mFirstChild; - NS_ASSERTION(prevFrame->ChildIsPseudoFrame(prevPseudoFrame), "bad previous pseudo-frame"); - - // Create a continuing column - prevPseudoFrame->CreateContinuingFrame(aPresContext, this, mFirstChild); - mChildCount = 1; - } -} - -/** - */ -NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); - -#ifdef NS_DEBUG - //PreReflowCheck(); -#endif - - aStatus = frComplete; - if (gsDebug==PR_TRUE) - printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - - mFirstContentOffset = mLastContentOffset = 0; - - nsSize availSize(aMaxSize); - nsSize maxElementSize; - nsSize *pMaxElementSize = aMaxElementSize; - if (NS_UNCONSTRAINEDSIZE==aMaxSize.width) - pMaxElementSize = &maxElementSize; - nsReflowMetrics kidSize; - nscoord x = 0; - // SEC: what about ascent and decent??? - - // Compute the insets (sum of border and padding) - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nscoord topInset = spacing->mBorderPadding.top; - nscoord rightInset = spacing->mBorderPadding.right; - nscoord bottomInset = spacing->mBorderPadding.bottom; - nscoord leftInset = spacing->mBorderPadding.left; - - // reduce available space by insets - if (NS_UNCONSTRAINEDSIZE!=availSize.width) - availSize.width -= leftInset+rightInset; - if (NS_UNCONSTRAINEDSIZE!=availSize.height) - availSize.height -= topInset+bottomInset; - - mLastContentIsComplete = PR_TRUE; - - // get frame, creating one if needed - if (nsnull==mFirstChild) - { - CreatePsuedoFrame(aPresContext); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - if (availSize.height < 0) - availSize.height = 1; - nsSize maxKidElementSize; - if (gsDebug==PR_TRUE) - printf(" nsTableCellFrame::ResizeReflow calling ReflowChild with availSize=%d,%d\n", - availSize.width, availSize.height); - aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, availSize, pMaxElementSize); - - if (gsDebug==PR_TRUE) - { - if (nsnull!=pMaxElementSize) - printf(" nsTableCellFrame::ResizeReflow: child returned desiredSize=%d,%d,\ - and maxElementSize=%d,%d\n", - kidSize.width, kidSize.height, - pMaxElementSize->width, pMaxElementSize->height); - else - printf(" nsTableCellFrame::ResizeReflow: child returned desiredSize=%d,%d,\ - and maxElementSize=nsnull\n", - kidSize.width, kidSize.height); - } - - SetFirstContentOffset(mFirstChild); - if (gsDebug) printf("CELL: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - SetLastContentOffset(mFirstChild); - if (gsDebug) printf("CELL: set last content offset to %d\n", GetLastContentOffset()); //@@@ - - // Place the child since some of it's content fit in us. - mFirstChild->SetRect(nsRect(leftInset + x, topInset, - kidSize.width, kidSize.height)); - - - if (frNotComplete == aStatus) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - } - - // Return our size and our result - PRInt32 kidWidth = kidSize.width; - if (NS_UNCONSTRAINEDSIZE!=kidSize.width) //&& NS_UNCONSTRAINEDSIZE!=aMaxSize.width) - kidWidth += leftInset + rightInset; - PRInt32 kidHeight = kidSize.height; - - // height can be set w/o being restricted by aMaxSize.height - if (NS_UNCONSTRAINEDSIZE!=kidSize.height) - kidHeight += topInset + bottomInset; - aDesiredSize.width = kidWidth; - aDesiredSize.height = kidHeight; - aDesiredSize.ascent = topInset; - aDesiredSize.descent = bottomInset; - - if (nsnull!=aMaxElementSize) - { - *aMaxElementSize = *pMaxElementSize; - aMaxElementSize->height += topInset + bottomInset; - aMaxElementSize->width += leftInset + rightInset; - } - - if (gsDebug==PR_TRUE) - printf(" nsTableCellFrame::ResizeReflow returning aDesiredSize=%d,%d\n", - aDesiredSize.width, aDesiredSize.height); - -#ifdef NS_DEBUG - //PostReflowCheck(result); -#endif - - return NS_OK; -} - -NS_METHOD nsTableCellFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n"); - // total hack for now, just some hard-coded values - ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - return NS_OK; -} - -NS_METHOD nsTableCellFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableCellFrame* cf = new nsTableCellFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - - -/* ----- static methods ----- */ - -nsresult nsTableCellFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableCellFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h deleted file mode 100644 index c41849660b4..00000000000 --- a/mozilla/layout/html/table/src/nsTableCellFrame.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableCellFrame_h__ -#define nsTableCellFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" -#include "nsTableCell.h" - -/** - * nsTableCellFrame - * data structure to maintain information about a single table cell's frame - * - * @author sclark - */ -class nsTableCellFrame : public nsContainerFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** - * @see nsContainerFrame - */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - void VerticallyAlignChild(nsIPresContext* aPresContext); - - /** return the mapped cell's row span. Always >= 1. */ - virtual PRInt32 GetRowSpan(); - - /** return the mapped cell's col span. Always >= 1. */ - virtual PRInt32 GetColSpan(); - - /** return the mapped cell's column index (starting at 0 for the first column) */ - virtual PRInt32 GetColIndex(); - - virtual ~nsTableCellFrame(); - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableCellFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** Create a psuedo-frame for this caption. Handles continuing frames as needed. - */ - virtual void CreatePsuedoFrame(nsIPresContext* aPresContext); - - -}; - - -#endif diff --git a/mozilla/layout/html/table/src/nsTableCol.cpp b/mozilla/layout/html/table/src/nsTableCol.cpp deleted file mode 100644 index 8a2ec92b382..00000000000 --- a/mozilla/layout/html/table/src/nsTableCol.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableCol.h" -#include "nsTableColGroup.h" -#include "nsTablePart.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsContainerFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsHTMLIIDs.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - -class nsTableColFrame : public nsFrame { -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - -protected: - - nsTableColFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - ~nsTableColFrame(); - -}; - - - -nsTableColFrame::nsTableColFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsTableColFrame::~nsTableColFrame() -{ -} - -NS_METHOD nsTableColFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - if (gsDebug==PR_TRUE) - printf("nsTableColFrame::Paint\n"); - return NS_OK; -} - - -NS_METHOD nsTableColFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad arg"); - if (gsDebug==PR_TRUE) printf("nsTableoupFrame::ResizeReflow\n"); - aDesiredSize.width=0; - aDesiredSize.height=0; - if (nsnull!=aMaxElementSize) - { - aMaxElementSize->width=0; - aMaxElementSize->height=0; - } - aStatus = nsIFrame::frComplete; - return NS_OK; -} - -NS_METHOD nsTableColFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad arg"); - if (gsDebug==PR_TRUE) printf("nsTableColFrame::IncrementalReflow\n"); - aDesiredSize.width=0; - aDesiredSize.height=0; - aStatus = nsIFrame::frComplete; - return NS_OK; -} - -nsresult nsTableColFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableColFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -//---------------------- nsTableCol implementation ----------------------------------- - -nsTableCol::nsTableCol(nsIAtom* aTag) - : nsTableContent(aTag), - mColGroup(0), - mColIndex(0), - mRepeat(0) -{ -} - -nsTableCol::nsTableCol() -: nsTableContent(NS_NewAtom(nsTablePart::kColTagString)), - mColGroup(0), - mColIndex(0), - mRepeat(0) -{ -} - -nsTableCol::nsTableCol (PRBool aImplicit) - : nsTableContent(NS_NewAtom(nsTablePart::kColTagString)), - mColGroup(0), - mColIndex(0), - mRepeat(0) -{ - mImplicit = aImplicit; -} - -nsTableCol::~nsTableCol() -{ -} - -// Added for debuging purposes -- remove from final build -nsrefcnt nsTableCol::AddRef(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Add Ref: %x, nsTableCol cnt = %d \n",this, mRefCnt+1); - return ++mRefCnt; -} - -nsrefcnt nsTableCol::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Release: %x, nsTableCol cnt = %d \n",this,mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: %x, nsTableCol \n",this); - delete this; - return 0; - } - return mRefCnt; -} - -int nsTableCol::GetType() -{ - return nsITableContent::kTableColType; -} - -int nsTableCol::GetRepeat () -{ - if (0 < mRepeat) - return mRepeat; - return 1; -} - -nsTableColGroup * nsTableCol::GetColGroup () -{ - NS_IF_ADDREF(mColGroup); - return mColGroup; -} - -void nsTableCol::SetColGroup (nsTableColGroup * aColGroup) -{ - mColGroup = aColGroup; -} - -int nsTableCol::GetColumnIndex () -{ - return mColIndex; -} - -void nsTableCol::SetColumnIndex (int aColIndex) -{ - mColIndex = aColIndex; -} - -void nsTableCol::SetRepeat (int aRepeat) -{ - mRepeat = aRepeat; - ResetColumns (); -} - -void nsTableCol::ResetColumns () -{ - if (nsnull != mColGroup) - mColGroup->ResetColumns (); -} - -static const nsString kRepeatAttributeName("REPEAT"); - -PRBool nsTableCol::SetInternalAttribute (nsString * aName, nsString * aValue) -{ - /* - // Assert aName and aValue - if (aName->EqualsIgnoreCase (kRepeatAttributeName)) - { - PRInt32 value = atoi(aValue->ToCString()); - SetRepeat (aValue); - return true; - } - return super.setInternalAttribute (aName, aValue); - */ - return PR_FALSE; -} - -/** I allocated it for you, you delete it when you're done */ -// ack!!! SEC this code and HTMLContainer need to get together and decide -nsString * nsTableCol::GetInternalAttribute (nsString * aName) -{ - /* - // Assert aName - if (aName->EqualsIgnoreCase (kRepeatAttributeName)) - { - char repeatAsCharArray[10]; - sprintf(repeatAsCharArray, "%d", GetRepeat()); - nsString * result = new nsString(repeatAsCharArray); - } - return nsTableContent::GetInternalAttribute (aName); - */ - return nsnull; -} - -PRBool nsTableCol::UnsetInternalAttribute (nsString * aName) -{ - /* - if (aName->EqualsIgnoreCase (kRepeatAttributeName)) - { - fRepeat = 0; - return true; - } - return nsTableContent::UnsetInternalAttribute (aName); - */ - return PR_FALSE; -} - -int nsTableCol::GetInternalAttributeState (nsString * aName) -{ - /* - if (aName->EqualsIgnoreCase (kRepeatAttributeName)) - { - if (0 < fRepeat) - return kAttributeSet; - } - return super.getInternalAttributeState (aName); - */ - return 0; -} - -PRBool nsTableCol::IsInternalAttribute (nsString * aName) -{ - /* - if (aName->EqualsIgnoreCase (kRepeatAttributeName)) - return true; - return super.isInternalAttribute (aName); - */ - return PR_FALSE; -} - - -static nsString * kInternalAttributeNames = nsnull; - -nsString * nsTableCol::GetAllInternalAttributeNames () -{ - /* - if (null == kInternalAttributeNames) - { - nsString * [] superInternal = super.getAllInternalAttributeNames (); - - int superLen = superInternal.length; - kInternalAttributeNames = new nsString * [superLen + 1]; - System.arraycopy (superInternal, 0, kInternalAttributeNames, 0, superLen); - kInternalAttributeNames[superLen] = kRepeatAttributeName; - } - return kInternalAttributeNames; - */ - return nsnull; -} - -nsIFrame* nsTableCol::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv; - nsresult status = nsTableColFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - return rv; -} - -/* ---------- Global Functions ---------- */ - -nsresult -NS_NewTableColPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new nsTableCol(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/table/src/nsTableCol.h b/mozilla/layout/html/table/src/nsTableCol.h deleted file mode 100644 index 3aef2b15307..00000000000 --- a/mozilla/layout/html/table/src/nsTableCol.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableCol_h__ -#define nsTableCol_h__ - -#include "nscore.h" -#include "nsTableContent.h" -#include "nsTableColGroup.h" - -class nsTablePart; - -/** - * nsTableCol is the content object that represents table cols - * (HTML tag COL). This class cannot be reused - * outside of an nsTableColGroup. It assumes that its parent is an nsTableColGroup, and - * it has no children. - * - * @see nsTablePart - * @see nsTableColGroup - * - * @author sclark - */ -class nsTableCol : public nsTableContent -{ - -private: - - /** parent pointer, the column group to which this column belongs */ - nsTableColGroup * mColGroup; - - /** the starting index of the column (starting at 0) that this col object represents */ - PRInt32 mColIndex; - - /** the number of columns that the attributes of this column extend to */ - PRInt32 mRepeat; - -public: - - /** default constructor */ - nsTableCol (); - - /** constructor - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this col. - */ - nsTableCol (PRBool aImplicit); - - /** constructor - * @param aTag the HTML tag causing this col to get constructed. - */ - nsTableCol (nsIAtom* aTag); - - /** destructor, not responsible for any memory destruction itself */ - virtual ~nsTableCol(); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - /** returns nsITableContent::kTableCellType */ - virtual int GetType(); - - /** @see nsIHTMLContent::CreateFrame */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** return the number of columns this content object represents. always >= 1*/ - virtual int GetRepeat (); - - /** set the number of columns this content object represents. must be >= 1*/ - void SetRepeat (int aRepeat); - - virtual nsTableColGroup *GetColGroup (); - - /** set the parent col group.
    - * NOTE: Since mColGroup is the parent of the table column, - * reference counting should NOT be done on - * this variable when setting the row. - * see /ns/raptor/doc/MemoryModel.html - **/ - virtual void SetColGroup (nsTableColGroup * aColGroup); - - /** return the index of the column this content object represents. always >= 0 */ - virtual int GetColumnIndex (); - - /** set the index of the column this content object represents. must be >= 0 */ - virtual void SetColumnIndex (int aColIndex); - - virtual void ResetColumns (); - - - /* ----------- nsITableContent overrides ----------- */ - -protected: - - /** obsolete */ - PRBool SetInternalAttribute (nsString *aName, nsString *aValue); - /** obsolete */ - nsString *GetInternalAttribute (nsString *aName); - /** obsolete */ - PRBool UnsetInternalAttribute (nsString *aName); - /** obsolete */ - int GetInternalAttributeState (nsString *aName); - /** obsolete */ - PRBool IsInternalAttribute (nsString *aName); - /** obsolete */ - static nsString * kInternalAttributeNames; - /** obsolete */ - nsString * GetAllInternalAttributeNames (); - - -}; - -#endif - - - diff --git a/mozilla/layout/html/table/src/nsTableColGroup.cpp b/mozilla/layout/html/table/src/nsTableColGroup.cpp deleted file mode 100644 index b7d8a996eb6..00000000000 --- a/mozilla/layout/html/table/src/nsTableColGroup.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableColGroup.h" -#include "nsTableColGroupFrame.h" -#include "nsTableCol.h" -#include "nsTablePart.h" -#include "nsContainerFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsHTMLIIDs.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - - -nsTableColGroup::nsTableColGroup(nsIAtom* aTag, int aSpan) - : nsTableContent(aTag), - mSpan(aSpan), - mStartColIndex(0), - mColCount(0) -{ -} - -nsTableColGroup::nsTableColGroup (PRBool aImplicit) - : nsTableContent(NS_NewAtom(nsTablePart::kColGroupTagString)), - mSpan(0), - mStartColIndex(0), - mColCount(0) -{ - mImplicit = aImplicit; -} - - -nsTableColGroup::~nsTableColGroup() -{ -} - -// Added for debuging purposes -- remove from final build -nsrefcnt nsTableColGroup::AddRef(void) -{ - if (gsNoisyRefs==PR_TRUE) - printf("Add Ref: %x, nsTableColGroup cnt = %d \n",this,mRefCnt+1); - return ++mRefCnt; -} - -nsrefcnt nsTableColGroup::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) - if (gsNoisyRefs==PR_TRUE) printf("Release: %x, nsTableColGroup cnt = %d \n",this,mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: %x, nsTableColGroup \n",this); - delete this; - return 0; - } - return mRefCnt; -} - -int nsTableColGroup::GetType() -{ - return nsITableContent::kTableColGroupType; -} - -int nsTableColGroup::GetSpan () -{ - if (0 < mSpan) - return mSpan; - return 1; -} - -int nsTableColGroup::GetStartColumnIndex () -{ - return mStartColIndex; -} - -void nsTableColGroup::SetStartColumnIndex (int aIndex) -{ - if (aIndex != mStartColIndex) - mColCount = 0; // our index is being changed, trigger reset of col indicies, don't propogate back to table - mStartColIndex = aIndex; -} - - -void nsTableColGroup::SetSpan (int aSpan) -{ - mSpan = aSpan; - if (0 < ChildCount ()) // span is only relevant if we don't have children - ResetColumns (); -} - -void nsTableColGroup::ResetColumns () -{ - mColCount = 0; - if (nsnull != mTable) - mTable->ResetColumns (); -} - -/** returns the number of columns represented by this group. - * if there are col children, count them (taking into account the span of each) - * else, check my own span attribute. - */ -int nsTableColGroup::GetColumnCount () -{ - if (0 == mColCount) - { - int count = ChildCount (); - if (0 < count) - { - for (int index = 0; index < count; index++) - { - nsIContent * child = ChildAt (index); // child: REFCNT++ - NS_ASSERTION(nsnull!=child, "bad child"); - // is child a column? - nsTableContent *tableContent = (nsTableContent *)child; - if (tableContent->GetType() == nsITableContent::kTableColType) - { - nsTableCol * col = (nsTableCol *)tableContent; - col->SetColumnIndex (mStartColIndex + mColCount); - mColCount += col->GetRepeat (); - } - NS_RELEASE(child); // child: REFCNT-- - } - } - else - mColCount = GetSpan (); - } - return mColCount; -} - -PRBool nsTableColGroup::SetInternalAttribute (nsString *aName, nsString *aValue) -{ -// Assert aName - PRBool result = PR_FALSE; - return result; -} - -nsString * nsTableColGroup::GetInternalAttribute (nsString *aName) -{ -// Assert aName - nsString * result = nsnull; - return result; -} - -PRBool nsTableColGroup::UnsetInternalAttribute (nsString *aName) -{ -// Assert aName - PRBool result = PR_FALSE; - return result; -} - -int nsTableColGroup::GetInternalAttributeState (nsString *aName) -{ -// Assert aName - int result = 0; - return result; -} - -PRBool nsTableColGroup::IsInternalAttribute (nsString *aName) -{ -// Assert aName - PRBool result = PR_FALSE; - return result; -} - -nsString * nsTableColGroup::GetAllInternalAttributeNames () -{ -// Assert aName - nsString * result = nsnull; - return result; -} - -PRBool nsTableColGroup::AppendChild (nsIContent *aContent) -{ - NS_ASSERTION(nsnull!=aContent, "bad arg"); - - // is aContent a TableRow? - PRBool isCol = IsCol(aContent); - - if (PR_FALSE==isCol) - { - // you should go talk to my parent if you want to insert something other than a column - return PR_FALSE; - } - - PRBool result = PR_FALSE; - PRBool contentHandled = PR_FALSE; - // SEC: TODO verify that aContent is table content - nsTableContent *tableContent = (nsTableContent *)aContent; - if (PR_FALSE==tableContent->IsImplicit()) - { - /* if aContent is not implicit, - * and if we already have an implicit column for this actual column, - * then replace the implicit col with this actual col. - */ - PRInt32 childCount = ChildCount(); - for (PRInt32 colIndex=0; colIndexIsImplicit()) - { - ReplaceChildAt(aContent, colIndex); - contentHandled = PR_TRUE; - break; - } - } - } - if (PR_FALSE==contentHandled) - result = nsTableContent::AppendChild (aContent); - if (result) - { - /* Set the table pointer */ - ((nsTableContent*)aContent)->SetTable(mTable); - - ((nsTableCol *)aContent)->SetColGroup (this); - ResetColumns (); - } - return result; -} - -PRBool nsTableColGroup::InsertChildAt (nsIContent *aContent, int aIndex) -{ - NS_ASSERTION(nsnull!=aContent, "bad arg"); - - // is aContent a TableCol? - PRBool isCol = IsCol(aContent); - - // if not, ignore the request to add aContent - if (PR_FALSE==isCol) - { - // you should go talk to my parent if you want to insert something other than a column - return PR_FALSE; - } - - // if so, add the row to this group - PRBool result = nsTableContent::InsertChildAt (aContent, aIndex); - if (result) - { - ((nsTableCol *)aContent)->SetColGroup (this); - ResetColumns (); - } - return result; -} - - -PRBool nsTableColGroup::ReplaceChildAt (nsIContent * aContent, int aIndex) -{ - NS_ASSERTION(nsnull!=aContent, "bad arg"); - NS_ASSERTION((0<=aIndex && ChildCount()>aIndex), "bad arg"); - if ((nsnull==aContent) || !(0<=aIndex && ChildCount()>aIndex)) - return PR_FALSE; - - // is aContent a TableRow? - PRBool isCol = IsCol(aContent); - - // if not, ignore the request to replace the child at aIndex - if (PR_FALSE==isCol) - { - // you should go talk to my parent if you want to insert something other than a column - return PR_FALSE; - } - - nsIContent * lastChild = ChildAt (aIndex); // lastChild : REFCNT++ - NS_ASSERTION(nsnull!=lastChild, "bad child"); - PRBool result = nsTableContent::ReplaceChildAt (aContent, aIndex); - if (result) - { - ((nsTableCol *)aContent)->SetColGroup (this); - if (nsnull != lastChild) - ((nsTableCol *)lastChild)->SetColGroup (nsnull); - ResetColumns (); - } - NS_RELEASE(lastChild); // lastChild : REFCNT-- - return result; -} - -/** - * Remove a child at the given position. The method is ignored if - * the index is invalid (too small or too large). - */ -PRBool nsTableColGroup::RemoveChildAt (int aIndex) -{ - NS_ASSERTION((0<=aIndex && ChildCount()>aIndex), "bad arg"); - nsIContent * lastChild = ChildAt (aIndex); // lastChild: REFCNT++ - NS_ASSERTION(nsnull!=lastChild, "bad child"); - PRBool result = nsTableContent::RemoveChildAt (aIndex); - if (result) - { - if (nsnull != lastChild) - ((nsTableCol *)lastChild)->SetColGroup (nsnull); - ResetColumns (); - } - NS_IF_RELEASE(lastChild); // lastChild REFCNT-- - return result; -} - -/** support method to determine if the param aContent is a TableRow object */ -PRBool nsTableColGroup::IsCol(nsIContent * aContent) const -{ - NS_ASSERTION(nsnull!=aContent, "bad arg"); - PRBool result = PR_FALSE; - if (nsnull!=aContent) - { - // is aContent a col? - nsTableContent *tableContent = (nsTableContent *)aContent; - const int contentType = tableContent->GetType(); - if (contentType == nsITableContent::kTableColType) - result = PR_TRUE; - } - return result; -} - -nsIFrame* nsTableColGroup::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv; - nsresult status = nsTableColGroupFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - NS_ASSERTION(nsnull!=rv, "can't allocate a new frame"); - return rv; -} - -/* ---------- Global Functions ---------- */ - -NS_HTML nsresult -NS_NewTableColGroupPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new nsTableColGroup(aTag, 0); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/table/src/nsTableColGroup.h b/mozilla/layout/html/table/src/nsTableColGroup.h deleted file mode 100644 index 121adda21d6..00000000000 --- a/mozilla/layout/html/table/src/nsTableColGroup.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableColGroup_h__ -#define nsTableColGroup_h__ - -#include "nscore.h" -#include "nsTableContent.h" - -class nsIPresContext; - -/** - * nsTableColGroup is the content object that represents table col groups - * (HTML tag COLGROUP). This class cannot be reused - * outside of an nsTablePart. It assumes that its parent is an nsTablePart, and - * its children are nsTableCols. - * - * @see nsTablePart - * @see nsTableCol - * - * @author sclark - */ -class nsTableColGroup : public nsTableContent -{ -protected: - - /** the number of columns this col group represents. Must be >=1. - * Default is 1. - * Must be ignored if the colgroup contains any explicit col content objects. - */ - int mSpan; - - /** the starting column index this col group represents. Must be >= 0. */ - int mStartColIndex; - - /** the number of columns represented by this col group when col content - * objects are contained herein. If no col children, then mSpan is the - * proper place to check. - * @see GetColumnCount - */ - int mColCount; - -public: - - /** constructor - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this col group. - */ - nsTableColGroup (PRBool aImplicit); - - /** constructor - * @param aTag the HTML tag causing this caption to get constructed. - * @param aSpan the number of columns this col group represents - * (unless overridden by col children.) - */ - nsTableColGroup (nsIAtom* aTag, int aSpan); - - /** destructor, not responsible for any memory destruction itself */ - virtual ~nsTableColGroup(); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - /** @see nsIHTMLContent::CreateFrame */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** returns nsITableContent::kTableColGroupType */ - virtual int GetType(); - - /** returns the span attribute, always >= 1. Not necessarily representative - * of the number of columns spanned, since span is overridden by any COL - * children. - * @see GetColumnCount - */ - virtual int GetSpan (); - - /** set the span attribute, must be >= 1. */ - virtual void SetSpan (int aSpan); - - /** get the starting column index, always >= 0. */ - virtual int GetStartColumnIndex (); - - /** set the starting column index, must be >= 0. */ - virtual void SetStartColumnIndex (int aIndex); - - /** called whenever the col structure changes. - * Propogates change notification up to the nsTablePart parent - */ - virtual void ResetColumns (); - - /** returns the number of columns represented by this group. - * if there are col children, count them (taking into account the span of each) - * else, check my own span attribute. - */ - virtual int GetColumnCount (); - - /** helper routine returns PR_TRUE if aContent represents a column */ - virtual PRBool IsCol(nsIContent * aContent) const; - - /** can only append objects that are columns (implement nsITableContent and are . - * of type nsITableContent::kTableColType.) - * @see nsIContent::AppendChild - */ - virtual PRBool AppendChild (nsIContent * aContent); - - /** can only insert objects that are columns (implement nsITableContent and are . - * of type nsITableContent::kTableColType.) - * @see nsIContent::InsertChildAt - */ - virtual PRBool InsertChildAt (nsIContent * aContent, int aIndex); - - /** can only replace child objects with objects that are columns - * (implement nsITableContent and are * of type nsITableContent::kTableColType.) - * @param aContent the object to insert, must be a column - * @param aIndex the index of the object to replace. Must be in the range - * 0<=aIndexwidth=0; - aMaxElementSize->height=0; - } - aStatus = nsIFrame::frComplete; - return NS_OK; -} - -NS_METHOD -nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad arg"); - if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n"); - return NS_OK; -} - -nsresult nsTableColGroupFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableColGroupFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.h b/mozilla/layout/html/table/src/nsTableColGroupFrame.h deleted file mode 100644 index e2a93f7a00b..00000000000 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableColGroupFrame_h__ -#define nsTableColGroupFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - - -/** - * nsTableColGroupFrame - * data structure to maintain information about a single table cell's frame - * - * @author sclark - */ -class nsTableColGroupFrame : public nsContainerFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - -protected: - - nsTableColGroupFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - ~nsTableColGroupFrame(); - -}; - -#endif diff --git a/mozilla/layout/html/table/src/nsTableContent.cpp b/mozilla/layout/html/table/src/nsTableContent.cpp deleted file mode 100644 index b06d2cbc73a..00000000000 --- a/mozilla/layout/html/table/src/nsTableContent.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableContent.h" -#include "nsITableContent.h" -#include "nsString.h" - -const int nsITableContent::kTableRowGroupType=1; -const int nsITableContent::kTableRowType=2; -const int nsITableContent::kTableColGroupType=3; -const int nsITableContent::kTableColType=4; -const int nsITableContent::kTableCaptionType=5; -const int nsITableContent::kTableCellType=6; - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - -static NS_DEFINE_IID(kITableContentIID, NS_ITABLECONTENT_IID); - -/** - * default contstructor - */ -nsTableContent::nsTableContent (nsIAtom* aTag) - : nsHTMLContainer(aTag) -{ -} - -/** - */ -nsTableContent::nsTableContent (nsIAtom* aTag, PRBool aImplicit) - : nsHTMLContainer(aTag), - mImplicit(aImplicit) -{ -} - -nsrefcnt nsTableContent::AddRef(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Add Ref: nsTableContent cnt = %d \n",mRefCnt+1); - return ++mRefCnt; -} - -nsrefcnt nsTableContent::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Release: nsTableContent cnt = %d \n",mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: nsTableContent \n"); - delete this; - return 0; - } - return mRefCnt; -} - - -nsresult nsTableContent::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kITableContentIID)) { - *aInstancePtrResult = (void*) ((nsITableContent*)this); - AddRef(); - return NS_OK; - } - return nsHTMLContent::QueryInterface(aIID, aInstancePtrResult); -} - -/** - * Don't want to put out implicit tags when saving. - */ -PRBool nsTableContent::SkipSelfForSaving() -{ - return mImplicit; -} - -nsTablePart* nsTableContent::GetTable () -{ - NS_IF_ADDREF(mTable); - return mTable; -} - -void nsTableContent::SetTableForChildren(nsTablePart *aTable) -{ - if (aTable != nsnull) - { - PRInt32 count = ChildCount(); - for (PRInt32 index = 0; index < count; index++) - SetTableForTableContent(ChildAt(index),aTable); - } -} - - -void nsTableContent::SetTable (nsTablePart *aTable) -{ - // Check to see if the current table was null, if it was, then call - // method to reset children - if (mTable == nsnull) - SetTableForChildren(aTable); - mTable = aTable; -} - -PRBool nsTableContent::IsImplicit () const -{ - return mImplicit; -} - - -/* ----- overridable methods from nsHTMLContainer ----- */ - -/** -* -* If the content is a nsTableContent then call SetTable on -* aContent, otherwise, do nothing. -* -*/ -void nsTableContent::SetTableForTableContent(nsIContent* aContent, nsTablePart *aTable) -{ - if (aContent != nsnull) - { - nsITableContent* tableContent; - nsresult result = aContent->QueryInterface(kITableContentIID, (void**) &tableContent); - if (NS_OK == result) - { - tableContent->SetTable(aTable); - NS_IF_RELEASE(tableContent); - } - } -} - - -void nsTableContent::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - nsIAtom* tag = GetTag(); - if (tag != nsnull) { - nsAutoString buf; - tag->ToString(buf); - fputs(buf, out); - NS_RELEASE(tag); - } - - char *isImplicitString = ""; - if (PR_TRUE==IsImplicit()) - isImplicitString = " (I)"; - - ListAttributes(out); - - if (gsNoisyRefs == PR_TRUE) - fprintf(out, " RefCount=%d<%s\n", mRefCnt, isImplicitString); - - if (CanContainChildren()) { - PRInt32 kids = ChildCount(); - for (i = 0; i < kids; i++) { - nsIContent* kid = ChildAt(i); - kid->List(out, aIndent + 1); - NS_RELEASE(kid); - } - } - for (i = aIndent; --i >= 0; ) fputs(" ", out); - fputs(">\n", out); -} - -PRBool nsTableContent::InsertChildAt(nsIContent* aKid, PRInt32 aIndex) -{ - PRBool result = nsHTMLContainer::InsertChildAt(aKid, aIndex); - if (result == PR_TRUE) - SetTableForTableContent(aKid,mTable); - return result; -} - -PRBool nsTableContent::ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex) -{ - nsIContent* child = ChildAt(aIndex); - PRBool result = nsHTMLContainer::ReplaceChildAt(aKid, aIndex); - if (result == PR_TRUE) - { - SetTableForTableContent(child,nsnull); - SetTableForTableContent(aKid,mTable); - } - NS_IF_RELEASE(child); - return result; -} - -PRBool nsTableContent::AppendChild(nsIContent* aKid) -{ - PRBool result = nsHTMLContainer::AppendChild(aKid); - if (result == PR_TRUE) - SetTableForTableContent(aKid,mTable); - return result; -} - -PRBool nsTableContent::RemoveChildAt(PRInt32 aIndex) -{ - nsTableContent* child = (nsTableContent*)ChildAt(aIndex); - PRBool result = nsHTMLContainer::RemoveChildAt(aIndex); - if (result == PR_TRUE) - SetTableForTableContent(child,nsnull); - NS_IF_RELEASE(child); - return result; -} - -/* ---------- nsITableContent implementations ----------- */ - -nsITableContent::nsITableContent () -{} - diff --git a/mozilla/layout/html/table/src/nsTableContent.h b/mozilla/layout/html/table/src/nsTableContent.h deleted file mode 100644 index 83127a2b997..00000000000 --- a/mozilla/layout/html/table/src/nsTableContent.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableContent_h__ -#define nsTableContent_h__ - -#include "nscore.h" -#include "nsITableContent.h" -#include "nsHTMLContainer.h" -#include "nsTablePart.h" -#include "nsIAtom.h" - -/** - * TableContent is a concrete base class for all content nodes contained directly - * within a table. - * - * @author sclark - * @version $Revision: 3.3 $ - * @see - */ -class nsTableContent : public nsHTMLContainer, public nsITableContent -{ - -public: - -protected: - /** the table to which this content belongs */ - nsTablePart *mTable; - - /** PR_TRUE if this content was generated in response to incomplete input, - * meaning there is no actual input tag matching this container. - */ - PRBool mImplicit; - -public: - - /** constructor - * @param aTag the HTML tag causing this caption to get constructed. - */ - nsTableContent (nsIAtom* aTag); - - /** constructor - * @param aTag the HTML tag causing this caption to get constructed. - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this caption. - */ - nsTableContent (nsIAtom* aTag, PRBool aImplicit); - - /** supports implementation */ - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtrResult); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - /** @see nsITableContent::GetTable */ - nsTablePart* GetTable (); - - /** @see nsITableContent::SetTable - * Note: Since mColGroup is the parent of the table column, - * reference counting should NOT be done. - * see /ns/raptor/doc/MemoryModel.html - **/ - void SetTable (nsTablePart *aTable); - - - /** Set the children of this piece of content to - * be aTable - **/ - void SetTableForChildren(nsTablePart *aTable); - - - /** @see nsITableContent::IsImplicit */ - virtual PRBool IsImplicit () const; - - /** @see nsITableContent::SkipSelfForSaving */ - virtual PRBool SkipSelfForSaving (); - - /** @see nsITableContent::GetType */ - virtual int GetType()=0; - - /** debug method prints out this and all child frames */ - void List(FILE* out, PRInt32 aIndent) const; - - PRBool InsertChildAt(nsIContent* aKid, PRInt32 aIndex); - PRBool ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex); - PRBool AppendChild(nsIContent* aKid); - PRBool RemoveChildAt(PRInt32 aIndex); - - -private: - /** - * - * If the content is a nsTableContent then call SetTable on - * aContent, otherwise, do nothing. - * - */ - void SetTableForTableContent(nsIContent* aContent, nsTablePart *aTable); - -}; - -#endif - diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp deleted file mode 100644 index 2efa9daef97..00000000000 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ /dev/null @@ -1,2939 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableFrame.h" -#include "nsTablePart.h" -#include "nsIRenderingContext.h" -#include "nsIStyleContext.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsCellMap.h" -#include "nsTableContent.h" -#include "nsTableCell.h" -#include "nsTableCellFrame.h" -#include "nsTableCol.h" -#include "nsTableRowFrame.h" -#include "nsTableRowGroupFrame.h" -#include "nsColLayoutData.h" -#include "nsIPresContext.h" -#include "nsCSSRendering.h" -#include "nsStyleConsts.h" -#include "nsCellLayoutData.h" -#include "nsVoidArray.h" -#include "prinrval.h" -#include "nsIPtr.h" - - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_TRUE; -static PRBool gsDebugCLD = PR_FALSE; -static PRBool gsTiming = PR_FALSE; -static PRBool gsDebugMBP = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsDebugCLD = PR_FALSE; -static const PRBool gsTiming = PR_FALSE; -static const PRBool gsDebugMBP = PR_FALSE; -#endif - -#ifndef max -#define max(x, y) ((x) > (y) ? (x) : (y)) -#endif - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); -NS_DEF_PTR(nsTableContent); -NS_DEF_PTR(nsTableCol); -NS_DEF_PTR(nsTableCell); - -/* ----------- InnerTableReflowState ---------- */ - -struct InnerTableReflowState { - - // The body's style molecule - - // The body's available size (computed from the body's parent) - nsSize availSize; - - nscoord leftInset, topInset; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Running y-offset - nscoord y; - - // Flag for whether we're dealing with the first interior row group - PRBool firstRowGroup; - - // a list of the footers in this table frame, for quick access when inserting bodies - nsVoidArray *footerList; - - // cache the total height of the footers for placing body rows - nscoord footerHeight; - - InnerTableReflowState(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsStyleSpacing* aStyleSpacing) - { - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - y=0; // border/padding/margin??? - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - availSize.width = aMaxSize.width; - if (!unconstrainedWidth) { - availSize.width -= aStyleSpacing->mBorderPadding.left + - aStyleSpacing->mBorderPadding.right; - } - leftInset = aStyleSpacing->mBorderPadding.left; - - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - availSize.height = aMaxSize.height; - if (!unconstrainedHeight) { - availSize.height -= aStyleSpacing->mBorderPadding.top + - aStyleSpacing->mBorderPadding.bottom; - } - topInset = aStyleSpacing->mBorderPadding.top; - - firstRowGroup = PR_TRUE; - footerHeight = 0; - footerList = nsnull; - } - - ~InnerTableReflowState() { - if (nsnull!=footerList) - delete footerList; - } -}; - - - -/* ----------- SpanInfo ---------- */ - -struct SpanInfo -{ - PRInt32 span; - PRInt32 cellMinWidth; - PRInt32 cellDesiredWidth; - - SpanInfo(PRInt32 aSpan, PRInt32 aMinWidth, PRInt32 aDesiredWidth) - { - span = aSpan; - cellMinWidth = aMinWidth; - cellDesiredWidth = aDesiredWidth; - }; - - ~SpanInfo() {}; -}; - - - -/* ----------- nsTableFrame ---------- */ - - -nsTableFrame::nsTableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mColumnLayoutData(nsnull), - mColumnWidths(nsnull), - mFirstPassValid(PR_FALSE), - mPass(kPASS_UNDEFINED), - mIsInvariantWidth(PR_FALSE) -{ -} - -/** - * Method to delete all owned objects assoicated - * with the ColumnLayoutObject instance variable - */ -void nsTableFrame::DeleteColumnLayoutData() -{ - if (nsnull!=mColumnLayoutData) - { - PRInt32 numCols = mColumnLayoutData->Count(); - for (PRInt32 i = 0; iElementAt(i)); - delete colData; - } - delete mColumnLayoutData; - mColumnLayoutData = nsnull; - } -} - -nsTableFrame::~nsTableFrame() -{ - DeleteColumnLayoutData(); - if (nsnull!=mColumnWidths) - delete [] mColumnWidths; -} - - - -/** -* Lists the column layout data which turns -* around and lists the cell layout data. -* This is for debugging purposes only. -*/ -void nsTableFrame::ListColumnLayoutData(FILE* out, PRInt32 aIndent) const -{ - // if this is a continuing frame, there will be no output - if (nsnull!=mColumnLayoutData) - { - fprintf(out,"Column Layout Data \n"); - - PRInt32 numCols = mColumnLayoutData->Count(); - for (PRInt32 i = 0; iElementAt(i)); - - for (PRInt32 indent = aIndent; --indent >= 0; ) fputs(" ", out); - fprintf(out,"Column Data [%d] \n",i); - colData->List(out,aIndent+2); - } - } -} - - -/** - * Find the CellLayoutData assocated with the TableCell -**/ -nsCellLayoutData* nsTableFrame::FindCellLayoutData(nsTableCell* aCell) -{ - if (aCell != nsnull) - { - if (nsnull!=mColumnLayoutData) - { - PRInt32 numCols = mColumnLayoutData->Count(); - for (PRInt32 i = 0; iElementAt(i)); - PRInt32 index = colLayoutData->IndexOf(aCell); - if (index != -1) - return colLayoutData->ElementAt(index); - } - } - } - return nsnull; -} - - -/** - * For the TableCell in CellData, find the CellLayoutData assocated - * and add it to the list -**/ -void nsTableFrame::AppendLayoutData(nsVoidArray* aList, nsTableCell* aTableCell) -{ - - if (aTableCell != nsnull) - { - nsCellLayoutData* layoutData = FindCellLayoutData(aTableCell); - if (layoutData != nsnull) - aList->AppendElement((void*)layoutData); - } -} - -void nsTableFrame::RecalcLayoutData() -{ - - nsTablePart* table = (nsTablePart*)mContent; - nsCellMap* cellMap = table->GetCellMap(); - PRInt32 colCount = cellMap->GetColCount(); - PRInt32 rowCount = cellMap->GetRowCount(); - PRInt32 row = 0; - PRInt32 col = 0; - - nsTableCell* above = nsnull; - nsTableCell* below = nsnull; - nsTableCell* left = nsnull; - nsTableCell* right = nsnull; - - - PRInt32 edge = 0; - nsVoidArray* boundaryCells[4]; - - for (edge = 0; edge < 4; edge++) - boundaryCells[edge] = new nsVoidArray(); - - - if (colCount != 0 && rowCount != 0) - { - for (row = 0; row < rowCount; row++) - { - for (col = 0; col < colCount; col++) - { - CellData* cellData = cellMap->GetCellAt(row,col); - nsTableCell* cell = cellData->mCell; - - if (!cell) - continue; - - PRInt32 colSpan = cell->GetColSpan(); - PRInt32 rowSpan = cell->GetRowSpan(); - - // clear the cells for all for edges - for (edge = 0; edge < 4; edge++) - boundaryCells[edge]->Clear(); - - - // Check to see if the cell data represents the top,left - // corner of a a table cell - - // Check to see if cell the represents a left edge cell - if (row == 0) - above = nsnull; - else - { - cellData = cellMap->GetCellAt(row-1,col); - if (cellData != nsnull) - above = cellData->mCell; - - // Does the cell data point to the same cell? - // If it is, then continue - if (above != nsnull && above == cell) - continue; - } - - // Check to see if cell the represents a top edge cell - if (col == 0) - left = nsnull; - else - { - cellData = cellMap->GetCellAt(row,col-1); - if (cellData != nsnull) - left = cellData->mCell; - - if (left != nsnull && left == cell) - continue; - } - - // If this is the top,left edged cell - // Then add the cells on the for edges to the array - - // Do the top and bottom edge - PRInt32 r,c; - PRInt32 r1,r2; - PRInt32 c1,c2; - PRInt32 last; - - - r1 = row - 1; - r2 = row + rowSpan; - c = col; - last = col + colSpan -1; - - while (c <= last) - { - if (r1 != -1) - { - // Add top edge cells - if (c != col) - { - cellData = cellMap->GetCellAt(r1,c); - if (cellData->mCell != above) - { - above = cellData->mCell; - if (above != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_TOP],above); - } - } - else if (above != nsnull) - { - AppendLayoutData(boundaryCells[NS_SIDE_TOP],above); - } - } - - if (r2 < rowCount) - { - // Add bottom edge cells - cellData = cellMap->GetCellAt(r2,c); - if (cellData->mCell != below) - { - below = cellData->mCell; - if (below != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_BOTTOM],below); - } - } - c++; - } - - // Do the left and right edge - c1 = col - 1; - c2 = col + colSpan; - r = row ; - last = row + rowSpan-1; - - while (r <= last) - { - // Add left edge cells - if (c1 != -1) - { - if (r != row) - { - cellData = cellMap->GetCellAt(r,c1); - if (cellData->mCell != left) - { - left = cellData->mCell; - if (left != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_LEFT],left); - } - } - else if (left != nsnull) - { - AppendLayoutData(boundaryCells[NS_SIDE_LEFT],left); - } - } - - if (c2 < colCount) - { - // Add right edge cells - cellData = cellMap->GetCellAt(r,c2); - if (cellData->mCell != right) - { - right = cellData->mCell; - if (right != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_RIGHT],right); - } - } - r++; - } - - nsCellLayoutData* cellLayoutData = FindCellLayoutData(cell); - cellLayoutData->RecalcLayoutData(this,boundaryCells); - } - } - } - for (edge = 0; edge < 4; edge++) - delete boundaryCells[edge]; - -} - - - - -/* SEC: TODO: adjust the rect for captions */ -NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // table paint code is concerned primarily with borders and bg color - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - NS_ASSERTION(nsnull != myColor, "null style color"); - NS_ASSERTION(nsnull != myBorder, "null style border"); - if (nsnull!=myBorder) - { - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - } - - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(0,128,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -PRBool nsTableFrame::NeedsReflow(const nsSize& aMaxSize) -{ - PRBool result = PR_TRUE; - if (PR_TRUE==mIsInvariantWidth) - result = PR_FALSE; - // TODO: other cases... - return result; -} - -// SEC: TODO need to worry about continuing frames prev/next in flow for splitting across pages. -// SEC: TODO need to keep "first pass done" state, update it when ContentChanged notifications come in - -/* overview: - if mFirstPassValid is false, this is our first time through since content was last changed - set pass to 1 - do pass 1 - get min/max info for all cells in an infinite space - do column balancing - set mFirstPassValid to true - do pass 2 - if pass is 1, - set pass to 2 - use column widths to ResizeReflow cells - shrinkWrap Cells in each row to tallest, realigning contents within the cell -*/ - -/** Layout the entire inner table. - */ -NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_PRECONDITION(nsnull != aPresContext, "null arg"); - if (gsDebug==PR_TRUE) - { - printf("-----------------------------------------------------------------\n"); - printf("nsTableFrame::ResizeReflow: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - } - -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - aStatus = frComplete; - - PRIntervalTime startTime; - if (gsTiming) { - startTime = PR_IntervalNow(); - } - - if (PR_TRUE==gsDebug) - printf ("*** tableframe reflow\t\t%p\n", this); - - if (PR_TRUE==NeedsReflow(aMaxSize)) - { - if (PR_FALSE==IsFirstPassValid()) - { // we treat the table as if we've never seen the layout data before - mPass = kPASS_FIRST; - aStatus = ResizeReflowPass1(aPresContext, aDesiredSize, - aMaxSize, aMaxElementSize); - // check result - } - mPass = kPASS_SECOND; - - // assign column widths, and assign aMaxElementSize->width - BalanceColumnWidths(aPresContext, aMaxSize, aMaxElementSize); - - // assign table width - SetTableWidth(aPresContext); - - aStatus = ResizeReflowPass2(aPresContext, aDesiredSize, aMaxSize, - aMaxElementSize, 0, 0); - - if (gsTiming) { - PRIntervalTime endTime = PR_IntervalNow(); - printf("Table reflow took %ld ticks for frame %d\n", - endTime-startTime, this);/* XXX need to use LL_* macros! */ - } - - mPass = kPASS_UNDEFINED; - } - else - { - // set aDesiredSize and aMaxElementSize - } - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - - return NS_OK; -} - -/** the first of 2 reflow passes - * lay out the captions and row groups in an infinite space (NS_UNCONSTRAINEDSIZE) - * cache the results for each caption and cell. - * if successful, set mFirstPassValid=PR_TRUE, so we know we can skip this step - * next time. mFirstPassValid is set to PR_FALSE when content is changed. - * NOTE: should never get called on a continuing frame! All cached pass1 state - * is stored in the inner table first-in-flow. - */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad pres context param"); - NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame."); - - if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this); - ReflowStatus result = frComplete; - - mChildCount = 0; - mFirstContentOffset = mLastContentOffset = 0; - - nsIContent* c = mContent; - NS_ASSERTION(nsnull != c, "null content"); - ((nsTablePart *)c)->GetMaxColumns(); // as a side effect, does important initialization - - nsSize availSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); // availSize is the space available at any given time in the process - nsSize maxSize(0, 0); // maxSize is the size of the largest child so far in the process - nsSize kidMaxSize(0,0); - nsSize* pKidMaxSize = (nsnull != aMaxElementSize) ? &kidMaxSize : nsnull; - nsReflowMetrics kidSize; - nscoord y = 0; - nscoord maxAscent = 0; - nscoord maxDescent = 0; - PRInt32 kidIndex = 0; - PRInt32 lastIndex = c->ChildCount(); - PRInt32 contentOffset=0; - nsIFrame* prevKidFrame = nsnull;/* XXX incremental reflow! */ - - // Compute the insets (sum of border and padding) - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nscoord topInset = spacing->mBorderPadding.top; - nscoord rightInset = spacing->mBorderPadding.right; - nscoord bottomInset =spacing->mBorderPadding.bottom; - nscoord leftInset = spacing->mBorderPadding.left; - - /* assumes that Table's children are in the following order: - * Captions - * ColGroups, in order - * THead, in order - * TFoot, in order - * TBody, in order - */ - for (;;) { - nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ - if (kid.IsNull()) { - result = frComplete; - break; - } - - mLastContentIsComplete = PR_TRUE; - - const PRInt32 contentType = ((nsTableContent *)(nsIContent*)kid)->GetType(); - if (contentType==nsITableContent::kTableRowGroupType) - { - // Resolve style - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - NS_ASSERTION(kidStyleContext.IsNotNull(), "null style context for kid"); - - // SEC: TODO: when content is appended or deleted, be sure to clear out the frame hierarchy!!!! - - // get next frame, creating one if needed - nsIFrame* kidFrame=nsnull; - if (nsnull!=prevKidFrame) - prevKidFrame->GetNextSibling(kidFrame); // no need to check for an error, just see if it returned null... - else - ChildAt(0, kidFrame); - - // if this is the first time, allocate the caption frame - if (nsnull==kidFrame) - { - nsIContentDelegate* kidDel; - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, contentOffset, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidStyleContext); - } - - nsSize maxKidElementSize; - result = ReflowChild(kidFrame, aPresContext, kidSize, availSize, pKidMaxSize); - - // Place the child since some of it's content fit in us. - if (gsDebug) { - if (nsnull != pKidMaxSize) { - printf ("reflow of row group returned desired=%d,%d, max-element=%d,%d\n", - kidSize.width, kidSize.height, pKidMaxSize->width, pKidMaxSize->height); - } else { - printf ("reflow of row group returned desired=%d,%d\n", kidSize.width, kidSize.height); - } - } - PRInt32 yCoord = y; - if (NS_UNCONSTRAINEDSIZE!=yCoord) - yCoord+= topInset; - kidFrame->SetRect(nsRect(leftInset, yCoord, - kidSize.width, kidSize.height)); - if (NS_UNCONSTRAINEDSIZE==kidSize.height) - y = NS_UNCONSTRAINEDSIZE; - else - y += kidSize.height; - if (nsnull != pKidMaxSize) { - if (pKidMaxSize->width > maxSize.width) { - maxSize.width = pKidMaxSize->width; - } - if (pKidMaxSize->height > maxSize.height) { - maxSize.height = pKidMaxSize->height; - } - } - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - // Our first child (**blush**) - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - if (gsDebug) printf("INNER: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - } - prevKidFrame = kidFrame; - mChildCount++; - - if (frNotComplete == result) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - break; - } - } - contentOffset++; - kidIndex++; - if (frNotComplete == result) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - break; - } - } - - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "unexpected last child"); - // can't use SetLastContentOffset here - mLastContentOffset = contentOffset-1; // takes into account colGroup frame we're not using - if (gsDebug) printf("INNER: set last content offset to %d\n", GetLastContentOffset()); //@@@ - } - - mFirstPassValid = PR_TRUE; - - return result; -} - -/** the second of 2 reflow passes - */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth) -{ - if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this); - if (gsDebug==PR_TRUE) - printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - - ReflowStatus result = frComplete; - - // now that we've computed the column width information, reflow all children - nsIContent* c = mContent; - NS_ASSERTION(nsnull != c, "null kid"); - nsSize kidMaxSize(0,0); - - PRInt32 kidIndex = 0; - PRInt32 lastIndex = c->ChildCount(); - nsIFrame* prevKidFrame = nsnull;/* XXX incremental reflow! */ - -#ifdef NS_DEBUG - //PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - PRBool reflowMappedOK = PR_TRUE; - ReflowStatus status = frComplete; - - // Check for an overflow list - MoveOverflowToChildList(); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - InnerTableReflowState state(aPresContext, aMaxSize, mySpacing); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - status = frNotComplete; - } - } - - // Did we successfully reflow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - status = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - status = ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - status = frNotComplete; - } - } - } - - // Return our size and our status - - if (frComplete == status) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - //NS_ASSERTION(0width, aMaxElementSize->height); - else - printf("Reflow complete, returning aDesiredSize = %d,%d and NSNULL aMaxElementSize\n", - aDesiredSize.width, aDesiredSize.height); - } - - // SEC: assign our real width and height based on this reflow step and return - - mPass = kPASS_UNDEFINED; // we're no longer in-process - -#ifdef NS_DEBUG - //PostReflowCheck(status); -#endif - - return status; - -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableFrame::GetTopMarginFor(nsIPresContext* aCX, - InnerTableReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableFrame::PlaceChild(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug) - printf ("table: placing row group at %d, %d, %d, %d\n", - aKidRect.x, aKidRect.y, aKidRect.width, aKidRect.height); - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - // If this is a footer row group, add it to the list of footer row groups - nsIAtom * tFootTag = NS_NewAtom(nsTablePart::kRowGroupFootTagString); // tFootTag: REFCNT++ - nsIAtom *kidType=nsnull; - ((nsTableRowGroupFrame *)aKidFrame)->GetRowGroupType(kidType); - if (tFootTag==kidType) - { - if (nsnull==aState.footerList) - aState.footerList = new nsVoidArray(); - aState.footerList->AppendElement((void *)aKidFrame); - aState.footerHeight += aKidRect.height; - } - // else if this is a body row group, push down all the footer row groups - else - { - // don't bother unless there are footers to push down - if (nsnull!=aState.footerList && 0!=aState.footerList->Count()) - { - nsPoint origin; - aKidFrame->GetOrigin(origin); - origin.y -= aState.footerHeight; - aKidFrame->MoveTo(origin.x, origin.y); - nsIAtom * tBodyTag = NS_NewAtom(nsTablePart::kRowGroupBodyTagString); // tBodyTag: REFCNT++ - if (tBodyTag==kidType) - { - PRInt32 numFooters = aState.footerList->Count(); - for (PRInt32 footerIndex = 0; footerIndex < numFooters; footerIndex++) - { - nsTableRowGroupFrame * footer = (nsTableRowGroupFrame *)(aState.footerList->ElementAt(footerIndex)); - NS_ASSERTION(nsnull!=footer, "bad footer list in table inner frame."); - if (nsnull!=footer) - { - footer->GetOrigin(origin); - origin.y += aKidRect.height; - footer->MoveTo(origin.x, origin.y); - } - } - } - NS_RELEASE(tBodyTag); - } - } - NS_RELEASE(tFootTag); - - // Update the maximum element size - if (PR_TRUE==aState.firstRowGroup) - { - aState.firstRowGroup = PR_FALSE; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aKidMaxElementSize.width; - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableFrame* flow = (nsTableFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool originalLastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - if (((nsTableContent *)(nsIContent*)kid)->GetType() == nsITableContent::kTableRowGroupType) - { // skip children that are not row groups - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width -= kidSpacing->mMargin.left + - kidSpacing->mMargin.right; - } - - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidFrame != mFirstChild) && (desiredSize.height > kidAvailSize.height)) - { - // The child is too wide to fit in the available space, and it's - // not our first child - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - nsRect kidRect (0, 0, desiredSize.width, desiredSize.height); - kidRect.x += aState.leftInset + kidSpacing->mMargin.left; - kidRect.y += aState.topInset + aState.y ; - PlaceChild(aPresContext, aState, kidFrame, kidRect, - aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - // Special handling for incomplete children - if (frNotComplete == status) { - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count - mChildCount = childCount; -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); -#endif - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableFrame* flow = (nsTableFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableFrame* flow = (nsTableFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableFrame* nextInFlow = (nsTableFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - if ((kidFrameSize.height > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Advance y by the topMargin between children. Zero out the - // topMargin in case this frame is continued because - // continuations do not have a top margin. Update the prev - // bottom margin state in the body reflow state so that we can - // apply the bottom margin when we hit the next child (or - // finish). - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - //kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* contentParent; - - kidFrame->GetContentParent(contentParent); - if (nextInFlow == contentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsTableFrame* prev = (nsTableFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - break; - } - - // Resolve style for the child - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - - // Figure out how we should treat the child - nsIFrame* kidFrame; - - // Create a child frame - if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel = nsnull; - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - // Advance y by the topMargin between children. Zero out the - // topMargin in case this frame is continued because - // continuations do not have a top margin. Update the prev - // bottom margin state in the body reflow state so that we can - // apply the bottom margin when we hit the next child (or - // finish). - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - } - - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - - -/** - Now I've got all the cells laid out in an infinite space. - For each column, use the min size for each cell in that column - along with the attributes of the table, column group, and column - to assign widths to each column. - */ -// use the cell map to determine which cell is in which column. -void nsTableFrame::BalanceColumnWidths(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - if (gsDebug) - printf ("BalanceColumnWidths...\n"); - - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - if (nsnull==mColumnWidths) - { - mColumnWidths = new PRInt32[numCols]; - // SEC should be a memset - for (PRInt32 i = 0; iGetData(kStyleSpacingSID); - - // need to figure out the overall table width constraint - // default case, get 100% of available space - PRInt32 maxWidth; - nsStylePosition* position = - (nsStylePosition*)mStyleContext->GetData(kStylePositionSID); - switch (position->mWidthFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - maxWidth = position->mWidth; - break; - case NS_STYLE_POSITION_VALUE_PERCENT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - // XXX for now these fall through - - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - maxWidth = aMaxSize.width; - break; - } - - // now, if maxWidth is not NS_UNCONSTRAINED, subtract out my border - // and padding - if (NS_UNCONSTRAINEDSIZE!=maxWidth) - { - maxWidth -= spacing->mBorderPadding.left + spacing->mBorderPadding.right; - if (0>maxWidth) // nonsense style specification - maxWidth = 0; - } - - if (gsDebug) printf (" maxWidth=%d from aMaxSize=%d,%d\n", maxWidth, aMaxSize.width, aMaxSize.height); - - // Step 1 - assign the width of all fixed-width columns - AssignFixedColumnWidths(aPresContext, maxWidth, numCols, - totalFixedWidth, minTableWidth, maxTableWidth); - - if (nsnull!=aMaxElementSize) - { - aMaxElementSize->width = minTableWidth; - if (gsDebug) printf(" setting aMaxElementSize->width = %d\n", aMaxElementSize->width); - } - else - { - if (gsDebug) printf(" nsnull aMaxElementSize\n"); - } - - // Step 2 - assign the width of all proportional-width columns in the remaining space - PRInt32 availWidth=maxWidth - totalFixedWidth; - if (gsDebug==PR_TRUE) printf ("Step 2...\n availWidth = %d\n", availWidth); - if (TableIsAutoWidth()) - { - if (gsDebug==PR_TRUE) printf (" calling BalanceProportionalColumnsForAutoWidthTable\n"); - BalanceProportionalColumnsForAutoWidthTable(aPresContext, - availWidth, maxWidth, - minTableWidth, maxTableWidth); - } - else - { - if (gsDebug==PR_TRUE) printf (" calling BalanceProportionalColumnsForSpecifiedWidthTable\n"); - BalanceProportionalColumnsForSpecifiedWidthTable(aPresContext, - availWidth, maxWidth, - minTableWidth, maxTableWidth); - } - -/* -STEP 1 -for every col - if the col has a fixed width - set the width to max(fixed width, maxElementSize) - if the cell spans columns, divide the cell width between the columns - else skip it for now - -take borders and padding into account - -STEP 2 -determine the min and max size for the table width -if col is proportionately specified - if (col width specified to 0) - col width = minColWidth - else if (minTableWidth >= aMaxSize.width) - set col widths to min, install a hor. scroll bar - else if (maxTableWidth <= aMaxSize.width) - set each col to its max size - else - W = aMaxSize.width - minTableWidth - D = maxTableWidth - minTableWidth - for each col - d = maxColWidth - minColWidth - col width = minColWidth + ((d*W)/D) - -STEP 3 -if there is space left over - for every col - if col is proportionately specified - add space to col width until it is that proportion of the table width - do this non-destructively in case there isn't enough space - if there isn't enough space as determined in the prior step, - add space in proportion to the proportionate width attribute - */ - -} - -// Step 1 - assign the width of all fixed-width columns, -// and calculate min/max table width -PRBool nsTableFrame::AssignFixedColumnWidths(nsIPresContext* aPresContext, - PRInt32 maxWidth, - PRInt32 aNumCols, - PRInt32 &aTotalFixedWidth, - PRInt32 &aMinTableWidth, - PRInt32 &aMaxTableWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - if (gsDebug==PR_TRUE) printf (" AssignFixedColumnWidths\n"); - nsVoidArray *spanList=nsnull; - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - NS_ASSERTION(nsnull != colData, "bad column data"); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - NS_ASSERTION(col.IsNotNull(), "bad col"); - - // need to track min/max column width for setting min/max table widths - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - nsVoidArray *cells = colData->GetCells(); - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for column %d numCells = %d\n", colIndex, numCells); - -#if XXX_need_access_to_column_frame_help - // Get the columns's style - nsIStyleContextPtr colSC; - colFrame->GetStyleContext(aPresContext, colSC.AssignRef()); - nsStylePosition* colPosition = (nsStylePosition*) - colSC->GetData(kStylePositionSID); - - // Get column width if it has one - PRBool haveColWidth = PR_FALSE; - nscoord colWidth; - switch (colPosition->mWidthFlags) { - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - break; - - case NS_STYLE_POSITION_VALUE_LENGTH: - haveColWidth = PR_TRUE; - colWidth = colPosition->mWidth; - break; - - case NS_STYLE_POSITION_VALUE_PCT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - //XXX haveColWidth = PR_TRUE; - //XXX colWidth = colPosition->mWidthPCT * something; - break; - } -#endif - - /* Scan the column, simulatneously assigning fixed column widths - * and computing the min/max column widths - */ - // first, deal with any cells that span into this column from a pervious column - if (nsnull!=spanList) - { - PRInt32 spanCount = spanList->Count(); - // go through the list backwards so we can delete easily - for (PRInt32 spanIndex=spanCount-1; 0<=spanIndex; spanIndex--) - { - SpanInfo *spanInfo = (SpanInfo *)(spanList->ElementAt(spanIndex)); - if (minColWidth < spanInfo->cellMinWidth) - minColWidth = spanInfo->cellMinWidth; - if (maxColWidth < spanInfo->cellDesiredWidth) - maxColWidth = spanInfo->cellDesiredWidth; - spanInfo->span--; - if (gsDebug==PR_TRUE) - printf (" for spanning cell %d with remaining span=%d, min = %d and des = %d\n", - spanIndex, spanInfo->span, spanInfo->cellMinWidth, spanInfo->cellDesiredWidth); - if (0==spanInfo->span) - { - spanList->RemoveElementAt(spanIndex); - delete spanInfo; - } - } - } - - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - nsSize * cellMinSize = data->GetMaxElementSize(); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - PRInt32 colSpan = data->GetCellFrame()->GetColSpan(); - if (gsDebug==PR_TRUE) - printf (" for cell %d with colspan=%d, min = %d,%d and des = %d,%d\n", - cellIndex, colSpan, cellMinSize->width, cellMinSize->height, - cellDesiredSize->width, cellDesiredSize->height); - - PRBool haveCellWidth = PR_FALSE; - nscoord cellWidth; - - /* - * The first cell in a column (in row 0) has special standing. - * if the first cell has a width specification, it overrides the - * COL width - */ - if (0==cellIndex) - { - nsCellLayoutData * data = (nsCellLayoutData *)(cells->ElementAt(0)); - nsTableCellFrame *cellFrame = data->GetCellFrame(); - nsTableCellPtr cell; - cellFrame->GetContent((nsIContent*&)(cell.AssignRef())); // cell: REFCNT++ - - // Get the cell's style - nsIStyleContextPtr cellSC; - cellFrame->GetStyleContext(aPresContext, cellSC.AssignRef()); - nsStylePosition* cellPosition = (nsStylePosition*) - cellSC->GetData(kStylePositionSID); - switch (cellPosition->mWidthFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - haveCellWidth = PR_TRUE; - cellWidth = cellPosition->mWidth; - break; - - case NS_STYLE_POSITION_VALUE_PERCENT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - // XXX write me when pct/proportional are supported - // XXX haveCellWidth = PR_TRUE; - // XXX cellWidth = cellPosition->mWidth; - break; - - default: - case NS_STYLE_POSITION_VALUE_INHERIT: - case NS_STYLE_POSITION_VALUE_AUTO: - break; - } - } - -#if XXX_need_access_to_column_frame_help - switch (colPosition->mWidthFlags) { - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - break; - - case NS_STYLE_POSITION_VALUE_LENGTH: - { - // This col has a fixed width, so set the cell's width to the - // larger of (specified width, largest max_element_size of the - // cells in the column) - PRInt32 widthForThisCell = max(cellMinSize->width, colPosition->mWidth); - if (mColumnWidths[colIndex] < widthForThisCell) - { - if (gsDebug) printf (" setting fixed width to %d\n",widthForThisCell); - mColumnWidths[colIndex] = widthForThisCell; - maxColWidth = widthForThisCell; - } - } - break; - - case NS_STYLE_POSITION_VALUE_PCT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - // XXX write me when pct/proportional are supported - break; - } -#endif - - // regardless of the width specification, keep track of the - // min/max column widths - PRInt32 cellMinWidth = cellMinSize->width/colSpan; - PRInt32 cellDesiredWidth = cellDesiredSize->width/colSpan; - if (minColWidth < cellMinWidth) - minColWidth = cellMinWidth; - if (maxColWidth < cellDesiredWidth) - maxColWidth = cellDesiredWidth; - if (1AppendElement(spanInfo); - } - if (gsDebug) { - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - } - } - -#if 0 - // if the col is fixed-width, expand the col to the specified - // fixed width if necessary - if (colStyle->fixedWidth > mColumnWidths[colIndex]) - mColumnWidths[colIndex] = colStyle->fixedWidth; - - // keep a running total of the amount of space taken up by all - // fixed-width columns - aTotalFixedWidth += mColumnWidths[colIndex]; - if (gsDebug) { - printf (" after col %d, aTotalFixedWidth = %d\n", - colIndex, aTotalFixedWidth); - } -#endif - - // add col[i] metrics to the running totals for the table min/max width - if (NS_UNCONSTRAINEDSIZE!=aMinTableWidth) - aMinTableWidth += minColWidth; // SEC: insets! - if (aMinTableWidth<=0) - aMinTableWidth = NS_UNCONSTRAINEDSIZE; // handle overflow - if (NS_UNCONSTRAINEDSIZE!=aMaxTableWidth) - aMaxTableWidth += maxColWidth; // SEC: insets! - if (aMaxTableWidth<=0) - aMaxTableWidth = NS_UNCONSTRAINEDSIZE; // handle overflow - if (gsDebug==PR_TRUE) - printf (" after this col, minTableWidth = %d and maxTableWidth = %d\n", aMinTableWidth, aMaxTableWidth); - - } // end Step 1 for fixed-width columns - if (nsnull!=spanList) - delete spanList; - return PR_TRUE; -} - -PRBool nsTableFrame::BalanceProportionalColumnsForSpecifiedWidthTable(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - PRBool result = PR_TRUE; - - if (NS_UNCONSTRAINEDSIZE==aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table laying out in NS_UNCONSTRAINEDSIZE, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else if (aMinTableWidth > aMaxWidth) - { // the table doesn't fit in the available space - if (gsDebug) printf (" * min table does not fit, calling SetColumnsToMinWidth\n"); - result = SetColumnsToMinWidth(aPresContext); - } - else if (aMaxTableWidth <= aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table desired size fits, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else - { // the table fits somewhere between its min and desired size - if (gsDebug) printf (" * table desired size does not fit, calling BalanceColumnsHTML4Constrained\n"); - result = BalanceColumnsHTML4Constrained(aPresContext, aAvailWidth, - aMaxWidth, aMinTableWidth, aMaxTableWidth); - } - return result; -} - -PRBool nsTableFrame::BalanceProportionalColumnsForAutoWidthTable( nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth) -{ - PRBool result = PR_TRUE; - - if (NS_UNCONSTRAINEDSIZE==aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table laying out in NS_UNCONSTRAINEDSIZE, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else if (aMinTableWidth > aMaxWidth) - { // the table doesn't fit in the available space - if (gsDebug) printf (" * min table does not fit, calling SetColumnsToMinWidth\n"); - result = SetColumnsToMinWidth(aPresContext); - } - else if (aMaxTableWidth <= aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table desired size fits, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else - { // the table fits somewhere between its min and desired size - if (gsDebug) printf (" * table desired size does not fit, calling BalanceColumnsHTML4Constrained\n"); - result = BalanceColumnsHTML4Constrained(aPresContext, aAvailWidth, - aMaxWidth, aMinTableWidth, aMaxTableWidth); - } - return result; -} - -PRBool nsTableFrame::SetColumnsToMinWidth(nsIPresContext* aPresContext) -{ - PRBool result = PR_TRUE; - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - nsVoidArray *cells = colData->GetCells(); - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for col %d\n", colIndex); - - // XXX need column frame to ask this question - nsStylePosition* colPosition = nsnull; - - if (PR_TRUE==IsProportionalWidth(colPosition)) - { - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - nsSize * cellMinSize = data->GetMaxElementSize(); - NS_ASSERTION(nsnull != cellMinSize, "bad cellMinSize"); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - if (minColWidth < cellMinSize->width) - minColWidth = cellMinSize->width; - if (maxColWidth < cellDesiredSize->width) - maxColWidth = cellDesiredSize->width; - /* - if (gsDebug==PR_TRUE) - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - */ - } - - if (gsDebug==PR_TRUE) - { - printf (" for determining width of col %d %s:\n",colIndex, IsProportionalWidth(colPosition)? "(P)":"(A)"); - printf (" minColWidth = %d and maxColWidth = %d\n", minColWidth, maxColWidth); - } - - // XXX BUG: why are we asking this again? this if is already in a - // IsProportionalWidth == PR_TRUE case! - if (PR_TRUE==IsProportionalWidth(colPosition)) - { // this col has proportional width, so set its width based on the table width - mColumnWidths[colIndex] = minColWidth; - if (gsDebug==PR_TRUE) - printf (" 2: col %d, set to width = %d\n", colIndex, mColumnWidths[colIndex]); - } - } - } - return result; -} - -PRBool nsTableFrame::BalanceColumnsTableFits(nsIPresContext* aPresContext, - PRInt32 aAvailWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - PRBool result = PR_TRUE; - nsVoidArray *spanList=nsnull; - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - nsVoidArray *cells = colData->GetCells(); - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for col %d\n", colIndex); - - // XXX Need columnFrame to ask the style question - nsStylePosition* colPosition = nsnull; - - if (PR_TRUE==IsProportionalWidth(colPosition)) - { - // first, deal with any cells that span into this column from a pervious column - if (nsnull!=spanList) - { - PRInt32 spanCount = spanList->Count(); - // go through the list backwards so we can delete easily - for (PRInt32 spanIndex=spanCount-1; 0<=spanIndex; spanIndex--) - { - SpanInfo *spanInfo = (SpanInfo *)(spanList->ElementAt(spanIndex)); - if (minColWidth < spanInfo->cellMinWidth) - minColWidth = spanInfo->cellMinWidth; - if (maxColWidth < spanInfo->cellDesiredWidth) - maxColWidth = spanInfo->cellDesiredWidth; - spanInfo->span--; - if (gsDebug==PR_TRUE) - printf (" for spanning cell %d with remaining span=%d, min = %d and des = %d\n", - spanIndex, spanInfo->span, spanInfo->cellMinWidth, spanInfo->cellDesiredWidth); - if (0==spanInfo->span) - { - spanList->RemoveElementAt(spanIndex); - delete spanInfo; - } - } - } - - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - - PRInt32 colSpan = data->GetCellFrame()->GetColSpan(); - // distribute a portion of the spanning cell's min and max width to this column - nsSize * cellMinSize = data->GetMaxElementSize(); - NS_ASSERTION(nsnull != cellMinSize, "bad cellMinSize"); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - PRInt32 cellMinWidth = cellMinSize->width/colSpan; - PRInt32 cellDesiredWidth = cellDesiredSize->width/colSpan; - if (PR_TRUE==gsDebug) - printf("factoring in cell %d with colSpan=%d\n factoring in min=%d and desired=%d\n", - cellIndex, colSpan, cellMinWidth, cellDesiredWidth); - if (minColWidth < cellMinWidth) - minColWidth = cellMinWidth; - if (maxColWidth < cellDesiredWidth) - maxColWidth = cellDesiredWidth; - if (gsDebug==PR_TRUE) - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - if (1AppendElement(spanInfo); - } - } - - if (gsDebug==PR_TRUE) - { - printf (" for determining width of col %d %s:\n",colIndex, IsProportionalWidth(colPosition)? "(P)":"(A)"); - printf (" minColWidth = %d and maxColWidth = %d\n", minColWidth, maxColWidth); - printf (" aAvailWidth = %d\n", aAvailWidth); - } - - // XXX BUG: why are we asking this again? this if is already in a - // IsProportionalWidth == PR_TRUE case! - if (PR_TRUE==IsProportionalWidth(colPosition)) - { // this col has proportional width, so set its width based on the table width -#if XXX_bug_kipp_about_this - if (0==colStyle->proportionalWidth) - { // col width is specified to be the minimum - mColumnWidths[colIndex] = minColWidth; - if (gsDebug==PR_TRUE) - printf (" 3 (0): col %d set to min width = %d because style set proportionalWidth=0\n", - colIndex, mColumnWidths[colIndex]); - } - else // BUG? else? other code below has the else -#endif - if (PR_TRUE==AutoColumnWidths()) - { // give each remaining column it's desired width - // if there is width left over, we'll factor that in after this loop is complete - mColumnWidths[colIndex] = maxColWidth; - if (gsDebug==PR_TRUE) - printf (" 3a: col %d with availWidth %d, set to width = %d\n", - colIndex, aAvailWidth, mColumnWidths[colIndex]); - } - else - { // give each remaining column an equal percentage of the remaining space - PRInt32 percentage = -1; - if (NS_UNCONSTRAINEDSIZE==aAvailWidth) - { - mColumnWidths[colIndex] = maxColWidth; - } - else - { -#if XXX_bug_kipp_about_this - percentage = colStyle->proportionalWidth; - if (-1==percentage) -#endif - percentage = 100/numCols; - mColumnWidths[colIndex] = (percentage*aAvailWidth)/100; - // if the column was computed to be too small, enlarge the column - if (mColumnWidths[colIndex] <= minColWidth) - mColumnWidths[colIndex] = minColWidth; - } - if (gsDebug==PR_TRUE) - printf (" 3b: col %d given %d percent of availWidth %d, set to width = %d\n", - colIndex, percentage, aAvailWidth, mColumnWidths[colIndex]); - } - } - } - } - if (nsnull!=spanList) - delete spanList; - return result; -} - -PRBool nsTableFrame::BalanceColumnsHTML4Constrained(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - PRBool result = PR_TRUE; - PRInt32 maxOfAllMinColWidths = 0; - nsVoidArray *spanList=nsnull; - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - -#if XXX_bug_kipp_about_this - // XXX BUG: mStyleContext is for the table frame not for the column. - nsStyleMolecule* colStyle = - (nsStyleMolecule*)mStyleContext->GetData(kStyleMoleculeSID); -#else - nsStylePosition* colPosition = nsnull; -#endif - - nsVoidArray *cells = colData->GetCells(); - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for col %d\n", colIndex); - - if (PR_TRUE==IsProportionalWidth(colPosition)) - { - // first, deal with any cells that span into this column from a pervious column - if (nsnull!=spanList) - { - PRInt32 spanCount = spanList->Count(); - // go through the list backwards so we can delete easily - for (PRInt32 spanIndex=spanCount-1; 0<=spanIndex; spanIndex--) - { - SpanInfo *spanInfo = (SpanInfo *)(spanList->ElementAt(spanIndex)); - if (minColWidth < spanInfo->cellMinWidth) - minColWidth = spanInfo->cellMinWidth; - if (maxColWidth < spanInfo->cellDesiredWidth) - maxColWidth = spanInfo->cellDesiredWidth; - spanInfo->span--; - if (gsDebug==PR_TRUE) - printf (" for spanning cell %d with remaining span=%d, min = %d and des = %d\n", - spanIndex, spanInfo->span, spanInfo->cellMinWidth, spanInfo->cellDesiredWidth); - if (0==spanInfo->span) - { - spanList->RemoveElementAt(spanIndex); - delete spanInfo; - } - } - } - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - PRInt32 colSpan = data->GetCellFrame()->GetColSpan(); - nsSize * cellMinSize = data->GetMaxElementSize(); - NS_ASSERTION(nsnull != cellMinSize, "bad cellMinSize"); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - PRInt32 cellMinWidth = cellMinSize->width/colSpan; - PRInt32 cellDesiredWidth = cellDesiredSize->width/colSpan; - if (minColWidth < cellMinWidth) - minColWidth = cellMinWidth; - if (maxColWidth < cellDesiredWidth) - maxColWidth = cellDesiredWidth; - if (1AppendElement(spanInfo); - } - if (gsDebug==PR_TRUE) - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - } - - if (gsDebug==PR_TRUE) - { - printf (" for determining width of col %d %s:\n",colIndex, IsProportionalWidth(colPosition)? "(P)":"(A)"); - printf (" minTableWidth = %d and maxTableWidth = %d\n", aMinTableWidth, aMaxTableWidth); - printf (" minColWidth = %d and maxColWidth = %d\n", minColWidth, maxColWidth); - printf (" aAvailWidth = %d\n", aAvailWidth); - } - - // XXX BUG: why are we asking this again? this if is already in a - // IsProportionalWidth == PR_TRUE case! - if (PR_TRUE==IsProportionalWidth(colPosition)) - { // this col has proportional width, so set its width based on the table width - // the table fits in the space somewhere between its min and max size - // so dole out the available space appropriately -#if XXX_bug_kipp_about_this - if (0==colStyle->proportionalWidth) - { // col width is specified to be the minimum - mColumnWidths[colIndex] = minColWidth; - if (gsDebug==PR_TRUE) - printf (" 4 (0): col %d set to min width = %d because style set proportionalWidth=0\n", - colIndex, mColumnWidths[colIndex]); - } - else -#endif - if (AutoColumnWidths()) - { - PRInt32 W = aMaxWidth - aMinTableWidth; - PRInt32 D = aMaxTableWidth - aMinTableWidth; - PRInt32 d = maxColWidth - minColWidth; - mColumnWidths[colIndex] = minColWidth + ((d*W)/D); - if (gsDebug==PR_TRUE) - printf (" 4 auto-width: col %d W=%d D=%d d=%d, set to width = %d\n", - colIndex, W, D, d, mColumnWidths[colIndex]); - } - else - { // give each remaining column an equal percentage of the remaining space -#if XXX_bug_kipp_about_this - PRInt32 percentage = colStyle->proportionalWidth; - if (-1==percentage) -#endif - PRInt32 percentage = 100/numCols; - mColumnWidths[colIndex] = (percentage*aAvailWidth)/100; - // if the column was computed to be too small, enlarge the column - if (mColumnWidths[colIndex] <= minColWidth) - { - mColumnWidths[colIndex] = minColWidth; - if (maxOfAllMinColWidths < minColWidth) - maxOfAllMinColWidths = minColWidth; - } - if (gsDebug==PR_TRUE) - { - printf (" 4 equal width: col %d given %d percent of availWidth %d, set to width = %d\n", - colIndex, percentage, aAvailWidth, mColumnWidths[colIndex]); - if (0!=maxOfAllMinColWidths) - printf(" and setting maxOfAllMins to %d\n", maxOfAllMinColWidths); - } - } - } - } - } - - // post-process if necessary - - // if columns have equal width, and some column's content couldn't squeeze into the computed size, - // then expand every column to the min size of the column with the largest min size - if (!AutoColumnWidths() && 0!=maxOfAllMinColWidths) - { - if (gsDebug==PR_TRUE) printf(" EqualColWidths specified, so setting all col widths to %d\n", maxOfAllMinColWidths); - for (PRInt32 colIndex = 0; colIndexCount(); - for (PRInt32 i = 0; iGetData(kStyleSpacingSID); - nscoord rightInset = spacing->mBorderPadding.right; - nscoord leftInset = spacing->mBorderPadding.left; - tableWidth += (leftInset + rightInset); - nsRect tableSize = mRect; - tableSize.width = tableWidth; - if (gsDebug==PR_TRUE) - { - printf ("setting table rect to %d, %d after adding insets %d, %d\n", - tableSize.width, tableSize.height, rightInset, leftInset); - } - SetRect(tableSize); -} - -/** - */ -void nsTableFrame::ShrinkWrapChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - PRBool gsDebugWas = gsDebug; - //gsDebug = PR_TRUE; // turn on debug in this method -#endif - // iterate children, tell all row groups to ShrinkWrap - PRBool atLeastOneRowSpanningCell = PR_FALSE; - - PRInt32 tableHeight = 0; - - nsStyleSpacing* spacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - tableHeight += - spacing->mBorderPadding.top + spacing->mBorderPadding.bottom; - - PRInt32 childCount = mChildCount; - nsIFrame * kidFrame; - for (PRInt32 i = 0; i < childCount; i++) - { - PRInt32 childHeight=0; - // for every child that is a rowFrame, set the row frame height = sum of row heights - - if (0==i) - ChildAt(i, kidFrame); // frames are not ref counted - else - kidFrame->GetNextSibling(kidFrame); - NS_ASSERTION(nsnull != kidFrame, "bad kid frame"); - nsTableContentPtr kid; - - kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++ - NS_ASSERTION(kid.IsNotNull(), "bad kid"); - if (kid->GetType() == nsITableContent::kTableRowGroupType) - { - /* Step 1: set the row height to the height of the tallest cell, - * and resize all cells in that row to that height (except cells with rowspan>1) - */ - PRInt32 rowGroupHeight = 0; - nsTableRowGroupFrame * rowGroupFrame = (nsTableRowGroupFrame *)kidFrame; - PRInt32 numRows; - rowGroupFrame->ChildCount(numRows); - PRInt32 *rowHeights = new PRInt32[numRows]; - if (gsDebug==PR_TRUE) printf("Height Step 1...\n"); - for (PRInt32 rowIndex = 0; rowIndex < numRows; rowIndex++) - { - // get the height of the tallest cell in the row (excluding cells that span rows) - nsTableRowFrame *rowFrame; - - rowGroupFrame->ChildAt(rowIndex, (nsIFrame*&)rowFrame); - NS_ASSERTION(nsnull != rowFrame, "bad row frame"); - rowHeights[rowIndex] = rowFrame->GetTallestChild(); - - nsSize rowFrameSize; - - rowFrame->GetSize(rowFrameSize); - rowFrame->SizeTo(rowFrameSize.width, rowHeights[rowIndex]); - rowGroupHeight += rowHeights[rowIndex]; - // resize all the cells based on the rowHeight - PRInt32 numCells; - - rowFrame->ChildCount(numCells); - for (PRInt32 cellIndex = 0; cellIndex < numCells; cellIndex++) - { - nsTableCellFrame *cellFrame; - - rowFrame->ChildAt(cellIndex, (nsIFrame*&)cellFrame); - PRInt32 rowSpan = cellFrame->GetRowSpan(); - if (1==rowSpan) - { - if (gsDebug==PR_TRUE) printf(" setting cell[%d,%d] height to %d\n", rowIndex, cellIndex, rowHeights[rowIndex]); - - nsSize cellFrameSize; - - cellFrame->GetSize(cellFrameSize); - cellFrame->SizeTo(cellFrameSize.width, rowHeights[rowIndex]); - // Realign cell content based on new height - cellFrame->VerticallyAlignChild(aPresContext); - } - else - { - if (gsDebug==PR_TRUE) printf(" skipping cell[%d,%d]\n", rowIndex, cellIndex); - atLeastOneRowSpanningCell = PR_TRUE; - } - } - } - - /* Step 2: now account for cells that span rows. - * a spanning cell's height is the sum of the heights of the rows it spans, - * or it's own desired height, whichever is greater. - * If the cell's desired height is the larger value, resize the rows and contained - * cells by an equal percentage of the additional space. - */ - /* TODO - * 1. optimization, if (PR_TRUE==atLeastOneRowSpanningCell) ... otherwise skip this step entirely - * 2. find cases where spanning cells effect other spanning cells that began in rows above themselves. - * I think in this case, we have to make another pass through step 2. - * There should be a "rational" check to terminate that kind of loop after n passes, probably 3 or 4. - */ - if (gsDebug==PR_TRUE) printf("Height Step 2...\n"); - rowGroupHeight=0; - nsTableRowFrame *rowFrame=nsnull; - for (rowIndex = 0; rowIndex < numRows; rowIndex++) - { - // get the next row - if (0==rowIndex) - rowGroupFrame->ChildAt(rowIndex, (nsIFrame*&)rowFrame); - else - rowFrame->GetNextSibling((nsIFrame*&)rowFrame); - PRInt32 numCells; - rowFrame->ChildCount(numCells); - // check this row for a cell with rowspans - for (PRInt32 cellIndex = 0; cellIndex < numCells; cellIndex++) - { - // get the next cell - nsTableCellFrame *cellFrame; - rowFrame->ChildAt(cellIndex, (nsIFrame*&)cellFrame); - PRInt32 rowSpan = cellFrame->GetRowSpan(); - if (1 1, determine it's height - if (gsDebug==PR_TRUE) printf(" cell[%d,%d] has a rowspan = %d\n", rowIndex, cellIndex, rowSpan); - PRInt32 heightOfRowsSpanned = 0; - for (PRInt32 i=0; iGetSize(cellFrameSize); - if (heightOfRowsSpanned>cellFrameSize.height) - { - if (gsDebug==PR_TRUE) printf(" cell[%d,%d] fits, setting height to %d\n", rowIndex, cellIndex, heightOfRowsSpanned); - cellFrame->SizeTo(cellFrameSize.width, heightOfRowsSpanned); - // Realign cell content based on new height - cellFrame->VerticallyAlignChild(aPresContext); - } - /* otherwise, distribute the excess height to the rows effected, and to the cells in those rows - * push all subsequent rows down by the total change in height of all the rows above it - */ - else - { - PRInt32 excessHeight = cellFrameSize.height - heightOfRowsSpanned; - PRInt32 excessHeightPerRow = excessHeight/rowSpan; - if (gsDebug==PR_TRUE) printf(" cell[%d,%d] does not fit, excessHeight = %d, excessHeightPerRow = %d\n", - rowIndex, cellIndex, excessHeight, excessHeightPerRow); - // for every row starting at the row with the spanning cell... - for (i=rowIndex; iChildAt(i, (nsIFrame*&)rowFrameToBeResized); - // if the row is within the spanned range, resize the row and it's cells - if (iGetSize(rowFrameSize); - rowFrameToBeResized->SizeTo(rowFrameSize.width, rowHeights[i]); - PRInt32 cellCount; - - rowFrameToBeResized->ChildCount(cellCount); - for (PRInt32 j=0; jChildAt(j, (nsIFrame*&)frame); - if (frame->GetRowSpan()==1) - { - nsSize frameSize; - - frame->GetSize(frameSize); - if (gsDebug==PR_TRUE) printf(" cell[%d, %d] set height to %d\n", i, j, frameSize.height+excessHeightPerRow); - frame->SizeTo(frameSize.width, frameSize.height+excessHeightPerRow); - // Realign cell content based on new height - frame->VerticallyAlignChild(aPresContext); - } - } - } - // if we're dealing with a row below the row containing the spanning cell, - // push that row down by the amount we've expanded the cell heights by - if (i>=rowIndex && i!=0) - { - nsRect rowRect; - - rowFrameToBeResized->GetRect(rowRect); - nscoord delta = excessHeightPerRow*(i-rowIndex); - if (delta > excessHeight) - delta = excessHeight; - rowFrameToBeResized->MoveTo(rowRect.x, rowRect.y + delta); - if (gsDebug==PR_TRUE) printf(" row %d (%p) moved by %d to y-offset %d\n", - i, rowFrameToBeResized, delta, rowRect.y + delta); - } - } - } - } - } - rowGroupHeight += rowHeights[rowIndex]; - } - if (gsDebug==PR_TRUE) printf("row group height set to %d\n", rowGroupHeight); - - nsSize rowGroupFrameSize; - - rowGroupFrame->GetSize(rowGroupFrameSize); - rowGroupFrame->SizeTo(rowGroupFrameSize.width, rowGroupHeight); - tableHeight += rowGroupHeight; - } - } - if (0!=tableHeight) - { - if (gsDebug==PR_TRUE) printf("table desired height set to %d\n", tableHeight); - aDesiredSize.height = tableHeight; - } -#ifdef NS_DEBUG - gsDebug = gsDebugWas; -#endif -} - -// XXX Kipp wonders: what does this really mean? Are you really asking -// "Is it fixed width"? If so, then VALUE_PCT may be wrong and the -// name of the method should be changed. - -PRBool nsTableFrame::IsProportionalWidth(nsStylePosition* aStylePosition) -{ - PRBool result = PR_FALSE; - if (nsnull == aStylePosition) { - // Assume NS_STYLE_POSITION_VALUE_AUTO when no style is available - result = PR_TRUE; - } - else { - switch (aStylePosition->mWidthFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - case NS_STYLE_POSITION_VALUE_PERCENT: - break; - - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - result = PR_TRUE; - break; - } - } - return result; -} - -/** - */ -NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull != aCX, "bad arg"); - if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - - // mFirstPassValid needs to be set somewhere in response to change notifications. - - aDesiredSize.width = mRect.width; - aDesiredSize.height = mRect.height; - aStatus = frComplete; - return NS_OK; -} - -void nsTableFrame::VerticallyAlignChildren(nsIPresContext* aPresContext, - nscoord* aAscents, - nscoord aMaxAscent, - nscoord aMaxHeight) -{ -} - -nsVoidArray * nsTableFrame::GetColumnLayoutData() -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - NS_ASSERTION(nsnull!=firstInFlow->mColumnLayoutData, "illegal state -- no column layout data"); - return firstInFlow->mColumnLayoutData; -} - -/** Associate aData with the cell at (aRow,aCol) - * @return PR_TRUE if the data was successfully associated with a Cell - * PR_FALSE if there was an error, such as aRow or aCol being invalid - */ -PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aCell) -{ - NS_ASSERTION(nsnull != aData, "bad arg"); - NS_ASSERTION(nsnull != aCell, "bad arg"); - - PRBool result = PR_TRUE; - - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - if (this!=firstInFlow) - result = firstInFlow->SetCellLayoutData(aData, aCell); - else - { - if (kPASS_FIRST==GetReflowPass()) - { - if (nsnull==mColumnLayoutData) - { - mColumnLayoutData = new nsVoidArray(); - NS_ASSERTION(nsnull != mColumnLayoutData, "bad alloc"); - nsTablePart * tablePart = (nsTablePart *)mContent; - PRInt32 cols = tablePart->GetMaxColumns(); - PRInt32 tableKidCount = tablePart->ChildCount(); - for (PRInt32 i=0; iChildAt(i); - NS_ASSERTION(tableKid.IsNotNull(), "bad kid"); - const int contentType = tableKid->GetType(); - if (contentType == nsITableContent::kTableColGroupType) - { - PRInt32 colsInGroup = tableKid->ChildCount(); - for (PRInt32 j=0; jChildAt(j); - NS_ASSERTION(col.IsNotNull(), "bad content"); - nsColLayoutData *colData = new nsColLayoutData(col); - mColumnLayoutData->AppendElement((void *)colData); - } - } - // can't have col groups after row groups, so stop if you find a row group - else if (contentType == nsITableContent::kTableRowGroupType) - { - break; - } - } - } - - // create cell layout data objects for the passed in data, one per column spanned - // for now, divide width equally between spanned columns - - PRInt32 firstColIndex = aCell->GetColIndex(); - nsTableRow *row = aCell->GetRow(); // row: ADDREF++ - PRInt32 rowIndex = row->GetRowIndex(); - NS_RELEASE(row); // row: ADDREF-- - PRInt32 colSpan = aCell->GetColSpan(); - nsColLayoutData * colData = (nsColLayoutData *)(mColumnLayoutData->ElementAt(firstColIndex)); - nsVoidArray *col = colData->GetCells(); - if (gsDebugCLD) printf (" ~ SetCellLayoutData with row = %d, firstCol = %d, colSpan = %d, colData = %ld, col=%ld\n", - rowIndex, firstColIndex, colSpan, colData, col); - for (PRInt32 i=0; iGetMaxElementSize(); - nsSize partialCellSize(*cellSize); - partialCellSize.width = (cellSize->width)/colSpan; - // This method will copy the nsReflowMetrics pointed at by aData->GetDesiredSize() - nsCellLayoutData * kidLayoutData = new nsCellLayoutData(aData->GetCellFrame(), - aData->GetDesiredSize(), - &partialCellSize); - PRInt32 numCells = col->Count(); - if (gsDebugCLD) printf (" ~ before setting data, number of cells in this column = %d\n", numCells); - if ((numCells==0) || numCellsAppendElement((void *)kidLayoutData); - } - else - { - if (gsDebugCLD) printf (" ~ replacing %d + rowIndex = %d\n", i, i+rowIndex); - nsCellLayoutData* data = (nsCellLayoutData*)col->ElementAt(i+rowIndex); - col->ReplaceElementAt((void *)kidLayoutData, i+rowIndex); - if (data != nsnull) - delete data; - } - if (gsDebugCLD) printf (" ~ after setting data, number of cells in this column = %d\n", col->Count()); - } - } - else - result = PR_FALSE; - } - - return result; -} - -/** Get the layout data associated with the cell at (aRow,aCol) - * @return nsnull if there was an error, such as aRow or aCol being invalid - * otherwise, the data is returned. - */ -nsCellLayoutData * nsTableFrame::GetCellLayoutData(nsTableCell *aCell) -{ - NS_ASSERTION(nsnull != aCell, "bad arg"); - - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - nsCellLayoutData *result = nsnull; - if (this!=firstInFlow) - result = firstInFlow->GetCellLayoutData(aCell); - else - { - if (nsnull!=mColumnLayoutData) - { - PRInt32 firstColIndex = aCell->GetColIndex(); - nsColLayoutData * colData = (nsColLayoutData *)(mColumnLayoutData->ElementAt(firstColIndex)); - nsVoidArray *cells = colData->GetCells(); - PRInt32 count = cells->Count(); - for (PRInt32 i=0; iElementAt(i)); - nsTableCellPtr cell; - - data->GetCellFrame()->GetContent((nsIContent*&)(cell.AssignRef())); // cell: REFCNT++ - if (cell == aCell) - { - result = data; - break; - } - } - } - } - return result; -} - - - -PRInt32 nsTableFrame::GetReflowPass() const -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - return firstInFlow->mPass; -} - -void nsTableFrame::SetReflowPass(PRInt32 aReflowPass) -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - firstInFlow->mPass = aReflowPass; -} - -PRBool nsTableFrame::IsFirstPassValid() const -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - return firstInFlow->mFirstPassValid; -} - -//ZZZ TOTAL HACK -PRBool isTableAutoWidth = PR_TRUE; -PRBool isAutoColumnWidths = PR_TRUE; - -PRBool nsTableFrame::TableIsAutoWidth() -{ // ZZZ: TOTAL HACK - return isTableAutoWidth; -} - -PRBool nsTableFrame::AutoColumnWidths() -{ // ZZZ: TOTAL HACK - return isAutoColumnWidths; -} - -NS_METHOD nsTableFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableFrame* cf = new nsTableFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); - // set my width, because all frames in a table flow are the same width - // code in nsTableOuterFrame depends on this being set - cf->SetRect(nsRect(0, 0, mRect.width, 0)); - // add headers and footers to cf - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - nsIFrame * rg = nsnull; - firstInFlow->ChildAt(0, rg); - NS_ASSERTION (nsnull!=rg, "previous frame has no children"); - nsIAtom * tHeadTag = NS_NewAtom(nsTablePart::kRowGroupHeadTagString); // tHeadTag: REFCNT++ - nsIAtom * tFootTag = NS_NewAtom(nsTablePart::kRowGroupFootTagString); // tFootTag: REFCNT++ - PRInt32 index = 0; - nsIFrame * bodyRowGroupFromOverflow = mOverflowList; - nsIFrame * lastSib = nsnull; - for ( ; nsnull!=rg; index++) - { - nsIContent *content = nsnull; - rg->GetContent(content); // content: REFCNT++ - NS_ASSERTION(nsnull!=content, "bad frame, returned null content."); - nsIAtom * rgTag = content->GetTag(); - // if we've found a header or a footer, replicate it - if (tHeadTag==rgTag || tFootTag==rgTag) - { - printf("found a head or foot in continuing frame\n"); - // Resolve style for the child - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(content, cf); // kidStyleContext: REFCNT++ - nsIContentDelegate* kidDel = nsnull; - kidDel = content->GetDelegate(aPresContext); // kidDel: REFCNT++ - nsIFrame * duplicateFrame = kidDel->CreateFrame(aPresContext, content, index, cf); - NS_RELEASE(kidDel); // kidDel: REFCNT-- - duplicateFrame->SetStyleContext(kidStyleContext); - NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT-- - - if (nsnull==lastSib) - { - mOverflowList = duplicateFrame; - } - else - { - lastSib->SetNextSibling(duplicateFrame); - } - duplicateFrame->SetNextSibling(bodyRowGroupFromOverflow); - lastSib = duplicateFrame; - } - NS_RELEASE(content); // content: REFCNT-- - // get the next row group - rg->GetNextSibling(rg); - } - NS_RELEASE(tFootTag); // tHeadTag: REFCNT -- - NS_RELEASE(tHeadTag); // tFootTag: REFCNT -- - aContinuingFrame = cf; - return NS_OK; -} - -PRInt32 nsTableFrame::GetColumnWidth(PRInt32 aColIndex) -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - PRInt32 result = 0; - if (this!=firstInFlow) - result = firstInFlow->GetColumnWidth(aColIndex); - else - { - NS_ASSERTION(nsnull!=mColumnWidths, "illegal state"); -#ifdef DEBUG - nsVoidArray *cld = GetColumnLayoutData(); - NS_ASSERTION(nsnull!=cld, "no column layout data"); - PRInt32 numCols = cld->Count(); - NS_ASSERTION (numCols > aColIndex, "bad arg, col index out of bounds"); -#endif - if (nsnull!=mColumnWidths) - result = mColumnWidths[aColIndex]; - } - - //printf("GET_COL_WIDTH: %p, FIF=%p getting col %d and returning %d\n", this, firstInFlow, aColIndex, result); - - // XXX hack -#if 0 - if (result <= 0) { - result = 100; - } -#endif - return result; -} - -void nsTableFrame::SetColumnWidth(PRInt32 aColIndex, PRInt32 aWidth) -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - //printf("SET_COL_WIDTH: %p, FIF=%p setting col %d to %d\n", this, firstInFlow, aColIndex, aWidth); - if (this!=firstInFlow) - firstInFlow->SetColumnWidth(aColIndex, aWidth); - else - { - NS_ASSERTION(nsnull!=mColumnWidths, "illegal state"); - if (nsnull!=mColumnWidths) - mColumnWidths[aColIndex] = aWidth; - } -} - - -/* ---------- static methods ---------- */ - -nsresult nsTableFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -/* valuable code not yet used anywhere - - // since the table is a specified width, we need to expand the columns to fill the table - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - PRInt32 spaceUsed = 0; - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - nsStyleMolecule* colStyle = - (nsStyleMolecule*)mStyleContext->GetData(kStyleMoleculeSID); - if (PR_TRUE==IsProportionalWidth(colStyle)) - { - PRInt32 percentage = (100*mColumnWidths[colIndex]) / aMaxWidth; - PRInt32 additionalSpace = (spaceRemaining*percentage)/100; - mColumnWidths[colIndex] += additionalSpace; - additionalSpaceAdded += additionalSpace; - } - } - if (spaceUsed+additionalSpaceAdded < aMaxTableWidth) - mColumnWidths[numCols-1] += (aMaxTableWidth - (spaceUsed+additionalSpaceAdded)); - } -*/ - - - - diff --git a/mozilla/layout/html/table/src/nsTableFrame.h b/mozilla/layout/html/table/src/nsTableFrame.h deleted file mode 100644 index 43859f8ead8..00000000000 --- a/mozilla/layout/html/table/src/nsTableFrame.h +++ /dev/null @@ -1,439 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableFrame_h__ -#define nsTableFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - -class nsCellLayoutData; -class nsTableCell; -class nsVoidArray; -class nsTableCellFrame; -class CellData; -struct InnerTableReflowState; -struct nsStylePosition; -struct nsStyleSpacing; - -/** nsTableFrame maps the inner portion of a table (everything except captions.) - * Used as a pseudo-frame within nsTableOuterFrame, - * it may also be used stand-alone as the top-level frame. - * The meaningful child frames of nsTableFrame map rowgroups. - * - * @author sclark - * - * TODO: make methods virtual so nsTableFrame can be used as a base class in the future. - */ -class nsTableFrame : public nsContainerFrame -{ -public: - - /** nsTableOuterFrame has intimate knowledge of the inner table frame */ - friend class nsTableOuterFrame; - - /** instantiate a new instance of nsTableFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** inner tables are reflowed in two steps. - *
    -    * if mFirstPassValid is false, this is our first time through since content was last changed
    -    *   set pass to 1
    -    *   do pass 1
    -    *     get min/max info for all cells in an infinite space
    -    *   do column balancing
    -    *   set mFirstPassValid to true
    -    *   do pass 2
    -    *     use column widths to ResizeReflow cells
    -    *     shrinkWrap Cells in each row to tallest, realigning contents within the cell
    -    * 
    - * - * @see ResizeReflowPass1 - * @see ResizeReflowPass2 - * @see BalanceColumnWidths - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame::CreateContinuingFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** resize myself and my children according to the arcane rules of cell height magic. - * By default, the height of a cell is the max (height of cells in its row) - * In the case of a cell with rowspan>1 (lets call this C), - * if the sum of the height of the rows spanned (excluding C in the calculation) - * is greater than or equal to the height of C, - * the cells in the rows are sized normally and - * the height of C is set to the sum of the heights (taking into account borders, padding, and margins) - * else - * the height of each row is expanded by a percentage of the difference between - * the row's desired height and the height of C - */ - virtual void ShrinkWrapChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsSize* aMaxElementSize); - - /** return the column layout data for this inner table frame. - * if this is a continuing frame, return the first-in-flow's column layout data. - */ - virtual nsVoidArray *GetColumnLayoutData(); - - /** Associate aData with the cell at (aRow,aCol) - * @return PR_TRUE if the data was successfully associated with a Cell - * PR_FALSE if there was an error, such as aRow or aCol being invalid - */ - virtual PRBool SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aCell); - - /** Get the layout data associated with the cell at (aRow,aCol) - * @return PR_NULL if there was an error, such as aRow or aCol being invalid - * otherwise, the data is returned. - */ - virtual nsCellLayoutData * GetCellLayoutData(nsTableCell *aCell); - - /** returns PR_TRUE if this table has proportional width - */ - PRBool IsProportionalWidth(nsStylePosition* aStylePosition); - - - - /** - * DEBUG METHOD - * - */ - void ListColumnLayoutData(FILE* out = stdout, PRInt32 aIndent = 0) const; - - - /** return the width of the column at aColIndex */ - PRInt32 GetColumnWidth(PRInt32 aColIndex); - - /** set the width of the column at aColIndex to aWidth */ - void SetColumnWidth(PRInt32 aColIndex, PRInt32 aWidth); - - - - /** - * Calculate Layout Information - * - */ - nsCellLayoutData* FindCellLayoutData(nsTableCell* aCell); - void AppendLayoutData(nsVoidArray* aList, nsTableCell* aTableCell); - void RecalcLayoutData(); - void ResetCellLayoutData( nsTableCell* aCell, - nsTableCell* aAbove, - nsTableCell* aBelow, - nsTableCell* aLeft, - nsTableCell* aRight); - - - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** destructor, responsible for mColumnLayoutData and mColumnWidths */ - virtual ~nsTableFrame(); - - /** helper method to delete contents of mColumnLayoutData - * should be called with care (ie, only by destructor) - */ - virtual void DeleteColumnLayoutData(); - - /** first pass of ResizeReflow. - * lays out all table content with aMaxSize(NS_UNCONSTRAINEDSIZE,NS_UNCONSTRAINEDSIZE) and - * a non-null aMaxElementSize so we get all the metrics we need to do column balancing. - * Pass 1 only needs to be executed once no matter how many times the table is resized, - * as long as content and style don't change. This is managed in the member variable mFirstPassIsValid. - * The layout information for each cell is cached in mColumLayoutData. - * - * @see ResizeReflow - */ - virtual ReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** second pass of ResizeReflow. - * lays out all table content with aMaxSize(computed_table_width, given_table_height) - * Pass 2 is executed every time the table needs to resize. An optimization is included - * so that if the table doesn't need to actually be resized, no work is done (see NeedsReflow). - * - * @param aMinCaptionWidth - the max of all the minimum caption widths. 0 if no captions. - * @param aMaxCaptionWidth - the max of all the desired caption widths. 0 if no captions. - * - * @see ResizeReflow - * @see NeedsReflow - */ - virtual ReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - InnerTableReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); - - - /** assign widths for each column, taking into account the table content, the effective style, - * the layout constraints, and the compatibility mode. Sets mColumnWidths as a side effect. - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aMaxSize the height and width constraints - * @param aMaxElementSize the min size of the largest indivisible object - */ - virtual void BalanceColumnWidths(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** assign widths for each column that has fixed width. - * Computes the minimum and maximum table widths. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aMaxWidth the maximum width of the table - * @param aNumCols the total number of columns in the table - * @param aTableStyle the resolved style for the table - * @param aTotalFixedWidth out param, the sum of the fixed width columns - * @param aMinTableWidth out param, the min possible table width - * @param aMaxTableWidth out param, the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: should be renamed to "AssignKnownWidthInformation - */ - virtual PRBool AssignFixedColumnWidths(nsIPresContext* aPresContext, - PRInt32 aMaxWidth, - PRInt32 aNumCols, - PRInt32 & aTotalFixedWidth, - PRInt32 & aMinTableWidth, - PRInt32 & aMaxTableWidth); - - /** assign widths for each column that has proportional width inside a table that - * has a fixed width. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * @param aMaxWidth the total amount of horizontal space available - * @param aMinTableWidth the min possible table width - * @param aMaxTableWidth the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: rename this method to reflect that it is a Nav4 compatibility method - */ - virtual PRBool BalanceProportionalColumnsForSpecifiedWidthTable(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth); - - /** assign widths for each column that has proportional width inside a table that - * has auto width (width set by the content and available space.) - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * @param aMaxWidth the total amount of horizontal space available - * @param aMinTableWidth the min possible table width - * @param aMaxTableWidth the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: rename this method to reflect that it is a Nav4 compatibility method - */ - virtual PRBool BalanceProportionalColumnsForAutoWidthTable(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth); - - /** assign the minimum allowed width for each column that has proportional width. - * Typically called when the min table width doesn't fit in the available space. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - */ - virtual PRBool SetColumnsToMinWidth(nsIPresContext* aPresContext); - - /** assign the maximum allowed width for each column that has proportional width. - * Typically called when the desired max table width fits in the available space. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - */ - virtual PRBool BalanceColumnsTableFits(nsIPresContext* aPresContext, - PRInt32 aAvailWidth); - - /** assign widths for each column that has proportional width inside a table that - * has auto width (width set by the content and available space) according to the - * HTML 4 specification. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * @param aMaxWidth the total amount of horizontal space available - * @param aMinTableWidth the min possible table width - * @param aMaxTableWidth the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: rename this method to reflect that it is a Nav4 compatibility method - */ - virtual PRBool BalanceColumnsHTML4Constrained(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth); - - /** sets the width of the table according to the computed widths of each column. */ - virtual void SetTableWidth(nsIPresContext* aPresContext); - - /** - */ - virtual void VerticallyAlignChildren(nsIPresContext* aPresContext, - nscoord* aAscents, - nscoord aMaxAscent, - nscoord aMaxHeight); - - /** support routine returns PR_TRUE if the table should be sized "automatically" - * according to its content. - * In NAV4, this is the default (no WIDTH, no COLS). - */ - virtual PRBool TableIsAutoWidth(); - - /** support routine returns PR_TRUE if the table columns should be sized "automatically" - * according to its content. - * In NAV4, this is when there is a COLS attribute on the table. - */ - virtual PRBool AutoColumnWidths(); - - /** given the new parent size, do I really need to do a reflow? */ - virtual PRBool NeedsReflow(const nsSize& aMaxSize); - - /** what stage of reflow is currently in process? */ - virtual PRInt32 GetReflowPass() const; - - /** sets the reflow pass flag. use with caution! */ - virtual void SetReflowPass(PRInt32 aReflowPass); - - /** returns PR_TRUE if the cached pass 1 data is still valid */ - virtual PRBool IsFirstPassValid() const; - -private: - void nsTableFrame::DebugPrintCount() const; // Debugging routine - - - /** table reflow is a multi-pass operation. Use these constants to keep track of - * which pass is currently being executed. - */ - enum {kPASS_UNDEFINED=0, kPASS_FIRST=1, kPASS_SECOND=2, kPASS_THIRD=3}; - - nsVoidArray *mColumnLayoutData; // array of array of cellLayoutData's - PRInt32 *mColumnWidths; // widths of each column - PRBool mFirstPassValid; // PR_TRUE if first pass data is still legit - PRInt32 mPass; // which Reflow pass are we currently in? - PRBool mIsInvariantWidth; // PR_TRUE if table width cannot change - -}; - -#endif diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp deleted file mode 100644 index ce00afbce76..00000000000 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ /dev/null @@ -1,1402 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableOuterFrame.h" -#include "nsTableFrame.h" -#include "nsTableCaptionFrame.h" -#include "nsITableContent.h" -#include "nsTableContent.h" -#include "nsBodyFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsCSSRendering.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsCSSLayout.h" -#include "nsVoidArray.h" -#include "nsReflowCommand.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -//#define NOISY_MARGINS -#else -static const PRBool gsDebug = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kITableContentIID, NS_ITABLECONTENT_IID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct OuterTableReflowState { - - // The presentation context - nsIPresContext *pc; - - // The total available size (computed from the parent) - nsSize availSize; - // The available size for the inner table frame - nsSize innerTableMaxSize; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Running y-offset - nscoord y; - - // Flags for where we are in the content - PRBool firstRowGroup; - PRBool processingCaption; - - OuterTableReflowState(nsIPresContext* aPresContext, - const nsSize& aMaxSize) - { - pc = aPresContext; - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - y=0; // border/padding/margin??? - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - firstRowGroup = PR_TRUE; - processingCaption = PR_FALSE; - } - - ~OuterTableReflowState() { - } -}; - - - -/* ----------- nsTableOuterFrame ---------- */ - - -/** - */ -nsTableOuterFrame::nsTableOuterFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mInnerTableFrame(nsnull), - mCaptionFrames(nsnull), - mBottomCaptions(nsnull), - mMinCaptionWidth(0), - mMaxCaptionWidth(0), - mFirstPassValid(PR_FALSE) -{ -} - -nsTableOuterFrame::~nsTableOuterFrame() -{ - if (nsnull!=mCaptionFrames) - delete mCaptionFrames; - if (nsnull!=mBottomCaptions) - delete mBottomCaptions; -} - -NS_METHOD nsTableOuterFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -PRBool nsTableOuterFrame::NeedsReflow(const nsSize& aMaxSize) -{ - PRBool result=PR_TRUE; - if (nsnull!=mInnerTableFrame) - result = mInnerTableFrame->NeedsReflow(aMaxSize); - return result; -} - -PRBool nsTableOuterFrame::IsFirstPassValid() -{ - return mFirstPassValid; -} - -void nsTableOuterFrame::SetFirstPassValid(PRBool aValidState) -{ - mFirstPassValid = aValidState; -} - -/** - * ResizeReflow is a 2-step process. - * In the first step, we lay out all of the captions and the inner table in NS_UNCONSTRAINEDSIZE space. - * This gives us absolute minimum and maximum widths. - * In the second step, we force all the captions and the table to the width of the widest component, - * given the table's width constraints. - * With the widths known, we reflow the captions and table. - * NOTE: for breaking across pages, this method has to account for table content that is not laid out - * linearly vis a vis the frames. That is, content hierarchy and the frame hierarchy do not match. - */ -NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - if (PR_TRUE==gsDebug) - printf ("***table outer frame reflow \t\t%p\n", this); - if (PR_TRUE==gsDebug) - printf("nsTableOuterFrame::ResizeReflow : maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - -#ifdef NS_DEBUG - // replace with a check that does not assume linear placement of children - // PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; - nsSize innerTableMaxElementSize(0,0); - - // Set up our kids. They're already present, on an overflow list, - // or there are none so we'll create them now - MoveOverflowToChildList(); - if (nsnull==mFirstChild) - CreateChildFrames(aPresContext); - if (nsnull!=mPrevInFlow && nsnull==mInnerTableFrame) - { // if I am a continuing frame, my inner table is my prev-in-flow's mInnerTableFrame's next-in-flow - CreateInnerTableFrame(aPresContext); - } - // at this point, we must have at least one child frame, and we must have an inner table frame - NS_ASSERTION(nsnull!=mFirstChild, "no children"); - NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame"); - if (nsnull==mFirstChild || nsnull==mInnerTableFrame) { - //ERROR! - aStatus = frComplete; - return NS_OK; - } - - OuterTableReflowState state(aPresContext, aMaxSize); - - // lay out captions pass 1, if necessary - if (PR_FALSE==IsFirstPassValid()) - { - mFirstPassValid = PR_TRUE; - aStatus = ResizeReflowCaptionsPass1(aPresContext); - - } - - // lay out inner table, if required - if (PR_FALSE==mInnerTableFrame->IsFirstPassValid()) - { // we treat the table as if we've never seen the layout data before - mInnerTableFrame->SetReflowPass(nsTableFrame::kPASS_FIRST); - aStatus = mInnerTableFrame->ResizeReflowPass1(aPresContext, aDesiredSize, aMaxSize, - &innerTableMaxElementSize); - -#ifdef NOISY_MARGINS - nsIContent* content = nsnull; - mInnerTableFrame->GetContent(content); - nsTablePart *table = (nsTablePart*)content; - if (table != nsnull) - table->DumpCellMap(); - mInnerTableFrame->RecalcLayoutData(); - mInnerTableFrame->ListColumnLayoutData(stdout,1); -#endif - - } - mInnerTableFrame->SetReflowPass(nsTableFrame::kPASS_SECOND); - // assign table width info only if the inner table frame is a first-in-flow - nsIFrame* prevInFlow; - - mInnerTableFrame->GetPrevInFlow(prevInFlow); - if (nsnull==prevInFlow) - { - // assign column widths, and assign aMaxElementSize->width - mInnerTableFrame->BalanceColumnWidths(aPresContext, aMaxSize, aMaxElementSize); - // assign table width - mInnerTableFrame->SetTableWidth(aPresContext); - } - // inner table max is now the computed width and assigned height - nsSize innerTableSize; - - mInnerTableFrame->GetSize(innerTableSize); - state.innerTableMaxSize.width = innerTableSize.width; - state.innerTableMaxSize.height = aMaxSize.height; - - // Reflow the child frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - NS_ABORT(); // huge error for tables! - } else { - // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; - } - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - //NS_ASSERTION(0width, aMaxElementSize->height); - else - printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n", - aStatus==frComplete ? "Complete" : "Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - -#ifdef NS_DEBUG - // replace with a check that does not assume linear placement of children - // PostReflowCheck(status); -#endif - // REMOVE ME! - /* - nsIFrame *next = this; - nsIFrame *root=nsnull; - while (nsnull!=next) - { - root = next; - next = next->GetGeometricParent(); - } - root->List(); - */ - // end REMOVE ME! - - return NS_OK; - -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableOuterFrame::GetTopMarginFor(nsIPresContext* aCX, - OuterTableReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableOuterFrame::PlaceChild( OuterTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug) - printf ("outer table place child: %p with aKidRect %d %d %d %d\n", - aKidFrame, aKidRect.x, aKidRect.y, - aKidRect.width, aKidRect.height); - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - /* Update the maximum element size, which is the sum of: - * the maxElementSize of our first row - * plus the maxElementSize of the top caption if we include it - * plus the maxElementSize of the bottom caption if we include it - */ - if (PR_TRUE==aState.processingCaption || PR_TRUE==aState.firstRowGroup) - { - if (PR_FALSE==aState.processingCaption) - aState.firstRowGroup = PR_FALSE; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aKidMaxElementSize.width; - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool originalLastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - aState.availSize.width = aState.innerTableMaxSize.width; - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsReflowMetrics kidSize; - nsIFrame::ReflowStatus status; - - SetReflowState(aState, kidFrame); - - if (PR_TRUE==gsDebug) printf ("ReflowMappedChildren: %p with state = %s\n", - kidFrame, aState.processingCaption?"caption":"inner"); - - // Get top margin for this kid - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = - (nsStyleSpacing*)kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - aState.availSize.width -= kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Only skip the reflow if this is not our first child and we are - // out of space. - if ((kidFrame == mFirstChild) || (aState.availSize.height > 0)) { - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, kidSize, - aState.availSize, pKidMaxElementSize, - aState); - } - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (kidFrame != mFirstChild)) { - // The child is too tall to fit in the available space, and it's - // not our first child - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aState, kidFrame, kidRect, aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - if (frNotComplete == status) { - // No, the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - /* debug */ - /* - printf ("having just pushed children, here is the frame hierarchy.\n"); - nsIFrame *p; - GetGeometricParent(p); - nsIFrame *root; - while (nsnull!=p) - { - root = p; - p->GetGeometricParent(p); - } - root->List(); - fflush(stdout); - */ - /* end debug */ - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count - mChildCount = childCount; - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - // Set the last content offset based on the last child we mapped. - NS_ASSERTION(IsLastChild(prevKidFrame), "unexpected last child"); - SetLastContentOffset(prevKidFrame); - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableOuterFrame* nextInFlow = (nsTableOuterFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list - //NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - - if ((kidFrameSize.width > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize, aState); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Place the child after taking into account it's margin -// aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); -// kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableOuterFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** set the OuterTableReflowState based on the child frame we are currently processing. - * must be called before ReflowChild, at a minimum. - */ -void nsTableOuterFrame::SetReflowState(OuterTableReflowState& aState, nsIFrame* aKidFrame) -{ - nsIContentPtr kid; - - aKidFrame->GetContent(kid.AssignRef()); // kid: REFCNT++ - nsITableContent *tableContentInterface = nsnull; - kid->QueryInterface(kITableContentIID, (void**)&tableContentInterface);// tableContentInterface: REFCNT++ - if (nsnull!=tableContentInterface) - { - aState.processingCaption = PR_TRUE; - NS_RELEASE(tableContentInterface); // tableContentInterface: REFCNT-- - } - else - aState.processingCaption = PR_FALSE; -} - -/** - * Reflow a child frame and return the status of the reflow. If the - * child is complete and it has next-in-flows (it was a splittable child) - * then delete the next-in-flows. - */ -nsIFrame::ReflowStatus -nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - OuterTableReflowState& aState) -{ - ReflowStatus status; - - /* call the appropriate reflow method based on the type and position of the child */ - if (PR_TRUE==aState.processingCaption) - { // it's a caption, find out if it's top or bottom - // Resolve style - nsIStyleContextPtr captionStyleContext; - - aKidFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); - nsStyleText* captionStyle = - (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); - NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); - if ((eStyleUnit_Enumerated == captionStyle->mVerticalAlign.GetUnit()) && - (NS_STYLE_VERTICAL_ALIGN_BOTTOM==captionStyle->mVerticalAlign.GetIntValue())) - { - if (PR_TRUE==gsDebug) printf("reflowChild called with a bottom caption\n"); - status = ResizeReflowBottomCaptionsPass2(aPresContext, aDesiredSize, - aMaxSize, aMaxElementSize, - aState.y); - } - else - { - if (PR_TRUE==gsDebug) printf("reflowChild called with a top caption\n"); - status = ResizeReflowTopCaptionsPass2(aPresContext, aDesiredSize, - aMaxSize, aMaxElementSize); - } - } - else - { - if (PR_TRUE==gsDebug) printf("reflowChild called with a table body\n"); - status = ((nsTableFrame*)aKidFrame)->ResizeReflowPass2(aPresContext, aDesiredSize, aState.innerTableMaxSize, - aMaxElementSize, - mMinCaptionWidth, mMaxCaptionWidth); - } - if (PR_TRUE==gsDebug) - { - } - - if (frComplete == status) { - nsIFrame* kidNextInFlow; - - aKidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull != kidNextInFlow) { - // Remove all of the childs next-in-flows. Make sure that we ask - // the right parent to do the removal (it's possible that the - // parent is not this because we are executing pullup code) - nsTableOuterFrame* parent; - - aKidFrame->GetGeometricParent((nsIFrame*&)parent); - parent->DeleteChildsNextInFlow(aKidFrame); - } - } - return status; -} - -void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) -{ - nsIFrame *prevKidFrame = nsnull; - nsresult frameCreated = nsTableFrame::NewFrame((nsIFrame **)(&mInnerTableFrame), mContent, 0, this); - if (NS_OK!=frameCreated) - return; // SEC: an error!!!! - // Resolve style - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(mContent, this); - NS_ASSERTION(kidStyleContext.IsNotNull(), "bad style context for kid."); - mInnerTableFrame->SetStyleContext(kidStyleContext); - mChildCount++; - // Link child frame into the list of children - mFirstChild = mInnerTableFrame; - prevKidFrame = mInnerTableFrame; - - // now create the caption frames, prepending top captions and - // appending bottom captions - mCaptionFrames = new nsVoidArray(); - // create caption frames as needed - nsIFrame *lastTopCaption = nsnull; - for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) { - nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++ - if (caption.IsNull()) { - break; - } - const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType(); - if (contentType==nsITableContent::kTableCaptionType) - { - nsIFrame *captionFrame=nsnull; - frameCreated = nsTableCaptionFrame::NewFrame(&captionFrame, caption, 0, this); - if (NS_OK!=frameCreated) - return; // SEC: an error!!!! - // Resolve style - nsIStyleContextPtr captionStyleContext = - aPresContext->ResolveStyleContextFor(caption, this); - NS_ASSERTION(captionStyleContext.IsNotNull(), "bad style context for caption."); - nsStyleText* captionStyle = - (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); - captionFrame->SetStyleContext(captionStyleContext); - mChildCount++; - // Link child frame into the list of children - if ((eStyleUnit_Enumerated == captionStyle->mVerticalAlign.GetUnit()) && - (NS_STYLE_VERTICAL_ALIGN_BOTTOM==captionStyle->mVerticalAlign.GetIntValue())) - { // bottom captions get added to the end of the outer frame child list - prevKidFrame->SetNextSibling(captionFrame); - prevKidFrame = captionFrame; - // bottom captions get remembered in an instance variable for easy access later - if (nsnull==mBottomCaptions) - { - mBottomCaptions = new nsVoidArray(); - } - mBottomCaptions->AppendElement(captionFrame); - } - else - { // top captions get prepended to the outer frame child list - if (nsnull == lastTopCaption) - { // our first top caption, therefore our first child - mFirstChild = captionFrame; - mFirstChild->SetNextSibling(mInnerTableFrame); - } - else - { // just another grub in the brood of top captions - lastTopCaption->SetNextSibling(captionFrame); - lastTopCaption = captionFrame; - } - lastTopCaption = captionFrame; - } - mCaptionFrames->AppendElement(captionFrame); - } - else - { - break; - } - } -} - - -nsIFrame::ReflowStatus -nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext) -{ - if (nsnull!=mCaptionFrames) - { - PRInt32 numCaptions = mCaptionFrames->Count(); - for (PRInt32 captionIndex = 0; captionIndex < numCaptions; captionIndex++) - { - nsSize maxElementSize(0,0); - nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); - nsReflowMetrics desiredSize; - nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex); - ReflowStatus status; - captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status); - if (mMinCaptionWidthVerticallyAlignChild(aPresContext); - - } - } - return frComplete; -} - -nsIFrame::ReflowStatus -nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - ReflowStatus result = frComplete; - nscoord topCaptionY = 0; - if (nsnull!=mCaptionFrames) - { - PRInt32 numCaptions = mCaptionFrames->Count(); - for (PRInt32 captionIndex = 0; captionIndex < numCaptions; captionIndex++) - { - // get the caption - nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex); - - // Resolve style - nsIStyleContextPtr captionStyleContext; - - captionFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); - nsStyleText* captionStyle = - (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); - NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); - - if ((eStyleUnit_Enumerated == captionStyle->mVerticalAlign.GetUnit()) && - (NS_STYLE_VERTICAL_ALIGN_BOTTOM==captionStyle->mVerticalAlign.GetIntValue())) - { - } - else - { // top-align captions, the default - // reflow the caption, skipping top captions after the first that doesn't fit - if (frComplete==result) - { - nsReflowMetrics desiredSize; - result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull); - // place the caption - captionFrame->SetRect(nsRect(0, topCaptionY, desiredSize.width, desiredSize.height)); - if (NS_UNCONSTRAINEDSIZE!=desiredSize.height) - topCaptionY += desiredSize.height; - else - topCaptionY = NS_UNCONSTRAINEDSIZE; - mInnerTableFrame->MoveTo(0, topCaptionY); - PRInt32 captionIndexInParent; - - captionFrame->GetIndexInParent(captionIndexInParent); - if (0==captionIndexInParent) - { - SetFirstContentOffset(captionFrame); - if (gsDebug) printf("OUTER: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - } - } - // else continue on, so we can build the mBottomCaptions list - } - } - } - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = topCaptionY; - if (nsnull!=aMaxElementSize) - { // SEC: this isn't right - aMaxElementSize->width = aMaxSize.width; - aMaxElementSize->height = topCaptionY; - } - return result; -} - -nsIFrame::ReflowStatus -nsTableOuterFrame::ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nscoord aYOffset) -{ - ReflowStatus result = frComplete; - nscoord bottomCaptionY = aYOffset; - // for now, assume all captions are stacked vertically - if (nsnull!=mBottomCaptions) - { - PRInt32 numCaptions = mBottomCaptions->Count(); - for (PRInt32 captionIndex = 0; captionIndex < numCaptions; captionIndex++) - { - // get the caption - nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mBottomCaptions->ElementAt(captionIndex); - - // Resolve style -/* - nsIStyleContextPtr captionStyleContext = captionFrame->GetStyleContext(aPresContext); - NS_ASSERTION(nsnull != captionStyleContext, "null style context for caption"); - nsStyleMolecule* captionStyle = - (nsStyleMolecule*)captionStyleContext->GetData(kStyleMoleculeSID); - NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); -*/ - // reflow the caption - nsReflowMetrics desiredSize; - result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull); - - // place the caption - nsRect rect; - - captionFrame->GetRect(rect); - rect.y = bottomCaptionY; - rect.width=desiredSize.width; - rect.height=desiredSize.height; - captionFrame->SetRect(rect); - if (NS_UNCONSTRAINEDSIZE!=desiredSize.height) - bottomCaptionY += desiredSize.height; - else - bottomCaptionY = NS_UNCONSTRAINEDSIZE; - } - } - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = bottomCaptionY-aYOffset; - if (nsnull!=aMaxElementSize) - { // SEC: not right - aMaxElementSize->width = aMaxSize.width; - aMaxElementSize->height = bottomCaptionY-aYOffset; - } - return result; -} - -/** - * Sets the last content offset based on the last child frame. If the last - * child is a pseudo frame then it sets mLastContentIsComplete to be the same - * as the last child's mLastContentIsComplete - */ -/* -void nsTableOuterFrame::SetLastContentOffset(const nsIFrame* aLastChild) -{ - NS_PRECONDITION(nsnull != aLastChild, "bad argument"); - NS_PRECONDITION(aLastChild->GetGeometricParent() == this, "bad geometric parent"); - - if (ChildIsPseudoFrame(aLastChild)) { - nsContainerFrame* pseudoFrame = (nsContainerFrame*)aLastChild; - mLastContentOffset = pseudoFrame->GetLastContentOffset(); - mLastContentIsComplete = pseudoFrame->GetLastContentIsComplete(); - } else { - mLastContentOffset = aLastChild->GetIndexInParent(); - } -#ifdef NS_DEBUG - if (mLastContentOffset < mFirstContentOffset) { - nsIFrame* top = this; - while (top->GetGeometricParent() != nsnull) { - top = top->GetGeometricParent(); - } - top->List(); - } -#endif - // it is this next line that forces us to re-implement this method here - //NS_ASSERTION(mLastContentOffset >= mFirstContentOffset, "unexpected content mapping"); -} -*/ - -NS_METHOD -nsTableOuterFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::IncrementalReflow\n"); - // total hack for now, just some hard-coded values - ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - return NS_OK; -} - -NS_METHOD nsTableOuterFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableOuterFrame* cf = new nsTableOuterFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - cf->SetFirstPassValid(PR_TRUE); - if (PR_TRUE==gsDebug) - printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); - aContinuingFrame = cf; - return NS_OK; -} - -void nsTableOuterFrame::PrepareContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsTableOuterFrame* aContFrame) -{ - // Append the continuing frame to the flow - aContFrame->AppendToFlow(this); - - // Initialize it's content offsets. Note that we assume for now that - // the continuingFrame will map the remainder of the content and - // that therefore mLastContentIsComplete will be true. - PRInt32 nextOffset; - if (mChildCount > 0) { - nextOffset = mLastContentOffset; - if (mLastContentIsComplete) { - nextOffset++; - } - } else { - nextOffset = mFirstContentOffset; - } - - aContFrame->SetFirstContentOffset(nextOffset); - aContFrame->SetLastContentOffset(nextOffset); - aContFrame->SetLastContentIsComplete(PR_TRUE); - - // Resolve style for the continuing frame and set its style context. - // XXX presumptive - nsIStyleContextPtr styleContext = - aPresContext->ResolveStyleContextFor(mContent, aParent); - aContFrame->SetStyleContext(styleContext); -} - -NS_METHOD nsTableOuterFrame::VerifyTree() const -{ -#ifdef NS_DEBUG - -#endif - return NS_OK; -} - -/** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow - * pointers. - * - * Updates the child count and content offsets of all containers that are - * affected - * - * Overloaded here because nsContainerFrame makes assumptions about pseudo-frames - * that are not true for tables. - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise - */ -PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild) -{ - NS_PRECONDITION(IsChild(aChild), "bad geometric parent"); - - nsIFrame* nextInFlow; - - aChild->GetNextInFlow(nextInFlow); - - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nsTableOuterFrame* parent; - - nextInFlow->GetGeometricParent((nsIFrame*&)parent); - - // If the next-in-flow has a next-in-flow then delete it too (and - // delete it first). - nsIFrame* nextNextInFlow; - - nextInFlow->GetNextInFlow(nextNextInFlow); - if (nsnull != nextNextInFlow) { - parent->DeleteChildsNextInFlow(nextInFlow); - } - -#ifdef NS_DEBUG - PRInt32 childCount; - nsIFrame* firstChild; - - nextInFlow->ChildCount(childCount); - nextInFlow->FirstChild(firstChild); - - NS_ASSERTION(childCount == 0, "deleting !empty next-in-flow"); - - NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); -#endif - - // Disconnect the next-in-flow from the flow list - nextInFlow->BreakFromPrevFlow(); - - // Take the next-in-flow out of the parent's child list - if (parent->mFirstChild == nextInFlow) { - nextInFlow->GetNextSibling(parent->mFirstChild); - if (nsnull != parent->mFirstChild) { - parent->SetFirstContentOffset(parent->mFirstChild); - if (parent->IsPseudoFrame()) { - parent->PropagateContentOffsets(); - } - } - - // When a parent loses it's last child and that last child is a - // pseudo-frame then the parent's content offsets are now wrong. - // However, we know that the parent will eventually be reflowed - // in one of two ways: it will either get a chance to pullup - // children or it will be deleted because it's prev-in-flow - // (e.g. this) is complete. In either case, the content offsets - // will be repaired. - - } else { - nsIFrame* nextSibling; - - // Because the next-in-flow is not the first child of the parent - // we know that it shares a parent with aChild. Therefore, we need - // to capture the next-in-flow's next sibling (in case the - // next-in-flow is the last next-in-flow for aChild AND the - // next-in-flow is not the last child in parent) - NS_ASSERTION(parent->IsChild(aChild), "screwy flow"); - aChild->GetNextSibling(nextSibling); - NS_ASSERTION(nextSibling == nextInFlow, "unexpected sibling"); - - nextInFlow->GetNextSibling(nextSibling); - aChild->SetNextSibling(nextSibling); - } - - // Delete the next-in-flow frame and adjust it's parent's child count - nextInFlow->DeleteFrame(); - parent->mChildCount--; - -#ifdef NS_DEBUG - aChild->GetNextInFlow(nextInFlow); - NS_POSTCONDITION(nsnull == nextInFlow, "non null next-in-flow"); -#endif - - return PR_TRUE; -} - - -void nsTableOuterFrame::CreateInnerTableFrame(nsIPresContext* aPresContext) -{ - // Do we have a prev-in-flow? - if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame - mInnerTableFrame = new nsTableFrame(mContent, mIndexInParent, this); - mChildCount++; - - // Resolve style and set the style context - nsIStyleContextPtr styleContext = - aPresContext->ResolveStyleContextFor(mContent, this); - mInnerTableFrame->SetStyleContext(styleContext); - } else { - nsTableOuterFrame* prevOuterTable = (nsTableOuterFrame*)mPrevInFlow; - - nsIFrame* prevInnerTable = prevOuterTable->mInnerTableFrame; - - // Create a continuing column - prevInnerTable->GetNextInFlow((nsIFrame*&)mInnerTableFrame); - if (nsnull==mInnerTableFrame) - { - nsIFrame* continuingFrame; - - prevInnerTable->CreateContinuingFrame(aPresContext, this, continuingFrame); - mInnerTableFrame = (nsTableFrame*)continuingFrame; - mChildCount++; - } - } -} - -/* ----- static methods ----- */ - -nsresult nsTableOuterFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableOuterFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.h b/mozilla/layout/html/table/src/nsTableOuterFrame.h deleted file mode 100644 index b53523daabc..00000000000 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.h +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableOuterFrame_h__ -#define nsTableOuterFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - -class nsTableFrame; -class nsVoidArray; -class nsTableCaptionFrame; -struct OuterTableReflowState; -struct nsStyleSpacing; - -/** - * main frame for an nsTable content object, - * the nsTableOuterFrame contains 0 or more nsTableCaptionFrames, - * and a single nsTableFrame psuedo-frame, often referred to as the "inner frame'. - *

    Unlike other frames that handle continuing across breaks, nsTableOuterFrame - * has no notion of "unmapped" children. All children (captions and inner table) - * have frames created in Pass 1, so from the layout process' point of view, they - * are always mapped - * - * @author sclark - */ -class nsTableOuterFrame : public nsContainerFrame -{ -public: - - /** instantiate a new instance of nsTableFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** outer tables are reflowed in two steps. - * Step 1:, we lay out all of the captions and the inner table with - * height and width set to NS_UNCONSTRAINEDSIZE. - * This gives us absolute minimum and maximum widths for each component. - * In the second step, we set all the captions and the inner table to - * the width of the widest component, given the table's style, width constraints - * and compatibility mode.
    - * Step 2: With the widths now known, we reflow the captions and table.
    - * NOTE: for breaking across pages, this method has to account for table content - * that is not laid out linearly vis a vis the frames. - * That is, content hierarchy and the frame hierarchy do not match. - * - * @see NeedsReflow - * @see ResizeReflowCaptionsPass1 - * @see ResizeReflowTopCaptionsPass2 - * @see ResizeReflowBottomCaptionsPass2 - * @see PlaceChild - * @see ReflowMappedChildren - * @see PullUpChildren - * @see ReflowChild - * @see nsTableFrame::ResizeReflowPass1 - * @see nsTableFrame::ResizeReflowPass2 - * @see nsTableFrame::BalanceColumnWidths - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - /** destructor */ - virtual ~nsTableOuterFrame(); - -protected: - - /** protected constructor - * @see NewFrame - */ - nsTableOuterFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** return PR_TRUE if the table needs to be reflowed. - * the outer table needs to be reflowed if the table content has changed, - * or if the table style attributes or parent max height/width have - * changed. - */ - virtual PRBool NeedsReflow(const nsSize& aMaxSize); - - /** returns PR_TRUE if the data obtained from the first reflow pass - * is cached and still valid (ie, no content or style change notifications.) - */ - virtual PRBool IsFirstPassValid(); - - /** setter for mFirstPassValid. - * should be called with PR_FALSE when: - * content changes, style changes, or context changes - */ - virtual void SetFirstPassValid(PRBool aValidState); - - /** create all child frames for this table */ - virtual void CreateChildFrames(nsIPresContext* aPresContext); - - /** reflow the captions in an infinite space, caching the min/max sizes for each - */ - virtual ReflowStatus ResizeReflowCaptionsPass1(nsIPresContext* aPresContext); - - /** reflow the top captions in a space constrained by the computed table width - * and the heigth given to us by our parent. Top captions are laid down - * before the inner table. - */ - virtual ReflowStatus ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** reflow the bottom captions in a space constrained by the computed table width - * and the heigth given to us by our parent. Bottom captions are laid down - * after the inner table. - */ - virtual ReflowStatus ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nscoord aYOffset); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - OuterTableReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild( OuterTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize); - - virtual void SetReflowState(OuterTableReflowState& aState, - nsIFrame* aKidFrame); - - virtual nsIFrame::ReflowStatus ReflowChild( nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - OuterTableReflowState& aState); - - /** overridden here to handle special caption-table relationship - * @see nsContainerFrame::VerifyTree - */ - NS_IMETHOD VerifyTree() const; - - /** overridden here to handle special caption-table relationship - * @see nsContainerFrame::PrepareContinuingFrame - */ - virtual void PrepareContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsTableOuterFrame* aContFrame); - - /** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow - * pointers. - * - * Updates the child count and content offsets of all containers that are - * affected - * - * Overloaded here because nsContainerFrame makes assumptions about pseudo-frames - * that are not true for tables. - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise - */ - PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild); - - /** create the inner table frame (nsTableFrame) - * handles initial creation as well as creation of continuing frames - */ - virtual void CreateInnerTableFrame(nsIPresContext* aPresContext); - - -private: - /** used to keep track of this frame's children */ - nsTableFrame *mInnerTableFrame; - nsVoidArray * mCaptionFrames; - nsVoidArray * mBottomCaptions; - - /** used to keep track of min/max caption requirements */ - PRInt32 mMinCaptionWidth; - PRInt32 mMaxCaptionWidth; - - /** used to cache reflow results so we can optimize out reflow in some circumstances */ - nsReflowMetrics mDesiredSize; - nsSize mMaxElementSize; - - /** we can skip the first pass on captions if mFirstPassValid is true */ - PRBool mFirstPassValid; - -}; - - - -#endif diff --git a/mozilla/layout/html/table/src/nsTablePart.cpp b/mozilla/layout/html/table/src/nsTablePart.cpp deleted file mode 100644 index 55085b7ca0d..00000000000 --- a/mozilla/layout/html/table/src/nsTablePart.cpp +++ /dev/null @@ -1,1158 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTablePart.h" -#include "nsTableOuterFrame.h" -#include "nsITableContent.h" -#include "nsTableCol.h" -#include "nsTableColGroup.h" -#include "nsTableRowGroup.h" -#include "nsTableCaption.h" -#include "nsTableRow.h" -#include "nsTableCell.h" -#include "nsCellMap.h" -#include "nsHTMLParts.h" -#include "nsIPresContext.h" -#include "nsContainerFrame.h" -#include "nsIRenderingContext.h" -#include "nsHTMLIIDs.h" -#include "nsIAtom.h" -#include "nsIStyleContext.h" -#include "nsHTMLAtoms.h" -#include "nsStyleConsts.h" -#include "nsUnitConversion.h" - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kITableContentIID, NS_ITABLECONTENT_IID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - -const char *nsTablePart::kCaptionTagString="CAPTION"; -const char *nsTablePart::kRowGroupBodyTagString="TBODY"; -const char *nsTablePart::kRowGroupHeadTagString="THEAD"; -const char *nsTablePart::kRowGroupFootTagString="TFOOT"; -const char *nsTablePart::kRowTagString="TR"; -const char *nsTablePart::kColGroupTagString="COLGROUP"; -const char *nsTablePart::kColTagString="COL"; -const char *nsTablePart::kDataCellTagString="TD"; -const char *nsTablePart::kHeaderCellTagString="TH"; - -CellData::CellData() -{ - mCell = nsnull; - mRealCell = nsnull; - mOverlap = nsnull; -} - -CellData::~CellData() -{} - - -/*---------- nsTablePart implementation -----------*/ - -/** - * - * BUGS: - *

      - *
    • centering (etc.) is leaking into table cell's from the outer environment - *
    - * - * TODO: - *
      - *
    • colspan creating empty cells on rows w/o matching cells - *
    • draw table borders ala navigator - *
    • border sizing - *
    • bordercolor - *
    • draw cell borders ala navigator - *
    • cellspacing - *
    • colspan not the last cell - *
    • floaters in table cells - *
        - *
      • rowspan truncation (rowspan sticking out past the bottom of the table) - *
      • effect on subsequent row structure - *
      - *
    • inherit table border color ala nav4 (use inherited text color) when - * the border is enabled and the bordercolor value nsnull. - *
    - * - * - * CSS1: - *
      - *
    • table margin - *
    • table border-width - *
    • table padding - *
    • row margin - *
    • row border-width - *
    • row padding - *
    • cell margin - *
    • cell border-width - *
    • cell padding - *
    • what about colgroup, thead, tbody, tfoot margin/border-width/padding? - *
    • map css1 style (borders, padding, margins) in some sensible manner - *
    - * - * CSS2: - *
      - *
    • watch it - *
    - * - */ - -/** constructor - * I do not check or addref aTag because my superclass does that for me - */ -nsTablePart::nsTablePart(nsIAtom* aTag) - : nsHTMLContainer(aTag), - mColCount(0), - mSpecifiedColCount(0), - mCellMap(0) -{ -} - -/** constructor - * I do not check or addref aTag because my superclass does that for me - */ -nsTablePart::nsTablePart (nsIAtom* aTag, PRInt32 aColumnCount) - : nsHTMLContainer(aTag), - mColCount(aColumnCount), - mSpecifiedColCount(0), - mCellMap(0) -{ -} - -/** - */ -nsTablePart::~nsTablePart() -{ - if (nsnull!=mCellMap) - { - delete mCellMap; - } -} - -// for debugging only -nsrefcnt nsTablePart::AddRef(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Add Ref: nsTablePart cnt = %d \n",mRefCnt+1); - return ++mRefCnt; -} - -// for debugging only -nsrefcnt nsTablePart::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Release: nsTablePart cnt = %d \n",mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: nsTablePart \n"); - delete this; - return 0; - } - return mRefCnt; -} - -PRInt32 nsTablePart::GetMaxColumns () -{ - if (nsnull == mCellMap) - { - BuildCellMap (); - } - return mColCount; -} - - // XXX what do rows with no cells turn into? -PRInt32 nsTablePart::GetRowCount () -{ - // if we've already built the cellMap, ask it for the row count - if (nsnull != mCellMap) - return mCellMap->GetRowCount(); - - // otherwise, we need to compute it by walking our children - int rowCount = 0; - int index = ChildCount (); - while (0 < index) - { - nsIContent *child = ChildAt (--index); // child: REFCNT++ - nsTableContent *tableContent = (nsTableContent *)child; - const int contentType = tableContent->GetType(); - if (contentType == nsITableContent::kTableRowGroupType) - rowCount += ((nsTableRowGroup *)tableContent)->GetRowCount (); - NS_RELEASE(child); // child: REFCNT-- - } - return rowCount; -} - -/* counts columns in column groups */ -PRInt32 nsTablePart::GetSpecifiedColumnCount () -{ - if (mSpecifiedColCount < 0) - { - mSpecifiedColCount = 0; - int count = ChildCount (); - for (int index = 0; index < count; index++) - { - nsIContent *child = ChildAt (index); // child: REFCNT++ - nsTableContent *tableContent = (nsTableContent *)child; - const int contentType = tableContent->GetType(); - if (contentType == nsITableContent::kTableColGroupType) - { - ((nsTableColGroup *)tableContent)->SetStartColumnIndex (mSpecifiedColCount); - mSpecifiedColCount += ((nsTableColGroup *)tableContent)->GetColumnCount (); - } - NS_RELEASE(child); // child: REFCNT-- - } - } - return mSpecifiedColCount; -} - -// returns the actual cell map, not a copy, so don't mess with it! -nsCellMap* nsTablePart::GetCellMap() const -{ - return mCellMap; -} - - -/* call when the cell structure has changed. mCellMap will be rebuilt on demand. */ -void nsTablePart::ResetCellMap () -{ - if (nsnull==mCellMap) - delete mCellMap; - mCellMap = nsnull; // for now, will rebuild when needed -} - -/* call when column structure has changed. */ -void nsTablePart::ResetColumns () -{ - mSpecifiedColCount = -1; - if (nsnull != mCellMap) - { - int colCount = GetSpecifiedColumnCount (); - GrowCellMap (colCount); // make sure we're at least as big as specified columns - } - else - mColCount = 0; // we'll compute later (as part of building cell map) -} - -/** sum the columns represented by all nsTableColGroup objects - * if the cell map says there are more columns than this, - * add extra implicit columns to the content tree. - */ -void nsTablePart::EnsureColumns() -{ - if (nsnull!=mCellMap) - { - PRInt32 actualColumns = 0; - PRInt32 numColGroups = ChildCount(); - nsTableColGroup *lastColGroup = nsnull; - for (PRInt32 colGroupIndex = 0; colGroupIndex < numColGroups; colGroupIndex++) - { - nsTableContent *colGroup = (nsTableContent*)ChildAt(colGroupIndex); // colGroup: REFCNT++ - const int contentType = colGroup->GetType(); - if (contentType==nsTableContent::kTableColGroupType) - { - PRInt32 numCols = ((nsTableColGroup *)colGroup)->GetColumnCount(); - actualColumns += numCols; - lastColGroup = (nsTableColGroup *)colGroup; - NS_RELEASE(colGroup); - } - else if (contentType==nsTableContent::kTableRowGroupType) - { - NS_RELEASE(colGroup); - break; - } - } - if (actualColumns < mCellMap->GetColCount()) - { - if (nsnull==lastColGroup) - { - lastColGroup = new nsTableColGroup (PR_TRUE); - AppendColGroup(lastColGroup); - } - PRInt32 excessColumns = mCellMap->GetColCount() - actualColumns; - for ( ; excessColumns > 0; excessColumns--) - { - nsTableCol *col = new nsTableCol(PR_TRUE); - lastColGroup->AppendChild (col); - } - } - } -} - -/** - */ -void nsTablePart::ReorderChildren() -{ - NS_ASSERTION(PR_FALSE, "not yet implemented."); -} - -void nsTablePart::NotifyContentComplete() -{ - // set the children in order - ReorderChildren(); -} - -/** add a child to the table content. - * tables are special because they require the content to be normalized, in order. - * so this function doesn't really "append" the content, but adds it in the proper place, - * possibly nested inside of implicit parents. - * order is: - * Captions (optional) - * Column Groups (1 or more, possibly implicit) - * Row Groups - * THEADs (optional) - * TFOOTs (optional) - * TBODY (at least 1, possibly implicit) - * - * should be broken out into separate functions! - */ -PRBool nsTablePart::AppendChild (nsIContent * aContent) -{ - NS_PRECONDITION(nsnull!=aContent, "bad arg"); - PRBool result = PR_FALSE; - PRBool newCells = PR_FALSE; - PRBool contentHandled = PR_FALSE; - - // wait, stop! need to check to see if this is really tableContent or not! - nsITableContent *tableContentInterface = nsnull; - nsresult rv = aContent->QueryInterface(kITableContentIID, - (void **)&tableContentInterface); // tableContentInterface: REFCNT++ - if (NS_FAILED(rv)) - { // create an implicit cell and return the result of adding it to the table - if (gsDebug==PR_TRUE) - printf ("*** bad HTML in table, not yet implemented.\n"); - return PR_FALSE; - } - else - { - nsTableContent *tableContent = (nsTableContent *)tableContentInterface; - const int contentType = tableContent->GetType(); - if ((contentType == nsITableContent::kTableCellType) || - (contentType==nsITableContent::kTableRowType)) - { - if (gsDebug==PR_TRUE) - { - if (contentType == nsITableContent::kTableRowType) - printf ("nsTablePart::AppendChild -- adding a row.\n"); - else - printf ("nsTablePart::AppendChild -- adding a cell.\n"); - } - // find last row group, if ! implicit, make one, append there - nsTableRowGroup *group = nsnull; - int index = ChildCount (); - while ((0 < index) && (nsnull==group)) - { - nsIContent *child = ChildAt (--index); // child: REFCNT++ - if (nsnull != child) - { - nsTableContent * content = (nsTableContent *)child; - if (content->GetType()==nsITableContent::kTableRowGroupType) - { - group = (nsTableRowGroup *)content; - NS_ADDREF(group); // group: REFCNT++ - // SEC: this code might be a space leak for tables >1 row group - } - } - NS_RELEASE(child); // child: REFCNT-- - } - if ((nsnull == group) || (! group->IsImplicit ())) - { - if (gsDebug==PR_TRUE) printf ("nsTablePart::AppendChild -- creating an implicit row group.\n"); - nsIAtom * rowGroupTag = NS_NewAtom(kRowGroupBodyTagString); // rowGroupTag: REFCNT++ - group = new nsTableRowGroup (rowGroupTag, PR_TRUE); - NS_ADDREF(group); // group: REFCNT++ - AppendChild (group); - group->SetTable(this); - NS_RELEASE(rowGroupTag); // rowGroupTag: REFCNT-- - } - // group is guaranteed to be allocated at this point - result = group->AppendChild(aContent); - newCells = result; - contentHandled = PR_TRUE; - NS_RELEASE(group); // group: REFCNT-- - } - else if (contentType == nsITableContent::kTableColType) - { - result = AppendColumn((nsTableCol *)aContent); - newCells = result; - contentHandled = PR_TRUE; - } - else if (contentType == nsITableContent::kTableCaptionType) - { - result = AppendCaption((nsTableCaption *)aContent); - contentHandled = PR_TRUE; // whether we succeeded or not, we've "handled" this request - } - else if (contentType == nsITableContent::kTableRowGroupType) - { - result = AppendRowGroup((nsTableRowGroup *)aContent); - if (PR_TRUE==result) - { - newCells = PR_TRUE; - } - contentHandled = PR_TRUE; // whether we succeeded or not, we've "handled" this request - } - else if (contentType == nsITableContent::kTableColGroupType) - { - result = AppendColGroup((nsTableColGroup *)aContent); - if (PR_TRUE==result) - { - newCells = PR_TRUE; - } - contentHandled = PR_TRUE; // whether we succeeded or not, we've "handled" this request - } - - // Remember to set the table variable -- gpk - if (tableContentInterface) - tableContentInterface->SetTable(this); - - /* if aContent is not a known content type, make a capion out of it */ - // SEC the logic here is very suspicious!!!! - if (PR_FALSE==contentHandled) - { - if (gsDebug==PR_TRUE) printf ("nsTablePart::AppendChild -- content not handled!!!\n"); - nsTableCaption *caption = nsnull; - nsIContent *lastChild = ChildAt (ChildCount() - 1); // lastChild: REFCNT++ - if (nsnull != lastChild) - { - nsTableContent * content = (nsTableContent *)lastChild; - if (content->GetType()==nsITableContent::kTableCaptionType) - caption = (nsTableCaption *)content; - NS_RELEASE(lastChild); // lastChild: REFCNT-- - } - if ((nsnull == caption) || (! caption->IsImplicit ())) - { - if (gsDebug==PR_TRUE) printf ("nsTablePart::AppendChild -- adding an implicit caption.\n"); - caption = new nsTableCaption (PR_TRUE); - AppendCaption (caption); - } - result = caption->AppendChild (aContent); - } - /* if we added new cells, we need to fix up the cell map */ - if (newCells) - { - ResetCellMap (); - } - } - NS_RELEASE(tableContentInterface); // tableContentInterface: REFCNT-- - return result; -} - -/* SEC: why can we only insertChildAt (captions or groups) ? */ -PRBool nsTablePart::InsertChildAt(nsIContent * aContent, PRInt32 aIndex) -{ - NS_PRECONDITION(nsnull!=aContent, "bad arg"); - // aIndex checked in nsHTMLContainer - - PRBool result = PR_FALSE; - nsTableContent *tableContent = (nsTableContent *)aContent; - const int contentType = tableContent->GetType(); - if ((contentType == nsITableContent::kTableCaptionType) || - (contentType == nsITableContent::kTableColGroupType) || - (contentType == nsITableContent::kTableRowGroupType)) - { - result = nsHTMLContainer::InsertChildAt (aContent, aIndex); - if (result) - { - tableContent->SetTable (this); - ResetCellMap (); - } - } - return result; -} - -PRBool nsTablePart::ReplaceChildAt (nsIContent *aContent, PRInt32 aIndex) -{ - NS_PRECONDITION(nsnull!=aContent, "bad aContent arg to ReplaceChildAt"); - NS_PRECONDITION(0<=aIndex && aIndexGetType(); - if ( (contentType == nsITableContent::kTableCaptionType) || - (contentType == nsITableContent::kTableColGroupType) || - (contentType == nsITableContent::kTableRowGroupType)) - { - nsIContent *lastChild = ChildAt (aIndex);// lastChild: REFCNT++ - result = nsHTMLContainer::ReplaceChildAt (aContent, aIndex); - if (result) - { - if (nsnull != lastChild) - tableContent->SetTable (nsnull); - tableContent->SetTable (this); - ResetCellMap (); - } - NS_IF_RELEASE(lastChild); // lastChild: REFCNT-- - } - return result; -} - -/** - * Remove a child at the given position. The method is a no-op if - * the index is invalid (too small or too large). - */ -PRBool nsTablePart::RemoveChildAt (PRInt32 aIndex) -{ - NS_PRECONDITION(0<=aIndex && aIndexGetType(); - if (contentType == nsITableContent::kTableRowType) - { - if (nsnull != lastChild) - ((nsTableRow *)tableContent)->SetRowGroup (nsnull); - tableContent->SetTable(nsnull); - ResetCellMap (); - } - } - NS_IF_RELEASE(lastChild); - return result; -} - -/** protected method for appending a column group to this table */ -PRBool nsTablePart::AppendRowGroup (nsTableRowGroup *aContent) -{ - NS_PRECONDITION(nsnull!=aContent, "null arg."); - PRBool result = PR_TRUE; - if (gsDebug==PR_TRUE) - printf ("nsTablePart::AppendRowGroup -- adding a row group.\n"); - // find the last row group of this kind and insert this row group after it - // if there is no row group of this type already in the table, - // find the appropriate slot depending on this row group tag - nsIAtom * rowGroupTag = aContent->GetTag(); - int childCount = ChildCount (); - nsIAtom * tHeadTag = NS_NewAtom(kRowGroupHeadTagString); // tHeadTag: REFCNT++ - nsIAtom * tFootTag = NS_NewAtom(kRowGroupFootTagString); // tFootTag: REFCNT++ - nsIAtom * tBodyTag = NS_NewAtom(kRowGroupBodyTagString); // tBodyTag: REFCNT++ - for (PRInt32 childIndex = 0; childIndex < childCount; childIndex++) - { - nsTableContent *tableChild = (nsTableContent *)ChildAt(childIndex); // tableChild: REFCNT++ - const int tableChildType = tableChild->GetType(); - // if we've found caption or colgroup, then just skip it and keep going - if ((tableChildType == nsITableContent::kTableCaptionType) || - (tableChildType == nsITableContent::kTableColGroupType)) - { - NS_RELEASE(tableChild); // tableChild: REFCNT-- (a) - continue; - } - // if we've found a row group, our action depends on what kind of row group - else if (tableChildType == nsITableContent::kTableRowGroupType) - { - nsIAtom * tableChildTag = tableChild->GetTag(); - NS_RELEASE(tableChild); // tableChild: REFCNT-- (b) - // if aContent is a header and the current child is a header, keep going - if (tHeadTag==rowGroupTag && tHeadTag==tableChildTag) - { - continue; - } - // if aContent is a footer and the current child is either a header or a footer, keep going - else if (tFootTag==rowGroupTag && - (tHeadTag==tableChildTag || - tFootTag==tableChildTag)) - { - continue; - } - // if aContent is a body and the current child is a footer, stop, we've found the spot - else if (tBodyTag==rowGroupTag && tFootTag==tableChildTag) - { - continue; - } - // if aContent is a body and we've gotten this far, keep going - else if (tBodyTag==rowGroupTag) - { - continue; - } - // otherwise, we must have found the right spot so stop - else - { - break; - } - } - // otherwise we're already at the right spot, so stop - else - { - NS_RELEASE(tableChild); // tableChild: REFCNT-- (c) - break; - } - } - NS_RELEASE(tFootTag); - NS_RELEASE(tHeadTag); - NS_RELEASE(tBodyTag); - result = nsHTMLContainer::InsertChildAt(aContent, childIndex); - if (result) - ((nsTableContent *)aContent)->SetTable (this); - return result; -} - -/** protected method for appending a column group to this table */ -PRBool nsTablePart::AppendColGroup(nsTableColGroup *aContent) -{ - NS_PRECONDITION(nsnull!=aContent, "null arg."); - if (gsDebug==PR_TRUE) - printf ("nsTablePart::AppendColGroup -- adding a column group.\n"); - // find the last column group and insert this column group after it. - // if there is no column group already in the table, make this the first child - // after any caption - int childCount = ChildCount (); - for (PRInt32 childIndex = 0; childIndex < childCount; childIndex++) - { - nsTableContent *tableChild = (nsTableContent *)ChildAt(childIndex); // tableChild: REFCNT++ - const int tableChildType = tableChild->GetType(); - NS_RELEASE(tableChild); // tableChild: REFCNT-- - if (!((tableChildType == nsITableContent::kTableCaptionType) || - (tableChildType == nsITableContent::kTableColGroupType))) - break; - } - PRBool result = nsHTMLContainer::InsertChildAt(aContent, childIndex); - if (result) - { - ((nsTableContent *)aContent)->SetTable (this); - } - // if col group has a SPAN attribute, create implicit columns for the value of SPAN - // what sucks is if we then get a COL for this COLGROUP, we have to delete all the - // COLs we created for SPAN, and just contain the explicit COLs. - PRInt32 span = 0; // SEC: TODO find a way to really get this - for (PRInt32 i=0; iAppendChild (col); - } - - return result; -} - -/** protected method for appending a column group to this table */ -PRBool nsTablePart::AppendColumn(nsTableCol *aContent) -{ - NS_PRECONDITION(nsnull!=aContent, "null arg."); - if (gsDebug==PR_TRUE) - printf ("nsTablePart::AppendColumn -- adding a column.\n"); - // find last col group, if ! implicit, make one, append there - nsTableColGroup *group = nsnull; - PRBool foundColGroup = PR_FALSE; - int index = ChildCount (); - while ((0 < index) && (PR_FALSE==foundColGroup)) - { - nsIContent *child = ChildAt (--index); // child: REFCNT++ - if (nsnull != child) - { - group = (nsTableColGroup *)child; - foundColGroup = (PRBool) - (group->GetType()==nsITableContent::kTableColGroupType); - NS_RELEASE(child); // child: REFCNT-- - } - } - if ((PR_FALSE == foundColGroup) || (! group->IsImplicit ())) - { - if (gsDebug==PR_TRUE) - printf ("nsTablePart::AppendChild -- creating an implicit column group.\n"); - group = new nsTableColGroup (PR_TRUE); - AppendChild (group); - group->SetTable(this); - } - PRBool result = group->AppendChild (aContent); - return result; -} - -/** protected method for appending a column group to this table */ -PRBool nsTablePart::AppendCaption(nsTableCaption *aContent) -{ - NS_PRECONDITION(nsnull!=aContent, "null arg."); - if (gsDebug==PR_TRUE) - printf ("nsTablePart::AppendCaption -- adding a caption.\n"); - // find the last caption and insert this caption after it. - // if there is no caption already in the table, make this the first child - int childCount = ChildCount (); - for (PRInt32 childIndex = 0; childIndex < childCount; childIndex++) - { - nsTableContent *tableChild = (nsTableContent *)ChildAt(childIndex); - const int tableChildType = tableChild->GetType(); - NS_RELEASE(tableChild); - if (tableChildType != nsITableContent::kTableCaptionType) - break; - } - PRBool result = nsHTMLContainer::InsertChildAt(aContent, childIndex); - if (PR_TRUE==result) - { - ((nsTableContent *)aContent)->SetTable (this); - } - return result; -} - -/* return the index of the first row group after aStartIndex */ -PRInt32 nsTablePart::NextRowGroup (PRInt32 aStartIndex) -{ - int index = aStartIndex; - int count = ChildCount (); - - while (++index < count) - { - nsIContent * child = ChildAt (index); // child: REFCNT++ - nsTableContent *tableContent = (nsTableColGroup *)child; - const int contentType = tableContent->GetType(); - NS_RELEASE(child); // child: REFCNT-- - if (contentType == nsITableContent::kTableRowGroupType) - return index; - } - return count; -} - -// XXX This should be computed incrementally and updated -// automatically when rows are added/deleted. To do this, however, -// we need to change the way the ContentSink works and somehow -// notify this table when a row is modified. We can give the rows -// parent pointers, but that would bite. - -// XXX nuke this; instead pretend the content sink is working -// incrementally like we want it to and build up the data a row at a -// time. - -void nsTablePart::BuildCellMap () -{ - if (gsDebug==PR_TRUE) printf("Build Cell Map...\n"); - int rowCount = GetRowCount (); - if (0 == rowCount) - { - if (gsDebug==PR_TRUE) printf("0 row count. Returning.\n"); - mColCount = GetSpecifiedColumnCount (); // at least set known column count - EnsureColumns(); - return; - } - - // Make an educated guess as to how many columns we have. It's - // only a guess because we can't know exactly until we have - // processed the last row. - - int childCount = ChildCount (); - int groupIndex = NextRowGroup (-1); - if (0 == mColCount) - mColCount = GetSpecifiedColumnCount (); - if (0 == mColCount) // no column parts - { - nsTableRowGroup *rowGroup = (nsTableRowGroup*)(ChildAt (groupIndex)); // rowGroup: REFCNT++ - nsTableRow *row = (nsTableRow *)(rowGroup->ChildAt (0)); // row: REFCNT++ - mColCount = row->GetMaxColumns (); - if (gsDebug==PR_TRUE) printf("mColCount=0 at start. Guessing col count to be %d from a row.\n", mColCount); - NS_RELEASE(rowGroup); // rowGroup: REFCNT-- - NS_RELEASE(row); // row: REFCNT-- - } - if (nsnull==mCellMap) - mCellMap = new nsCellMap(rowCount, mColCount); - else - mCellMap->Reset(rowCount, mColCount); - if (gsDebug==PR_TRUE) printf("mCellMap set to (%d, %d)\n", rowCount, mColCount); - int rowStart = 0; - if (gsDebug==PR_TRUE) printf("childCount is %d\n", childCount); - while (groupIndex < childCount) - { - if (gsDebug==PR_TRUE) printf(" groupIndex is %d\n", groupIndex); - if (gsDebug==PR_TRUE) printf(" rowStart is %d\n", rowStart); - nsTableRowGroup *rowGroup = (nsTableRowGroup *)ChildAt (groupIndex); // rowGroup: REFCNT++ - int groupRowCount = rowGroup->ChildCount (); - if (gsDebug==PR_TRUE) printf(" groupRowCount is %d\n", groupRowCount); - for (int rowIndex = 0; rowIndex < groupRowCount; rowIndex++) - { - nsTableRow *row = (nsTableRow *)(rowGroup->ChildAt (rowIndex)); // row: REFCNT++ - int cellCount = row->ChildCount (); - int cellIndex = 0; - int colIndex = 0; - if (gsDebug==PR_TRUE) - DumpCellMap(); - if (gsDebug==PR_TRUE) printf(" rowIndex is %d, row->SetRowIndex(%d)\n", rowIndex, rowIndex + rowStart); - row->SetRowIndex (rowIndex + rowStart); - while (colIndex < mColCount) - { - if (gsDebug==PR_TRUE) printf(" colIndex = %d, with mColCount = %d\n", colIndex, mColCount); - CellData *data =mCellMap->GetCellAt(rowIndex + rowStart, colIndex); - if (nsnull == data) - { - if (gsDebug==PR_TRUE) printf(" null data from GetCellAt(%d,%d)\n", rowIndex+rowStart, colIndex); - if (gsDebug==PR_TRUE) printf(" cellIndex=%d, cellCount=%d)\n", cellIndex, cellCount); - if (cellIndex < cellCount) - { - nsTableCell* cell = (nsTableCell *) row->ChildAt (cellIndex); // cell: REFCNT++ - if (gsDebug==PR_TRUE) printf(" calling BuildCellIntoMap(cell, %d, %d), and incrementing cellIndex\n", rowIndex + rowStart, colIndex); - BuildCellIntoMap (cell, rowIndex + rowStart, colIndex); - NS_RELEASE(cell); // cell: REFCNT-- - cellIndex++; - } - } - colIndex++; - } - - if (cellIndex < cellCount) - { - // We didn't use all the cells in this row up. Grow the cell - // data because we now know that we have more columns than we - // originally thought we had. - if (gsDebug==PR_TRUE) printf(" calling GrowCellMap because cellIndex < %d\n", cellIndex, cellCount); - GrowCellMap (cellCount); - while (cellIndex < cellCount) - { - if (gsDebug==PR_TRUE) printf(" calling GrowCellMap again because cellIndex < %d\n", cellIndex, cellCount); - GrowCellMap (colIndex + 1); // ensure enough cols in map, may be low due to colspans - CellData *data =mCellMap->GetCellAt(rowIndex + rowStart, colIndex); - if (data == nsnull) - { - nsTableCell* cell = (nsTableCell *) row->ChildAt (cellIndex); // cell: REFCNT++ - BuildCellIntoMap (cell, rowIndex + rowStart, colIndex); - cellIndex++; - NS_RELEASE(cell); // cell: REFCNT-- - } - colIndex++; - } - } - NS_RELEASE(row); // row: REFCNT-- - } - NS_RELEASE(rowGroup); // rowGroup: REFCNT-- - rowStart += groupRowCount; - groupIndex = NextRowGroup (groupIndex); - } - if (gsDebug==PR_TRUE) - DumpCellMap (); - EnsureColumns(); -} - -/** - */ -void nsTablePart::DumpCellMap () const -{ - printf("dumping CellMap:\n"); - if (nsnull != mCellMap) - { - int rowCount = mCellMap->GetRowCount(); - int cols = mCellMap->GetColCount(); - for (int r = 0; r < rowCount; r++) - { - if (gsDebug==PR_TRUE) - { printf("row %d", r); - printf(": "); - } - for (int c = 0; c < cols; c++) - { - CellData *cd =mCellMap->GetCellAt(r, c); - if (cd != nsnull) - { - if (cd->mCell != nsnull) - { - printf("C%d,%d ", r, c); - printf(" "); - } - else - { - nsTableCell *cell = cd->mRealCell->mCell; - nsTableRow *row = cell->GetRow(); - int rr = row->GetRowIndex (); - int cc = cell->GetColIndex (); - printf("S%d,%d ", rr, cc); - if (cd->mOverlap != nsnull) - { - cell = cd->mOverlap->mCell; - nsTableRow* row2 = cell->GetRow(); - rr = row2->GetRowIndex (); - cc = cell->GetColIndex (); - printf("O%d,%c ", rr, cc); - NS_RELEASE(row2); - } - else - printf(" "); - NS_RELEASE(row); - } - } - else - printf("---- "); - } - printf("\n"); - } - } - else - printf ("[nsnull]"); -} - -void nsTablePart::BuildCellIntoMap (nsTableCell *aCell, PRInt32 aRowIndex, PRInt32 aColIndex) -{ - NS_PRECONDITION (nsnull!=aCell, "bad cell arg"); - NS_PRECONDITION (aColIndex < mColCount, "bad column index arg"); - NS_PRECONDITION (aRowIndex < GetRowCount(), "bad row index arg"); - - // Setup CellMap for this cell - int rowSpan = GetEffectiveRowSpan (aRowIndex, aCell); - int colSpan = aCell->GetColSpan (); - if (gsDebug==PR_TRUE) printf(" BuildCellIntoMap. rowSpan = %d, colSpan = %d\n", rowSpan, colSpan); - - // Grow the mCellMap array if we will end up addressing - // some new columns. - if (mColCount < (aColIndex + colSpan)) - { - if (gsDebug==PR_TRUE) printf(" mColCount=%dmCell = aCell; - data->mRealCell = data; - if (gsDebug==PR_TRUE) printf(" calling mCellMap->SetCellAt(data, %d, %d)\n", aRowIndex, aColIndex); - mCellMap->SetCellAt(data, aRowIndex, aColIndex); - aCell->SetColIndex (aColIndex); - - // Create CellData objects for the rows that this cell spans. Set - // their mCell to nsnull and their mRealCell to point to data. If - // there were no column overlaps then we could use the same - // CellData object for each row that we span... - if ((1 < rowSpan) || (1 < colSpan)) - { - if (gsDebug==PR_TRUE) printf(" spans\n"); - for (int rowIndex = 0; rowIndex < rowSpan; rowIndex++) - { - if (gsDebug==PR_TRUE) printf(" rowIndex = %d\n", rowIndex); - int workRow = aRowIndex + rowIndex; - if (gsDebug==PR_TRUE) printf(" workRow = %d\n", workRow); - for (int colIndex = 0; colIndex < colSpan; colIndex++) - { - if (gsDebug==PR_TRUE) printf(" colIndex = %d\n", colIndex); - int workCol = aColIndex + colIndex; - if (gsDebug==PR_TRUE) printf(" workCol = %d\n", workCol); - CellData *testData = mCellMap->GetCellAt(workRow, workCol); - if (nsnull == testData) - { - CellData *spanData = new CellData (); - spanData->mRealCell = data; - if (gsDebug==PR_TRUE) printf(" null GetCellAt(%d, %d) so setting to spanData\n", workRow, workCol); - mCellMap->SetCellAt(spanData, workRow, workCol); - } - else if ((0 < rowIndex) || (0 < colIndex)) - { // we overlap, replace existing data, it might be shared - if (gsDebug==PR_TRUE) printf(" overlapping Cell from GetCellAt(%d, %d) so setting to spanData\n", workRow, workCol); - CellData *overlap = new CellData (); - overlap->mCell = testData->mCell; - overlap->mRealCell = testData->mRealCell; - overlap->mOverlap = data; - mCellMap->SetCellAt(overlap, workRow, workCol); - } - } - } - } -} - -void nsTablePart::GrowCellMap (PRInt32 aColCount) -{ - if (nsnull!=mCellMap) - { - if (mColCount < aColCount) - { - mCellMap->GrowTo(aColCount); - } - mColCount = aColCount; - } -} - -PRInt32 nsTablePart::GetEffectiveRowSpan (PRInt32 aRowIndex, nsTableCell *aCell) -{ - NS_PRECONDITION (nsnull!=aCell, "bad cell arg"); - NS_PRECONDITION (0<=aRowIndex && aRowIndexGetRowSpan (); - int rowCount = GetRowCount (); - if (rowCount < (aRowIndex + rowSpan)) - return (rowCount - aRowIndex); - return rowSpan; -} - - -/** - * Create a frame object that will layout this table. - */ -nsIFrame* nsTablePart::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv; - nsresult status = nsTableOuterFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - return rv; -} - -void nsTablePart::SetAttribute(nsIAtom* aAttribute, const nsString& aValue) -{ - nsHTMLValue val; - - if (aAttribute == nsHTMLAtoms::width) - { - ParseValueOrPercent(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - } - else if ( aAttribute == nsHTMLAtoms::border) - { - nsHTMLValue val; - nsAutoString tmp(aValue); - tmp.StripWhitespace(); - if (0 == tmp.Length()) { - // Just enable the border; same as border=1 - val.Set(1, eHTMLUnit_Absolute);/* XXX pixels? */ - } - else - { - ParseValue(aValue, 1, val); - } - nsHTMLTagContent::SetAttribute(aAttribute, val); - } - else if (aAttribute == nsHTMLAtoms::cellspacing || - aAttribute == nsHTMLAtoms::cellpadding) - { - ParseValue(aValue, 0, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } - else if (aAttribute == nsHTMLAtoms::bgcolor) - { - ParseColor(aValue, val); - nsHTMLTagContent::SetAttribute(aAttribute, val); - return; - } -} - -void nsTablePart::MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext) -{ - NS_PRECONDITION(nsnull!=aContext, "bad style context arg"); - NS_PRECONDITION(nsnull!=aPresContext, "bad presentation context arg"); - - float p2t; - nsHTMLValue value; - - // width - GetAttribute(nsHTMLAtoms::width, value); - if (value.GetUnit() != eHTMLUnit_Null) { - nsStylePosition* position = (nsStylePosition*) - aContext->GetData(kStylePositionSID); - switch (value.GetUnit()) { - case eHTMLUnit_Percent: - position->mWidthFlags = NS_STYLE_POSITION_VALUE_PERCENT; - position->mWidth = 0;/* XXX need a float to store into */ - break; - - case eHTMLUnit_Absolute: - p2t = aPresContext->GetPixelsToTwips(); - position->mWidthFlags = NS_STYLE_POSITION_VALUE_LENGTH; - position->mWidth = nscoord(p2t * value.GetIntValue()); - break; - } - } - - // border - GetTableBorder(this, aContext, aPresContext, PR_FALSE); -} - -void nsTablePart::GetTableBorder(nsIHTMLContent* aContent, - nsIStyleContext* aContext, - nsIPresContext* aPresContext, - PRBool aForCell) -{ - NS_PRECONDITION(nsnull!=aContent, "bad content arg"); - NS_PRECONDITION(nsnull!=aContext, "bad style context arg"); - NS_PRECONDITION(nsnull!=aPresContext, "bad presentation context arg"); - - nsHTMLValue value; - - aContent->GetAttribute(nsHTMLAtoms::border, value); - if (value.GetUnit() == eHTMLUnit_Absolute) { - nsStyleBorder* border = (nsStyleBorder*) - aContext->GetData(kStyleBorderSID); - nsStyleSpacing* spacing = (nsStyleSpacing*) - aContext->GetData(kStyleSpacingSID); - float p2t = aPresContext->GetPixelsToTwips(); - nscoord twips = aForCell - ? NS_TO_INT_ROUND(1 * p2t) - : NS_TO_INT_ROUND(value.GetIntValue() * p2t); - nscoord two = NS_TO_INT_ROUND(2 * p2t); - -#if 0 - // XXX do I need to do this or can I assert that it's zero? - spacing->mBorderPadding.top -= spacing->mBorder.top; - spacing->mBorderPadding.right -= spacing->mBorder.right; - spacing->mBorderPadding.bottom -= spacing->mBorder.bottom; - spacing->mBorderPadding.left -= spacing->mBorder.left; -#endif - - spacing->mBorder.top = twips; - spacing->mBorder.right = twips; - spacing->mBorder.bottom = twips; - spacing->mBorder.left = twips; - - spacing->mPadding.top = two; - spacing->mPadding.right = two; - spacing->mPadding.bottom = two; - spacing->mPadding.left = two; - - spacing->mBorderPadding.top += twips + two; - spacing->mBorderPadding.right += twips + two; - spacing->mBorderPadding.bottom += twips + two; - spacing->mBorderPadding.left += twips + two; - - border->mSize.top = twips; - border->mSize.right = twips; - border->mSize.bottom = twips; - border->mSize.left = twips; - - if (border->mStyle[0] == NS_STYLE_BORDER_STYLE_NONE) { - border->mStyle[0] = NS_STYLE_BORDER_STYLE_SOLID; - } - if (border->mStyle[1] == NS_STYLE_BORDER_STYLE_NONE) { - border->mStyle[1] = NS_STYLE_BORDER_STYLE_SOLID; - } - if (border->mStyle[2] == NS_STYLE_BORDER_STYLE_NONE) { - border->mStyle[2] = NS_STYLE_BORDER_STYLE_SOLID; - } - if (border->mStyle[3] == NS_STYLE_BORDER_STYLE_NONE) { - border->mStyle[3] = NS_STYLE_BORDER_STYLE_SOLID; - } - } -} - -/* ---------- Global Functions ---------- */ - -/** - */ -nsresult -NS_NewTablePart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* table = new nsTablePart(aTag); - if (nsnull == table) { - return NS_ERROR_OUT_OF_MEMORY; - } - return table->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} - diff --git a/mozilla/layout/html/table/src/nsTablePart.h b/mozilla/layout/html/table/src/nsTablePart.h deleted file mode 100644 index ebf4eb53cf6..00000000000 --- a/mozilla/layout/html/table/src/nsTablePart.h +++ /dev/null @@ -1,234 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTablePart_h___ -#define nsTablePart_h___ - - -// nsTablePart.h -#include "nsHTMLContainer.h" - -// forward declarations -class nsTableCell; -class nsCellMap; -class nsTableRowGroup; -class nsTableColGroup; -class nsTableCol; -class nsTableCaption; - -/** Data stored by nsCellMap to rationalize rowspan and colspan cells. - * if mCell is null then mRealCell will be the rowspan/colspan source - * in addition, if fOverlap is non-null then it will point to the - * other cell that overlaps this position - * @see nsCellMap - * @see nsTablePart::BuildCellMap - * @see nsTablePart::GrowCellMap - * @see nsTablePart::BuildCellIntoMap - * - */ -class CellData -{ -public: - nsTableCell *mCell; - CellData *mRealCell; - CellData *mOverlap; - - CellData(); - - ~CellData(); -}; - -/** - * Table Content Model. - * We build a full rationalized content model, so the structure of a table - * will always be regular and predictable. - * A Table can contain RowGroups (THEAD, TBODY, TFOOT), ColumnGroups (COLGROUP), - * and Captions (CAPTION). Any other table content (TH, TD, COL) belongs in - * one of these containers, and if the container doesn't explicitly exist in - * the source, an implicit container will get created. - * - * @author sclark - */ -class nsTablePart : public nsHTMLContainer { - -public: - - /** known HTML tags */ - static const char *nsTablePart::kCaptionTagString; - static const char *nsTablePart::kRowGroupBodyTagString; - static const char *nsTablePart::kRowGroupHeadTagString; - static const char *nsTablePart::kRowGroupFootTagString; - static const char *nsTablePart::kRowTagString; - static const char *nsTablePart::kColGroupTagString; - static const char *nsTablePart::kColTagString; - static const char *nsTablePart::kDataCellTagString; - static const char *nsTablePart::kHeaderCellTagString; - - /** constructor - * @param aTag the HTML tag that caused this content node to be instantiated - */ - nsTablePart(nsIAtom* aTag); - - /** constructor - * @param aTag the HTML tag that caused this content node to be instantiated - * @param aColumnCount the number of columns in this table - */ - nsTablePart(nsIAtom* aTag, PRInt32 aColumnCount); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); - - virtual void MapAttributesInto(nsIStyleContext* aContext, - nsIPresContext* aPresContext); - -/* public Table methods */ - - /** ResetCellMap is called when the cell structure of the table is changed. - * Call with caution, only when changing the structure of the table such as - * inserting or removing rows, changing the rowspan or colspan attribute of a cell, etc. - */ - virtual void ResetCellMap (); - - /** ResetColumns is called when the column structure of the table is changed. - * Call with caution, only when adding or removing columns, changing - * column attributes, changing the rowspan or colspan attribute of a cell, etc. - */ - virtual void ResetColumns (); - - /** sum the columns represented by all nsTableColGroup objects. - * if the cell map says there are more columns than this, - * add extra implicit columns to the content tree. - */ - virtual void EnsureColumns (); - - /** return the number of columns as specified by the input. - * has 2 side effects:
    - * calls SetStartColumnIndex on each nsTableColumn
    - * sets mSpecifiedColCount.
    - */ - virtual PRInt32 GetSpecifiedColumnCount (); - - /** returns the number of rows in this table. - * if mCellMap has been created, it is asked for the number of rows.
    - * otherwise, the content is enumerated and the rows are counted. - */ - virtual PRInt32 GetRowCount(); - - /** returns the actual number of columns in this table.
    - * as a side effect, will call BuildCellMap to constuct mCellMap if needed. - */ - virtual PRInt32 GetMaxColumns(); - - -/* overrides from nsHTMLContainer */ - - virtual PRBool InsertChildAt(nsIContent* aKid, PRInt32 aIndex); - virtual PRBool ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex); - virtual PRBool AppendChild(nsIContent* aKid); - virtual PRBool RemoveChildAt(PRInt32 aIndex); - - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** called when the input stream knows that the input has been completely consumed. - * this is a hook for future optimizations. - */ - virtual void NotifyContentComplete(); - - static void GetTableBorder(nsIHTMLContent* aContent, - nsIStyleContext* aContext, - nsIPresContext* aPresContext, - PRBool aForCell); - -protected: - /** destructor - * deletes mCellMap, if allocated. - */ - virtual ~nsTablePart(); - - /** return the row span of a cell, taking into account row span magic at the bottom - * of a table. - * @param aRowIndex the first row that contains the cell - * @param aCell the content object representing the cell - * @return the row span, correcting for row spans that extend beyond the bottom - * of the table. - */ - virtual PRInt32 GetEffectiveRowSpan(PRInt32 aRowIndex, nsTableCell *aCell); - - /** build as much of the CellMap as possible from the info we have so far - */ - virtual void BuildCellMap (); - - /** called whenever the number of columns changes, to increase the storage in mCellMap - */ - virtual void GrowCellMap(PRInt32 aColCount); - - /** called every time we discover we have a new cell to add to the table. - * This could be because we got actual cell content, because of rowspan/colspan attributes, etc. - * This method changes mCellMap as necessary to account for the new cell. - * - * @param aCell the content object created for the cell - * @param aRowIndex the row into which the cell is to be inserted - * @param aColIndex the col into which the cell is to be inserted - */ - virtual void BuildCellIntoMap (nsTableCell *aCell, PRInt32 aRowIndex, PRInt32 aColIndex); - - /** returns the index of the first child after aStartIndex that is a row group - */ - virtual PRInt32 NextRowGroup (PRInt32 aStartIndex); - - /** obsolete! */ - virtual void ReorderChildren(); - - /** append aContent to my child list - * @return PR_TRUE on success, PR_FALSE if aContent could not be appended - */ - virtual PRBool AppendRowGroup(nsTableRowGroup *aContent); - - /** append aContent to my child list - * @return PR_TRUE on success, PR_FALSE if aContent could not be appended - */ - virtual PRBool AppendColGroup(nsTableColGroup *aContent); - - /** append aContent to my child list - * @return PR_TRUE on success, PR_FALSE if aContent could not be appended - */ - virtual PRBool AppendColumn(nsTableCol *aContent); - - /** append aContent to my child list - * @return PR_TRUE on success, PR_FALSE if aContent could not be appended - */ - virtual PRBool AppendCaption(nsTableCaption *aContent); - - -public: - virtual void DumpCellMap() const; - virtual nsCellMap* GetCellMap() const; - -private: - - PRInt32 mColCount; - PRInt32 mSpecifiedColCount; - nsCellMap* mCellMap; - static nsIAtom *kDefaultTag; -}; - -#endif // nsTablePart_h___ diff --git a/mozilla/layout/html/table/src/nsTableRow.cpp b/mozilla/layout/html/table/src/nsTableRow.cpp deleted file mode 100644 index 9e215daed96..00000000000 --- a/mozilla/layout/html/table/src/nsTableRow.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableRow.h" -#include "nsTableRowFrame.h" -#include "nsTableRowGroup.h" -#include "nsTableCell.h" -#include "nsTableFrame.h" -#include "nsCellLayoutData.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsTableRowFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIContentDelegate.h" -#include "nsHTMLIIDs.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - -// nsTableContent checks aTag -nsTableRow::nsTableRow(nsIAtom* aTag) - : nsTableContent(aTag), - mRowGroup(0), - mRowIndex(0) -{ -} - -// nsTableContent checks aTag -nsTableRow::nsTableRow(nsIAtom* aTag, PRBool aImplicit) - : nsTableContent(aTag), - mRowGroup(0), - mRowIndex(0) -{ - mImplicit = aImplicit; -} - -nsTableRow::~nsTableRow() -{ -} - -int nsTableRow::GetType() -{ - return nsITableContent::kTableRowType; -} - -nsTableRowGroup * nsTableRow::GetRowGroup () -{ - NS_IF_ADDREF(mRowGroup); - return mRowGroup; -} - -void nsTableRow::SetRowGroup (nsTableRowGroup * aRowGroup) -{ - if (aRowGroup != mRowGroup) - { - mRowGroup = aRowGroup; - } -} - -PRInt32 nsTableRow::GetRowIndex () -{ - NS_PRECONDITION(0<=mRowIndex, "bad mRowIndex"); - return mRowIndex; -} - -void nsTableRow::SetRowIndex (int aRowIndex) -{ - mRowIndex = aRowIndex; -} - -// Added for debuging purposes -- remove from final build -nsrefcnt nsTableRow::AddRef(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Add Ref: %x, nsTableRow cnt = %d \n",this, mRefCnt+1); - return ++mRefCnt; -} - -nsrefcnt nsTableRow::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) printf("Release: %x, nsTableRow cnt = %d \n",this,mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: %x, nsTableRow \n",this); - delete this; - return 0; - } - return mRefCnt; -} - -PRInt32 nsTableRow::GetMaxColumns() -{ - int sum = 0; - for (int i = 0, n = ChildCount(); i < n; i++) { - nsTableCell *cell = (nsTableCell *) ChildAt(i); // cell: REFCNT++ - sum += cell->GetColSpan(); - NS_RELEASE(cell); // cell: REFCNT-- - } - return sum; -} - -void nsTableRow::ResetCellMap () -{ - if (nsnull != mRowGroup) - { - mRowGroup->ResetCellMap (); - } -} - -PRBool nsTableRow::AppendChild (nsIContent *aContent) -{ - NS_PRECONDITION(nsnull != aContent, "null ptr"); - PRBool result = PR_FALSE; - if (nsnull!=aContent) - { - // SEC: should verify that it is indeed table content before we do the cast - nsTableContent *tableContent = (nsTableContent *)aContent; - const int contentType = tableContent->GetType(); - if (contentType != nsITableContent::kTableCellType) - { - if (gsDebug==PR_TRUE) printf ("nsTableRow::AppendChild -- didn't get a cell, giving up to parent.\n"); - if (nsnull != mRowGroup) - return mRowGroup->AppendChild (aContent); // let parent have it - return PR_FALSE; - } - else - { - PRBool result = nsTableContent::AppendChild (aContent); - if (result) - { - ((nsTableCell *)aContent)->SetRow (this); - ResetCellMap (); - } - } - } - return result; -} - -PRBool nsTableRow::InsertChildAt (nsIContent *aContent, int aIndex) -{ - NS_PRECONDITION(nsnull != aContent, "null ptr"); - PRBool result = PR_FALSE; - if (nsnull!=aContent) - { - nsTableContent *tableContent = (nsTableContent *)aContent; - const int contentType = tableContent->GetType(); - if (contentType != nsITableContent::kTableCellType) - { - return PR_FALSE; - } - else - { - PRBool result = nsTableContent::InsertChildAt (aContent, aIndex); - if (result) - { - ((nsTableCell *)aContent)->SetRow (this); - ResetCellMap (); - } - } - } - return result; -} - - -PRBool nsTableRow::ReplaceChildAt (nsIContent *aContent, int aIndex) -{ - PRBool result = PR_FALSE; - - NS_PRECONDITION(nsnull!=aContent, "bad aContent arg to ReplaceChildAt"); - NS_PRECONDITION(0<=aIndex && aIndexGetType(); - if (contentType != nsITableContent::kTableCellType) - { - return PR_FALSE; - } - else - return PR_FALSE; - nsIContent * oldChild = ChildAt (aIndex); // oldChild: REFCNT++ - result = nsTableContent::ReplaceChildAt (aContent, aIndex); - if (result) - { - ((nsTableCell *)aContent)->SetRow (this); - if (nsnull!=oldChild) - ((nsTableCell *)oldChild)->SetRow (nsnull); - ResetCellMap (); - } - NS_IF_RELEASE(oldChild); // oldChild: REFCNT-- - } - return result; -} - -/** - * Remove a child at the given position. The method is ignored if - * the index is invalid (too small or too large). - */ -PRBool nsTableRow::RemoveChildAt (int aIndex) -{ - NS_PRECONDITION(0<=aIndex && aIndexSetRow (nsnull); - ResetCellMap (); - } - } - NS_IF_RELEASE(oldChild); // oldChild: REFCNT-- - return result; -} - -// nsTableRowFrame checks args -nsIFrame* nsTableRow::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv; - nsresult status = nsTableRowFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - return rv; -} - -/* ---------- Global Functions ---------- */ - -nsresult -NS_NewTableRowPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new nsTableRow(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/table/src/nsTableRow.h b/mozilla/layout/html/table/src/nsTableRow.h deleted file mode 100644 index a31cfba62a0..00000000000 --- a/mozilla/layout/html/table/src/nsTableRow.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableRow_h__ -#define nsTableRow_h__ - -#include "nscore.h" -#include "nsTableContent.h" -#include "nsTableRowGroup.h" - - -/** - * nsTableRow is the content object that represents table rows - * (HTML tag TR). This class cannot be reused - * outside of an nsTableRowGroup. It assumes that its parent is an nsTableRowGroup, and - * its children are nsTableCells. - * - * @see nsTablePart - * @see nsTableRowGroup - * @see nsTableCell - * - * @author sclark - */ -class nsTableRow : public nsTableContent -{ - -private: - /** parent pointer */ - nsTableRowGroup * mRowGroup; - - /** the index of the row this content object represents */ - PRInt32 mRowIndex; - -public: - - /** constructor - * @param aTag the HTML tag causing this row to get constructed. - */ - nsTableRow (nsIAtom* aTag); - - /** constructor - * @param aTag the HTML tag causing this row to get constructed. - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this row. - */ - nsTableRow (nsIAtom* aTag, PRBool aImplicit); - - /** destructor, not responsible for any memory destruction itself */ - virtual ~nsTableRow(); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - /** returns nsITableContent::kTableRowType */ - virtual int GetType(); - - /** @see nsIHTMLContent::CreateFrame */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** return the row group that contains me (my parent) */ - virtual nsTableRowGroup *GetRowGroup (); - - - /** Set my parent row group.
    - * NOTE: Since mRowGroup is the parent of the table row, - * reference counting should not be done on - * this variable when setting the row. - * see /ns/raptor/doc/MemoryModel.html - **/ - virtual void SetRowGroup (nsTableRowGroup * aRowGroup); - - /** return this row's starting row index */ - virtual PRInt32 GetRowIndex (); - - /** set this row's starting row index */ - virtual void SetRowIndex (int aRowIndex); - - /** return the number of columns represented by the cells in this row */ - virtual PRInt32 GetMaxColumns(); - - /** notify the containing nsTablePart that cell information has changed */ - virtual void ResetCellMap (); - - /* ----------- nsTableContent overrides ----------- */ - - /** can only append objects that are cells (implement nsITableContent and are . - * of type nsITableContent::kTableCellType.) - * @see nsIContent::AppendChild - */ - virtual PRBool AppendChild (nsIContent * aContent); - - /** can only insert objects that are cells (implement nsITableContent and are . - * of type nsITableContent::kTableCellType.) - * @see nsIContent::InsertChildAt - */ - virtual PRBool InsertChildAt (nsIContent * aContent, int aIndex); - - /** can only replace child objects with objects that are cells - * (implement nsITableContent and are * of type nsITableContent::kTableCellType.) - * @param aContent the object to insert, must be a cell - * @param aIndex the index of the object to replace. Must be in the range - * 0<=aIndex1) - nscoord maxCellHeight; - - nsTableFrame *tableFrame; - - - RowReflowState( nsIPresContext* aPresContext, - const nsSize& aMaxSize) - { - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - x=0; - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - maxCellHeight=0; - tableFrame = nsnull; - } - - ~RowReflowState() { - } -}; - - - - -/* ----------- nsTableRowpFrame ---------- */ - -nsTableRowFrame::nsTableRowFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mTallestCell(0) -{ -} - -nsTableRowFrame::~nsTableRowFrame() -{ -} - -void nsTableRowFrame::ResetMaxChildHeight() -{ - mTallestCell=0; -} - -void nsTableRowFrame::SetMaxChildHeight(PRInt32 aChildHeight) -{ - if (mTallestCellGetView(pView); - if (nsnull == pView) { - nsRect kidRect; - kid->GetRect(kidRect); - nsRect damageArea(aDirtyRect); - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - aRenderingContext.PushState(); - aRenderingContext.Translate(kidRect.x, kidRect.y); - kid->Paint(aPresContext, aRenderingContext, kidDamageArea); - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, kidRect.width, kidRect.height); - } - aRenderingContext.PopState(); - } else { - NS_RELEASE(pView); - } - kid->GetNextSibling(kid); - } -} - - -/** returns the tallest child in this row (ignoring any cell with rowspans) */ -PRInt32 nsTableRowFrame::GetTallestChild() const -{ - return mTallestCell; -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableRowFrame::GetTopMarginFor( nsIPresContext* aCX, - RowReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableRowFrame::PlaceChild(nsIPresContext* aPresContext, - RowReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug1) - printf ("row: placing cell at %d, %d, %d, %d\n", - aKidRect.x, aKidRect.y, aKidRect.width, aKidRect.height); - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Update the maximum element size - PRInt32 rowSpan = ((nsTableCellFrame*)aKidFrame)->GetRowSpan(); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width += aKidMaxElementSize.width; - if ((1==rowSpan) && (aKidMaxElementSize.height>aMaxElementSize->height)) - { - aMaxElementSize->height = aKidMaxElementSize.height; - } - } - if ((1==rowSpan) && (aState.maxCellHeightmFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool lastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsIContent* cell = nsnull; - kidFrame->GetContent(cell); // cell: REFCNT++ - nsSize kidAvailSize(aState.availSize); - if (0>=kidAvailSize.height) - kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIStyleContext* kidSC; - kidFrame->GetStyleContext(aPresContext, kidSC); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - NS_RELEASE(kidSC); - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width -= kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - if (NS_UNCONSTRAINEDSIZE == aState.availSize.width) - { - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - nsCellLayoutData kidLayoutData((nsTableCellFrame *)kidFrame, &desiredSize, pKidMaxElementSize); - aState.tableFrame->SetCellLayoutData(&kidLayoutData, (nsTableCell *)cell); - } - else - { // we're in a constrained situation, so get the avail width from the known column widths - nsCellLayoutData *cellData = aState.tableFrame->GetCellLayoutData((nsTableCell *)cell); - PRInt32 cellStartingCol = ((nsTableCell *)cell)->GetColIndex(); - PRInt32 cellColSpan = ((nsTableCell *)cell)->GetColSpan(); - nscoord availWidth = 0; - for (PRInt32 numColSpan=0; numColSpanGetColumnWidth(cellStartingCol+numColSpan); -// NS_ASSERTION(0width, pKidMaxElementSize->height); - else - printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", - desiredSize.width, desiredSize.height); - } - } - NS_RELEASE(cell); // cell: REFCNT-- - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (desiredSize.height > kidAvailSize.height))) - { - // The child's height is too big to fit at all in our remaining space, - // and it's not our first child. - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete, too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - // Our mLastContentIsComplete was already set by the last kid we - // reflowed reflow's status - result = PR_FALSE; - break; - } - - // Adjust the running x-offset, taking into account intruders (cells from prior rows with rowspans > 1) - aState.x = 0; - PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex(); - for (PRInt32 colIndex=0; colIndexGetColumnWidth(colIndex); - // Place the child after taking into account it's margin - nsRect kidRect (aState.x, topMargin, desiredSize.width, desiredSize.height); - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, - kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - /* Rows should not create continuing frames for cells - * unless they absolutely have to! - * check to see if this is absolutely necessary (with new params from troy) - * otherwise PushChildren and bail. - */ - // Special handling for incomplete children - if (frNotComplete == status) { - // XXX It's good to assume that we might still have room - // even if the child didn't complete (floaters will want this) - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // No the child isn't complete, and it doesn't have a next in flow so - // create a continuing frame. This hooks the child into the flow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Insert the frame. We'll reflow it next pass through the loop - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Add back in the left and right margins, because one row does not - // impact another row's width - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width += kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - } - - SetMaxChildHeight(aState.maxCellHeight); // remember height of tallest child who doesn't have a row span - - // Update the child count - mChildCount = childCount; - -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); -#endif - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowFrame* flow = (nsTableRowFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowFrame* flow = (nsTableRowFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableRowFrame* nextInFlow = (nsTableRowFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - nsSize kidAvailSize(aState.availSize); -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics desiredSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list -// NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - - if ((kidFrameSize.height > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - nsIContent *cell = nsnull; - kidFrame->GetContent(cell); // cell: REFNCT++ - // we're in a constrained situation, so get the avail width from the known column widths - nsCellLayoutData *cellData = aState.tableFrame->GetCellLayoutData((nsTableCell *)cell); - PRInt32 cellStartingCol = ((nsTableCell *)cell)->GetColIndex(); - PRInt32 cellColSpan = ((nsTableCell *)cell)->GetColSpan(); - nscoord availWidth = 0; - for (PRInt32 numColSpan=0; numColSpanGetColumnWidth(cellStartingCol+numColSpan); - NS_ASSERTION(0width, pKidMaxElementSize->height); - else - printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", - desiredSize.width, desiredSize.height); - } - } - NS_RELEASE(cell); // cell: REFCNT-- - - // Did the child fit? - if ((desiredSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too tall to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Adjust the running x-offset, taking into account intruders (cells from prior rows with rowspans > 1) - aState.x = 0; - PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex(); - for (PRInt32 colIndex=0; colIndexGetColumnWidth(colIndex); - // Place the child - //nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidMol); - nsRect kidRect (aState.x, 0, desiredSize.width, desiredSize.height); - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableRowFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowFrame* flow = (nsTableRowFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsTableRowFrame* prev = (nsTableRowFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time, until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - nsSize kidAvailSize(aState.availSize); - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); // XXX remember this... - - for (;;) { - // Get the next content object - nsIContent* cell = mContent->ChildAt(kidIndex); - if (nsnull == cell) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - NS_RELEASE(cell); // cell: REFCNT--(a) - break; - } - - // Resolve style - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(cell, this); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidStyleContext->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - nsIFrame* kidFrame; - - // Create a child frame - if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel = nsnull; - kidDel = cell->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, cell, kidIndex, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - NS_RELEASE(kidStyleContext); - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics desiredSize; - ReflowStatus status; - if (NS_UNCONSTRAINEDSIZE == aState.availSize.width) - { - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - nsCellLayoutData kidLayoutData((nsTableCellFrame *)kidFrame, &desiredSize, pKidMaxElementSize); - aState.tableFrame->SetCellLayoutData(&kidLayoutData, (nsTableCell *)cell); - } - else - { // we're in a constrained situation, so get the avail width from the known column widths - nsCellLayoutData *cellData = aState.tableFrame->GetCellLayoutData((nsTableCell *)cell); - PRInt32 cellStartingCol = ((nsTableCell *)cell)->GetColIndex(); - PRInt32 cellColSpan = ((nsTableCell *)cell)->GetColSpan(); - nscoord availWidth = 0; - for (PRInt32 numColSpan=0; numColSpanGetColumnWidth(cellStartingCol+numColSpan); - NS_ASSERTION(0width, pKidMaxElementSize->height); - else - printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", - desiredSize.width, desiredSize.height); - } - } - NS_RELEASE(cell); // cell: REFCNT-- - - // Did the child fit? - if ((desiredSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - aState.x = 0; - // if we're constrained, compute the x offset where the cell should be put - if (NS_UNCONSTRAINEDSIZE!=aState.availSize.width) - { - // Adjust the running x-offset, taking into account intruders (cells from prior rows with rowspans > 1) - PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex(); - for (PRInt32 colIndex=0; colIndexGetColumnWidth(colIndex); - } - // Place the child - nsRect kidRect (aState.x, topMargin, desiredSize.width, desiredSize.height); - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - } - - SetMaxChildHeight(aState.maxCellHeight); // remember height of tallest child who doesn't have a row span - - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - - -/** Layout the entire row. - * This method stacks rows horizontally according to HTML 4.0 rules. - * Rows are responsible for layout of their children (cells). - */ -NS_METHOD -nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) - printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n", - aMaxSize.width, aMaxSize.height); -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - // Initialize our internal data - ResetMaxChildHeight(); - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; - - // Check for an overflow list - MoveOverflowToChildList(); - - RowReflowState state(aPresContext, aMaxSize); - mContentParent->GetContentParent((nsIFrame*&)(state.tableFrame)); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - } - - // Return our desired rect - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = state.maxCellHeight; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - - if (gsDebug1==PR_TRUE) - { - if (nsnull!=aMaxElementSize) - printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height, - aMaxElementSize->width, aMaxElementSize->height); - else - printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - - return NS_OK; - -} - -NS_METHOD -nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n"); - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsTableRowFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::CreateContinuingFrame\n"); - nsTableRowFrame* cf = new nsTableRowFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -nsresult nsTableRowFrame::NewFrame( nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableRowFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.h b/mozilla/layout/html/table/src/nsTableRowFrame.h deleted file mode 100644 index 141ef6a9a6d..00000000000 --- a/mozilla/layout/html/table/src/nsTableRowFrame.h +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableRowFrame_h__ -#define nsTableRowFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - -struct RowReflowState; -struct nsStyleSpacing; - -/** - * nsTableRowFrame is the frame that maps table rows - * (HTML tag TR). This class cannot be reused - * outside of an nsTableRowGroupFrame. It assumes that its parent is an nsTableRowGroupFrame, - * and its children are nsTableCellFrames. - * - * @see nsTableFrame - * @see nsTableRowGroupFrame - * @see nsTableCellFrame - * - * @author sclark - */ -class nsTableRowFrame : public nsContainerFrame -{ -public: - - /** instantiate a new instance of nsTableRowFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - - /** ask all children to paint themselves, without clipping (for cells with rowspan>1) - * @see nsIFrame::Paint - */ - virtual void PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** calls ResizeReflow for all of its child cells. - * Cells with rowspan=1 are all set to the same height and stacked horizontally. - *

    Cells are not split unless absolutely necessary. - *

    Cells are resized in nsTableFrame::BalanceColumnWidths - * and nsTableFrame::ShrinkWrapChildren - * - * @param aDesiredSize width set to width of the sum of the cells, height set to - * height of cells with rowspan=1. - * - * @see nsIFrame::ResizeReflow - * @see nsTableFrame::BalanceColumnWidths - * @see nsTableFrame::ShrinkWrapChildren - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame::CreateContinuingFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** set mTallestCell to 0 in anticipation of recalculating it */ - void ResetMaxChildHeight(); - - /** set mTallestCell to max(mTallestCell, aChildHeight) */ - void SetMaxChildHeight(PRInt32 aChildHeight); - - /** returns the tallest child in this row (ignoring any cell with rowspans) */ - PRInt32 GetTallestChild() const; - - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableRowFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** destructor */ - virtual ~nsTableRowFrame(); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - RowReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild( nsIPresContext* aPresContext, - RowReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); - - -private: - PRInt32 mTallestCell; // not my height, but the height of my tallest child - -}; - -#endif diff --git a/mozilla/layout/html/table/src/nsTableRowGroup.cpp b/mozilla/layout/html/table/src/nsTableRowGroup.cpp deleted file mode 100644 index d9c792c3a1f..00000000000 --- a/mozilla/layout/html/table/src/nsTableRowGroup.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableRowGroup.h" -#include "nsTableRowGroupFrame.h" -#include "nsTableRowFrame.h" -#include "nsTablePart.h" -#include "nsTableRow.h" -#include "nsHTMLParts.h" -#include "nsHTMLContainer.h" -#include "nsIContentDelegate.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsIRenderingContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIDocument.h" -#include "nsHTMLIIDs.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -static PRBool gsNoisyRefs = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsNoisyRefs = PR_FALSE; -#endif - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kITableContentIID, NS_ITABLECONTENT_IID); - -// nsTableContent checks aTag -nsTableRowGroup::nsTableRowGroup(nsIAtom* aTag) - : nsTableContent(aTag) -{ -} - -// nsTableContent checks aTag -nsTableRowGroup::nsTableRowGroup(nsIAtom* aTag, PRBool aImplicit) - : nsTableContent(aTag) -{ - mImplicit = aImplicit; -} - -nsTableRowGroup::~nsTableRowGroup() -{ -} - -/** return the number of columns in the widest row in this group */ -PRInt32 nsTableRowGroup::GetMaxColumns() -{ // computed every time for now, could be cached - PRInt32 result = 0; - PRInt32 numRows = ChildCount(); - for (PRInt32 rowIndex = 0; rowIndex < numRows; rowIndex++) - { - nsTableRow *row = (nsTableRow*)ChildAt(rowIndex); - PRInt32 numCols = row->GetMaxColumns(); - if (result < numCols) - result = numCols; - } - return result; -} - -// Added for debuging purposes -- remove from final build -nsrefcnt nsTableRowGroup::AddRef(void) -{ - if (gsNoisyRefs==PR_TRUE) - printf("Add Ref: %x, nsTableRowGroup cnt = %d \n",this,mRefCnt+1); - return ++mRefCnt; -} - -nsrefcnt nsTableRowGroup::Release(void) -{ - if (gsNoisyRefs==PR_TRUE) - printf("Release: %x, nsTableRowGroup cnt = %d \n",this,mRefCnt-1); - if (--mRefCnt == 0) { - if (gsNoisyRefs==PR_TRUE) printf("Delete: %x, nsTableRowGroup \n",this); - delete this; - return 0; - } - return mRefCnt; -} - -// nsTableRowGroupFrame checks arguments -nsIFrame* nsTableRowGroup::CreateFrame( nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - nsIFrame* rv; - nsresult status = nsTableRowGroupFrame::NewFrame(&rv, this, aIndexInParent, - aParentFrame); - return rv; -} - -void nsTableRowGroup::ResetCellMap () -{ - // GREG: enable this assertion when the content notification code is checked in - // NS_ASSERTION(nsnull!=mTable, "illegal table content state"); - if (nsnull != mTable) - mTable->ResetCellMap (); -} - -PRBool nsTableRowGroup::AppendChild (nsIContent *aContent) -{ - NS_PRECONDITION(nsnull!=aContent, "bad arg to AppendChild"); - PRBool result = PR_TRUE; - - // is aContent a TableRow? - PRBool isRow = IsRow(aContent); - - // if so, simply add it - if (PR_TRUE==isRow) - { - if (gsDebug==PR_TRUE) printf ("nsTableRowGroup::AppendChild -- inserting a row into this row group.\n"); - // if it is, we'll add it here - PRBool result = nsTableContent::AppendChild (aContent); - if (result) - { - ((nsTableRow *)aContent)->SetRowGroup (this); - ResetCellMap (); - } - } - // otherwise, if it's a cell, create an implicit row for it - else - { - nsTableContent *tableContent = (nsTableContent *)aContent; - const int contentType = tableContent->GetType(); - if (contentType == nsITableContent::kTableCellType) - { - // find last row, if ! implicit, make one, append there - nsTableRow *row = nsnull; - int index = ChildCount (); - while ((0 < index) && (nsnull==row)) - { - nsIContent *child = ChildAt (--index); // child: REFCNT++ - if (nsnull != child) - { - nsTableContent * content = (nsTableContent *)child; - if (content->GetType()==nsITableContent::kTableRowType) - row = (nsTableRow *)content; - NS_RELEASE(child); // child: REFCNT-- - } - } - if ((nsnull == row) || (! row->IsImplicit ())) - { - printf ("nsTableRow::AppendChild -- creating an implicit row.\n"); - nsIAtom * trDefaultTag = NS_NewAtom(nsTablePart::kRowTagString); // trDefaultTag: REFCNT++ - row = new nsTableRow (trDefaultTag, PR_TRUE); - NS_RELEASE(trDefaultTag); // trDefaultTag: REFCNT-- - result = AppendChild (row); - // SEC: check result - } - // group is guaranteed to be allocated at this point - result = row->AppendChild(aContent); - } - // otherwise, punt and let the table try to insert it. Or maybe just return a failure? - else - { - // you should go talk to my parent if you want to insert something other than a row - result = PR_FALSE; - } - } - return result; -} - -PRBool nsTableRowGroup::InsertChildAt (nsIContent *aContent, int aIndex) -{ - NS_PRECONDITION(nsnull!=aContent, "bad arg to InsertChildAt"); - - // is aContent a TableRow? - PRBool isRow = IsRow(aContent); - - // if not, ignore the request to add aContent - if (PR_FALSE==isRow) - { - // you should go talk to my parent if you want to insert something other than a column - return PR_FALSE; - } - - // if so, add the row to this group - PRBool result = nsTableContent::InsertChildAt (aContent, aIndex); - if (result) - { - ((nsTableRow *)aContent)->SetRowGroup (this); - ResetCellMap (); - } - return result; -} - - -PRBool nsTableRowGroup::ReplaceChildAt (nsIContent *aContent, int aIndex) -{ - NS_PRECONDITION(nsnull!=aContent, "bad aContent arg to ReplaceChildAt"); - NS_PRECONDITION(0<=aIndex && aIndexSetRowGroup (this); - if (nsnull != lastChild) - ((nsTableRow *)lastChild)->SetRowGroup (nsnull); - ResetCellMap (); - } - NS_IF_RELEASE(lastChild); // lastChild: REFCNT-- - return result; -} - -/** - * Remove a child at the given position. The method is ignored if - * the index is invalid (too small or too large). - */ -PRBool nsTableRowGroup::RemoveChildAt (int aIndex) -{ - NS_PRECONDITION(0<=aIndex && aIndexSetRowGroup (nsnull); - ResetCellMap (); - } - NS_IF_RELEASE(lastChild); // lastChild: REFCNT-- - return result; -} - -/** support method to determine if the param aContent is a TableRow object */ -PRBool nsTableRowGroup::IsRow(nsIContent * aContent) const -{ - PRBool result = PR_FALSE; - if (nsnull!=aContent) - { - // is aContent a row? - nsTableContent *tableContent = (nsTableContent *)aContent; - const int contentType = tableContent->GetType(); - if (contentType == nsITableContent::kTableRowType) - result = PR_TRUE; - } - return result; -} - -/* ----------- Global Functions ---------- */ - -nsresult -NS_NewTableRowGroupPart(nsIHTMLContent** aInstancePtrResult, - nsIAtom* aTag) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "nsnull ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* body = new nsTableRowGroup(aTag); - if (nsnull == body) { - return NS_ERROR_OUT_OF_MEMORY; - } - return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/html/table/src/nsTableRowGroup.h b/mozilla/layout/html/table/src/nsTableRowGroup.h deleted file mode 100644 index 91cb906a72f..00000000000 --- a/mozilla/layout/html/table/src/nsTableRowGroup.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableRowGroup_h__ -#define nsTableRowGroup_h__ - -#include "nscore.h" -#include "nsTableContent.h" - -class nsIPresContext; - -/** - * nsTableRowGroup is the content object that represents table row groups - * (HTML tags THEAD, TFOOT, and TBODY). This class cannot be reused - * outside of an nsTablePart. It assumes that its parent is an nsTableParte, and - * its children are nsTableRows. - * - * @see nsTablePart - * @see nsTableRow - * - * @author sclark - * TODO: make getter/setters inline - */ -class nsTableRowGroup : public nsTableContent -{ - -public: - - /** constructor - * @param aTag the HTML tag causing this row group to get constructed. - */ - nsTableRowGroup (nsIAtom* aTag); - - /** constructor - * @param aTag the HTML tag causing this row group to get constructed. - * @param aImplicit PR_TRUE if there is no actual input tag corresponding to - * this row group. - */ - nsTableRowGroup (nsIAtom* aTag, PRBool aImplicit); - - /** destructor, not responsible for any memory destruction itself */ - virtual ~nsTableRowGroup(); - - /** return the max of the number of columns represented by the contained rows */ - virtual PRInt32 GetMaxColumns(); - - // For debugging purposes only - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - /** @see nsIHTMLContent::CreateFrame */ - virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** return the number of contained rows */ - virtual int GetRowCount () - { - return ChildCount (); - }; - - /** returns nsITableContent::kTableRowGroupType */ - virtual int GetType() - { - return nsITableContent::kTableRowGroupType; - }; - - /** notify the containing nsTablePart that cell information has changed */ - virtual void ResetCellMap (); - - /* ----------- overrides from nsTableContent ---------- */ - - /** can only append objects that are rows (implement nsITableContent and are . - * of type nsITableContent::kTableRowType.) - * @see nsIContent::AppendChild - */ - virtual PRBool AppendChild (nsIContent * aContent); - - /** can only insert objects that are rows (implement nsITableContent and are . - * of type nsITableContent::kTableRowType.) - * @see nsIContent::InsertChildAt - */ - virtual PRBool InsertChildAt (nsIContent * aContent, int aIndex); - - /** can only replace child objects with objects that are rows - * (implement nsITableContent and are * of type nsITableContent::kTableRowe.) - * @param aContent the object to insert, must be a row - * @param aIndex the index of the object to replace. Must be in the range - * 0<=aIndexGetTag(); // mType: REFCNT++ -} - -nsTableRowGroupFrame::~nsTableRowGroupFrame() -{ - if (nsnull!=mType) - NS_RELEASE(mType); // mType: REFCNT-- -} - -NS_METHOD nsTableRowGroupFrame::GetRowGroupType(nsIAtom *& aType) -{ - NS_ADDREF(mType); - aType=mType; - return NS_OK; -} - - -NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - - // for debug... - /* - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(128,0,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - */ - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -// aDirtyRect is in our coordinate system -// child rect's are also in our coordinate system -/** overloaded method from nsContainerFrame. The difference is that - * we don't want to clip our children, so a cell can do a rowspan - */ -void nsTableRowGroupFrame::PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsIView *pView; - - kid->GetView(pView); - if (nsnull == pView) { - nsRect kidRect; - kid->GetRect(kidRect); - nsRect damageArea(aDirtyRect); - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - aRenderingContext.PushState(); - aRenderingContext.Translate(kidRect.x, kidRect.y); - kid->Paint(aPresContext, aRenderingContext, kidDamageArea); - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, kidRect.width, kidRect.height); - } - aRenderingContext.PopState(); - } - else - NS_RELEASE(pView); - kid->GetNextSibling(kid); - } -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableRowGroupFrame::GetTopMarginFor(nsIPresContext* aCX, - RowGroupReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableRowGroupFrame::PlaceChild( nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug1) - printf ("rowgroup: placing row at %d, %d, %d, %d\n", - aKidRect.x, aKidRect.y, aKidRect.width, aKidRect.height); - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - // Update the maximum element size - if (PR_TRUE==aState.firstRow) - { - aState.firstRow = PR_FALSE; - aState.firstRowHeight = aKidRect.height; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aKidMaxElementSize.width; - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool lastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - if (0>=kidAvailSize.height) - kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width -= kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (desiredSize.height > kidAvailSize.height))) - { - // The child's height is too big to fit at all in our remaining space, - // and it's not our first child. - // - // Note that if the width is too big that's okay and we allow the - // child to extend horizontally outside of the reflow area - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete, too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - // Our mLastContentIsComplete was already set by the last kid we - // reflowed reflow's status - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - nsRect kidRect (0, 0, desiredSize.width, desiredSize.height); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, - kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - /* Row groups should not create continuing frames for rows - * unless they absolutely have to! - * check to see if this is absolutely necessary (with new params from troy) - * otherwise PushChildren and bail. - */ - // Special handling for incomplete children - if (frNotComplete == status) { - // XXX It's good to assume that we might still have room - // even if the child didn't complete (floaters will want this) - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // No the child isn't complete, and it doesn't have a next in flow so - // create a continuing frame. This hooks the child into the flow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Insert the frame. We'll reflow it next pass through the loop - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Add back in the left and right margins, because one row does not - // impact another row's width - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width += kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - } - - // Update the child count - mChildCount = childCount; - -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); -#endif - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableRowGroupFrame* nextInFlow = (nsTableRowGroupFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list -// NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - if ((kidFrameSize.height > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Place the child - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - //kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableRowGroupFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsTableRowGroupFrame* prev = (nsTableRowGroupFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time, until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); // XXX remember this... - - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - break; - } - - // Resolve style - nsIStyleContextPtr kidSC = - aPresContext->ResolveStyleContextFor(kid, this); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - nsIFrame* kidFrame; - - // Create a child frame - if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel = nsnull; - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidSC); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - // Place the child - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - //kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - } - - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - - -/** Layout the entire row group. - * This method stacks rows vertically according to HTML 4.0 rules. - * Rows are responsible for layout of their children. - */ -NS_METHOD -nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) - printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n", - aMaxSize.width, aMaxSize.height); -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; - - // Check for an overflow list - MoveOverflowToChildList(); - - RowGroupReflowState state(aPresContext, aMaxSize); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - //NS_ASSERTION(0width, aMaxElementSize->height); - else - printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - - return NS_OK; - -} - -NS_METHOD -nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n"); - - // total hack for now, just some hard-coded values - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = aMaxSize.height; - - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableRowGroupFrame* cf = new nsTableRowGroupFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - if (PR_TRUE==gsDebug1) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); - aContinuingFrame = cf; - return NS_OK; -} - -/* ----- static methods ----- */ - -nsresult nsTableRowGroupFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableRowGroupFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - - - diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h deleted file mode 100644 index c341db18a06..00000000000 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableRowGroupFrame_h__ -#define nsTableRowGroupFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" -#include "nsIAtom.h" - -struct RowGroupReflowState; -struct nsStyleSpacing; - -/** - * nsTableRowGroupFrame is the frame that maps row groups - * (HTML tags THEAD, TFOOT, and TBODY). This class cannot be reused - * outside of an nsTableFrame. It assumes that its parent is an nsTableFrame, and - * its children are nsTableRowFrames. - * - * @see nsTableFrame - * @see nsTableRowFrame - * - * @author sclark - */ -class nsTableRowGroupFrame : public nsContainerFrame -{ -public: - - /** instantiate a new instance of nsTableRowGroupFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** ask all children to paint themselves, without clipping (for cells with rowspan>1) - * @see nsIFrame::Paint - */ - virtual void PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** calls ResizeReflow for all of its child rows. - * Rows are all set to the same width and stacked vertically. - *

    rows are not split unless absolutely necessary. - * - * @param aDesiredSize width set to width of rows, height set to - * sum of height of rows that fit in aMaxSize.height. - * - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame::CreateContinuingFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** returns the type of the mapped row group content in aType. - * caller MUST call release on the returned object if it is not null. - * - * @param aType out param filled with the type of the mapped content, or null if none. - * - * @return NS_OK - */ - NS_IMETHOD GetRowGroupType(nsIAtom *& aType); - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableRowGroupFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** protected destructor */ - ~nsTableRowGroupFrame(); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - RowGroupReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild( nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); - -private: - nsIAtom *mType; - -}; - - -#endif diff --git a/mozilla/layout/html/tests/CellMapTest/CellMapTest.cpp b/mozilla/layout/html/tests/CellMapTest/CellMapTest.cpp deleted file mode 100644 index 21cd9ee3551..00000000000 --- a/mozilla/layout/html/tests/CellMapTest/CellMapTest.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nscore.h" -#include "..\..\src\nsCellMap.h" - -static FILE * out; - -class CellData -{ -public: - PRInt32 mID; - - CellData(PRInt32 aID) - { mID = aID;}; - -}; - -class BasicTest -{ -public: - BasicTest(); - virtual ~BasicTest() {}; - - void DumpCellMap(nsCellMap *aMap, PRInt32 aRows, PRInt32 aCols); - void VerifyRowsAndCols(nsCellMap *aMap, PRInt32 aRows, PRInt32 aCols); -}; - -BasicTest::BasicTest() -{ - PRInt32 rows = 3; - PRInt32 cols = 4; - nsCellMap *map = new nsCellMap(rows, cols); - fprintf(out, "\nCreating %d by %d table with these values...\n", rows, cols); - for (PRInt32 i=0; imID); - map->SetCellAt(cellData, i, j); - } - fprintf(out, "\n"); - } - // verify input - DumpCellMap(map, rows, cols); - VerifyRowsAndCols(map, rows, cols); - - // cell map's own output should match above output - map->DumpCellMap(); - - // append a column - fprintf(out, "\nadding a column, so cols=%d\n", cols); - cols++; - map->GrowTo(cols); - DumpCellMap(map, rows, cols); - VerifyRowsAndCols(map, rows, cols); - - // reset the map - rows++; cols++; - fprintf(out, "\nresetting the map to %d,%d\n", rows, cols); - map->Reset(rows, cols); - DumpCellMap(map, rows, cols); - VerifyRowsAndCols(map, rows, cols); - -} - -void BasicTest::DumpCellMap(nsCellMap *aMap, PRInt32 aRows, PRInt32 aCols) -{ - fprintf(out, "\nPrinting out %d by %d table...\n", aRows, aCols); - for (PRInt32 i=0; iGetCellAt(i, j); - if (nsnull!=cellData) - fprintf(out, "Cell_%d ", cellData->mID); - else - fprintf(out, "null "); - } - fprintf(out, "\n"); - } -} - -void BasicTest::VerifyRowsAndCols(nsCellMap *aMap, PRInt32 aRows, PRInt32 aCols) -{ - if (aMap->GetRowCount()!=aRows) - fprintf(out, "ERROR: map->mRowCount!=rows, %d != %d\n", aMap->GetRowCount(), aRows); - if (aMap->GetColCount()!=aCols) - fprintf(out, "ERROR: map->mColCount!=cols, %d != %d\n", aMap->GetColCount(), aCols); -} - -void main (int argc, char **argv) -{ - out = fopen("CellMapTest.txt", "w+t"); - if (nsnull==out) - { - printf("test failed to open output file\n"); - exit(-1); - } - fprintf(out, "Test starting...\n\n"); - BasicTest basicTest; - fprintf(out, "\nTest completed.\n"); -} - - - diff --git a/mozilla/layout/html/tests/Makefile b/mozilla/layout/html/tests/Makefile deleted file mode 100644 index bfff9337cfc..00000000000 --- a/mozilla/layout/html/tests/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../.. - -include $(DEPTH)/config/config.mk - -CPPSRCS = \ - TestCSSParser.cpp \ - TestCSSPropertyLookup.cpp \ - TestCSSScanner.cpp \ - TestHTMLTagLookup.cpp \ - $(NULL) - -INCLUDES+=-I../src -I$(PUBLIC)/xpcom -I$(PUBLIC)/raptor - -DIRS = - -OBJS = $(CPPSRCS:.cpp=.o) - -EX_LIBS = \ - $(DIST)/lib/libraptorhtml.a \ - $(DIST)/lib/libraptorlayout_s.a \ - $(DIST)/lib/libraptorgfx.a \ - $(DIST)/lib/libraptorbase.a \ - $(DIST)/lib/libxpcom.a \ - $(DIST)/lib/libplc21.a \ - $(DIST)/lib/libplds21.a \ - $(DIST)/lib/libnspr21.a \ - $(NULL) - -PROGS = $(addprefix $(OBJDIR)/, $(CPPSRCS:.cpp=)) - -TARGETS = $(PROGS) - -include $(DEPTH)/config/rules.mk - -$(OBJDIR)/%.o: %.cpp - @$(MAKE_OBJDIR) - $(CCC) -o $@ $(CFLAGS) -c $*.cpp - -$(PROGS):$(OBJDIR)/%: $(OBJDIR)/%.o $(EX_LIBS) - @$(MAKE_OBJDIR) - $(CCC) -o $@ $@.o $(LDFLAGS) $(EX_LIBS) $(OS_LIBS) - -export:: - -install:: $(TARGETS) - $(INSTALL) $(TARGETS) $(DIST)/bin - diff --git a/mozilla/layout/html/tests/TestAttributes.cpp b/mozilla/layout/html/tests/TestAttributes.cpp deleted file mode 100644 index 68e36ad453d..00000000000 --- a/mozilla/layout/html/tests/TestAttributes.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nscore.h" -#include "nsIAtom.h" -#include "nsCRT.h" -#include "nsHTMLParts.h" -#include "nsIHTMLContent.h" -#include "nsIHTMLAttributes.h" -#include "nsITextContent.h" -#include "nsIUnicharInputStream.h" -#include "nsString.h" -#include "nsIDocument.h" -#include "nsISupportsArray.h" -#include "nsDocument.h" -#include "nsIURL.h" - -void testAttributes(nsIHTMLContent* content) { - nsIAtom* sBORDER = NS_NewAtom("BORDER"); - nsIAtom* sWIDTH = NS_NewAtom("WIDTH"); - nsIAtom* sHEIGHT = NS_NewAtom("HEIGHT"); - nsIAtom* sSRC = NS_NewAtom("SRC"); - nsIAtom* sBAD = NS_NewAtom("BADATTRIBUTE"); - nsString sempty(""); - nsString sfoo_gif("foo.gif"); - - content->SetAttribute(sBORDER); - content->SetAttribute(sWIDTH, nsHTMLValue(5, eHTMLUnit_Pixel)); - content->SetAttribute(sHEIGHT, sempty); - content->SetAttribute(sSRC, sfoo_gif); - - nsHTMLValue ret; - nsContentAttr rv; - rv = content->GetAttribute(sBORDER, ret); - if ((rv != eContentAttr_NoValue) || (ret.GetUnit() != eHTMLUnit_Null)) { - printf("test 0 failed\n"); - } - - rv = content->GetAttribute(sWIDTH, ret); - if ((rv != eContentAttr_HasValue) || (! (ret == nsHTMLValue(5, eHTMLUnit_Pixel)))) { - printf("test 1 failed\n"); - } - - rv = content->GetAttribute(sBAD, ret); - if (rv != eContentAttr_NotThere) { - printf("test 2 failed\n"); - } - - // Same, except different case strings - - nsString sborder("border"); - nsString strRet; - rv = ((nsIContent*)content)->GetAttribute(sborder, strRet); - if (rv != eContentAttr_NoValue) { - printf("test 3 (case comparison) failed\n"); - } - - content->UnsetAttribute(sWIDTH); - - nsISupportsArray* allNames; - NS_NewISupportsArray(&allNames); - - content->GetAllAttributeNames(allNames); - if (allNames->Count() != 3) { - printf("test 5 (unset attriubte) failed\n"); - } - - PRBool borderFound = PR_FALSE,heightFound = PR_FALSE,srcFound = PR_FALSE; - for (int n = 0; n < 3; n++) { - const nsIAtom* ident = (const nsIAtom*)allNames->ElementAt(n); - if (sBORDER == ident) { - borderFound = PR_TRUE; - } - if (sHEIGHT == ident) { - heightFound = PR_TRUE; - } - if (sSRC == ident) { - srcFound = PR_TRUE; - } - } - if (!(borderFound && heightFound && srcFound)) { - printf("test 6 failed\n"); - } - - NS_RELEASE(allNames); - - NS_RELEASE(sBORDER); - NS_RELEASE(sWIDTH); - NS_RELEASE(sHEIGHT); - NS_RELEASE(sSRC); -} - -void testStrings(nsIDocument* aDoc) { - printf("begin string tests\n"); - - PRBool val; - // regular Equals - val = (nsString("mrString")).Equals(nsString("mrString")); - if (PR_TRUE != val) { - printf("test 0 failed\n"); - } - val = (nsString("mrString")).Equals(nsString("MRString")); - if (PR_FALSE != val) { - printf("test 1 failed\n"); - } - val = (nsString("mrString")).Equals(nsString("mrStri")); - if (PR_FALSE != val) { - printf("test 2 failed\n"); - } - val = (nsString("mrStri")).Equals(nsString("mrString")); - if (PR_FALSE != val) { - printf("test 3 failed\n"); - } - // EqualsIgnoreCase - val = (nsString("mrString")).EqualsIgnoreCase("mrString"); - if (PR_TRUE != val) { - printf("test 4 failed\n"); - } - val = (nsString("mrString")).EqualsIgnoreCase("mrStrinG"); - if (PR_TRUE != val) { - printf("test 5 failed\n"); - } - val = (nsString("mrString")).EqualsIgnoreCase("mrStri"); - if (PR_FALSE != val) { - printf("test 6 failed\n"); - } - val = (nsString("mrStri")).EqualsIgnoreCase("mrString"); - if (PR_FALSE != val) { - printf("test 7 failed\n"); - } - // String vs. Ident - val = (nsString("mrString")).EqualsIgnoreCase(NS_NewAtom("mrString")); - if (PR_TRUE != val) { - printf("test 8 failed\n"); - } - val = (nsString("mrString")).EqualsIgnoreCase(NS_NewAtom("MRStrINg")); - if (PR_TRUE != val) { - printf("test 9 failed\n"); - } - val = (nsString("mrString")).EqualsIgnoreCase(NS_NewAtom("mrStri")); - if (PR_FALSE != val) { - printf("test 10 failed\n"); - } - val = (nsString("mrStri")).EqualsIgnoreCase(NS_NewAtom("mrString")); - if (PR_FALSE != val) { - printf("test 11 failed\n"); - } - - printf("string tests complete\n"); -} - -class MyDocument : public nsDocument { -public: - MyDocument(); - void LoadURL(nsIURL* aURL); - -protected: - virtual ~MyDocument(); -}; - -MyDocument::MyDocument() -{ -} - -MyDocument::~MyDocument() -{ -} - -void MyDocument::LoadURL(nsIURL* aURL) -{ -} - -int main(int argc, char** argv) -{ - // Create Byte2Unicode converter - nsresult rv; - nsIB2UConverter *converter; - rv = NS_NewB2UConverter(&converter,NULL); - if (NS_OK != rv) { - printf("Could not create converter.\n"); - return -1; - } - - // Create a unicode string - static const char* srcStr = "This is some meaningless text about nothing at all"; - PRInt32 rv2; - PRInt32 origSrcLen = nsCRT::strlen((char *)srcStr); - const int BUFFER_LENGTH = 100; - PRUnichar destStr[BUFFER_LENGTH]; - PRInt32 srcLen = origSrcLen; - PRInt32 destLen = BUFFER_LENGTH; - rv2 = converter->Convert(destStr,0,destLen,srcStr,0,srcLen); - if ((NS_OK != rv2) || (srcLen < origSrcLen)) { - printf("Failed to convert all characters to unicode.\n"); - return -1; - } - - delete converter; - - // Create test document. - MyDocument *myDoc = new MyDocument(); - - testStrings(myDoc); - - // Create a new text content object. - nsIHTMLContent *text; - rv = NS_NewHTMLText(&text,destStr,destLen); - if (NS_OK != rv) { - printf("Could not create text content.\n"); - return -1; - } - NS_ASSERTION(!text->CanContainChildren(),""); - text->SetDocument(myDoc); - -#if 0 - // Query ITextContent interface - static NS_DEFINE_IID(kITextContentIID, NS_ITEXTCONTENT_IID); - nsITextContent* textContent; - rv = text->QueryInterface(kITextContentIID,(void **)&textContent); - if (NS_OK != rv) { - printf("Created text content does not have the ITextContent interface.\n"); - return -1; - } - - // Print the contents. - nsAutoString stringBuf; - textContent->GetText(stringBuf,0,textContent->GetLength()); - if (!stringBuf.Equals(nsString(destStr,destLen))) { - printf("something wrong with the text in a text content\n"); - } -#endif - - // Create a simple container. - nsIHTMLContent* container; - nsIAtom* li = NS_NewAtom("LI"); - - rv = NS_NewHTMLContainer(&container,li); - if (NS_OK != rv) { - printf("Could not create container.\n"); - return -1; - } - NS_ASSERTION(container->CanContainChildren(),""); - container->SetDocument(myDoc); - - container->AppendChild(text); - if (container->ChildCount() != 1) { - printf("Container has wrong number of children."); - } - - printf("begin attribute tests\n"); - testAttributes(container); - printf("attribute tests complete\n"); - - - // Clean up memory. - text->Release(); // The textContent interface. - delete container; - delete text; - myDoc->Release(); - return 0; -} diff --git a/mozilla/layout/html/tests/TestCSSParser.cpp b/mozilla/layout/html/tests/TestCSSParser.cpp deleted file mode 100644 index 8045885d409..00000000000 --- a/mozilla/layout/html/tests/TestCSSParser.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nsICSSParser.h" -#include "nsIStyleSheet.h" -#include "nsIURL.h" -#include "nsIInputStream.h" -#include "nsIUnicharInputStream.h" -#include "nsString.h" - -static void Usage(void) -{ - printf("usage: TestCSSParser [-v] url\n"); -} - -int main(int argc, char** argv) -{ - if (argc < 2 || argc > 3) { - Usage(); - return -1; - } - - PRBool verbose = PR_FALSE; - char* urlName; - if (argc == 3) { - if (strcmp(argv[1], "-v") == 0) { - verbose = PR_TRUE; - } else { - Usage(); - return -1; - } - urlName = argv[2]; - } else { - urlName = argv[1]; - } - - // Create url object - nsIURL* url; - nsresult rv = NS_NewURL(&url, nsnull, urlName); - if (NS_OK != rv) { - printf("invalid URL: '%s'\n", urlName); - return -1; - } - - // Get an input stream from the url - PRInt32 ec; - nsIInputStream* in = url->Open(&ec); - if (nsnull == in) { - printf("open of url('%s') failed: error=%x\n", urlName, ec); - return -1; - } - - // Translate the input using the argument character set id into unicode - nsIUnicharInputStream* uin; - rv = NS_NewConverterStream(&uin, nsnull, in); - if (NS_OK != rv) { - printf("can't create converter input stream: %d\n", rv); - return -1; - } - - // Create parser and set it up to process the input file - nsICSSParser* css; - rv = NS_NewCSSParser(&css); - if (NS_OK != rv) { - printf("can't create css parser: %d\n", rv); - return -1; - } - printf("CSS parser supports %x\n", css->GetInfoMask()); - - // Parse the input and produce a style set - nsIStyleSheet* sheet = css->Parse(&ec, uin, url); - if (verbose) { - sheet->List(); - } - - url->Release(); - in->Release(); - uin->Release(); - css->Release(); - sheet->Release(); - - return 0; -} diff --git a/mozilla/layout/html/tests/TestCSSPropertyLookup.cpp b/mozilla/layout/html/tests/TestCSSPropertyLookup.cpp deleted file mode 100644 index a989d6efdb9..00000000000 --- a/mozilla/layout/html/tests/TestCSSPropertyLookup.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "plstr.h" -#include "nsCSSProps.h" -#include "nsCSSKeywords.h" - -static const char* kJunkNames[] = { - nsnull, - "", - "123", - "backgroundz", - "zzzzzz", - "#@$&@#*@*$@$#" -}; - -int TestProps() { - int rv = 0; - PRInt32 id; - - // First make sure we can find all of the tags that are supposed to - // be in the table. Futz with the case to make sure any case will - // work - const nsCSSProps::NameTableEntry* et = &nsCSSProps::kNameTable[0]; - const nsCSSProps::NameTableEntry* end = &nsCSSProps::kNameTable[PROP_MAX]; - while (et < end) { - char tagName[100]; - id = nsCSSProps::LookupName(et->name); - if (id < 0) { - printf("bug: can't find '%s'\n", et->name); - rv = -1; - } - if (et->id != id) { - printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id); - rv = -1; - } - - // fiddle with the case to make sure we can still find it - PL_strcpy(tagName, et->name); - tagName[0] = tagName[0] - 32; - id = nsCSSProps::LookupName(tagName); - if (id < 0) { - printf("bug: can't find '%s'\n", tagName); - rv = -1; - } - if (et->id != id) { - printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id); - rv = -1; - } - et++; - } - - // Now make sure we don't find some garbage - for (int i = 0; i < sizeof(kJunkNames) / sizeof(const char*); i++) { - const char* tag = kJunkNames[i]; - id = nsCSSProps::LookupName(tag); - if (id >= 0) { - printf("bug: found '%s'\n", tag ? tag : "(null)"); - rv = -1; - } - } - - return rv; -} - -int TestKeywords() { - int rv = 0; - PRInt32 id; - - // First make sure we can find all of the tags that are supposed to - // be in the table. Futz with the case to make sure any case will - // work - const nsCSSKeywords::NameTableEntry* et = &nsCSSKeywords::kNameTable[0]; - const nsCSSKeywords::NameTableEntry* end = &nsCSSKeywords::kNameTable[KEYWORD_MAX]; - while (et < end) { - char tagName[100]; - id = nsCSSKeywords::LookupName(et->name); - if (id < 0) { - printf("bug: can't find '%s'\n", et->name); - rv = -1; - } - if (et->id != id) { - printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id); - rv = -1; - } - - // fiddle with the case to make sure we can still find it - PL_strcpy(tagName, et->name); - tagName[0] = tagName[0] - 32; - id = nsCSSKeywords::LookupName(tagName); - if (id < 0) { - printf("bug: can't find '%s'\n", tagName); - rv = -1; - } - if (et->id != id) { - printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id); - rv = -1; - } - et++; - } - - // Now make sure we don't find some garbage - for (int i = 0; i < sizeof(kJunkNames) / sizeof(const char*); i++) { - const char* tag = kJunkNames[i]; - id = nsCSSKeywords::LookupName(tag); - if (id >= 0) { - printf("bug: found '%s'\n", tag ? tag : "(null)"); - rv = -1; - } - } - - return rv; -} - -int main(int argc, char** argv) -{ - TestProps(); - TestKeywords(); - return 0; -} diff --git a/mozilla/layout/html/tests/TestCSSScanner.cpp b/mozilla/layout/html/tests/TestCSSScanner.cpp deleted file mode 100644 index b3b561f59f4..00000000000 --- a/mozilla/layout/html/tests/TestCSSScanner.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nsCSSScanner.h" -#include "nsIURL.h" -#include "nsIInputStream.h" -#include "nsIUnicharInputStream.h" -#include "nsString.h" - -int main(int argc, char** argv) -{ - if (2 != argc) { - printf("usage: TestCSSScanner url\n"); - return -1; - } - - // Create url object - char* urlName = argv[1]; - nsIURL* url; - nsresult rv = NS_NewURL(&url, nsnull, urlName); - if (NS_OK != rv) { - printf("invalid URL: '%s'\n", urlName); - return -1; - } - - // Get an input stream from the url - PRInt32 ec; - nsIInputStream* in = url->Open(&ec); - if (nsnull == in) { - printf("open of url('%s') failed: error=%x\n", urlName, ec); - return -1; - } - - // Translate the input using the argument character set id into unicode - nsIUnicharInputStream* uin; - rv = NS_NewConverterStream(&uin, nsnull, in); - if (NS_OK != rv) { - printf("can't create converter input stream: %d\n", rv); - return -1; - } - - // Create scanner and set it up to process the input file - nsCSSScanner* css = new nsCSSScanner(); - css->Init(uin); - - // Scan the file and dump out the tokens - nsCSSToken tok; - for (;;) { - char buf[20]; - if (!css->Next(&ec, &tok)) { - break; - } - printf("%02d: ", tok.mType); - switch (tok.mType) { - case eCSSToken_Ident: - case eCSSToken_AtKeyword: - case eCSSToken_String: - case eCSSToken_WhiteSpace: - case eCSSToken_URL: - case eCSSToken_InvalidURL: - case eCSSToken_ID: - fputs(tok.mIdent, stdout); - fputs("\n", stdout); - break; - - case eCSSToken_Number: - printf("%g\n", tok.mNumber); - break; - case eCSSToken_Percentage: - printf("%g%%\n", tok.mNumber * 100.0f); - break; - case eCSSToken_Dimension: - tok.mIdent.ToCString(buf, sizeof(buf)); - printf("%g%s\n", tok.mNumber, buf); - break; - case eCSSToken_Symbol: - printf("%c (%x)\n", tok.mSymbol, tok.mSymbol); - break; - } - } - - delete css; - uin->Release(); - in->Release(); - url->Release(); - - return 0; -} diff --git a/mozilla/layout/html/tests/TestHTMLTagLookup.cpp b/mozilla/layout/html/tests/TestHTMLTagLookup.cpp deleted file mode 100644 index ea6cb6aeb09..00000000000 --- a/mozilla/layout/html/tests/TestHTMLTagLookup.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "plstr.h" -#include "nsHTMLTags.h" - -static const char* kJunkNames[] = { - nsnull, - "", - "123", - "ab", - "zzzzzz", - "#@$&@#*@*$@$#" -}; - -int main(int argc, char** argv) -{ - PRInt32 id; - - // First make sure we can find all of the tags that are supposed to - // be in the table. Futz with the case to make sure any case will - // work - const nsHTMLTags::NameTableEntry* et = &nsHTMLTags::kNameTable[0]; - const nsHTMLTags::NameTableEntry* end = &nsHTMLTags::kNameTable[TAG_MAX]; - while (et < end) { - char tagName[100]; - id = nsHTMLTags::LookupName(et->name); - if (id < 0) { - printf("bug: can't find '%s'\n", et->name); - } - if (et->id != id) { - printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id); - } - - // fiddle with the case to make sure we can still find it - PL_strcpy(tagName, et->name); - tagName[0] = tagName[0] - 32; - id = nsHTMLTags::LookupName(tagName); - if (id < 0) { - printf("bug: can't find '%s'\n", tagName); - } - if (et->id != id) { - printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id); - } - et++; - } - - // Now make sure we don't find some garbage - for (int i = 0; i < sizeof(kJunkNames) / sizeof(const char*); i++) { - const char* tag = kJunkNames[i]; - id = nsHTMLTags::LookupName(tag); - if (id >= 0) { - printf("bug: found '%s'\n", tag ? tag : "(null)"); - } - } - - return 0; -} diff --git a/mozilla/layout/html/tests/TestInlineFrame.cpp b/mozilla/layout/html/tests/TestInlineFrame.cpp deleted file mode 100644 index 6de56e9dc77..00000000000 --- a/mozilla/layout/html/tests/TestInlineFrame.cpp +++ /dev/null @@ -1,1652 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nscore.h" -#include "nsCRT.h" -#include "nsHTMLParts.h" -#include "nsIHTMLContent.h" -#include "nsIDocument.h" -#include "nsVoidArray.h" -#include "nsDocument.h" -#include "nsHTMLTagContent.h" -#include "nscoord.h" -#include "nsSplittableFrame.h" -#include "nsIContentDelegate.h" -#include "nsIPresContext.h" -#include "nsInlineFrame.h" -#include "nsIAtom.h" - -static NS_DEFINE_IID(kIContentDelegateIID, NS_ICONTENTDELEGATE_IID); - -/////////////////////////////////////////////////////////////////////////////// -// - -class MyDocument : public nsDocument { -public: - MyDocument(); - - virtual void LoadURL(nsIURL* aURL); - -protected: - virtual ~MyDocument(); -}; - -MyDocument::MyDocument() -{ -} - -MyDocument::~MyDocument() -{ -} - -void MyDocument::LoadURL(nsIURL* aURL) -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// - -// Frame with a fixed width, but that's optionally splittable -class FixedSizeFrame : public nsSplittableFrame { -public: - FixedSizeFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - ReflowStatus ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - PRBool IsSplittable() const; -}; - -class FixedSizeContent : public nsHTMLTagContent { -public: - FixedSizeContent(nscoord aWidth, - nscoord aHeight, - PRBool aIsSplittable = PR_FALSE); - - nsIFrame* CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - // Accessors - nscoord GetWidth() {return mWidth;} - void SetWidth(nscoord aWidth); - nscoord GetHeight() {return mHeight;} - void SetHeight(nscoord aHeight); - - void ToHTML(nsString& out); - PRBool IsSplittable() const {return mIsSplittable;} - void SetIsSplittable(PRBool aIsSplittable) {mIsSplittable = aIsSplittable;} - -private: - nscoord mWidth, mHeight; - PRBool mIsSplittable; -}; - -/////////////////////////////////////////////////////////////////////////////// -// - -FixedSizeFrame::FixedSizeFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsSplittableFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsIFrame::ReflowStatus -FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "bad max size"); - FixedSizeContent* content = (FixedSizeContent*)mContent; - ReflowStatus status = frComplete; - FixedSizeFrame* prevInFlow = (FixedSizeFrame*)mPrevInFlow; - - aDesiredSize.width = content->GetWidth(); - aDesiredSize.height = content->GetHeight(); - - // We can split once horizontally - if (nsnull != prevInFlow) { - aDesiredSize.width -= prevInFlow->mRect.width; - } else if ((aDesiredSize.width > aMaxSize.width) && content->IsSplittable()) { - aDesiredSize.width = aMaxSize.width; - status = frNotComplete; - } - - aDesiredSize.ascent = aDesiredSize.height; - aDesiredSize.descent = 0; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aDesiredSize.width; - aMaxElementSize->height = aDesiredSize.height; - } - - return status; -} - -PRBool FixedSizeFrame::IsSplittable() const -{ - FixedSizeContent* content = (FixedSizeContent*)mContent; - - return content->IsSplittable(); -} - -/////////////////////////////////////////////////////////////////////////////// -// - -FixedSizeContent::FixedSizeContent(nscoord aWidth, - nscoord aHeight, - PRBool aIsSplittable) - : nsHTMLTagContent() -{ - mWidth = aWidth; - mHeight = aHeight; - mIsSplittable = aIsSplittable; -} - -nsIFrame* FixedSizeContent::CreateFrame(nsIPresContext* aPresContext, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) -{ - return new FixedSizeFrame(this, aIndexInParent, aParentFrame); -} - -// Change the width of the content triggering an incremental reflow -void FixedSizeContent::SetWidth(nscoord aWidth) -{ - NS_NOTYETIMPLEMENTED("set width"); -} - -// Change the width of the content triggering an incremental reflow -void FixedSizeContent::SetHeight(nscoord aHeight) -{ - NS_NOTYETIMPLEMENTED("set height"); -} - -void FixedSizeContent::ToHTML(nsString& out) -{ -} - -/////////////////////////////////////////////////////////////////////////////// -// - -class InlineFrame : public nsInlineFrame -{ -public: - InlineFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - // Accessors to return protected state - nsIFrame* OverflowList() {return mOverflowList;} - void ClearOverflowList() {mOverflowList = nsnull;} - PRBool LastContentIsComplete() {return mLastContentIsComplete;} - - // Helper member functions - PRInt32 MaxChildWidth(); - PRInt32 MaxChildHeight(); -}; - -InlineFrame::InlineFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) - : nsInlineFrame(aContent, aIndexInParent, aParent) -{ -} - -#if 0 -PRInt32 InlineFrame::MaxChildWidth() -{ - PRInt32 maxWidth = 0; - - nsIFrame* f; - for (FirstChild(f); nsnull != f; f->GetNextSibling(f)) { - if (f->GetWidth() > maxWidth) { - maxWidth = f->GetWidth(); - } - } - - return maxWidth; -} - -PRInt32 InlineFrame::MaxChildHeight() -{ - PRInt32 maxHeight = 0; - - for (nsIFrame* f = FirstChild(); nsnull != f; f = f->GetNextSibling()) { - if (f->GetHeight() > maxHeight) { - maxHeight = f->GetHeight(); - } - } - - return maxHeight; -} - -/////////////////////////////////////////////////////////////////////////////// -// Helper functions - -// Compute the number of frames in the list -static PRInt32 -LengthOf(nsIFrame* aChildList) -{ - PRInt32 result = 0; - - while (nsnull != aChildList) { - aChildList = aChildList->GetNextSibling(); - result++; - } - - return result; -} - -/////////////////////////////////////////////////////////////////////////////// -// - -// Test basic reflowing of unmapped children. No borders/padding or child -// margins involved, and no splitting of child frames. b is an empty -// HTML container -// -// Here's what this function tests: -// - reflow unmapped maps all children and returns that it's complete -// - each child frame is placed and sized properly -// - the inline frame's desired width and height are correct -static PRBool -TestReflowUnmapped(nsIPresContext* presContext) -{ - // Create an HTML container - nsIHTMLContent* b; - NS_NewHTMLContainer(&b, NS_NewAtom("SPAN")); - - // Append three fixed width elements. - b->AppendChild(new FixedSizeContent(100, 100)); - b->AppendChild(new FixedSizeContent(300, 300)); - b->AppendChild(new FixedSizeContent(200, 200)); - - // Create an inline frame for the HTML container and set its - // style context - InlineFrame* f = new InlineFrame(b, 0, nsnull); - nsIStyleContext* styleContext = presContext->ResolveStyleContextFor(b, nsnull); - - f->SetStyleContext(styleContext); - - // Reflow the HTML container - nsReflowMetrics reflowMetrics; - nsSize maxSize(1000, 1000); - nsIFrame::ReflowStatus status; - - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Make sure the frame is complete - if (status != nsIFrame::frComplete) { - printf("ReflowUnmapped: initial reflow not complete: %d\n", status); - return PR_FALSE; - } - - // Verify that all the children were mapped - if (f->ChildCount() != b->ChildCount()) { - printf("ReflowUnmapped: wrong number of child frames: %d\n", f->ChildCount()); - return PR_FALSE; - } - - // and that the last content offset is correct - if (f->GetLastContentOffset() != (b->ChildCount() - 1)) { - printf("ReflowUnmapped: wrong last content offset: %d\n", f->GetLastContentOffset()); - return PR_FALSE; - } - - // Verify that the width/height of each child frame is correct - for (PRInt32 i = 0; i < b->ChildCount(); i++) { - FixedSizeContent* childContent = (FixedSizeContent*)b->ChildAt(i); - nsIFrame* childFrame = f->ChildAt(i); - - if ((childFrame->GetWidth() != childContent->GetWidth()) || - (childFrame->GetHeight() != childContent->GetHeight())) { - printf("ReflowUnmapped: child frame size incorrect: %d\n", i); - return PR_FALSE; - } - } - - // Verify that the inline frame's desired height is correct - if (reflowMetrics.height != f->MaxChildHeight()) { - printf("ReflowUnmapped: wrong frame height: %d\n", reflowMetrics.height); - return PR_FALSE; - } - - // Verify that the frames are tiled horizontally with no space between frames - nscoord x = 0; - for (nsIFrame* child = f->FirstChild(); child; child = child->GetNextSibling()) { - nsPoint origin; - - child->GetOrigin(origin); - if (origin.x != x) { - printf("ReflowUnmapped: child x-origin is incorrect: %d\n", x); - return PR_FALSE; - } - - x += child->GetWidth(); - } - - // and that the inline frame's desired width is correct - if (reflowMetrics.width != x) { - printf("ReflowUnmapped: wrong frame width: %d\n", reflowMetrics.width); - return PR_FALSE; - } - - NS_RELEASE(b); - return PR_TRUE; -} - -// Test the case where the frame max size is too small for even one child frame. -// -// Here's what this function tests: -// 1. reflow unmapped with a max width narrower than the first child -// a) when there's only one content child -// b) when there's more than one content child -// 2. reflow unmapped when the height's too small -// 3. reflow mapped when the height's too small -// 4. reflow mapped with a max width narrower than the first child -static PRBool -TestChildrenThatDontFit(nsIPresContext* presContext) -{ - // Create an HTML container - nsIHTMLContent* b; - NS_NewHTMLContainer(&b, NS_NewAtom("SPAN")); - - // Add one fixed width element. - b->AppendChild(new FixedSizeContent(100, 100)); - - // Create an inline frame for the HTML container and set its - // style context - InlineFrame* f = new InlineFrame(b, 0, nsnull); - nsIStyleContext* styleContext = presContext->ResolveStyleContextFor(b, nsnull); - - f->SetStyleContext(styleContext); - - /////////////////////////////////////////////////////////////////////////// - // Test #1a - - // Reflow the frame with a width narrower than the first child frame. This - // tests how we handle one child that doesn't fit when reflowing unmapped - nsReflowMetrics reflowMetrics; - nsSize maxSize(10, 1000); - nsIFrame::ReflowStatus status; - - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify that the inline frame is complete - if (status != nsIFrame::frComplete) { - printf("ChildrenThatDontFIt: reflow unmapped isn't complete (#1a): %d\n", status); - return PR_FALSE; - } - - // Verify that the desired width is the width of the first frame - if (reflowMetrics.width != f->FirstChild()->GetWidth()) { - printf("ChildrenThatDontFit: frame width is wrong (#1a): %d\n", f->FirstChild()->GetWidth()); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #1b - - // Append two more fixed width elements. - b->AppendChild(new FixedSizeContent(300, 300)); - b->AppendChild(new FixedSizeContent(200, 200)); - - // Create a new inline frame for the HTML container - InlineFrame* f1 = new InlineFrame(b, 0, nsnull); - f1->SetStyleContext(styleContext); - - // Reflow the frame with a width narrower than the first child frame. This - // tests how we handle children that don't fit when reflowing unmapped - maxSize.SizeTo(10, 1000); - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify that the frame is not complete - if (status != nsIFrame::frNotComplete) { - printf("ChildrenThatDontFIt: reflow unmapped isn't not complete (#1b): %d\n", status); - return PR_FALSE; - } - - // Verify that the desired width is the width of the first frame - if (reflowMetrics.width != f1->FirstChild()->GetWidth()) { - printf("ChildrenThatDontFit: frame width is wrong (#1b): %d\n", f1->FirstChild()->GetWidth()); - return PR_FALSE; - } - - // Verify that the child count is only 1 - if (f1->ChildCount() != 1) { - printf("ChildrenThatDontFit: more than one child frame (#1b): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // and that there's no overflow list. If there's an overflow list that means - // we reflowed a second frame and we would have passed it a negative max size - // which is not a very nice thing to do - if (nsnull != f1->OverflowList()) { - printf("ChildrenThatDontFit: unexpected overflow list (#1b)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #2 - - // Now reflow the frame wide enough so that all the frames fit. Make - // the height small enough so that no frames fit, so we can test that - // reflow unmapped handles that check correctly - maxSize.width = 1000; - maxSize.height = 10; - reflowMetrics.height = 0; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify the frame is complete - if (status != nsIFrame::frComplete) { - printf("ChildrenThatDontFit: resize isn't complete (#2): %d\n", status); - return PR_FALSE; - } - - // Verify that all child frames are now there - if (f1->ChildCount() != b->ChildCount()) { - printf("ChildrenThatDontFit: wrong child count (#2): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // and that the frame's height is the right size - if (reflowMetrics.height != f1->MaxChildHeight()) { - printf("ChildrenThatDontFit: height is wrong (#2): %d\n", reflowMetrics.height); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #3 - - // Now test reflow mapped against a height that's too small - nscoord oldHeight = reflowMetrics.height; - maxSize.height = 10; - reflowMetrics.height = 0; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify the frame is complete and we still have all the child frames - if ((status != nsIFrame::frComplete) || (f1->ChildCount() != b->ChildCount())) { - printf("ChildrenThatDontFit: reflow mapped failed (#3)\n"); - return PR_FALSE; - } - - // Verify that the desired height of the frame is the same as before - if (reflowMetrics.height != oldHeight) { - printf("ChildrenThatDontFit: height is wrong (#3): %d\n", reflowMetrics.height); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #4 - - // And finally test reflowing mapped with a max width narrower than the first - // child - maxSize.width = 10; - maxSize.height = 1000; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify the frame is not complete - if (status != nsIFrame::frNotComplete) { - printf("ChildrenThatDontFIt: reflow mapped isn't not complete (#4): %d\n", status); - return PR_FALSE; - } - - // Verify that there's only one child - if (f1->ChildCount() > 1) { - printf("ChildrenThatDontFIt: reflow mapped too many children (#4): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // and that the desired width is the width of the first frame - if (reflowMetrics.width != f1->FirstChild()->GetWidth()) { - printf("ChildrenThatDontFit: frame width is wrong (#4): %d\n", f1->FirstChild()->GetWidth()); - return PR_FALSE; - } - - NS_RELEASE(b); - return PR_TRUE; -} - -// Test handling of the overflow list -// -// Here's what this function tests: -// 1. reflow unmapped places children whose width doesn't completely fit on -// the overflow list -// 2. frames use their own overflow list when reflowing mapped children -// 3. continuing frames should use the overflow list from their prev-in-flow -static PRBool -TestOverflow(nsIPresContext* presContext) -{ - // Create an HTML container - nsIHTMLContent* b; - NS_NewHTMLContainer(&b, NS_NewAtom("SPAN")); - - // Append three fixed width elements. - b->AppendChild(new FixedSizeContent(100, 100)); - b->AppendChild(new FixedSizeContent(300, 300)); - b->AppendChild(new FixedSizeContent(200, 200)); - - // Create an inline frame for the HTML container and set its - // style context - InlineFrame* f = new InlineFrame(b, 0, nsnull); - nsIStyleContext* styleContext = presContext->ResolveStyleContextFor(b, nsnull); - - f->SetStyleContext(styleContext); - - /////////////////////////////////////////////////////////////////////////// - // Test #1 - - // Reflow the frame so only half the second frame fits - nsReflowMetrics reflowMetrics; - nsSize maxSize(150, 1000); - nsIFrame::ReflowStatus status; - - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // Verify that there's one frame on the overflow list - if ((nsnull == f->OverflowList()) || (LengthOf(f->OverflowList()) != 1)) { - printf("Overflow: no overflow list (#1)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #2 - - // Reflow the frame again this time so all the child frames fit. The inline - // frame should use its own overflow list - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "isn't complete"); - - // Verify the overflow list is now empty - if (nsnull != f->OverflowList()) { - printf("Overflow: overflow list should be empty (#2)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #3 - - // Reflow the frame so that only the first frame fits. The rest of the - // children should go on the overflow list. This isn't interesting by - // itself, but it enables the next test - maxSize.width = f->FirstChild()->GetWidth(); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION((f->ChildCount() == 1) && (LengthOf(f->OverflowList()) == 2), "bad overflow list"); - - // Create a continuing frame - InlineFrame* f1 = new InlineFrame(b, 0, nsnull); - - f1->SetStyleContext(f->GetStyleContext(presContext)); - f->SetNextSibling(f1); - f->SetNextInFlow(f1); - f1->SetPrevInFlow(f); - - // Reflow the continuing frame. It should get its children from the overflow list - maxSize.width = 1000; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad continuing frame"); - - // Verify that the overflow list is now empty - if (nsnull != f->OverflowList()) { - printf("Overflow: overflow list should be empty (#3)\n"); - return PR_FALSE; - } - - // and that the continuing frame has the remaining children - if (f1->ChildCount() != (b->ChildCount() - f->ChildCount())) { - printf("Overflow: continuing frame child count is wrong (#3): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // Verify that the content offsets of the continuing frame are correct - if (f1->GetFirstContentOffset() != f1->FirstChild()->GetIndexInParent()) { - printf("Overflow: continuing frame bad first content offset (#3): %d\n", f1->GetFirstContentOffset()); - return PR_FALSE; - } - if (f1->GetLastContentOffset() != (f1->LastChild()->GetIndexInParent())) { - printf("Overflow: continuing frame bad last content offset (#3): %d\n", f1->GetLastContentOffset()); - return PR_FALSE; - } - - NS_RELEASE(b); - return PR_TRUE; -} - -// Test handling of pushing/pulling children -// -// Here's what this function tests: -// 1. continuing frames pick up where their prev-in-flow left off -// 2. pulling up a child from a next-in-flow -// 3. pushing a child frame to a next-in-flow that already has children -// 4. pushing a child frame to an empty next-in-flow -// 5. pulling up children from a next-in-flow that has an overflow list -// 6. pulling up all the children across an empty frame -// 7. pulling up only some of the children across an empty frame -// 8. partially pulling up a child from a next-in-flow -static PRBool -TestPushingPulling(nsIPresContext* presContext) -{ - // Create an HTML container - nsIHTMLContent* b; - NS_NewHTMLContainer(&b, NS_NewAtom("SPAN")); - - // Append three fixed width elements. - b->AppendChild(new FixedSizeContent(100, 100)); - b->AppendChild(new FixedSizeContent(300, 300)); - b->AppendChild(new FixedSizeContent(200, 200)); - - // Create an inline frame for the HTML container and set its - // style context - InlineFrame* f = new InlineFrame(b, 0, nsnull); - nsIStyleContext* styleContext = presContext->ResolveStyleContextFor(b, nsnull); - - f->SetStyleContext(styleContext); - - // Reflow the inline frame so only the first frame fits - nsReflowMetrics reflowMetrics; - nsSize maxSize(100, 1000); - nsIFrame::ReflowStatus status; - - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - /////////////////////////////////////////////////////////////////////////// - // Test #1 - - // Create a continuing inline frame and test that it picks up with the second - // child frame. See TestOverflow() for checking the case where the continuing - // frame uses the overflow list, and TestSplittableChildren() for the - // case where the last child isn't complete - NS_ASSERTION(nsnull == f->OverflowList(), "unexpected overflow list"); - InlineFrame* f1 = new InlineFrame(b, 0, nsnull); - - f1->SetStyleContext(f->GetStyleContext(presContext)); - f->SetNextSibling(f1); - f->SetNextInFlow(f1); - f1->SetPrevInFlow(f); - - // Reflow the continuing inline frame. It should have the remainder of the - // children - maxSize.width = 1000; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad continuing frame"); - - // Verify that the continuing inline frame has the remaining children - if (f1->ChildCount() != (b->ChildCount() - f->ChildCount())) { - printf("PushPull: continuing frame child count is wrong (#1): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #2 - - // Reflow the first inline frame so that two child frames now fit. This tests - // pulling up a child frame from the next-in-flow - maxSize.width = 400; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 2, "bad child count"); - NS_ASSERTION(f1->ChildCount() == 1, "bad continuing child count"); - - // Verify the last content offset of the first inline frame - if (f->GetLastContentOffset() != (f->ChildCount() - 1)) { - printf("PushPull: bad last content offset (#2): %d\n", f->GetLastContentOffset()); - return PR_FALSE; - } - - // Verify that the first/last content offsets of the continuing inline frame - // were updated correctly after pulling up a child - if (f1->GetFirstContentOffset() != f1->FirstChild()->GetIndexInParent()) { - printf("PushPull: continuing frame bad first content offset (#2): %d\n", f1->GetFirstContentOffset()); - return PR_FALSE; - } - if (f1->GetLastContentOffset() != (f1->LastChild()->GetIndexInParent())) { - printf("PushPull: continuing frame bad last content offset (#2): %d\n", f1->GetLastContentOffset()); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #3 - - // Now reflow the inline frame so only the first child fits and verify the pushing - // code works correctly. - // - // This tests the case where we're pushing to a next-in-flow that already has - // child frames - maxSize.width = f->FirstChild()->GetWidth(); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // Verify the last content offset of the first inline frame - if (f->GetLastContentOffset() != 0) { - printf("PushPull: bad last content offset after push (#3): %d\n", - f->GetLastContentOffset()); - return PR_FALSE; - } - - // Verify the continuing inline frame has two children - if (f1->ChildCount() != 2) { - printf("PushPull: continuing child bad child count after push (#3): %d\n", - f1->ChildCount()); - return PR_FALSE; - } - - // Verify its first content offset is correct - if (f1->GetFirstContentOffset() != f1->FirstChild()->GetIndexInParent()) { - printf("PushPull: continuing child bad first content offset after push (#3): %d\n", - f1->GetFirstContentOffset()); - return PR_FALSE; - } - - // and that the last content offset is correct - if (f1->GetLastContentOffset() != (f1->LastChild()->GetIndexInParent())) { - printf("PushPull: continuing child bad last content offset after push (#3): %d\n", - f1->GetLastContentOffset()); - return PR_FALSE; - } - - // Now pull all the frames back to the first inline frame - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - - // Verify the child count and last content offset of the first inline frame - if ((f->ChildCount() != b->ChildCount()) || - (f->GetLastContentOffset() != (f->ChildCount() - 1))) { - printf("PushPull: failed to pull up all the child frames (#3)\n"); - return PR_FALSE; - } - - // The continuing inline frame should have no children - if (f1->ChildCount() != 0) { - printf("PushPull: continuing child is not empty after pulling up all children (#3)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #4 - - // Now reflow the inline frame so only the first child fits and verify the pushing - // code works correctly. - // - // This tests the case where we're pushing to an empty next-in-flow - maxSize.width = f->FirstChild()->GetWidth(); - f1->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow check of next-in-flow - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // Verify the continuing inline frame has two children - if (f1->ChildCount() != 2) { - printf("PushPull: continuing child bad child count after push (#4): %d\n", - f1->ChildCount()); - return PR_FALSE; - } - - // Verify its first content offset is correct - if (f1->GetFirstContentOffset() != f1->FirstChild()->GetIndexInParent()) { - printf("PushPull: continuing child bad first content offset after push (#4): %d\n", - f1->GetFirstContentOffset()); - return PR_FALSE; - } - - // and that the last content offset is correct - if (f1->GetLastContentOffset() != (f1->LastChild()->GetIndexInParent())) { - printf("PushPull: continuing child bad last content offset after push (#4): %d\n", - f1->GetLastContentOffset()); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #5 - - // Test pulling up children from a next-in-flow that has an overflow list. - // Reflow f1 so only one child fits - maxSize.width = 300; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION((f1->ChildCount() == 1) && (f1->GetLastContentOffset() == 1), "bad reflow"); - NS_ASSERTION(nsnull != f1->OverflowList(), "no overflow list"); - - // Now reflow the first inline frame so it's wide enough for all the child frames - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - NS_ASSERTION((f->ChildCount() == 3) && (f->GetLastContentOffset() == 2), "bad mapping"); - - // The second frame should be be empty, and it should not have an overflow list - if (f1->ChildCount() != 0) { - printf("PushPull: continuing child isn't empty (#5)\n"); - return PR_FALSE; - } - if (nsnull != f1->OverflowList()) { - printf("PushPull: continuing child still has overflow list (#5)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #6 - - // Test pulling up all the child frames across an empty frame, i.e. a frame - // from which we've already pulled up all the children - // - // Set it up so that there's one frame in 'f' and one frame in 'f1' - maxSize.width = 100; - f1->BreakFromPrevFlow(); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION((f->ChildCount() == 1) && (f->GetLastContentOffset() == 0), "bad mapping"); - - maxSize.width = 300; - f1->AppendToFlow(f); - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION((f1->ChildCount() == 1) && (f1->GetLastContentOffset() == 1), "bad mapping"); - NS_ASSERTION(nsnull != f1->OverflowList(), "no overflow list"); - - // Now create a third inline frame and have it map the third child frame - InlineFrame* f2 = new InlineFrame(b, 0, nsnull); - - f2->SetStyleContext(f->GetStyleContext(presContext)); - f1->SetNextSibling(f2); - f1->SetNextInFlow(f2); - f2->SetPrevInFlow(f1); - - maxSize.width = 1000; - status = f2->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - NS_ASSERTION(nsnull == f1->OverflowList(), "overflow list"); - - // Now reflow the first inline frame wide enough so all the child frames fit - // XXX This isn't enough and we need one more test. We need to first - // pull up just one child, then reflow the first frame again so all - // the child frames fit. - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify that the inline frame is complete - if (nsIFrame::frComplete != status) { - printf("PushPull: failed to pull-up across empty frame (#6)\n"); - return PR_FALSE; - } - - // Verify the inline frame maps all the children - if ((f->ChildCount() != 3) || (f->GetLastContentOffset() != 2)) { - printf("PushPull: bad last content offset or child count (#6)\n"); - return PR_FALSE; - } - - // Verify that the next two inline frames are empty - if (f1->ChildCount() != 0) { - printf("PushPull: second frame isn't empty (#6)\n"); - return PR_FALSE; - } - if (f2->ChildCount() != 0) { - printf("PushPull: third frame isn't empty (#6)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #7 - - // Test pulling up only some of the child frames across an empty frame, i.e. - // a frame from which we've already pulled up all the children - // - // Set it up so that there's one child frame in the first inline frame - maxSize.width = 100; - f1->BreakFromPrevFlow(); - f2->BreakFromPrevFlow(); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - NS_ASSERTION(f->GetLastContentOffset() == 0, "bad mapping"); - - // And one frame in f1 - maxSize.width = 300; - f1->AppendToFlow(f); - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f1->ChildCount() == 1, "bad child count"); - NS_ASSERTION((f1->GetFirstContentOffset() == 1) && (f1->GetLastContentOffset() == 1), "bad mapping"); - - // And one frame in f2 - f2->AppendToFlow(f1); - maxSize.width = 1000; - status = f2->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - NS_ASSERTION(f2->ChildCount() == 1, "bad child count"); - NS_ASSERTION((f2->GetFirstContentOffset() == 2) && (f2->GetLastContentOffset() == 2), "bad mapping"); - - // Now reflow the first inline frame wide enough so that the first two child - // frames fit - maxSize.width = 400; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // Verify that the first inline frame is not complete - if (nsIFrame::frNotComplete != status) { - printf("PushPull: bad status (#7)\n"); - return PR_FALSE; - } - - // Verify the first inline frame maps two children - if ((f->ChildCount() != 2) || (f->GetLastContentOffset() != 1)) { - printf("PushPull: bad last content offset or child count (#7)\n"); - return PR_FALSE; - } - - // Verify that the second inline frame is empty - if (f1->ChildCount() != 0) { - printf("PushPull: second frame isn't empty (#7)\n"); - return PR_FALSE; - } - - // and that it's content offset must be correct, because the third inline - // frame isn't empty - // Note: don't check the last content offset, because for empty frames the value - // is undefined... - if (f1->GetFirstContentOffset() != f->NextChildOffset()) { - printf("PushPull: second frame bad first content offset (#7): %d\n", f1->GetFirstContentOffset()); - return PR_FALSE; - } - - // Verify that the third inline frame has one child frame - if (f2->ChildCount() != 1) { - printf("PushPull: third frame bad child count (#7): %d\n", f2->ChildCount()); - return PR_FALSE; - } - - // and that its content offsets are correct - if ((f2->GetFirstContentOffset() != 2) || (f2->GetLastContentOffset() != 2)) { - printf("PushPull: third frame bad content mapping (#7)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #8 - - // Test partially pulling up a child. First get all the child frames back into - // the first inline frame, and get rid of the third inline frame - f2->BreakFromPrevFlow(); - f1->SetNextSibling(nsnull); - - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 3, "bad child count"); - f1->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow checks below - - // Now reflow the first inline frame so there are two frames pushed to the - // next-in-flow - maxSize.width = 100; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION((f->ChildCount() == 1) && (f1->ChildCount() == 2), "bad child count"); - - // Reflow the first inline frame so that part only part of the second child frame - // fits. In order to test this we need to make the second piece of content - // splittable - FixedSizeContent* c2 = (FixedSizeContent*)b->ChildAt(1); - c2->SetIsSplittable(PR_TRUE); - - maxSize.width = 250; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - - // The first inline frame should have two child frames - if (f->ChildCount() != 2) { - printf("PushPull: bad child count when pulling up (#8): %d\n", f->ChildCount()); - return PR_FALSE; - } - - // it should have a last content offset of 1, and it's last content should - // not be complete - if ((f->GetLastContentOffset() != 1) || f->LastContentIsComplete()) { - printf("PushPull: bad content mapping when pulling up (#8)\n"); - return PR_FALSE; - } - - // The continuing inline frame should also have two child frame - if (f1->ChildCount() != 2) { - printf("PushPull: continuing frame bad child count (#8): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // and correct content offsets - if ((f1->GetFirstContentOffset() != f1->FirstChild()->GetIndexInParent()) || - (f1->GetLastContentOffset() != (f1->LastChild()->GetIndexInParent()))) { - printf("PushPull: continuing frame bad mapping (#8)\n"); - return PR_FALSE; - } - - // The first child of f1 should be in the flow - if (f1->FirstChild()->GetPrevInFlow() != f->LastChild()) { - printf("PushPull: continuing frame bad flow (#8)\n"); - return PR_FALSE; - } - - NS_RELEASE(b); - return PR_TRUE; -} - -// Test handling of splittable children -// -// Here's what this function tests: -// 1. reflow unmapped correctly handles child frames that need to split -// 2. reflow mapped correctly handles when the last child is incomplete -// 3. reflow mapped correctly handles the case of a child that's incomplete -// and that already has a next-in-flow -// 4. reflow mapped handles the case where a child that's incomplete now fits -// when reflowed again -// a) when the child has a next-in-flow -// b) when the child doesn't have a next-in-flow -// 5. continuing frame checks its prev-in-flow's last child and if it's incomplete -// creates a continuing frame -// 6. reflow mapped correctly handles child frames that need to be continued -// 7. pulling up across empty frames resulting from deleting a child's next-in-flows -static PRBool -TestSplittableChildren(nsIPresContext* presContext) -{ - // Create an HTML container - nsIHTMLContent* b; - NS_NewHTMLContainer(&b, NS_NewAtom("SPAN")); - - // Append three fixed width elements that can split - b->AppendChild(new FixedSizeContent(100, 100, PR_TRUE)); - b->AppendChild(new FixedSizeContent(300, 300, PR_TRUE)); - b->AppendChild(new FixedSizeContent(200, 200, PR_TRUE)); - - // Create an inline frame for the HTML container and set its - // style context - InlineFrame* f = new InlineFrame(b, 0, nsnull); - nsIStyleContext* styleContext = presContext->ResolveStyleContextFor(b, nsnull); - - f->SetStyleContext(styleContext); - - /////////////////////////////////////////////////////////////////////////// - // Test #1 - - // Reflow the inline frame so only half of the first frame fits. This tests - // reflow unmapped - nsReflowMetrics reflowMetrics; - nsSize maxSize(50, 1000); - nsIFrame::ReflowStatus status; - - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // Verify that the inline frame isn't complete - if (nsIFrame::frNotComplete != status) { - printf("Splittable: inline frame should be incomplete (#1): %d\n", status); - return PR_FALSE; - } - - // Verify the last content offset is correct - if (f->GetLastContentOffset() != 0) { - printf("Splittable: wrong last content offset (#1): %d\n", f->GetLastContentOffset()); - return PR_FALSE; - } - - // Verify that the last child isn't complete - if (f->LastContentIsComplete()) { - printf("Splittable: child should not be complete (#1)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #2 - - // Now reflow the inline frame again and test reflow mapped - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // The inline frame should still be incomplete with a last content offset of 0 - if ((nsIFrame::frNotComplete != status) || - (f->GetLastContentOffset() != 0) || (f->LastContentIsComplete())) { - printf("Splittable: reflow mapped failed (#2)\n"); - return PR_FALSE; - } - - // There should be an overflow list containing the first child's next-in-flow - if ((nsnull == f->OverflowList()) || - (f->OverflowList() != f->FirstChild()->GetNextInFlow())) { - printf("Splittable: should be an overflow list (#2)\n"); - return PR_FALSE; - } - - // Verify that the first child has a null next sibling. Children on the overflow - // list should be disconnected from the mapped children - if (nsnull != f->FirstChild()->GetNextSibling()) { - printf("Splittable: first child has overflow list as next sibling (#2)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #3 - - // Reflow it again with the same size and make sure we don't add any more - // frames to the overflow list - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // The inline frame should still have a last content offset of 0 and - // the last content child should still be incomplete - if ((f->GetLastContentOffset() != 0) || (f->LastContentIsComplete())) { - printf("Splittable: reflow mapped again failed (#3)\n"); - return PR_FALSE; - } - - // The overflow list should still have only one child - if (LengthOf(f->OverflowList()) != 1) { - printf("Splittable: reflow mapped again has bad overflow list (#3)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #4a - - // Now reflow the inline frame so that the the first child now completely fits. - // This tests how reflow mapped handles the case of a child that's incomplete - // and has a next-in-flow, and when reflowed now fits. - maxSize.width = 100; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // The inline frame should have a last content offset of 0 - if (f->GetLastContentOffset() != 0) { - printf("Splittable: wrong last content offset (#4a): %d\n", - f->GetLastContentOffset()); - return PR_FALSE; - } - - // The first child should now be complete - if (!f->LastContentIsComplete()) { - printf("Splittable: last child isn't complete (#4a)\n"); - return PR_FALSE; - } - - // it should not have a next-in-flow - if (nsnull != f->FirstChild()->GetNextInFlow()) { - printf("Splittable: unexpected next-in-flow (#4a)\n"); - return PR_FALSE; - } - - // and there should be no overflow list - if (nsnull != f->OverflowList()) { - printf("Splittable: unexpected overflow list (#4a)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #4b - - // This is a variation of the previous test where the child doesn't have - // a next-in-flow. Reflow the inline frame so the first child is incomplete - maxSize.width = 50; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(!f->LastContentIsComplete(), "last child should be incomplete"); - NS_ASSERTION(nsnull != f->OverflowList(), "no overflow list"); - NS_ASSERTION(f->FirstChild()->GetNextInFlow() == f->OverflowList(), "bad next-in-flow"); - - // Now get rid of the overflow list and the first child's next-in-flow - f->FirstChild()->SetNextInFlow(nsnull); - f->ClearOverflowList(); - - // Now reflow the inline frame so the first child fits. This tests that we - // correctly reset mLastContentIsComplete when the frame that was incomplete - // doesn't have a next-in-flow - maxSize.width = 100; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION(f->ChildCount() == 1, "bad child count"); - - // Verify that the first child is complete - if (!f->LastContentIsComplete()) { - printf("Splittable: last content is NOT complete (#4b)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #5 - - // Create a continuing inline frame and have it pick up with the second - // child - InlineFrame* f1 = new InlineFrame(b, 0, nsnull); - - f1->SetStyleContext(f->GetStyleContext(presContext)); - f->SetNextSibling(f1); - f->SetNextInFlow(f1); - f1->SetPrevInFlow(f); - - // Reflow the continuing inline frame so its second frame is not complete - maxSize.width = 150; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - NS_ASSERTION((f1->GetFirstContentOffset() == 1) && (f1->GetLastContentOffset() == 1), "bad offsets"); - NS_ASSERTION(!f1->LastContentIsComplete(), "should not be complete"); - - // Create a third continuing inline frame and verify that it picks up by continuing - // the second child frame. This tests the case where the prev-in-flow's last - // child isn't complete and there's no overflow list - NS_ASSERTION(nsnull == f1->OverflowList(), "unexpected overflow list"); - InlineFrame* f2 = new InlineFrame(b, 0, nsnull); - - f2->SetStyleContext(f->GetStyleContext(presContext)); - f1->SetNextSibling(f2); - f1->SetNextInFlow(f2); - f2->SetPrevInFlow(f1); - - // Make the width large enough for all the remaining frames to fit - maxSize.width = 1000; - status = f2->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - - // Verify the first child is a continuing frame of its prev-in-flow's - // child - if (f2->FirstChild()->GetPrevInFlow() != f1->FirstChild()) { - printf("Splittable: child frame bad prev-in-flow (#5)\n"); - return PR_FALSE; - } - - // Verify the two child frames have the same content offset and so - // do their parents - if ((f2->FirstChild()->GetIndexInParent() != f1->FirstChild()->GetIndexInParent()) || - (f2->GetFirstContentOffset() != f1->GetFirstContentOffset())) { - printf("Splittable: bad content offset (#5)\n"); - return PR_FALSE; - } - - // Verify that the third continuing inline frame is complete and that it has two children - if ((nsnull != f2->FirstChild()->GetNextInFlow()) || (f2->ChildCount() != 2)) { - printf("Splittable: bad continuing frame (#5)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #6 - - // Test how reflow mapped handles the case where an existing child doesn't - // fit when reflowed. We care about the case where the child doesn't have - // a continuing frame and so we have to create one - // - // Reflow the first inline frame so all the child frames fit - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - NS_ASSERTION((f->ChildCount() == 3) && (f->GetLastContentOffset() == 2), "bad count"); - - f1->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow checks - f2->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow checks - - // Now reflow it so that the first child needs to be continued - maxSize.width = 50; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - - // Verify there's only one child in f - if (f->ChildCount() != 1) { - printf("Splittable: bad child count (#6): %d\n", f->ChildCount()); - return PR_FALSE; - } - - // Verify the last content offset and that the last content is not complete - if ((f->GetLastContentOffset() != 0) || f->LastContentIsComplete()) { - printf("Splittable: bad content mapping (#6)\n"); - return PR_FALSE; - } - - // Verify that there are three children in the next-in-flow, and that - // the first child is a continuing frame - if (f1->ChildCount() != 3) { - printf("Splittable: continuing frame bad child count (#6): %d\n", - f1->ChildCount()); - return PR_FALSE; - } - if (f1->FirstChild()->GetPrevInFlow() != f->LastChild()) { - printf("Splittable: continuing frame bad child flow (#6)\n"); - return PR_FALSE; - } - - // Verify the next-in-flow's content offsets - if ((f1->GetFirstContentOffset() != 0) || (f1->GetLastContentOffset() != 2)) { - printf("Splittable: continuing frame bad mapping (#6)\n"); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #7 - - // Test pulling up across empty frames resulting from deleting a child - // frame's next-in-flows - // - // Reflow the first inline frame so all the child frames fit - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad status"); - NS_ASSERTION((f->ChildCount() == 3) && (f->GetLastContentOffset() == 2), "bad count"); - - f1->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow checks - f2->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow checks - - // Now reflow the first inline frame so that the second child frame is continued - maxSize.width = 200; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - - // Verify the first inline frame's child count is correct - if (f->ChildCount() != 2) { - printf("Splittable: bad child count (#7): %d\n", f->ChildCount()); - return PR_FALSE; - } - - // Verify the last content offset and that the last frame isn't complete - if ((f->GetLastContentOffset() != 1) || (f->LastContentIsComplete())) { - printf("Splittable: bad mapping (#7)\n"); - return PR_FALSE; - } - - // The second inline frame should have two children as well - if (f1->ChildCount() != 2) { - printf("Splittable: continuing frame bad child count (#7): %d\n", f1->ChildCount()); - return PR_FALSE; - } - - // and that its content offsets are correct - if ((f1->GetFirstContentOffset() != 1) || (f1->GetLastContentOffset() != 2)) { - printf("Splittable: continuing frame bad mapping (#7)\n"); - return PR_FALSE; - } - - // Now reflow the second inline frame so that only the continuing child frame - // fits and the last frame is pushed to the third inline frame - maxSize.width = 200; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); - - // Verify the second inline frame's child count and last content offset - if ((f1->ChildCount() != 1) || (f1->GetLastContentOffset() != 1)) { - printf("Splittable: continuing frame bad child count or mapping (#7)\n"); - return PR_FALSE; - } - - // Verify the third inline frame maps the last child frame and has correct - // content offsets - if ((f2->ChildCount() != 1) || - (f2->GetFirstContentOffset() != 2) || (f2->GetLastContentOffset() != 2)) { - printf("Splittable: last continuing frame bad child count or mapping (#7)\n"); - return PR_FALSE; - } - - // Now the real test. Reflow the first inline frame so all the child frames fit. - // What we're testing is that the pull-up code correctly handles the case where - // there's an empty frame that results from the second child frame's next-in-flow - // being deleted - maxSize.width = 1000; - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - - // The inline frame should be complete and map all three child frames - if ((nsIFrame::frComplete != status) || (f->ChildCount() != 3)) { - printf("Splittable: first inline frame does not map all the child frames (#7)\n"); - return PR_FALSE; - } - - NS_RELEASE(b); - return PR_TRUE; -} - -// Test computing the max element size -// -// Here's what this function tests: -// 1. reflow unmapped correctly computes the max element size -// 2. reflow mapped correctly computes the max element size -// 3. reflow mapped/unmapped work together to compute the correct result -// 4. pulling-up children code computes the correct result -static PRBool -TestMaxElementSize(nsIPresContext* presContext) -{ - // Create an HTML container - nsIHTMLContent* b; - NS_NewHTMLContainer(&b, NS_NewAtom("SPAN")); - - // Append three fixed width elements. - b->AppendChild(new FixedSizeContent(100, 100)); - b->AppendChild(new FixedSizeContent(300, 300)); - b->AppendChild(new FixedSizeContent(200, 200)); - - // Create an inline frame for the HTML container and set its - // style context - InlineFrame* f = new InlineFrame(b, 0, nsnull); - nsIStyleContext* styleContext = presContext->ResolveStyleContextFor(b, nsnull); - - f->SetStyleContext(styleContext); - - /////////////////////////////////////////////////////////////////////////// - // Test #1 - - // Reflow the inline frame and check our max element size computation when reflowing - // unmapped children - // - // Note: we've already tested elsewhere that we correctly handle the case - // where aMaxElementSize is NULL and that we don't GPF... - nsSize maxElementSize(0, 0); - nsReflowMetrics reflowMetrics; - nsSize maxSize(1000, 1000); - nsIFrame::ReflowStatus status; - - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - - // Verify that the max element size is correct - NS_ASSERTION(nsIFrame::frComplete == status, "isn't complete"); - if ((maxElementSize.width != f->MaxChildWidth()) || - (maxElementSize.height != f->MaxChildHeight())) { - printf("MaxElementSize: wrong result in reflow unmapped (#1): (%d, %d)\n", - maxElementSize.width, maxElementSize.height); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #2 - - // Now compute it again and check the computation when reflowing - // mapped children - maxElementSize.SizeTo(0, 0); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION(nsIFrame::frComplete == status, "isn't complete"); - - if ((maxElementSize.width != f->MaxChildWidth()) || - (maxElementSize.height != f->MaxChildHeight())) { - printf("MaxElementSize: wrong result in reflow mapped (#2): (%d, %d)\n", - maxElementSize.width, maxElementSize.height); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #3 - - // Check that reflow mapped/unmapped work together. Reflow the inline frame - // so that only the first two frames (including the largest frame) fit - nsIFrame* maxChild = f->ChildAt(1); - nsPoint origin; - - maxChild->GetOrigin(origin); - maxSize.width = origin.x + maxChild->GetWidth(); - maxElementSize.SizeTo(0, 0); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - - if ((nsIFrame::frNotComplete != status) || (f->ChildCount() != 2)) { - printf("MaxElementSize: reflow failed (#3)\n"); - return PR_FALSE; - } - - // Now reflow it again and check that the maximum element size is correct - maxSize.width = 1000; - maxElementSize.SizeTo(0, 0); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION(nsIFrame::frComplete == status, "isn't complete"); - - if ((maxElementSize.width != f->MaxChildWidth()) || - (maxElementSize.height != f->MaxChildHeight())) { - printf("MaxElementSize: wrong result in reflow mapped/unmapped (#3): (%d, %d)\n", - maxElementSize.width, maxElementSize.height); - return PR_FALSE; - } - - /////////////////////////////////////////////////////////////////////////// - // Test #4 - - // Last thing to check is pulling up children. Reflow it so only the first two - // frames (including the largest frame) fit - maxChild = f->ChildAt(1); - maxChild->GetOrigin(origin); - maxSize.width = origin.x + maxChild->GetWidth(); - maxElementSize.SizeTo(0, 0); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION(f->ChildCount() == 2, "unexpected child count"); - - // Create a continuing inline frame and reflow it - InlineFrame* f1 = new InlineFrame(b, 0, nsnull); - - f1->SetStyleContext(f->GetStyleContext(presContext)); - f->SetNextSibling(f1); - f->SetNextInFlow(f1); - f1->SetPrevInFlow(f); - maxSize.width = 1000; - status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION((nsIFrame::frComplete == status) && (f1->ChildCount() == 1), "bad continuing frame"); - - // Now reflow the first inline frame so all child frames fit, and verify the - // max element size is correct - maxElementSize.SizeTo(0, 0); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION(nsIFrame::frComplete == status, "isn't complete"); - NS_ASSERTION(f1->ChildCount() == 0, "pull-up failed"); - - if ((maxElementSize.width != f->MaxChildWidth()) || - (maxElementSize.height != f->MaxChildHeight())) { - printf("MaxElementSize: wrong result in reflow mapped/pull-up (#4): (%d, %d)\n", - maxElementSize.width, maxElementSize.height); - return PR_FALSE; - } - - // Now reflow it so that the largest size frame is in the continuing inline frame - f1->SetFirstContentOffset(f->NextChildOffset()); // don't trigger pre-reflow checks - maxSize.width = f->FirstChild()->GetWidth(); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION(f->ChildCount() == 1, "unexpected child count"); - NS_ASSERTION(f1->ChildCount() == 2, "unexpected child count"); - - // Now reflow the first inline frame so all child frames fit, and verify the - // max element size is correct - maxSize.width = 1000; - maxElementSize.SizeTo(0, 0); - status = f->ResizeReflow(presContext, reflowMetrics, maxSize, &maxElementSize); - NS_ASSERTION(nsIFrame::frComplete == status, "isn't complete"); - NS_ASSERTION(f1->ChildCount() == 0, "pull-up failed"); - - if ((maxElementSize.width != f->MaxChildWidth()) || - (maxElementSize.height != f->MaxChildHeight())) { - printf("MaxElementSize: wrong result in reflow mapped/pull-up (#4): (%d, %d)\n", - maxElementSize.width, maxElementSize.height); - return PR_FALSE; - } - - NS_RELEASE(b); - return PR_TRUE; -} -#endif - -int main(int argc, char** argv) -{ -#if 0 - // Create test document and presentation context - MyDocument *myDoc = new MyDocument(); - nsIPresContext* presContext; - - NS_NewGalleyContext(&presContext); - - // Test basic reflowing of unmapped children - if (!TestReflowUnmapped(presContext)) { - return -1; - } - - // Test the case where the frame max size is too small for even one child frame - if (!TestChildrenThatDontFit(presContext)) { - return -1; - } - - if (!TestOverflow(presContext)) { - return -1; - } - - if (!TestPushingPulling(presContext)) { - return -1; - } - - if (!TestSplittableChildren(presContext)) { - return -1; - } - - if (!TestMaxElementSize(presContext)) { - return -1; - } - - /* - if (!TestIncremental(presContext)) { - return -1; - } - - if (!TestBorderPadding(presContext)) { - return -1; - } - - if (!TestChildMargins(presContext)) { - return -1; - } - - if (!TestAlignment(presContext)) { - return -1; - } - - if (!TestDisplayNone(presContext)) { - return -1; - } - - if (!TestRelativePositioning(presContext)) { - return -1; - } - - if (!TestAbsolutePositiong(presContext)) { - return -1; - } - */ - - presContext->Release(); - myDoc->Release(); -#endif - return 0; -} diff --git a/mozilla/layout/html/tests/css/INVALID.css b/mozilla/layout/html/tests/css/INVALID.css deleted file mode 100644 index bdd29017096..00000000000 --- a/mozilla/layout/html/tests/css/INVALID.css +++ /dev/null @@ -1,391 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -// Test of illegal CSS1 input. -// Illegal @ rules -@ignored; -P { color: purple } -@ignored [ skip me ]; -P { color: purple } -@ignored { skip me } -P { color: purple } -@ignored ( skip me too ); -P { color: purple } - -// Handle dangling semi-colons. Outside the scope of the CSS1 document -// but a reasonable parser should be able to eat them. -@extra-semicolon;; -P { color: purple } - -// These are all properties that have an extra keyword (fish) at the -// end. CSS1 says that such properties are to be ignored. Because the -// properties are all set in the BODY tag we can see if anything -// happens to invalid.html when this sheet is loaded (there should be -// no effect because the entire declaration block should be skipped). -BODY { - word-spacing: normal fish; - wOrd-spacing: 12.0em fish; - WoRd-Spacing: 12.0eX fish; - worD-Spacing: 12PX fish; - word-Spacing: 12.0In fish; - word-sPacing: 12.0cm fish; - word-spAcing: 12.0mm fish; - word-spaCing: 12.0pt fish; - word-spacIng: 12.0pc fish; - color: red fish; - color: rgb(0, 0, 0) fish; - color: rGb(110%, 23, 9123784328342834) fish; - color: #f00 fish; - color: #ff00ff fish; - background: red none repeat scroll 20% 30% fish; - background: none repeat scroll 20% 30% red fish; - background: repeat scroll 20% 30% red none fish; - background: scroll 20% 30% red none repeat fish; - background: 20% 30% red none repeat scroll fish; - background-color: blue fish; - background-color: rgb(0, 0, 0) fish; - background-color: rGb(110%, 23, 9123784328342834) fish; - BackGround-Color: Transparent fish; - background-image: none fish; - background-image: url(fowl.url) fish; - background-image: url( fowl.url ) fish; - background-image: url( "fowl.url" ) fish; - background-image: url( 'fowl.url' ) fish; - background-repeat: repeat fish; - background-repeat: repeat-x fish; - background-repeat: repeat-y fish; - background-repeat: no-repeat fish; - Background-Attachment: Scroll fish; - Background-Attachment: Fixed fish; - background-position: 73% fish; - background-position: -73% fish; - background-position: +3% fish; - background-position: +3.5% fish; - background-position: 10% 20% fish; - background-position: 10% 23in fish; - background-position: 23in fish; - background-position: 23in 10% fish; - Background-Position: 23IN 30CM fish; - Background-Position: top left fish; - Background-Position: left top fish; - Background-Position: top fish; - Background-Position: top center fish; - Background-Position: center top fish; - Background-Position: right top fish; - Background-Position: top right fish; - Background-Position: left fish; - Background-Position: left center fish; - Background-Position: center left fish; - Background-Position: right fish; - Background-Position: right center fish; - Background-Position: center right fish; - Background-Position: bottom fish; - Background-Position: bottom center fish; - Background-Position: center bottom fish; - Background-Position: bottom right fish; - Background-Position: right bottom fish; - font: italic small-caps bold 12pt helvetica - font: italic bold small-caps 12pt helvetica - font: small-caps bold italic 12pt helvetica - font: small-caps italic bold 12pt helvetica - font: bold italic small-caps 12pt helvetica - font: bold small-caps italic 12pt helvetica - font: bold 12pt helvetica - font: 12pt helvetica - font: 12pt/14pt sans-serif 27; - font: 80% sans-serif 27; - font: x-large/110% "new century schoolbook", serif 27; - font: bold italic large Palatino, serif 27; - font: normal small-caps 120%/120% fantasy 27; - font-family: gill, helvetica, times new roman, sans-serif 27; - font-style: normal fish; - font-style: italic fish; - font-style: oblique fish; - font-variant: normal fish; - font-variant: small-caps fish; - font-weight: normal fish; - font-weight: bold fish; - font-weight: bolder fish; - font-weight: lighter fish; - font-weight: 100 fish; - font-weight: 200 fish; - font-weight: 300 fish; - font-weight: 400 fish; - font-weight: 500 fish; - font-weight: 600 fish; - font-weight: 700 fish; - font-weight: 800 fish; - font-weight: 900 fish; - font-size: Xx-smAll fish; - font-size: x-Small fish; - font-size: Small fish; - font-size: Medium fish; - font-size: LaRgE fish; - font-size: x-LaRgE fish; - font-size: Xx-LaRgE fish; - font-size: LaRgEr fish; - font-size: smalLer fish; - font-size: 3.0in fish; - font-size: 120% fish; - letter-spacing: normal fish; - letter-spacing: 3.0in fish; - text-decoration: none fish; - text-decoration: underline fish; - text-decoration: overline underline fish; - text-decoration: line-through overline underline fish; - text-decoration: blink line-through overline underline fish; - vertical-align: baseline fish; - vertical-align: sub fish; - vertical-align: super fish; - vertical-align: top fish; - vertical-align: text-top fish; - vertical-align: middle fish; - vertical-align: bottom fish; - vertical-align: text-bottom fish; - vertical-align: 120% fish; - text-transform: capitalize fish; - text-transform: uppercase fish; - text-transform: lowercase fish; - text-transform: none fish; - text-align: left fish; - text-align: right fish; - text-align: center fish; - text-align: justify fish; - text-indent: 3.0in fish; - text-indent: 120% fish; - line-height: normal fish; - line-height: 17 fish; - line-height: 17.0in fish; - line-height: 17% fish; - margin-top: 17.0in fish; - margin-top: 120% fish; - margin-top: auto fish; - margin-right: 17.0in fish; - margin-right: 120% fish; - margin-right: auto fish; - margin-bottom: 17.0in fish; - margin-bottom: 120% fish; - margin-bottom: auto fish; - margin-left: 17.0in fish; - margin-left: 120% fish; - margin-left: auto fish; - margin: 17.0in fish; - margin: 120% fish; - margin: auto fish; - margin: 17.0in auto fish; - margin: 17.0in 120% fish; - margin: 17.0in 17.0in fish; - margin: 120% 17.0in fish; - margin: 120% auto fish; - margin: 120% 120% fish; - margin: auto 120% fish; - margin: auto 17.0in fish; - margin: auto auto fish; - margin: 17.0in 17.0in 17.0in fish; - margin: 17.0in 17.0in 120% fish; - margin: 17.0in 17.0in auto fish; - margin: 17.0in 120% 17.0in fish; - margin: 17.0in auto 17.0in fish; - margin: 17.0in 17.0in 17.0in 17.0in fish; - margin: 17.0in 120% 17.0in 17.0in fish; - margin: 120% 120% 17.0in 17.0in fish; - margin: 120% 120% 120% 17.0in fish; - margin: 120% 120% 120% 120% fish; - padding-top: 17.0in fish; - padding-top: 120% fish; - padding-right: 17.0in fish; - padding-right: 120% fish; - padding-bottom: 17.0in fish; - padding-bottom: 120% fish; - padding-left: 17.0in fish; - padding-left: 120% fish; - padding: 17.0in fish; - padding: 120% fish; - padding: 17.0in 120% fish; - padding: 17.0in 17.0in fish; - padding: 120% 17.0in fish; - padding: 120% 120% fish; - padding: 17.0in 17.0in 17.0in fish; - padding: 17.0in 17.0in 120% fish; - padding: 17.0in 120% 17.0in fish; - padding: 17.0in 17.0in 17.0in 17.0in fish; - padding: 17.0in 120% 17.0in 17.0in fish; - padding: 120% 120% 17.0in 17.0in fish; - padding: 120% 120% 120% 17.0in fish; - padding: 120% 120% 120% 120% fish; - border-top-width: thin fish; - border-top-width: medium fish; - border-top-width: thick fish; - border-top-width: 3.0in fish; - border-right-width: thin fish; - border-right-width: medium fish; - border-right-width: thick fish; - border-right-width: 3.0in fish; - border-bottom-width: thin fish; - border-bottom-width: medium fish; - border-bottom-width: thick fish; - border-bottom-width: 3.0in fish; - border-left-width: thin fish; - border-left-width: medium fish; - border-left-width: thick fish; - border-left-width: 3.0in fish; - border-width: thin fish; - border-width: 3.0in fish; - border-width: thick thick fish; - border-width: 3.0in thick fish; - border-width: thin 3.0in thick fish; - border-width: 3.0in thick thin fish; - border-width: 3.0in thick medium fish; - border-color: red fish; - border-color: red blue fish; - border-color: red blue rgb(0, 0, 0) fish; - border-color: red blue green yellow fish; - border-style: none fish; - border-style: dotted fish; - border-style: dashed fish; - border-style: solid fish; - border-style: double fish; - border-style: groove fish; - border-style: ridge fish; - border-style: inset fish; - border-style: outset fish; - border-style: dashed none fish; - border-style: dashed dotted none fish; - border-style: dashed dotted inset none fish; - border-top: 3.0in fish; - border-top: thin fish; - border-top: 3.0in dashed fish; - border-top: thin dotted fish; - border-top: 3.0in dashed red fish; - border-top: thin dotted green fish; - border-top: green thin dotted fish; - border-top: green dotted thin fish; - border-right: 3.0in fish; - border-right: thin fish; - border-right: 3.0in dashed fish; - border-right: thin dotted fish; - border-right: 3.0in dashed red fish; - border-right: thin dotted green fish; - border-right: green thin dotted fish; - border-right: green dotted thin fish; - border-bottom: 3.0in fish; - border-bottom: thin fish; - border-bottom: 3.0in dashed fish; - border-bottom: thin dotted fish; - border-bottom: 3.0in dashed red fish; - border-bottom: thin dotted green fish; - border-bottom: green thin dotted fish; - border-bottom: green dotted thin fish; - border-left: 3.0in fish; - border-left: thin fish; - border-left: 3.0in dashed fish; - border-left: thin dotted fish; - border-left: 3.0in dashed red fish; - border-left: thin dotted green fish; - border-left: green thin dotted fish; - border-left: green dotted thin fish; - border: 3.0in fish; - border: thin fish; - border: 3.0in dashed fish; - border: thin dotted fish; - border: 3.0in dashed red fish; - border: thin dotted green fish; - border: green thin dotted fish; - border: green dotted thin fish; - width: 3.0in fish; - width: 120% fish; - width: auto fish; - height: 3.0in fish; - height: auto fish; - float: left fish; - float: right fish; - float: none fish; - clear: none fish; - clear: left fish; - clear: right fish; - clear: both fish; - white-space: normal fish; - white-space: pre fish; - white-space: nowrap fish; - list-style-type: disc fish; - list-style-type: circle fish; - list-style-type: square fish; - list-style-type: decimal fish; - list-style-type: lower-roman fish; - list-style-type: upper-roman fish; - list-style-type: lower-alpha fish; - list-style-type: upper-alpha fish; - list-style-type: none fish; - list-style-image: none fish; - list-style-image: url(fowl.gif) fish; - list-style-position: inside fish; - list-style-position: outside fish; - list-style: disc fish; - list-style: disc inside fish; - list-style: inside disc fish; - list-style: inside disc url(fowl.gif) fish; - list-style: disc url(fowl.gif) inside fish; - list-style: url(fowl.gif) inside disc fish; -} -P { color: purple } - -// Illegal color values -InvalidColor { - color: RGB(110; - color: RGB(110,; - color: RGB(110, 23; - color: RGB(110, 23,; - color: RGB(110, 23, 37; - color: RGB(110, 23, fowl; - color: RGB(110%, 23); - color: RGB(110%); - color: #7xy; - color: #777888999; - color:; - color:#; - color:#x; - color:#7; -} -P { color: purple } - -// Illegal numeric values -InvalidNumber { - list-indent: 2..3; - list-indent: 17a; - list-indent: 1.0e25; - list-indent: 10quadloos; -} -P { color: purple } - -// Illegal url values -InvalidURL { - background-image: url; - background-image: url(goaway; - background-image: url( this (is) some nonsense ); -} -P { color: purple } - -// Illegal rules -P[align], UL { - color: red; - font-size: large -} -P { color: purple } - -!27 32 hike! { - color: red; -} -P { color: purple } diff --git a/mozilla/layout/html/tests/css/SELECTORS.css b/mozilla/layout/html/tests/css/SELECTORS.css deleted file mode 100644 index 84a90807133..00000000000 --- a/mozilla/layout/html/tests/css/SELECTORS.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -// Combinatorics for selectors -Tag { color: purple } -Tag#Id { color: purple } -Tag#Id.Class { color: purple } -Tag#Id.Class:Pseudo { color: purple } -Tag#Id:Pseudo { color: purple } -Tag.Class { color: purple } -Tag.Class:Pseudo { color: purple } -Tag:Pseudo { color: purple } -#Id { color: purple } -#Id.Class { color: purple } -#Id.Class:Pseudo { color: purple } -#Id:Pseudo { color: purple } -.Class { color: purple } -.Class:Pseudo { color: purple } -:Pseudo { color: purple } diff --git a/mozilla/layout/html/tests/css/background-attachment.css b/mozilla/layout/html/tests/css/background-attachment.css deleted file mode 100644 index caf801e05df..00000000000 --- a/mozilla/layout/html/tests/css/background-attachment.css +++ /dev/null @@ -1,28 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { Background-Attachment: Scroll; } -GOOD { Background-Attachment: Fixed; } -BAD { Background-Attachments: Fixed; } -BAD { Background-Attachment: Scroll Fixed; } -BAD { Background-Attachment: Fixed tiny; } -BAD { Background-Attachment: tiny Scroll; } -BAD { Background-Attachment: tiny Fixed; } -BAD { Background-Attachment: medium; } -BAD { Background-Attachment: 12pt; } -BAD { Background-Attachment: red; } -BAD { Background-Attachment: url("foo.html"); } -BAD { Background-Attachment: smelly; } diff --git a/mozilla/layout/html/tests/css/background-color.css b/mozilla/layout/html/tests/css/background-color.css deleted file mode 100644 index 4175cdf90fb..00000000000 --- a/mozilla/layout/html/tests/css/background-color.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { background-color: blue; } -GOOD { background-color: rgb(0, 0, 0); } -GOOD { background-color: rGb(110%, 23, 9123784328342834); } -GOOD { BackGround-Color: Transparent; } -BAD { BackGround-Color: beeble; } -BAD { BackGround-Color: 27; } -BAD { BackGround-Color: #23; } -BAD { BackGround-Color: url(fish; } diff --git a/mozilla/layout/html/tests/css/background-image.css b/mozilla/layout/html/tests/css/background-image.css deleted file mode 100644 index 5e273811cb3..00000000000 --- a/mozilla/layout/html/tests/css/background-image.css +++ /dev/null @@ -1,23 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { background-image: none; } -GOOD { background-image: url(fowl.url); } -GOOD { background-image: url( fowl.url ); } -GOOD { background-image: url( "fowl.url" ); } -GOOD { background-image: url( 'fowl.url' ); } -BAD { background-image: none url(fowl.url); } -BAD { background-image: url(fowl.url) none; } diff --git a/mozilla/layout/html/tests/css/background-position.css b/mozilla/layout/html/tests/css/background-position.css deleted file mode 100644 index 0e6313dca74..00000000000 --- a/mozilla/layout/html/tests/css/background-position.css +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { background-position: 73%; } -GOOD { background-position: -73%; } -GOOD { background-position: +3%; } -GOOD { background-position: +3.5%; } -GOOD { background-position: 10% 20%; } -GOOD { background-position: 10% 23in; } -GOOD { background-position: 23in; } -GOOD { background-position: 23in 10%; } -GOOD { Background-Position: 23IN 30CM; } -GOOD { Background-Position: top left; } -GOOD { Background-Position: left top; } -GOOD { Background-Position: top; } -GOOD { Background-Position: top center; } -GOOD { Background-Position: center top; } -GOOD { Background-Position: right top; } -GOOD { Background-Position: top right; } -GOOD { Background-Position: left; } -GOOD { Background-Position: left center; } -GOOD { Background-Position: center left; } -GOOD { Background-Position: right; } -GOOD { Background-Position: right center; } -GOOD { Background-Position: center right; } -GOOD { Background-Position: bottom; } -GOOD { Background-Position: bottom center; } -GOOD { Background-Position: center bottom; } -GOOD { Background-Position: bottom right; } -GOOD { Background-Position: right bottom; } diff --git a/mozilla/layout/html/tests/css/background-repeat.css b/mozilla/layout/html/tests/css/background-repeat.css deleted file mode 100644 index d8ff9010e80..00000000000 --- a/mozilla/layout/html/tests/css/background-repeat.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { background-repeat: repeat; } -GOOD { background-repeat: repeat-x; } -GOOD { background-repeat: repeat-y; } -GOOD { background-repeat: no-repeat; } -BAD { background-repeat: medium; } -BAD { background-repeat: #23; } -BAD { background-repeat: 23pt; } -BAD { background-repeat: "foo"; } -BAD { background-repeat: repeat-x repeat-y; } diff --git a/mozilla/layout/html/tests/css/background.css b/mozilla/layout/html/tests/css/background.css deleted file mode 100644 index 9919c28fd7e..00000000000 --- a/mozilla/layout/html/tests/css/background.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { background: red; } -GOOD { background: red repeat-x; } -GOOD { background: red fixed; } -GOOD { background: fixed 20% 30%; } -GOOD { background: red none repeat scroll 20% 30%; } -GOOD { background: none repeat scroll 20% 30% red; } -GOOD { background: repeat scroll 20% 30% red none; } -GOOD { background: scroll 20% 30% red none repeat; } -GOOD { background: 20% 30% red none repeat scroll; } -BAD { background: 20% 30% red none repeat scroll fish; } -BAD { background: 20% 30% red none repeat fish scroll; } -BAD { background: 20% 30% red none fish repeat scroll; } -BAD { background: 20% 30% red fish none repeat scroll; } -BAD { background: 20% 30% fish red none repeat scroll; } -BAD { background: 20% fish 30% red none repeat scroll; } -BAD { background: fish 20% 30% red none repeat scroll; } diff --git a/mozilla/layout/html/tests/css/border-bottom-width.css b/mozilla/layout/html/tests/css/border-bottom-width.css deleted file mode 100644 index d35cb0d9ec8..00000000000 --- a/mozilla/layout/html/tests/css/border-bottom-width.css +++ /dev/null @@ -1,23 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-bottom-width: thin; } -GOOD { border-bottom-width: medium; } -GOOD { border-bottom-width: thick; } -GOOD { border-bottom-width: 3.0in; } -BAD { border-bottom-width: narrow; } -BAD { border-bottom-width: "foo"; } -BAD { border-bottom-width: center; } diff --git a/mozilla/layout/html/tests/css/border-bottom.css b/mozilla/layout/html/tests/css/border-bottom.css deleted file mode 100644 index d1e4283fd10..00000000000 --- a/mozilla/layout/html/tests/css/border-bottom.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-bottom: 3.0in; } -GOOD { border-bottom: thin; } -GOOD { border-bottom: 3.0in dashed; } -GOOD { border-bottom: thin dotted; } -GOOD { border-bottom: 3.0in dashed red; } -GOOD { border-bottom: thin dotted green; } -GOOD { border-bottom: green thin dotted; } -GOOD { border-bottom: green dotted thin; } diff --git a/mozilla/layout/html/tests/css/border-color.css b/mozilla/layout/html/tests/css/border-color.css deleted file mode 100644 index fdecde99399..00000000000 --- a/mozilla/layout/html/tests/css/border-color.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-color: red; } -GOOD { border-color: red blue; } -GOOD { border-color: red blue rgb(0, 0, 0); } -GOOD { border-color: red blue green yellow; } diff --git a/mozilla/layout/html/tests/css/border-left-width.css b/mozilla/layout/html/tests/css/border-left-width.css deleted file mode 100644 index 1923f205d26..00000000000 --- a/mozilla/layout/html/tests/css/border-left-width.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-left-width: thin; } -GOOD { border-left-width: medium; } -GOOD { border-left-width: thick; } -GOOD { border-left-width: 3.0in; } diff --git a/mozilla/layout/html/tests/css/border-left.css b/mozilla/layout/html/tests/css/border-left.css deleted file mode 100644 index 56204fb1f68..00000000000 --- a/mozilla/layout/html/tests/css/border-left.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-left: 3.0in; } -GOOD { border-left: thin; } -GOOD { border-left: 3.0in dashed; } -GOOD { border-left: thin dotted; } -GOOD { border-left: 3.0in dashed red; } -GOOD { border-left: thin dotted green; } -GOOD { border-left: green thin dotted; } -GOOD { border-left: green dotted thin; } diff --git a/mozilla/layout/html/tests/css/border-right-width.css b/mozilla/layout/html/tests/css/border-right-width.css deleted file mode 100644 index b18d5c5923e..00000000000 --- a/mozilla/layout/html/tests/css/border-right-width.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-right-width: thin; } -GOOD { border-right-width: medium; } -GOOD { border-right-width: thick; } -GOOD { border-right-width: 3.0in; } diff --git a/mozilla/layout/html/tests/css/border-right.css b/mozilla/layout/html/tests/css/border-right.css deleted file mode 100644 index e58820e15a7..00000000000 --- a/mozilla/layout/html/tests/css/border-right.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-right: 3.0in; } -GOOD { border-right: thin; } -GOOD { border-right: 3.0in dashed; } -GOOD { border-right: thin dotted; } -GOOD { border-right: 3.0in dashed red; } -GOOD { border-right: thin dotted green; } -GOOD { border-right: green thin dotted; } -GOOD { border-right: green dotted thin; } diff --git a/mozilla/layout/html/tests/css/border-style.css b/mozilla/layout/html/tests/css/border-style.css deleted file mode 100644 index aef6d55e79a..00000000000 --- a/mozilla/layout/html/tests/css/border-style.css +++ /dev/null @@ -1,28 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-style: none; } -GOOD { border-style: dotted; } -GOOD { border-style: dashed; } -GOOD { border-style: solid; } -GOOD { border-style: double; } -GOOD { border-style: groove; } -GOOD { border-style: ridge; } -GOOD { border-style: inset; } -GOOD { border-style: outset; } -GOOD { border-style: dashed none; } -GOOD { border-style: dashed dotted none; } -GOOD { border-style: dashed dotted inset none; } diff --git a/mozilla/layout/html/tests/css/border-top-width.css b/mozilla/layout/html/tests/css/border-top-width.css deleted file mode 100644 index 267ad2349d2..00000000000 --- a/mozilla/layout/html/tests/css/border-top-width.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-top-width: thin; } -GOOD { border-top-width: medium; } -GOOD { border-top-width: thick; } -GOOD { border-top-width: 3.0in; } diff --git a/mozilla/layout/html/tests/css/border-top.css b/mozilla/layout/html/tests/css/border-top.css deleted file mode 100644 index 341b6a09384..00000000000 --- a/mozilla/layout/html/tests/css/border-top.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-top: 3.0in; } -GOOD { border-top: thin; } -GOOD { border-top: 3.0in dashed; } -GOOD { border-top: thin dotted; } -GOOD { border-top: 3.0in dashed red; } -GOOD { border-top: thin dotted green; } -GOOD { border-top: green thin dotted; } -GOOD { border-top: green dotted thin; } diff --git a/mozilla/layout/html/tests/css/border-width.css b/mozilla/layout/html/tests/css/border-width.css deleted file mode 100644 index dd8d8b04ca7..00000000000 --- a/mozilla/layout/html/tests/css/border-width.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border-width: thin; } -GOOD { border-width: medium; } -GOOD { border-width: thick; } -GOOD { border-width: 3.0in; } -GOOD { border-width: thin thin; } -GOOD { border-width: 3.0in thin; } -GOOD { border-width: thin 3.0in thin; } -GOOD { border-width: 3.0in thin thin; } -GOOD { border-width: 3.0in thin medium; } diff --git a/mozilla/layout/html/tests/css/border.css b/mozilla/layout/html/tests/css/border.css deleted file mode 100644 index 86967fd2a40..00000000000 --- a/mozilla/layout/html/tests/css/border.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { border: 3.0in; } -GOOD { border: thin; } -GOOD { border: 3.0in dashed; } -GOOD { border: thin dotted; } -GOOD { border: 3.0in dashed red; } -GOOD { border: thin dotted green; } -GOOD { border: green thin dotted; } -GOOD { border: green dotted thin; } diff --git a/mozilla/layout/html/tests/css/bugs/bug01.css b/mozilla/layout/html/tests/css/bugs/bug01.css deleted file mode 100644 index 1a0a5d0223d..00000000000 --- a/mozilla/layout/html/tests/css/bugs/bug01.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -/* 0 numbers were causing data to be eaten */ -DD { margin-top: 0; margin-left: .25in; } -A:link { color: blue; text-decoration: underline } diff --git a/mozilla/layout/html/tests/css/bugs/bug02.css b/mozilla/layout/html/tests/css/bugs/bug02.css deleted file mode 100644 index f3b0f6a391e..00000000000 --- a/mozilla/layout/html/tests/css/bugs/bug02.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -/* This rule evaluates to just a margin-left value */ -DD { margin-top: 0pixels; margin-left: .25in; } -/* This rule evaluates to just a margin-top value */ -DD { margin-top: 0; margin-left: .25parsecs; } diff --git a/mozilla/layout/html/tests/css/clear.css b/mozilla/layout/html/tests/css/clear.css deleted file mode 100644 index 7e6fec6a9b7..00000000000 --- a/mozilla/layout/html/tests/css/clear.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { clear: none; } -GOOD { clear: left; } -GOOD { clear: right; } -GOOD { clear: both; } diff --git a/mozilla/layout/html/tests/css/clip.css b/mozilla/layout/html/tests/css/clip.css deleted file mode 100644 index d811b3a555a..00000000000 --- a/mozilla/layout/html/tests/css/clip.css +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { clip: auto; } -GOOD { clip: rect( auto auto auto auto ) } -GOOD { clip: rect(auto auto auto auto) } -GOOD { clip: rect( 12pt auto auto auto ) } - -GOOD { clip: rect( auto 12pt auto auto ) } -GOOD { clip: rect( auto auto 12pt auto ) } -GOOD { clip: rect( auto auto auto 12pt ) } -GOOD { clip: rect( 12pt 13em auto auto ) } - -GOOD { clip: rect( 12pt 13em 14pc auto ) } -GOOD { clip: rect( 12pt 13em 14pc 15in ) } -GOOD { clip: rect ( 12pt 13em 14pc 15in ) } - -GOOD { clip: rect( auto, auto, auto, auto ) } -GOOD { clip: rect(auto , auto , auto , auto) } -GOOD { clip: rect( 12pt, auto, auto, auto, ) } - -GOOD { clip: rect( auto, 12pt, auto, auto ) } -GOOD { clip: rect( auto, auto, 12pt, auto ) } -GOOD { clip: rect( auto, auto, auto, 12pt ) } -GOOD { clip: rect( 12pt, 13em, auto, auto ) } - -GOOD { clip: rect( 12pt, 13em, 14pc, auto ) } -GOOD { clip: rect( 12pt, 13em, 14pc, 15in ) } -GOOD { clip: rect ( 12pt, 13em, 14pc, 15in ) } - -BAD { clip: rect( 1pt ) } -BAD { clip: rect( 1pt 2pt ) } -BAD { clip: rect( 1pt 2pt 3pt ) } -BAD { clip: rect( 1 2 3 4 ) } -BAD { clip: rect( auto ) } -BAD { clip: rect( auto auto) } -BAD { clip: rect( auto auto auto) } -BAD { clip: rect( auto auto auto) } -BAD { clip: rect( auto, auto, auto, auto, ) } -BAD { clip: rect ( 12pt, 13em, 14pc, 15in, ) } diff --git a/mozilla/layout/html/tests/css/color.css b/mozilla/layout/html/tests/css/color.css deleted file mode 100644 index c6b4c7e8f2a..00000000000 --- a/mozilla/layout/html/tests/css/color.css +++ /dev/null @@ -1,22 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { color: red; } -GOOD { color: rgb(0, 0, 0); } -GOOD { color: rGb(110%, 23, 9123784328342834); } -GOOD { color: #f00; } -GOOD { color: #ff00ff; } -GOOD { color: #fff000fff; } /* Note: an extension */ diff --git a/mozilla/layout/html/tests/css/cursor.css b/mozilla/layout/html/tests/css/cursor.css deleted file mode 100644 index 09c4e866cae..00000000000 --- a/mozilla/layout/html/tests/css/cursor.css +++ /dev/null @@ -1,23 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { cursor: arrow; } -GOOD { cursor: hand; } -GOOD { cursor: ibeam; } -GOOD { cursor: inherit; } -BAD { cursor: thin; } -BAD { cursor: 3.0in; } -BAD { cursor: thin dotted; } diff --git a/mozilla/layout/html/tests/css/direction.css b/mozilla/layout/html/tests/css/direction.css deleted file mode 100644 index 41f402d1b6e..00000000000 --- a/mozilla/layout/html/tests/css/direction.css +++ /dev/null @@ -1,22 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { direction: ltr; } -GOOD { direction: rtl; } -GOOD { direction: inherit; } -BAD { direction: thin; } -BAD { direction: 3.0in; } -BAD { direction: thin dotted; } diff --git a/mozilla/layout/html/tests/css/display.css b/mozilla/layout/html/tests/css/display.css deleted file mode 100644 index 01cda2f1226..00000000000 --- a/mozilla/layout/html/tests/css/display.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { display: none; } -GOOD { display: block; } -GOOD { display: inline; } -GOOD { display: list-item; } diff --git a/mozilla/layout/html/tests/css/float.css b/mozilla/layout/html/tests/css/float.css deleted file mode 100644 index b07e27e4a7a..00000000000 --- a/mozilla/layout/html/tests/css/float.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { float: none; } -GOOD { float: left; } -GOOD { float: right; } -BAD { float: medium; } diff --git a/mozilla/layout/html/tests/css/font-family.css b/mozilla/layout/html/tests/css/font-family.css deleted file mode 100644 index 2dd8514b494..00000000000 --- a/mozilla/layout/html/tests/css/font-family.css +++ /dev/null @@ -1,17 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { font-family: gill, helvetica, times new roman, sans-serif; } diff --git a/mozilla/layout/html/tests/css/font-size.css b/mozilla/layout/html/tests/css/font-size.css deleted file mode 100644 index cb0c10a81e5..00000000000 --- a/mozilla/layout/html/tests/css/font-size.css +++ /dev/null @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { font-size: Xx-smAll; } -GOOD { font-size: x-Small; } -GOOD { font-size: Small; } -GOOD { font-size: Medium; } -GOOD { font-size: LaRgE; } -GOOD { font-size: x-LaRgE; } -GOOD { font-size: Xx-LaRgE; } -GOOD { font-size: LaRgEr; } -GOOD { font-size: smalLer; } -GOOD { font-size: 3.0in; } -GOOD { font-size: 120%; } -BAD { font-size: green; } -BAD { font-size: 120% 240%; } diff --git a/mozilla/layout/html/tests/css/font-style.css b/mozilla/layout/html/tests/css/font-style.css deleted file mode 100644 index 4f8b200abaa..00000000000 --- a/mozilla/layout/html/tests/css/font-style.css +++ /dev/null @@ -1,23 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { font-style: normal; } -GOOD { font-style: italic; } -GOOD { font-style: oblique; } -BAD { font-style: green; } -BAD { font-style: 120% 240%; } -BAD { font-style: medium; } -BAD { font-style: "kanji"; } diff --git a/mozilla/layout/html/tests/css/font-variant.css b/mozilla/layout/html/tests/css/font-variant.css deleted file mode 100644 index 302b44790a9..00000000000 --- a/mozilla/layout/html/tests/css/font-variant.css +++ /dev/null @@ -1,22 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { font-variant: normal; } -GOOD { font-variant: small-caps; } -BAD { font-variant: green; } -BAD { font-variant: 120% 240%; } -BAD { font-variant: medium; } -BAD { font-variant: "kanji"; } diff --git a/mozilla/layout/html/tests/css/font-weight.css b/mozilla/layout/html/tests/css/font-weight.css deleted file mode 100644 index fd7c8328960..00000000000 --- a/mozilla/layout/html/tests/css/font-weight.css +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { font-weight: normal; } -GOOD { font-weight: bold; } -GOOD { font-weight: bolder; } -GOOD { font-weight: lighter; } -GOOD { font-weight: 100; } -GOOD { font-weight: 200; } -GOOD { font-weight: 300; } -GOOD { font-weight: 400; } -GOOD { font-weight: 500; } -GOOD { font-weight: 600; } -GOOD { font-weight: 700; } -GOOD { font-weight: 800; } -GOOD { font-weight: 900; } -BAD { font-weight: heavy; } -BAD { font-weight: 12.3em; } diff --git a/mozilla/layout/html/tests/css/font.css b/mozilla/layout/html/tests/css/font.css deleted file mode 100644 index 98096fb7617..00000000000 --- a/mozilla/layout/html/tests/css/font.css +++ /dev/null @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { font: italic small-caps bold 12pt helvetica } -GOOD { font: italic bold small-caps 12pt helvetica } -GOOD { font: small-caps bold italic 12pt helvetica } -GOOD { font: small-caps italic bold 12pt helvetica } -GOOD { font: bold italic small-caps 12pt helvetica } -GOOD { font: bold small-caps italic 12pt helvetica } -GOOD { font: bold 12pt helvetica } -GOOD { font: 12pt helvetica } -GOOD { font: 12pt/14pt sans-serif; } -GOOD { font: 80% sans-serif; } -GOOD { font: x-large/110% "new century schoolbook", serif; } -GOOD { font: bold italic large Palatino, serif; } -GOOD { font: normal small-caps 120%/120% fantasy; } diff --git a/mozilla/layout/html/tests/css/height.css b/mozilla/layout/html/tests/css/height.css deleted file mode 100644 index 85c7a68af95..00000000000 --- a/mozilla/layout/html/tests/css/height.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { height: 3.0in; } -GOOD { height: auto; } diff --git a/mozilla/layout/html/tests/css/left.css b/mozilla/layout/html/tests/css/left.css deleted file mode 100644 index 227ff293e37..00000000000 --- a/mozilla/layout/html/tests/css/left.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { left: auto; } -GOOD { left: 17.0in; } -GOOD { left: 120%; } diff --git a/mozilla/layout/html/tests/css/letter-spacing.css b/mozilla/layout/html/tests/css/letter-spacing.css deleted file mode 100644 index b3056ab3020..00000000000 --- a/mozilla/layout/html/tests/css/letter-spacing.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { letter-spacing: normal; } -GOOD { letter-spacing: 3.0in; } diff --git a/mozilla/layout/html/tests/css/line-height.css b/mozilla/layout/html/tests/css/line-height.css deleted file mode 100644 index 39c1c97ab8d..00000000000 --- a/mozilla/layout/html/tests/css/line-height.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { line-height: normal; } -GOOD { line-height: 17; } -GOOD { line-height: 17.0in; } -GOOD { line-height: 17%; } diff --git a/mozilla/layout/html/tests/css/list-style-image.css b/mozilla/layout/html/tests/css/list-style-image.css deleted file mode 100644 index cbc79581319..00000000000 --- a/mozilla/layout/html/tests/css/list-style-image.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { list-style-image: none; } -GOOD { list-style-image: url(fowl.gif); } diff --git a/mozilla/layout/html/tests/css/list-style-position.css b/mozilla/layout/html/tests/css/list-style-position.css deleted file mode 100644 index f114339b063..00000000000 --- a/mozilla/layout/html/tests/css/list-style-position.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { list-style-position: inside; } -GOOD { list-style-position: outside; } diff --git a/mozilla/layout/html/tests/css/list-style-type.css b/mozilla/layout/html/tests/css/list-style-type.css deleted file mode 100644 index 7704ad65f49..00000000000 --- a/mozilla/layout/html/tests/css/list-style-type.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { list-style-type: none; } -GOOD { list-style-type: disc; } -GOOD { list-style-type: circle; } -GOOD { list-style-type: square; } -GOOD { list-style-type: decimal; } -GOOD { list-style-type: lower-roman; } -GOOD { list-style-type: upper-roman; } -GOOD { list-style-type: lower-alpha; } -GOOD { list-style-type: upper-alpha; } diff --git a/mozilla/layout/html/tests/css/list-style.css b/mozilla/layout/html/tests/css/list-style.css deleted file mode 100644 index 2c1e3df4823..00000000000 --- a/mozilla/layout/html/tests/css/list-style.css +++ /dev/null @@ -1,26 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { list-style: disc; } -GOOD { list-style: disc inside; } -GOOD { list-style: inside disc; } -GOOD { list-style: inside disc url(fowl.gif); } -GOOD { list-style: disc url(fowl.gif) inside; } -GOOD { list-style: url(fowl.gif) inside disc; } - -BAD { list-style: none inside disc; } -BAD { list-style: inside disc none; } -BAD { list-style: disc none inside; } diff --git a/mozilla/layout/html/tests/css/margin-bottom.css b/mozilla/layout/html/tests/css/margin-bottom.css deleted file mode 100644 index ac32d56d61f..00000000000 --- a/mozilla/layout/html/tests/css/margin-bottom.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { margin-bottom: 17.0in; } -GOOD { margin-bottom: 120%; } -GOOD { margin-bottom: auto; } diff --git a/mozilla/layout/html/tests/css/margin-left.css b/mozilla/layout/html/tests/css/margin-left.css deleted file mode 100644 index 4696c491ea1..00000000000 --- a/mozilla/layout/html/tests/css/margin-left.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { margin-left: 17.0in; } -GOOD { margin-left: 120%; } -GOOD { margin-left: auto; } diff --git a/mozilla/layout/html/tests/css/margin-right.css b/mozilla/layout/html/tests/css/margin-right.css deleted file mode 100644 index 2672b4a2ae4..00000000000 --- a/mozilla/layout/html/tests/css/margin-right.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { margin-right: 17.0in; } -GOOD { margin-right: 120%; } -GOOD { margin-right: auto; } diff --git a/mozilla/layout/html/tests/css/margin-top.css b/mozilla/layout/html/tests/css/margin-top.css deleted file mode 100644 index 9ea23bbae00..00000000000 --- a/mozilla/layout/html/tests/css/margin-top.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { margin-top: 17.0in; } -GOOD { margin-top: 120%; } -GOOD { margin-top: auto; } diff --git a/mozilla/layout/html/tests/css/margin.css b/mozilla/layout/html/tests/css/margin.css deleted file mode 100644 index febf50f6798..00000000000 --- a/mozilla/layout/html/tests/css/margin.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { margin: 17.0in; } -GOOD { margin: 120%; } -GOOD { margin: auto; } -GOOD { margin: 17.0in auto; } -GOOD { margin: 17.0in 120%; } -GOOD { margin: 17.0in 17.0in; } -GOOD { margin: 120% 17.0in; } -GOOD { margin: 120% auto; } -GOOD { margin: 120% 120%; } -GOOD { margin: auto 120%; } -GOOD { margin: auto 17.0in; } -GOOD { margin: auto auto; } -GOOD { margin: 17.0in 17.0in 17.0in; } -GOOD { margin: 17.0in 17.0in 120%; } -GOOD { margin: 17.0in 17.0in auto; } -GOOD { margin: 17.0in 120% 17.0in; } -GOOD { margin: 17.0in auto 17.0in; } -GOOD { margin: 17.0in 17.0in 17.0in 17.0in; } -GOOD { margin: 17.0in 120% 17.0in 17.0in; } -GOOD { margin: 120% 120% 17.0in 17.0in; } -GOOD { margin: 120% 120% 120% 17.0in; } -GOOD { margin: 120% 120% 120% 120%; } diff --git a/mozilla/layout/html/tests/css/overflow.css b/mozilla/layout/html/tests/css/overflow.css deleted file mode 100644 index 46e7fd682a1..00000000000 --- a/mozilla/layout/html/tests/css/overflow.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { overflow: visible; } -GOOD { overflow: hidden; } -GOOD { overflow: scroll; } -GOOD { overflow: auto; } diff --git a/mozilla/layout/html/tests/css/padding-bottom.css b/mozilla/layout/html/tests/css/padding-bottom.css deleted file mode 100644 index b1efb0eb840..00000000000 --- a/mozilla/layout/html/tests/css/padding-bottom.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { padding-bottom: 17.0in; } -GOOD { padding-bottom: 120%; } diff --git a/mozilla/layout/html/tests/css/padding-left.css b/mozilla/layout/html/tests/css/padding-left.css deleted file mode 100644 index 3951f619078..00000000000 --- a/mozilla/layout/html/tests/css/padding-left.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { padding-left: 17.0in; } -GOOD { padding-left: 120%; } diff --git a/mozilla/layout/html/tests/css/padding-right.css b/mozilla/layout/html/tests/css/padding-right.css deleted file mode 100644 index b20297318d5..00000000000 --- a/mozilla/layout/html/tests/css/padding-right.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { padding-right: 17.0in; } -GOOD { padding-right: 120%; } diff --git a/mozilla/layout/html/tests/css/padding-top.css b/mozilla/layout/html/tests/css/padding-top.css deleted file mode 100644 index 7ff1a36b66d..00000000000 --- a/mozilla/layout/html/tests/css/padding-top.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { padding-top: 17.0in; } -GOOD { padding-top: 120%; } diff --git a/mozilla/layout/html/tests/css/padding.css b/mozilla/layout/html/tests/css/padding.css deleted file mode 100644 index 9541aeae23b..00000000000 --- a/mozilla/layout/html/tests/css/padding.css +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { padding: 17.0in; } -GOOD { padding: 120%; } -GOOD { padding: 17.0in 120%; } -GOOD { padding: 17.0in 17.0in; } -GOOD { padding: 120% 17.0in; } -GOOD { padding: 120% 120%; } -GOOD { padding: 17.0in 17.0in 17.0in; } -GOOD { padding: 17.0in 17.0in 120%; } -GOOD { padding: 17.0in 120% 17.0in; } -GOOD { padding: 17.0in 17.0in 17.0in 17.0in; } -GOOD { padding: 17.0in 120% 17.0in 17.0in; } -GOOD { padding: 120% 120% 17.0in 17.0in; } -GOOD { padding: 120% 120% 120% 17.0in; } -GOOD { padding: 120% 120% 120% 120%; } diff --git a/mozilla/layout/html/tests/css/position.css b/mozilla/layout/html/tests/css/position.css deleted file mode 100644 index e4f176c6d67..00000000000 --- a/mozilla/layout/html/tests/css/position.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { position: static; } -GOOD { position: relative; } -GOOD { position: absolute; } -BAD { position: 12; } -BAD { position: medium; } diff --git a/mozilla/layout/html/tests/css/text-align.css b/mozilla/layout/html/tests/css/text-align.css deleted file mode 100644 index 0c78292c178..00000000000 --- a/mozilla/layout/html/tests/css/text-align.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { text-align: left; } -GOOD { text-align: right; } -GOOD { text-align: center; } -GOOD { text-align: justify; } diff --git a/mozilla/layout/html/tests/css/text-decoration.css b/mozilla/layout/html/tests/css/text-decoration.css deleted file mode 100644 index c4c835534d8..00000000000 --- a/mozilla/layout/html/tests/css/text-decoration.css +++ /dev/null @@ -1,26 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { text-decoration: none; } -GOOD { text-decoration: underline; } -GOOD { text-decoration: overline; } -GOOD { text-decoration: line-through; } -GOOD { text-decoration: blink; } -GOOD { text-decoration: overline underline; } -GOOD { text-decoration: line-through overline underline; } -GOOD { text-decoration: blink line-through overline underline; } -BAD { text-decoration: blink fish line-through overline underline; } -BAD { text-decoration: none blink; } diff --git a/mozilla/layout/html/tests/css/text-indent.css b/mozilla/layout/html/tests/css/text-indent.css deleted file mode 100644 index 17bc36e0647..00000000000 --- a/mozilla/layout/html/tests/css/text-indent.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { text-indent: 3.0in; } -GOOD { text-indent: 120%; } diff --git a/mozilla/layout/html/tests/css/text-transform.css b/mozilla/layout/html/tests/css/text-transform.css deleted file mode 100644 index 7fae9a04625..00000000000 --- a/mozilla/layout/html/tests/css/text-transform.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { text-transform: none; } -GOOD { text-transform: capitalize; } -GOOD { text-transform: lowercase; } -GOOD { text-transform: uppercase; } -BAD { text-transform: capitalize lowercase } diff --git a/mozilla/layout/html/tests/css/top.css b/mozilla/layout/html/tests/css/top.css deleted file mode 100644 index 5f45d8db192..00000000000 --- a/mozilla/layout/html/tests/css/top.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { top: auto; } -GOOD { top: 17.0in; } -GOOD { top: 120%; } diff --git a/mozilla/layout/html/tests/css/vertical-align.css b/mozilla/layout/html/tests/css/vertical-align.css deleted file mode 100644 index 591cf4e42d6..00000000000 --- a/mozilla/layout/html/tests/css/vertical-align.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { vertical-align: baseline; } -GOOD { vertical-align: sub; } -GOOD { vertical-align: super; } -GOOD { vertical-align: top; } -GOOD { vertical-align: text-top; } -GOOD { vertical-align: middle; } -GOOD { vertical-align: text-bottom; } -GOOD { vertical-align: bottom; } -GOOD { vertical-align: 120%; } diff --git a/mozilla/layout/html/tests/css/visibility.css b/mozilla/layout/html/tests/css/visibility.css deleted file mode 100644 index 16c409e3afb..00000000000 --- a/mozilla/layout/html/tests/css/visibility.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { visibility: inherit; } -GOOD { visibility: visible; } -GOOD { visibility: hidden; } diff --git a/mozilla/layout/html/tests/css/white-space.css b/mozilla/layout/html/tests/css/white-space.css deleted file mode 100644 index e1b61a8a619..00000000000 --- a/mozilla/layout/html/tests/css/white-space.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { white-space: normal; } -GOOD { white-space: pre; } -GOOD { white-space: nowrap; } diff --git a/mozilla/layout/html/tests/css/width.css b/mozilla/layout/html/tests/css/width.css deleted file mode 100644 index f1122d4fc23..00000000000 --- a/mozilla/layout/html/tests/css/width.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { width: 3.0in; } -GOOD { width: 120%; } -GOOD { width: auto; } diff --git a/mozilla/layout/html/tests/css/word-spacing.css b/mozilla/layout/html/tests/css/word-spacing.css deleted file mode 100644 index 057882d3c72..00000000000 --- a/mozilla/layout/html/tests/css/word-spacing.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { word-spacing: normal; } -GOOD { wOrd-spacing: 12.0em; } -GOOD { WoRd-Spacing: 12.0eX; } -GOOD { worD-Spacing: 12PX; } -GOOD { word-Spacing: 12.0In; } -GOOD { word-sPacing: 12.0cm; } -GOOD { word-spAcing: 12.0mm; } -GOOD { word-spaCing: 12.0pt; } -GOOD { word-spacIng: 12.0pc; } diff --git a/mozilla/layout/html/tests/css/z-index.css b/mozilla/layout/html/tests/css/z-index.css deleted file mode 100644 index e33879cc405..00000000000 --- a/mozilla/layout/html/tests/css/z-index.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -GOOD { z-index: auto } -GOOD { z-index: 123456789 } -BAD { z-index: 12.3pt } -BAD { z-index: 12.3 } diff --git a/mozilla/layout/html/tests/makefile.win b/mozilla/layout/html/tests/makefile.win deleted file mode 100644 index 3576ed3bfd1..00000000000 --- a/mozilla/layout/html/tests/makefile.win +++ /dev/null @@ -1,97 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. - -MAKE_OBJ_TYPE = EXE -PROG1 = .\$(OBJDIR)\TestCSSScanner.exe -PROG2 = .\$(OBJDIR)\TestHTMLTagLookup.exe -PROG3 = .\$(OBJDIR)\TestCSSPropertyLookup.exe -PROG4 = .\$(OBJDIR)\TestCSSParser.exe -PROG5 = .\$(OBJDIR)\TestAttributes.exe -PROG6 = .\$(OBJDIR)\TestInlineFrame.exe -PROGRAMS = $(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG5) $(PROG6) - -DEFINES = -D_IMPL_NS_HTML - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\dom \ - -I..\base\src -I..\style\src \ - -I..\..\base\src - -LLIBS= \ - $(DIST)\lib\raptorhtmlbase_s.lib \ - $(DIST)\lib\raptorhtmlstyle_s.lib \ - $(DIST)\lib\raptorlayout_s.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\img3240.lib \ - $(DIST)\lib\util.lib \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\jsdom.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAMS) - $(MAKE_INSTALL) $(PROG1) $(DIST)\bin - $(MAKE_INSTALL) $(PROG2) $(DIST)\bin - $(MAKE_INSTALL) $(PROG3) $(DIST)\bin - $(MAKE_INSTALL) $(PROG4) $(DIST)\bin - $(MAKE_INSTALL) $(PROG5) $(DIST)\bin - $(MAKE_INSTALL) $(PROG6) $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\TestCSSScanner.exe - rm -f $(DIST)\bin\TestHTMLTagLookup.exe - rm -f $(DIST)\bin\TestCSSPropertyLookup.exe - rm -f $(DIST)\bin\TestCSSParser.exe - rm -f $(DIST)\bin\TestAttributes.exe - rm -f $(DIST)\bin\TestInlineFrame.exe - -# Move this into config/obj.inc when it's allowed -.cpp{.\$(OBJDIR)\}.exe: - -$(CC) @<<$(CFGFILE) - $(CFLAGS) - $(LCFLAGS) - $(LINCS) - $(LINCS_1) - $(INCS) - $(LLIBS) - $(OS_LIBS) - -Fd$(PBDFILE) - -Fe.\$(OBJDIR)\ - -Fo.\$(OBJDIR)\ - $(CURDIR)$(*B).cpp -< -#include "nscore.h" -#include "nsIAtom.h" -#include "nsStringBuf.h" -#include "nsDocument.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsIContentDelegate.h" -#include "nsIViewManager.h" -#include "nsIView.h" -#include "nsViewsCID.h" -#include "nsIFrame.h" -#include "nsIStyleSet.h" -#include "nsHTMLParts.h" -#include "nsIHTMLContent.h" -#include "..\..\..\src\nsTablePart.h" - - -static FILE * out; - - -class BasicTest : public nsDocument // yep, I'm a document -{ -public: - BasicTest(); - virtual ~BasicTest() {}; - - nsresult AppendSimpleSpan(nsIContent* aContainer, const char* aTag, const char* aText); - - void CreateCorrectContent(PRInt32 aRows, PRInt32 aCols); - void CreateCorrectFullContent(PRInt32 aRows, PRInt32 aCols); - void CreateOutOfOrderContent(PRInt32 aRows, PRInt32 aCols); - void CreateIllegalContent(PRInt32 aRows, PRInt32 aCols); - - void VerifyContent(PRInt32 aRows, PRInt32 aCols); - - void TestGeometry(); -}; - -class GeometryTest -{ -public: - GeometryTest(BasicTest *aDoc); - - virtual ~GeometryTest() {}; - - void CreateGeometry(BasicTest *aDoc, nsIPresContext *aPC); - - void VerifyGeometry(BasicTest *aDoc, nsIPresContext *aPC); - - nsIPresShell * mShell; - nsIViewManager * mViewManager; - nsIFrame * mRootFrame; -}; - -/* ---------- BasicTest Definitions ---------- */ - -BasicTest::BasicTest() - : nsDocument() -{ - Init(); - - PRInt32 rows = 3; - PRInt32 cols = 4; - - // Build a basic table content model the "right" way - CreateCorrectContent(rows, cols); - VerifyContent(rows, cols); - nsIContent *root; - root = GetRootContent(); - if (nsnull!=root && 1==root->ChildCount()) - root->RemoveChildAt(0); - else - { - fprintf(out, "corrupt root after CreateCorrectContent\n"); - NS_ASSERTION(PR_FALSE, ""); - } - - // Build a content model the "right" way with every kind of table object - CreateCorrectFullContent(rows, cols); - VerifyContent(rows, cols); - root = GetRootContent(); - if (nsnull!=root && 1==root->ChildCount()) - root->RemoveChildAt(0); - else - { - fprintf(out, "corrupt root after CreateCorrectFullContent\n"); - NS_ASSERTION(PR_FALSE, ""); - } - - // Build a content model with things out of order - CreateOutOfOrderContent(rows, cols); - VerifyContent(rows, cols); - root = GetRootContent(); - if (nsnull!=root && 1==root->ChildCount()) - root->RemoveChildAt(0); - else - { - fprintf(out, "corrupt root after CreateOutOfOrderContent\n"); - NS_ASSERTION(PR_FALSE, ""); - } - - // Build a content model with illegal things - /* not ready for prime time... - CreateIllegalContent(rows, cols); - VerifyContent(rows, cols); - root = GetRootContent(); - if (nsnull!=root && 1==root->ChildCount()) - root->RemoveChildAt(0); - else - { - fprintf(out, "corrupt root after CreateIllegalContent\n"); - NS_ASSERTION(PR_FALSE); - } - */ - - TestGeometry(); -} - -nsresult BasicTest::AppendSimpleSpan(nsIContent* aContainer, const char* aTag, const char* aText) -{ - nsIHTMLContent* span; - nsIHTMLContent* text; - nsIAtom* atom = NS_NewAtom(aTag); - nsresult rv = NS_NewHTMLContainer(&span, atom); - if (NS_OK == rv) { - nsStringBuf tmp; - tmp.Append(aText); - rv = NS_NewHTMLText(&text, tmp.GetUnicode(), tmp.Length()); - if (NS_OK == rv) { - span->AppendChild(text); - NS_RELEASE(text); - } - aContainer->AppendChild(span); - NS_RELEASE(span); - } - NS_RELEASE(atom); - return rv; -} - -void BasicTest::CreateCorrectContent(int aRows, int aCols) -{ - fprintf(out, "CreateCorrectContent %d %d\n", aRows, aCols); - nsIHTMLContent* root; - nsresult rv = NS_NewRootPart(&root, this); // does a SetRootPart on the returned root object - if (NS_OK != rv) { - fprintf(out, "NS_NewRootPart failed\n"); - NS_ASSERTION(PR_FALSE, "NS_NewRootPart failed"); - } - - nsIHTMLContent* body; - nsIAtom* atom = NS_NewAtom("BODY"); - rv = NS_NewBodyPart(&body, atom); - if (NS_OK != rv) { - fprintf(out, "NS_NewBodyPart failed\n"); - NS_ASSERTION(PR_FALSE, "NS_NewBodyPart failed"); - } - NS_RELEASE(atom); - - nsIHTMLContent* table; - nsIHTMLContent* row; - nsIHTMLContent* cell; - - nsIAtom* tatom = NS_NewAtom("TABLE"); - rv = NS_NewTablePart(&table, tatom); - NS_RELEASE(tatom); - if (NS_OK == rv) { - PRInt32 rowIndex; - for (rowIndex = 0; (NS_OK == rv) && (rowIndex < aRows); rowIndex++) { - nsIAtom* tratom = NS_NewAtom("TR"); - rv = NS_NewTableRowPart(&row, tratom); - NS_RELEASE(tratom); - if (NS_OK == rv) { - PRInt32 colIndex; - for (colIndex = 0; (NS_OK == rv) && (colIndex < aCols); colIndex++) { - nsIAtom* tdatom = NS_NewAtom("TD"); - rv = NS_NewTableCellPart(&cell, tdatom); - NS_RELEASE(tdatom); - if (NS_OK == rv) { - rv = AppendSimpleSpan (cell, "P", "test"); - } - row->AppendChild(cell); - NS_RELEASE(cell); - } - table->AppendChild(row); - NS_RELEASE(row); - } - } - ((nsTablePart *)table)->GetMaxColumns(); // has important side effect of creating pseudo-columns - body->AppendChild(table); - NS_RELEASE(table); - } - root->AppendChild(body); - NS_RELEASE(body); -} - -void BasicTest::CreateCorrectFullContent(int aRows, int aCols) -{ - fprintf(out, "CreateCorrectFullContent %d %d, 1 caption\n", aRows, aCols); - nsIHTMLContent* root; - nsresult rv = NS_NewRootPart(&root, this); // does a SetRootPart on the returned root object - if (NS_OK != rv) { - fprintf(out, "NS_NewRootPart failed\n"); - NS_ASSERTION(PR_FALSE, "NS_NewRootPart failed\n"); - } - - nsIHTMLContent* body; - nsIAtom* atom = NS_NewAtom("BODY"); - rv = NS_NewBodyPart(&body, atom); - if (NS_OK != rv) { - fprintf(out, "NS_NewBodyPart failed\n"); - NS_ASSERTION(PR_FALSE, "NS_NewBodyPart failed\n"); - } - NS_RELEASE(atom); - - nsIHTMLContent* table; - nsIHTMLContent* caption; - nsIHTMLContent* colGroup; - nsIHTMLContent* col; - nsIHTMLContent* row; - nsIHTMLContent* cell; - - nsIAtom* tatom = NS_NewAtom("TABLE"); - rv = NS_NewTablePart(&table, tatom); - NS_RELEASE(tatom); - - // add caption - nsIAtom* captionAtom = NS_NewAtom("CAPTION"); - rv = NS_NewTableCaptionPart(&caption, captionAtom); - NS_RELEASE(captionAtom); - table->AppendChild(caption); - - // add column group - PRInt32 colIndex; - nsIAtom* colGroupAtom = NS_NewAtom("COLGROUP"); - rv = NS_NewTableColGroupPart(&colGroup, colGroupAtom); - NS_RELEASE(colGroupAtom); - table->AppendChild(colGroup); - - // add columns - nsIAtom* colAtom = NS_NewAtom("COL"); - for (colIndex = 0; (NS_OK == rv) && (colIndex < aCols); colIndex++) { - rv = NS_NewTableColPart(&col, colAtom); - colGroup->AppendChild(col); - } - NS_RELEASE(colAtom); - - // add rows and cells - if (NS_OK == rv) { - PRInt32 rowIndex; - for (rowIndex = 0; (NS_OK == rv) && (rowIndex < aRows); rowIndex++) { - nsIAtom* tratom = NS_NewAtom("TR"); - rv = NS_NewTableRowPart(&row, tratom); - NS_RELEASE(tratom); - if (NS_OK == rv) { - for (colIndex = 0; (NS_OK == rv) && (colIndex < aCols); colIndex++) { - nsIAtom* tdatom = NS_NewAtom("TD"); - rv = NS_NewTableCellPart(&cell, tdatom); - NS_RELEASE(tdatom); - if (NS_OK == rv) { - rv = AppendSimpleSpan (cell, "P", "test"); - } - row->AppendChild(cell); - NS_RELEASE(cell); - } - table->AppendChild(row); - NS_RELEASE(row); - } - } - body->AppendChild(table); - NS_RELEASE(table); - } - root->AppendChild(body); - NS_RELEASE(body); -} - - -void BasicTest::CreateOutOfOrderContent(int aRows, int aCols) -{ - fprintf(out, "CreateOutOfOrderContent %d %d, 2 captions\n", aRows, aCols); - nsIHTMLContent* root; - nsresult rv = NS_NewRootPart(&root, this); // does a SetRootPart on the returned root object - if (NS_OK != rv) { - fprintf(out, "NS_NewRootPart failed\n"); - NS_ASSERTION(PR_FALSE, "NS_NewRootPart failed\n"); - } - - nsIHTMLContent* body; - nsIAtom* atom = NS_NewAtom("BODY"); - rv = NS_NewBodyPart(&body, atom); - if (NS_OK != rv) { - fprintf(out, "NS_NewBodyPart failed\n"); - NS_ASSERTION(PR_FALSE, "NS_NewBodyPart failed\n"); - } - NS_RELEASE(atom); - - nsIHTMLContent* table; - nsIHTMLContent* caption; - nsIHTMLContent* colGroup; - nsIHTMLContent* col; - nsIHTMLContent* row; - nsIHTMLContent* cell; - - nsIAtom* tatom = NS_NewAtom("TABLE"); - rv = NS_NewTablePart(&table, tatom); - NS_RELEASE(tatom); - - // add rows and cells - if (NS_OK == rv) { - PRInt32 rowIndex; - for (rowIndex = 0; (NS_OK == rv) && (rowIndex < aRows); rowIndex++) { - nsIAtom* tratom = NS_NewAtom("TR"); - rv = NS_NewTableRowPart(&row, tratom); - NS_RELEASE(tratom); - if (NS_OK == rv) { - for (PRInt32 colIndex = 0; (NS_OK == rv) && (colIndex < aCols); colIndex++) { - nsIAtom* tdatom = NS_NewAtom("TD"); - rv = NS_NewTableCellPart(&cell, tdatom); - NS_RELEASE(tdatom); - if (NS_OK == rv) { - rv = AppendSimpleSpan (cell, "P", "test"); - } - row->AppendChild(cell); - NS_RELEASE(cell); - if (1==rowIndex && 0==colIndex) - { - // add column after cell[1,0], force implicit column group to be built - PRInt32 colIndex; - nsIAtom* colGroupAtom = NS_NewAtom("COLGROUP"); - rv = NS_NewTableColGroupPart(&colGroup, colGroupAtom); - NS_RELEASE(colGroupAtom); - table->AppendChild(colGroup); - } - } - table->AppendChild(row); - NS_RELEASE(row); - } - } - ((nsTablePart *)table)->GetMaxColumns(); // has important side effect of creating pseudo-columns - body->AppendChild(table); - } - root->AppendChild(body); - - // add caption in middle - nsIAtom* captionAtom = NS_NewAtom("CAPTION"); - rv = NS_NewTableCaptionPart(&caption, captionAtom); - NS_RELEASE(captionAtom); - table->AppendChild(caption); - - // add columns - nsIAtom* colAtom = NS_NewAtom("COL"); - for (PRInt32 colIndex = 0; (NS_OK == rv) && (colIndex < aCols); colIndex++) { - rv = NS_NewTableColPart(&col, colAtom); - colGroup->AppendChild(col); - } - NS_RELEASE(colAtom); - - // add caption at end - captionAtom = NS_NewAtom("CAPTION"); - rv = NS_NewTableCaptionPart(&caption, captionAtom); - NS_RELEASE(captionAtom); - table->AppendChild(caption); - - NS_RELEASE(table); - NS_RELEASE(body); -} - -void BasicTest::CreateIllegalContent(int aRows, int aCols) -{ -} - -void BasicTest::VerifyContent(PRInt32 aRows, PRInt32 aCols) -{ - nsIContent* root = GetRootContent(); - if (nsnull==root) - { - fprintf(out, "GetRootContent failed\n"); - NS_ASSERTION(PR_FALSE, "GetRootContent failed\n"); - } - fprintf(out, "VerifyContent for rows=%d, cols=%d\n", aRows, aCols); - root->List(out); -} - -void BasicTest::TestGeometry() -{ - GeometryTest test(this); -} - -/* ---------- GeometryTest Definitions ---------- */ - -GeometryTest::GeometryTest(BasicTest *aDoc) -{ - PRInt32 rows = 4; - PRInt32 cols = 3; - -#if 0 - NS_InitToolkit(PR_GetCurrentThread()); - - //NS_NewDeviceContext(&scribbleData.mContext); - static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); - NS_NewWindow(NULL, kIWidgetIID, nsnull); - -#endif - - nsIPresContext * pc = nsnull; - nsresult status = NS_NewGalleyContext(&pc); - if ((NS_FAILED(status)) || nsnull==pc) - { - fprintf(out, "bad galley pc"); - NS_ASSERTION(PR_FALSE, "bad galley pc"); - } - - // create a view manager - nsIViewManager * vm = nsnull; - - static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID); - static NS_DEFINE_IID(kIViewManagerIID, NS_IVIEWMANAGER_IID); - - status = NSRepository::CreateInstance(kViewManagerCID, - nsnull, - kIViewManagerIID, - (void **)&vm); - - if ((NS_FAILED(status)) || nsnull==vm) - { - fprintf(out, "bad view manager"); - NS_ASSERTION(PR_FALSE, "bad view manager"); - } - vm->Init(pc); - - nsIView * rootView = nsnull; - - // Create a view - static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID); - static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - - status = NSRepository::CreateInstance(kScrollingViewCID, - nsnull, - kIViewIID, - (void **)&rootView); - - if ((NS_FAILED(status)) || nsnull==rootView) - { - fprintf(out, "bad view"); - NS_ASSERTION(PR_FALSE, "bad view"); - } - nsRect bounds(0, 0, 10000, 10000); - rootView->Init(vm, bounds, nsnull); - - vm->SetRootView(rootView); - - nsIStyleSet * ss = nsnull; - status = NS_NewStyleSet(&ss); - if ((NS_FAILED(status)) || nsnull==ss) - { - fprintf(out, "bad style set"); - NS_ASSERTION(PR_FALSE, "bad style set"); - } - - mShell = nsnull; - status = NS_NewPresShell(&mShell); - if ((NS_FAILED(status)) || nsnull==mShell) - { - fprintf(out, "bad presentation shell."); - NS_ASSERTION(PR_FALSE, ""); - } - mShell->Init(aDoc, pc, vm, ss); - - aDoc->CreateCorrectContent(rows, cols); - CreateGeometry(aDoc, pc); - VerifyGeometry(aDoc, pc); - - aDoc->CreateCorrectFullContent(rows, cols); - CreateGeometry(aDoc, pc); - VerifyGeometry(aDoc, pc); - - /* paginated tests not ready yet... - NS_RELEASE(pc); - pc = nsnull; - status = NS_NewPrintPreviewContext(&pc); - if ((NS_FAILED(status)) || nsnull==pc) - { - fprintf(out, "bad paginated pc"); - NS_ASSERTION(PR_FALSE, ""); - } - aDoc->CreateCorrectContent(rows, cols); - CreateGeometry(aDoc, pc); - VerifyGeometry(aDoc, pc); - - aDoc->CreateCorrectFullContent(rows, cols); - CreateGeometry(aDoc, pc); - VerifyGeometry(aDoc, pc); - */ -} - -/** given a content model, create a geometry model */ -void GeometryTest::CreateGeometry(BasicTest * aDoc, nsIPresContext *aPC) -{ - nsIContent *root = aDoc->GetRootContent(); - nsIContentDelegate* cd = root->GetDelegate(aPC); - if (nsnull != cd) { - mRootFrame = cd->CreateFrame(aPC, root, -1, nsnull); - NS_RELEASE(cd); - if (nsnull==mRootFrame) - { - fprintf(out, "mRootFrame failed\n"); - NS_ASSERTION(PR_FALSE, "mRootFrame failed\n"); - } - - // Bind root frame to root view (and root window) - mViewManager = mShell->GetViewManager(); - if (nsnull==mViewManager) - { - fprintf(out, "bad view manager"); - NS_ASSERTION(PR_FALSE, ""); - } - nsIView* rootView = mViewManager->GetRootView(); - NS_ASSERTION(nsnull!=rootView, "bad root view"); - mRootFrame->SetView(rootView); - NS_RELEASE(rootView); - } - else { - fprintf(out, "ERROR: no root delegate\n"); - NS_ASSERTION(PR_FALSE, "no root delegate"); - } - NS_RELEASE(root); - - nsReflowMetrics desiredSize; - nsSize maxSize(400, 600); - nsSize maxElementSize; - - - mRootFrame->ResizeReflow(aPC, desiredSize, maxSize, &maxElementSize); - - -} - -void GeometryTest::VerifyGeometry(BasicTest *aDoc, nsIPresContext *aPC) -{ - mRootFrame->List(out); -} - - -/* ---------- Global Functions ---------- */ - -void main (int argc, char **argv) -{ - out = fopen("TableContentTest.txt", "w+t"); - if (nsnull==out) - { - fprintf(out, "test failed to open output file\n"); - NS_ASSERTION(PR_FALSE, "test failed to open output file\n"); - } - fprintf(out, "Test starting...\n\n"); - BasicTest basicTest; - fprintf(out, "\nTest completed.\n"); -} - - - - - - diff --git a/mozilla/layout/html/tests/table/testcases/nestedTables.html b/mozilla/layout/html/tests/table/testcases/nestedTables.html deleted file mode 100644 index 78f7cbe008b..00000000000 --- a/mozilla/layout/html/tests/table/testcases/nestedTables.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - table - - -  - - - - - - - - - - - - - - - - - - - - - - - - -
    Cell oneCell2Cell 3
    Cell 4Cell 5Cell 6
    - - - - - - - - - - - - - - - - - - - - - - - - -
    123
    4 - - - - - - - - - - - - - - - - - - - - - - - - -
    1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    12345
    67 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    abcde
    fghij
    kl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    abcde
    fghij
    kl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    abcde
    fghij
    klmno
    pqrst
    uvwxy
    no
    pqrst
    uvwxy
    no
    pqrst
    uvwxy
    90
    abcde
    fghij
    klmno
    3
    456
    789
    6
    789
    89
    -  - - diff --git a/mozilla/layout/html/tests/table/testcases/slashlogo.html b/mozilla/layout/html/tests/table/testcases/slashlogo.html deleted file mode 100644 index ade83d2d41f..00000000000 --- a/mozilla/layout/html/tests/table/testcases/slashlogo.html +++ /dev/null @@ -1,3471 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
    \ No newline at end of file diff --git a/mozilla/layout/html/tests/table/testcases/wa_table_thtd_rowspan.html b/mozilla/layout/html/tests/table/testcases/wa_table_thtd_rowspan.html deleted file mode 100644 index 1b069be225b..00000000000 --- a/mozilla/layout/html/tests/table/testcases/wa_table_thtd_rowspan.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - Web Browser Web View (HTML): Table - - - - -

    Acceptance Test Case
    Web Browser: Web View (HTML)

    -

    -Table: <TH> & <TD> ROWSPAN - -


    -This acceptance test case tests the optional <TH> & <TD> tag ROWSPAN attribute which, -when placed in a table header or data tag, specifies how many rows the table header or data cell will span. The -ROWSPAN attribute is set to an integer value equal the number of rows the table header or data cell spans. -

    -Test Instructions: -

      -
    1. Verify that the sample text displays as stated in each of the following test cases:
    2. -

      - - - - - - - - - - - - - -
      Test Case #1table with header cells spanning multiple rows
      Test Case #2table with data cells spanning multiple rows
      Test Case #3table with nested header & data cells spanning multiple rows
      -

      -

    3. Verify that the table is maintained when you minimize/maximize the screen.
    4. -
    5. Verify that the table is maintained when you re-size left & right the screen.
    6. -
    7. Verify that the table is maintained when you re-size top & bottom the screen.
    8. -
    9. Verify re-draw takes place correctly after maximizing the screen.
    10. -
    11. Verify reload works.
    12. -
    - -
    -

    - - -
    -Test Case #1: table with header cells spanning multiple rows -(using <TH ROWSPAN=integer value> tag) -
    -

    -
    - - -
    In the following sample table you should see that the ROWSPAN -attribute applies an integer value equal to the number of rows the HEADER cell is to span. This -tells the browser to make the table header cell occupy the same vertical space as the integer number of cells specified in rows -above or below it. The browser flows the contents of the spanning cell to occupy the entire spanned space. -
    - -



    -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Table Header Cells spanning multiple rows
      Header 1
      span=2 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Header 2
      span=5 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Header 3
      span=3 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      -
    - -

    -


    -

    - - -
    -Test Case #2: table with data cells spanning multiple rows -(using <TD ROWSPAN=integer value> tag) -
    -

    -
    - - -
    In the following sample table you should see that the ROWSPAN -attribute applies an integer value equal to the number of rows the DATA cell is to span. This -tells the browser to make the table data cell occupy the same vertical space as the integer number of cells specified in rows -above or below it. The browser flows the contents of the spanning cell to occupy the entire spanned space. -
    - -



    -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Table Data Cells spanning multiple rows
      HeadData 1
      span=2 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      HeadData 2
      span=5 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      HeadData 3
      span=3 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      Headcol 1col 2col 3col 4col 5col 6col 7col 8col 9
      -
    - -

    -


    -

    - - -
    -Test Case #3: table with nested header & data cells spanning multiple rows -(using <TH ROWSPAN=integer value> <TD ROWSPAN=integer value> tag) -
    - -



    -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Nested Table Header Cells & Data Cells spanning multiple rows
      Header 1
      span=7 rows -
      Data 1
      span=2 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Data 2
      span=5 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      Header 2
      span=3 rows -
      Data 3
      span=3 rows
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      col 1col 2col 3col 4col 5col 6col 7col 8col 9
      -
    - -

    -


    - Created 9/19/96 by Ronald Greti
    -

    -

    -

    CONFIDENTIAL AND PROPRIETARY TEST SCRIPT OF NETSCAPE COMMUNICATIONS CORP.
    Copyright © 1996 Netscape Communications Corp. All Rights Reserved.
    Use of this Test Script is subject to the terms of the applicable license agreement from Netscape Communications Corp.
    - - - - diff --git a/mozilla/layout/html/tests/table/testcases/wa_table_tr_align.html b/mozilla/layout/html/tests/table/testcases/wa_table_tr_align.html deleted file mode 100644 index 5fe7808de3b..00000000000 --- a/mozilla/layout/html/tests/table/testcases/wa_table_tr_align.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Web Browser Web View (HTML): Table - - - - -

    Acceptance Test Case
    Web Browser: Web View (HTML)

    -

    -Table: <TR> ALIGN - -


    -This acceptance test case tests the optional <TR> tag ALIGN attribute which controls the -horizontal alignment of all the cells in a row. This cause the contents of each cell in the row to be aligned -either LEFT|CENTER|RIGHT with respect to the current left and right margins of the display window. -The Header cells by default are aligned CENTER while the Data cells by default are aligned LEFT. -

    -Test Instructions: -

      -
    1. Verify that the sample text displays as stated in each of the following test cases:
    2. -

      - - - - - - - - - -
      Test Case #1Table displaying Header "CENTER "& Data "LEFT" default horizontal row alignment
      Test Case #2Tables displaying Header & Data "LEFT|CENTER|RIGHT" horizontal row alignment
      -

      -

    3. Verify that the table is maintained when you minimize/maximize the screen.
    4. -
    5. Verify that the table is maintained when you re-size left & right the screen.
    6. -
    7. Verify that the table is maintained when you re-size top & bottom the screen.
    8. -
    9. Verify re-draw takes place correctly after maximizing the screen.
    10. -
    11. Verify reload works.
    12. -
    - -
    -

    - - -
    -Test Case #1: Table displaying Header "CENTER "& Data "LEFT" default horizontal row alignment -(using <TR> tag) -
    -

    - - - - -
    Default Horizontal Row Alignment
    row head 1row head 2row head 3
    row data 1row data 2row data 3
    - -


    -

    - - -
    -Test Case #2: Tables displaying Header & Data "LEFT|CENTER|RIGHT" horizontal row alignment -(using <TR ALIGN=LEFT|CENTER|RIGHT> tag) -
    - -

    - - - - - - -
    Horizontal Row Alignment=LEFT
    row head 1row head 2row head 3
    row data 1row data 2row data 3
    - -Note: The attribute ALIGN=LEFT has no special effect on the row data since it simply reiterates the default horizontal row alignment! -

    -

    - -

    - - - - - -
    Horizontal Row Alignment=CENTER
    row head 1row head 2row head 3
    row data 1row data 2row data 3
    - -Note: The attribute ALIGN=CENTER has no special effect on the row head since it simply reiterates the default horizontal row alignment! -

    -

    - -

    - - - - -
    Horizontal Row Alignment=RIGHT
    row head 1row head 2row head 3
    row data 1row data 2row data 3
    - -

    -


    - Created 9/9/96 by Ronald Greti
    -

    -

    -

    CONFIDENTIAL AND PROPRIETARY TEST SCRIPT OF NETSCAPE COMMUNICATIONS CORP.
    Copyright © 1996 Netscape Communications Corp. All Rights Reserved.
    Use of this Test Script is subject to the terms of the applicable license agreement from Netscape Communications Corp.
    - - - - diff --git a/mozilla/layout/html/tests/table/testcases/wf_table_index.html b/mozilla/layout/html/tests/table/testcases/wf_table_index.html deleted file mode 100644 index 9064fd8782b..00000000000 --- a/mozilla/layout/html/tests/table/testcases/wf_table_index.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - Web Browser Web View (HTML): DocType - - - - - - - -

    Functional Test
    Web Browser: Web View (HTML)

    - -

    - -Tables - - - -


    - -Objective: Tests the Simple HTML Table Model. - -

    - -Syntax: The Simple Table Model is the table model that most browsers currently support. - -The model is from the HTML 3.2 Draft specifications which describes tables in terms of table cells - -grouped into row-based cell layouts. - -

    - -Based on the simple table model, you can create a wide variety of tables with only five tags: - -

      - -
    1. the <TABLE> tag, which encapsulates a table and its elements in the HTML document's body content;
    2. - -
    3. the <TR> tag, which defines a table row;
    4. - -
    5. the <TH> tag, which define the table header;
    6. - -
    7. the <TD> tag, which define the table data cell;
    8. - -
    9. the <CAPTION> tag, which defines a table title (caption); - -
    - -Each tag has one or more required and optional attributes, some of which affect not only the tag itself, but related tags. - -

    - -Procedure: Click each link in the Special Case column to verify that the expected results match the resulting display. - -


    - - - - - -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Special CaseExpected Results
    Table with background color
  • Verify what happens when you use the Edit|Preferences|Appearance|Color checkbox.
  • Table with Mixed Widths
  • Verify what happens when you have mixed absolute and relative table cell widths?.
  • Large Table
  • Verify that you can load a table with a large number of rows & columns.
  • Character Styles inside Tables
  • Verify that tables can contain character styles.[from Character Styles Functional Test Case]
  • Images inside Tables
  • Verify that images can be contained inside tables.[from Image Functional Test Case]
  • Multicolumns inside a Table
  • Verify that multicolumns can be contained inside a table.[from Multicolumn Functional Test Case]
  • Table with Plug-ins
  • Verify that multimedia plug-ins can be contained inside a table.
  • Nested Tables
  • Verify that tables can be nested inside other tables.
  • Invalid Table Tags
  • Verify that table will NOT crash when closing table tags were missing.
  • Image/table overlapping
  • Verify that Image and table text should NOT co-exist in the same space.
  • - -
    - - - -

    - -
    - -

    - - - - - - - - - - - - - -
    - back to Body
    -
    -
    - back to Functional Test Suite - - - back to Tag Index - -   - back to Acceptance Test - - - on to Stress Test - -
    - -
    - - - -
    - Created 5/13/96 by Ronald Greti
    - Modified 11/03/96 by Ronald Greti
    - Modified 12/08/96 by Robert Wehrfritz
    - Modified 03/04/97 by Chitra Natarajan
    - Modified 1/13/98 by Fenella Gor
    -

    - -

    -

    CONFIDENTIAL AND PROPRIETARY TEST SCRIPT OF NETSCAPE COMMUNICATIONS CORP.
    Copyright © 1996 Netscape Communications Corp. All Rights Reserved.
    Use of this Test Script is subject to the terms of the applicable license agreement from Netscape Communications Corp.
    diff --git a/mozilla/layout/makefile.win b/mozilla/layout/makefile.win deleted file mode 100644 index 0e5c931a894..00000000000 --- a/mozilla/layout/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=.. -IGNORE_MANIFEST=1 - -DIRS=base html build - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/layout/style/nsCSSDeclaration.cpp b/mozilla/layout/style/nsCSSDeclaration.cpp deleted file mode 100644 index 35ee0d46229..00000000000 --- a/mozilla/layout/style/nsCSSDeclaration.cpp +++ /dev/null @@ -1,1435 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSDeclaration.h" -#include "nsString.h" -#include "nsCRT.h" -#include "nsCSSProps.h" -#include "nsCSSPropIDs.h" -#include "nsUnitConversion.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID); -static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID); -static NS_DEFINE_IID(kCSSDisplaySID, NS_CSS_DISPLAY_SID); -static NS_DEFINE_IID(kCSSTextSID, NS_CSS_TEXT_SID); -static NS_DEFINE_IID(kCSSMarginSID, NS_CSS_MARGIN_SID); -static NS_DEFINE_IID(kCSSPositionSID, NS_CSS_POSITION_SID); -static NS_DEFINE_IID(kCSSListSID, NS_CSS_LIST_SID); -static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID); - - -nsCSSValue::nsCSSValue(void) - : mUnit(eCSSUnit_Null) -{ - mValue.mInt = 0; -} - -nsCSSValue::nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit) - : mUnit(aUnit) -{ - mValue.mInt = aValue; -} - -nsCSSValue::nsCSSValue(float aValue, nsCSSUnit aUnit) - : mUnit(aUnit) -{ - mValue.mFloat = aValue; -} - -nsCSSValue::nsCSSValue(const nsString& aValue) - : mUnit(eCSSUnit_String) -{ - mValue.mString = aValue.ToNewString(); -} - -nsCSSValue::nsCSSValue(nscolor aValue) - : mUnit(eCSSUnit_Color) -{ - mValue.mColor = aValue; -} - -nsCSSValue::nsCSSValue(const nsCSSValue& aCopy) - : mUnit(aCopy.mUnit) -{ - if (eCSSUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = (aCopy.mValue.mString)->ToNewString(); - } - else { - mValue.mString = nsnull; - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - mValue.mInt = aCopy.mValue.mInt; - } - else if (eCSSUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else { - mValue.mFloat = aCopy.mValue.mFloat; - } -} - -nsCSSValue::~nsCSSValue(void) -{ - Reset(); -} - -nsCSSValue& nsCSSValue::operator=(const nsCSSValue& aCopy) -{ - Reset(); - mUnit = aCopy.mUnit; - if (eCSSUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = (aCopy.mValue.mString)->ToNewString(); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - mValue.mInt = aCopy.mValue.mInt; - } - else if (eCSSUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else { - mValue.mFloat = aCopy.mValue.mFloat; - } - return *this; -} - -PRBool nsCSSValue::operator==(const nsCSSValue& aOther) const -{ - if (mUnit == aOther.mUnit) { - if (eCSSUnit_String == mUnit) { - if (nsnull == mValue.mString) { - if (nsnull == aOther.mValue.mString) { - return PR_TRUE; - } - } - else if (nsnull != aOther.mValue.mString) { - return mValue.mString->Equals(*(aOther.mValue.mString)); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit < eCSSUnit_Percent)) { - return PRBool(mValue.mInt == aOther.mValue.mInt); - } - else if (eCSSUnit_Color == mUnit){ - return PRBool(mValue.mColor == aOther.mValue.mColor); - } - else { - return PRBool(mValue.mFloat == aOther.mValue.mFloat); - } - } - return PR_FALSE; -} - -nscoord nsCSSValue::GetLengthTwips(void) const -{ - NS_ASSERTION(IsFixedLengthUnit(), "not a fixed length unit"); - - if (IsFixedLengthUnit()) { - switch (mUnit) { - case eCSSUnit_Inch: - return (nscoord)NS_INCHES_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Foot: - return (nscoord)NS_FEET_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Mile: - return (nscoord)NS_MILES_TO_TWIPS(mValue.mFloat); - - case eCSSUnit_Millimeter: - return (nscoord)NS_MILLIMETERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Centimeter: - return (nscoord)NS_CENTIMETERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Meter: - return (nscoord)NS_METERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Kilometer: - return (nscoord)NS_KILOMETERS_TO_TWIPS(mValue.mFloat); - - case eCSSUnit_Point: - return (nscoord)NS_POINTS_TO_TWIPS_FLOAT(mValue.mFloat); - case eCSSUnit_Pica: - return (nscoord)NS_PICAS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Didot: - return (nscoord)NS_DIDOTS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Cicero: - return (nscoord)NS_CICEROS_TO_TWIPS(mValue.mFloat); - } - } - return 0; -} - -void nsCSSValue::Reset(void) -{ - if ((eCSSUnit_String == mUnit) && (nsnull != mValue.mString)) { - delete mValue.mString; - } - mUnit = eCSSUnit_Null; - mValue.mInt = 0; -}; - -void nsCSSValue::Set(PRInt32 aValue, nsCSSUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mInt = aValue; -} - -void nsCSSValue::Set(float aValue, nsCSSUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mFloat = aValue; -} - -void nsCSSValue::Set(const nsString& aValue) -{ - Reset(); - mUnit = eCSSUnit_String; - mValue.mString = aValue.ToNewString(); -} - -void nsCSSValue::Set(nscolor aValue) -{ - Reset(); - mUnit = eCSSUnit_Color; - mValue.mColor = aValue; -} - -void nsCSSValue::AppendToString(nsString& aBuffer, PRInt32 aPropID) const -{ - if (eCSSUnit_Null == mUnit) { - return; - } - - if (-1 < aPropID) { - aBuffer.Append(nsCSSProps::kNameTable[aPropID].name); - aBuffer.Append(": "); - } - - if (eCSSUnit_String == mUnit) { - if (nsnull != mValue.mString) { - aBuffer.Append('"'); - aBuffer.Append(*(mValue.mString)); - aBuffer.Append('"'); - } - else { - aBuffer.Append("null str"); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - aBuffer.Append(mValue.mInt, 10); - aBuffer.Append("[0x"); - aBuffer.Append(mValue.mInt, 16); - aBuffer.Append(']'); - } - else if (eCSSUnit_Color == mUnit){ - aBuffer.Append("(0x"); - aBuffer.Append(NS_GET_R(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_G(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_B(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_A(mValue.mColor), 16); - aBuffer.Append(')'); - } - else if (eCSSUnit_Percent <= mUnit) { - aBuffer.Append(mValue.mFloat); - } - - switch (mUnit) { - case eCSSUnit_Null: break; - case eCSSUnit_Auto: aBuffer.Append("auto"); break; - case eCSSUnit_String: break; - case eCSSUnit_Absolute: aBuffer.Append("abs"); break; - case eCSSUnit_Enumerated: aBuffer.Append("enum"); break; - case eCSSUnit_Color: aBuffer.Append("rbga"); break; - case eCSSUnit_Percent: aBuffer.Append("%"); break; - case eCSSUnit_Number: aBuffer.Append("#"); break; - case eCSSUnit_Inch: aBuffer.Append("in"); break; - case eCSSUnit_Foot: aBuffer.Append("ft"); break; - case eCSSUnit_Mile: aBuffer.Append("mi"); break; - case eCSSUnit_Millimeter: aBuffer.Append("mm"); break; - case eCSSUnit_Centimeter: aBuffer.Append("cm"); break; - case eCSSUnit_Meter: aBuffer.Append("m"); break; - case eCSSUnit_Kilometer: aBuffer.Append("km"); break; - case eCSSUnit_Point: aBuffer.Append("pt"); break; - case eCSSUnit_Pica: aBuffer.Append("pc"); break; - case eCSSUnit_Didot: aBuffer.Append("dt"); break; - case eCSSUnit_Cicero: aBuffer.Append("cc"); break; - case eCSSUnit_EM: aBuffer.Append("em"); break; - case eCSSUnit_EN: aBuffer.Append("en"); break; - case eCSSUnit_XHeight: aBuffer.Append("ex"); break; - case eCSSUnit_CapHeight: aBuffer.Append("cap"); break; - case eCSSUnit_Pixel: aBuffer.Append("px"); break; - } - aBuffer.Append(' '); -} - -void nsCSSValue::ToString(nsString& aBuffer, PRInt32 aPropID) const -{ - aBuffer.SetLength(0); - AppendToString(aBuffer, aPropID); -} - -const nsID& nsCSSFont::GetID(void) -{ - return kCSSFontSID; -} - -void nsCSSFont::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mFamily.AppendToString(buffer, PROP_FONT_FAMILY); - mStyle.AppendToString(buffer, PROP_FONT_STYLE); - mVariant.AppendToString(buffer, PROP_FONT_VARIANT); - mWeight.AppendToString(buffer, PROP_FONT_WEIGHT); - mSize.AppendToString(buffer, PROP_FONT_SIZE); - fputs(buffer, out); -} - - -const nsID& nsCSSColor::GetID(void) -{ - return kCSSColorSID; -} - -void nsCSSColor::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mColor.AppendToString(buffer, PROP_COLOR); - mBackColor.AppendToString(buffer, PROP_BACKGROUND_COLOR); - mBackImage.AppendToString(buffer, PROP_BACKGROUND_IMAGE); - mBackRepeat.AppendToString(buffer, PROP_BACKGROUND_REPEAT); - mBackAttachment.AppendToString(buffer, PROP_BACKGROUND_ATTACHMENT); - mBackPositionX.AppendToString(buffer, PROP_BACKGROUND_X_POSITION); - mBackPositionY.AppendToString(buffer, PROP_BACKGROUND_Y_POSITION); - mBackFilter.AppendToString(buffer, PROP_BACKGROUND_FILTER); - mCursor.AppendToString(buffer, PROP_CURSOR); - mCursorImage.AppendToString(buffer, PROP_CURSOR_IMAGE); - fputs(buffer, out); -} - -const nsID& nsCSSText::GetID(void) -{ - return kCSSTextSID; -} - -void nsCSSText::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mWordSpacing.AppendToString(buffer, PROP_WORD_SPACING); - mLetterSpacing.AppendToString(buffer, PROP_LETTER_SPACING); - mDecoration.AppendToString(buffer, PROP_TEXT_DECORATION); - mVerticalAlign.AppendToString(buffer, PROP_VERTICAL_ALIGN); - mTextTransform.AppendToString(buffer, PROP_TEXT_TRANSFORM); - mTextAlign.AppendToString(buffer, PROP_TEXT_ALIGN); - mTextIndent.AppendToString(buffer, PROP_TEXT_INDENT); - mLineHeight.AppendToString(buffer, PROP_LINE_HEIGHT); - mWhiteSpace.AppendToString(buffer, PROP_WHITE_SPACE); - fputs(buffer, out); -} - -const nsID& nsCSSDisplay::GetID(void) -{ - return kCSSDisplaySID; -} - -void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mDirection.AppendToString(buffer, PROP_DIRECTION); - mDisplay.AppendToString(buffer, PROP_DISPLAY); - mFloat.AppendToString(buffer, PROP_FLOAT); - mClear.AppendToString(buffer, PROP_CLEAR); - fputs(buffer, out); -} - -void nsCSSRect::List(FILE* out, PRInt32 aPropID, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - if (-1 < aPropID) { - buffer.Append(nsCSSProps::kNameTable[aPropID].name); - buffer.Append(": "); - } - - mTop.AppendToString(buffer); - mRight.AppendToString(buffer); - mBottom.AppendToString(buffer); - mLeft.AppendToString(buffer); - fputs(buffer, out); -} - -nsCSSMargin::nsCSSMargin(void) - : mMargin(nsnull), mPadding(nsnull), mBorder(nsnull), mColor(nsnull), mStyle(nsnull) -{ -} - -nsCSSMargin::~nsCSSMargin(void) -{ - if (nsnull != mMargin) { - delete mMargin; - } - if (nsnull != mPadding) { - delete mPadding; - } - if (nsnull != mBorder) { - delete mBorder; - } - if (nsnull != mColor) { - delete mColor; - } - if (nsnull != mStyle) { - delete mStyle; - } -} - -const nsID& nsCSSMargin::GetID(void) -{ - return kCSSMarginSID; -} - -void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - if (nsnull != mMargin) { - mMargin->List(out, PROP_MARGIN, aIndent); - } - if (nsnull != mPadding) { - mPadding->List(out, PROP_PADDING, aIndent); - } - if (nsnull != mBorder) { - mBorder->List(out, PROP_BORDER_WIDTH, aIndent); - } - if (nsnull != mColor) { - mColor->List(out, PROP_BORDER_COLOR, aIndent); - } - if (nsnull != mStyle) { - mStyle->List(out, PROP_BORDER_STYLE, aIndent); - } -} - -nsCSSPosition::nsCSSPosition(void) - : mClip(nsnull) -{ -} - -nsCSSPosition::~nsCSSPosition(void) -{ - if (nsnull != mClip) { - delete mClip; - } -} - -const nsID& nsCSSPosition::GetID(void) -{ - return kCSSPositionSID; -} - -void nsCSSPosition::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mPosition.AppendToString(buffer, PROP_POSITION); - mWidth.AppendToString(buffer, PROP_WIDTH); - mHeight.AppendToString(buffer, PROP_HEIGHT); - mLeft.AppendToString(buffer, PROP_LEFT); - mTop.AppendToString(buffer, PROP_TOP); - fputs(buffer, out); - if (nsnull != mClip) { - mClip->List(out, PROP_CLIP); - } - buffer.SetLength(0); - mOverflow.AppendToString(buffer, PROP_OVERFLOW); - mZIndex.AppendToString(buffer, PROP_OVERFLOW); - mVisibility.AppendToString(buffer, PROP_VISIBILITY); - mFilter.AppendToString(buffer, PROP_FILTER); - fputs(buffer, out); -} - -const nsID& nsCSSList::GetID(void) -{ - return kCSSListSID; -} - -void nsCSSList::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mType.AppendToString(buffer, PROP_LIST_STYLE_TYPE); - mImage.AppendToString(buffer, PROP_LIST_STYLE_IMAGE); - mPosition.AppendToString(buffer, PROP_LIST_STYLE_POSITION); - fputs(buffer, out); -} - - - -class CSSDeclarationImpl : public nsICSSDeclaration { -public: - void* operator new(size_t size); - - CSSDeclarationImpl(void); - ~CSSDeclarationImpl(void); - - NS_DECL_ISUPPORTS - - nsresult GetData(const nsID& aSID, nsCSSStruct** aData); - nsresult EnsureData(const nsID& aSID, nsCSSStruct** aData); - - nsresult AddValue(const char* aProperty, const nsCSSValue& aValue); - nsresult AddValue(PRInt32 aProperty, const nsCSSValue& aValue); - nsresult GetValue(const char* aProperty, nsCSSValue& aValue); - nsresult GetValue(PRInt32 aProperty, nsCSSValue& aValue); - - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - CSSDeclarationImpl(const CSSDeclarationImpl& aCopy); - CSSDeclarationImpl& operator=(const CSSDeclarationImpl& aCopy); - PRBool operator==(const CSSDeclarationImpl& aCopy) const; - -protected: - nsCSSFont* mFont; - nsCSSColor* mColor; - nsCSSText* mText; - nsCSSMargin* mMargin; - nsCSSPosition* mPosition; - nsCSSList* mList; - nsCSSDisplay* mDisplay; -}; - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - - -void* CSSDeclarationImpl::operator new(size_t size) -{ - void* result = new char[size]; - - nsCRT::zero(result, size); - return result; -} - -CSSDeclarationImpl::CSSDeclarationImpl(void) -{ - NS_INIT_REFCNT(); -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + CSSDeclaration\n", gInstanceCount); -#endif -} - -CSSDeclarationImpl::~CSSDeclarationImpl(void) -{ - if (nsnull != mFont) { - delete mFont; - } - if (nsnull != mColor) { - delete mColor; - } - if (nsnull != mText) { - delete mText; - } - if (nsnull != mMargin) { - delete mMargin; - } - if (nsnull != mPosition) { - delete mPosition; - } - if (nsnull != mList) { - delete mList; - } - if (nsnull != mDisplay) { - delete mDisplay; - } -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - CSSDeclaration\n", gInstanceCount); -#endif -} - -NS_IMPL_ISUPPORTS(CSSDeclarationImpl, kICSSDeclarationIID); - -nsresult CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr) -{ - if (nsnull == aDataPtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aSID.Equals(kCSSFontSID)) { - *aDataPtr = mFont; - } - else if (aSID.Equals(kCSSColorSID)) { - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSDisplaySID)) { - *aDataPtr = mDisplay; - } - else if (aSID.Equals(kCSSTextSID)) { - *aDataPtr = mText; - } - else if (aSID.Equals(kCSSMarginSID)) { - *aDataPtr = mMargin; - } - else if (aSID.Equals(kCSSPositionSID)) { - *aDataPtr = mPosition; - } - else if (aSID.Equals(kCSSListSID)) { - *aDataPtr = mList; - } - else { - return NS_NOINTERFACE; - } - return NS_OK; -} - -nsresult CSSDeclarationImpl::EnsureData(const nsID& aSID, nsCSSStruct** aDataPtr) -{ - if (nsnull == aDataPtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aSID.Equals(kCSSFontSID)) { - if (nsnull == mFont) { - mFont = new nsCSSFont(); - } - *aDataPtr = mFont; - } - else if (aSID.Equals(kCSSColorSID)) { - if (nsnull == mColor) { - mColor = new nsCSSColor(); - } - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSDisplaySID)) { - if (nsnull == mDisplay) { - mDisplay = new nsCSSDisplay(); - } - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSTextSID)) { - if (nsnull == mText) { - mText = new nsCSSText(); - } - *aDataPtr = mText; - } - else if (aSID.Equals(kCSSMarginSID)) { - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - *aDataPtr = mMargin; - } - else if (aSID.Equals(kCSSPositionSID)) { - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - *aDataPtr = mPosition; - } - else if (aSID.Equals(kCSSListSID)) { - if (nsnull == mList) { - mList = new nsCSSList(); - } - *aDataPtr = mList; - } - else { - return NS_NOINTERFACE; - } - if (nsnull == *aDataPtr) { - return NS_ERROR_OUT_OF_MEMORY; - } - return NS_OK; -} - -nsresult CSSDeclarationImpl::AddValue(const char* aProperty, const nsCSSValue& aValue) -{ - return AddValue(nsCSSProps::LookupName(aProperty), aValue); -} - -nsresult CSSDeclarationImpl::AddValue(PRInt32 aProperty, const nsCSSValue& aValue) -{ - nsresult result = NS_OK; - - switch (aProperty) { - // nsCSSFont - case PROP_FONT_FAMILY: - case PROP_FONT_STYLE: - case PROP_FONT_VARIANT: - case PROP_FONT_WEIGHT: - case PROP_FONT_SIZE: - if (nsnull == mFont) { - mFont = new nsCSSFont(); - } - if (nsnull != mFont) { - switch (aProperty) { - case PROP_FONT_FAMILY: mFont->mFamily = aValue; break; - case PROP_FONT_STYLE: mFont->mStyle = aValue; break; - case PROP_FONT_VARIANT: mFont->mVariant = aValue; break; - case PROP_FONT_WEIGHT: mFont->mWeight = aValue; break; - case PROP_FONT_SIZE: mFont->mSize = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSColor - case PROP_COLOR: - case PROP_BACKGROUND_COLOR: - case PROP_BACKGROUND_IMAGE: - case PROP_BACKGROUND_REPEAT: - case PROP_BACKGROUND_ATTACHMENT: - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BACKGROUND_FILTER: - case PROP_CURSOR: - case PROP_CURSOR_IMAGE: - if (nsnull == mColor) { - mColor = new nsCSSColor(); - } - if (nsnull != mColor) { - switch (aProperty) { - case PROP_COLOR: mColor->mColor = aValue; break; - case PROP_BACKGROUND_COLOR: mColor->mBackColor = aValue; break; - case PROP_BACKGROUND_IMAGE: mColor->mBackImage = aValue; break; - case PROP_BACKGROUND_REPEAT: mColor->mBackRepeat = aValue; break; - case PROP_BACKGROUND_ATTACHMENT: mColor->mBackAttachment = aValue; break; - case PROP_BACKGROUND_X_POSITION: mColor->mBackPositionX = aValue; break; - case PROP_BACKGROUND_Y_POSITION: mColor->mBackPositionY = aValue; break; - case PROP_BACKGROUND_FILTER: mColor->mBackFilter = aValue; break; - case PROP_CURSOR: mColor->mCursor = aValue; break; - case PROP_CURSOR_IMAGE: mColor->mCursorImage = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSText - case PROP_WORD_SPACING: - case PROP_LETTER_SPACING: - case PROP_TEXT_DECORATION: - case PROP_VERTICAL_ALIGN: - case PROP_TEXT_TRANSFORM: - case PROP_TEXT_ALIGN: - case PROP_TEXT_INDENT: - case PROP_LINE_HEIGHT: - case PROP_WHITE_SPACE: - if (nsnull == mText) { - mText = new nsCSSText(); - } - if (nsnull != mText) { - switch (aProperty) { - case PROP_WORD_SPACING: mText->mWordSpacing = aValue; break; - case PROP_LETTER_SPACING: mText->mLetterSpacing = aValue; break; - case PROP_TEXT_DECORATION: mText->mDecoration = aValue; break; - case PROP_VERTICAL_ALIGN: mText->mVerticalAlign = aValue; break; - case PROP_TEXT_TRANSFORM: mText->mTextTransform = aValue; break; - case PROP_TEXT_ALIGN: mText->mTextAlign = aValue; break; - case PROP_TEXT_INDENT: mText->mTextIndent = aValue; break; - case PROP_LINE_HEIGHT: mText->mLineHeight = aValue; break; - case PROP_WHITE_SPACE: mText->mWhiteSpace = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSMargin - case PROP_MARGIN_TOP: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mMargin) { - mMargin->mMargin = new nsCSSRect(); - } - if (nsnull != mMargin->mMargin) { - switch (aProperty) { - case PROP_MARGIN_TOP: mMargin->mMargin->mTop = aValue; break; - case PROP_MARGIN_RIGHT: mMargin->mMargin->mRight = aValue; break; - case PROP_MARGIN_BOTTOM: mMargin->mMargin->mBottom = aValue; break; - case PROP_MARGIN_LEFT: mMargin->mMargin->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_PADDING_TOP: - case PROP_PADDING_RIGHT: - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mPadding) { - mMargin->mPadding = new nsCSSRect(); - } - if (nsnull != mMargin->mPadding) { - switch (aProperty) { - case PROP_PADDING_TOP: mMargin->mPadding->mTop = aValue; break; - case PROP_PADDING_RIGHT: mMargin->mPadding->mRight = aValue; break; - case PROP_PADDING_BOTTOM: mMargin->mPadding->mBottom = aValue; break; - case PROP_PADDING_LEFT: mMargin->mPadding->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mBorder) { - mMargin->mBorder = new nsCSSRect(); - } - if (nsnull != mMargin->mBorder) { - switch (aProperty) { - case PROP_BORDER_TOP_WIDTH: mMargin->mBorder->mTop = aValue; break; - case PROP_BORDER_RIGHT_WIDTH: mMargin->mBorder->mRight = aValue; break; - case PROP_BORDER_BOTTOM_WIDTH: mMargin->mBorder->mBottom = aValue; break; - case PROP_BORDER_LEFT_WIDTH: mMargin->mBorder->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mColor) { - mMargin->mColor = new nsCSSRect(); - } - if (nsnull != mMargin->mColor) { - switch (aProperty) { - case PROP_BORDER_TOP_COLOR: mMargin->mColor->mTop = aValue; break; - case PROP_BORDER_RIGHT_COLOR: mMargin->mColor->mRight = aValue; break; - case PROP_BORDER_BOTTOM_COLOR: mMargin->mColor->mBottom = aValue; break; - case PROP_BORDER_LEFT_COLOR: mMargin->mColor->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mStyle) { - mMargin->mStyle = new nsCSSRect(); - } - if (nsnull != mMargin->mStyle) { - switch (aProperty) { - case PROP_BORDER_TOP_STYLE: mMargin->mStyle->mTop = aValue; break; - case PROP_BORDER_RIGHT_STYLE: mMargin->mStyle->mRight = aValue; break; - case PROP_BORDER_BOTTOM_STYLE: mMargin->mStyle->mBottom = aValue; break; - case PROP_BORDER_LEFT_STYLE: mMargin->mStyle->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSPosition - case PROP_POSITION: - case PROP_WIDTH: - case PROP_HEIGHT: - case PROP_LEFT: - case PROP_TOP: - case PROP_OVERFLOW: - case PROP_Z_INDEX: - case PROP_VISIBILITY: - case PROP_FILTER: - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - if (nsnull != mPosition) { - switch (aProperty) { - case PROP_POSITION: mPosition->mPosition = aValue; break; - case PROP_WIDTH: mPosition->mWidth = aValue; break; - case PROP_HEIGHT: mPosition->mHeight = aValue; break; - case PROP_LEFT: mPosition->mLeft = aValue; break; - case PROP_TOP: mPosition->mTop = aValue; break; - case PROP_OVERFLOW: mPosition->mOverflow = aValue; break; - case PROP_Z_INDEX: mPosition->mZIndex = aValue; break; - case PROP_VISIBILITY: mPosition->mVisibility = aValue; break; - case PROP_FILTER: mPosition->mFilter = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_CLIP_TOP: - case PROP_CLIP_RIGHT: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - if (nsnull != mPosition) { - if (nsnull == mPosition->mClip) { - mPosition->mClip = new nsCSSRect(); - } - if (nsnull != mPosition->mClip) { - switch(aProperty) { - case PROP_CLIP_TOP: mPosition->mClip->mTop = aValue; break; - case PROP_CLIP_RIGHT: mPosition->mClip->mRight = aValue; break; - case PROP_CLIP_BOTTOM: mPosition->mClip->mBottom = aValue; break; - case PROP_CLIP_LEFT: mPosition->mClip->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSList - case PROP_LIST_STYLE_TYPE: - case PROP_LIST_STYLE_IMAGE: - case PROP_LIST_STYLE_POSITION: - if (nsnull == mList) { - mList = new nsCSSList(); - } - if (nsnull != mList) { - switch (aProperty) { - case PROP_LIST_STYLE_TYPE: mList->mType = aValue; break; - case PROP_LIST_STYLE_IMAGE: mList->mImage = aValue; break; - case PROP_LIST_STYLE_POSITION: mList->mPosition = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSDisplay - case PROP_FLOAT: - case PROP_CLEAR: - case PROP_DISPLAY: - case PROP_DIRECTION: - if (nsnull == mDisplay) { - mDisplay = new nsCSSDisplay(); - } - if (nsnull != mDisplay) { - switch (aProperty) { - case PROP_FLOAT: mDisplay->mFloat = aValue; break; - case PROP_CLEAR: mDisplay->mClear = aValue; break; - case PROP_DISPLAY: mDisplay->mDisplay = aValue; break; - case PROP_DIRECTION: mDisplay->mDirection = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BACKGROUND: - case PROP_BORDER: - case PROP_CLIP: - case PROP_FONT: - case PROP_LIST_STYLE: - case PROP_MARGIN: - case PROP_PADDING: - case PROP_BACKGROUND_POSITION: - case PROP_BORDER_TOP: - case PROP_BORDER_RIGHT: - case PROP_BORDER_BOTTOM: - case PROP_BORDER_LEFT: - case PROP_BORDER_COLOR: - case PROP_BORDER_STYLE: - case PROP_BORDER_WIDTH: - NS_ERROR("can't query for shorthand properties"); - default: - result = NS_ERROR_ILLEGAL_VALUE; - break; - } - return result; -} - -nsresult CSSDeclarationImpl::GetValue(const char* aProperty, nsCSSValue& aValue) -{ - return GetValue(nsCSSProps::LookupName(aProperty), aValue); -} - -nsresult CSSDeclarationImpl::GetValue(PRInt32 aProperty, nsCSSValue& aValue) -{ - nsresult result = NS_OK; - - switch (aProperty) { - // nsCSSFont - case PROP_FONT_FAMILY: - case PROP_FONT_STYLE: - case PROP_FONT_VARIANT: - case PROP_FONT_WEIGHT: - case PROP_FONT_SIZE: - if (nsnull != mFont) { - switch (aProperty) { - case PROP_FONT_FAMILY: aValue = mFont->mFamily; break; - case PROP_FONT_STYLE: aValue = mFont->mStyle; break; - case PROP_FONT_VARIANT: aValue = mFont->mVariant; break; - case PROP_FONT_WEIGHT: aValue = mFont->mWeight; break; - case PROP_FONT_SIZE: aValue = mFont->mSize; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSColor - case PROP_COLOR: - case PROP_BACKGROUND_COLOR: - case PROP_BACKGROUND_IMAGE: - case PROP_BACKGROUND_REPEAT: - case PROP_BACKGROUND_ATTACHMENT: - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BACKGROUND_FILTER: - case PROP_CURSOR: - case PROP_CURSOR_IMAGE: - if (nsnull != mColor) { - switch (aProperty) { - case PROP_COLOR: aValue = mColor->mColor; break; - case PROP_BACKGROUND_COLOR: aValue = mColor->mBackColor; break; - case PROP_BACKGROUND_IMAGE: aValue = mColor->mBackImage; break; - case PROP_BACKGROUND_REPEAT: aValue = mColor->mBackRepeat; break; - case PROP_BACKGROUND_ATTACHMENT: aValue = mColor->mBackAttachment; break; - case PROP_BACKGROUND_X_POSITION: aValue = mColor->mBackPositionX; break; - case PROP_BACKGROUND_Y_POSITION: aValue = mColor->mBackPositionY; break; - case PROP_BACKGROUND_FILTER: aValue = mColor->mBackFilter; break; - case PROP_CURSOR: aValue = mColor->mCursor; break; - case PROP_CURSOR_IMAGE: aValue = mColor->mCursorImage; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSText - case PROP_WORD_SPACING: - case PROP_LETTER_SPACING: - case PROP_TEXT_DECORATION: - case PROP_VERTICAL_ALIGN: - case PROP_TEXT_TRANSFORM: - case PROP_TEXT_ALIGN: - case PROP_TEXT_INDENT: - case PROP_LINE_HEIGHT: - case PROP_WHITE_SPACE: - if (nsnull != mText) { - switch (aProperty) { - case PROP_WORD_SPACING: aValue = mText->mWordSpacing; break; - case PROP_LETTER_SPACING: aValue = mText->mLetterSpacing; break; - case PROP_TEXT_DECORATION: aValue = mText->mDecoration; break; - case PROP_VERTICAL_ALIGN: aValue = mText->mVerticalAlign; break; - case PROP_TEXT_TRANSFORM: aValue = mText->mTextTransform; break; - case PROP_TEXT_ALIGN: aValue = mText->mTextAlign; break; - case PROP_TEXT_INDENT: aValue = mText->mTextIndent; break; - case PROP_LINE_HEIGHT: aValue = mText->mLineHeight; break; - case PROP_WHITE_SPACE: aValue = mText->mWhiteSpace; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSMargin - case PROP_MARGIN_TOP: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - if ((nsnull != mMargin) && (nsnull != mMargin->mMargin)) { - switch (aProperty) { - case PROP_MARGIN_TOP: aValue = mMargin->mMargin->mTop; break; - case PROP_MARGIN_RIGHT: aValue = mMargin->mMargin->mRight; break; - case PROP_MARGIN_BOTTOM: aValue = mMargin->mMargin->mBottom; break; - case PROP_MARGIN_LEFT: aValue = mMargin->mMargin->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_PADDING_TOP: - case PROP_PADDING_RIGHT: - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - if ((nsnull != mMargin) && (nsnull != mMargin->mPadding)) { - switch (aProperty) { - case PROP_PADDING_TOP: aValue = mMargin->mPadding->mTop; break; - case PROP_PADDING_RIGHT: aValue = mMargin->mPadding->mRight; break; - case PROP_PADDING_BOTTOM: aValue = mMargin->mPadding->mBottom; break; - case PROP_PADDING_LEFT: aValue = mMargin->mPadding->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - if ((nsnull != mMargin) && (nsnull != mMargin->mBorder)) { - switch (aProperty) { - case PROP_BORDER_TOP_WIDTH: aValue = mMargin->mBorder->mTop; break; - case PROP_BORDER_RIGHT_WIDTH: aValue = mMargin->mBorder->mRight; break; - case PROP_BORDER_BOTTOM_WIDTH: aValue = mMargin->mBorder->mBottom; break; - case PROP_BORDER_LEFT_WIDTH: aValue = mMargin->mBorder->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - if ((nsnull != mMargin) && (nsnull != mMargin->mColor)) { - switch (aProperty) { - case PROP_BORDER_TOP_COLOR: aValue = mMargin->mColor->mTop; break; - case PROP_BORDER_RIGHT_COLOR: aValue = mMargin->mColor->mRight; break; - case PROP_BORDER_BOTTOM_COLOR: aValue = mMargin->mColor->mBottom; break; - case PROP_BORDER_LEFT_COLOR: aValue = mMargin->mColor->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - if ((nsnull != mMargin) && (nsnull != mMargin->mStyle)) { - switch (aProperty) { - case PROP_BORDER_TOP_STYLE: aValue = mMargin->mStyle->mTop; break; - case PROP_BORDER_RIGHT_STYLE: aValue = mMargin->mStyle->mRight; break; - case PROP_BORDER_BOTTOM_STYLE: aValue = mMargin->mStyle->mBottom; break; - case PROP_BORDER_LEFT_STYLE: aValue = mMargin->mStyle->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSPosition - case PROP_POSITION: - case PROP_WIDTH: - case PROP_HEIGHT: - case PROP_LEFT: - case PROP_TOP: - case PROP_OVERFLOW: - case PROP_Z_INDEX: - case PROP_VISIBILITY: - case PROP_FILTER: - if (nsnull != mPosition) { - switch (aProperty) { - case PROP_POSITION: aValue = mPosition->mPosition; break; - case PROP_WIDTH: aValue = mPosition->mWidth; break; - case PROP_HEIGHT: aValue = mPosition->mHeight; break; - case PROP_LEFT: aValue = mPosition->mLeft; break; - case PROP_TOP: aValue = mPosition->mTop; break; - case PROP_OVERFLOW: aValue = mPosition->mOverflow; break; - case PROP_Z_INDEX: aValue = mPosition->mZIndex; break; - case PROP_VISIBILITY: aValue = mPosition->mVisibility; break; - case PROP_FILTER: aValue = mPosition->mFilter; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_CLIP_TOP: - case PROP_CLIP_RIGHT: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - if ((nsnull != mPosition) && (nsnull != mPosition->mClip)) { - switch(aProperty) { - case PROP_CLIP_TOP: aValue = mPosition->mClip->mTop; break; - case PROP_CLIP_RIGHT: aValue = mPosition->mClip->mRight; break; - case PROP_CLIP_BOTTOM: aValue = mPosition->mClip->mBottom; break; - case PROP_CLIP_LEFT: aValue = mPosition->mClip->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSList - case PROP_LIST_STYLE_TYPE: - case PROP_LIST_STYLE_IMAGE: - case PROP_LIST_STYLE_POSITION: - if (nsnull != mList) { - switch (aProperty) { - case PROP_LIST_STYLE_TYPE: aValue = mList->mType; break; - case PROP_LIST_STYLE_IMAGE: aValue = mList->mImage; break; - case PROP_LIST_STYLE_POSITION: aValue = mList->mPosition; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSDisplay - case PROP_FLOAT: - case PROP_CLEAR: - case PROP_DISPLAY: - case PROP_DIRECTION: - if (nsnull != mDisplay) { - switch (aProperty) { - case PROP_FLOAT: aValue = mDisplay->mFloat; break; - case PROP_CLEAR: aValue = mDisplay->mClear; break; - case PROP_DISPLAY: aValue = mDisplay->mDisplay; break; - case PROP_DIRECTION: aValue = mDisplay->mDirection; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BACKGROUND: - case PROP_BORDER: - case PROP_CLIP: - case PROP_FONT: - case PROP_LIST_STYLE: - case PROP_MARGIN: - case PROP_PADDING: - case PROP_BACKGROUND_POSITION: - case PROP_BORDER_TOP: - case PROP_BORDER_RIGHT: - case PROP_BORDER_BOTTOM: - case PROP_BORDER_LEFT: - case PROP_BORDER_COLOR: - case PROP_BORDER_STYLE: - case PROP_BORDER_WIDTH: - NS_ERROR("can't query for shorthand properties"); - default: - result = NS_ERROR_ILLEGAL_VALUE; - break; - } - return result; -} - -void CSSDeclarationImpl::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("{ ", out); - - if (nsnull != mFont) { - mFont->List(out); - } - if (nsnull != mColor) { - mColor->List(out); - } - if (nsnull != mText) { - mText->List(out); - } - if (nsnull != mMargin) { - mMargin->List(out); - } - if (nsnull != mPosition) { - mPosition->List(out); - } - if (nsnull != mList) { - mList->List(out); - } - if (nsnull != mDisplay) { - mDisplay->List(out); - } - - fputs("}", out); -} - -NS_HTML nsresult - NS_NewCSSDeclaration(nsICSSDeclaration** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSDeclarationImpl *it = new CSSDeclarationImpl(); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSDeclarationIID, (void **) aInstancePtrResult); -} - - -/* -font -=========== -font-family: string (list) -font-style: enum -font-variant: enum (ie: small caps) -font-weight: enum -font-size: abs, pct, enum, +-1 - - -color/background -============= -color: color -background-color: color -background-image: url(string) -background-repeat: enum -background-attachment: enum -background-position-x -y: abs, pct, enum (left/top center right/bottom (pct?)) -cursor: enum -cursor-image: url(string) - - -text -======= -word-spacing: abs, "normal" -letter-spacing: abs, "normal" -text-decoration: enum -vertical-align: enum, pct -text-transform: enum -text-align: enum -text-indent: abs, pct -line-height: "normal", abs, pct, number-factor -white-space: enum - -margin -======= -margin-top -right -bottom -left: "auto", abs, pct -padding-top -right -bottom -left: abs, pct -border-top -right -bottom -left-width: enum, abs -border-top -right -bottom -left-color: color -border-top -right -bottom -left-style: enum - -size -======= -position: enum -width: abs, pct, "auto" -height: abs, pct, "auto" -left: abs, pct, "auto" -top: abs, pct, "auto" -clip: shape, "auto" (shape: rect - abs, auto) -overflow: enum -z-index: int, auto -visibity: enum - -display -======= -float: enum -clear: enum -direction: enum -display: enum - -filter: string - -list -======== -list-style-type: enum -list-style-image: url, "none" -list-style-position: enum (bool? in/out) - -*/ - - - diff --git a/mozilla/layout/style/nsCSSKeywords.cpp b/mozilla/layout/style/nsCSSKeywords.cpp deleted file mode 100644 index eefdfa68880..00000000000 --- a/mozilla/layout/style/nsCSSKeywords.cpp +++ /dev/null @@ -1,399 +0,0 @@ - -/* -** This is a generated file, do not edit it. This file is created by -** genhash.pl -*/ - -#include "plstr.h" -#include "nsCSSKeywords.h" -#define TOTAL_KEYWORDS 91 -#define MIN_WORD_LENGTH 2 -#define MAX_WORD_LENGTH 12 -#define MIN_HASH_VALUE 12 -#define MAX_HASH_VALUE 312 -/* maximum key range = 301, duplicates = 0 */ - - -struct StaticNameTable { - char* tag; - PRInt32 id; -}; - -static const unsigned char kLowerLookup[256] = { - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64, - 97,98,99,100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -#define MYLOWER(x) kLowerLookup[((x) & 0x7f)] - -/** - * Map a name to an ID or -1 - */ -PRInt32 nsCSSKeywords::LookupName(const char* str) -{ - static unsigned short asso_values[] = - { - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 7, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 5, 125, 117, - 67, 0, 10, 55, 15, 20, 5, 35, 0, 25, - 75, 0, 10, 0, 106, 25, 0, 30, 10, 90, - 10, 0, 313, 313, 313, 313, 313, 313, - }; - static unsigned char lengthtable[] = - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7, 0, 0, 0, - 8, 0, 0, 0, 2, 0, 0, 8, 6, 7, 0, 4, 0, 0, - 0, 0, 0, 0, 11, 0, 0, 7, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 5, 6, 7, 0, 9, 0, 0, 7, 0, 0, - 0, 11, 0, 0, 0, 5, 0, 2, 0, 9, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 8, 9, 0, 8, 0, 0, 0, 5, - 0, 0, 0, 6, 0, 6, 9, 0, 0, 7, 0, 3, 0, 11, - 5, 0, 4, 0, 5, 7, 6, 3, 0, 0, 6, 6, 8, 5, - 6, 11, 0, 0, 0, 8, 7, 0, 0, 0, 0, 12, 0, 0, - 6, 8, 10, 0, 4, 0, 0, 0, 6, 0, 9, 0, 0, 6, - 4, 0, 6, 0, 0, 0, 0, 0, 0, 8, 0, 5, 4, 6, - 0, 2, 6, 0, 2, 0, 0, 5, 5, 0, 0, 0, 0, 6, - 0, 6, 0, 5, 5, 6, 0, 0, 0, 7, 0, 0, 0, 0, - 4, 0, 5, 0, 0, 9, 0, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 6, - 8, 0, 0, 0, 11, 0, 0, 0, 2, 0, 0, 6, 0, 0, - 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 3, 0, 0, 0, 5, - }; - static struct StaticNameTable wordlist[] = - { - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, - {"pt", 58}, - {"",}, - {"left", 35}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"ex", 20}, - {"top", 80}, - {"x-large", 87}, - {"",}, {"",}, {"",}, - {"text-top", 77}, - {"",}, {"",}, {"",}, - {"px", 59}, - {"",}, {"",}, - {"xx-small", 90}, - {"outset", 52}, - {"outside", 53}, - {"",}, - {"auto", 2}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"text-bottom", 76}, - {"",}, {"",}, - {"x-small", 88}, - {"",}, {"",}, - {"em", 19}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"small", 68}, - {"square", 72}, - {"visible", 86}, - {"",}, - {"uppercase", 85}, - {"",}, {"",}, - {"justify", 32}, - {"",}, {"",}, {"",}, - {"upper-alpha", 83}, - {"",}, {"",}, {"",}, - {"thick", 78}, - {"",}, - {"mm", 45}, - {"",}, - {"list-item", 38}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, - {"xx-large", 89}, - {"no-repeat", 46}, - {"",}, - {"overline", 54}, - {"",}, {"",}, {"",}, - {"solid", 71}, - {"",}, {"",}, {"",}, - {"inline", 28}, - {"",}, - {"double", 18}, - {"lowercase", 41}, - {"",}, {"",}, - {"noshade", 49}, - {"",}, - {"rtl", 66}, - {"",}, - {"lower-alpha", 39}, - {"fixed", 21}, - {"",}, - {"thin", 79}, - {"",}, - {"large", 33}, - {"inherit", 27}, - {"middle", 44}, - {"pre", 57}, - {"",}, {"",}, - {"repeat", 61}, - {"medium", 43}, - {"relative", 60}, - {"inset", 29}, - {"inside", 30}, - {"transparent", 81}, - {"",}, {"",}, {"",}, - {"repeat-y", 63}, - {"oblique", 51}, - {"",}, {"",}, {"",}, {"",}, - {"line-through", 37}, - {"",}, {"",}, - {"dotted", 17}, - {"repeat-x", 62}, - {"capitalize", 10}, - {"",}, - {"both", 8}, - {"",}, {"",}, {"",}, - {"italic", 31}, - {"",}, - {"paragraph", 55}, - {"",}, {"",}, - {"static", 73}, - {"none", 47}, - {"",}, - {"bottom", 9}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"absolute", 0}, - {"",}, - {"block", 5}, - {"hand", 23}, - {"groove", 22}, - {"",}, - {"cm", 13}, - {"dashed", 14}, - {"",}, - {"in", 26}, - {"",}, {"",}, - {"ibeam", 25}, - {"super", 75}, - {"",}, {"",}, {"",}, {"",}, - {"nowrap", 50}, - {"",}, - {"hidden", 24}, - {"",}, - {"blink", 4}, - {"right", 65}, - {"normal", 48}, - {"",}, {"",}, {"",}, - {"decimal", 15}, - {"",}, {"",}, {"",}, {"",}, - {"bold", 6}, - {"",}, - {"ridge", 64}, - {"",}, {"",}, - {"underline", 82}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"small-caps", 69}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"ltr", 42}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"larger", 34}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"disc", 16}, - {"",}, {"",}, {"",}, - {"bolder", 7}, - {"baseline", 3}, - {"",}, {"",}, {"",}, - {"upper-roman", 84}, - {"",}, {"",}, {"",}, - {"pc", 56}, - {"",}, {"",}, - {"circle", 12}, - {"",}, {"",}, {"",}, {"",}, - {"scroll", 67}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"smaller", 70}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"lower-roman", 40}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, - {"lighter", 36}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"center", 11}, - {"",}, {"",}, {"",}, - {"sub", 74}, - {"",}, {"",}, {"",}, - {"arrow", 1}, - }; - - if (str != NULL) { - int len = PL_strlen(str); - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int hval = len; - - switch (hval) - { - default: - case 7: - hval += asso_values[MYLOWER(str[6])]; - case 6: - case 5: - case 4: - case 3: - hval += asso_values[MYLOWER(str[2])]; - case 2: - hval += asso_values[MYLOWER(str[1])]; - case 1: - hval += asso_values[MYLOWER(str[0])]; - break; - } - hval += asso_values[MYLOWER(str[len - 1])]; - if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) { - if (len == lengthtable[hval]) { - register const char *tag = wordlist[hval].tag; - - /* - ** While not at the end of the string, if they ever differ - ** they are not equal. We know "tag" is already lower case. - */ - while ((*tag != '\0')&&(*str != '\0')) { - if (*tag != (char) MYLOWER(*str)) { - return -1; - } - tag++; - str++; - } - - /* - ** One of the strings has ended, if they are both ended, then they - ** are equal, otherwise not. - */ - if ((*tag == '\0')&&(*str == '\0')) { - return wordlist[hval].id; - } - } - } - } - } - return -1; -} - -const nsCSSKeywords::NameTableEntry nsCSSKeywords::kNameTable[] = { - { "absolute", 0 }, - { "arrow", 1 }, - { "auto", 2 }, - { "baseline", 3 }, - { "blink", 4 }, - { "block", 5 }, - { "bold", 6 }, - { "bolder", 7 }, - { "both", 8 }, - { "bottom", 9 }, - { "capitalize", 10 }, - { "center", 11 }, - { "circle", 12 }, - { "cm", 13 }, - { "dashed", 14 }, - { "decimal", 15 }, - { "disc", 16 }, - { "dotted", 17 }, - { "double", 18 }, - { "em", 19 }, - { "ex", 20 }, - { "fixed", 21 }, - { "groove", 22 }, - { "hand", 23 }, - { "hidden", 24 }, - { "ibeam", 25 }, - { "in", 26 }, - { "inherit", 27 }, - { "inline", 28 }, - { "inset", 29 }, - { "inside", 30 }, - { "italic", 31 }, - { "justify", 32 }, - { "large", 33 }, - { "larger", 34 }, - { "left", 35 }, - { "lighter", 36 }, - { "line-through", 37 }, - { "list-item", 38 }, - { "lower-alpha", 39 }, - { "lower-roman", 40 }, - { "lowercase", 41 }, - { "ltr", 42 }, - { "medium", 43 }, - { "middle", 44 }, - { "mm", 45 }, - { "no-repeat", 46 }, - { "none", 47 }, - { "normal", 48 }, - { "noshade", 49 }, - { "nowrap", 50 }, - { "oblique", 51 }, - { "outset", 52 }, - { "outside", 53 }, - { "overline", 54 }, - { "paragraph", 55 }, - { "pc", 56 }, - { "pre", 57 }, - { "pt", 58 }, - { "px", 59 }, - { "relative", 60 }, - { "repeat", 61 }, - { "repeat-x", 62 }, - { "repeat-y", 63 }, - { "ridge", 64 }, - { "right", 65 }, - { "rtl", 66 }, - { "scroll", 67 }, - { "small", 68 }, - { "small-caps", 69 }, - { "smaller", 70 }, - { "solid", 71 }, - { "square", 72 }, - { "static", 73 }, - { "sub", 74 }, - { "super", 75 }, - { "text-bottom", 76 }, - { "text-top", 77 }, - { "thick", 78 }, - { "thin", 79 }, - { "top", 80 }, - { "transparent", 81 }, - { "underline", 82 }, - { "upper-alpha", 83 }, - { "upper-roman", 84 }, - { "uppercase", 85 }, - { "visible", 86 }, - { "x-large", 87 }, - { "x-small", 88 }, - { "xx-large", 89 }, - { "xx-small", 90 }, -}; diff --git a/mozilla/layout/style/nsCSSKeywords.h b/mozilla/layout/style/nsCSSKeywords.h deleted file mode 100644 index 1db3cbe5ee3..00000000000 --- a/mozilla/layout/style/nsCSSKeywords.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSKeywords_h___ -#define nsCSSKeywords_h___ - -#include "nslayout.h" -#include "nsCSSKeywordIDs.h" - -class NS_LAYOUT nsCSSKeywords { -public: - // Given a null terminated string of 7 bit characters, return the - // tag id (see nsHTMLTagIDs.h) for the tag or -1 if the tag is not - // known. The lookup function uses a perfect hash. - static PRInt32 LookupName(const char* str); - - struct NameTableEntry { - const char* name; - PRInt32 id; - }; - - // A table whose index is the tag id (from LookupName) - static const NameTableEntry kNameTable[]; -}; - -#endif /* nsCSSKeywords_h___ */ diff --git a/mozilla/layout/style/nsCSSParser.cpp b/mozilla/layout/style/nsCSSParser.cpp deleted file mode 100644 index cd57f884ebf..00000000000 --- a/mozilla/layout/style/nsCSSParser.cpp +++ /dev/null @@ -1,2209 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSParser.h" -#include "nsCSSProps.h" -#include "nsCSSKeywords.h" -#include "nsCSSScanner.h" -#include "nsICSSStyleRule.h" -#include "nsIUnicharInputStream.h" -#include "nsIStyleSet.h" -#include "nsICSSStyleSheet.h" -#include "nsICSSDeclaration.h" -#include "nsStyleConsts.h" -#include "nsIURL.h" -#include "nsString.h" -#include "nsIAtom.h" -#include "nsVoidArray.h" -#include "nsColor.h" - -static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID); -static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID); - -// XXX url's spec'd in a style sheet are relative to the style sheet -// (this includes things like background-image!). -// XXX cell-padding, spacing, etc.??? - -struct Selector { - nsString mTag; // weight 1 - nsString mID; // weight 100 - nsString mClass; // weight 10 - nsString mPseudo; // weight 10 (== class) - PRUint32 mMask; // which fields have values - - Selector(); - ~Selector(); - - PRInt32 Weight() const; -#ifdef NS_DEBUG - void Dump() const; -#endif -}; - -#define SELECTOR_TAG 0x1 -#define SELECTOR_ID 0x2 -#define SELECTOR_CLASS 0x4 -#define SELECTOR_PSEUDO 0x8 - -#define SELECTOR_WEIGHT_BASE 10 - -Selector::Selector() -{ - mMask = 0; -} - -Selector::~Selector() -{ -} - -PRInt32 Selector::Weight() const -{ - return (((0 != (SELECTOR_TAG & mMask)) ? 1 : 0) + - ((0 != (SELECTOR_ID & mMask)) ? (SELECTOR_WEIGHT_BASE * SELECTOR_WEIGHT_BASE) : 0) + - ((0 != ((SELECTOR_CLASS | SELECTOR_PSEUDO) & mMask)) ? SELECTOR_WEIGHT_BASE : 0)); -} - -#ifdef NS_DEBUG -void Selector::Dump() const -{ - PRBool needSpace = PR_FALSE; - if (mTag.Length() > 0) { - fputs(mTag, stdout); - needSpace = PR_TRUE; - } - if (mID.Length() > 0) { - if (needSpace) fputs(" ", stdout); - fputs("#", stdout); - fputs(mID, stdout); - needSpace = PR_TRUE; - } - if (mClass.Length() > 0) { - if (needSpace) fputs(" ", stdout); - fputs(".", stdout); - fputs(mClass, stdout); - needSpace = PR_TRUE; - } - if (mPseudo.Length() > 0) { - if (needSpace) fputs(" ", stdout); - fputs(":", stdout); - fputs(mPseudo, stdout); - needSpace = PR_TRUE; - } -} -#endif - -// e.g. "P B, H1 B { ... }" has a selector list with two elements, -// each of which has two selectors. -struct SelectorList { - SelectorList* mNext; - nsVoidArray mSelectors; - - SelectorList(); - - void Destroy(); - - void AddSelector(Selector* aSelector) { - mSelectors.AppendElement(aSelector); - } - -#ifdef NS_DEBUG - void Dump(); -#endif - -private: - ~SelectorList(); -}; - -SelectorList::SelectorList() -{ - mNext = nsnull; -} - -SelectorList::~SelectorList() -{ - PRInt32 n = mSelectors.Count(); - for (PRInt32 i = 0; i < n; i++) { - Selector* sel = (Selector*) mSelectors.ElementAt(i); - delete sel; - } -} - -void SelectorList::Destroy() -{ - SelectorList* list = this; - while (nsnull != list) { - SelectorList* next = list->mNext; - delete list; - list = next; - } -} - -#ifdef NS_DEBUG -void SelectorList::Dump() -{ - PRInt32 n = mSelectors.Count(); - for (PRInt32 i = 0; i < n; i++) { - Selector* sel = (Selector*) mSelectors.ElementAt(i); - sel->Dump(); - fputs(" ", stdout); - } - if (mNext) { - fputs(", ", stdout); - mNext->Dump(); - } -} -#endif - -//---------------------------------------------------------------------- - -// Your basic top-down recursive descent style parser -class CSSParserImpl : public nsICSSParser { -public: - CSSParserImpl(); - CSSParserImpl(nsICSSStyleSheet* aSheet); - ~CSSParserImpl(); - - NS_DECL_ISUPPORTS - - virtual PRUint32 GetInfoMask(); - - virtual nsresult SetStyleSheet(nsIStyleSheet* aSheet); - - virtual nsIStyleSheet* Parse(PRInt32* aErrorCode, - nsIUnicharInputStream* aInput, - nsIURL* aInputURL); - -protected: - PRBool GetToken(PRInt32* aErrorCode, PRBool aSkipWS); - void UngetToken(); - - PRBool ExpectSymbol(PRInt32* aErrorCode, char aSymbol, PRBool aSkipWS); - nsString* NextIdent(PRInt32* aErrorCode); - void SkipUntil(PRInt32* aErrorCode, PRUnichar aStopSymbol); - void SkipRuleSet(PRInt32* aErrorCode); - void SkipDeclaration(PRInt32* aErrorCode); - - PRBool ParseRuleSet(PRInt32* aErrorCode); - PRBool ParseAtRule(PRInt32* aErrorCode); - PRBool ParseImportRule(PRInt32* aErrorCode); - - PRBool ParseSelectorGroup(PRInt32* aErrorCode, SelectorList* aListHead); - PRBool ParseSelectorList(PRInt32* aErrorCode, SelectorList* aListHead); - PRBool ParseSelector(PRInt32* aErrorCode, Selector* aSelectorResult); - nsICSSDeclaration* ParseDeclarationBlock(PRInt32* aErrorCode); - PRBool ParseDeclaration(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseProperty(PRInt32* aErrorCode, const char* aName, - nsICSSDeclaration* aDeclaration); - PRBool ParseProperty(PRInt32* aErrorCode, const char* aName, - nsICSSDeclaration* aDeclaration, PRInt32 aID); - - // Property specific parsing routines - PRBool ParseBackground(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBackgroundFilter(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseForegroundFilter(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseBackgroundPosition(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseBorder(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBorderColor(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBorderSide(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aWhichSide); - PRBool ParseBorderStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseBorderWidth(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseClip(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseFont(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseFontFamily(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseFontWeight(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - PRBool ParseListStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseMargin(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParsePadding(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration); - PRBool ParseTextDecoration(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName); - - // Reused utility parsing routines - PRBool ParseBoxProperties(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[]); - PRInt32 ParseChoice(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aNumNames); - PRBool ParseColor(PRInt32* aErrorCode, nscolor* aColorResult); - PRBool ParseColorComponent(PRInt32* aErrorCode, PRUint8* aComponent, - char aStop); - PRBool ParseEnum(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName, PRInt32* aTable); - PRInt32 SearchKeywordTable(PRInt32 aID, PRInt32 aTable[]); - PRBool ParseVariant(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName, PRInt32 aVariant, - PRInt32* aTable); - PRBool TranslateLength(nsICSSDeclaration* aDeclaration, const char* aName, - float aNumber, const nsString& aDimension); - - void ProcessImport(const nsString& aURLSpec); - - // Current token. The value is valid after calling GetToken - nsCSSToken mToken; - - // After an UngetToken is done this flag is true. The next call to - // GetToken clears the flag. - PRBool mHavePushBack; - - nsCSSScanner* mScanner; - nsIURL* mURL; - nsICSSStyleSheet* mSheet; - - PRBool mInHead; -}; - -NS_HTML nsresult -NS_NewCSSParser(nsICSSParser** aInstancePtrResult) -{ - CSSParserImpl *it = new CSSParserImpl(); - - if (it == nsnull) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSParserIID, (void **) aInstancePtrResult); -} - -CSSParserImpl::CSSParserImpl() -{ - NS_INIT_REFCNT(); - mScanner = nsnull; - mSheet = nsnull; - mHavePushBack = PR_FALSE; -} - -CSSParserImpl::CSSParserImpl(nsICSSStyleSheet* aSheet) -{ - NS_INIT_REFCNT(); - mScanner = nsnull; - mSheet = aSheet; aSheet->AddRef(); - mHavePushBack = PR_FALSE; -} - -NS_IMPL_ISUPPORTS(CSSParserImpl,kICSSParserIID) - -CSSParserImpl::~CSSParserImpl() -{ - NS_IF_RELEASE(mSheet); -} - -PRUint32 CSSParserImpl::GetInfoMask() -{ - return NS_CSS_GETINFO_CSS1 | NS_CSS_GETINFO_CSSP; -} - -nsresult CSSParserImpl::SetStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null ptr"); - if (nsnull == aSheet) { - return NS_ERROR_NULL_POINTER; - } - - // Make sure the sheet supports the correct interface! - static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID); - nsICSSStyleSheet* cssSheet; - nsresult rv = aSheet->QueryInterface(kICSSStyleSheetIID, (void**)&cssSheet); - if (NS_OK != rv) { - return rv; - } - - // Switch to using the new sheet - NS_IF_RELEASE(mSheet); - mSheet = cssSheet; - - return NS_OK; -} - -nsIStyleSheet* CSSParserImpl::Parse(PRInt32* aErrorCode, - nsIUnicharInputStream* aInput, - nsIURL* aInputURL) -{ - if (nsnull == mSheet) { - NS_NewCSSStyleSheet(&mSheet, aInputURL); - } - - mScanner = new nsCSSScanner(); - mScanner->Init(aInput); - mURL = aInputURL; - if (nsnull != aInputURL) { - aInputURL->AddRef(); - } - mInHead = PR_TRUE; - nsCSSToken* tk = &mToken; - for (;;) { - // Get next non-whitespace token - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_AtKeyword == tk->mType) { - ParseAtRule(aErrorCode); - continue; - } else if (eCSSToken_Symbol == tk->mType) { - // Discard dangling semicolons. This is not part of the CSS1 - // forward compatible parsing spec, but it makes alot of sense. - if (';' == tk->mSymbol) { - continue; - } - } - mInHead = PR_FALSE; - UngetToken(); - ParseRuleSet(aErrorCode); - } - delete mScanner; - mScanner = nsnull; - NS_IF_RELEASE(mURL); - - nsIStyleSheet* rv = nsnull; - mSheet->QueryInterface(kIStyleSheetIID, (void**)&rv); - return rv; -} - -//---------------------------------------------------------------------- - -PRBool CSSParserImpl::GetToken(PRInt32* aErrorCode, PRBool aSkipWS) -{ - for (;;) { - if (!mHavePushBack) { - if (!mScanner->Next(aErrorCode, &mToken)) { - break; - } - } - mHavePushBack = PR_FALSE; - if (aSkipWS && (eCSSToken_WhiteSpace == mToken.mType)) { - continue; - } - return PR_TRUE; - } - return PR_FALSE; -} - -void CSSParserImpl::UngetToken() -{ - NS_PRECONDITION(mHavePushBack == PR_FALSE, "double pushback"); - mHavePushBack = PR_TRUE; -} - -PRBool CSSParserImpl::ExpectSymbol(PRInt32* aErrorCode, - char aSymbol, - PRBool aSkipWS) -{ - if (!GetToken(aErrorCode, aSkipWS)) { - return PR_FALSE; - } - nsCSSToken* tk = &mToken; - if ((eCSSToken_Symbol == tk->mType) && (aSymbol == tk->mSymbol)) { - return PR_TRUE; - } - UngetToken(); - return PR_FALSE; -} - -nsString* CSSParserImpl::NextIdent(PRInt32* aErrorCode) -{ - if (!GetToken(aErrorCode, PR_TRUE)) { - return nsnull; - } - if (eCSSToken_Ident != mToken.mType) { - UngetToken(); - return nsnull; - } - return &mToken.mIdent; -} - -// XXX @media type {, types } '{' rules '}' -// XXX @font-face -// XXX @page { :left | :right } '{' declarations '}' -PRBool CSSParserImpl::ParseAtRule(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - if (mInHead && tk->mIdent.EqualsIgnoreCase("import")) { - ParseImportRule(aErrorCode); - return PR_TRUE; - } - - // Skip over unsupported at rule - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if (symbol == ';') { - break; - } - if (symbol == '{') { - SkipUntil(aErrorCode, '}'); - break; - } else if (symbol == '(') { - SkipUntil(aErrorCode, ')'); - } else if (symbol == '[') { - SkipUntil(aErrorCode, ']'); - } - } - } - mInHead = PR_FALSE; - return PR_TRUE; -} - -// Parse a CSS1 import rule: "@import STRING | URL" -PRBool CSSParserImpl::ParseImportRule(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if ((eCSSToken_String == tk->mType) || (eCSSToken_URL == tk->mType)) { - if (ExpectSymbol(aErrorCode, ';', PR_TRUE)) { - ProcessImport(tk->mIdent); - return PR_TRUE; - } - if ((eCSSToken_Symbol != tk->mType) || (';' != tk->mSymbol)) { - SkipUntil(aErrorCode, ';'); - } - } - mInHead = PR_FALSE; - return PR_TRUE; -} - -void CSSParserImpl::ProcessImport(const nsString& aURLSpec) -{ - // XXX probably need a way to encode unicode junk for the part of - // the url that follows a "?" - char* cp = aURLSpec.ToNewCString(); - nsIURL* url; - nsresult rv = NS_NewURL(&url, mURL, cp); - delete cp; - if (NS_OK != rv) { - // import url is bad - // XXX log this somewhere for easier web page debugging - return; - } - - if (PR_FALSE == mSheet->ContainsStyleSheet(url)) { // don't allow circular references - - PRInt32 ec; - nsIInputStream* in = url->Open(&ec); - if (nsnull == in) { - // failure to make connection - // XXX log this somewhere for easier web page debugging - } - else { - - nsIUnicharInputStream* uin; - rv = NS_NewConverterStream(&uin, nsnull, in); - if (NS_OK != rv) { - // XXX no iso-latin-1 converter? out of memory? - NS_RELEASE(in); - } - else { - - NS_RELEASE(in); - - // Create a new parse to parse the import. - - if (NS_OK == rv) { - CSSParserImpl *parser = new CSSParserImpl(); - nsIStyleSheet* childSheet = parser->Parse(&ec, uin, url); - NS_RELEASE(parser); - if (nsnull != childSheet) { - nsICSSStyleSheet* cssChild = nsnull; - if (NS_OK == childSheet->QueryInterface(kICSSStyleSheetIID, (void**)&cssChild)) { - mSheet->AppendStyleSheet(cssChild); - NS_RELEASE(cssChild); - } - } - NS_RELEASE(childSheet); - } - NS_RELEASE(uin); - } - } - } - NS_RELEASE(url); -} - -void CSSParserImpl::SkipUntil(PRInt32* aErrorCode, PRUnichar aStopSymbol) -{ - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if (symbol == aStopSymbol) { - break; - } else if ('{' == symbol) { - SkipUntil(aErrorCode, '}'); - } else if ('[' == symbol) { - SkipUntil(aErrorCode, ']'); - } else if ('(' == symbol) { - SkipUntil(aErrorCode, ')'); - } - } - } -} - -void CSSParserImpl::SkipDeclaration(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if (';' == symbol) { - break; - } - if ('}' == symbol) { - UngetToken(); - break; - } - if ('{' == symbol) { - SkipUntil(aErrorCode, '}'); - } else if ('(' == symbol) { - SkipUntil(aErrorCode, ')'); - } else if ('[' == symbol) { - SkipUntil(aErrorCode, ']'); - } - } - } -} - -void CSSParserImpl::SkipRuleSet(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Symbol == tk->mType) { - PRUnichar symbol = tk->mSymbol; - if ('{' == symbol) { - SkipUntil(aErrorCode, '}'); - break; - } - if ('(' == symbol) { - SkipUntil(aErrorCode, ')'); - } else if ('[' == symbol) { - SkipUntil(aErrorCode, ']'); - } - } - } -} - -PRBool CSSParserImpl::ParseRuleSet(PRInt32* aErrorCode) -{ - nsCSSToken* tk = &mToken; - - // First get the list of selectors for the rule - SelectorList *slist = new SelectorList(); - if (!ParseSelectorList(aErrorCode, slist)) { - SkipRuleSet(aErrorCode); - slist->Destroy(); - return PR_FALSE; - } - - // Next parse the declaration block - nsICSSDeclaration* declaration = ParseDeclarationBlock(aErrorCode); - if (nsnull == declaration) { - // XXX skip something here - slist->Destroy(); - return PR_FALSE; - } - -#if 0 - slist->Dump(); - fputs("{\n", stdout); - declaration->List(); - fputs("}\n", stdout); -#endif - - // Translate the selector list and declaration block into style data - - // XXX PSL working here - - SelectorList* list = slist; - nsCSSSelector selector; - nsICSSStyleRule* rule; - - while (nsnull != list) { - PRInt32 selIndex = list->mSelectors.Count(); - - Selector* sel = (Selector*)list->mSelectors[--selIndex]; - selector.Set(sel->mTag, sel->mID, sel->mClass, sel->mPseudo); - PRInt32 weight = sel->Weight(); - - if (NS_OK == NS_NewCSSStyleRule(&rule, selector)) { - while (--selIndex >= 0) { - Selector* sel = (Selector*)list->mSelectors[selIndex]; - selector.Set(sel->mTag, sel->mID, sel->mClass, sel->mPseudo); - - rule->AddSelector(selector); - weight += sel->Weight(); - } - rule->SetDeclaration(declaration); - rule->SetWeight(weight); -// rule->List(); - mSheet->AppendStyleRule(rule); - NS_RELEASE(rule); - } - - list = list->mNext; - } - - // XXX PSL working here - - // Release temporary storage - slist->Destroy(); - NS_RELEASE(declaration); - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseSelectorList(PRInt32* aErrorCode, - SelectorList* aListHead) -{ - if (!ParseSelectorGroup(aErrorCode, aListHead)) { - // must have at least one selector group - return PR_FALSE; - } - - // After that there must either be a "," or a "{" - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Symbol != tk->mType) { - UngetToken(); - return PR_FALSE; - } - if (',' == tk->mSymbol) { - // Another selector group must follow - SelectorList* newList = new SelectorList(); - if (!ParseSelectorGroup(aErrorCode, newList)) { - newList->Destroy(); - return PR_FALSE; - } - // add new list to the end of the selector list - aListHead->mNext = newList; - aListHead = newList; - continue; - } else if ('{' == tk->mSymbol) { - UngetToken(); - break; - } else { - UngetToken(); - return PR_FALSE; - } - } - - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseSelectorGroup(PRInt32* aErrorCode, - SelectorList* aList) -{ - for (;;) { - Selector* sel = new Selector(); - if (!ParseSelector(aErrorCode, sel)) { - delete sel; - break; - } - aList->AddSelector(sel); - } - return (PRBool) (aList->mSelectors.Count() > 0); -} - -/** - * These are the 15 possible kinds of CSS1 style selectors: - *

      - *
    • Tag - *
    • Tag#Id - *
    • Tag#Id.Class - *
    • Tag#Id.Class:Pseudo - *
    • Tag#Id:Pseudo - *
    • Tag.Class - *
    • Tag.Class:Pseudo - *
    • Tag:Pseudo - *
    • #Id - *
    • #Id.Class - *
    • #Id.Class:Pseudo - *
    • #Id:Pseudo - *
    • .Class - *
    • .Class:Pseudo - *
    • :Pseudo - *
    - */ -PRBool CSSParserImpl::ParseSelector(PRInt32* aErrorCode, - Selector* aSelectorResult) -{ - PRUint32 mask = 0; - aSelectorResult->mTag.SetLength(0); - aSelectorResult->mClass.SetLength(0); - aSelectorResult->mID.SetLength(0); - aSelectorResult->mPseudo.SetLength(0); - - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Ident == tk->mType) { - // tag - mask |= SELECTOR_TAG; - aSelectorResult->mTag.Append(tk->mIdent); - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof is ok (here!) - return PR_TRUE; - } - } - if (eCSSToken_ID == tk->mType) { - // #id - mask |= SELECTOR_ID; - aSelectorResult->mID.Append(tk->mIdent); - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof is ok (here!) - return PR_TRUE; - } - } - if ((eCSSToken_Symbol == tk->mType) && ('.' == tk->mSymbol)) { - // .class - mask |= SELECTOR_CLASS; - if (!GetToken(aErrorCode, PR_FALSE)) { - return PR_FALSE; - } - if (eCSSToken_Ident != tk->mType) { - // malformed selector - UngetToken(); - return PR_FALSE; - } - aSelectorResult->mClass.Append(tk->mIdent); - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof is ok (here!) - return PR_TRUE; - } - } - if ((eCSSToken_Symbol == tk->mType) && (':' == tk->mSymbol)) { - // :pseudo - mask |= SELECTOR_PSEUDO; - if (!GetToken(aErrorCode, PR_FALSE)) { - // premature eof - return PR_FALSE; - } - if (eCSSToken_Ident != tk->mType) { - // malformed selector - UngetToken(); - return PR_FALSE; - } - aSelectorResult->mPseudo.Append(tk->mIdent); - tk = nsnull; - } - if (nsnull != tk) { - UngetToken(); - } - if (mask == 0) { - return PR_FALSE; - } - aSelectorResult->mMask = mask; - return PR_TRUE; -} - -nsICSSDeclaration* CSSParserImpl::ParseDeclarationBlock(PRInt32* aErrorCode) -{ - if (!ExpectSymbol(aErrorCode, '{', PR_TRUE)) { - return nsnull; - } - nsICSSDeclaration* declaration = nsnull; - if (NS_OK == NS_NewCSSDeclaration(&declaration)) { - for (;;) { - if (!ParseDeclaration(aErrorCode, declaration)) { - SkipDeclaration(aErrorCode); - if (ExpectSymbol(aErrorCode, '}', PR_TRUE)) { - break; - } - // Since the skipped declaration didn't end the block we parse - // the next declaration. - } - } - } - return declaration; -} - -PRBool CSSParserImpl::ParseColor(PRInt32* aErrorCode, nscolor* aColorResult) -{ - char cbuf[50]; - - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - - nsCSSToken* tk = &mToken; - switch (tk->mType) { - case eCSSToken_ID: - // #xxyyzz - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - if (NS_HexToRGB(cbuf, aColorResult)) { - return PR_TRUE; - } - break; - - case eCSSToken_Ident: - if (!tk->mIdent.EqualsIgnoreCase("rgb")) { - // named color (maybe!) - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - if (NS_ColorNameToRGB(cbuf, aColorResult)) { - return PR_TRUE; - } - } else { - // rgb ( component , component , component ) - PRUint8 r, g, b; - if (ExpectSymbol(aErrorCode, '(', PR_TRUE) && - ParseColorComponent(aErrorCode, &r, ',') && - ParseColorComponent(aErrorCode, &g, ',') && - ParseColorComponent(aErrorCode, &b, ')')) { - *aColorResult = NS_RGB(r,g,b); - return PR_TRUE; - } - } - break; - - default: - break; - } - - // It's not a color - UngetToken(); - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseColorComponent(PRInt32* aErrorCode, - PRUint8* aComponent, - char aStop) -{ - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - float value; - nsCSSToken* tk = &mToken; - switch (tk->mType) { - case eCSSToken_Number: - value = tk->mNumber; - break; - case eCSSToken_Percentage: - value = tk->mNumber * 255.0f; - break; - default: - UngetToken(); - return PR_FALSE; - } - if (ExpectSymbol(aErrorCode, aStop, PR_TRUE)) { - if (value < 0.0f) value = 0.0f; - if (value > 255.0f) value = 255.0f; - *aComponent = (PRUint8) value; - return PR_TRUE; - } - return PR_FALSE; -} - -//---------------------------------------------------------------------- - -PRBool CSSParserImpl::ParseDeclaration(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - // Get property name - nsCSSToken* tk = &mToken; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Ident == tk->mType) { - if (!ExpectSymbol(aErrorCode, ':', PR_TRUE)) { - return PR_FALSE; - } - break; - } - if ((eCSSToken_Symbol == tk->mType) && (';' == tk->mSymbol)) { - // dangling semicolons are skipped - continue; - } - - // Not a declaration... - UngetToken(); - return PR_FALSE; - } - - // Map property name to it's ID and then parse the property - char propertyName[100]; - tk->mIdent.ToCString(propertyName, sizeof(propertyName)); - if (!ParseProperty(aErrorCode, propertyName, aDeclaration)) { - return PR_FALSE; - } - - // Make sure valid property declaration is terminated with either a - // semicolon or a right-curly-brace. - if (!GetToken(aErrorCode, PR_TRUE)) { - // Premature eof is not ok - return PR_FALSE; - } - if (eCSSToken_Symbol == tk->mType) { - if (';' == tk->mSymbol) { - return PR_TRUE; - } - if ('}' == tk->mSymbol) { - UngetToken(); - return PR_TRUE; - } - } - return PR_FALSE; -} - -// Flags for ParseVariant method -#define VARIANT_KEYWORD 0x01 -#define VARIANT_LENGTH 0x02 -#define VARIANT_PERCENT 0x04 -#define VARIANT_COLOR 0x08 -#define VARIANT_URL 0x10 -#define VARIANT_NUMBER 0x20 -#define VARIANT_INTEGER 0x40 - -// Common combinations of variants -#define VARIANT_KL (VARIANT_KEYWORD | VARIANT_LENGTH) -#define VARIANT_KLP (VARIANT_KEYWORD | VARIANT_LENGTH | VARIANT_PERCENT) -#define VARIANT_KLPN (VARIANT_KLP | VARIANT_NUMBER) -#define VARIANT_KP (VARIANT_KEYWORD | VARIANT_PERCENT) -#define VARIANT_KI (VARIANT_KEYWORD | VARIANT_INTEGER) -#define VARIANT_LP (VARIANT_LENGTH | VARIANT_PERCENT) -#define VARIANT_CK (VARIANT_COLOR | VARIANT_KEYWORD) -#define VARIANT_C VARIANT_COLOR -#define VARIANT_UK (VARIANT_URL | VARIANT_KEYWORD) - -// Keyword id tables for variant/enum parsing -static PRInt32 kBackgroundAttachmentKTable[] = { - KEYWORD_FIXED, NS_STYLE_BG_ATTACHMENT_FIXED, - KEYWORD_SCROLL, NS_STYLE_BG_ATTACHMENT_SCROLL, - -1 -}; - -static PRInt32 kBackgroundColorKTable[] = { - KEYWORD_TRANSPARENT, NS_STYLE_BG_COLOR_TRANSPARENT, - -1 -}; - -static PRInt32 kBackgroundImageKTable[] = { - KEYWORD_NONE, NS_STYLE_BG_IMAGE_NONE, - -1 -}; - -static PRInt32 kBackgroundRepeatKTable[] = { - KEYWORD_NO_REPEAT, NS_STYLE_BG_REPEAT_OFF, - KEYWORD_REPEAT, NS_STYLE_BG_REPEAT_XY, - KEYWORD_REPEAT_X, NS_STYLE_BG_REPEAT_X, - KEYWORD_REPEAT_Y, NS_STYLE_BG_REPEAT_Y, - -1 -}; - -static PRInt32 kBorderStyleKTable[] = { - KEYWORD_NONE, NS_STYLE_BORDER_STYLE_NONE, - KEYWORD_DOTTED, NS_STYLE_BORDER_STYLE_DOTTED, - KEYWORD_DASHED, NS_STYLE_BORDER_STYLE_DASHED, - KEYWORD_SOLID, NS_STYLE_BORDER_STYLE_SOLID, - KEYWORD_DOUBLE, NS_STYLE_BORDER_STYLE_DOUBLE, - KEYWORD_GROOVE, NS_STYLE_BORDER_STYLE_GROOVE, - KEYWORD_RIDGE, NS_STYLE_BORDER_STYLE_RIDGE, - KEYWORD_INSET, NS_STYLE_BORDER_STYLE_INSET, - KEYWORD_OUTSET, NS_STYLE_BORDER_STYLE_OUTSET, - -1 -}; - -static PRInt32 kBorderWidthKTable[] = { - KEYWORD_THIN, NS_STYLE_BORDER_WIDTH_THIN, - KEYWORD_MEDIUM, NS_STYLE_BORDER_WIDTH_MEDIUM, - KEYWORD_THICK, NS_STYLE_BORDER_WIDTH_THICK, - -1 -}; - -static PRInt32 kClearKTable[] = { - KEYWORD_NONE, NS_STYLE_CLEAR_NONE, - KEYWORD_LEFT, NS_STYLE_CLEAR_LEFT, - KEYWORD_RIGHT, NS_STYLE_CLEAR_RIGHT, - KEYWORD_BOTH, NS_STYLE_CLEAR_LEFT_AND_RIGHT, - -1 -}; - -static PRInt32 kClipKTable[] = { - KEYWORD_AUTO, NS_STYLE_CLIP_AUTO, - -1 -}; - -static PRInt32 kCursorKTable[] = { - KEYWORD_INHERIT, NS_STYLE_CURSOR_INHERIT, - KEYWORD_IBEAM, NS_STYLE_CURSOR_IBEAM, - KEYWORD_ARROW, NS_STYLE_CURSOR_DEFAULT, - KEYWORD_HAND, NS_STYLE_CURSOR_HAND, - -1 -}; - -static PRInt32 kDirectionKTable[] = { - KEYWORD_LTR, NS_STYLE_DIRECTION_LTR, - KEYWORD_RTL, NS_STYLE_DIRECTION_RTL, - KEYWORD_INHERIT, NS_STYLE_DIRECTION_INHERIT, - -1 -}; - -static PRInt32 kDisplayKTable[] = { - KEYWORD_NONE, NS_STYLE_DISPLAY_NONE, - KEYWORD_BLOCK, NS_STYLE_DISPLAY_BLOCK, - KEYWORD_INLINE, NS_STYLE_DISPLAY_INLINE, - KEYWORD_LIST_ITEM, NS_STYLE_DISPLAY_LIST_ITEM, - -1 -}; - -static PRInt32 kFloatKTable[] = { - KEYWORD_NONE, NS_STYLE_FLOAT_NONE, - KEYWORD_LEFT, NS_STYLE_FLOAT_LEFT, - KEYWORD_RIGHT, NS_STYLE_FLOAT_RIGHT, - -1 -}; - -static PRInt32 kFontSizeKTable[] = { - KEYWORD_XX_SMALL, NS_STYLE_FONT_SIZE_XXSMALL, - KEYWORD_X_SMALL, NS_STYLE_FONT_SIZE_XSMALL, - KEYWORD_SMALL, NS_STYLE_FONT_SIZE_SMALL, - KEYWORD_MEDIUM, NS_STYLE_FONT_SIZE_MEDIUM, - KEYWORD_LARGE, NS_STYLE_FONT_SIZE_LARGE, - KEYWORD_X_LARGE, NS_STYLE_FONT_SIZE_XLARGE, - KEYWORD_XX_LARGE, NS_STYLE_FONT_SIZE_XXLARGE, - KEYWORD_LARGER, NS_STYLE_FONT_SIZE_LARGER, - KEYWORD_SMALLER, NS_STYLE_FONT_SIZE_SMALLER, - -1 -}; - -static PRInt32 kFontStyleKTable[] = { - KEYWORD_NORMAL, NS_STYLE_FONT_STYLE_NORMAL, - KEYWORD_ITALIC, NS_STYLE_FONT_STYLE_ITALIC, - KEYWORD_OBLIQUE, NS_STYLE_FONT_STYLE_OBLIQUE, - -1 -}; - -static PRInt32 kFontVariantKTable[] = { - KEYWORD_NORMAL, NS_STYLE_FONT_VARIANT_NORMAL, - KEYWORD_SMALL_CAPS, NS_STYLE_FONT_VARIANT_SMALL_CAPS, - -1 -}; - -static PRInt32 kLeftKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kHeightKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kLineHeightKTable[] = { - KEYWORD_NORMAL, NS_STYLE_LINE_HEIGHT_NORMAL, - -1 -}; - -static PRInt32 kListStyleImageKTable[] = { - KEYWORD_NONE, NS_STYLE_LIST_STYLE_IMAGE_NONE, - -1 -}; - -static PRInt32 kListStylePositionKTable[] = { - KEYWORD_INSIDE, NS_STYLE_LIST_STYLE_POSITION_INSIDE, - KEYWORD_OUTSIDE, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE, - -1 -}; - -static PRInt32 kListStyleKTable[] = { - KEYWORD_NONE, NS_STYLE_LIST_STYLE_NONE, - KEYWORD_DISC, NS_STYLE_LIST_STYLE_DISC, - KEYWORD_CIRCLE, NS_STYLE_LIST_STYLE_CIRCLE, - KEYWORD_SQUARE, NS_STYLE_LIST_STYLE_SQUARE, - KEYWORD_DECIMAL, NS_STYLE_LIST_STYLE_DECIMAL, - KEYWORD_LOWER_ROMAN, NS_STYLE_LIST_STYLE_LOWER_ROMAN, - KEYWORD_UPPER_ROMAN, NS_STYLE_LIST_STYLE_UPPER_ROMAN, - KEYWORD_LOWER_ALPHA, NS_STYLE_LIST_STYLE_LOWER_ALPHA, - KEYWORD_UPPER_ALPHA, NS_STYLE_LIST_STYLE_UPPER_ALPHA, - -1 -}; - -static PRInt32 kMarginSizeKTable[] = { - KEYWORD_AUTO, NS_STYLE_MARGIN_SIZE_AUTO, - -1 -}; - -static PRInt32 kSpacingKTable[] = { - KEYWORD_NORMAL, NS_STYLE_SPACING_NORMAL, - -1 -}; - -static PRInt32 kOverflowKTable[] = { - KEYWORD_VISIBLE, NS_STYLE_OVERFLOW_VISIBLE, - KEYWORD_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN, - KEYWORD_SCROLL, NS_STYLE_OVERFLOW_SCROLL, - KEYWORD_AUTO, NS_STYLE_OVERFLOW_AUTO, - -1 -}; - -static PRInt32 kPositionKTable[] = { - KEYWORD_STATIC, NS_STYLE_POSITION_STATIC, - KEYWORD_RELATIVE, NS_STYLE_POSITION_RELATIVE, - KEYWORD_ABSOLUTE, NS_STYLE_POSITION_ABSOLUTE, - -1 -}; - -static PRInt32 kTextAlignKTable[] = { - KEYWORD_LEFT, NS_STYLE_TEXT_ALIGN_LEFT, - KEYWORD_RIGHT, NS_STYLE_TEXT_ALIGN_RIGHT, - KEYWORD_CENTER, NS_STYLE_TEXT_ALIGN_CENTER, - KEYWORD_JUSTIFY, NS_STYLE_TEXT_ALIGN_JUSTIFY, - -1 -}; - -static PRInt32 kTextTransformKTable[] = { - KEYWORD_NONE, NS_STYLE_TEXT_TRANSFORM_NONE, - KEYWORD_CAPITALIZE, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE, - KEYWORD_LOWERCASE, NS_STYLE_TEXT_TRANSFORM_LOWERCASE, - KEYWORD_UPPERCASE, NS_STYLE_TEXT_TRANSFORM_UPPERCASE, - -1 -}; - -static PRInt32 kTopKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kVerticalAlignKTable[] = { - KEYWORD_BASELINE, NS_STYLE_VERTICAL_ALIGN_BASELINE, - KEYWORD_SUB, NS_STYLE_VERTICAL_ALIGN_SUB, - KEYWORD_SUPER, NS_STYLE_VERTICAL_ALIGN_SUPER, - KEYWORD_TOP, NS_STYLE_VERTICAL_ALIGN_TOP, - KEYWORD_TEXT_TOP, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP, - KEYWORD_MIDDLE, NS_STYLE_VERTICAL_ALIGN_MIDDLE, - KEYWORD_BOTTOM, NS_STYLE_VERTICAL_ALIGN_BOTTOM, - KEYWORD_TEXT_BOTTOM, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM, - -1 -}; - -static PRInt32 kVisibilityKTable[] = { - KEYWORD_INHERIT, NS_STYLE_VISIBILITY_INHERIT, - KEYWORD_VISIBLE, NS_STYLE_VISIBILITY_VISIBLE, - KEYWORD_HIDDEN, NS_STYLE_VISIBILITY_HIDDEN, - -1 -}; - -static PRInt32 kWhitespaceKTable[] = { - KEYWORD_NORMAL, NS_STYLE_WHITESPACE_NORMAL, - KEYWORD_PRE, NS_STYLE_WHITESPACE_PRE, - KEYWORD_NOWRAP, NS_STYLE_WHITESPACE_NOWRAP, - -1 -}; - -static PRInt32 kWidthKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static PRInt32 kZIndexKTable[] = { - KEYWORD_AUTO, NS_STYLE_POSITION_VALUE_AUTO, - -1 -}; - -static const char* kBorderTopNames[] = { - "border-top-width", - "border-top-style", - "border-top-color", -}; -static const char* kBorderRightNames[] = { - "border-right-width", - "border-right-style", - "border-right-color", -}; -static const char* kBorderBottomNames[] = { - "border-bottom-width", - "border-bottom-style", - "border-bottom-color", -}; -static const char* kBorderLeftNames[] = { - "border-left-width", - "border-left-style", - "border-left-color", -}; - -PRInt32 CSSParserImpl::SearchKeywordTable(PRInt32 aID, PRInt32 aTable[]) -{ - PRInt32 i = 0; - for (;;) { - if (aTable[i] < 0) { - break; - } - if (aID == aTable[i]) { - return i; - } - i += 2; - } - return -1; -} - -PRBool CSSParserImpl::ParseEnum(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName, PRInt32* aTable) -{ - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - return PR_FALSE; - } - char cbuf[50]; - ident->ToCString(cbuf, sizeof(cbuf)); - PRInt32 id = nsCSSKeywords::LookupName(cbuf); - if (id >= 0) { - PRInt32 ix = SearchKeywordTable(id, aTable); - if (ix >= 0) { - aDeclaration->AddValue(aName, nsCSSValue(aTable[ix+1], eCSSUnit_Enumerated)); - return PR_TRUE; - } - } - - // Put the unknown identifier back and return - UngetToken(); - return PR_FALSE; -} - -PRBool CSSParserImpl::TranslateLength(nsICSSDeclaration* aDeclaration, - const char* aName, - float aNumber, - const nsString& aDimension) -{ - nsCSSUnit units; - if (0 != aDimension.Length()) { - char cbuf[50]; - aDimension.ToCString(cbuf, sizeof(cbuf)); - PRInt32 id = nsCSSKeywords::LookupName(cbuf); - switch (id) { - case KEYWORD_EM: units = eCSSUnit_EM; break; - case KEYWORD_EX: units = eCSSUnit_XHeight; break; - case KEYWORD_PX: units = eCSSUnit_Pixel; break; - case KEYWORD_IN: units = eCSSUnit_Inch; break; - case KEYWORD_CM: units = eCSSUnit_Centimeter; break; - case KEYWORD_MM: units = eCSSUnit_Millimeter; break; - case KEYWORD_PT: units = eCSSUnit_Point; break; - case KEYWORD_PC: units = eCSSUnit_Pica; break; - default: - // unknown dimension - return PR_FALSE; - } - } else { - // Must be a zero number... - units = eCSSUnit_Point; - } - aDeclaration->AddValue(aName, nsCSSValue(aNumber, units)); - return PR_TRUE; -} - - -PRBool CSSParserImpl::ParseVariant(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName, - PRInt32 aVariants, PRInt32* aTable) -{ - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (((aVariants & VARIANT_KEYWORD) != 0) && - (eCSSToken_Ident == tk->mType)) { - char cbuf[50]; - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - PRInt32 sid = nsCSSKeywords::LookupName(cbuf); - if (sid >= 0) { - PRInt32 ix = SearchKeywordTable(sid, aTable); - if (ix >= 0) { - aDeclaration->AddValue(aName, nsCSSValue(aTable[ix+1], eCSSUnit_Enumerated)); - return PR_TRUE; - } - } - } - if (((aVariants & VARIANT_LENGTH) != 0) && tk->isDimension()) { - return TranslateLength(aDeclaration, aName, tk->mNumber, tk->mIdent); - } - if (((aVariants & VARIANT_PERCENT) != 0) && - (eCSSToken_Percentage == tk->mType)) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Percent)); - return PR_TRUE; - } - if (((aVariants & VARIANT_NUMBER) != 0) && - (eCSSToken_Number == tk->mType)) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mNumber, eCSSUnit_Number)); - return PR_TRUE; - } - if (((aVariants & VARIANT_INTEGER) != 0) && - (eCSSToken_Number == tk->mType) && tk->mIntegerValid) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mInteger, eCSSUnit_Absolute)); - return PR_TRUE; - } - if (((aVariants & VARIANT_URL) != 0) && - (eCSSToken_URL == tk->mType)) { - aDeclaration->AddValue(aName, nsCSSValue(tk->mIdent)); - return PR_TRUE; - } - if ((aVariants & VARIANT_COLOR) != 0) { - if ((eCSSToken_ID == tk->mType) || (eCSSToken_Ident == tk->mType)) { - // Put token back so that parse color can get it - UngetToken(); - nscolor rgba; - // XXX This loses the original input format (e.g. a name which - // should be preserved when editing) - if (ParseColor(aErrorCode, &rgba)) { - aDeclaration->AddValue(aName, nsCSSValue(rgba)); - return PR_TRUE; - } - return PR_FALSE; - } - } - UngetToken(); - return PR_FALSE; -} - -PRInt32 CSSParserImpl::ParseChoice(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aNumNames) -{ - PRInt32 found = 0; - for (int i = 0; i < aNumNames; i++) { - // Try each property parser in order - for (int j = 0; j < aNumNames; j++) { - PRInt32 bit = 1 << j; - if ((found & bit) == 0) { - PRInt32 id = nsCSSProps::LookupName(aNames[j]); - if (ParseProperty(aErrorCode, aNames[j], aDeclaration, id)) { - found |= bit; - } - } - } - } - return found; -} - -/** - * Parse a "box" property. Box properties have 1 to 4 values. When less - * than 4 values are provided a standard mapping is used to replicate - * existing values. Note that the replication requires renaming the - * values. - */ -PRBool CSSParserImpl::ParseBoxProperties(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aNames[]) -{ - // Get up to four values for the property - PRInt32 count = 0; - for (int i = 0; i < 4; i++) { - PRInt32 id = nsCSSProps::LookupName(aNames[i]); - if (!ParseProperty(aErrorCode, aNames[i], aDeclaration, id)) { - break; - } - count++; - } - if (count == 0) { - return PR_FALSE; - } - - // Provide missing values by replicating some of the values found - nsCSSValue value; - switch (count) { - case 1: // Make right == top - aDeclaration->GetValue(aNames[0], value); - aDeclaration->AddValue(aNames[1], value); - case 2: // Make bottom == top - aDeclaration->GetValue(aNames[0], value); - aDeclaration->AddValue(aNames[2], value); - case 3: // Make left == right - aDeclaration->GetValue(aNames[1], value); - aDeclaration->AddValue(aNames[3], value); - } - - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseProperty(PRInt32* aErrorCode, - const char* aName, - nsICSSDeclaration* aDeclaration) -{ - PRInt32 id = nsCSSProps::LookupName(aName); - if (id < 0) { - return PR_FALSE; - } - - // Strip out properties we use internally. These properties are used - // by compound property parsing routines (e.g. "background-position"). - switch (id) { - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - case PROP_CLIP_RIGHT: - case PROP_CLIP_TOP: - // The user can't use these - return PR_FALSE; - } - - return ParseProperty(aErrorCode, aName, aDeclaration, id); -} - -PRBool CSSParserImpl::ParseProperty(PRInt32* aErrorCode, - const char* aName, - nsICSSDeclaration* aDeclaration, - PRInt32 aID) -{ - switch (aID) { - case PROP_BACKGROUND: - return ParseBackground(aErrorCode, aDeclaration); - case PROP_BACKGROUND_ATTACHMENT: - return ParseEnum(aErrorCode, aDeclaration, aName, kBackgroundAttachmentKTable); - case PROP_BACKGROUND_COLOR: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_CK, - kBackgroundColorKTable); - case PROP_BACKGROUND_FILTER: - return ParseBackgroundFilter(aErrorCode, aDeclaration, aName); - case PROP_BACKGROUND_IMAGE: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_UK, - kBackgroundImageKTable); - case PROP_BACKGROUND_POSITION: - return ParseBackgroundPosition(aErrorCode, aDeclaration, aName); - case PROP_BACKGROUND_REPEAT: - return ParseEnum(aErrorCode, aDeclaration, aName, kBackgroundRepeatKTable); - case PROP_BORDER: - return ParseBorder(aErrorCode, aDeclaration); - case PROP_BORDER_COLOR: - return ParseBorderColor(aErrorCode, aDeclaration); - case PROP_BORDER_STYLE: - return ParseBorderStyle(aErrorCode, aDeclaration); - case PROP_BORDER_BOTTOM: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderBottomNames, 0); - case PROP_BORDER_LEFT: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderLeftNames, 1); - case PROP_BORDER_RIGHT: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderRightNames, 2); - case PROP_BORDER_TOP: - return ParseBorderSide(aErrorCode, aDeclaration, kBorderTopNames, 3); - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_TOP_COLOR: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_C, nsnull); - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_TOP_STYLE: - return ParseEnum(aErrorCode, aDeclaration, aName, kBorderStyleKTable); - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_TOP_WIDTH: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KL, - kBorderWidthKTable); - case PROP_BORDER_WIDTH: - return ParseBorderWidth(aErrorCode, aDeclaration); - case PROP_CLEAR: - return ParseEnum(aErrorCode, aDeclaration, aName, kClearKTable); - case PROP_CLIP: - return ParseClip(aErrorCode, aDeclaration); - case PROP_COLOR: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_COLOR, nsnull); - case PROP_CURSOR: - return ParseEnum(aErrorCode, aDeclaration, aName, kCursorKTable); - case PROP_DIRECTION: - return ParseEnum(aErrorCode, aDeclaration, aName, kDirectionKTable); - case PROP_DISPLAY: - return ParseEnum(aErrorCode, aDeclaration, aName, kDisplayKTable); - case PROP_FILTER: - return ParseForegroundFilter(aErrorCode, aDeclaration, aName); - case PROP_FLOAT: - return ParseEnum(aErrorCode, aDeclaration, aName, kFloatKTable); - case PROP_FONT: - return ParseFont(aErrorCode, aDeclaration, aName); - case PROP_FONT_FAMILY: - return ParseFontFamily(aErrorCode, aDeclaration, aName); - case PROP_FONT_SIZE: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, - kFontSizeKTable); - case PROP_FONT_STYLE: - return ParseEnum(aErrorCode, aDeclaration, aName, kFontStyleKTable); - case PROP_FONT_VARIANT: - return ParseEnum(aErrorCode, aDeclaration, aName, kFontVariantKTable); - case PROP_FONT_WEIGHT: - return ParseFontWeight(aErrorCode, aDeclaration, aName); - case PROP_HEIGHT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kHeightKTable); - case PROP_LEFT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kLeftKTable); - case PROP_LINE_HEIGHT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLPN, - kLineHeightKTable); - case PROP_LIST_STYLE: - return ParseListStyle(aErrorCode, aDeclaration); - case PROP_LIST_STYLE_IMAGE: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_UK, - kListStyleImageKTable); - case PROP_LIST_STYLE_POSITION: - return ParseEnum(aErrorCode, aDeclaration, aName, kListStylePositionKTable); - case PROP_LIST_STYLE_TYPE: - return ParseEnum(aErrorCode, aDeclaration, aName, kListStyleKTable); - case PROP_MARGIN: - return ParseMargin(aErrorCode, aDeclaration); - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_TOP: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, - kMarginSizeKTable); - case PROP_PADDING: - return ParsePadding(aErrorCode, aDeclaration); - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - case PROP_PADDING_RIGHT: - case PROP_PADDING_TOP: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_LP, nsnull); - case PROP_OVERFLOW: - return ParseEnum(aErrorCode, aDeclaration, aName, kOverflowKTable); - case PROP_POSITION: - return ParseEnum(aErrorCode, aDeclaration, aName, kPositionKTable); - case PROP_TEXT_ALIGN: - return ParseEnum(aErrorCode, aDeclaration, aName, kTextAlignKTable); - case PROP_TEXT_DECORATION: - return ParseTextDecoration(aErrorCode, aDeclaration, aName); - case PROP_TEXT_INDENT: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_LP, nsnull); - case PROP_TEXT_TRANSFORM: - return ParseEnum(aErrorCode, aDeclaration, aName, kTextTransformKTable); - case PROP_TOP: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kTopKTable); - case PROP_VERTICAL_ALIGN: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KP, - kVerticalAlignKTable); - case PROP_VISIBILITY: - return ParseEnum(aErrorCode, aDeclaration, aName, kVisibilityKTable); - case PROP_WHITE_SPACE: - return ParseEnum(aErrorCode, aDeclaration, aName, kWhitespaceKTable); - case PROP_WIDTH: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KLP, kWidthKTable); - case PROP_LETTER_SPACING: - case PROP_WORD_SPACING: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KL, kSpacingKTable); - case PROP_Z_INDEX: - return ParseVariant(aErrorCode, aDeclaration, aName, VARIANT_KI, kZIndexKTable); - } - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseBackground(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBackgroundNames[] = { - "background-color", - "background-image", - "background-repeat", - "background-attachment", - "background-position", - "background-filter", - }; - - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, kBackgroundNames, 6); - if (0 == found) { - return PR_FALSE; - } - - // Provide missing values - if ((found & 1) == 0) { - aDeclaration->AddValue(kBackgroundNames[0], - nsCSSValue(NS_STYLE_BG_COLOR_TRANSPARENT, - eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - aDeclaration->AddValue(kBackgroundNames[1], - nsCSSValue(NS_STYLE_BG_IMAGE_NONE, - eCSSUnit_Enumerated)); - } - if ((found & 4) == 0) { - aDeclaration->AddValue(kBackgroundNames[2], - nsCSSValue(NS_STYLE_BG_REPEAT_XY, - eCSSUnit_Enumerated)); - } - if ((found & 8) == 0) { - aDeclaration->AddValue(kBackgroundNames[3], - nsCSSValue(NS_STYLE_BG_ATTACHMENT_SCROLL, - eCSSUnit_Enumerated)); - } - if ((found & 16) == 0) { - aDeclaration->AddValue("background-x-position", nsCSSValue(0.0f, eCSSUnit_Percent)); - aDeclaration->AddValue("background-y-position", nsCSSValue(0.0f, eCSSUnit_Percent)); - } - - // XXX Note: no default for filter (yet) - return PR_TRUE; -} - -// Bits used in determining which background position info we have -#define BG_CENTER 0 -#define BG_TOP 1 -#define BG_BOTTOM 2 -#define BG_LEFT 4 -#define BG_RIGHT 8 -#define BG_CENTER1 16 -#define BG_CENTER2 32 - -PRBool CSSParserImpl::ParseBackgroundPosition(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static PRInt32 kBackgroundPositionNames[] = { - PROP_BACKGROUND_X_POSITION, - PROP_BACKGROUND_Y_POSITION, - }; - - // Note: Don't change this table unless you update - // parseBackgroundPosition! - - static PRInt32 kBackgroundXYPositionKTable[] = { - KEYWORD_CENTER, BG_CENTER, - KEYWORD_TOP, BG_TOP, - KEYWORD_BOTTOM, BG_BOTTOM, - KEYWORD_LEFT, BG_LEFT, - KEYWORD_RIGHT, BG_RIGHT, - -1, - }; - - const char* bxp = "background-x-position"; - const char* byp = "background-y-position"; - - // First try a number or a length value - if (ParseVariant(aErrorCode, aDeclaration, bxp, VARIANT_LP, nsnull)) { - // We have one number/length. Get the optional second number/length. - if (ParseVariant(aErrorCode, aDeclaration, byp, VARIANT_LP, nsnull)) { - // We have two numbers - return PR_TRUE; - } - - // We have one number which is the x position. Create an value for - // the vertical position which is of value 50% - aDeclaration->AddValue(byp, nsCSSValue(0.5f, eCSSUnit_Percent)); - // XXX shouldn't this be CENTER enum instead? - return PR_TRUE; - } - - // Now try keywords. We do this manually to allow for the first - // appearance of "center" to apply to the either the x or y - // position (it's ambiguous so we have to disambiguate). Each - // allowed keyword value is assigned it's own bit. We don't allow - // any duplicate keywords other than center. We try to get two - // keywords but it's okay if there is only one. - PRInt32 mask = 0; - PRInt32 centerBit = BG_CENTER1; - for (PRInt32 i = 0; i < 2; i++) { - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - break; - } - char cbuf[50]; - ident->ToCString(cbuf, sizeof(cbuf)); - PRInt32 ix = SearchKeywordTable(nsCSSKeywords::LookupName(cbuf), - kBackgroundXYPositionKTable); - if (ix >= 0) { - PRInt32 bit = kBackgroundXYPositionKTable[ix + 1]; - if (bit == 0) { - // Special hack for center bits: We can have two of them - mask |= centerBit; - centerBit <<= 1; - continue; - } else if ((mask & bit) != 0) { - // no duplicate values allowed (other than center) - return PR_FALSE; - } - mask |= bit; - } else { - UngetToken(); - break; - } - } - - // Check for bad input. Bad input consists of no matching keywords, - // or pairs of x keywords or pairs of y keywords. - if ((mask == 0) || (mask == (BG_TOP | BG_BOTTOM)) || - (mask == (BG_LEFT | BG_RIGHT))) { - return PR_FALSE; - } - - // Map good input - int xValue = 50; - if ((mask & (BG_LEFT | BG_RIGHT)) != 0) { - // We have an x value - xValue = ((mask & BG_LEFT) != 0) ? 0 : 100; - } - int yValue = 50; - if ((mask & (BG_TOP | BG_BOTTOM)) != 0) { - // We have a y value - yValue = ((mask & BG_TOP) != 0) ? 0 : 100; - } - - // Create style values - aDeclaration->AddValue(bxp, nsCSSValue(xValue, eCSSUnit_Enumerated)); - aDeclaration->AddValue(byp, nsCSSValue(yValue, eCSSUnit_Enumerated)); - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseBackgroundFilter(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - // XXX not yet supported - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseForegroundFilter(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - // XXX not yet supported - return PR_FALSE; -} - -// These must be in alphabetical order for aWhich based indexing to work -static const char* kBorderStyleNames[] = { - "border-bottom-style", - "border-left-style", - "border-right-style", - "border-top-style", -}; -static const char* kBorderWidthNames[] = { - "border-bottom-width", - "border-left-width", - "border-right-width", - "border-top-width", -}; - - -PRBool CSSParserImpl::ParseBorder(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBorderNames[] = { - "border-width", - "border-style", - "border-color" - }; - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, kBorderNames, 3); - if (0 == found) { - return PR_FALSE; - } - if (0 == (found & 1)) { - // provide missing border width's - for (int i = 0; i < 4; i++) { - aDeclaration->AddValue(kBorderWidthNames[i], - nsCSSValue(NS_STYLE_BORDER_WIDTH_MEDIUM, - eCSSUnit_Enumerated)); - } - } - if (0 == (found & 2)) { - // provide missing border style's - for (int i = 0; i < 4; i++) { - aDeclaration->AddValue(kBorderStyleNames[i], - nsCSSValue(NS_STYLE_BORDER_STYLE_NONE, - eCSSUnit_Enumerated)); - } - } - - // Do NOT provide a missing color value as the default is to be - // the color of the element itself which must be determined later. - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseBorderColor(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxBorderColorNames[] = { - "border-top-color", - "border-right-color", - "border-bottom-color", - "border-left-color", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxBorderColorNames); -} - -PRBool CSSParserImpl::ParseBorderSide(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aNames[], PRInt32 aWhich) -{ - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, aNames, 3); - if (found == 0) return PR_FALSE; - if ((found & 1) == 0) { - // Provide default border-width - aDeclaration->AddValue(kBorderWidthNames[aWhich], - nsCSSValue(NS_STYLE_BORDER_WIDTH_MEDIUM, eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - // Provide default border-style - aDeclaration->AddValue(kBorderStyleNames[aWhich], - nsCSSValue(NS_STYLE_BORDER_STYLE_NONE, eCSSUnit_Enumerated)); - } - - // Do NOT provide a missing color value as the default is to be - // the color of the element itself which must be determined later. - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseBorderStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - // in top, right, bottom, left order - static const char* kBoxBorderStyleNames[] = { - "border-top-style", - "border-right-style", - "border-bottom-style", - "border-left-style", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxBorderStyleNames); -} - -PRBool CSSParserImpl::ParseBorderWidth(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxBorderWidthNames[] = { - "border-top-width", - "border-right-width", - "border-bottom-width", - "border-left-width", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxBorderWidthNames); -} - -PRBool CSSParserImpl::ParseClip(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kClipNames[] = { - "clip-top", - "clip-right", - "clip-bottom", - "clip-left", - }; - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - return PR_FALSE; - } - if (ident->EqualsIgnoreCase("auto")) { - for (int i = 0; i < 4; i++) { - aDeclaration->AddValue(kClipNames[i], - nsCSSValue(NS_STYLE_CLIP_AUTO, eCSSUnit_Enumerated)); - } - return PR_TRUE; - } else if (ident->EqualsIgnoreCase("rect")) { - if (!ExpectSymbol(aErrorCode, '(', PR_TRUE)) { - return PR_FALSE; - } - for (int i = 0; i < 4; i++) { - if (!ParseVariant(aErrorCode, aDeclaration, kClipNames[i], VARIANT_KL, - kClipKTable)) { - return PR_FALSE; - } - if (3 != i) { - // skip optional commas between elements - ExpectSymbol(aErrorCode, ',', PR_TRUE); - } - } - if (!ExpectSymbol(aErrorCode, ')', PR_TRUE)) { - return PR_FALSE; - } - return PR_TRUE; - } else { - UngetToken(); - } - return PR_FALSE; -} - -PRBool CSSParserImpl::ParseFont(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static const char* fontNames[] = { - "font-style", - "font-variant", - "font-weight", - }; - - // Get optional font-style, font-variant and font-weight (in any order) - PRInt32 found = ParseChoice(aErrorCode, aDeclaration, fontNames, 3); - if ((found & 1) == 0) { - // Provide default font-style - aDeclaration->AddValue(fontNames[0], - nsCSSValue(NS_STYLE_FONT_STYLE_NORMAL, eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - // Provide default font-variant - aDeclaration->AddValue(fontNames[1], - nsCSSValue(NS_STYLE_FONT_VARIANT_NORMAL, eCSSUnit_Enumerated)); - } - if ((found & 4) == 0) { - // Provide default font-weight - aDeclaration->AddValue(fontNames[2], - nsCSSValue(NS_STYLE_FONT_WEIGHT_NORMAL, eCSSUnit_Enumerated)); - } - - // Get mandatory font-size - if (!ParseVariant(aErrorCode, aDeclaration, "font-size", - VARIANT_KLP, kFontSizeKTable)) { - return PR_FALSE; - } - - // Get optional "/" line-height - if (ExpectSymbol(aErrorCode, '/', PR_TRUE)) { - if (!ParseVariant(aErrorCode, aDeclaration, "line-height", - VARIANT_KLPN, kLineHeightKTable)) { - return PR_FALSE; - } - } - - // Get final mandatory font-family - return ParseFontFamily(aErrorCode, aDeclaration, "font-family"); -} - -PRBool CSSParserImpl::ParseFontFamily(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName) -{ - nsCSSToken* tk = &mToken; - nsAutoString family; - PRBool firstOne = PR_TRUE; - for (;;) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Ident == tk->mType) { - if (!firstOne) { - family.Append(PRUnichar(',')); - } - family.Append(PRUnichar('"')); - family.Append(tk->mIdent); - for (;;) { - if (!GetToken(aErrorCode, PR_FALSE)) { - break; - } - if (eCSSToken_Ident == tk->mType) { - family.Append(tk->mIdent); - } else if (eCSSToken_WhiteSpace == tk->mType) { - // Lookahead one token and drop whitespace if we ending the - // font name. - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_Ident != tk->mType) { - UngetToken(); - break; - } - UngetToken(); - family.Append(PRUnichar(' ')); - } else { - UngetToken(); - break; - } - } - family.Append(PRUnichar('"')); - firstOne = PR_FALSE; - } else if (eCSSToken_String == tk->mType) { - if (!firstOne) { - family.Append(PRUnichar(',')); - } - family.Append(PRUnichar('"')); - family.Append(tk->mIdent); - family.Append(PRUnichar('"')); - firstOne = PR_FALSE; - } else if (eCSSToken_Symbol == tk->mType) { - if (',' != tk->mSymbol) { - UngetToken(); - break; - } - } else { - UngetToken(); - break; - } - } - if (family.Length() == 0) { - return PR_FALSE; - } - aDeclaration->AddValue(aName, nsCSSValue(family)); - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseFontWeight(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static PRInt32 kFontWeightKTable[] = { - KEYWORD_NORMAL, NS_STYLE_FONT_WEIGHT_NORMAL, - KEYWORD_BOLD, NS_STYLE_FONT_WEIGHT_BOLD, - KEYWORD_BOLDER, NS_STYLE_FONT_WEIGHT_BOLDER, - KEYWORD_LIGHTER, NS_STYLE_FONT_WEIGHT_LIGHTER, - -1, - }; - nsCSSToken* tk = &mToken; - if (!GetToken(aErrorCode, PR_TRUE)) { - return PR_FALSE; - } - if (eCSSToken_Ident == tk->mType) { - char cbuf[50]; - tk->mIdent.ToCString(cbuf, sizeof(cbuf)); - PRInt32 kid = nsCSSKeywords::LookupName(cbuf); - PRInt32 ix = SearchKeywordTable(kid, kFontWeightKTable); - if (ix < 0) { - UngetToken(); - return PR_FALSE; - } - aDeclaration->AddValue(aName, nsCSSValue(kFontWeightKTable[ix+1], eCSSUnit_Enumerated)); - } else if (eCSSToken_Number == tk->mType) { - PRInt32 v = (PRInt32) tk->mNumber; - if (v < 100) v = 100; - else if (v > 900) v = 900; - v = v - (v % 100); - aDeclaration->AddValue(aName, nsCSSValue(v, eCSSUnit_Absolute)); - } else { - UngetToken(); - return PR_FALSE; - } - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseListStyle(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - const char* lst = "list-style-type"; - const char* lsp = "list-style-position"; - const char* lsi = "list-style-image"; - int found = 0; - for (int i = 0; i < 3; i++) { - if (((found & 1) == 0) && - ParseEnum(aErrorCode, aDeclaration, lst, kListStyleKTable)) { - found |= 1; - continue; - } - if (((found & 2) == 0) && - ParseEnum(aErrorCode, aDeclaration, lsp, kListStylePositionKTable)) { - found |= 2; - continue; - } - if ((found & 4) == 0) { - if (!GetToken(aErrorCode, PR_TRUE)) { - break; - } - if (eCSSToken_URL == mToken.mType) { - aDeclaration->AddValue(lsi, nsCSSValue(mToken.mIdent)); - found |= 4; - continue; - } else { - if (eCSSToken_Symbol == mToken.mType) { - PRUnichar symbol = mToken.mSymbol; - if ((';' == symbol) || ('}' == symbol)) { - UngetToken(); - break; - } - } - - // We got something strange. That's an error. - UngetToken(); - return PR_FALSE; - } - } - } - if (found == 0) { - return PR_FALSE; - } - - // Provide default values - if ((found & 1) == 0) { - aDeclaration->AddValue(lst, nsCSSValue(NS_STYLE_LIST_STYLE_DISC, eCSSUnit_Enumerated)); - } - if ((found & 2) == 0) { - aDeclaration->AddValue(lsp, nsCSSValue(NS_STYLE_LIST_STYLE_POSITION_OUTSIDE, eCSSUnit_Enumerated)); - } - if ((found & 4) == 0) { - aDeclaration->AddValue(lsi, nsCSSValue(NS_STYLE_LIST_STYLE_IMAGE_NONE, eCSSUnit_Enumerated)); - } - return PR_TRUE; -} - -PRBool CSSParserImpl::ParseMargin(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxMarginSideNames[] = { - "margin-top", - "margin-right", - "margin-bottom", - "margin-left", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxMarginSideNames); -} - -PRBool CSSParserImpl::ParsePadding(PRInt32* aErrorCode, nsICSSDeclaration* aDeclaration) -{ - static const char* kBoxPaddingSideNames[] = { - "padding-top", - "padding-right", - "padding-bottom", - "padding-left", - }; - return ParseBoxProperties(aErrorCode, aDeclaration, kBoxPaddingSideNames); -} - -PRBool CSSParserImpl::ParseTextDecoration(PRInt32* aErrorCode, - nsICSSDeclaration* aDeclaration, - const char* aName) -{ - static PRInt32 kTextDecorationNoneKTable[] = { - KEYWORD_NONE, NS_STYLE_TEXT_DECORATION_NONE, - -1 - }; - static PRInt32 kTextDecorationKTable[] = { - KEYWORD_UNDERLINE, NS_STYLE_TEXT_DECORATION_UNDERLINE, - KEYWORD_OVERLINE, NS_STYLE_TEXT_DECORATION_OVERLINE, - KEYWORD_LINE_THROUGH, NS_STYLE_TEXT_DECORATION_LINE_THROUGH, - KEYWORD_BLINK, NS_STYLE_TEXT_DECORATION_BLINK, - -1, - }; - - if (ParseEnum(aErrorCode, aDeclaration, aName, kTextDecorationNoneKTable)) { - return PR_TRUE; - } - - PRInt32 decoration = 0; - for (int i = 0; i < 4; i++) { - nsString* ident = NextIdent(aErrorCode); - if (nsnull == ident) { - break; - } - char cbuf[50]; - ident->ToCString(cbuf, sizeof(cbuf)); - PRInt32 id = nsCSSKeywords::LookupName(cbuf); - PRInt32 ix = SearchKeywordTable(id, kTextDecorationKTable); - if (ix < 0) { - UngetToken(); - break; - } - decoration |= kTextDecorationKTable[ix+1]; - } - if (0 == decoration) { - return PR_FALSE; - } - aDeclaration->AddValue(aName, nsCSSValue(decoration, eCSSUnit_Absolute)); - return PR_TRUE; -} diff --git a/mozilla/layout/style/nsCSSProps.cpp b/mozilla/layout/style/nsCSSProps.cpp deleted file mode 100644 index 1363ffd53de..00000000000 --- a/mozilla/layout/style/nsCSSProps.cpp +++ /dev/null @@ -1,360 +0,0 @@ - -/* -** This is a generated file, do not edit it. This file is created by -** genhash.pl -*/ - -#include "plstr.h" -#include "nsCSSProps.h" -#define TOTAL_KEYWORDS 79 -#define MIN_WORD_LENGTH 3 -#define MAX_WORD_LENGTH 21 -#define MIN_HASH_VALUE 6 -#define MAX_HASH_VALUE 238 -/* maximum key range = 233, duplicates = 0 */ - - -struct StaticNameTable { - char* tag; - PRInt32 id; -}; - -static const unsigned char kLowerLookup[256] = { - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64, - 97,98,99,100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -#define MYLOWER(x) kLowerLookup[((x) & 0x7f)] - -/** - * Map a name to an ID or -1 - */ -PRInt32 nsCSSProps::LookupName(const char* str) -{ - static unsigned char asso_values[] = - { - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 35, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 45, 0, 85, - 80, 25, 5, 0, 80, 0, 239, 239, 25, 90, - 0, 0, 5, 239, 0, 65, 40, 35, 0, 80, - 10, 15, 5, 239, 239, 239, 239, 239, - }; - static unsigned char lengthtable[] = - { - 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 6, 12, 8, - 0, 10, 0, 0, 0, 19, 0, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, - 0, 0, 19, 0, 0, 0, 3, 4, 0, 11, 17, 0, 0, 0, - 0, 7, 18, 0, 0, 0, 12, 0, 14, 0, 11, 17, 0, 19, - 0, 0, 0, 0, 0, 5, 21, 17, 0, 0, 0, 21, 7, 18, - 0, 0, 16, 0, 0, 0, 5, 0, 12, 0, 4, 0, 0, 12, - 0, 19, 0, 16, 17, 13, 9, 10, 16, 0, 0, 0, 0, 0, - 0, 8, 19, 5, 11, 0, 0, 4, 10, 0, 0, 0, 14, 10, - 6, 0, 0, 9, 0, 16, 17, 0, 0, 10, 11, 0, 18, 0, - 0, 6, 12, 0, 0, 0, 16, 7, 0, 0, 10, 21, 0, 0, - 0, 0, 11, 12, 0, 0, 10, 0, 0, 8, 0, 5, 0, 0, - 0, 0, 15, 0, 12, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 12, 13, 9, 0, 11, 0, 0, 0, 0, 6, 0, 0, 14, 0, - 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 12, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, - 13, - }; - static struct StaticNameTable wordlist[] = - { - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"border", 9}, - {"",}, {"",}, {"",}, {"",}, - {"filter", 40}, - {"border-color", 14}, - {"position", 67}, - {"",}, - {"border-top", 24}, - {"",}, {"",}, {"",}, - {"border-bottom-color", 11}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"visibility", 74}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, - {"font-family", 43}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"border-bottom-style", 12}, - {"",}, {"",}, {"",}, - {"top", 72}, - {"font", 42}, - {"",}, - {"border-left", 15}, - {"border-left-color", 16}, - {"",}, {"",}, {"",}, {"",}, - {"padding", 62}, - {"border-right-color", 20}, - {"",}, {"",}, {"",}, - {"border-style", 23}, - {"",}, - {"letter-spacing", 50}, - {"",}, - {"padding-top", 66}, - {"background-filter", 3}, - {"",}, - {"background-position", 5}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"float", 41}, - {"background-x-position", 6}, - {"border-left-style", 17}, - {"",}, {"",}, {"",}, - {"background-y-position", 7}, - {"z-index", 78}, - {"border-right-style", 21}, - {"",}, {"",}, - {"background-image", 4}, - {"",}, {"",}, {"",}, - {"color", 35}, - {"",}, - {"border-right", 19}, - {"",}, - {"left", 49}, - {"",}, {"",}, - {"font-variant", 46}, - {"",}, - {"border-bottom-width", 13}, - {"",}, - {"border-top-color", 25}, - {"background-repeat", 8}, - {"border-bottom", 10}, - {"font-size", 44}, - {"font-style", 45}, - {"border-top-style", 26}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"overflow", 61}, - {"list-style-position", 54}, - {"clear", 29}, - {"text-indent", 70}, - {"",}, {"",}, - {"clip", 30}, - {"text-align", 68}, - {"",}, {"",}, {"",}, - {"vertical-align", 73}, - {"list-style", 52}, - {"cursor", 36}, - {"",}, {"",}, - {"direction", 38}, - {"",}, - {"list-style-image", 53}, - {"border-left-width", 18}, - {"",}, {"",}, - {"background", 0}, - {"font-weight", 47}, - {"",}, - {"border-right-width", 22}, - {"",}, {"",}, - {"margin", 56}, - {"padding-left", 64}, - {"",}, {"",}, {"",}, - {"background-color", 2}, - {"display", 39}, - {"",}, {"",}, - {"margin-top", 60}, - {"background-attachment", 1}, - {"",}, {"",}, {"",}, {"",}, - {"line-height", 51}, - {"word-spacing", 77}, - {"",}, {"",}, - {"clip-right", 33}, - {"",}, {"",}, - {"clip-top", 34}, - {"",}, - {"width", 76}, - {"",}, {"",}, {"",}, {"",}, - {"list-style-type", 55}, - {"",}, - {"border-width", 28}, - {"",}, {"",}, {"",}, - {"border-top-width", 27}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"cursor-image", 37}, - {"padding-right", 65}, - {"clip-left", 32}, - {"",}, - {"margin-left", 58}, - {"",}, {"",}, {"",}, {"",}, - {"height", 48}, - {"",}, {"",}, - {"padding-bottom", 63}, - {"",}, {"",}, {"",}, {"",}, {"",}, - {"text-decoration", 69}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"text-transform", 71}, - {"",}, - {"clip-bottom", 31}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"margin-right", 59}, - {"",}, {"",}, {"",}, - {"white-space", 75}, - {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, - {"margin-bottom", 57}, - }; - - if (str != NULL) { - int len = PL_strlen(str); - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { - register int hval = len; - - switch (hval) - { - default: - case 12: - hval += asso_values[MYLOWER(str[11])]; - case 11: - case 10: - case 9: - case 8: - case 7: - case 6: - hval += asso_values[MYLOWER(str[5])]; - case 5: - case 4: - case 3: - case 2: - hval += asso_values[MYLOWER(str[1])]; - case 1: - hval += asso_values[MYLOWER(str[0])]; - break; - } - hval += asso_values[MYLOWER(str[len - 1])]; - if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) { - if (len == lengthtable[hval]) { - register const char *tag = wordlist[hval].tag; - - /* - ** While not at the end of the string, if they ever differ - ** they are not equal. We know "tag" is already lower case. - */ - while ((*tag != '\0')&&(*str != '\0')) { - if (*tag != (char) MYLOWER(*str)) { - return -1; - } - tag++; - str++; - } - - /* - ** One of the strings has ended, if they are both ended, then they - ** are equal, otherwise not. - */ - if ((*tag == '\0')&&(*str == '\0')) { - return wordlist[hval].id; - } - } - } - } - } - return -1; -} - -const nsCSSProps::NameTableEntry nsCSSProps::kNameTable[] = { - { "background", 0 }, - { "background-attachment", 1 }, - { "background-color", 2 }, - { "background-filter", 3 }, - { "background-image", 4 }, - { "background-position", 5 }, - { "background-x-position", 6 }, - { "background-y-position", 7 }, - { "background-repeat", 8 }, - { "border", 9 }, - { "border-bottom", 10 }, - { "border-bottom-color", 11 }, - { "border-bottom-style", 12 }, - { "border-bottom-width", 13 }, - { "border-color", 14 }, - { "border-left", 15 }, - { "border-left-color", 16 }, - { "border-left-style", 17 }, - { "border-left-width", 18 }, - { "border-right", 19 }, - { "border-right-color", 20 }, - { "border-right-style", 21 }, - { "border-right-width", 22 }, - { "border-style", 23 }, - { "border-top", 24 }, - { "border-top-color", 25 }, - { "border-top-style", 26 }, - { "border-top-width", 27 }, - { "border-width", 28 }, - { "clear", 29 }, - { "clip", 30 }, - { "clip-bottom", 31 }, - { "clip-left", 32 }, - { "clip-right", 33 }, - { "clip-top", 34 }, - { "color", 35 }, - { "cursor", 36 }, - { "cursor-image", 37 }, - { "direction", 38 }, - { "display", 39 }, - { "filter", 40 }, - { "float", 41 }, - { "font", 42 }, - { "font-family", 43 }, - { "font-size", 44 }, - { "font-style", 45 }, - { "font-variant", 46 }, - { "font-weight", 47 }, - { "height", 48 }, - { "left", 49 }, - { "letter-spacing", 50 }, - { "line-height", 51 }, - { "list-style", 52 }, - { "list-style-image", 53 }, - { "list-style-position", 54 }, - { "list-style-type", 55 }, - { "margin", 56 }, - { "margin-bottom", 57 }, - { "margin-left", 58 }, - { "margin-right", 59 }, - { "margin-top", 60 }, - { "overflow", 61 }, - { "padding", 62 }, - { "padding-bottom", 63 }, - { "padding-left", 64 }, - { "padding-right", 65 }, - { "padding-top", 66 }, - { "position", 67 }, - { "text-align", 68 }, - { "text-decoration", 69 }, - { "text-indent", 70 }, - { "text-transform", 71 }, - { "top", 72 }, - { "vertical-align", 73 }, - { "visibility", 74 }, - { "white-space", 75 }, - { "width", 76 }, - { "word-spacing", 77 }, - { "z-index", 78 }, -}; diff --git a/mozilla/layout/style/nsCSSProps.h b/mozilla/layout/style/nsCSSProps.h deleted file mode 100644 index 29bd8de6945..00000000000 --- a/mozilla/layout/style/nsCSSProps.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSProps_h___ -#define nsCSSProps_h___ - -#include "nslayout.h" -#include "nsCSSPropIDs.h" - -class NS_LAYOUT nsCSSProps { -public: - // Given a null terminated string of 7 bit characters, return the - // tag id (see nsCSSPropIDs.h) for the tag or -1 if the tag is not - // known. The lookup function uses a perfect hash. - static PRInt32 LookupName(const char* str); - - struct NameTableEntry { - const char* name; - PRInt32 id; - }; - - // A table whose index is the tag id (from nsCSSPropIDs) - static const NameTableEntry kNameTable[]; -}; - -#endif /* nsCSSProps_h___ */ diff --git a/mozilla/layout/style/nsCSSScanner.cpp b/mozilla/layout/style/nsCSSScanner.cpp deleted file mode 100644 index 50f64a93f29..00000000000 --- a/mozilla/layout/style/nsCSSScanner.cpp +++ /dev/null @@ -1,585 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCSSScanner.h" -#include "nsIInputStream.h" -#include "nsIUnicharInputStream.h" -#include "nsString.h" -#include "nsCRT.h" - -#ifdef NS_DEBUG -static char* kNullPointer = "null pointer"; -#endif - -// Don't bother collecting whitespace characters in token's mIdent buffer -#undef COLLECT_WHITESPACE - -#define BUFFER_SIZE 256 - -static const PRUnichar CSS_ESCAPE = PRUnichar('\\'); - -static const PRUint8 IS_LATIN1 = 0x01; -static const PRUint8 IS_DIGIT = 0x02; -static const PRUint8 IS_HEX_DIGIT = 0x04; -static const PRUint8 IS_ALPHA = 0x08; -static const PRUint8 START_IDENT = 0x10; -static const PRUint8 IS_IDENT = 0x20; -static const PRUint8 IS_WHITESPACE = 0x40; - -static PRUint8* gLexTable; - -static void BuildLexTable() -{ - PRUint8* lt = new PRUint8[256]; - nsCRT::zero(lt, 256); - gLexTable = lt; - - int i; - lt[CSS_ESCAPE] = START_IDENT; - lt['-'] |= IS_IDENT; - // XXX add in other whitespace chars - lt[' '] |= IS_WHITESPACE; - lt['\t'] |= IS_WHITESPACE; - lt['\r'] |= IS_WHITESPACE; - lt['\n'] |= IS_WHITESPACE; - for (i = 161; i <= 255; i++) { - lt[i] |= IS_LATIN1 | IS_IDENT | START_IDENT; - } - for (i = '0'; i <= '9'; i++) { - lt[i] |= IS_DIGIT | IS_HEX_DIGIT | IS_IDENT; - } - for (i = 'A'; i <= 'Z'; i++) { - if ((i >= 'A') && (i <= 'F')) { - lt[i] |= IS_HEX_DIGIT; - lt[i+32] |= IS_HEX_DIGIT; - } - lt[i] |= IS_ALPHA | IS_IDENT | START_IDENT; - lt[i+32] |= IS_ALPHA | IS_IDENT | START_IDENT; - } -} - -nsCSSToken::nsCSSToken() -{ - mType = eCSSToken_Symbol; -} - -nsCSSScanner::nsCSSScanner() -{ - if (nsnull == gLexTable) { - // XXX need a monitor - BuildLexTable(); - } - mInput = nsnull; - mBuffer = new PRUnichar[BUFFER_SIZE]; - mOffset = 0; - mCount = 0; - mLookAhead = -1; -} - -nsCSSScanner::~nsCSSScanner() -{ - Close(); - if (nsnull != mBuffer) { - delete mBuffer; - mBuffer = nsnull; - } -} - -void nsCSSScanner::Init(nsIUnicharInputStream* aInput) -{ - NS_PRECONDITION(nsnull != aInput, kNullPointer); - Close(); - mInput = aInput; - if (nsnull != aInput) { - aInput->AddRef(); - } -} - -void nsCSSScanner::Close() -{ - NS_IF_RELEASE(mInput); -} - -// Returns -1 on error or eof -PRInt32 nsCSSScanner::Read(PRInt32* aErrorCode) -{ - PRInt32 rv; - if (mLookAhead >= 0) { - rv = mLookAhead; - mLookAhead = -1; - } else { - if (mCount < 0) { - return -1; - } - if (mOffset == mCount) { - mOffset = 0; - mCount = mInput->Read(aErrorCode, mBuffer, 0, BUFFER_SIZE); - if (mCount <= 0) { - return -1; - } - } - rv = PRInt32(mBuffer[mOffset++]); - } - mLastRead = rv; -//printf("Read => %x\n", rv); - return rv; -} - -PRInt32 nsCSSScanner::Peek(PRInt32* aErrorCode) -{ - if (mLookAhead < 0) { - mLookAhead = Read(aErrorCode); - if (mLookAhead < 0) { - return -1; - } - } -//printf("Peek => %x\n", mLookAhead); - return mLookAhead; -} - -void nsCSSScanner::Unread() -{ - NS_PRECONDITION((mLastRead >= 0) && (mLookAhead < 0), "double pushback"); - mLookAhead = mLastRead; - mLastRead = -1; -} - -PRBool nsCSSScanner::LookAhead(PRInt32* aErrorCode, PRUnichar aChar) -{ - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - if (ch == aChar) { - return PR_TRUE; - } - Unread(); - return PR_FALSE; -} - -PRBool nsCSSScanner::EatWhiteSpace(PRInt32* aErrorCode) -{ - PRBool eaten = PR_FALSE; - for (;;) { - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - break; - } - if ((ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t')) { - eaten = PR_TRUE; - continue; - } - Unread(); - break; - } - return eaten; -} - -PRBool nsCSSScanner::EatNewline(PRInt32* aErrorCode) -{ - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - PRBool eaten = PR_FALSE; - if (ch == '\r') { - eaten = PR_TRUE; - ch = Peek(aErrorCode); - if (ch == '\n') { - (void) Read(aErrorCode); - } - } else if (ch == '\n') { - eaten = PR_TRUE; - } else { - Unread(); - } - return eaten; -} - -PRBool nsCSSScanner::Next(PRInt32* aErrorCode, nsCSSToken* aToken) -{ - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - if (ch < 256) { - PRUint8* lexTable = gLexTable; - - // IDENT - if ((lexTable[ch] & START_IDENT) != 0) { - return ParseIdent(aErrorCode, ch, aToken); - } - - // AT_KEYWORD - if (ch == '@') { - PRInt32 nextChar = Peek(aErrorCode); - if ((nextChar >= 0) && (nextChar <= 255)) { - if ((lexTable[nextChar] & START_IDENT) != 0) { - return ParseAtKeyword(aErrorCode, ch, aToken); - } - } - } - - // NUMBER or DIM - if ((ch == '.') || (ch == '+') || (ch == '-')) { - PRInt32 nextChar = Peek(aErrorCode); - if ((nextChar >= 0) && (nextChar <= 255)) { - if ((lexTable[nextChar] & IS_DIGIT) != 0) { - return ParseNumber(aErrorCode, ch, aToken); - } - } - } - if ((lexTable[ch] & IS_DIGIT) != 0) { - return ParseNumber(aErrorCode, ch, aToken); - } - - // ID - if (ch == '#') { - return ParseID(aErrorCode, ch, aToken); - } - - // STRING - if ((ch == '"') || (ch == '\'')) { - return ParseString(aErrorCode, ch, aToken); - } - - // WS - if ((lexTable[ch] & IS_WHITESPACE) != 0) { - aToken->mType = eCSSToken_WhiteSpace; - aToken->mIdent.SetLength(0); - aToken->mIdent.Append(PRUnichar(ch)); - (void) EatWhiteSpace(aErrorCode); - return PR_TRUE; - } - if (ch == '/') { - PRInt32 nextChar = Peek(aErrorCode); - if (nextChar == '/') { - (void) Read(aErrorCode); - aToken->mIdent.SetLength(0); - aToken->mIdent.Append(PRUnichar(ch)); - aToken->mIdent.Append(PRUnichar(ch)); - return ParseEOLComment(aErrorCode, aToken); - } else if (nextChar == '*') { - (void) Read(aErrorCode); - aToken->mIdent.SetLength(0); - aToken->mIdent.Append(PRUnichar(ch)); - aToken->mIdent.Append(PRUnichar(nextChar)); - return ParseCComment(aErrorCode, aToken); - } - } - } - aToken->mType = eCSSToken_Symbol; - aToken->mSymbol = ch; - return PR_TRUE; -} - -PRInt32 nsCSSScanner::ParseEscape(PRInt32* aErrorCode) -{ - PRUint8* lexTable = gLexTable; - PRInt32 ch = Peek(aErrorCode); - if (ch < 0) { - return CSS_ESCAPE; - } - if ((ch <= 255) && ((lexTable[ch] & IS_HEX_DIGIT) != 0)) { - PRInt32 rv = 0; - for (int i = 0; i < 4; i++) { - ch = Read(aErrorCode); - if (ch < 0) { - // Whoops: error or premature eof - break; - } - if ((lexTable[ch] & IS_HEX_DIGIT) != 0) { - if ((lexTable[ch] & IS_DIGIT) != 0) { - rv = rv * 16 + (ch - '0'); - } else { - // Note: c&7 just keeps the low three bits which causes - // upper and lower case alphabetics to both yield their - // "relative to 10" value for computing the hex value. - rv = rv * 16 + (ch & 0x7) + 10; - } - } else { - Unread(); - break; - } - } - return rv; - } else { - // "Any character except a hexidecimal digit can be escaped to - // remove its special meaning by putting a backslash in front" - // -- CSS1 spec section 7.1 - (void) Read(aErrorCode); - return ch; - } -} - -/** - * Gather up the characters in an identifier. The identfier was - * started by "aChar" which will be appended to aIdent. The result - * will be aIdent with all of the identifier characters appended - * until the first non-identifier character is seen. The termination - * character is unread for the future re-reading. - */ -PRBool nsCSSScanner::GatherIdent(PRInt32* aErrorCode, PRInt32 aChar, - nsString& aIdent) -{ - if (aChar == CSS_ESCAPE) { - aChar = ParseEscape(aErrorCode); - } - for (;;) { - aChar = Read(aErrorCode); - if (aChar < 0) break; - if (aChar == CSS_ESCAPE) { - aChar = ParseEscape(aErrorCode); - aIdent.Append(PRUnichar(aChar)); - } else if ((aChar <= 255) && ((gLexTable[aChar] & IS_IDENT) != 0)) { - aIdent.Append(PRUnichar(aChar)); - } else { - Unread(); - break; - } - } - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseID(PRInt32* aErrorCode, - PRInt32 aChar, - nsCSSToken* aToken) -{ - aToken->mIdent.SetLength(0); - aToken->mType = eCSSToken_ID; - return GatherIdent(aErrorCode, aChar, aToken->mIdent); -} - -PRBool nsCSSScanner::ParseIdent(PRInt32* aErrorCode, - PRInt32 aChar, - nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - ident.SetLength(0); - ident.Append(PRUnichar(aChar)); - if (!GatherIdent(aErrorCode, aChar, ident)) { - return PR_FALSE; - } - - // Process a url lexical token. A CSS1 url token can contain - // characters beyond identifier characters (e.g. '/', ':', etc.) - // Because of this the normal rules for tokenizing the input don't - // apply very well. To simplify the parser and relax some of the - // requirements on the scanner we parse url's here. If we find a - // malformed URL then we emit a token of type "InvalidURL" so that - // the CSS1 parser can ignore the invalid input. We attempt to eat - // the right amount of input data when an invalid URL is presented. - nsCSSTokenType tokenType = eCSSToken_Ident; - if (ident.EqualsIgnoreCase("url")) { - tokenType = eCSSToken_InvalidURL; - if (LookAhead(aErrorCode, '(')) { - // Skip leading whitespace - (void) EatWhiteSpace(aErrorCode); - ident.SetLength(0); - - PRInt32 c = Read(aErrorCode); - if (c == ')') { - // empty url spec: this is invalid - } else if ((c == '"') || (c == '\'')) { - // start of a quoted url - if (!GatherString(aErrorCode, c, ident)) { - return PR_FALSE; - } - if (!EatWhiteSpace(aErrorCode)) { - return PR_FALSE; - } - if (LookAhead(aErrorCode, ')')) { - tokenType = eCSSToken_URL; - } - } else { - // start of a non-quoted url - Unread(); - PRBool ok = PR_TRUE; - for (;;) { - c = Read(aErrorCode); - if (c < 0) break; - if (c == CSS_ESCAPE) { - c = ParseEscape(aErrorCode); - ident.Append(PRUnichar(c)); - } else if ((c == '"') || (c == '\'') || (c == '(')) { - // This is an invalid URL spec - ok = PR_FALSE; - } else if ((256 >= c) && ((gLexTable[c] & IS_WHITESPACE) != 0)) { - // Whitespace is allowed at the end of the URL - (void) EatWhiteSpace(aErrorCode); - if (LookAhead(aErrorCode, ')')) { - // done! - break; - } - // Whitespace is followed by something other than a - // ")". This is an invalid url spec. - ok = PR_FALSE; - } else if (c == ')') { - // All done - break; - } else { - // A regular url character. - ident.Append(PRUnichar(c)); - } - } - - // If the result of the above scanning is ok then change the token - // type to a useful one. - if (ok) { - tokenType = eCSSToken_URL; - } - } - } - } - aToken->mType = tokenType; - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseAtKeyword(PRInt32* aErrorCode, PRInt32 aChar, - nsCSSToken* aToken) -{ - aToken->mIdent.SetLength(0); - aToken->mType = eCSSToken_AtKeyword; - return GatherIdent(aErrorCode, aChar, aToken->mIdent); -} - -PRBool nsCSSScanner::ParseNumber(PRInt32* aErrorCode, PRInt32 c, - nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - ident.SetLength(0); - PRBool gotDot = (c == '.') ? PR_TRUE : PR_FALSE; - if (c != '+') { - ident.Append(PRUnichar(c)); - } - - // Gather up characters that make up the number - PRUint8* lexTable = gLexTable; - for (;;) { - c = Read(aErrorCode); - if (c < 0) break; - if (!gotDot && (c == '.')) { - gotDot = PR_TRUE; - } else if ((c > 255) || ((lexTable[c] & IS_DIGIT) == 0)) { - break; - } - ident.Append(PRUnichar(c)); - } - - // Convert number to floating point - nsCSSTokenType type = eCSSToken_Number; - PRInt32 ec; - float value = ident.ToFloat(&ec); - - // Look at character that terminated the number - aToken->mIntegerValid = PR_FALSE; - if (c >= 0) { - if ((c <= 255) && ((lexTable[c] & START_IDENT) != 0)) { - ident.SetLength(0); - ident.Append(PRUnichar(c)); - if (!GatherIdent(aErrorCode, c, ident)) { - return PR_FALSE; - } - type = eCSSToken_Dimension; - } else if ('%' == c) { - type = eCSSToken_Percentage; - value = value / 100.0f; - } else { - // Put back character that stopped numeric scan - Unread(); - if (!gotDot) { - aToken->mInteger = ident.ToInteger(&ec); - aToken->mIntegerValid = PR_TRUE; - } - ident.SetLength(0); - } - } - aToken->mNumber = value; - aToken->mType = type; - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseCComment(PRInt32* aErrorCode, nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - for (;;) { - PRInt32 ch = Read(aErrorCode); - if (ch < 0) break; - if (ch == '*') { - if (LookAhead(aErrorCode, '/')) { - ident.Append(PRUnichar(ch)); - ident.Append('/'); - break; - } - } -#ifdef COLLECT_WHITESPACE - ident.Append(PRUnichar(ch)); -#endif - } - aToken->mType = eCSSToken_WhiteSpace; - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseEOLComment(PRInt32* aErrorCode, nsCSSToken* aToken) -{ - nsString& ident = aToken->mIdent; - ident.SetLength(0); - for (;;) { - if (EatNewline(aErrorCode)) { - break; - } - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - break; - } -#ifdef COLLECT_WHITESPACE - ident.Append(PRUnichar(ch)); -#endif - } - aToken->mType = eCSSToken_WhiteSpace; - return PR_TRUE; -} - -PRBool nsCSSScanner::GatherString(PRInt32* aErrorCode, PRInt32 aStop, - nsString& aBuffer) -{ - for (;;) { - PRInt32 ch = Read(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - if (ch == aStop) { - break; - } - if (ch == CSS_ESCAPE) { - ch = ParseEscape(aErrorCode); - if (ch < 0) { - return PR_FALSE; - } - } - aBuffer.Append(PRUnichar(ch)); - } - return PR_TRUE; -} - -PRBool nsCSSScanner::ParseString(PRInt32* aErrorCode, PRInt32 aStop, - nsCSSToken* aToken) -{ - aToken->mIdent.SetLength(0); - aToken->mType = eCSSToken_String; - return GatherString(aErrorCode, aStop, aToken->mIdent); -} diff --git a/mozilla/layout/style/nsCSSScanner.h b/mozilla/layout/style/nsCSSScanner.h deleted file mode 100644 index afbe1da67fd..00000000000 --- a/mozilla/layout/style/nsCSSScanner.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSSScanner_h___ -#define nsCSSScanner_h___ - -#include "nsString.h" -class nsIUnicharInputStream; - -// Token types -enum nsCSSTokenType { - // A css identifier (e.g. foo) - eCSSToken_Ident = 0, - - // A css at keyword (e.g. @foo) - eCSSToken_AtKeyword = 1, - - // A css number without a percentage or dimension; with percentage; - // without percentage but with a dimension - eCSSToken_Number = 2, - eCSSToken_Percentage = 3, - eCSSToken_Dimension = 4, - - // A css string (e.g. "foo" or 'foo') - eCSSToken_String = 5, - - // Whitespace (e.g. " " or "/* abc */" or "// foo ") - eCSSToken_WhiteSpace = 6, - - // A css symbol (e.g. ':', ';', '+', etc.) - eCSSToken_Symbol = 7, - - eCSSToken_URL = 8, // use getString - eCSSToken_InvalidURL = 9, // doesn't matter - - // A css1 id (e.g. #foo3) - eCSSToken_ID = 10, // use getString() -}; - -struct nsCSSToken { - nsCSSTokenType mType; - nsAutoString mIdent; - float mNumber; - PRInt32 mInteger; - PRUnichar mSymbol; - PRBool mIntegerValid; - - nsCSSToken(); - - PRBool isDimension() { - return (PRBool) - ((eCSSToken_Dimension == mType) || - ((eCSSToken_Number == mType) && (mNumber == 0.0f))); - } -}; - -// CSS Scanner API. Used to tokenize an input stream using the CSS -// forward compatible tokenization rules. This implementation is -// private to this package and is only used internally by the css -// parser. -class nsCSSScanner { - public: - nsCSSScanner(); - ~nsCSSScanner(); - - // Init the scanner. - void Init(nsIUnicharInputStream* aInput); - - // Get the next token. Return nsfalse on EOF or ERROR. aTokenResult - // is filled in with the data for the token. - PRBool Next(PRInt32* aErrorCode, nsCSSToken* aTokenResult); - -protected: - void Close(); - PRInt32 Read(PRInt32* aErrorCode); - PRInt32 Peek(PRInt32* aErrorCode); - void Unread(); - PRBool LookAhead(PRInt32* aErrorCode, PRUnichar aChar); - PRBool EatWhiteSpace(PRInt32* aErrorCode); - PRBool EatNewline(PRInt32* aErrorCode); - - PRInt32 ParseEscape(PRInt32* aErrorCode); - PRBool ParseIdent(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseAtKeyword(PRInt32* aErrorCode, PRInt32 aChar, - nsCSSToken* aResult); - PRBool ParseNumber(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseID(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseString(PRInt32* aErrorCode, PRInt32 aChar, nsCSSToken* aResult); - PRBool ParseEOLComment(PRInt32* aErrorCode, nsCSSToken* aResult); - PRBool ParseCComment(PRInt32* aErrorCode, nsCSSToken* aResult); - - PRBool GatherString(PRInt32* aErrorCode, PRInt32 aStop, - nsString& aString); - PRBool GatherIdent(PRInt32* aErrorCode, PRInt32 aChar, nsString& aIdent); - - nsIUnicharInputStream* mInput; - PRUnichar* mBuffer; - PRInt32 mOffset; - PRInt32 mCount; - PRInt32 mLookAhead; - PRInt32 mLastRead; -}; - -#endif /* nsCSSScanner_h___ */ diff --git a/mozilla/layout/style/nsCSSStruct.cpp b/mozilla/layout/style/nsCSSStruct.cpp deleted file mode 100644 index 35ee0d46229..00000000000 --- a/mozilla/layout/style/nsCSSStruct.cpp +++ /dev/null @@ -1,1435 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSDeclaration.h" -#include "nsString.h" -#include "nsCRT.h" -#include "nsCSSProps.h" -#include "nsCSSPropIDs.h" -#include "nsUnitConversion.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID); -static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID); -static NS_DEFINE_IID(kCSSDisplaySID, NS_CSS_DISPLAY_SID); -static NS_DEFINE_IID(kCSSTextSID, NS_CSS_TEXT_SID); -static NS_DEFINE_IID(kCSSMarginSID, NS_CSS_MARGIN_SID); -static NS_DEFINE_IID(kCSSPositionSID, NS_CSS_POSITION_SID); -static NS_DEFINE_IID(kCSSListSID, NS_CSS_LIST_SID); -static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID); - - -nsCSSValue::nsCSSValue(void) - : mUnit(eCSSUnit_Null) -{ - mValue.mInt = 0; -} - -nsCSSValue::nsCSSValue(PRInt32 aValue, nsCSSUnit aUnit) - : mUnit(aUnit) -{ - mValue.mInt = aValue; -} - -nsCSSValue::nsCSSValue(float aValue, nsCSSUnit aUnit) - : mUnit(aUnit) -{ - mValue.mFloat = aValue; -} - -nsCSSValue::nsCSSValue(const nsString& aValue) - : mUnit(eCSSUnit_String) -{ - mValue.mString = aValue.ToNewString(); -} - -nsCSSValue::nsCSSValue(nscolor aValue) - : mUnit(eCSSUnit_Color) -{ - mValue.mColor = aValue; -} - -nsCSSValue::nsCSSValue(const nsCSSValue& aCopy) - : mUnit(aCopy.mUnit) -{ - if (eCSSUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = (aCopy.mValue.mString)->ToNewString(); - } - else { - mValue.mString = nsnull; - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - mValue.mInt = aCopy.mValue.mInt; - } - else if (eCSSUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else { - mValue.mFloat = aCopy.mValue.mFloat; - } -} - -nsCSSValue::~nsCSSValue(void) -{ - Reset(); -} - -nsCSSValue& nsCSSValue::operator=(const nsCSSValue& aCopy) -{ - Reset(); - mUnit = aCopy.mUnit; - if (eCSSUnit_String == mUnit) { - if (nsnull != aCopy.mValue.mString) { - mValue.mString = (aCopy.mValue.mString)->ToNewString(); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - mValue.mInt = aCopy.mValue.mInt; - } - else if (eCSSUnit_Color == mUnit){ - mValue.mColor = aCopy.mValue.mColor; - } - else { - mValue.mFloat = aCopy.mValue.mFloat; - } - return *this; -} - -PRBool nsCSSValue::operator==(const nsCSSValue& aOther) const -{ - if (mUnit == aOther.mUnit) { - if (eCSSUnit_String == mUnit) { - if (nsnull == mValue.mString) { - if (nsnull == aOther.mValue.mString) { - return PR_TRUE; - } - } - else if (nsnull != aOther.mValue.mString) { - return mValue.mString->Equals(*(aOther.mValue.mString)); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit < eCSSUnit_Percent)) { - return PRBool(mValue.mInt == aOther.mValue.mInt); - } - else if (eCSSUnit_Color == mUnit){ - return PRBool(mValue.mColor == aOther.mValue.mColor); - } - else { - return PRBool(mValue.mFloat == aOther.mValue.mFloat); - } - } - return PR_FALSE; -} - -nscoord nsCSSValue::GetLengthTwips(void) const -{ - NS_ASSERTION(IsFixedLengthUnit(), "not a fixed length unit"); - - if (IsFixedLengthUnit()) { - switch (mUnit) { - case eCSSUnit_Inch: - return (nscoord)NS_INCHES_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Foot: - return (nscoord)NS_FEET_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Mile: - return (nscoord)NS_MILES_TO_TWIPS(mValue.mFloat); - - case eCSSUnit_Millimeter: - return (nscoord)NS_MILLIMETERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Centimeter: - return (nscoord)NS_CENTIMETERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Meter: - return (nscoord)NS_METERS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Kilometer: - return (nscoord)NS_KILOMETERS_TO_TWIPS(mValue.mFloat); - - case eCSSUnit_Point: - return (nscoord)NS_POINTS_TO_TWIPS_FLOAT(mValue.mFloat); - case eCSSUnit_Pica: - return (nscoord)NS_PICAS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Didot: - return (nscoord)NS_DIDOTS_TO_TWIPS(mValue.mFloat); - case eCSSUnit_Cicero: - return (nscoord)NS_CICEROS_TO_TWIPS(mValue.mFloat); - } - } - return 0; -} - -void nsCSSValue::Reset(void) -{ - if ((eCSSUnit_String == mUnit) && (nsnull != mValue.mString)) { - delete mValue.mString; - } - mUnit = eCSSUnit_Null; - mValue.mInt = 0; -}; - -void nsCSSValue::Set(PRInt32 aValue, nsCSSUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mInt = aValue; -} - -void nsCSSValue::Set(float aValue, nsCSSUnit aUnit) -{ - Reset(); - mUnit = aUnit; - mValue.mFloat = aValue; -} - -void nsCSSValue::Set(const nsString& aValue) -{ - Reset(); - mUnit = eCSSUnit_String; - mValue.mString = aValue.ToNewString(); -} - -void nsCSSValue::Set(nscolor aValue) -{ - Reset(); - mUnit = eCSSUnit_Color; - mValue.mColor = aValue; -} - -void nsCSSValue::AppendToString(nsString& aBuffer, PRInt32 aPropID) const -{ - if (eCSSUnit_Null == mUnit) { - return; - } - - if (-1 < aPropID) { - aBuffer.Append(nsCSSProps::kNameTable[aPropID].name); - aBuffer.Append(": "); - } - - if (eCSSUnit_String == mUnit) { - if (nsnull != mValue.mString) { - aBuffer.Append('"'); - aBuffer.Append(*(mValue.mString)); - aBuffer.Append('"'); - } - else { - aBuffer.Append("null str"); - } - } - else if ((eCSSUnit_Absolute <= mUnit) && (mUnit <= eCSSUnit_Enumerated)) { - aBuffer.Append(mValue.mInt, 10); - aBuffer.Append("[0x"); - aBuffer.Append(mValue.mInt, 16); - aBuffer.Append(']'); - } - else if (eCSSUnit_Color == mUnit){ - aBuffer.Append("(0x"); - aBuffer.Append(NS_GET_R(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_G(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_B(mValue.mColor), 16); - aBuffer.Append(" 0x"); - aBuffer.Append(NS_GET_A(mValue.mColor), 16); - aBuffer.Append(')'); - } - else if (eCSSUnit_Percent <= mUnit) { - aBuffer.Append(mValue.mFloat); - } - - switch (mUnit) { - case eCSSUnit_Null: break; - case eCSSUnit_Auto: aBuffer.Append("auto"); break; - case eCSSUnit_String: break; - case eCSSUnit_Absolute: aBuffer.Append("abs"); break; - case eCSSUnit_Enumerated: aBuffer.Append("enum"); break; - case eCSSUnit_Color: aBuffer.Append("rbga"); break; - case eCSSUnit_Percent: aBuffer.Append("%"); break; - case eCSSUnit_Number: aBuffer.Append("#"); break; - case eCSSUnit_Inch: aBuffer.Append("in"); break; - case eCSSUnit_Foot: aBuffer.Append("ft"); break; - case eCSSUnit_Mile: aBuffer.Append("mi"); break; - case eCSSUnit_Millimeter: aBuffer.Append("mm"); break; - case eCSSUnit_Centimeter: aBuffer.Append("cm"); break; - case eCSSUnit_Meter: aBuffer.Append("m"); break; - case eCSSUnit_Kilometer: aBuffer.Append("km"); break; - case eCSSUnit_Point: aBuffer.Append("pt"); break; - case eCSSUnit_Pica: aBuffer.Append("pc"); break; - case eCSSUnit_Didot: aBuffer.Append("dt"); break; - case eCSSUnit_Cicero: aBuffer.Append("cc"); break; - case eCSSUnit_EM: aBuffer.Append("em"); break; - case eCSSUnit_EN: aBuffer.Append("en"); break; - case eCSSUnit_XHeight: aBuffer.Append("ex"); break; - case eCSSUnit_CapHeight: aBuffer.Append("cap"); break; - case eCSSUnit_Pixel: aBuffer.Append("px"); break; - } - aBuffer.Append(' '); -} - -void nsCSSValue::ToString(nsString& aBuffer, PRInt32 aPropID) const -{ - aBuffer.SetLength(0); - AppendToString(aBuffer, aPropID); -} - -const nsID& nsCSSFont::GetID(void) -{ - return kCSSFontSID; -} - -void nsCSSFont::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mFamily.AppendToString(buffer, PROP_FONT_FAMILY); - mStyle.AppendToString(buffer, PROP_FONT_STYLE); - mVariant.AppendToString(buffer, PROP_FONT_VARIANT); - mWeight.AppendToString(buffer, PROP_FONT_WEIGHT); - mSize.AppendToString(buffer, PROP_FONT_SIZE); - fputs(buffer, out); -} - - -const nsID& nsCSSColor::GetID(void) -{ - return kCSSColorSID; -} - -void nsCSSColor::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mColor.AppendToString(buffer, PROP_COLOR); - mBackColor.AppendToString(buffer, PROP_BACKGROUND_COLOR); - mBackImage.AppendToString(buffer, PROP_BACKGROUND_IMAGE); - mBackRepeat.AppendToString(buffer, PROP_BACKGROUND_REPEAT); - mBackAttachment.AppendToString(buffer, PROP_BACKGROUND_ATTACHMENT); - mBackPositionX.AppendToString(buffer, PROP_BACKGROUND_X_POSITION); - mBackPositionY.AppendToString(buffer, PROP_BACKGROUND_Y_POSITION); - mBackFilter.AppendToString(buffer, PROP_BACKGROUND_FILTER); - mCursor.AppendToString(buffer, PROP_CURSOR); - mCursorImage.AppendToString(buffer, PROP_CURSOR_IMAGE); - fputs(buffer, out); -} - -const nsID& nsCSSText::GetID(void) -{ - return kCSSTextSID; -} - -void nsCSSText::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mWordSpacing.AppendToString(buffer, PROP_WORD_SPACING); - mLetterSpacing.AppendToString(buffer, PROP_LETTER_SPACING); - mDecoration.AppendToString(buffer, PROP_TEXT_DECORATION); - mVerticalAlign.AppendToString(buffer, PROP_VERTICAL_ALIGN); - mTextTransform.AppendToString(buffer, PROP_TEXT_TRANSFORM); - mTextAlign.AppendToString(buffer, PROP_TEXT_ALIGN); - mTextIndent.AppendToString(buffer, PROP_TEXT_INDENT); - mLineHeight.AppendToString(buffer, PROP_LINE_HEIGHT); - mWhiteSpace.AppendToString(buffer, PROP_WHITE_SPACE); - fputs(buffer, out); -} - -const nsID& nsCSSDisplay::GetID(void) -{ - return kCSSDisplaySID; -} - -void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mDirection.AppendToString(buffer, PROP_DIRECTION); - mDisplay.AppendToString(buffer, PROP_DISPLAY); - mFloat.AppendToString(buffer, PROP_FLOAT); - mClear.AppendToString(buffer, PROP_CLEAR); - fputs(buffer, out); -} - -void nsCSSRect::List(FILE* out, PRInt32 aPropID, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - if (-1 < aPropID) { - buffer.Append(nsCSSProps::kNameTable[aPropID].name); - buffer.Append(": "); - } - - mTop.AppendToString(buffer); - mRight.AppendToString(buffer); - mBottom.AppendToString(buffer); - mLeft.AppendToString(buffer); - fputs(buffer, out); -} - -nsCSSMargin::nsCSSMargin(void) - : mMargin(nsnull), mPadding(nsnull), mBorder(nsnull), mColor(nsnull), mStyle(nsnull) -{ -} - -nsCSSMargin::~nsCSSMargin(void) -{ - if (nsnull != mMargin) { - delete mMargin; - } - if (nsnull != mPadding) { - delete mPadding; - } - if (nsnull != mBorder) { - delete mBorder; - } - if (nsnull != mColor) { - delete mColor; - } - if (nsnull != mStyle) { - delete mStyle; - } -} - -const nsID& nsCSSMargin::GetID(void) -{ - return kCSSMarginSID; -} - -void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - if (nsnull != mMargin) { - mMargin->List(out, PROP_MARGIN, aIndent); - } - if (nsnull != mPadding) { - mPadding->List(out, PROP_PADDING, aIndent); - } - if (nsnull != mBorder) { - mBorder->List(out, PROP_BORDER_WIDTH, aIndent); - } - if (nsnull != mColor) { - mColor->List(out, PROP_BORDER_COLOR, aIndent); - } - if (nsnull != mStyle) { - mStyle->List(out, PROP_BORDER_STYLE, aIndent); - } -} - -nsCSSPosition::nsCSSPosition(void) - : mClip(nsnull) -{ -} - -nsCSSPosition::~nsCSSPosition(void) -{ - if (nsnull != mClip) { - delete mClip; - } -} - -const nsID& nsCSSPosition::GetID(void) -{ - return kCSSPositionSID; -} - -void nsCSSPosition::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mPosition.AppendToString(buffer, PROP_POSITION); - mWidth.AppendToString(buffer, PROP_WIDTH); - mHeight.AppendToString(buffer, PROP_HEIGHT); - mLeft.AppendToString(buffer, PROP_LEFT); - mTop.AppendToString(buffer, PROP_TOP); - fputs(buffer, out); - if (nsnull != mClip) { - mClip->List(out, PROP_CLIP); - } - buffer.SetLength(0); - mOverflow.AppendToString(buffer, PROP_OVERFLOW); - mZIndex.AppendToString(buffer, PROP_OVERFLOW); - mVisibility.AppendToString(buffer, PROP_VISIBILITY); - mFilter.AppendToString(buffer, PROP_FILTER); - fputs(buffer, out); -} - -const nsID& nsCSSList::GetID(void) -{ - return kCSSListSID; -} - -void nsCSSList::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - nsAutoString buffer; - - mType.AppendToString(buffer, PROP_LIST_STYLE_TYPE); - mImage.AppendToString(buffer, PROP_LIST_STYLE_IMAGE); - mPosition.AppendToString(buffer, PROP_LIST_STYLE_POSITION); - fputs(buffer, out); -} - - - -class CSSDeclarationImpl : public nsICSSDeclaration { -public: - void* operator new(size_t size); - - CSSDeclarationImpl(void); - ~CSSDeclarationImpl(void); - - NS_DECL_ISUPPORTS - - nsresult GetData(const nsID& aSID, nsCSSStruct** aData); - nsresult EnsureData(const nsID& aSID, nsCSSStruct** aData); - - nsresult AddValue(const char* aProperty, const nsCSSValue& aValue); - nsresult AddValue(PRInt32 aProperty, const nsCSSValue& aValue); - nsresult GetValue(const char* aProperty, nsCSSValue& aValue); - nsresult GetValue(PRInt32 aProperty, nsCSSValue& aValue); - - void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - CSSDeclarationImpl(const CSSDeclarationImpl& aCopy); - CSSDeclarationImpl& operator=(const CSSDeclarationImpl& aCopy); - PRBool operator==(const CSSDeclarationImpl& aCopy) const; - -protected: - nsCSSFont* mFont; - nsCSSColor* mColor; - nsCSSText* mText; - nsCSSMargin* mMargin; - nsCSSPosition* mPosition; - nsCSSList* mList; - nsCSSDisplay* mDisplay; -}; - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - - -void* CSSDeclarationImpl::operator new(size_t size) -{ - void* result = new char[size]; - - nsCRT::zero(result, size); - return result; -} - -CSSDeclarationImpl::CSSDeclarationImpl(void) -{ - NS_INIT_REFCNT(); -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + CSSDeclaration\n", gInstanceCount); -#endif -} - -CSSDeclarationImpl::~CSSDeclarationImpl(void) -{ - if (nsnull != mFont) { - delete mFont; - } - if (nsnull != mColor) { - delete mColor; - } - if (nsnull != mText) { - delete mText; - } - if (nsnull != mMargin) { - delete mMargin; - } - if (nsnull != mPosition) { - delete mPosition; - } - if (nsnull != mList) { - delete mList; - } - if (nsnull != mDisplay) { - delete mDisplay; - } -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - CSSDeclaration\n", gInstanceCount); -#endif -} - -NS_IMPL_ISUPPORTS(CSSDeclarationImpl, kICSSDeclarationIID); - -nsresult CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr) -{ - if (nsnull == aDataPtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aSID.Equals(kCSSFontSID)) { - *aDataPtr = mFont; - } - else if (aSID.Equals(kCSSColorSID)) { - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSDisplaySID)) { - *aDataPtr = mDisplay; - } - else if (aSID.Equals(kCSSTextSID)) { - *aDataPtr = mText; - } - else if (aSID.Equals(kCSSMarginSID)) { - *aDataPtr = mMargin; - } - else if (aSID.Equals(kCSSPositionSID)) { - *aDataPtr = mPosition; - } - else if (aSID.Equals(kCSSListSID)) { - *aDataPtr = mList; - } - else { - return NS_NOINTERFACE; - } - return NS_OK; -} - -nsresult CSSDeclarationImpl::EnsureData(const nsID& aSID, nsCSSStruct** aDataPtr) -{ - if (nsnull == aDataPtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aSID.Equals(kCSSFontSID)) { - if (nsnull == mFont) { - mFont = new nsCSSFont(); - } - *aDataPtr = mFont; - } - else if (aSID.Equals(kCSSColorSID)) { - if (nsnull == mColor) { - mColor = new nsCSSColor(); - } - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSDisplaySID)) { - if (nsnull == mDisplay) { - mDisplay = new nsCSSDisplay(); - } - *aDataPtr = mColor; - } - else if (aSID.Equals(kCSSTextSID)) { - if (nsnull == mText) { - mText = new nsCSSText(); - } - *aDataPtr = mText; - } - else if (aSID.Equals(kCSSMarginSID)) { - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - *aDataPtr = mMargin; - } - else if (aSID.Equals(kCSSPositionSID)) { - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - *aDataPtr = mPosition; - } - else if (aSID.Equals(kCSSListSID)) { - if (nsnull == mList) { - mList = new nsCSSList(); - } - *aDataPtr = mList; - } - else { - return NS_NOINTERFACE; - } - if (nsnull == *aDataPtr) { - return NS_ERROR_OUT_OF_MEMORY; - } - return NS_OK; -} - -nsresult CSSDeclarationImpl::AddValue(const char* aProperty, const nsCSSValue& aValue) -{ - return AddValue(nsCSSProps::LookupName(aProperty), aValue); -} - -nsresult CSSDeclarationImpl::AddValue(PRInt32 aProperty, const nsCSSValue& aValue) -{ - nsresult result = NS_OK; - - switch (aProperty) { - // nsCSSFont - case PROP_FONT_FAMILY: - case PROP_FONT_STYLE: - case PROP_FONT_VARIANT: - case PROP_FONT_WEIGHT: - case PROP_FONT_SIZE: - if (nsnull == mFont) { - mFont = new nsCSSFont(); - } - if (nsnull != mFont) { - switch (aProperty) { - case PROP_FONT_FAMILY: mFont->mFamily = aValue; break; - case PROP_FONT_STYLE: mFont->mStyle = aValue; break; - case PROP_FONT_VARIANT: mFont->mVariant = aValue; break; - case PROP_FONT_WEIGHT: mFont->mWeight = aValue; break; - case PROP_FONT_SIZE: mFont->mSize = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSColor - case PROP_COLOR: - case PROP_BACKGROUND_COLOR: - case PROP_BACKGROUND_IMAGE: - case PROP_BACKGROUND_REPEAT: - case PROP_BACKGROUND_ATTACHMENT: - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BACKGROUND_FILTER: - case PROP_CURSOR: - case PROP_CURSOR_IMAGE: - if (nsnull == mColor) { - mColor = new nsCSSColor(); - } - if (nsnull != mColor) { - switch (aProperty) { - case PROP_COLOR: mColor->mColor = aValue; break; - case PROP_BACKGROUND_COLOR: mColor->mBackColor = aValue; break; - case PROP_BACKGROUND_IMAGE: mColor->mBackImage = aValue; break; - case PROP_BACKGROUND_REPEAT: mColor->mBackRepeat = aValue; break; - case PROP_BACKGROUND_ATTACHMENT: mColor->mBackAttachment = aValue; break; - case PROP_BACKGROUND_X_POSITION: mColor->mBackPositionX = aValue; break; - case PROP_BACKGROUND_Y_POSITION: mColor->mBackPositionY = aValue; break; - case PROP_BACKGROUND_FILTER: mColor->mBackFilter = aValue; break; - case PROP_CURSOR: mColor->mCursor = aValue; break; - case PROP_CURSOR_IMAGE: mColor->mCursorImage = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSText - case PROP_WORD_SPACING: - case PROP_LETTER_SPACING: - case PROP_TEXT_DECORATION: - case PROP_VERTICAL_ALIGN: - case PROP_TEXT_TRANSFORM: - case PROP_TEXT_ALIGN: - case PROP_TEXT_INDENT: - case PROP_LINE_HEIGHT: - case PROP_WHITE_SPACE: - if (nsnull == mText) { - mText = new nsCSSText(); - } - if (nsnull != mText) { - switch (aProperty) { - case PROP_WORD_SPACING: mText->mWordSpacing = aValue; break; - case PROP_LETTER_SPACING: mText->mLetterSpacing = aValue; break; - case PROP_TEXT_DECORATION: mText->mDecoration = aValue; break; - case PROP_VERTICAL_ALIGN: mText->mVerticalAlign = aValue; break; - case PROP_TEXT_TRANSFORM: mText->mTextTransform = aValue; break; - case PROP_TEXT_ALIGN: mText->mTextAlign = aValue; break; - case PROP_TEXT_INDENT: mText->mTextIndent = aValue; break; - case PROP_LINE_HEIGHT: mText->mLineHeight = aValue; break; - case PROP_WHITE_SPACE: mText->mWhiteSpace = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSMargin - case PROP_MARGIN_TOP: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mMargin) { - mMargin->mMargin = new nsCSSRect(); - } - if (nsnull != mMargin->mMargin) { - switch (aProperty) { - case PROP_MARGIN_TOP: mMargin->mMargin->mTop = aValue; break; - case PROP_MARGIN_RIGHT: mMargin->mMargin->mRight = aValue; break; - case PROP_MARGIN_BOTTOM: mMargin->mMargin->mBottom = aValue; break; - case PROP_MARGIN_LEFT: mMargin->mMargin->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_PADDING_TOP: - case PROP_PADDING_RIGHT: - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mPadding) { - mMargin->mPadding = new nsCSSRect(); - } - if (nsnull != mMargin->mPadding) { - switch (aProperty) { - case PROP_PADDING_TOP: mMargin->mPadding->mTop = aValue; break; - case PROP_PADDING_RIGHT: mMargin->mPadding->mRight = aValue; break; - case PROP_PADDING_BOTTOM: mMargin->mPadding->mBottom = aValue; break; - case PROP_PADDING_LEFT: mMargin->mPadding->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mBorder) { - mMargin->mBorder = new nsCSSRect(); - } - if (nsnull != mMargin->mBorder) { - switch (aProperty) { - case PROP_BORDER_TOP_WIDTH: mMargin->mBorder->mTop = aValue; break; - case PROP_BORDER_RIGHT_WIDTH: mMargin->mBorder->mRight = aValue; break; - case PROP_BORDER_BOTTOM_WIDTH: mMargin->mBorder->mBottom = aValue; break; - case PROP_BORDER_LEFT_WIDTH: mMargin->mBorder->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mColor) { - mMargin->mColor = new nsCSSRect(); - } - if (nsnull != mMargin->mColor) { - switch (aProperty) { - case PROP_BORDER_TOP_COLOR: mMargin->mColor->mTop = aValue; break; - case PROP_BORDER_RIGHT_COLOR: mMargin->mColor->mRight = aValue; break; - case PROP_BORDER_BOTTOM_COLOR: mMargin->mColor->mBottom = aValue; break; - case PROP_BORDER_LEFT_COLOR: mMargin->mColor->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - if (nsnull == mMargin) { - mMargin = new nsCSSMargin(); - } - if (nsnull != mMargin) { - if (nsnull == mMargin->mStyle) { - mMargin->mStyle = new nsCSSRect(); - } - if (nsnull != mMargin->mStyle) { - switch (aProperty) { - case PROP_BORDER_TOP_STYLE: mMargin->mStyle->mTop = aValue; break; - case PROP_BORDER_RIGHT_STYLE: mMargin->mStyle->mRight = aValue; break; - case PROP_BORDER_BOTTOM_STYLE: mMargin->mStyle->mBottom = aValue; break; - case PROP_BORDER_LEFT_STYLE: mMargin->mStyle->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSPosition - case PROP_POSITION: - case PROP_WIDTH: - case PROP_HEIGHT: - case PROP_LEFT: - case PROP_TOP: - case PROP_OVERFLOW: - case PROP_Z_INDEX: - case PROP_VISIBILITY: - case PROP_FILTER: - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - if (nsnull != mPosition) { - switch (aProperty) { - case PROP_POSITION: mPosition->mPosition = aValue; break; - case PROP_WIDTH: mPosition->mWidth = aValue; break; - case PROP_HEIGHT: mPosition->mHeight = aValue; break; - case PROP_LEFT: mPosition->mLeft = aValue; break; - case PROP_TOP: mPosition->mTop = aValue; break; - case PROP_OVERFLOW: mPosition->mOverflow = aValue; break; - case PROP_Z_INDEX: mPosition->mZIndex = aValue; break; - case PROP_VISIBILITY: mPosition->mVisibility = aValue; break; - case PROP_FILTER: mPosition->mFilter = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_CLIP_TOP: - case PROP_CLIP_RIGHT: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - if (nsnull == mPosition) { - mPosition = new nsCSSPosition(); - } - if (nsnull != mPosition) { - if (nsnull == mPosition->mClip) { - mPosition->mClip = new nsCSSRect(); - } - if (nsnull != mPosition->mClip) { - switch(aProperty) { - case PROP_CLIP_TOP: mPosition->mClip->mTop = aValue; break; - case PROP_CLIP_RIGHT: mPosition->mClip->mRight = aValue; break; - case PROP_CLIP_BOTTOM: mPosition->mClip->mBottom = aValue; break; - case PROP_CLIP_LEFT: mPosition->mClip->mLeft = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSList - case PROP_LIST_STYLE_TYPE: - case PROP_LIST_STYLE_IMAGE: - case PROP_LIST_STYLE_POSITION: - if (nsnull == mList) { - mList = new nsCSSList(); - } - if (nsnull != mList) { - switch (aProperty) { - case PROP_LIST_STYLE_TYPE: mList->mType = aValue; break; - case PROP_LIST_STYLE_IMAGE: mList->mImage = aValue; break; - case PROP_LIST_STYLE_POSITION: mList->mPosition = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - // nsCSSDisplay - case PROP_FLOAT: - case PROP_CLEAR: - case PROP_DISPLAY: - case PROP_DIRECTION: - if (nsnull == mDisplay) { - mDisplay = new nsCSSDisplay(); - } - if (nsnull != mDisplay) { - switch (aProperty) { - case PROP_FLOAT: mDisplay->mFloat = aValue; break; - case PROP_CLEAR: mDisplay->mClear = aValue; break; - case PROP_DISPLAY: mDisplay->mDisplay = aValue; break; - case PROP_DIRECTION: mDisplay->mDirection = aValue; break; - } - } - else { - result = NS_ERROR_OUT_OF_MEMORY; - } - break; - - case PROP_BACKGROUND: - case PROP_BORDER: - case PROP_CLIP: - case PROP_FONT: - case PROP_LIST_STYLE: - case PROP_MARGIN: - case PROP_PADDING: - case PROP_BACKGROUND_POSITION: - case PROP_BORDER_TOP: - case PROP_BORDER_RIGHT: - case PROP_BORDER_BOTTOM: - case PROP_BORDER_LEFT: - case PROP_BORDER_COLOR: - case PROP_BORDER_STYLE: - case PROP_BORDER_WIDTH: - NS_ERROR("can't query for shorthand properties"); - default: - result = NS_ERROR_ILLEGAL_VALUE; - break; - } - return result; -} - -nsresult CSSDeclarationImpl::GetValue(const char* aProperty, nsCSSValue& aValue) -{ - return GetValue(nsCSSProps::LookupName(aProperty), aValue); -} - -nsresult CSSDeclarationImpl::GetValue(PRInt32 aProperty, nsCSSValue& aValue) -{ - nsresult result = NS_OK; - - switch (aProperty) { - // nsCSSFont - case PROP_FONT_FAMILY: - case PROP_FONT_STYLE: - case PROP_FONT_VARIANT: - case PROP_FONT_WEIGHT: - case PROP_FONT_SIZE: - if (nsnull != mFont) { - switch (aProperty) { - case PROP_FONT_FAMILY: aValue = mFont->mFamily; break; - case PROP_FONT_STYLE: aValue = mFont->mStyle; break; - case PROP_FONT_VARIANT: aValue = mFont->mVariant; break; - case PROP_FONT_WEIGHT: aValue = mFont->mWeight; break; - case PROP_FONT_SIZE: aValue = mFont->mSize; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSColor - case PROP_COLOR: - case PROP_BACKGROUND_COLOR: - case PROP_BACKGROUND_IMAGE: - case PROP_BACKGROUND_REPEAT: - case PROP_BACKGROUND_ATTACHMENT: - case PROP_BACKGROUND_X_POSITION: - case PROP_BACKGROUND_Y_POSITION: - case PROP_BACKGROUND_FILTER: - case PROP_CURSOR: - case PROP_CURSOR_IMAGE: - if (nsnull != mColor) { - switch (aProperty) { - case PROP_COLOR: aValue = mColor->mColor; break; - case PROP_BACKGROUND_COLOR: aValue = mColor->mBackColor; break; - case PROP_BACKGROUND_IMAGE: aValue = mColor->mBackImage; break; - case PROP_BACKGROUND_REPEAT: aValue = mColor->mBackRepeat; break; - case PROP_BACKGROUND_ATTACHMENT: aValue = mColor->mBackAttachment; break; - case PROP_BACKGROUND_X_POSITION: aValue = mColor->mBackPositionX; break; - case PROP_BACKGROUND_Y_POSITION: aValue = mColor->mBackPositionY; break; - case PROP_BACKGROUND_FILTER: aValue = mColor->mBackFilter; break; - case PROP_CURSOR: aValue = mColor->mCursor; break; - case PROP_CURSOR_IMAGE: aValue = mColor->mCursorImage; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSText - case PROP_WORD_SPACING: - case PROP_LETTER_SPACING: - case PROP_TEXT_DECORATION: - case PROP_VERTICAL_ALIGN: - case PROP_TEXT_TRANSFORM: - case PROP_TEXT_ALIGN: - case PROP_TEXT_INDENT: - case PROP_LINE_HEIGHT: - case PROP_WHITE_SPACE: - if (nsnull != mText) { - switch (aProperty) { - case PROP_WORD_SPACING: aValue = mText->mWordSpacing; break; - case PROP_LETTER_SPACING: aValue = mText->mLetterSpacing; break; - case PROP_TEXT_DECORATION: aValue = mText->mDecoration; break; - case PROP_VERTICAL_ALIGN: aValue = mText->mVerticalAlign; break; - case PROP_TEXT_TRANSFORM: aValue = mText->mTextTransform; break; - case PROP_TEXT_ALIGN: aValue = mText->mTextAlign; break; - case PROP_TEXT_INDENT: aValue = mText->mTextIndent; break; - case PROP_LINE_HEIGHT: aValue = mText->mLineHeight; break; - case PROP_WHITE_SPACE: aValue = mText->mWhiteSpace; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSMargin - case PROP_MARGIN_TOP: - case PROP_MARGIN_RIGHT: - case PROP_MARGIN_BOTTOM: - case PROP_MARGIN_LEFT: - if ((nsnull != mMargin) && (nsnull != mMargin->mMargin)) { - switch (aProperty) { - case PROP_MARGIN_TOP: aValue = mMargin->mMargin->mTop; break; - case PROP_MARGIN_RIGHT: aValue = mMargin->mMargin->mRight; break; - case PROP_MARGIN_BOTTOM: aValue = mMargin->mMargin->mBottom; break; - case PROP_MARGIN_LEFT: aValue = mMargin->mMargin->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_PADDING_TOP: - case PROP_PADDING_RIGHT: - case PROP_PADDING_BOTTOM: - case PROP_PADDING_LEFT: - if ((nsnull != mMargin) && (nsnull != mMargin->mPadding)) { - switch (aProperty) { - case PROP_PADDING_TOP: aValue = mMargin->mPadding->mTop; break; - case PROP_PADDING_RIGHT: aValue = mMargin->mPadding->mRight; break; - case PROP_PADDING_BOTTOM: aValue = mMargin->mPadding->mBottom; break; - case PROP_PADDING_LEFT: aValue = mMargin->mPadding->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_WIDTH: - case PROP_BORDER_RIGHT_WIDTH: - case PROP_BORDER_BOTTOM_WIDTH: - case PROP_BORDER_LEFT_WIDTH: - if ((nsnull != mMargin) && (nsnull != mMargin->mBorder)) { - switch (aProperty) { - case PROP_BORDER_TOP_WIDTH: aValue = mMargin->mBorder->mTop; break; - case PROP_BORDER_RIGHT_WIDTH: aValue = mMargin->mBorder->mRight; break; - case PROP_BORDER_BOTTOM_WIDTH: aValue = mMargin->mBorder->mBottom; break; - case PROP_BORDER_LEFT_WIDTH: aValue = mMargin->mBorder->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_COLOR: - case PROP_BORDER_RIGHT_COLOR: - case PROP_BORDER_BOTTOM_COLOR: - case PROP_BORDER_LEFT_COLOR: - if ((nsnull != mMargin) && (nsnull != mMargin->mColor)) { - switch (aProperty) { - case PROP_BORDER_TOP_COLOR: aValue = mMargin->mColor->mTop; break; - case PROP_BORDER_RIGHT_COLOR: aValue = mMargin->mColor->mRight; break; - case PROP_BORDER_BOTTOM_COLOR: aValue = mMargin->mColor->mBottom; break; - case PROP_BORDER_LEFT_COLOR: aValue = mMargin->mColor->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BORDER_TOP_STYLE: - case PROP_BORDER_RIGHT_STYLE: - case PROP_BORDER_BOTTOM_STYLE: - case PROP_BORDER_LEFT_STYLE: - if ((nsnull != mMargin) && (nsnull != mMargin->mStyle)) { - switch (aProperty) { - case PROP_BORDER_TOP_STYLE: aValue = mMargin->mStyle->mTop; break; - case PROP_BORDER_RIGHT_STYLE: aValue = mMargin->mStyle->mRight; break; - case PROP_BORDER_BOTTOM_STYLE: aValue = mMargin->mStyle->mBottom; break; - case PROP_BORDER_LEFT_STYLE: aValue = mMargin->mStyle->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSPosition - case PROP_POSITION: - case PROP_WIDTH: - case PROP_HEIGHT: - case PROP_LEFT: - case PROP_TOP: - case PROP_OVERFLOW: - case PROP_Z_INDEX: - case PROP_VISIBILITY: - case PROP_FILTER: - if (nsnull != mPosition) { - switch (aProperty) { - case PROP_POSITION: aValue = mPosition->mPosition; break; - case PROP_WIDTH: aValue = mPosition->mWidth; break; - case PROP_HEIGHT: aValue = mPosition->mHeight; break; - case PROP_LEFT: aValue = mPosition->mLeft; break; - case PROP_TOP: aValue = mPosition->mTop; break; - case PROP_OVERFLOW: aValue = mPosition->mOverflow; break; - case PROP_Z_INDEX: aValue = mPosition->mZIndex; break; - case PROP_VISIBILITY: aValue = mPosition->mVisibility; break; - case PROP_FILTER: aValue = mPosition->mFilter; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_CLIP_TOP: - case PROP_CLIP_RIGHT: - case PROP_CLIP_BOTTOM: - case PROP_CLIP_LEFT: - if ((nsnull != mPosition) && (nsnull != mPosition->mClip)) { - switch(aProperty) { - case PROP_CLIP_TOP: aValue = mPosition->mClip->mTop; break; - case PROP_CLIP_RIGHT: aValue = mPosition->mClip->mRight; break; - case PROP_CLIP_BOTTOM: aValue = mPosition->mClip->mBottom; break; - case PROP_CLIP_LEFT: aValue = mPosition->mClip->mLeft; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSList - case PROP_LIST_STYLE_TYPE: - case PROP_LIST_STYLE_IMAGE: - case PROP_LIST_STYLE_POSITION: - if (nsnull != mList) { - switch (aProperty) { - case PROP_LIST_STYLE_TYPE: aValue = mList->mType; break; - case PROP_LIST_STYLE_IMAGE: aValue = mList->mImage; break; - case PROP_LIST_STYLE_POSITION: aValue = mList->mPosition; break; - } - } - else { - aValue.Reset(); - } - break; - - // nsCSSDisplay - case PROP_FLOAT: - case PROP_CLEAR: - case PROP_DISPLAY: - case PROP_DIRECTION: - if (nsnull != mDisplay) { - switch (aProperty) { - case PROP_FLOAT: aValue = mDisplay->mFloat; break; - case PROP_CLEAR: aValue = mDisplay->mClear; break; - case PROP_DISPLAY: aValue = mDisplay->mDisplay; break; - case PROP_DIRECTION: aValue = mDisplay->mDirection; break; - } - } - else { - aValue.Reset(); - } - break; - - case PROP_BACKGROUND: - case PROP_BORDER: - case PROP_CLIP: - case PROP_FONT: - case PROP_LIST_STYLE: - case PROP_MARGIN: - case PROP_PADDING: - case PROP_BACKGROUND_POSITION: - case PROP_BORDER_TOP: - case PROP_BORDER_RIGHT: - case PROP_BORDER_BOTTOM: - case PROP_BORDER_LEFT: - case PROP_BORDER_COLOR: - case PROP_BORDER_STYLE: - case PROP_BORDER_WIDTH: - NS_ERROR("can't query for shorthand properties"); - default: - result = NS_ERROR_ILLEGAL_VALUE; - break; - } - return result; -} - -void CSSDeclarationImpl::List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("{ ", out); - - if (nsnull != mFont) { - mFont->List(out); - } - if (nsnull != mColor) { - mColor->List(out); - } - if (nsnull != mText) { - mText->List(out); - } - if (nsnull != mMargin) { - mMargin->List(out); - } - if (nsnull != mPosition) { - mPosition->List(out); - } - if (nsnull != mList) { - mList->List(out); - } - if (nsnull != mDisplay) { - mDisplay->List(out); - } - - fputs("}", out); -} - -NS_HTML nsresult - NS_NewCSSDeclaration(nsICSSDeclaration** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSDeclarationImpl *it = new CSSDeclarationImpl(); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSDeclarationIID, (void **) aInstancePtrResult); -} - - -/* -font -=========== -font-family: string (list) -font-style: enum -font-variant: enum (ie: small caps) -font-weight: enum -font-size: abs, pct, enum, +-1 - - -color/background -============= -color: color -background-color: color -background-image: url(string) -background-repeat: enum -background-attachment: enum -background-position-x -y: abs, pct, enum (left/top center right/bottom (pct?)) -cursor: enum -cursor-image: url(string) - - -text -======= -word-spacing: abs, "normal" -letter-spacing: abs, "normal" -text-decoration: enum -vertical-align: enum, pct -text-transform: enum -text-align: enum -text-indent: abs, pct -line-height: "normal", abs, pct, number-factor -white-space: enum - -margin -======= -margin-top -right -bottom -left: "auto", abs, pct -padding-top -right -bottom -left: abs, pct -border-top -right -bottom -left-width: enum, abs -border-top -right -bottom -left-color: color -border-top -right -bottom -left-style: enum - -size -======= -position: enum -width: abs, pct, "auto" -height: abs, pct, "auto" -left: abs, pct, "auto" -top: abs, pct, "auto" -clip: shape, "auto" (shape: rect - abs, auto) -overflow: enum -z-index: int, auto -visibity: enum - -display -======= -float: enum -clear: enum -direction: enum -display: enum - -filter: string - -list -======== -list-style-type: enum -list-style-image: url, "none" -list-style-position: enum (bool? in/out) - -*/ - - - diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp deleted file mode 100644 index 6bb42cd4013..00000000000 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ /dev/null @@ -1,1047 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSStyleRule.h" -#include "nsICSSDeclaration.h" -#include "nsIStyleContext.h" -#include "nsIPresContext.h" -#include "nsIArena.h" -#include "nsIAtom.h" -#include "nsCRT.h" -#include "nsString.h" -#include "nsStyleConsts.h" -#include "nsUnitConversion.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID); -static NS_DEFINE_IID(kICSSDeclarationIID, NS_ICSS_DECLARATION_IID); -static NS_DEFINE_IID(kICSSStyleRuleIID, NS_ICSS_STYLE_RULE_IID); - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); - -static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID); -static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID); -static NS_DEFINE_IID(kCSSTextSID, NS_CSS_TEXT_SID); -static NS_DEFINE_IID(kCSSMarginSID, NS_CSS_MARGIN_SID); -static NS_DEFINE_IID(kCSSPositionSID, NS_CSS_POSITION_SID); -static NS_DEFINE_IID(kCSSListSID, NS_CSS_LIST_SID); -static NS_DEFINE_IID(kCSSDisplaySID, NS_CSS_DISPLAY_SID); - - -// -- nsCSSSelector ------------------------------- - -nsCSSSelector::nsCSSSelector() - : mTag(nsnull), mID(nsnull), mClass(nsnull), mPseudoClass(nsnull), - mNext(nsnull) -{ -} - -nsCSSSelector::nsCSSSelector(nsIAtom* aTag, nsIAtom* aID, nsIAtom* aClass, nsIAtom* aPseudoClass) - : mTag(aTag), mID(aID), mClass(aClass), mPseudoClass(aPseudoClass), - mNext(nsnull) -{ - NS_IF_ADDREF(mTag); - NS_IF_ADDREF(mID); - NS_IF_ADDREF(mClass); - NS_IF_ADDREF(mPseudoClass); -} - -nsCSSSelector::nsCSSSelector(const nsCSSSelector& aCopy) - : mTag(aCopy.mTag), mID(aCopy.mID), mClass(aCopy.mClass), mPseudoClass(aCopy.mPseudoClass), - mNext(nsnull) -{ // implmented to support extension to CSS2 (when we have to copy the array) - NS_IF_ADDREF(mTag); - NS_IF_ADDREF(mID); - NS_IF_ADDREF(mClass); - NS_IF_ADDREF(mPseudoClass); -} - -nsCSSSelector::~nsCSSSelector() -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); - NS_IF_RELEASE(mPseudoClass); -} - -nsCSSSelector& nsCSSSelector::operator=(const nsCSSSelector& aCopy) -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); - NS_IF_RELEASE(mPseudoClass); - mTag = aCopy.mTag; - mID = aCopy.mID; - mClass = aCopy.mClass; - mPseudoClass = aCopy.mPseudoClass; - NS_IF_ADDREF(mTag); - NS_IF_ADDREF(mID); - NS_IF_ADDREF(mClass); - NS_IF_ADDREF(mPseudoClass); - return *this; -} - -PRBool nsCSSSelector::Equals(const nsCSSSelector* aOther) const -{ - if (nsnull != aOther) { - return (PRBool)((aOther->mTag == mTag) && (aOther->mID == mID) && - (aOther->mClass == mClass) && (aOther->mPseudoClass == mPseudoClass)); - } - return PR_FALSE; -} - - -void nsCSSSelector::Set(const nsString& aTag, const nsString& aID, - const nsString& aClass, const nsString& aPseudoClass) -{ - NS_IF_RELEASE(mTag); - NS_IF_RELEASE(mID); - NS_IF_RELEASE(mClass); - NS_IF_RELEASE(mPseudoClass); - if (0 < aTag.Length()) { - mTag = NS_NewAtom(aTag); - } - if (0 < aID.Length()) { - mID = NS_NewAtom(aID); - } - if (0 < aClass.Length()) { - mClass = NS_NewAtom(aClass); - } - if (0 < aPseudoClass.Length()) { - mPseudoClass = NS_NewAtom(aPseudoClass); - } -} - -// -- nsCSSStyleRule ------------------------------- - -class CSSStyleRuleImpl : public nsICSSStyleRule { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - CSSStyleRuleImpl(const nsCSSSelector& aSelector); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRBool Equals(const nsIStyleRule* aRule) const; - virtual PRUint32 HashValue(void) const; - - virtual nsCSSSelector* FirstSelector(void); - virtual void AddSelector(const nsCSSSelector& aSelector); - virtual void DeleteSelector(nsCSSSelector* aSelector); - - virtual nsICSSDeclaration* GetDeclaration(void) const; - virtual void SetDeclaration(nsICSSDeclaration* aDeclaration); - - virtual PRInt32 GetWeight(void) const; - virtual void SetWeight(PRInt32 aWeight); - - virtual nscoord CalcLength(const nsCSSValue& aValue, nsStyleFont* aFont, - nsIPresContext* aPresContext); - virtual void MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext); - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - // These are not supported and are not implemented! - CSSStyleRuleImpl(const CSSStyleRuleImpl& aCopy); - CSSStyleRuleImpl& operator=(const CSSStyleRuleImpl& aCopy); - -protected: - virtual ~CSSStyleRuleImpl(); - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsCSSSelector mSelector; - nsICSSDeclaration* mDeclaration; - PRInt32 mWeight; -#ifdef DEBUG_REFS - PRInt32 mInstance; -#endif -}; - - -void* CSSStyleRuleImpl::operator new(size_t size) -{ - CSSStyleRuleImpl* rv = (CSSStyleRuleImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* CSSStyleRuleImpl::operator new(size_t size, nsIArena* aArena) -{ - CSSStyleRuleImpl* rv = (CSSStyleRuleImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void CSSStyleRuleImpl::operator delete(void* ptr) -{ - CSSStyleRuleImpl* rule = (CSSStyleRuleImpl*) ptr; - if (nsnull != rule) { - if (rule->mInHeap) { - ::delete ptr; - } - } -} - - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -static const PRInt32 kInstrument = 1075; -#endif - -CSSStyleRuleImpl::CSSStyleRuleImpl(const nsCSSSelector& aSelector) - : mSelector(aSelector), mDeclaration(nsnull), mWeight(0) -{ - NS_INIT_REFCNT(); -#ifdef DEBUG_REFS - mInstance = gInstanceCount++; - fprintf(stdout, "%d of %d + CSSStyleRule\n", mInstance, gInstanceCount); -#endif -} - -CSSStyleRuleImpl::~CSSStyleRuleImpl() -{ - nsCSSSelector* next = mSelector.mNext; - - while (nsnull != next) { - nsCSSSelector* selector = next; - next = selector->mNext; - delete selector; - } - NS_IF_RELEASE(mDeclaration); -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d of %d - CSSStyleRule\n", mInstance, gInstanceCount); -#endif -} - -#ifdef DEBUG_REFS -nsrefcnt CSSStyleRuleImpl::AddRef(void) -{ - if (mInstance == kInstrument) { - fprintf(stdout, "%d AddRef CSSStyleRule\n", mRefCnt + 1); - } - return ++mRefCnt; -} - -nsrefcnt CSSStyleRuleImpl::Release(void) -{ - if (mInstance == kInstrument) { - fprintf(stdout, "%d Release CSSStyleRule\n", mRefCnt - 1); - } - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} -#else -NS_IMPL_ADDREF(CSSStyleRuleImpl) -NS_IMPL_RELEASE(CSSStyleRuleImpl) -#endif - -nsresult CSSStyleRuleImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kICSSStyleRuleIID)) { - *aInstancePtrResult = (void*) ((nsICSSStyleRule*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleRuleIID)) { - *aInstancePtrResult = (void*) ((nsIStyleRule*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - - -PRBool CSSStyleRuleImpl::Equals(const nsIStyleRule* aRule) const -{ - nsICSSStyleRule* iCSSRule; - - if (this == aRule) { - return PR_TRUE; - } - - if ((nsnull != aRule) && - (NS_OK == ((nsIStyleRule*)aRule)->QueryInterface(kICSSStyleRuleIID, (void**) &iCSSRule))) { - - CSSStyleRuleImpl* rule = (CSSStyleRuleImpl*)iCSSRule; - const nsCSSSelector* local = &mSelector; - const nsCSSSelector* other = &(rule->mSelector); - PRBool result = PR_TRUE; - - while ((PR_TRUE == result) && (nsnull != local) && (nsnull != other)) { - if (! local->Equals(other)) { - result = PR_FALSE; - } - local = local->mNext; - other = other->mNext; - } - if ((nsnull != local) || (nsnull != other)) { // more were left - result = PR_FALSE; - } - if ((rule->mDeclaration != mDeclaration) || - (rule->mWeight != mWeight)) { - result = PR_FALSE; - } - NS_RELEASE(iCSSRule); - return result; - } - return PR_FALSE; -} - -PRUint32 CSSStyleRuleImpl::HashValue(void) const -{ - return (PRUint32)this; -} - -nsCSSSelector* CSSStyleRuleImpl::FirstSelector(void) -{ - return &mSelector; -} - -void CSSStyleRuleImpl::AddSelector(const nsCSSSelector& aSelector) -{ - nsCSSSelector* selector = new nsCSSSelector(aSelector); - nsCSSSelector* last = &mSelector; - - while (nsnull != last->mNext) { - last = last->mNext; - } - last->mNext = selector; -} - - -void CSSStyleRuleImpl::DeleteSelector(nsCSSSelector* aSelector) -{ - if (nsnull != aSelector) { - if (&mSelector == aSelector) { // handle first selector - mSelector = *aSelector; // assign value - mSelector.mNext = aSelector->mNext; - delete aSelector; - } - else { - nsCSSSelector* selector = &mSelector; - - while (nsnull != selector->mNext) { - if (aSelector == selector->mNext) { - selector->mNext = aSelector->mNext; - delete aSelector; - return; - } - selector = selector->mNext; - } - } - } -} - -nsICSSDeclaration* CSSStyleRuleImpl::GetDeclaration(void) const -{ - NS_IF_ADDREF(mDeclaration); - return mDeclaration; -} - -void CSSStyleRuleImpl::SetDeclaration(nsICSSDeclaration* aDeclaration) -{ - NS_IF_RELEASE(mDeclaration); - mDeclaration = aDeclaration; - NS_IF_ADDREF(mDeclaration); -} - -PRInt32 CSSStyleRuleImpl::GetWeight(void) const -{ - return mWeight; -} - -void CSSStyleRuleImpl::SetWeight(PRInt32 aWeight) -{ - mWeight = aWeight; -} - -nscoord CSSStyleRuleImpl::CalcLength(const nsCSSValue& aValue, - nsStyleFont* aFont, - nsIPresContext* aPresContext) -{ - NS_ASSERTION(aValue.IsLengthUnit(), "not a length unit"); - if (aValue.IsFixedLengthUnit()) { - return aValue.GetLengthTwips(); - } - nsCSSUnit unit = aValue.GetUnit(); - switch (unit) { - case eCSSUnit_EM: - return aFont->mFont.size; - case eCSSUnit_EN: - return (aFont->mFont.size / 2); - case eCSSUnit_XHeight: - NS_NOTYETIMPLEMENTED("x height unit"); - return ((aFont->mFont.size / 3) * 2); // XXX HACK! - case eCSSUnit_CapHeight: - NS_NOTYETIMPLEMENTED("cap height unit"); - return ((aFont->mFont.size / 3) * 2); // XXX HACK! - - case eCSSUnit_Pixel: - return (nscoord)(aPresContext->GetPixelsToTwips() * aValue.GetFloatValue()); - } - return 0; -} - -void CSSStyleRuleImpl::MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) -{ - if (nsnull != mDeclaration) { - nsStyleFont* font = (nsStyleFont*)aContext->GetData(kStyleFontSID); - - nsCSSFont* ourFont; - if (NS_OK == mDeclaration->GetData(kCSSFontSID, (nsCSSStruct**)&ourFont)) { - if (nsnull != ourFont) { - nsStyleFont* parentFont = font; - nsIStyleContext* parentContext = aContext->GetParent(); - if (nsnull != parentContext) { - parentFont = (nsStyleFont*)parentContext->GetData(kStyleFontSID); - } - - // font-family: string list - if (ourFont->mFamily.GetUnit() == eCSSUnit_String) { - nsAutoString familyList; - ourFont->mFamily.GetStringValue(familyList); - // XXX meeds font support to determine usable fonts - // parse up the CSS string & remove the quotes - // XXX only does first until we can tell what are installed fonts - nsAutoString family; - PRInt32 index = familyList.Find(PRUnichar(',')); - if (-1 < index) { - familyList.Left(family, index); - } - else { - family.Append(familyList); - } - family.StripChars("\""); - family.StripWhitespace(); - - font->mFont.name = family; - } - - // font-style: enum - if (ourFont->mStyle.GetUnit() == eCSSUnit_Enumerated) { - font->mFont.style = ourFont->mStyle.GetIntValue(); - } - - // font-variant: enum - if (ourFont->mVariant.GetUnit() == eCSSUnit_Enumerated) { - font->mFont.variant = ourFont->mVariant.GetIntValue(); - } - - // font-weight: abs, enum - if (ourFont->mWeight.GetUnit() == eCSSUnit_Absolute) { - font->mFont.style = ourFont->mWeight.GetIntValue(); - } - else if (ourFont->mWeight.GetUnit() == eCSSUnit_Enumerated) { - PRInt32 value = ourFont->mWeight.GetIntValue(); - switch (value) { - case NS_STYLE_FONT_WEIGHT_NORMAL: - case NS_STYLE_FONT_WEIGHT_BOLD: - font->mFont.weight = value; - break; - case NS_STYLE_FONT_WEIGHT_BOLDER: - case NS_STYLE_FONT_WEIGHT_LIGHTER: - font->mFont.weight = (parentFont->mFont.weight + value); - break; - } - } - - // font-size: enum, length, percent - if (ourFont->mSize.GetUnit() == eCSSUnit_Enumerated) { - static float kFontScale[7] = { - 0.5f, // xx-small - 0.666667f, // x-small - 0.833333f, // small - 1.0f, // medium - 1.5f, // large - 1.5f * 1.5f, // x-large - 1.5f * 1.5f * 1.5f, // xx-large - }; - PRInt32 value = ourFont->mSize.GetIntValue(); - - const nsFont& normal = aPresContext->GetDefaultFont(); // use normal font or body font?? - if ((NS_STYLE_FONT_SIZE_XXSMALL <= value) && - (value <= NS_STYLE_FONT_SIZE_XXLARGE)) { - font->mFont.size = (nscoord)((float)normal.size * kFontScale[value]); - } - else if (NS_STYLE_FONT_SIZE_LARGER == value) { - PRInt32 index; - for (index = NS_STYLE_FONT_SIZE_XXSMALL; - index < NS_STYLE_FONT_SIZE_XXLARGE; index++) - if (parentFont->mFont.size < (nscoord)((float)normal.size * kFontScale[index])) - break; - font->mFont.size = (nscoord)((float)normal.size * kFontScale[index]); - } - else if (NS_STYLE_FONT_SIZE_SMALLER == value) { - PRInt32 index; - for (index = NS_STYLE_FONT_SIZE_XXLARGE; - index > NS_STYLE_FONT_SIZE_XXSMALL; index--) - if (parentFont->mFont.size > (nscoord)((float)normal.size * kFontScale[index])) - break; - font->mFont.size = (nscoord)((float)normal.size * kFontScale[index]); - } - } - else if (ourFont->mSize.IsLengthUnit()) { - font->mFont.size = CalcLength(ourFont->mSize, parentFont, aPresContext); - } - else if (ourFont->mSize.GetUnit() == eCSSUnit_Percent) { - font->mFont.size = (nscoord)((float)(parentFont->mFont.size) * ourFont->mSize.GetFloatValue()); - } - - NS_IF_RELEASE(parentContext); - } - } - - nsCSSText* ourText; - if (NS_OK == mDeclaration->GetData(kCSSTextSID, (nsCSSStruct**)&ourText)) { - if (nsnull != ourText) { - // Get our text style and our parent's text style - nsStyleText* text = (nsStyleText*) aContext->GetData(kStyleTextSID); - - // letter-spacing - if (ourText->mLetterSpacing.IsLengthUnit()) { - text->mLetterSpacing.Set(CalcLength(ourText->mLetterSpacing, - font, aPresContext)); - } - else if (ourText->mLetterSpacing.GetUnit() == eCSSUnit_Enumerated) { - text->mLetterSpacing.SetAuto(); - } - - // line-height - if (ourText->mLineHeight.IsLengthUnit()) { - text->mLineHeight.Set(CalcLength(ourText->mLineHeight, - font, aPresContext)); - } - else if (ourText->mLineHeight.GetUnit() == eCSSUnit_Enumerated) { - text->mLineHeight.SetAuto(); - } - else if (ourText->mLineHeight.GetUnit() == eCSSUnit_Percent) { - text->mLineHeight.Set(ourText->mLineHeight.GetFloatValue()); - } - - // text-align - if (ourText->mTextAlign.GetUnit() == eCSSUnit_Enumerated) { - text->mTextAlign = ourText->mTextAlign.GetIntValue(); - } - - // text-indent - if (ourText->mTextIndent.IsLengthUnit()) { - text->mTextIndent.Set(CalcLength(ourText->mTextIndent, - font, aPresContext)); - } - else if (ourText->mTextIndent.GetUnit() == eCSSUnit_Percent) { - text->mTextIndent.Set(ourText->mTextIndent.GetFloatValue()); - } - - // text-decoration: enum, absolute (bit field) - if ((ourText->mDecoration.GetUnit() == eCSSUnit_Enumerated) || - (ourText->mDecoration.GetUnit() == eCSSUnit_Absolute)) { - PRInt32 td = ourText->mDecoration.GetIntValue(); - font->mFont.decorations = td; - text->mTextDecoration = td; - } - - // text-transform - if (ourText->mTextTransform.GetUnit() == eCSSUnit_Enumerated) { - text->mTextTransform = ourText->mTextTransform.GetIntValue(); - } - - // vertical-align - if (ourText->mVerticalAlign.IsLengthUnit()) { - text->mVerticalAlign.Set(CalcLength(ourText->mVerticalAlign, - font, aPresContext)); - } - else if (ourText->mVerticalAlign.GetUnit() == eCSSUnit_Enumerated) { - text->mVerticalAlign.Set(ourText->mVerticalAlign.GetIntValue(), eStyleUnit_Enumerated); - } - else if (ourText->mVerticalAlign.GetUnit() == eCSSUnit_Percent) { - text->mVerticalAlign.Set(ourText->mVerticalAlign.GetFloatValue()); - } - - // white-space - if (ourText->mWhiteSpace.GetUnit() == eCSSUnit_Enumerated) { - text->mWhiteSpace = ourText->mWhiteSpace.GetIntValue(); - } - - // word-spacing - if (ourText->mWordSpacing.IsLengthUnit()) { - text->mWordSpacing.Set(CalcLength(ourText->mWordSpacing, - font, aPresContext)); - } - else if (ourText->mWordSpacing.GetUnit() == eCSSUnit_Enumerated) { - text->mWordSpacing.SetAuto(); - } - } - } - - nsCSSDisplay* ourDisplay; - if (NS_OK == mDeclaration->GetData(kCSSDisplaySID, (nsCSSStruct**)&ourDisplay)) { - if (nsnull != ourDisplay) { - // Get our style and our parent's style - nsStyleDisplay* display = (nsStyleDisplay*) - aContext->GetData(kStyleDisplaySID); - - // display - display->mDisplay = NS_STYLE_DISPLAY_INLINE; - if (ourDisplay->mDisplay.GetUnit() == eCSSUnit_Enumerated) { - display->mDisplay = ourDisplay->mDisplay.GetIntValue(); - } - - // direction: enum - display->mDirection = NS_STYLE_DIRECTION_LTR; - if (ourDisplay->mDirection.GetUnit() == eCSSUnit_Enumerated) { - display->mDirection = ourDisplay->mDirection.GetIntValue(); - } - - // clear: enum - if (ourDisplay->mClear.GetUnit() == eCSSUnit_Enumerated) { - display->mBreakType = ourDisplay->mClear.GetIntValue(); - } - - // float: enum - if (ourDisplay->mFloat.GetUnit() == eCSSUnit_Enumerated) { - display->mFloats = ourDisplay->mFloat.GetIntValue(); - } - } - } - - - nsCSSColor* ourColor; - if (NS_OK == mDeclaration->GetData(kCSSColorSID, (nsCSSStruct**)&ourColor)) { - if (nsnull != ourColor) { - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - - // color: color - if (ourColor->mColor.GetUnit() == eCSSUnit_Color) { - color->mColor = ourColor->mColor.GetColorValue(); - } - - // cursor: enum - if (ourColor->mCursor.GetUnit() == eCSSUnit_Enumerated) { - color->mCursor = ourColor->mCursor.GetIntValue(); - } - - // cursor-image: string - if (ourColor->mCursorImage.GetUnit() == eCSSUnit_String) { - ourColor->mCursorImage.GetStringValue(color->mCursorImage); - } - - // background-color: color, enum (flags) - if (ourColor->mBackColor.GetUnit() == eCSSUnit_Color) { - color->mBackgroundColor = ourColor->mBackColor.GetColorValue(); - color->mBackgroundFlags &= ~NS_STYLE_BG_COLOR_TRANSPARENT; - } - else if (ourColor->mBackColor.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundFlags |= NS_STYLE_BG_COLOR_TRANSPARENT; - } - - // background-image: string, enum (flags) - if (ourColor->mBackImage.GetUnit() == eCSSUnit_String) { - ourColor->mBackImage.GetStringValue(color->mBackgroundImage); - color->mBackgroundFlags &= ~NS_STYLE_BG_IMAGE_NONE; - } - else if (ourColor->mBackImage.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundFlags |= NS_STYLE_BG_IMAGE_NONE; - } - - // background-repeat: enum - if (ourColor->mBackRepeat.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundRepeat = ourColor->mBackRepeat.GetIntValue(); - } - - // background-attachment: enum - if (ourColor->mBackAttachment.GetUnit() == eCSSUnit_Enumerated) { - color->mBackgroundAttachment = ourColor->mBackAttachment.GetIntValue(); - } - - // background-position: length, percent (flags) - if (ourColor->mBackPositionX.GetUnit() == eCSSUnit_Percent) { - color->mBackgroundXPosition = (nscoord)(TWIPS_CONST_FLOAT * ourColor->mBackPositionX.GetFloatValue()); - color->mBackgroundFlags |= NS_STYLE_BG_X_POSITION_PERCENT; - color->mBackgroundFlags &= ~NS_STYLE_BG_X_POSITION_LENGTH; - } - else if (ourColor->mBackPositionX.IsLengthUnit()) { - color->mBackgroundXPosition = CalcLength(ourColor->mBackPositionX, - font, aPresContext); - color->mBackgroundFlags |= NS_STYLE_BG_X_POSITION_LENGTH; - color->mBackgroundFlags &= ~NS_STYLE_BG_X_POSITION_PERCENT; - } - if (ourColor->mBackPositionY.GetUnit() == eCSSUnit_Percent) { - color->mBackgroundYPosition = (nscoord)(TWIPS_CONST_FLOAT * ourColor->mBackPositionY.GetFloatValue()); - color->mBackgroundFlags |= NS_STYLE_BG_Y_POSITION_PERCENT; - color->mBackgroundFlags &= ~NS_STYLE_BG_Y_POSITION_LENGTH; - } - else if (ourColor->mBackPositionY.IsLengthUnit()) { - color->mBackgroundYPosition = CalcLength(ourColor->mBackPositionY, - font, aPresContext); - color->mBackgroundFlags |= NS_STYLE_BG_Y_POSITION_LENGTH; - color->mBackgroundFlags &= ~NS_STYLE_BG_Y_POSITION_PERCENT; - } - - // XXX: NYI nsCSSValue mBackFilter; - } - } - - nsCSSMargin* ourMargin; - if (NS_OK == mDeclaration->GetData(kCSSMarginSID, (nsCSSStruct**)&ourMargin)) { - if (nsnull != ourMargin) { - nsStyleSpacing* spacing = (nsStyleSpacing*) - aContext->GetData(kStyleSpacingSID); - nsStyleBorder* border = (nsStyleBorder*) - aContext->GetData(kStyleBorderSID); - - // margin - if (nsnull != ourMargin->mMargin) { - if (ourMargin->mMargin->mLeft.IsLengthUnit()) { - spacing->mMargin.left = CalcLength(ourMargin->mMargin->mLeft, font, aPresContext); - } else if (ourMargin->mMargin->mLeft.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.left = (nscoord)ourMargin->mMargin->mLeft.GetFloatValue(); - } - if (ourMargin->mMargin->mTop.IsLengthUnit()) { - spacing->mMargin.top = CalcLength(ourMargin->mMargin->mTop, font, aPresContext); - } else if (ourMargin->mMargin->mTop.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.top = (nscoord)ourMargin->mMargin->mTop.GetFloatValue(); - } - if (ourMargin->mMargin->mRight.IsLengthUnit()) { - spacing->mMargin.right = CalcLength(ourMargin->mMargin->mRight, font, aPresContext); - } else if (ourMargin->mMargin->mRight.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.right = (nscoord)ourMargin->mMargin->mRight.GetFloatValue(); - } - if (ourMargin->mMargin->mBottom.IsLengthUnit()) { - spacing->mMargin.bottom = CalcLength(ourMargin->mMargin->mBottom, font, aPresContext); - } else if (ourMargin->mMargin->mBottom.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mMargin.bottom = (nscoord)ourMargin->mMargin->mBottom.GetFloatValue(); - } - } - - // padding - if (nsnull != ourMargin->mPadding) { - if (ourMargin->mPadding->mLeft.IsLengthUnit()) { - spacing->mPadding.left = CalcLength(ourMargin->mPadding->mLeft, font, aPresContext); - } else if (ourMargin->mPadding->mLeft.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.left = (nscoord)ourMargin->mPadding->mLeft.GetFloatValue(); - } - if (ourMargin->mPadding->mTop.IsLengthUnit()) { - spacing->mPadding.top = CalcLength(ourMargin->mPadding->mTop, font, aPresContext); - } else if (ourMargin->mPadding->mTop.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.top = (nscoord)ourMargin->mPadding->mTop.GetFloatValue(); - } - if (ourMargin->mPadding->mRight.IsLengthUnit()) { - spacing->mPadding.right = CalcLength(ourMargin->mPadding->mRight, font, aPresContext); - } else if (ourMargin->mPadding->mRight.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.right = (nscoord)ourMargin->mPadding->mRight.GetFloatValue(); - } - if (ourMargin->mPadding->mBottom.IsLengthUnit()) { - spacing->mPadding.bottom = CalcLength(ourMargin->mPadding->mBottom, font, aPresContext); - } else if (ourMargin->mPadding->mBottom.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - spacing->mPadding.bottom = (nscoord)ourMargin->mPadding->mBottom.GetFloatValue(); - } - } - - // border-size - if (nsnull != ourMargin->mBorder) { - nsCSSRect* ourBorder = ourMargin->mBorder; - // XXX thin, thick, medium - if (ourBorder->mLeft.IsLengthUnit()) { - border->mSize.left = CalcLength(ourBorder->mLeft, font, aPresContext); - } else if (ourBorder->mLeft.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.left = (nscoord)ourBorder->mLeft.GetFloatValue(); - } - if (ourBorder->mTop.IsLengthUnit()) { - border->mSize.top = CalcLength(ourBorder->mTop, font, aPresContext); - } else if (ourBorder->mTop.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.top = (nscoord)ourBorder->mTop.GetFloatValue(); - } - if (ourBorder->mRight.IsLengthUnit()) { - border->mSize.right = CalcLength(ourBorder->mRight, font, aPresContext); - } else if (ourBorder->mRight.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.right = (nscoord)ourBorder->mRight.GetFloatValue(); - } - if (ourBorder->mBottom.IsLengthUnit()) { - border->mSize.bottom = CalcLength(ourBorder->mBottom, font, aPresContext); - } else if (ourBorder->mBottom.GetUnit() != eCSSUnit_Null) { - // XXX handle percent properly, this isn't it - border->mSize.bottom = (nscoord)ourBorder->mBottom.GetFloatValue(); - } - } - - // border-style - if (nsnull != ourMargin->mStyle) { - nsCSSRect* ourStyle = ourMargin->mStyle; - if (ourStyle->mTop.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_TOP] = ourStyle->mTop.GetIntValue(); - } - if (ourStyle->mRight.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_RIGHT] = ourStyle->mRight.GetIntValue(); - } - if (ourStyle->mBottom.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_BOTTOM] = ourStyle->mBottom.GetIntValue(); - } - if (ourStyle->mLeft.GetUnit() == eCSSUnit_Enumerated) { - border->mStyle[NS_SIDE_LEFT] = ourStyle->mLeft.GetIntValue(); - } - } - - // border-color - nsStyleColor* color = (nsStyleColor*)aContext->GetData(kStyleColorSID); - if (nsnull != ourMargin->mColor) { - nsCSSRect* ourColor = ourMargin->mColor; - if (ourColor->mTop.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_TOP] = ourColor->mTop.GetColorValue(); - } - if (ourColor->mRight.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_RIGHT] = ourColor->mRight.GetColorValue(); - } - if (ourColor->mBottom.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_BOTTOM] = ourColor->mBottom.GetColorValue(); - } - if (ourColor->mLeft.GetUnit() == eCSSUnit_Color) { - border->mColor[NS_SIDE_LEFT] = ourColor->mLeft.GetColorValue(); - } - } - } - } - - nsCSSPosition* ourPosition; - if (NS_OK == mDeclaration->GetData(kCSSPositionSID, (nsCSSStruct**)&ourPosition)) { - if (nsnull != ourPosition) { - nsStylePosition* position = (nsStylePosition*)aContext->GetData(kStylePositionSID); - - // positioning scheme - if (ourPosition->mPosition.GetUnit() == eCSSUnit_Enumerated) { - position->mPosition = ourPosition->mPosition.GetIntValue(); - } - - // overflow - if (ourPosition->mOverflow.GetUnit() == eCSSUnit_Enumerated) { - position->mOverflow = ourPosition->mOverflow.GetIntValue(); - } - - // box offsets. note: default value is auto so we don't check for it here - if (ourPosition->mLeft.IsLengthUnit()) { - position->mLeftOffset = CalcLength(ourPosition->mLeft, font, aPresContext); - position->mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mHeight.GetUnit() == eCSSUnit_Percent) { - position->mLeftOffset = (nscoord)(100 * ourPosition->mLeft.GetFloatValue()); - position->mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - if (ourPosition->mTop.IsLengthUnit()) { - position->mTopOffset = CalcLength(ourPosition->mTop, font, aPresContext); - position->mTopOffsetFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mHeight.GetUnit() == eCSSUnit_Percent) { - position->mTopOffset = (nscoord)(100 * ourPosition->mTop.GetFloatValue()); - position->mTopOffsetFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - if (ourPosition->mWidth.IsLengthUnit()) { - position->mWidth = CalcLength(ourPosition->mWidth, font, aPresContext); - position->mWidthFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mWidth.GetUnit() == eCSSUnit_Percent) { - position->mWidth = (nscoord)(100 * ourPosition->mWidth.GetFloatValue()); - position->mWidthFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - if (ourPosition->mHeight.IsLengthUnit()) { - position->mHeight = CalcLength(ourPosition->mHeight, font, aPresContext); - position->mHeightFlags = NS_STYLE_POSITION_VALUE_LENGTH; - } else if (ourPosition->mHeight.GetUnit() == eCSSUnit_Percent) { - position->mHeight = (nscoord)(100 * ourPosition->mHeight.GetFloatValue()); - position->mHeightFlags = NS_STYLE_POSITION_VALUE_PERCENT; - } - - // z-index - if (ourPosition->mZIndex.GetUnit() == eCSSUnit_Enumerated) { - position->mPosition = ourPosition->mPosition.GetIntValue(); - } else if (ourPosition->mZIndex.GetUnit() == eCSSUnit_Absolute) { - position->mZIndex = ourPosition->mZIndex.GetIntValue(); - } - - // clip property - if (nsnull != ourPosition->mClip) { - position->mClipFlags = NS_STYLE_CLIP_RECT; - - if (ourPosition->mClip->mTop.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.top = ourPosition->mClip->mTop.GetIntValue(); - } else if (ourPosition->mClip->mTop.IsLengthUnit()) { - position->mClip.top = CalcLength(ourPosition->mClip->mTop, font, aPresContext); - } - if (ourPosition->mClip->mRight.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.right = ourPosition->mClip->mRight.GetIntValue(); - } else if (ourPosition->mClip->mRight.IsLengthUnit()) { - position->mClip.right = CalcLength(ourPosition->mClip->mRight, font, aPresContext); - } - if (ourPosition->mClip->mBottom.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.bottom = ourPosition->mClip->mBottom.GetIntValue(); - } else if (ourPosition->mClip->mBottom.IsLengthUnit()) { - position->mClip.bottom = CalcLength(ourPosition->mClip->mBottom, font, aPresContext); - } - if (ourPosition->mClip->mLeft.GetUnit() == eCSSUnit_Enumerated) { - position->mClip.left = ourPosition->mClip->mLeft.GetIntValue(); - } else if (ourPosition->mClip->mLeft.IsLengthUnit()) { - position->mClip.left = CalcLength(ourPosition->mClip->mLeft, font, aPresContext); - } - } - } - } - - nsCSSList* ourList; - if (NS_OK == mDeclaration->GetData(kCSSListSID, (nsCSSStruct**)&ourList)) { - if (nsnull != ourList) { - nsStyleList* list = (nsStyleList*)aContext->GetData(kStyleListSID); - - // list-style-type: enum - if (ourList->mType.GetUnit() == eCSSUnit_Enumerated) { - list->mListStyleType = ourList->mType.GetIntValue(); - } - - if (ourList->mImage.GetUnit() == eCSSUnit_String) { - // list-style-image: string - ourList->mImage.GetStringValue(list->mListStyleImage); - } - else if (ourList->mImage.GetUnit() == eCSSUnit_Enumerated) { - // list-style-image: none - list->mListStyleImage = ""; - } - - // list-style-position: enum - if (ourList->mPosition.GetUnit() == eCSSUnit_Enumerated) { - list->mListStylePosition = ourList->mPosition.GetIntValue(); - } - } - } - } -} - - - -static void ListSelector(FILE* out, const nsCSSSelector* aSelector) -{ - nsAutoString buffer; - - if (nsnull != aSelector->mTag) { - aSelector->mTag->ToString(buffer); - fputs(buffer, out); - } - if (nsnull != aSelector->mID) { - aSelector->mID->ToString(buffer); - fputs("#", out); - fputs(buffer, out); - } - if (nsnull != aSelector->mClass) { - aSelector->mClass->ToString(buffer); - fputs(".", out); - fputs(buffer, out); - } - if (nsnull != aSelector->mPseudoClass) { - aSelector->mPseudoClass->ToString(buffer); - fputs(":", out); - fputs(buffer, out); - } -} - -void CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const -{ - // Indent - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - const nsCSSSelector* selector = &mSelector; - - while (nsnull != selector) { - ListSelector(out, selector); - fputs(" ", out); - selector = selector->mNext; - } - - nsAutoString buffer; - - buffer.Append("weight: "); - buffer.Append(mWeight, 10); - buffer.Append(" "); - fputs(buffer, out); - if (nsnull != mDeclaration) { - mDeclaration->List(out); - } - else { - fputs("{ null declaration }", out); - } - fputs("\n", out); -} - -NS_HTML nsresult - NS_NewCSSStyleRule(nsICSSStyleRule** aInstancePtrResult, const nsCSSSelector& aSelector) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSStyleRuleImpl *it = new CSSStyleRuleImpl(aSelector); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSStyleRuleIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp deleted file mode 100644 index b0fce35d38c..00000000000 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ /dev/null @@ -1,368 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsICSSStyleSheet.h" -#include "nsIArena.h" -#include "nsCRT.h" -#include "nsIAtom.h" -#include "nsIURL.h" -#include "nsISupportsArray.h" -#include "nsICSSStyleRule.h" -#include "nsIHTMLContent.h" -#include "nsIFrame.h" -#include "nsString.h" -#include "nsIPtr.h" - -//#define DEBUG_REFS - -static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID); -static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID); - -NS_DEF_PTR(nsIHTMLContent); -NS_DEF_PTR(nsIContent); -NS_DEF_PTR(nsIStyleRule); -NS_DEF_PTR(nsICSSStyleRule); -NS_DEF_PTR(nsIURL); -NS_DEF_PTR(nsISupportsArray); -NS_DEF_PTR(nsICSSStyleSheet); - -class CSSStyleSheetImpl : public nsICSSStyleSheet { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - CSSStyleSheetImpl(nsIURL* aURL); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRBool SelectorMatches(nsCSSSelector* aSelector, - nsIContent* aContent); - virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults); - - virtual nsIURL* GetURL(void); - - virtual PRBool ContainsStyleSheet(nsIURL* aURL); - - virtual void AppendStyleSheet(nsICSSStyleSheet* aSheet); - - // XXX do these belong here or are they generic? - virtual void PrependStyleRule(nsICSSStyleRule* aRule); - virtual void AppendStyleRule(nsICSSStyleRule* aRule); - - // XXX style rule enumerations - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - // These are not supported and are not implemented! - CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy); - CSSStyleSheetImpl& operator=(const CSSStyleSheetImpl& aCopy); - -protected: - virtual ~CSSStyleSheetImpl(); - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsIURLPtr mURL; - nsICSSStyleSheetPtr mFirstChild; - nsISupportsArrayPtr mRules; - nsICSSStyleSheetPtr mNext; -}; - - -void* CSSStyleSheetImpl::operator new(size_t size) -{ - CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) -{ - CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void CSSStyleSheetImpl::operator delete(void* ptr) -{ - CSSStyleSheetImpl* sheet = (CSSStyleSheetImpl*) ptr; - if (nsnull != sheet) { - if (sheet->mInHeap) { - ::delete ptr; - } - } -} - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - -CSSStyleSheetImpl::CSSStyleSheetImpl(nsIURL* aURL) - : nsICSSStyleSheet(), - mURL(nsnull), mFirstChild(nsnull), mRules(nsnull), mNext(nsnull) -{ - NS_INIT_REFCNT(); - mURL.SetAddRef(aURL); -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + CSSStyleSheet size: %d\n", gInstanceCount, sizeof(*this)); -#endif -} - -CSSStyleSheetImpl::~CSSStyleSheetImpl() -{ -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - CSSStyleSheet\n", gInstanceCount); -#endif -} - -NS_IMPL_ADDREF(CSSStyleSheetImpl) -NS_IMPL_RELEASE(CSSStyleSheetImpl) - -nsresult CSSStyleSheetImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kICSSStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsICSSStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsIStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -PRBool CSSStyleSheetImpl::SelectorMatches(nsCSSSelector* aSelector, nsIContent* aContent) -{ - PRBool result = PR_FALSE; - - if ((nsnull == aSelector->mTag) || (aSelector->mTag == aContent->GetTag())) { - if ((nsnull != aSelector->mClass) || (nsnull != aSelector->mID)) { - nsIHTMLContentPtr htmlContent; - if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, htmlContent.Query())) { - if ((nsnull == aSelector->mClass) || (aSelector->mClass == htmlContent->GetClass())) { - if ((nsnull == aSelector->mID) || (aSelector->mID == htmlContent->GetID())) { - result = PR_TRUE; - } - } - } - } - else { - result = PR_TRUE; - } - } - return result; -} - -PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) -{ - NS_PRECONDITION(nsnull != aPresContext, "null arg"); - NS_PRECONDITION(nsnull != aContent, "null arg"); -// NS_PRECONDITION(nsnull != aParentFrame, "null arg"); - NS_PRECONDITION(nsnull != aResults, "null arg"); - - PRInt32 matchCount = 0; - nsICSSStyleSheet* child = mFirstChild; - while (nsnull != child) { - matchCount += child->RulesMatching(aPresContext, aContent, aParentFrame, aResults); - child = ((CSSStyleSheetImpl*)child)->mNext; - } - - PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); - - for (PRInt32 index = 0; index < count; index++) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - - nsCSSSelector* selector = rule->FirstSelector(); - if (SelectorMatches(selector, aContent)) { - selector = selector->mNext; - nsIFrame* frame = aParentFrame; - while ((nsnull != selector) && (nsnull != frame)) { // check compound selectors - nsIContentPtr content; - frame->GetContent(content.AssignRef()); - if (SelectorMatches(selector, content)) { - selector = selector->mNext; - } - frame->GetGeometricParent(frame); - } - if (nsnull == selector) { // ran out, it matched - nsIStyleRulePtr iRule; - if (NS_OK == rule->QueryInterface(kIStyleRuleIID, iRule.Query())) { - aResults->AppendElement(iRule); - matchCount++; - } - } - } - } - return matchCount; -} - -nsIURL* CSSStyleSheetImpl::GetURL(void) -{ - return mURL.AddRef(); -} - -PRBool CSSStyleSheetImpl::ContainsStyleSheet(nsIURL* aURL) -{ - NS_PRECONDITION(nsnull != aURL, "null arg"); - - PRBool result = (*mURL == *aURL); - - nsICSSStyleSheet* child = mFirstChild; - while ((PR_FALSE == result) && (nsnull != child)) { - result = child->ContainsStyleSheet(aURL); - child = ((CSSStyleSheetImpl*)child)->mNext; - } - return result; -} - -void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (mFirstChild.IsNull()) { - mFirstChild.SetAddRef(aSheet); - } - else { - nsICSSStyleSheet* child = mFirstChild; - while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) { - child = ((CSSStyleSheetImpl*)child)->mNext; - } - ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); - } -} - -void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) -{ - NS_PRECONDITION(nsnull != aRule, "null arg"); - //XXX replace this with a binary search? - PRInt32 weight = aRule->GetWeight(); - if (mRules.IsNull()) { - if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) - return; - } - PRInt32 index = mRules->Count(); - while (0 <= --index) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - if (rule->GetWeight() > weight) { // insert before rules with equal or lesser weight - break; - } - } - mRules->InsertElementAt(aRule, index + 1); -} - -void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) -{ - NS_PRECONDITION(nsnull != aRule, "null arg"); - - //XXX replace this with a binary search? - PRInt32 weight = aRule->GetWeight(); - if (mRules.IsNull()) { - if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) - return; - } - PRInt32 count = mRules->Count(); - PRInt32 index = -1; - while (++index < count) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - if (rule->GetWeight() < weight) { // insert after rules with equal or greater weight (before lower weight) - break; - } - } - mRules->InsertElementAt(aRule, index); -} - -void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const -{ - nsAutoString buffer; - PRInt32 index; - - // Indent - for (index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("CSS Style Sheet: ", out); - mURL->ToString(buffer); - fputs(buffer, out); - fputs("\n", out); - - const nsICSSStyleSheet* child = mFirstChild; - while (nsnull != child) { - child->List(out, aIndent + 1); - child = ((CSSStyleSheetImpl*)child)->mNext; - } - - PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); - - for (index = 0; index < count; index++) { - nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); - rule->List(out, aIndent); - } -} - -NS_HTML nsresult - NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURL* aURL) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - CSSStyleSheetImpl *it = new CSSStyleSheetImpl(aURL); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kICSSStyleSheetIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp deleted file mode 100644 index 687a1030ee4..00000000000 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIHTMLStyleSheet.h" -#include "nsIArena.h" -#include "nsCRT.h" -#include "nsIAtom.h" -#include "nsIURL.h" -#include "nsISupportsArray.h" -#include "nsIHTMLContent.h" -#include "nsIStyleRule.h" - -static NS_DEFINE_IID(kIHTMLStyleSheetIID, NS_IHTML_STYLE_SHEET_IID); -static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID); -static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID); - - -class HTMLStyleSheetImpl : public nsIHTMLStyleSheet { -public: - void* operator new(size_t size); - void* operator new(size_t size, nsIArena* aArena); - void operator delete(void* ptr); - - HTMLStyleSheetImpl(nsIURL* aURL); - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults); - - virtual nsIURL* GetURL(void); - - // XXX style rule enumerations - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - -private: - // These are not supported and are not implemented! - HTMLStyleSheetImpl(const HTMLStyleSheetImpl& aCopy); - HTMLStyleSheetImpl& operator=(const HTMLStyleSheetImpl& aCopy); - -protected: - virtual ~HTMLStyleSheetImpl(); - -protected: - PRUint32 mInHeap : 1; - PRUint32 mRefCnt : 31; - - nsIURL* mURL; -}; - - -void* HTMLStyleSheetImpl::operator new(size_t size) -{ - HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) ::operator new(size); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 1; - return (void*) rv; -} - -void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena) -{ - HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) aArena->Alloc(PRInt32(size)); -#ifdef NS_DEBUG - if (nsnull != rv) { - nsCRT::memset(rv, 0xEE, size); - } -#endif - rv->mInHeap = 0; - return (void*) rv; -} - -void HTMLStyleSheetImpl::operator delete(void* ptr) -{ - HTMLStyleSheetImpl* sheet = (HTMLStyleSheetImpl*) ptr; - if (nsnull != sheet) { - if (sheet->mInHeap) { - ::delete ptr; - } - } -} - - - -HTMLStyleSheetImpl::HTMLStyleSheetImpl(nsIURL* aURL) - : nsIHTMLStyleSheet(), - mURL(aURL) -{ - NS_INIT_REFCNT(); - NS_ADDREF(mURL); -} - -HTMLStyleSheetImpl::~HTMLStyleSheetImpl() -{ - NS_RELEASE(mURL); -} - -NS_IMPL_ADDREF(HTMLStyleSheetImpl) -NS_IMPL_RELEASE(HTMLStyleSheetImpl) - -nsresult HTMLStyleSheetImpl::QueryInterface(const nsIID& aIID, - void** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIHTMLStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsIHTMLStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIStyleSheetIID)) { - *aInstancePtrResult = (void*) ((nsIStyleSheet*)this); - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtrResult = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) -{ - NS_PRECONDITION(nsnull != aPresContext, "null arg"); - NS_PRECONDITION(nsnull != aContent, "null arg"); -// NS_PRECONDITION(nsnull != aParentFrame, "null arg"); - NS_PRECONDITION(nsnull != aResults, "null arg"); - - PRInt32 matchCount = 0; - - nsIHTMLContent* htmlContent; - - // for now, just get the one and only style rule from the content - // this may need some special handling for pseudo-frames - if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) { - nsIStyleRule* rule = htmlContent->GetStyleRule(); - - if (nsnull != rule) { - aResults->AppendElement(rule); - NS_RELEASE(rule); - matchCount++; - } - - NS_RELEASE(htmlContent); - } - - return matchCount; -} - -nsIURL* HTMLStyleSheetImpl::GetURL(void) -{ - NS_ADDREF(mURL); - return mURL; -} - -void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const -{ - nsAutoString buffer; - - // Indent - for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out); - - fputs("HTML Style Sheet: ", out); - mURL->ToString(buffer); - fputs(buffer, out); - fputs("\n", out); - -} - -NS_HTML nsresult - NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult, nsIURL* aURL) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - HTMLStyleSheetImpl *it = new HTMLStyleSheetImpl(aURL); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIHTMLStyleSheetIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/style/nsICSSParser.h b/mozilla/layout/style/nsICSSParser.h deleted file mode 100644 index e9b21f10215..00000000000 --- a/mozilla/layout/style/nsICSSParser.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCSS1Parser_h___ -#define nsCSS1Parser_h___ - -#include "nslayout.h" -#include "nsISupports.h" -class nsIStyleSheet; -class nsIUnicharInputStream; -class nsIURL; - -#define NS_ICSS_PARSER_IID \ -{ 0xcc9c0610, 0x968c, 0x11d1, \ - {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -// Interface to the css parser. -class nsICSSParser : public nsISupports { -public: - // Return a mask of the various css standards that this parser - // supports. - virtual PRUint32 GetInfoMask() = 0; - - // Set a style sheet for the parser to fill in. The style sheet must - // implement the nsICSSStyleSheet interface - virtual nsresult SetStyleSheet(nsIStyleSheet* aSheet) = 0; - - virtual nsIStyleSheet* Parse(PRInt32* aErrorCode, - nsIUnicharInputStream* aInput, - nsIURL* aInputURL) = 0; -}; - -// Values or'd in the GetInfoMask; other bits are reserved -#define NS_CSS_GETINFO_CSS1 ((PRUint32) 0x00000001L) -#define NS_CSS_GETINFO_CSSP ((PRUint32) 0x00000002L) -#define NS_CSS_GETINFO_CSS2 ((PRUint32) 0x00000004L) -#define NS_CSS_GETINFO_CSS_FROSTING ((PRUint32) 0x00000008L) - -extern NS_HTML nsresult - NS_NewCSSParser(nsICSSParser** aInstancePtrResult); - -#endif /* nsCSS1Parser_h___ */ diff --git a/mozilla/layout/style/nsICSSStyleRule.h b/mozilla/layout/style/nsICSSStyleRule.h deleted file mode 100644 index 153397fe876..00000000000 --- a/mozilla/layout/style/nsICSSStyleRule.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsICSSStyleRule_h___ -#define nsICSSStyleRule_h___ - -#include -#include "nslayout.h" -#include "nsIStyleRule.h" -class nsIAtom; -class nsIArena; -class nsString; -class nsICSSDeclaration; - - -struct nsCSSSelector { -public: - nsCSSSelector(); - nsCSSSelector(nsIAtom* aTag, nsIAtom* aID, nsIAtom* aClass, nsIAtom* aPseudoClass); - nsCSSSelector(const nsCSSSelector& aCopy); - ~nsCSSSelector(); - - nsCSSSelector& operator=(const nsCSSSelector& aCopy); - PRBool Equals(const nsCSSSelector* aOther) const; - - void Set(const nsString& aTag, const nsString& aID, const nsString& aClass, const nsString& aPseudoClass); - -public: - nsIAtom* mTag; - nsIAtom* mID; - nsIAtom* mClass; // this'll have to be an array for CSS2 - nsIAtom* mPseudoClass; - - nsCSSSelector* mNext; -}; - -// IID for the nsICSSStyleRule interface {7c277af0-af19-11d1-8031-006008159b5a} -#define NS_ICSS_STYLE_RULE_IID \ -{0x7c277af0, 0xaf19, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsICSSStyleRule : public nsIStyleRule { -public: - virtual PRBool Equals(const nsIStyleRule* aRule) const = 0; - virtual PRUint32 HashValue(void) const = 0; - - virtual nsCSSSelector* FirstSelector(void) = 0; - virtual void AddSelector(const nsCSSSelector& aSelector) = 0; - virtual void DeleteSelector(nsCSSSelector* aSelector) = 0; - - virtual nsICSSDeclaration* GetDeclaration(void) const = 0; - virtual void SetDeclaration(nsICSSDeclaration* aDeclaration) = 0; - - virtual PRInt32 GetWeight(void) const = 0; - virtual void SetWeight(PRInt32 aWeight) = 0; - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -extern NS_HTML nsresult - NS_NewCSSStyleRule(nsICSSStyleRule** aInstancePtrResult, const nsCSSSelector& aSelector); - -#endif /* nsICSSStyleRule_h___ */ diff --git a/mozilla/layout/style/nsIStyleRule.h b/mozilla/layout/style/nsIStyleRule.h deleted file mode 100644 index e79eff7dae8..00000000000 --- a/mozilla/layout/style/nsIStyleRule.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIStyleRule_h___ -#define nsIStyleRule_h___ - -#include - -#include "nslayout.h" -#include "nsISupports.h" - -class nsIStyleContext; -class nsIPresContext; - -// IID for the nsIStyleRule interface {40ae5c90-ad6a-11d1-8031-006008159b5a} -#define NS_ISTYLE_RULE_IID \ -{0x40ae5c90, 0xad6a, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIStyleRule : public nsISupports { -public: - virtual PRBool Equals(const nsIStyleRule* aRule) const = 0; - virtual PRUint32 HashValue(void) const = 0; - - virtual void MapStyleInto(nsIStyleContext* aContext, nsIPresContext* aPresContext) = 0; - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -#endif /* nsIStyleRule_h___ */ diff --git a/mozilla/layout/style/nsIStyleSheet.h b/mozilla/layout/style/nsIStyleSheet.h deleted file mode 100644 index bac20159aa0..00000000000 --- a/mozilla/layout/style/nsIStyleSheet.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIStyleSheet_h___ -#define nsIStyleSheet_h___ - -#include -#include "nsISupports.h" -class nsIAtom; -class nsIURL; -class nsIStyleRule; -class nsISupportsArray; -class nsIPresContext; -class nsIContent; -class nsIFrame; - -// IID for the nsIStyleSheet interface {8c4a80a0-ad6a-11d1-8031-006008159b5a} -#define NS_ISTYLE_SHEET_IID \ -{0x8c4a80a0, 0xad6a, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} - -class nsIStyleSheet : public nsISupports { -public: - virtual nsIURL* GetURL(void) = 0; - - // populate void array with nsIStyleRule* - virtual PRInt32 RulesMatching(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) = 0; - - // XXX style rule enumerations - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -#endif /* nsIStyleSheet_h___ */ diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp deleted file mode 100644 index c0b88aaa2cf..00000000000 --- a/mozilla/layout/style/nsStyleContext.cpp +++ /dev/null @@ -1,545 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsString.h" -#include "nsUnitConversion.h" -#include "nsIContent.h" -#include "nsIPresContext.h" -#include "nsIStyleRule.h" -#include "nsISupportsArray.h" -#include "nsCRT.h" - -#include "nsIFrame.h" - -//#define DEBUG_REFS - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -#else -static const PRBool gsDebug = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleFontSID, NS_STYLEFONT_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID); - -static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID); - - -// -------------------- -// nsStyleFont -// -nsStyleFont::nsStyleFont(const nsFont& aFont) - : mFont(aFont) -{ } - -nsStyleFont::~nsStyleFont(void) { } - -struct StyleFontImpl : public nsStyleFont { - StyleFontImpl(const nsFont& aFont) - : nsStyleFont(aFont) - {} - - virtual const nsID& GetID(void) - { return kStyleFontSID; } - - virtual void InheritFrom(const nsStyleFont& aCopy); - -private: // These are not allowed - StyleFontImpl(const StyleFontImpl& aOther); - StyleFontImpl& operator=(const StyleFontImpl& aOther); -}; - -void StyleFontImpl::InheritFrom(const nsStyleFont& aCopy) -{ - mFont = aCopy.mFont; - mThreeD = aCopy.mThreeD; -} - -// -------------------- -// nsStyleColor -// -nsStyleColor::nsStyleColor() { } -nsStyleColor::~nsStyleColor() { } - -struct StyleColorImpl: public nsStyleColor { - StyleColorImpl(void) - { - mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL; - mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT; - mBackgroundRepeat = NS_STYLE_BG_REPEAT_OFF; - - mBackgroundColor = NS_RGB(192,192,192); - mCursor = NS_STYLE_CURSOR_INHERIT; - } - - virtual const nsID& GetID(void) - { return kStyleColorSID; } - - virtual void InheritFrom(const nsStyleColor& aCopy); - -private: // These are not allowed - StyleColorImpl(const StyleColorImpl& aOther); - StyleColorImpl& operator=(const StyleColorImpl& aOther); -}; - -void StyleColorImpl::InheritFrom(const nsStyleColor& aCopy) -{ - mColor = aCopy.mColor; -} - - -// -------------------- -// nsStyleSpacing -// -nsStyleSpacing::nsStyleSpacing(void) - : mMargin(0, 0, 0, 0), - mPadding(0, 0, 0, 0), - mBorderPadding(0, 0, 0, 0) -{ -} - -struct StyleSpacingImpl: public nsStyleSpacing { - StyleSpacingImpl(void) - : nsStyleSpacing() - {} - - virtual const nsID& GetID(void) - { return kStyleSpacingSID; } - - virtual void InheritFrom(const nsStyleSpacing& aCopy); -}; - -void StyleSpacingImpl::InheritFrom(const nsStyleSpacing& aCopy) -{ - // spacing values not inherited -} - -// -------------------- -// nsStyleBorder -// - -nsStyleBorder::nsStyleBorder(void) - : mSize(0, 0, 0, 0) -{ - mSizeFlag[0] = mSizeFlag[1] = mSizeFlag[2] = mSizeFlag[3] = NS_STYLE_BORDER_WIDTH_LENGTH_VALUE; - mStyle[0] = mStyle[1] = mStyle[2] = mStyle[3] = NS_STYLE_BORDER_STYLE_NONE; - mColor[0] = mColor[1] = mColor[2] = mColor[3] = NS_RGB(0, 0, 0); -} - -struct StyleBorderImpl: public nsStyleBorder { - StyleBorderImpl(void) - : nsStyleBorder() - {} - - virtual const nsID& GetID(void) - { return kStyleBorderSID; } - - virtual void InheritFrom(const nsStyleBorder& aCopy); -}; - -void StyleBorderImpl::InheritFrom(const nsStyleBorder& aCopy) -{ - // border values not inherited -} - -// -------------------- -// nsStyleList -// -nsStyleList::nsStyleList() { } -nsStyleList::~nsStyleList() { } - -struct StyleListImpl: public nsStyleList { - StyleListImpl(void) - { - mListStyleType = NS_STYLE_LIST_STYLE_BASIC; - mListStylePosition = NS_STYLE_LIST_STYLE_POSITION_OUTSIDE; - } - - virtual const nsID& GetID(void) - { return kStyleListSID; } - - virtual void InheritFrom(const nsStyleList& aCopy); -}; - -void StyleListImpl::InheritFrom(const nsStyleList& aCopy) -{ - mListStyleType = aCopy.mListStyleType; - mListStyleImage = aCopy.mListStyleImage; - mListStylePosition = aCopy.mListStylePosition; -} - -// -------------------- -// nsStylePosition -// -nsStylePosition::nsStylePosition() { } - -struct StylePositionImpl: public nsStylePosition { - StylePositionImpl(void) - { - mPosition = NS_STYLE_POSITION_STATIC; - mOverflow = NS_STYLE_OVERFLOW_VISIBLE; - mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO; - mLeftOffset = 0; - mTopOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO; - mTopOffset = 0; - mWidthFlags = NS_STYLE_POSITION_VALUE_AUTO; - mWidth = 0; - mHeightFlags = NS_STYLE_POSITION_VALUE_AUTO; - mHeight = 0; - mZIndex = 0; - mClipFlags = NS_STYLE_CLIP_AUTO; - mClip.SizeTo(0,0,0,0); - } - - virtual const nsID& GetID(void) - { return kStylePositionSID; } - - virtual void InheritFrom(const nsStylePosition& aCopy); - -private: // These are not allowed - StylePositionImpl(const StylePositionImpl& aOther); - StylePositionImpl& operator=(const StylePositionImpl& aOther); -}; - -void StylePositionImpl::InheritFrom(const nsStylePosition& aCopy) -{ - // positioning values not inherited -} - -// -------------------- -// nsStyleText -// - -nsStyleText::nsStyleText() { } - -struct StyleTextImpl: public nsStyleText { - StyleTextImpl() { - mTextAlign = NS_STYLE_TEXT_ALIGN_LEFT; - mTextDecoration = NS_STYLE_TEXT_DECORATION_NONE; - mTextTransform = NS_STYLE_TEXT_TRANSFORM_NONE; - mWhiteSpace = NS_STYLE_WHITESPACE_NORMAL; - - mLetterSpacing.SetNormal(); - mLineHeight.SetNormal(); - mTextIndent.Set(0); - mWordSpacing.SetNormal(); - mVerticalAlign.Set(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated); - } - - virtual const nsID& GetID() { - return kStyleTextSID; - } - - virtual void InheritFrom(const nsStyleText& aCopy); -}; - -void StyleTextImpl::InheritFrom(const nsStyleText& aCopy) -{ - // Properties not listed here are not inherited: mVerticalAlign, - // mTextDecoration - mTextAlign = aCopy.mTextAlign; - mTextTransform = aCopy.mTextTransform; - mWhiteSpace = aCopy.mWhiteSpace; - - mLetterSpacing = aCopy.mLetterSpacing; - mLineHeight = aCopy.mLineHeight; - mTextIndent = aCopy.mTextIndent; - mWordSpacing = aCopy.mWordSpacing; -} - -// -------------------- -// nsStyleDisplay -// - -nsStyleDisplay::nsStyleDisplay() { } - -struct StyleDisplayImpl: public nsStyleDisplay { - StyleDisplayImpl() { - mDirection = NS_STYLE_DIRECTION_LTR; - mDisplay = NS_STYLE_DISPLAY_INLINE; - mFloats = NS_STYLE_FLOAT_NONE; - mBreakType = NS_STYLE_CLEAR_NONE; - mBreakBefore = PR_FALSE; - mBreakAfter = PR_FALSE; - } - - virtual const nsID& GetID() { - return kStyleDisplaySID; - } - - virtual void InheritFrom(const nsStyleDisplay& aCopy); -}; - -void StyleDisplayImpl::InheritFrom(const nsStyleDisplay& aCopy) -{ - mDirection = aCopy.mDirection; -} - -//---------------------------------------------------------------------- - -class StyleContextImpl : public nsIStyleContext { -public: - StyleContextImpl(nsIStyleContext* aParent, nsISupportsArray* aRules, nsIPresContext* aPresContext); - ~StyleContextImpl(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - virtual nsIStyleContext* GetParent(void) const; - virtual nsISupportsArray* GetStyleRules(void) const; - - virtual PRBool Equals(const nsIStyleContext* aOther) const; - virtual PRUint32 HashValue(void) const; - - virtual nsStyleStruct* GetData(const nsIID& aSID); - - virtual void InheritFrom(const StyleContextImpl& aParent); - virtual void RecalcAutomaticData(void); - - nsIStyleContext* mParent; - PRUint32 mHashValid: 1; - PRUint32 mHashValue: 31; - nsISupportsArray* mRules; - - // the style data... - StyleFontImpl mFont; - StyleColorImpl mColor; - StyleSpacingImpl mSpacing; - StyleBorderImpl mBorder; - StyleListImpl mList; - StylePositionImpl mPosition; - StyleTextImpl mText; - StyleDisplayImpl mDisplay; -}; - -#ifdef DEBUG_REFS -static PRInt32 gInstanceCount; -#endif - -StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent, - nsISupportsArray* aRules, - nsIPresContext* aPresContext) - : mParent(aParent), // weak ref - mRules(aRules), - mFont(aPresContext->GetDefaultFont()), - mColor(), - mSpacing(), - mBorder(), - mList(), - mPosition(), - mText(), - mDisplay() -{ - NS_INIT_REFCNT(); - NS_IF_ADDREF(mRules); - - if (nsnull != aParent) { - InheritFrom((StyleContextImpl&)*aParent); - } - - if (nsnull != mRules) { - PRInt32 index = mRules->Count(); - while (0 < index) { - nsIStyleRule* rule = (nsIStyleRule*)mRules->ElementAt(--index); - rule->MapStyleInto(this, aPresContext); - NS_RELEASE(rule); - } - } -#ifdef DEBUG_REFS - ++gInstanceCount; - fprintf(stdout, "%d + StyleContext\n", gInstanceCount); -#endif -} - -StyleContextImpl::~StyleContextImpl() -{ - mParent = nsnull; // weak ref - NS_IF_RELEASE(mRules); -#ifdef DEBUG_REFS - --gInstanceCount; - fprintf(stdout, "%d - StyleContext\n", gInstanceCount); -#endif -} - -NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID) - -nsIStyleContext* StyleContextImpl::GetParent(void) const -{ - NS_IF_ADDREF(mParent); - return mParent; -} - -nsISupportsArray* StyleContextImpl::GetStyleRules(void) const -{ - NS_IF_ADDREF(mRules); - return mRules; -} - - -PRBool StyleContextImpl::Equals(const nsIStyleContext* aOther) const -{ - PRBool result = PR_TRUE; - const StyleContextImpl* other = (StyleContextImpl*)aOther; - - if (other != this) { - if (mParent != other->mParent) { - result = PR_FALSE; - } - else { - if ((nsnull != mRules) && (nsnull != other->mRules)) { - result = mRules->Equals(other->mRules); - } - else { - result = PRBool((nsnull == mRules) && (nsnull == other->mRules)); - } - } - } - return result; -} - -PRUint32 StyleContextImpl::HashValue(void) const -{ - if (0 == mHashValid) { - ((StyleContextImpl*)this)->mHashValue = ((nsnull != mParent) ? mParent->HashValue() : 0); - if (nsnull != mRules) { - PRInt32 index = mRules->Count(); - while (0 <= --index) { - nsIStyleRule* rule = (nsIStyleRule*)mRules->ElementAt(index); - PRUint32 hash = rule->HashValue(); - ((StyleContextImpl*)this)->mHashValue ^= (hash & 0x7FFFFFFF); - NS_RELEASE(rule); - } - } - ((StyleContextImpl*)this)->mHashValid = 1; - } - return mHashValue; -} - - -nsStyleStruct* StyleContextImpl::GetData(const nsIID& aSID) -{ - if (aSID.Equals(kStyleFontSID)) { - return &mFont; - } - if (aSID.Equals(kStyleColorSID)) { - return &mColor; - } - if (aSID.Equals(kStyleSpacingSID)) { - return &mSpacing; - } - if (aSID.Equals(kStyleBorderSID)) { - return &mBorder; - } - if (aSID.Equals(kStyleListSID)) { - return &mList; - } - if (aSID.Equals(kStylePositionSID)) { - return &mPosition; - } - if (aSID.Equals(kStyleTextSID)) { - return &mText; - } - if (aSID.Equals(kStyleDisplaySID)) { - return &mDisplay; - } - return nsnull; -} - -void StyleContextImpl::InheritFrom(const StyleContextImpl& aParent) -{ - mFont.InheritFrom(aParent.mFont); - mColor.InheritFrom(aParent.mColor); - mSpacing.InheritFrom(aParent.mSpacing); - mBorder.InheritFrom(aParent.mBorder); - mList.InheritFrom(aParent.mList); - mText.InheritFrom(aParent.mText); - mPosition.InheritFrom(aParent.mPosition); - mDisplay.InheritFrom(aParent.mDisplay); -} - -static void CalcBorderSize(nscoord& aSize, const nsStyleBorder& aBorder, PRUint8 aSide) -{ - static const nscoord kBorderSize[3] = // XXX need real numbers here (this is probably wrong anyway) - { NS_POINTS_TO_TWIPS_INT(1), - NS_POINTS_TO_TWIPS_INT(3), - NS_POINTS_TO_TWIPS_INT(5) }; - PRUint8 style = aBorder.mStyle[aSide]; - if (NS_STYLE_BORDER_STYLE_NONE == style) { - aSize = 0; - } - else { - PRUint8 flag = aBorder.mSizeFlag[aSide]; - if (flag < NS_STYLE_BORDER_WIDTH_LENGTH_VALUE) { - aSize = kBorderSize[flag]; - } - } -} - -void StyleContextImpl::RecalcAutomaticData(void) -{ - CalcBorderSize(mBorder.mSize.top, mBorder, NS_SIDE_TOP); - CalcBorderSize(mBorder.mSize.right, mBorder, NS_SIDE_RIGHT); - CalcBorderSize(mBorder.mSize.bottom, mBorder, NS_SIDE_BOTTOM); - CalcBorderSize(mBorder.mSize.left, mBorder, NS_SIDE_LEFT); - - // XXX fixup missing border colors - - mSpacing.mBorder = mBorder.mSize; - mSpacing.mBorderPadding = mSpacing.mPadding; - mSpacing.mBorderPadding += mBorder.mSize; -} - -NS_LAYOUT nsresult -NS_NewStyleContext(nsIStyleContext** aInstancePtrResult, - nsISupportsArray* aRules, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - - nsIStyleContext* parent = nsnull; - if (nsnull != aParentFrame) { - aParentFrame->GetStyleContext(aPresContext, parent); - NS_ASSERTION(nsnull != parent, "parent frame must have style context"); - } - - StyleContextImpl* context = new StyleContextImpl(parent, aRules, aPresContext); - NS_IF_RELEASE(parent); - if (nsnull == context) { - return NS_ERROR_OUT_OF_MEMORY; - } - context->RecalcAutomaticData(); - - return context->QueryInterface(kIStyleContextIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/style/nsStyleCoord.h b/mozilla/layout/style/nsStyleCoord.h deleted file mode 100644 index 0df2a9abec6..00000000000 --- a/mozilla/layout/style/nsStyleCoord.h +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsStyleCoord_h___ -#define nsStyleCoord_h___ - -#include "nscore.h" -#include "nsCoord.h" -class nsString; - -enum nsStyleUnit { - eStyleUnit_Twips = 0, // (nscoord) value is twips - eStyleUnit_Percent = 1, // (float) 1.0 == 100% - eStyleUnit_Normal = 2, // (no value) - eStyleUnit_Auto = 3, // (no value) - eStyleUnit_Inherit = 4, // (no value) value should be inherited - eStyleUnit_Proportional = 5, // (int) value has proportional meaning - eStyleUnit_Enumerated = 6, // (int) value has enumerated meaning -}; - -class nsStyleCoord { -public: - nsStyleCoord(void); // sets to 0 twips - nsStyleCoord(nscoord aValue); - nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit); - nsStyleCoord(float aValue); - nsStyleCoord(const nsStyleCoord& aCopy); - - nsStyleCoord& operator=(const nsStyleCoord& aCopy); - PRBool operator==(const nsStyleCoord& aOther) const; - - nsStyleUnit GetUnit(void) const { return mUnit; } - nscoord GetCoordValue(void) const; - PRInt32 GetIntValue(void) const; - float GetFloatValue(void) const; - - void Set(nscoord aValue); - void Set(PRInt32 aValue, nsStyleUnit aUnit); - void Set(float aValue); - void SetNormal(void); - void SetAuto(void); - void SetInherit(void); - - void AppendToString(nsString& aBuffer) const; - void ToString(nsString& aBuffer) const; - -protected: - nsStyleUnit mUnit; - union { - PRInt32 mInt; // nscoord is a PRInt32 for now - float mFloat; - } mValue; -}; - -inline PRInt32 nsStyleCoord::GetCoordValue(void) const -{ - NS_ASSERTION((mUnit == eStyleUnit_Twips), "not a coord value"); - if (mUnit == eStyleUnit_Twips) { - return mValue.mInt; - } - return 0; -} - -inline PRInt32 nsStyleCoord::GetIntValue(void) const -{ - NS_ASSERTION((mUnit == eStyleUnit_Proportional) || - (mUnit == eStyleUnit_Enumerated), "not an int value"); - if ((mUnit == eStyleUnit_Proportional) || - (mUnit == eStyleUnit_Enumerated)) { - return mValue.mInt; - } - return 0; -} - -inline float nsStyleCoord::GetFloatValue(void) const -{ - NS_ASSERTION(mUnit == eStyleUnit_Percent, "not a float value"); - if (mUnit == eStyleUnit_Percent) { - return mValue.mFloat; - } - return 0.0f; -} - - - -#endif /* nsStyleCoord_h___ */ diff --git a/mozilla/layout/style/nsStyleSet.cpp b/mozilla/layout/style/nsStyleSet.cpp deleted file mode 100644 index 94ea2a5c0e7..00000000000 --- a/mozilla/layout/style/nsStyleSet.cpp +++ /dev/null @@ -1,530 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIStyleSet.h" -#include "nsIStyleSheet.h" -#include "nsIStyleRule.h" -#include "nsIStyleContext.h" -#include "nsISupportsArray.h" -#include "nsIFrame.h" -#include "nsHashtable.h" - - -static NS_DEFINE_IID(kIStyleSetIID, NS_ISTYLE_SET_IID); - -class ContextKey : public nsHashKey { -public: - ContextKey(nsIStyleContext* aContext); - ContextKey(nsIStyleContext* aParent, nsISupportsArray* aRules); - virtual ~ContextKey(void); - - void SetContext(nsIStyleContext* aContext); - - PRBool Equals(const nsHashKey* aOther) const; - PRUint32 HashValue(void) const; - nsHashKey* Clone(void) const; - -private: - ContextKey(void); - ContextKey(const ContextKey& aCopy); - ContextKey& operator=(const ContextKey& aCopy) const; - -protected: - nsIStyleContext* mContext; - nsIStyleContext* mParent; - nsISupportsArray* mRules; -}; - -ContextKey::ContextKey(nsIStyleContext* aContext) - : mContext(aContext), - mParent(nsnull), - mRules(nsnull) -{ - NS_IF_ADDREF(mContext); -} - -ContextKey::ContextKey(nsIStyleContext* aParent, nsISupportsArray* aRules) - : mContext(nsnull), - mParent(aParent), - mRules(aRules) -{ - NS_IF_ADDREF(mParent); - NS_IF_ADDREF(mRules); -} - -ContextKey::ContextKey(const ContextKey& aCopy) - : mContext(aCopy.mContext), - mParent(aCopy.mParent), - mRules(aCopy.mRules) -{ - NS_IF_ADDREF(mContext); - NS_IF_ADDREF(mParent); - NS_IF_ADDREF(mRules); -} - -ContextKey::~ContextKey(void) -{ - NS_IF_RELEASE(mContext); - NS_IF_RELEASE(mParent); - NS_IF_RELEASE(mRules); -} - -void ContextKey::SetContext(nsIStyleContext* aContext) -{ - if (aContext != mContext) { - NS_IF_RELEASE(mContext); - mContext = aContext; - NS_IF_ADDREF(mContext); - } - NS_IF_RELEASE(mParent); - NS_IF_RELEASE(mRules); -} - -PRBool ContextKey::Equals(const nsHashKey* aOther) const -{ - PRBool result = PR_TRUE; - const ContextKey* other = (const ContextKey*)aOther; - - if (other != this) { - if ((nsnull == mContext) || (nsnull == other->mContext) || (mContext != other->mContext)) { - nsIStyleContext* otherParent = other->mParent; - if ((nsnull == otherParent) && (nsnull != other->mContext)) { - otherParent = other->mContext->GetParent(); - } - else { - NS_IF_ADDREF(otherParent); // simulate the above addref - } - - if (mParent == otherParent) { - nsISupportsArray* otherRules = other->mRules; - if ((nsnull == otherRules) && (nsnull != other->mContext)) { - otherRules = other->mContext->GetStyleRules(); - } - else { - NS_IF_ADDREF(otherRules); // simulate the above addref - } - if ((nsnull != mRules) && (nsnull != otherRules)) { - result = mRules->Equals(otherRules); - } - else { - result = PRBool((nsnull == mRules) && (nsnull == otherRules)); - } - NS_IF_RELEASE(otherRules); - } - else { - result = PR_FALSE; - } - NS_IF_RELEASE(otherParent); - } - } - return result; -} - -PRUint32 ContextKey::HashValue(void) const -{ - if (nsnull != mContext) { - return mContext->HashValue(); - } - // we don't have a context yet, compute it like it would - PRUint32 hashValue = ((nsnull != mParent) ? mParent->HashValue() : 0); - if (nsnull != mRules) { - PRInt32 index = mRules->Count(); - while (0 <= --index) { - nsIStyleRule* rule = (nsIStyleRule*)mRules->ElementAt(index); - PRUint32 hash = rule->HashValue(); - hashValue ^= (hash & 0x7FFFFFFF); - NS_RELEASE(rule); - } - } - return hashValue; -} - -nsHashKey* ContextKey::Clone(void) const -{ - return new ContextKey(*this); -} - - -class StyleSetImpl : public nsIStyleSet { -public: - StyleSetImpl(); - - NS_DECL_ISUPPORTS - - virtual void AppendOverrideStyleSheet(nsIStyleSheet* aSheet); - virtual void InsertOverrideStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet); - virtual void InsertOverrideStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet); - virtual void RemoveOverrideStyleSheet(nsIStyleSheet* aSheet); - virtual PRInt32 GetNumberOfOverrideStyleSheets(); - virtual nsIStyleSheet* GetOverrideStyleSheetAt(PRInt32 aIndex); - - virtual void AppendDocStyleSheet(nsIStyleSheet* aSheet); - virtual void InsertDocStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet); - virtual void InsertDocStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet); - virtual void RemoveDocStyleSheet(nsIStyleSheet* aSheet); - virtual PRInt32 GetNumberOfDocStyleSheets(); - virtual nsIStyleSheet* GetDocStyleSheetAt(PRInt32 aIndex); - - virtual void AppendBackstopStyleSheet(nsIStyleSheet* aSheet); - virtual void InsertBackstopStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet); - virtual void InsertBackstopStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet); - virtual void RemoveBackstopStyleSheet(nsIStyleSheet* aSheet); - virtual PRInt32 GetNumberOfBackstopStyleSheets(); - virtual nsIStyleSheet* GetBackstopStyleSheetAt(PRInt32 aIndex); - - virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame); - - // xxx style rules enumeration - - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0); - -private: - // These are not supported and are not implemented! - StyleSetImpl(const StyleSetImpl& aCopy); - StyleSetImpl& operator=(const StyleSetImpl& aCopy); - -protected: - virtual ~StyleSetImpl(); - PRBool EnsureArray(nsISupportsArray** aArray); - PRInt32 RulesMatching(nsISupportsArray* aSheets, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults); - void List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets); - - nsISupportsArray* mOverrideSheets; - nsISupportsArray* mDocSheets; - nsISupportsArray* mBackstopSheets; - nsHashtable mStyleContexts; -}; - - -StyleSetImpl::StyleSetImpl() - : mOverrideSheets(nsnull), - mDocSheets(nsnull), - mBackstopSheets(nsnull) -{ - NS_INIT_REFCNT(); -} - -PRBool ReleaseContext(nsHashKey *aKey, void *aData) -{ - ((nsIStyleContext*)aData)->Release(); - return PR_TRUE; -} - -StyleSetImpl::~StyleSetImpl() -{ - NS_IF_RELEASE(mOverrideSheets); - NS_IF_RELEASE(mDocSheets); - NS_IF_RELEASE(mBackstopSheets); - mStyleContexts.Enumerate(ReleaseContext); -} - -NS_IMPL_ISUPPORTS(StyleSetImpl, kIStyleSetIID) - -PRBool StyleSetImpl::EnsureArray(nsISupportsArray** aArray) -{ - if (nsnull == *aArray) { - if (NS_OK != NS_NewISupportsArray(aArray)) { - return PR_FALSE; - } - } - return PR_TRUE; -} - -// ----- Override sheets - -void StyleSetImpl::AppendOverrideStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mOverrideSheets)) { - mOverrideSheets->AppendElement(aSheet); - } -} - -void StyleSetImpl::InsertOverrideStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mOverrideSheets)) { - PRInt32 index = mOverrideSheets->IndexOf(aAfterSheet); - mOverrideSheets->InsertElementAt(aSheet, ++index); - } -} - -void StyleSetImpl::InsertOverrideStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mOverrideSheets)) { - PRInt32 index = mOverrideSheets->IndexOf(aBeforeSheet); - mOverrideSheets->InsertElementAt(aSheet, ((-1 < index) ? index : 0)); - } -} - -void StyleSetImpl::RemoveOverrideStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (nsnull != mOverrideSheets) { - mOverrideSheets->RemoveElement(aSheet); - } -} - -PRInt32 StyleSetImpl::GetNumberOfOverrideStyleSheets() -{ - if (nsnull != mOverrideSheets) { - return mOverrideSheets->Count(); - } - return 0; -} - -nsIStyleSheet* StyleSetImpl::GetOverrideStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = nsnull; - if (nsnull == mOverrideSheets) { - sheet = (nsIStyleSheet*)mOverrideSheets->ElementAt(aIndex); - } - return sheet; -} - -// -------- Doc Sheets - -void StyleSetImpl::AppendDocStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mDocSheets)) { - mDocSheets->AppendElement(aSheet); - } -} - -void StyleSetImpl::InsertDocStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mDocSheets)) { - PRInt32 index = mDocSheets->IndexOf(aAfterSheet); - mDocSheets->InsertElementAt(aSheet, ++index); - } -} - -void StyleSetImpl::InsertDocStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mDocSheets)) { - PRInt32 index = mDocSheets->IndexOf(aBeforeSheet); - mDocSheets->InsertElementAt(aSheet, ((-1 < index) ? index : 0)); - } -} - -void StyleSetImpl::RemoveDocStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (nsnull != mDocSheets) { - mDocSheets->RemoveElement(aSheet); - } -} - -PRInt32 StyleSetImpl::GetNumberOfDocStyleSheets() -{ - if (nsnull != mDocSheets) { - return mDocSheets->Count(); - } - return 0; -} - -nsIStyleSheet* StyleSetImpl::GetDocStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = nsnull; - if (nsnull == mDocSheets) { - sheet = (nsIStyleSheet*)mDocSheets->ElementAt(aIndex); - } - return sheet; -} - -// ------ backstop sheets - -void StyleSetImpl::AppendBackstopStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mBackstopSheets)) { - mBackstopSheets->AppendElement(aSheet); - } -} - -void StyleSetImpl::InsertBackstopStyleSheetAfter(nsIStyleSheet* aSheet, - nsIStyleSheet* aAfterSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mBackstopSheets)) { - PRInt32 index = mBackstopSheets->IndexOf(aAfterSheet); - mBackstopSheets->InsertElementAt(aSheet, ++index); - } -} - -void StyleSetImpl::InsertBackstopStyleSheetBefore(nsIStyleSheet* aSheet, - nsIStyleSheet* aBeforeSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (EnsureArray(&mBackstopSheets)) { - PRInt32 index = mBackstopSheets->IndexOf(aBeforeSheet); - mBackstopSheets->InsertElementAt(aSheet, ((-1 < index) ? index : 0)); - } -} - -void StyleSetImpl::RemoveBackstopStyleSheet(nsIStyleSheet* aSheet) -{ - NS_PRECONDITION(nsnull != aSheet, "null arg"); - - if (nsnull != mBackstopSheets) { - mBackstopSheets->RemoveElement(aSheet); - } -} - -PRInt32 StyleSetImpl::GetNumberOfBackstopStyleSheets() -{ - if (nsnull != mBackstopSheets) { - return mBackstopSheets->Count(); - } - return 0; -} - -nsIStyleSheet* StyleSetImpl::GetBackstopStyleSheetAt(PRInt32 aIndex) -{ - nsIStyleSheet* sheet = nsnull; - if (nsnull == mBackstopSheets) { - sheet = (nsIStyleSheet*)mBackstopSheets->ElementAt(aIndex); - } - return sheet; -} - -PRInt32 StyleSetImpl::RulesMatching(nsISupportsArray* aSheets, - nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame, - nsISupportsArray* aResults) -{ - PRInt32 ruleCount = 0; - - if (nsnull != aSheets) { - PRInt32 sheetCount = aSheets->Count(); - PRInt32 index; - for (index = 0; index < sheetCount; index++) { - nsIStyleSheet* sheet = (nsIStyleSheet*)aSheets->ElementAt(index); - ruleCount += sheet->RulesMatching(aPresContext, aContent, aParentFrame, - aResults); - NS_RELEASE(sheet); - } - } - return ruleCount; -} - -nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext, - nsIContent* aContent, - nsIFrame* aParentFrame) -{ - nsIStyleContext* result = nsnull; - - nsIStyleContext* parentContext = nsnull; - - if (nsnull != aParentFrame) { - aParentFrame->GetStyleContext(aPresContext, parentContext); - NS_ASSERTION(nsnull != parentContext, "parent must have style context"); - } - - // want to check parent frame's context for cached child context first - - // then do a brute force rule search - - nsISupportsArray* rules = nsnull; - if (NS_OK == NS_NewISupportsArray(&rules)) { - PRInt32 ruleCount = RulesMatching(mOverrideSheets, aPresContext, aContent, aParentFrame, rules); - ruleCount += RulesMatching(mDocSheets, aPresContext, aContent, aParentFrame, rules); - ruleCount += RulesMatching(mBackstopSheets, aPresContext, aContent, aParentFrame, rules); - - // then check for cached ruleSet to context or create - ContextKey tempKey(parentContext, rules); - result = (nsIStyleContext*)mStyleContexts.Get(&tempKey); - if (nsnull == result) { - if (NS_OK == NS_NewStyleContext(&result, rules, aPresContext, aContent, aParentFrame)) { - tempKey.SetContext(result); - mStyleContexts.Put(&tempKey, result); // hashtable clones key, so this is OK (table gets first ref) - NS_ADDREF(result); // add ref for the caller -//fprintf(stdout, "+"); - } - } - else { - NS_ADDREF(result); -//fprintf(stdout, "-"); - } - NS_RELEASE(rules); - } - - NS_IF_RELEASE(parentContext); - - return result; -} - -// xxx style rules enumeration - -void StyleSetImpl::List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets) -{ - PRInt32 count = ((nsnull != aSheets) ? aSheets->Count() : 0); - - for (PRInt32 index = 0; index < count; index++) { - nsIStyleSheet* sheet = (nsIStyleSheet*)aSheets->ElementAt(index); - sheet->List(out, aIndent); - fputs("\n", out); - NS_RELEASE(sheet); - } -} - -void StyleSetImpl::List(FILE* out, PRInt32 aIndent) -{ - List(out, aIndent, mOverrideSheets); - List(out, aIndent, mDocSheets); - List(out, aIndent, mBackstopSheets); -} - - -NS_LAYOUT nsresult -NS_NewStyleSet(nsIStyleSet** aInstancePtrResult) -{ - if (aInstancePtrResult == nsnull) { - return NS_ERROR_NULL_POINTER; - } - - StyleSetImpl *it = new StyleSetImpl(); - - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kIStyleSetIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/layout/style/ua.css b/mozilla/layout/style/ua.css deleted file mode 100644 index 2ad6eb38372..00000000000 --- a/mozilla/layout/style/ua.css +++ /dev/null @@ -1,292 +0,0 @@ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -// It's probably cheaper to have a single rule per tag than to have to -// merge rules - -// XXX I'm starting to believe that this portion of the style sheet -// comes from the PresentationContext. - -// XXX temporary hack -IMPLICITP { - display: block; - margin-top: 0pt; - margin-bottom: 2pt; -} - -BODY { - font-family: "Times Roman", serif; - font-style: normal; - font-variant: normal; - font-weight: normal; - font-size: 11pt; - line-height: 1.1; - background: rgb(255,255,255); -// background: rgb(192,192,192); - color: black; - padding: 12px; - display: block; - cursor: arrow; -} - -// XXX Use this! -FRAMESET { - font-family: "Times Roman", serif; - font-style: normal; - font-variant: normal; - font-weight: normal; - font-size: medium; - background: rgb(192,192,192); - color: black; - margin: 0px; - display: block; -} - -// XXX Used when PagePreview'ing -PAGE { - margin: 10px; - background: white; - border: black solid 1px; - display: block; -} - -//---------------------------------------------------------------------- - -// This part of the ua.css is junk taken from the css1 spec and used as -// a temporary style sheet. - -UL, OL, DL { display: block; } -DT, DD { display: block; } -LI { display: list-item; } -IMG { display: inline; } -SPACER { display: inline; } -WBR { display: inline; } - -// Default list-style-type styles. -// The Navigator 3.0 rule is: -// Zeroth-level: small disc. (Needs to be handled by parser.) -// First level: disc -// second level: circle -// third and higher levels: square. -// -// These style rules assume that MENU and DIR have been mapped to UL. - -UL { - list-style-type: disc; -} - -OL UL, UL UL { - list-style-type: circle; -} - -UL UL UL, UL OL UL, OL UL UL, OL OL UL { - list-style-type: square; -} - -OL { - list-style-type: decimal; -} - -UL, OL { - padding-left: 40px; /* nav4's value */ -} - -DT { margin-bottom: 0 } -DD { margin-top: 0; margin-left: .25in; } - -A:link { color: blue; text-decoration: underline; cursor: hand; } -A:visited { color: purple; text-decoration: underline; cursor: hand; } -A:active { color: lime; text-decoration: underline; cursor: hand; } -A:out-of-date { color: red; text-decoration: underline; cursor: hand; } - -A:link IMG { border: 2px solid blue; text-decoration: underline } -A:visited IMG { border: 2px solid purple; text-decoration: underline } -A:active IMG { border: 2px solid lime; text-decoration: underline } -A:out-of-date IMG { border: 2px solid red; text-decoration: underline } - -IMG { border-style: solid; border-color: blue; } -//INPUT { border-style: solid; border-color: blue; } - -//---------------------------------------------------------------------- -// The real stuff - -HR { - display: block; - height: 3px; - margin-top: 5px; - margin-bottom: 5px; -} - -BR { - display: block; -} - -// Block tags -ADDRESS { - display: block; - font-style: italic; -} -BLOCKQUOTE { - display: block; - margin-left: .25in; - margin-right: .25in; -} -CENTER { - display: block; - text-align: center; -} -DIV { - display: block; -} -H1 { - display: block; - font-size: 22pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H2 { - display: block; - font-size: 16pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H3 { - display: block; - font-size: 13pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H4 { - display: block; - font-size: 12pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H5 { - display: block; - font-size: 9pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -H6 { - display: block; - font-size: 8pt; - font-weight: bold; - margin-top: 2pt; - margin-bottom: 2pt; -} -LISTING { - display: block; - font-family: monospace; - font-size: small; - white-space: pre; -} -NOBR { - display: inline; - white-space: pre; // XXX approximation? -} -P { - display: block; - margin-top: 2pt; - margin-bottom: 2pt; -} -PLAINTEXT, XMP, PRE { - display: block; // Note: need before and after breaks - font-family: monospace; - white-space: pre; -} - -// Table tags -TABLE { - display: block; - border-style: outset; - border-color: #C0C0C0; - cell-spacing: 4px; -} -TD { - vertical-align: middle; - border-style: inset; - border-color: #C0C0C0; -} -TH { - vertical-align: middle; - text-align: center; - font-weight: bold; - border-style: inset; - border-color: #C0C0C0; -} -CAPTION { - text-align: center; -} - -// XXX Special rule to eliminate margin around for nav4 compatability -// XXX This isn't good enough because we only want the margin eliminated -// around the first paragraph! -/*TD P, TH P { - margin-top: 0; - margin-bottom: 0; -}*/ - -// Span tags -B, STRONG { - display: inline; - font-weight: bolder; -} -I, CITE, EM, VAR { - display: inline; - font-style: italic; -} -TT, CODE, KBD, SAMP { - display: inline; - font-family: monospace; -} -U { - display: inline; - text-decoration: underline; -} -S, STRIKE { - display: inline; - text-decoration: line-through; -} -BLINK { - display: inline; - text-decoration: blink; -} -BIG { - display: inline; - font-size: larger; -} -SMALL { - display: inline; - font-size: smaller; -} -DFN, SPAN { - display: inline; -} -SUB { - display: inline; - vertical-align: sub; -} -SUP { - display: inline; - vertical-align: super; -} diff --git a/mozilla/layout/tables/nsCellMap.cpp b/mozilla/layout/tables/nsCellMap.cpp deleted file mode 100644 index 25fd456989d..00000000000 --- a/mozilla/layout/tables/nsCellMap.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCRT.h" -#include "nsCellMap.h" -#include "nsTablePart.h" -#include /* XXX */ // for printf - -#ifdef NS_DEBUG -static PRBool gsDebug1 = PR_FALSE; -#else -static const PRBool gsDebug1 = PR_FALSE; -#endif - -static PRInt32 gBytesPerPointer = sizeof(PRInt32); - -nsCellMap::nsCellMap(int aRows, int aColumns) - : mRowCount(aRows), - mColCount(aColumns) -{ - mCells = nsnull; - Reset(aRows, aColumns); -} - -nsCellMap::~nsCellMap() -{ - for (int i=0;iGetData(kStyleColorSID); - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - NS_ASSERTION(nsnull!=myColor, "bad style color"); - NS_ASSERTION(nsnull!=myBorder, "bad style border"); - - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - /* - printf("painting borders, size = %d %d %d %d\n", - myBorder->mSize.left, myBorder->mSize.top, - myBorder->mSize.right, myBorder->mSize.bottom); - */ - - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(0,128,128)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -/** -* -* Align the cell's child frame within the cell -* -**/ - -void nsTableCellFrame::VerticallyAlignChild(nsIPresContext* aPresContext) -{ - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nsStyleText* textStyle = - (nsStyleText*)mStyleContext->GetData(kStyleTextSID); - - nscoord topInset = spacing->mBorderPadding.top; - nscoord bottomInset = spacing->mBorderPadding.bottom; - PRUint8 verticalAlignFlags = NS_STYLE_VERTICAL_ALIGN_MIDDLE; - if (textStyle->mVerticalAlign.GetUnit() == eStyleUnit_Enumerated) { - verticalAlignFlags = textStyle->mVerticalAlign.GetIntValue(); - } - - nscoord height = mRect.height; - - nsRect kidRect; - mFirstChild->GetRect(kidRect); - nscoord childHeight = kidRect.height; - - - // Vertically align the child - nscoord kidYTop = 0; - switch (verticalAlignFlags) - { - case NS_STYLE_VERTICAL_ALIGN_BASELINE: - // Align the child's baseline at the max baseline - //kidYTop = aMaxAscent - kidAscent; - break; - - case NS_STYLE_VERTICAL_ALIGN_TOP: - // Align the top of the child frame with the top of the box, - // minus the top padding - kidYTop = topInset; - break; - - case NS_STYLE_VERTICAL_ALIGN_BOTTOM: - kidYTop = height - childHeight - bottomInset; - break; - - default: - case NS_STYLE_VERTICAL_ALIGN_MIDDLE: - kidYTop = height/2 - childHeight/2; - } - mFirstChild->MoveTo(kidRect.x, kidYTop); -} - -/** helper method to get the row span of this frame's content (which must be a cell) */ -PRInt32 nsTableCellFrame::GetRowSpan() -{ - PRInt32 result = 0; - nsTableCell *cellContent = (nsTableCell *)mContent; - if (nsnull!=cellContent) - { - result = cellContent->GetRowSpan(); - } - return result; -} - -/** helper method to get the col span of this frame's content (which must be a cell) */ -PRInt32 nsTableCellFrame::GetColSpan() -{ - PRInt32 result = 0; - nsTableCell *cellContent = (nsTableCell *)mContent; - if (nsnull!=cellContent) - { - result = cellContent->GetColSpan(); - } - return result; -} - -/** helper method to get the col index of this frame's content (which must be a cell) */ -PRInt32 nsTableCellFrame::GetColIndex() -{ - PRInt32 result = 0; - nsTableCell *cellContent = (nsTableCell *)mContent; - if (nsnull!=cellContent) - { - result = cellContent->GetColIndex(); - } - return result; -} - -void nsTableCellFrame::CreatePsuedoFrame(nsIPresContext* aPresContext) -{ - // Do we have a prev-in-flow? - if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame - nsBodyFrame::NewFrame(&mFirstChild, mContent, mIndexInParent, this); - mChildCount = 1; - - // Resolve style and set the style context - nsIStyleContext* styleContext = - aPresContext->ResolveStyleContextFor(mContent, this); // styleContext: ADDREF++ - mFirstChild->SetStyleContext(styleContext); - NS_RELEASE(styleContext); // styleContext: ADDREF-- - } else { - nsTableCellFrame* prevFrame = (nsTableCellFrame *)mPrevInFlow; - - nsIFrame* prevPseudoFrame = prevFrame->mFirstChild; - NS_ASSERTION(prevFrame->ChildIsPseudoFrame(prevPseudoFrame), "bad previous pseudo-frame"); - - // Create a continuing column - prevPseudoFrame->CreateContinuingFrame(aPresContext, this, mFirstChild); - mChildCount = 1; - } -} - -/** - */ -NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); - -#ifdef NS_DEBUG - //PreReflowCheck(); -#endif - - aStatus = frComplete; - if (gsDebug==PR_TRUE) - printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - - mFirstContentOffset = mLastContentOffset = 0; - - nsSize availSize(aMaxSize); - nsSize maxElementSize; - nsSize *pMaxElementSize = aMaxElementSize; - if (NS_UNCONSTRAINEDSIZE==aMaxSize.width) - pMaxElementSize = &maxElementSize; - nsReflowMetrics kidSize; - nscoord x = 0; - // SEC: what about ascent and decent??? - - // Compute the insets (sum of border and padding) - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nscoord topInset = spacing->mBorderPadding.top; - nscoord rightInset = spacing->mBorderPadding.right; - nscoord bottomInset = spacing->mBorderPadding.bottom; - nscoord leftInset = spacing->mBorderPadding.left; - - // reduce available space by insets - if (NS_UNCONSTRAINEDSIZE!=availSize.width) - availSize.width -= leftInset+rightInset; - if (NS_UNCONSTRAINEDSIZE!=availSize.height) - availSize.height -= topInset+bottomInset; - - mLastContentIsComplete = PR_TRUE; - - // get frame, creating one if needed - if (nsnull==mFirstChild) - { - CreatePsuedoFrame(aPresContext); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - if (availSize.height < 0) - availSize.height = 1; - nsSize maxKidElementSize; - if (gsDebug==PR_TRUE) - printf(" nsTableCellFrame::ResizeReflow calling ReflowChild with availSize=%d,%d\n", - availSize.width, availSize.height); - aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, availSize, pMaxElementSize); - - if (gsDebug==PR_TRUE) - { - if (nsnull!=pMaxElementSize) - printf(" nsTableCellFrame::ResizeReflow: child returned desiredSize=%d,%d,\ - and maxElementSize=%d,%d\n", - kidSize.width, kidSize.height, - pMaxElementSize->width, pMaxElementSize->height); - else - printf(" nsTableCellFrame::ResizeReflow: child returned desiredSize=%d,%d,\ - and maxElementSize=nsnull\n", - kidSize.width, kidSize.height); - } - - SetFirstContentOffset(mFirstChild); - if (gsDebug) printf("CELL: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - SetLastContentOffset(mFirstChild); - if (gsDebug) printf("CELL: set last content offset to %d\n", GetLastContentOffset()); //@@@ - - // Place the child since some of it's content fit in us. - mFirstChild->SetRect(nsRect(leftInset + x, topInset, - kidSize.width, kidSize.height)); - - - if (frNotComplete == aStatus) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - } - - // Return our size and our result - PRInt32 kidWidth = kidSize.width; - if (NS_UNCONSTRAINEDSIZE!=kidSize.width) //&& NS_UNCONSTRAINEDSIZE!=aMaxSize.width) - kidWidth += leftInset + rightInset; - PRInt32 kidHeight = kidSize.height; - - // height can be set w/o being restricted by aMaxSize.height - if (NS_UNCONSTRAINEDSIZE!=kidSize.height) - kidHeight += topInset + bottomInset; - aDesiredSize.width = kidWidth; - aDesiredSize.height = kidHeight; - aDesiredSize.ascent = topInset; - aDesiredSize.descent = bottomInset; - - if (nsnull!=aMaxElementSize) - { - *aMaxElementSize = *pMaxElementSize; - aMaxElementSize->height += topInset + bottomInset; - aMaxElementSize->width += leftInset + rightInset; - } - - if (gsDebug==PR_TRUE) - printf(" nsTableCellFrame::ResizeReflow returning aDesiredSize=%d,%d\n", - aDesiredSize.width, aDesiredSize.height); - -#ifdef NS_DEBUG - //PostReflowCheck(result); -#endif - - return NS_OK; -} - -NS_METHOD nsTableCellFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n"); - // total hack for now, just some hard-coded values - ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - return NS_OK; -} - -NS_METHOD nsTableCellFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableCellFrame* cf = new nsTableCellFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - - -/* ----- static methods ----- */ - -nsresult nsTableCellFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableCellFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h deleted file mode 100644 index c41849660b4..00000000000 --- a/mozilla/layout/tables/nsTableCellFrame.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableCellFrame_h__ -#define nsTableCellFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" -#include "nsTableCell.h" - -/** - * nsTableCellFrame - * data structure to maintain information about a single table cell's frame - * - * @author sclark - */ -class nsTableCellFrame : public nsContainerFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** - * @see nsContainerFrame - */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - void VerticallyAlignChild(nsIPresContext* aPresContext); - - /** return the mapped cell's row span. Always >= 1. */ - virtual PRInt32 GetRowSpan(); - - /** return the mapped cell's col span. Always >= 1. */ - virtual PRInt32 GetColSpan(); - - /** return the mapped cell's column index (starting at 0 for the first column) */ - virtual PRInt32 GetColIndex(); - - virtual ~nsTableCellFrame(); - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableCellFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** Create a psuedo-frame for this caption. Handles continuing frames as needed. - */ - virtual void CreatePsuedoFrame(nsIPresContext* aPresContext); - - -}; - - -#endif diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp deleted file mode 100644 index f9bee13cc80..00000000000 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableColGroupFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" - -static PRBool gsDebug = PR_FALSE; - - -nsTableColGroupFrame::nsTableColGroupFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame) -{ -} - -nsTableColGroupFrame::~nsTableColGroupFrame() -{ -} - -NS_METHOD nsTableColGroupFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::Paint\n"); - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - - -NS_METHOD -nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad arg"); - if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n"); - aDesiredSize.width=0; - aDesiredSize.height=0; - if (nsnull!=aMaxElementSize) - { - aMaxElementSize->width=0; - aMaxElementSize->height=0; - } - aStatus = nsIFrame::frComplete; - return NS_OK; -} - -NS_METHOD -nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad arg"); - if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n"); - return NS_OK; -} - -nsresult nsTableColGroupFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableColGroupFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/tables/nsTableColGroupFrame.h b/mozilla/layout/tables/nsTableColGroupFrame.h deleted file mode 100644 index e2a93f7a00b..00000000000 --- a/mozilla/layout/tables/nsTableColGroupFrame.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableColGroupFrame_h__ -#define nsTableColGroupFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - - -/** - * nsTableColGroupFrame - * data structure to maintain information about a single table cell's frame - * - * @author sclark - */ -class nsTableColGroupFrame : public nsContainerFrame -{ -public: - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - -protected: - - nsTableColGroupFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - ~nsTableColGroupFrame(); - -}; - -#endif diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp deleted file mode 100644 index 2efa9daef97..00000000000 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ /dev/null @@ -1,2939 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableFrame.h" -#include "nsTablePart.h" -#include "nsIRenderingContext.h" -#include "nsIStyleContext.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsCellMap.h" -#include "nsTableContent.h" -#include "nsTableCell.h" -#include "nsTableCellFrame.h" -#include "nsTableCol.h" -#include "nsTableRowFrame.h" -#include "nsTableRowGroupFrame.h" -#include "nsColLayoutData.h" -#include "nsIPresContext.h" -#include "nsCSSRendering.h" -#include "nsStyleConsts.h" -#include "nsCellLayoutData.h" -#include "nsVoidArray.h" -#include "prinrval.h" -#include "nsIPtr.h" - - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_TRUE; -static PRBool gsDebugCLD = PR_FALSE; -static PRBool gsTiming = PR_FALSE; -static PRBool gsDebugMBP = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -#else -static const PRBool gsDebug = PR_FALSE; -static const PRBool gsDebugCLD = PR_FALSE; -static const PRBool gsTiming = PR_FALSE; -static const PRBool gsDebugMBP = PR_FALSE; -#endif - -#ifndef max -#define max(x, y) ((x) > (y) ? (x) : (y)) -#endif - -static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID); -static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID); -static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); -NS_DEF_PTR(nsTableContent); -NS_DEF_PTR(nsTableCol); -NS_DEF_PTR(nsTableCell); - -/* ----------- InnerTableReflowState ---------- */ - -struct InnerTableReflowState { - - // The body's style molecule - - // The body's available size (computed from the body's parent) - nsSize availSize; - - nscoord leftInset, topInset; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Running y-offset - nscoord y; - - // Flag for whether we're dealing with the first interior row group - PRBool firstRowGroup; - - // a list of the footers in this table frame, for quick access when inserting bodies - nsVoidArray *footerList; - - // cache the total height of the footers for placing body rows - nscoord footerHeight; - - InnerTableReflowState(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsStyleSpacing* aStyleSpacing) - { - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - y=0; // border/padding/margin??? - - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - availSize.width = aMaxSize.width; - if (!unconstrainedWidth) { - availSize.width -= aStyleSpacing->mBorderPadding.left + - aStyleSpacing->mBorderPadding.right; - } - leftInset = aStyleSpacing->mBorderPadding.left; - - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - availSize.height = aMaxSize.height; - if (!unconstrainedHeight) { - availSize.height -= aStyleSpacing->mBorderPadding.top + - aStyleSpacing->mBorderPadding.bottom; - } - topInset = aStyleSpacing->mBorderPadding.top; - - firstRowGroup = PR_TRUE; - footerHeight = 0; - footerList = nsnull; - } - - ~InnerTableReflowState() { - if (nsnull!=footerList) - delete footerList; - } -}; - - - -/* ----------- SpanInfo ---------- */ - -struct SpanInfo -{ - PRInt32 span; - PRInt32 cellMinWidth; - PRInt32 cellDesiredWidth; - - SpanInfo(PRInt32 aSpan, PRInt32 aMinWidth, PRInt32 aDesiredWidth) - { - span = aSpan; - cellMinWidth = aMinWidth; - cellDesiredWidth = aDesiredWidth; - }; - - ~SpanInfo() {}; -}; - - - -/* ----------- nsTableFrame ---------- */ - - -nsTableFrame::nsTableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mColumnLayoutData(nsnull), - mColumnWidths(nsnull), - mFirstPassValid(PR_FALSE), - mPass(kPASS_UNDEFINED), - mIsInvariantWidth(PR_FALSE) -{ -} - -/** - * Method to delete all owned objects assoicated - * with the ColumnLayoutObject instance variable - */ -void nsTableFrame::DeleteColumnLayoutData() -{ - if (nsnull!=mColumnLayoutData) - { - PRInt32 numCols = mColumnLayoutData->Count(); - for (PRInt32 i = 0; iElementAt(i)); - delete colData; - } - delete mColumnLayoutData; - mColumnLayoutData = nsnull; - } -} - -nsTableFrame::~nsTableFrame() -{ - DeleteColumnLayoutData(); - if (nsnull!=mColumnWidths) - delete [] mColumnWidths; -} - - - -/** -* Lists the column layout data which turns -* around and lists the cell layout data. -* This is for debugging purposes only. -*/ -void nsTableFrame::ListColumnLayoutData(FILE* out, PRInt32 aIndent) const -{ - // if this is a continuing frame, there will be no output - if (nsnull!=mColumnLayoutData) - { - fprintf(out,"Column Layout Data \n"); - - PRInt32 numCols = mColumnLayoutData->Count(); - for (PRInt32 i = 0; iElementAt(i)); - - for (PRInt32 indent = aIndent; --indent >= 0; ) fputs(" ", out); - fprintf(out,"Column Data [%d] \n",i); - colData->List(out,aIndent+2); - } - } -} - - -/** - * Find the CellLayoutData assocated with the TableCell -**/ -nsCellLayoutData* nsTableFrame::FindCellLayoutData(nsTableCell* aCell) -{ - if (aCell != nsnull) - { - if (nsnull!=mColumnLayoutData) - { - PRInt32 numCols = mColumnLayoutData->Count(); - for (PRInt32 i = 0; iElementAt(i)); - PRInt32 index = colLayoutData->IndexOf(aCell); - if (index != -1) - return colLayoutData->ElementAt(index); - } - } - } - return nsnull; -} - - -/** - * For the TableCell in CellData, find the CellLayoutData assocated - * and add it to the list -**/ -void nsTableFrame::AppendLayoutData(nsVoidArray* aList, nsTableCell* aTableCell) -{ - - if (aTableCell != nsnull) - { - nsCellLayoutData* layoutData = FindCellLayoutData(aTableCell); - if (layoutData != nsnull) - aList->AppendElement((void*)layoutData); - } -} - -void nsTableFrame::RecalcLayoutData() -{ - - nsTablePart* table = (nsTablePart*)mContent; - nsCellMap* cellMap = table->GetCellMap(); - PRInt32 colCount = cellMap->GetColCount(); - PRInt32 rowCount = cellMap->GetRowCount(); - PRInt32 row = 0; - PRInt32 col = 0; - - nsTableCell* above = nsnull; - nsTableCell* below = nsnull; - nsTableCell* left = nsnull; - nsTableCell* right = nsnull; - - - PRInt32 edge = 0; - nsVoidArray* boundaryCells[4]; - - for (edge = 0; edge < 4; edge++) - boundaryCells[edge] = new nsVoidArray(); - - - if (colCount != 0 && rowCount != 0) - { - for (row = 0; row < rowCount; row++) - { - for (col = 0; col < colCount; col++) - { - CellData* cellData = cellMap->GetCellAt(row,col); - nsTableCell* cell = cellData->mCell; - - if (!cell) - continue; - - PRInt32 colSpan = cell->GetColSpan(); - PRInt32 rowSpan = cell->GetRowSpan(); - - // clear the cells for all for edges - for (edge = 0; edge < 4; edge++) - boundaryCells[edge]->Clear(); - - - // Check to see if the cell data represents the top,left - // corner of a a table cell - - // Check to see if cell the represents a left edge cell - if (row == 0) - above = nsnull; - else - { - cellData = cellMap->GetCellAt(row-1,col); - if (cellData != nsnull) - above = cellData->mCell; - - // Does the cell data point to the same cell? - // If it is, then continue - if (above != nsnull && above == cell) - continue; - } - - // Check to see if cell the represents a top edge cell - if (col == 0) - left = nsnull; - else - { - cellData = cellMap->GetCellAt(row,col-1); - if (cellData != nsnull) - left = cellData->mCell; - - if (left != nsnull && left == cell) - continue; - } - - // If this is the top,left edged cell - // Then add the cells on the for edges to the array - - // Do the top and bottom edge - PRInt32 r,c; - PRInt32 r1,r2; - PRInt32 c1,c2; - PRInt32 last; - - - r1 = row - 1; - r2 = row + rowSpan; - c = col; - last = col + colSpan -1; - - while (c <= last) - { - if (r1 != -1) - { - // Add top edge cells - if (c != col) - { - cellData = cellMap->GetCellAt(r1,c); - if (cellData->mCell != above) - { - above = cellData->mCell; - if (above != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_TOP],above); - } - } - else if (above != nsnull) - { - AppendLayoutData(boundaryCells[NS_SIDE_TOP],above); - } - } - - if (r2 < rowCount) - { - // Add bottom edge cells - cellData = cellMap->GetCellAt(r2,c); - if (cellData->mCell != below) - { - below = cellData->mCell; - if (below != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_BOTTOM],below); - } - } - c++; - } - - // Do the left and right edge - c1 = col - 1; - c2 = col + colSpan; - r = row ; - last = row + rowSpan-1; - - while (r <= last) - { - // Add left edge cells - if (c1 != -1) - { - if (r != row) - { - cellData = cellMap->GetCellAt(r,c1); - if (cellData->mCell != left) - { - left = cellData->mCell; - if (left != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_LEFT],left); - } - } - else if (left != nsnull) - { - AppendLayoutData(boundaryCells[NS_SIDE_LEFT],left); - } - } - - if (c2 < colCount) - { - // Add right edge cells - cellData = cellMap->GetCellAt(r,c2); - if (cellData->mCell != right) - { - right = cellData->mCell; - if (right != nsnull) - AppendLayoutData(boundaryCells[NS_SIDE_RIGHT],right); - } - } - r++; - } - - nsCellLayoutData* cellLayoutData = FindCellLayoutData(cell); - cellLayoutData->RecalcLayoutData(this,boundaryCells); - } - } - } - for (edge = 0; edge < 4; edge++) - delete boundaryCells[edge]; - -} - - - - -/* SEC: TODO: adjust the rect for captions */ -NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // table paint code is concerned primarily with borders and bg color - nsStyleColor* myColor = - (nsStyleColor*)mStyleContext->GetData(kStyleColorSID); - nsStyleBorder* myBorder = - (nsStyleBorder*)mStyleContext->GetData(kStyleBorderSID); - NS_ASSERTION(nsnull != myColor, "null style color"); - NS_ASSERTION(nsnull != myBorder, "null style border"); - if (nsnull!=myBorder) - { - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myBorder, 0); - } - - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(0,128,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -PRBool nsTableFrame::NeedsReflow(const nsSize& aMaxSize) -{ - PRBool result = PR_TRUE; - if (PR_TRUE==mIsInvariantWidth) - result = PR_FALSE; - // TODO: other cases... - return result; -} - -// SEC: TODO need to worry about continuing frames prev/next in flow for splitting across pages. -// SEC: TODO need to keep "first pass done" state, update it when ContentChanged notifications come in - -/* overview: - if mFirstPassValid is false, this is our first time through since content was last changed - set pass to 1 - do pass 1 - get min/max info for all cells in an infinite space - do column balancing - set mFirstPassValid to true - do pass 2 - if pass is 1, - set pass to 2 - use column widths to ResizeReflow cells - shrinkWrap Cells in each row to tallest, realigning contents within the cell -*/ - -/** Layout the entire inner table. - */ -NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - NS_PRECONDITION(nsnull != aPresContext, "null arg"); - if (gsDebug==PR_TRUE) - { - printf("-----------------------------------------------------------------\n"); - printf("nsTableFrame::ResizeReflow: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - } - -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - aStatus = frComplete; - - PRIntervalTime startTime; - if (gsTiming) { - startTime = PR_IntervalNow(); - } - - if (PR_TRUE==gsDebug) - printf ("*** tableframe reflow\t\t%p\n", this); - - if (PR_TRUE==NeedsReflow(aMaxSize)) - { - if (PR_FALSE==IsFirstPassValid()) - { // we treat the table as if we've never seen the layout data before - mPass = kPASS_FIRST; - aStatus = ResizeReflowPass1(aPresContext, aDesiredSize, - aMaxSize, aMaxElementSize); - // check result - } - mPass = kPASS_SECOND; - - // assign column widths, and assign aMaxElementSize->width - BalanceColumnWidths(aPresContext, aMaxSize, aMaxElementSize); - - // assign table width - SetTableWidth(aPresContext); - - aStatus = ResizeReflowPass2(aPresContext, aDesiredSize, aMaxSize, - aMaxElementSize, 0, 0); - - if (gsTiming) { - PRIntervalTime endTime = PR_IntervalNow(); - printf("Table reflow took %ld ticks for frame %d\n", - endTime-startTime, this);/* XXX need to use LL_* macros! */ - } - - mPass = kPASS_UNDEFINED; - } - else - { - // set aDesiredSize and aMaxElementSize - } - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - - return NS_OK; -} - -/** the first of 2 reflow passes - * lay out the captions and row groups in an infinite space (NS_UNCONSTRAINEDSIZE) - * cache the results for each caption and cell. - * if successful, set mFirstPassValid=PR_TRUE, so we know we can skip this step - * next time. mFirstPassValid is set to PR_FALSE when content is changed. - * NOTE: should never get called on a continuing frame! All cached pass1 state - * is stored in the inner table first-in-flow. - */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - NS_ASSERTION(nsnull!=aPresContext, "bad pres context param"); - NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame."); - - if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this); - ReflowStatus result = frComplete; - - mChildCount = 0; - mFirstContentOffset = mLastContentOffset = 0; - - nsIContent* c = mContent; - NS_ASSERTION(nsnull != c, "null content"); - ((nsTablePart *)c)->GetMaxColumns(); // as a side effect, does important initialization - - nsSize availSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); // availSize is the space available at any given time in the process - nsSize maxSize(0, 0); // maxSize is the size of the largest child so far in the process - nsSize kidMaxSize(0,0); - nsSize* pKidMaxSize = (nsnull != aMaxElementSize) ? &kidMaxSize : nsnull; - nsReflowMetrics kidSize; - nscoord y = 0; - nscoord maxAscent = 0; - nscoord maxDescent = 0; - PRInt32 kidIndex = 0; - PRInt32 lastIndex = c->ChildCount(); - PRInt32 contentOffset=0; - nsIFrame* prevKidFrame = nsnull;/* XXX incremental reflow! */ - - // Compute the insets (sum of border and padding) - nsStyleSpacing* spacing = - (nsStyleSpacing*)mStyleContext->GetData(kStyleSpacingSID); - nscoord topInset = spacing->mBorderPadding.top; - nscoord rightInset = spacing->mBorderPadding.right; - nscoord bottomInset =spacing->mBorderPadding.bottom; - nscoord leftInset = spacing->mBorderPadding.left; - - /* assumes that Table's children are in the following order: - * Captions - * ColGroups, in order - * THead, in order - * TFoot, in order - * TBody, in order - */ - for (;;) { - nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ - if (kid.IsNull()) { - result = frComplete; - break; - } - - mLastContentIsComplete = PR_TRUE; - - const PRInt32 contentType = ((nsTableContent *)(nsIContent*)kid)->GetType(); - if (contentType==nsITableContent::kTableRowGroupType) - { - // Resolve style - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - NS_ASSERTION(kidStyleContext.IsNotNull(), "null style context for kid"); - - // SEC: TODO: when content is appended or deleted, be sure to clear out the frame hierarchy!!!! - - // get next frame, creating one if needed - nsIFrame* kidFrame=nsnull; - if (nsnull!=prevKidFrame) - prevKidFrame->GetNextSibling(kidFrame); // no need to check for an error, just see if it returned null... - else - ChildAt(0, kidFrame); - - // if this is the first time, allocate the caption frame - if (nsnull==kidFrame) - { - nsIContentDelegate* kidDel; - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, contentOffset, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidStyleContext); - } - - nsSize maxKidElementSize; - result = ReflowChild(kidFrame, aPresContext, kidSize, availSize, pKidMaxSize); - - // Place the child since some of it's content fit in us. - if (gsDebug) { - if (nsnull != pKidMaxSize) { - printf ("reflow of row group returned desired=%d,%d, max-element=%d,%d\n", - kidSize.width, kidSize.height, pKidMaxSize->width, pKidMaxSize->height); - } else { - printf ("reflow of row group returned desired=%d,%d\n", kidSize.width, kidSize.height); - } - } - PRInt32 yCoord = y; - if (NS_UNCONSTRAINEDSIZE!=yCoord) - yCoord+= topInset; - kidFrame->SetRect(nsRect(leftInset, yCoord, - kidSize.width, kidSize.height)); - if (NS_UNCONSTRAINEDSIZE==kidSize.height) - y = NS_UNCONSTRAINEDSIZE; - else - y += kidSize.height; - if (nsnull != pKidMaxSize) { - if (pKidMaxSize->width > maxSize.width) { - maxSize.width = pKidMaxSize->width; - } - if (pKidMaxSize->height > maxSize.height) { - maxSize.height = pKidMaxSize->height; - } - } - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - // Our first child (**blush**) - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - if (gsDebug) printf("INNER: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - } - prevKidFrame = kidFrame; - mChildCount++; - - if (frNotComplete == result) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - break; - } - } - contentOffset++; - kidIndex++; - if (frNotComplete == result) { - // If the child didn't finish layout then it means that it used - // up all of our available space (or needs us to split). - mLastContentIsComplete = PR_FALSE; - break; - } - } - - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "unexpected last child"); - // can't use SetLastContentOffset here - mLastContentOffset = contentOffset-1; // takes into account colGroup frame we're not using - if (gsDebug) printf("INNER: set last content offset to %d\n", GetLastContentOffset()); //@@@ - } - - mFirstPassValid = PR_TRUE; - - return result; -} - -/** the second of 2 reflow passes - */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth) -{ - if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this); - if (gsDebug==PR_TRUE) - printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - - ReflowStatus result = frComplete; - - // now that we've computed the column width information, reflow all children - nsIContent* c = mContent; - NS_ASSERTION(nsnull != c, "null kid"); - nsSize kidMaxSize(0,0); - - PRInt32 kidIndex = 0; - PRInt32 lastIndex = c->ChildCount(); - nsIFrame* prevKidFrame = nsnull;/* XXX incremental reflow! */ - -#ifdef NS_DEBUG - //PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - PRBool reflowMappedOK = PR_TRUE; - ReflowStatus status = frComplete; - - // Check for an overflow list - MoveOverflowToChildList(); - - nsStyleSpacing* mySpacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - InnerTableReflowState state(aPresContext, aMaxSize, mySpacing); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - status = frNotComplete; - } - } - - // Did we successfully reflow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - status = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - status = ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - status = frNotComplete; - } - } - } - - // Return our size and our status - - if (frComplete == status) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - //NS_ASSERTION(0width, aMaxElementSize->height); - else - printf("Reflow complete, returning aDesiredSize = %d,%d and NSNULL aMaxElementSize\n", - aDesiredSize.width, aDesiredSize.height); - } - - // SEC: assign our real width and height based on this reflow step and return - - mPass = kPASS_UNDEFINED; // we're no longer in-process - -#ifdef NS_DEBUG - //PostReflowCheck(status); -#endif - - return status; - -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableFrame::GetTopMarginFor(nsIPresContext* aCX, - InnerTableReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableFrame::PlaceChild(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug) - printf ("table: placing row group at %d, %d, %d, %d\n", - aKidRect.x, aKidRect.y, aKidRect.width, aKidRect.height); - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - // If this is a footer row group, add it to the list of footer row groups - nsIAtom * tFootTag = NS_NewAtom(nsTablePart::kRowGroupFootTagString); // tFootTag: REFCNT++ - nsIAtom *kidType=nsnull; - ((nsTableRowGroupFrame *)aKidFrame)->GetRowGroupType(kidType); - if (tFootTag==kidType) - { - if (nsnull==aState.footerList) - aState.footerList = new nsVoidArray(); - aState.footerList->AppendElement((void *)aKidFrame); - aState.footerHeight += aKidRect.height; - } - // else if this is a body row group, push down all the footer row groups - else - { - // don't bother unless there are footers to push down - if (nsnull!=aState.footerList && 0!=aState.footerList->Count()) - { - nsPoint origin; - aKidFrame->GetOrigin(origin); - origin.y -= aState.footerHeight; - aKidFrame->MoveTo(origin.x, origin.y); - nsIAtom * tBodyTag = NS_NewAtom(nsTablePart::kRowGroupBodyTagString); // tBodyTag: REFCNT++ - if (tBodyTag==kidType) - { - PRInt32 numFooters = aState.footerList->Count(); - for (PRInt32 footerIndex = 0; footerIndex < numFooters; footerIndex++) - { - nsTableRowGroupFrame * footer = (nsTableRowGroupFrame *)(aState.footerList->ElementAt(footerIndex)); - NS_ASSERTION(nsnull!=footer, "bad footer list in table inner frame."); - if (nsnull!=footer) - { - footer->GetOrigin(origin); - origin.y += aKidRect.height; - footer->MoveTo(origin.x, origin.y); - } - } - } - NS_RELEASE(tBodyTag); - } - } - NS_RELEASE(tFootTag); - - // Update the maximum element size - if (PR_TRUE==aState.firstRowGroup) - { - aState.firstRowGroup = PR_FALSE; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aKidMaxElementSize.width; - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableFrame* flow = (nsTableFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool originalLastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - if (((nsTableContent *)(nsIContent*)kid)->GetType() == nsITableContent::kTableRowGroupType) - { // skip children that are not row groups - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width -= kidSpacing->mMargin.left + - kidSpacing->mMargin.right; - } - - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidFrame != mFirstChild) && (desiredSize.height > kidAvailSize.height)) - { - // The child is too wide to fit in the available space, and it's - // not our first child - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - nsRect kidRect (0, 0, desiredSize.width, desiredSize.height); - kidRect.x += aState.leftInset + kidSpacing->mMargin.left; - kidRect.y += aState.topInset + aState.y ; - PlaceChild(aPresContext, aState, kidFrame, kidRect, - aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - // Special handling for incomplete children - if (frNotComplete == status) { - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count - mChildCount = childCount; -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); -#endif - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableFrame* flow = (nsTableFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableFrame* flow = (nsTableFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableFrame* nextInFlow = (nsTableFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - if ((kidFrameSize.height > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Advance y by the topMargin between children. Zero out the - // topMargin in case this frame is continued because - // continuations do not have a top margin. Update the prev - // bottom margin state in the body reflow state so that we can - // apply the bottom margin when we hit the next child (or - // finish). - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - //kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* contentParent; - - kidFrame->GetContentParent(contentParent); - if (nextInFlow == contentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsTableFrame* prev = (nsTableFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - break; - } - - // Resolve style for the child - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(kid, this); - - // Figure out how we should treat the child - nsIFrame* kidFrame; - - // Create a child frame - if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel = nsnull; - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - // Advance y by the topMargin between children. Zero out the - // topMargin in case this frame is continued because - // continuations do not have a top margin. Update the prev - // bottom margin state in the body reflow state so that we can - // apply the bottom margin when we hit the next child (or - // finish). - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - } - - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - - -/** - Now I've got all the cells laid out in an infinite space. - For each column, use the min size for each cell in that column - along with the attributes of the table, column group, and column - to assign widths to each column. - */ -// use the cell map to determine which cell is in which column. -void nsTableFrame::BalanceColumnWidths(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - if (gsDebug) - printf ("BalanceColumnWidths...\n"); - - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - if (nsnull==mColumnWidths) - { - mColumnWidths = new PRInt32[numCols]; - // SEC should be a memset - for (PRInt32 i = 0; iGetData(kStyleSpacingSID); - - // need to figure out the overall table width constraint - // default case, get 100% of available space - PRInt32 maxWidth; - nsStylePosition* position = - (nsStylePosition*)mStyleContext->GetData(kStylePositionSID); - switch (position->mWidthFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - maxWidth = position->mWidth; - break; - case NS_STYLE_POSITION_VALUE_PERCENT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - // XXX for now these fall through - - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - maxWidth = aMaxSize.width; - break; - } - - // now, if maxWidth is not NS_UNCONSTRAINED, subtract out my border - // and padding - if (NS_UNCONSTRAINEDSIZE!=maxWidth) - { - maxWidth -= spacing->mBorderPadding.left + spacing->mBorderPadding.right; - if (0>maxWidth) // nonsense style specification - maxWidth = 0; - } - - if (gsDebug) printf (" maxWidth=%d from aMaxSize=%d,%d\n", maxWidth, aMaxSize.width, aMaxSize.height); - - // Step 1 - assign the width of all fixed-width columns - AssignFixedColumnWidths(aPresContext, maxWidth, numCols, - totalFixedWidth, minTableWidth, maxTableWidth); - - if (nsnull!=aMaxElementSize) - { - aMaxElementSize->width = minTableWidth; - if (gsDebug) printf(" setting aMaxElementSize->width = %d\n", aMaxElementSize->width); - } - else - { - if (gsDebug) printf(" nsnull aMaxElementSize\n"); - } - - // Step 2 - assign the width of all proportional-width columns in the remaining space - PRInt32 availWidth=maxWidth - totalFixedWidth; - if (gsDebug==PR_TRUE) printf ("Step 2...\n availWidth = %d\n", availWidth); - if (TableIsAutoWidth()) - { - if (gsDebug==PR_TRUE) printf (" calling BalanceProportionalColumnsForAutoWidthTable\n"); - BalanceProportionalColumnsForAutoWidthTable(aPresContext, - availWidth, maxWidth, - minTableWidth, maxTableWidth); - } - else - { - if (gsDebug==PR_TRUE) printf (" calling BalanceProportionalColumnsForSpecifiedWidthTable\n"); - BalanceProportionalColumnsForSpecifiedWidthTable(aPresContext, - availWidth, maxWidth, - minTableWidth, maxTableWidth); - } - -/* -STEP 1 -for every col - if the col has a fixed width - set the width to max(fixed width, maxElementSize) - if the cell spans columns, divide the cell width between the columns - else skip it for now - -take borders and padding into account - -STEP 2 -determine the min and max size for the table width -if col is proportionately specified - if (col width specified to 0) - col width = minColWidth - else if (minTableWidth >= aMaxSize.width) - set col widths to min, install a hor. scroll bar - else if (maxTableWidth <= aMaxSize.width) - set each col to its max size - else - W = aMaxSize.width - minTableWidth - D = maxTableWidth - minTableWidth - for each col - d = maxColWidth - minColWidth - col width = minColWidth + ((d*W)/D) - -STEP 3 -if there is space left over - for every col - if col is proportionately specified - add space to col width until it is that proportion of the table width - do this non-destructively in case there isn't enough space - if there isn't enough space as determined in the prior step, - add space in proportion to the proportionate width attribute - */ - -} - -// Step 1 - assign the width of all fixed-width columns, -// and calculate min/max table width -PRBool nsTableFrame::AssignFixedColumnWidths(nsIPresContext* aPresContext, - PRInt32 maxWidth, - PRInt32 aNumCols, - PRInt32 &aTotalFixedWidth, - PRInt32 &aMinTableWidth, - PRInt32 &aMaxTableWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - if (gsDebug==PR_TRUE) printf (" AssignFixedColumnWidths\n"); - nsVoidArray *spanList=nsnull; - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - NS_ASSERTION(nsnull != colData, "bad column data"); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - NS_ASSERTION(col.IsNotNull(), "bad col"); - - // need to track min/max column width for setting min/max table widths - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - nsVoidArray *cells = colData->GetCells(); - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for column %d numCells = %d\n", colIndex, numCells); - -#if XXX_need_access_to_column_frame_help - // Get the columns's style - nsIStyleContextPtr colSC; - colFrame->GetStyleContext(aPresContext, colSC.AssignRef()); - nsStylePosition* colPosition = (nsStylePosition*) - colSC->GetData(kStylePositionSID); - - // Get column width if it has one - PRBool haveColWidth = PR_FALSE; - nscoord colWidth; - switch (colPosition->mWidthFlags) { - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - break; - - case NS_STYLE_POSITION_VALUE_LENGTH: - haveColWidth = PR_TRUE; - colWidth = colPosition->mWidth; - break; - - case NS_STYLE_POSITION_VALUE_PCT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - //XXX haveColWidth = PR_TRUE; - //XXX colWidth = colPosition->mWidthPCT * something; - break; - } -#endif - - /* Scan the column, simulatneously assigning fixed column widths - * and computing the min/max column widths - */ - // first, deal with any cells that span into this column from a pervious column - if (nsnull!=spanList) - { - PRInt32 spanCount = spanList->Count(); - // go through the list backwards so we can delete easily - for (PRInt32 spanIndex=spanCount-1; 0<=spanIndex; spanIndex--) - { - SpanInfo *spanInfo = (SpanInfo *)(spanList->ElementAt(spanIndex)); - if (minColWidth < spanInfo->cellMinWidth) - minColWidth = spanInfo->cellMinWidth; - if (maxColWidth < spanInfo->cellDesiredWidth) - maxColWidth = spanInfo->cellDesiredWidth; - spanInfo->span--; - if (gsDebug==PR_TRUE) - printf (" for spanning cell %d with remaining span=%d, min = %d and des = %d\n", - spanIndex, spanInfo->span, spanInfo->cellMinWidth, spanInfo->cellDesiredWidth); - if (0==spanInfo->span) - { - spanList->RemoveElementAt(spanIndex); - delete spanInfo; - } - } - } - - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - nsSize * cellMinSize = data->GetMaxElementSize(); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - PRInt32 colSpan = data->GetCellFrame()->GetColSpan(); - if (gsDebug==PR_TRUE) - printf (" for cell %d with colspan=%d, min = %d,%d and des = %d,%d\n", - cellIndex, colSpan, cellMinSize->width, cellMinSize->height, - cellDesiredSize->width, cellDesiredSize->height); - - PRBool haveCellWidth = PR_FALSE; - nscoord cellWidth; - - /* - * The first cell in a column (in row 0) has special standing. - * if the first cell has a width specification, it overrides the - * COL width - */ - if (0==cellIndex) - { - nsCellLayoutData * data = (nsCellLayoutData *)(cells->ElementAt(0)); - nsTableCellFrame *cellFrame = data->GetCellFrame(); - nsTableCellPtr cell; - cellFrame->GetContent((nsIContent*&)(cell.AssignRef())); // cell: REFCNT++ - - // Get the cell's style - nsIStyleContextPtr cellSC; - cellFrame->GetStyleContext(aPresContext, cellSC.AssignRef()); - nsStylePosition* cellPosition = (nsStylePosition*) - cellSC->GetData(kStylePositionSID); - switch (cellPosition->mWidthFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - haveCellWidth = PR_TRUE; - cellWidth = cellPosition->mWidth; - break; - - case NS_STYLE_POSITION_VALUE_PERCENT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - // XXX write me when pct/proportional are supported - // XXX haveCellWidth = PR_TRUE; - // XXX cellWidth = cellPosition->mWidth; - break; - - default: - case NS_STYLE_POSITION_VALUE_INHERIT: - case NS_STYLE_POSITION_VALUE_AUTO: - break; - } - } - -#if XXX_need_access_to_column_frame_help - switch (colPosition->mWidthFlags) { - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - break; - - case NS_STYLE_POSITION_VALUE_LENGTH: - { - // This col has a fixed width, so set the cell's width to the - // larger of (specified width, largest max_element_size of the - // cells in the column) - PRInt32 widthForThisCell = max(cellMinSize->width, colPosition->mWidth); - if (mColumnWidths[colIndex] < widthForThisCell) - { - if (gsDebug) printf (" setting fixed width to %d\n",widthForThisCell); - mColumnWidths[colIndex] = widthForThisCell; - maxColWidth = widthForThisCell; - } - } - break; - - case NS_STYLE_POSITION_VALUE_PCT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - // XXX write me when pct/proportional are supported - break; - } -#endif - - // regardless of the width specification, keep track of the - // min/max column widths - PRInt32 cellMinWidth = cellMinSize->width/colSpan; - PRInt32 cellDesiredWidth = cellDesiredSize->width/colSpan; - if (minColWidth < cellMinWidth) - minColWidth = cellMinWidth; - if (maxColWidth < cellDesiredWidth) - maxColWidth = cellDesiredWidth; - if (1AppendElement(spanInfo); - } - if (gsDebug) { - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - } - } - -#if 0 - // if the col is fixed-width, expand the col to the specified - // fixed width if necessary - if (colStyle->fixedWidth > mColumnWidths[colIndex]) - mColumnWidths[colIndex] = colStyle->fixedWidth; - - // keep a running total of the amount of space taken up by all - // fixed-width columns - aTotalFixedWidth += mColumnWidths[colIndex]; - if (gsDebug) { - printf (" after col %d, aTotalFixedWidth = %d\n", - colIndex, aTotalFixedWidth); - } -#endif - - // add col[i] metrics to the running totals for the table min/max width - if (NS_UNCONSTRAINEDSIZE!=aMinTableWidth) - aMinTableWidth += minColWidth; // SEC: insets! - if (aMinTableWidth<=0) - aMinTableWidth = NS_UNCONSTRAINEDSIZE; // handle overflow - if (NS_UNCONSTRAINEDSIZE!=aMaxTableWidth) - aMaxTableWidth += maxColWidth; // SEC: insets! - if (aMaxTableWidth<=0) - aMaxTableWidth = NS_UNCONSTRAINEDSIZE; // handle overflow - if (gsDebug==PR_TRUE) - printf (" after this col, minTableWidth = %d and maxTableWidth = %d\n", aMinTableWidth, aMaxTableWidth); - - } // end Step 1 for fixed-width columns - if (nsnull!=spanList) - delete spanList; - return PR_TRUE; -} - -PRBool nsTableFrame::BalanceProportionalColumnsForSpecifiedWidthTable(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - PRBool result = PR_TRUE; - - if (NS_UNCONSTRAINEDSIZE==aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table laying out in NS_UNCONSTRAINEDSIZE, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else if (aMinTableWidth > aMaxWidth) - { // the table doesn't fit in the available space - if (gsDebug) printf (" * min table does not fit, calling SetColumnsToMinWidth\n"); - result = SetColumnsToMinWidth(aPresContext); - } - else if (aMaxTableWidth <= aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table desired size fits, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else - { // the table fits somewhere between its min and desired size - if (gsDebug) printf (" * table desired size does not fit, calling BalanceColumnsHTML4Constrained\n"); - result = BalanceColumnsHTML4Constrained(aPresContext, aAvailWidth, - aMaxWidth, aMinTableWidth, aMaxTableWidth); - } - return result; -} - -PRBool nsTableFrame::BalanceProportionalColumnsForAutoWidthTable( nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth) -{ - PRBool result = PR_TRUE; - - if (NS_UNCONSTRAINEDSIZE==aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table laying out in NS_UNCONSTRAINEDSIZE, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else if (aMinTableWidth > aMaxWidth) - { // the table doesn't fit in the available space - if (gsDebug) printf (" * min table does not fit, calling SetColumnsToMinWidth\n"); - result = SetColumnsToMinWidth(aPresContext); - } - else if (aMaxTableWidth <= aMaxWidth) - { // the max width of the table fits comfortably in the available space - if (gsDebug) printf (" * table desired size fits, calling BalanceColumnsTableFits\n"); - result = BalanceColumnsTableFits(aPresContext, aAvailWidth); - } - else - { // the table fits somewhere between its min and desired size - if (gsDebug) printf (" * table desired size does not fit, calling BalanceColumnsHTML4Constrained\n"); - result = BalanceColumnsHTML4Constrained(aPresContext, aAvailWidth, - aMaxWidth, aMinTableWidth, aMaxTableWidth); - } - return result; -} - -PRBool nsTableFrame::SetColumnsToMinWidth(nsIPresContext* aPresContext) -{ - PRBool result = PR_TRUE; - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - nsVoidArray *cells = colData->GetCells(); - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for col %d\n", colIndex); - - // XXX need column frame to ask this question - nsStylePosition* colPosition = nsnull; - - if (PR_TRUE==IsProportionalWidth(colPosition)) - { - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - nsSize * cellMinSize = data->GetMaxElementSize(); - NS_ASSERTION(nsnull != cellMinSize, "bad cellMinSize"); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - if (minColWidth < cellMinSize->width) - minColWidth = cellMinSize->width; - if (maxColWidth < cellDesiredSize->width) - maxColWidth = cellDesiredSize->width; - /* - if (gsDebug==PR_TRUE) - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - */ - } - - if (gsDebug==PR_TRUE) - { - printf (" for determining width of col %d %s:\n",colIndex, IsProportionalWidth(colPosition)? "(P)":"(A)"); - printf (" minColWidth = %d and maxColWidth = %d\n", minColWidth, maxColWidth); - } - - // XXX BUG: why are we asking this again? this if is already in a - // IsProportionalWidth == PR_TRUE case! - if (PR_TRUE==IsProportionalWidth(colPosition)) - { // this col has proportional width, so set its width based on the table width - mColumnWidths[colIndex] = minColWidth; - if (gsDebug==PR_TRUE) - printf (" 2: col %d, set to width = %d\n", colIndex, mColumnWidths[colIndex]); - } - } - } - return result; -} - -PRBool nsTableFrame::BalanceColumnsTableFits(nsIPresContext* aPresContext, - PRInt32 aAvailWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - PRBool result = PR_TRUE; - nsVoidArray *spanList=nsnull; - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - nsVoidArray *cells = colData->GetCells(); - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for col %d\n", colIndex); - - // XXX Need columnFrame to ask the style question - nsStylePosition* colPosition = nsnull; - - if (PR_TRUE==IsProportionalWidth(colPosition)) - { - // first, deal with any cells that span into this column from a pervious column - if (nsnull!=spanList) - { - PRInt32 spanCount = spanList->Count(); - // go through the list backwards so we can delete easily - for (PRInt32 spanIndex=spanCount-1; 0<=spanIndex; spanIndex--) - { - SpanInfo *spanInfo = (SpanInfo *)(spanList->ElementAt(spanIndex)); - if (minColWidth < spanInfo->cellMinWidth) - minColWidth = spanInfo->cellMinWidth; - if (maxColWidth < spanInfo->cellDesiredWidth) - maxColWidth = spanInfo->cellDesiredWidth; - spanInfo->span--; - if (gsDebug==PR_TRUE) - printf (" for spanning cell %d with remaining span=%d, min = %d and des = %d\n", - spanIndex, spanInfo->span, spanInfo->cellMinWidth, spanInfo->cellDesiredWidth); - if (0==spanInfo->span) - { - spanList->RemoveElementAt(spanIndex); - delete spanInfo; - } - } - } - - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - - PRInt32 colSpan = data->GetCellFrame()->GetColSpan(); - // distribute a portion of the spanning cell's min and max width to this column - nsSize * cellMinSize = data->GetMaxElementSize(); - NS_ASSERTION(nsnull != cellMinSize, "bad cellMinSize"); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - PRInt32 cellMinWidth = cellMinSize->width/colSpan; - PRInt32 cellDesiredWidth = cellDesiredSize->width/colSpan; - if (PR_TRUE==gsDebug) - printf("factoring in cell %d with colSpan=%d\n factoring in min=%d and desired=%d\n", - cellIndex, colSpan, cellMinWidth, cellDesiredWidth); - if (minColWidth < cellMinWidth) - minColWidth = cellMinWidth; - if (maxColWidth < cellDesiredWidth) - maxColWidth = cellDesiredWidth; - if (gsDebug==PR_TRUE) - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - if (1AppendElement(spanInfo); - } - } - - if (gsDebug==PR_TRUE) - { - printf (" for determining width of col %d %s:\n",colIndex, IsProportionalWidth(colPosition)? "(P)":"(A)"); - printf (" minColWidth = %d and maxColWidth = %d\n", minColWidth, maxColWidth); - printf (" aAvailWidth = %d\n", aAvailWidth); - } - - // XXX BUG: why are we asking this again? this if is already in a - // IsProportionalWidth == PR_TRUE case! - if (PR_TRUE==IsProportionalWidth(colPosition)) - { // this col has proportional width, so set its width based on the table width -#if XXX_bug_kipp_about_this - if (0==colStyle->proportionalWidth) - { // col width is specified to be the minimum - mColumnWidths[colIndex] = minColWidth; - if (gsDebug==PR_TRUE) - printf (" 3 (0): col %d set to min width = %d because style set proportionalWidth=0\n", - colIndex, mColumnWidths[colIndex]); - } - else // BUG? else? other code below has the else -#endif - if (PR_TRUE==AutoColumnWidths()) - { // give each remaining column it's desired width - // if there is width left over, we'll factor that in after this loop is complete - mColumnWidths[colIndex] = maxColWidth; - if (gsDebug==PR_TRUE) - printf (" 3a: col %d with availWidth %d, set to width = %d\n", - colIndex, aAvailWidth, mColumnWidths[colIndex]); - } - else - { // give each remaining column an equal percentage of the remaining space - PRInt32 percentage = -1; - if (NS_UNCONSTRAINEDSIZE==aAvailWidth) - { - mColumnWidths[colIndex] = maxColWidth; - } - else - { -#if XXX_bug_kipp_about_this - percentage = colStyle->proportionalWidth; - if (-1==percentage) -#endif - percentage = 100/numCols; - mColumnWidths[colIndex] = (percentage*aAvailWidth)/100; - // if the column was computed to be too small, enlarge the column - if (mColumnWidths[colIndex] <= minColWidth) - mColumnWidths[colIndex] = minColWidth; - } - if (gsDebug==PR_TRUE) - printf (" 3b: col %d given %d percent of availWidth %d, set to width = %d\n", - colIndex, percentage, aAvailWidth, mColumnWidths[colIndex]); - } - } - } - } - if (nsnull!=spanList) - delete spanList; - return result; -} - -PRBool nsTableFrame::BalanceColumnsHTML4Constrained(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth) -{ - NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); - - PRBool result = PR_TRUE; - PRInt32 maxOfAllMinColWidths = 0; - nsVoidArray *spanList=nsnull; - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - -#if XXX_bug_kipp_about_this - // XXX BUG: mStyleContext is for the table frame not for the column. - nsStyleMolecule* colStyle = - (nsStyleMolecule*)mStyleContext->GetData(kStyleMoleculeSID); -#else - nsStylePosition* colPosition = nsnull; -#endif - - nsVoidArray *cells = colData->GetCells(); - PRInt32 minColWidth = 0; - PRInt32 maxColWidth = 0; - PRInt32 numCells = cells->Count(); - if (gsDebug==PR_TRUE) printf (" for col %d\n", colIndex); - - if (PR_TRUE==IsProportionalWidth(colPosition)) - { - // first, deal with any cells that span into this column from a pervious column - if (nsnull!=spanList) - { - PRInt32 spanCount = spanList->Count(); - // go through the list backwards so we can delete easily - for (PRInt32 spanIndex=spanCount-1; 0<=spanIndex; spanIndex--) - { - SpanInfo *spanInfo = (SpanInfo *)(spanList->ElementAt(spanIndex)); - if (minColWidth < spanInfo->cellMinWidth) - minColWidth = spanInfo->cellMinWidth; - if (maxColWidth < spanInfo->cellDesiredWidth) - maxColWidth = spanInfo->cellDesiredWidth; - spanInfo->span--; - if (gsDebug==PR_TRUE) - printf (" for spanning cell %d with remaining span=%d, min = %d and des = %d\n", - spanIndex, spanInfo->span, spanInfo->cellMinWidth, spanInfo->cellDesiredWidth); - if (0==spanInfo->span) - { - spanList->RemoveElementAt(spanIndex); - delete spanInfo; - } - } - } - for (PRInt32 cellIndex = 0; cellIndexElementAt(cellIndex)); - NS_ASSERTION(nsnull != data, "bad data"); - PRInt32 colSpan = data->GetCellFrame()->GetColSpan(); - nsSize * cellMinSize = data->GetMaxElementSize(); - NS_ASSERTION(nsnull != cellMinSize, "bad cellMinSize"); - nsReflowMetrics * cellDesiredSize = data->GetDesiredSize(); - NS_ASSERTION(nsnull != cellDesiredSize, "bad cellDesiredSize"); - PRInt32 cellMinWidth = cellMinSize->width/colSpan; - PRInt32 cellDesiredWidth = cellDesiredSize->width/colSpan; - if (minColWidth < cellMinWidth) - minColWidth = cellMinWidth; - if (maxColWidth < cellDesiredWidth) - maxColWidth = cellDesiredWidth; - if (1AppendElement(spanInfo); - } - if (gsDebug==PR_TRUE) - printf (" after cell %d, minColWidth = %d and maxColWidth = %d\n", - cellIndex, minColWidth, maxColWidth); - } - - if (gsDebug==PR_TRUE) - { - printf (" for determining width of col %d %s:\n",colIndex, IsProportionalWidth(colPosition)? "(P)":"(A)"); - printf (" minTableWidth = %d and maxTableWidth = %d\n", aMinTableWidth, aMaxTableWidth); - printf (" minColWidth = %d and maxColWidth = %d\n", minColWidth, maxColWidth); - printf (" aAvailWidth = %d\n", aAvailWidth); - } - - // XXX BUG: why are we asking this again? this if is already in a - // IsProportionalWidth == PR_TRUE case! - if (PR_TRUE==IsProportionalWidth(colPosition)) - { // this col has proportional width, so set its width based on the table width - // the table fits in the space somewhere between its min and max size - // so dole out the available space appropriately -#if XXX_bug_kipp_about_this - if (0==colStyle->proportionalWidth) - { // col width is specified to be the minimum - mColumnWidths[colIndex] = minColWidth; - if (gsDebug==PR_TRUE) - printf (" 4 (0): col %d set to min width = %d because style set proportionalWidth=0\n", - colIndex, mColumnWidths[colIndex]); - } - else -#endif - if (AutoColumnWidths()) - { - PRInt32 W = aMaxWidth - aMinTableWidth; - PRInt32 D = aMaxTableWidth - aMinTableWidth; - PRInt32 d = maxColWidth - minColWidth; - mColumnWidths[colIndex] = minColWidth + ((d*W)/D); - if (gsDebug==PR_TRUE) - printf (" 4 auto-width: col %d W=%d D=%d d=%d, set to width = %d\n", - colIndex, W, D, d, mColumnWidths[colIndex]); - } - else - { // give each remaining column an equal percentage of the remaining space -#if XXX_bug_kipp_about_this - PRInt32 percentage = colStyle->proportionalWidth; - if (-1==percentage) -#endif - PRInt32 percentage = 100/numCols; - mColumnWidths[colIndex] = (percentage*aAvailWidth)/100; - // if the column was computed to be too small, enlarge the column - if (mColumnWidths[colIndex] <= minColWidth) - { - mColumnWidths[colIndex] = minColWidth; - if (maxOfAllMinColWidths < minColWidth) - maxOfAllMinColWidths = minColWidth; - } - if (gsDebug==PR_TRUE) - { - printf (" 4 equal width: col %d given %d percent of availWidth %d, set to width = %d\n", - colIndex, percentage, aAvailWidth, mColumnWidths[colIndex]); - if (0!=maxOfAllMinColWidths) - printf(" and setting maxOfAllMins to %d\n", maxOfAllMinColWidths); - } - } - } - } - } - - // post-process if necessary - - // if columns have equal width, and some column's content couldn't squeeze into the computed size, - // then expand every column to the min size of the column with the largest min size - if (!AutoColumnWidths() && 0!=maxOfAllMinColWidths) - { - if (gsDebug==PR_TRUE) printf(" EqualColWidths specified, so setting all col widths to %d\n", maxOfAllMinColWidths); - for (PRInt32 colIndex = 0; colIndexCount(); - for (PRInt32 i = 0; iGetData(kStyleSpacingSID); - nscoord rightInset = spacing->mBorderPadding.right; - nscoord leftInset = spacing->mBorderPadding.left; - tableWidth += (leftInset + rightInset); - nsRect tableSize = mRect; - tableSize.width = tableWidth; - if (gsDebug==PR_TRUE) - { - printf ("setting table rect to %d, %d after adding insets %d, %d\n", - tableSize.width, tableSize.height, rightInset, leftInset); - } - SetRect(tableSize); -} - -/** - */ -void nsTableFrame::ShrinkWrapChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - PRBool gsDebugWas = gsDebug; - //gsDebug = PR_TRUE; // turn on debug in this method -#endif - // iterate children, tell all row groups to ShrinkWrap - PRBool atLeastOneRowSpanningCell = PR_FALSE; - - PRInt32 tableHeight = 0; - - nsStyleSpacing* spacing = (nsStyleSpacing*) - mStyleContext->GetData(kStyleSpacingSID); - tableHeight += - spacing->mBorderPadding.top + spacing->mBorderPadding.bottom; - - PRInt32 childCount = mChildCount; - nsIFrame * kidFrame; - for (PRInt32 i = 0; i < childCount; i++) - { - PRInt32 childHeight=0; - // for every child that is a rowFrame, set the row frame height = sum of row heights - - if (0==i) - ChildAt(i, kidFrame); // frames are not ref counted - else - kidFrame->GetNextSibling(kidFrame); - NS_ASSERTION(nsnull != kidFrame, "bad kid frame"); - nsTableContentPtr kid; - - kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++ - NS_ASSERTION(kid.IsNotNull(), "bad kid"); - if (kid->GetType() == nsITableContent::kTableRowGroupType) - { - /* Step 1: set the row height to the height of the tallest cell, - * and resize all cells in that row to that height (except cells with rowspan>1) - */ - PRInt32 rowGroupHeight = 0; - nsTableRowGroupFrame * rowGroupFrame = (nsTableRowGroupFrame *)kidFrame; - PRInt32 numRows; - rowGroupFrame->ChildCount(numRows); - PRInt32 *rowHeights = new PRInt32[numRows]; - if (gsDebug==PR_TRUE) printf("Height Step 1...\n"); - for (PRInt32 rowIndex = 0; rowIndex < numRows; rowIndex++) - { - // get the height of the tallest cell in the row (excluding cells that span rows) - nsTableRowFrame *rowFrame; - - rowGroupFrame->ChildAt(rowIndex, (nsIFrame*&)rowFrame); - NS_ASSERTION(nsnull != rowFrame, "bad row frame"); - rowHeights[rowIndex] = rowFrame->GetTallestChild(); - - nsSize rowFrameSize; - - rowFrame->GetSize(rowFrameSize); - rowFrame->SizeTo(rowFrameSize.width, rowHeights[rowIndex]); - rowGroupHeight += rowHeights[rowIndex]; - // resize all the cells based on the rowHeight - PRInt32 numCells; - - rowFrame->ChildCount(numCells); - for (PRInt32 cellIndex = 0; cellIndex < numCells; cellIndex++) - { - nsTableCellFrame *cellFrame; - - rowFrame->ChildAt(cellIndex, (nsIFrame*&)cellFrame); - PRInt32 rowSpan = cellFrame->GetRowSpan(); - if (1==rowSpan) - { - if (gsDebug==PR_TRUE) printf(" setting cell[%d,%d] height to %d\n", rowIndex, cellIndex, rowHeights[rowIndex]); - - nsSize cellFrameSize; - - cellFrame->GetSize(cellFrameSize); - cellFrame->SizeTo(cellFrameSize.width, rowHeights[rowIndex]); - // Realign cell content based on new height - cellFrame->VerticallyAlignChild(aPresContext); - } - else - { - if (gsDebug==PR_TRUE) printf(" skipping cell[%d,%d]\n", rowIndex, cellIndex); - atLeastOneRowSpanningCell = PR_TRUE; - } - } - } - - /* Step 2: now account for cells that span rows. - * a spanning cell's height is the sum of the heights of the rows it spans, - * or it's own desired height, whichever is greater. - * If the cell's desired height is the larger value, resize the rows and contained - * cells by an equal percentage of the additional space. - */ - /* TODO - * 1. optimization, if (PR_TRUE==atLeastOneRowSpanningCell) ... otherwise skip this step entirely - * 2. find cases where spanning cells effect other spanning cells that began in rows above themselves. - * I think in this case, we have to make another pass through step 2. - * There should be a "rational" check to terminate that kind of loop after n passes, probably 3 or 4. - */ - if (gsDebug==PR_TRUE) printf("Height Step 2...\n"); - rowGroupHeight=0; - nsTableRowFrame *rowFrame=nsnull; - for (rowIndex = 0; rowIndex < numRows; rowIndex++) - { - // get the next row - if (0==rowIndex) - rowGroupFrame->ChildAt(rowIndex, (nsIFrame*&)rowFrame); - else - rowFrame->GetNextSibling((nsIFrame*&)rowFrame); - PRInt32 numCells; - rowFrame->ChildCount(numCells); - // check this row for a cell with rowspans - for (PRInt32 cellIndex = 0; cellIndex < numCells; cellIndex++) - { - // get the next cell - nsTableCellFrame *cellFrame; - rowFrame->ChildAt(cellIndex, (nsIFrame*&)cellFrame); - PRInt32 rowSpan = cellFrame->GetRowSpan(); - if (1 1, determine it's height - if (gsDebug==PR_TRUE) printf(" cell[%d,%d] has a rowspan = %d\n", rowIndex, cellIndex, rowSpan); - PRInt32 heightOfRowsSpanned = 0; - for (PRInt32 i=0; iGetSize(cellFrameSize); - if (heightOfRowsSpanned>cellFrameSize.height) - { - if (gsDebug==PR_TRUE) printf(" cell[%d,%d] fits, setting height to %d\n", rowIndex, cellIndex, heightOfRowsSpanned); - cellFrame->SizeTo(cellFrameSize.width, heightOfRowsSpanned); - // Realign cell content based on new height - cellFrame->VerticallyAlignChild(aPresContext); - } - /* otherwise, distribute the excess height to the rows effected, and to the cells in those rows - * push all subsequent rows down by the total change in height of all the rows above it - */ - else - { - PRInt32 excessHeight = cellFrameSize.height - heightOfRowsSpanned; - PRInt32 excessHeightPerRow = excessHeight/rowSpan; - if (gsDebug==PR_TRUE) printf(" cell[%d,%d] does not fit, excessHeight = %d, excessHeightPerRow = %d\n", - rowIndex, cellIndex, excessHeight, excessHeightPerRow); - // for every row starting at the row with the spanning cell... - for (i=rowIndex; iChildAt(i, (nsIFrame*&)rowFrameToBeResized); - // if the row is within the spanned range, resize the row and it's cells - if (iGetSize(rowFrameSize); - rowFrameToBeResized->SizeTo(rowFrameSize.width, rowHeights[i]); - PRInt32 cellCount; - - rowFrameToBeResized->ChildCount(cellCount); - for (PRInt32 j=0; jChildAt(j, (nsIFrame*&)frame); - if (frame->GetRowSpan()==1) - { - nsSize frameSize; - - frame->GetSize(frameSize); - if (gsDebug==PR_TRUE) printf(" cell[%d, %d] set height to %d\n", i, j, frameSize.height+excessHeightPerRow); - frame->SizeTo(frameSize.width, frameSize.height+excessHeightPerRow); - // Realign cell content based on new height - frame->VerticallyAlignChild(aPresContext); - } - } - } - // if we're dealing with a row below the row containing the spanning cell, - // push that row down by the amount we've expanded the cell heights by - if (i>=rowIndex && i!=0) - { - nsRect rowRect; - - rowFrameToBeResized->GetRect(rowRect); - nscoord delta = excessHeightPerRow*(i-rowIndex); - if (delta > excessHeight) - delta = excessHeight; - rowFrameToBeResized->MoveTo(rowRect.x, rowRect.y + delta); - if (gsDebug==PR_TRUE) printf(" row %d (%p) moved by %d to y-offset %d\n", - i, rowFrameToBeResized, delta, rowRect.y + delta); - } - } - } - } - } - rowGroupHeight += rowHeights[rowIndex]; - } - if (gsDebug==PR_TRUE) printf("row group height set to %d\n", rowGroupHeight); - - nsSize rowGroupFrameSize; - - rowGroupFrame->GetSize(rowGroupFrameSize); - rowGroupFrame->SizeTo(rowGroupFrameSize.width, rowGroupHeight); - tableHeight += rowGroupHeight; - } - } - if (0!=tableHeight) - { - if (gsDebug==PR_TRUE) printf("table desired height set to %d\n", tableHeight); - aDesiredSize.height = tableHeight; - } -#ifdef NS_DEBUG - gsDebug = gsDebugWas; -#endif -} - -// XXX Kipp wonders: what does this really mean? Are you really asking -// "Is it fixed width"? If so, then VALUE_PCT may be wrong and the -// name of the method should be changed. - -PRBool nsTableFrame::IsProportionalWidth(nsStylePosition* aStylePosition) -{ - PRBool result = PR_FALSE; - if (nsnull == aStylePosition) { - // Assume NS_STYLE_POSITION_VALUE_AUTO when no style is available - result = PR_TRUE; - } - else { - switch (aStylePosition->mWidthFlags) { - case NS_STYLE_POSITION_VALUE_LENGTH: - case NS_STYLE_POSITION_VALUE_PERCENT: - break; - - default: - case NS_STYLE_POSITION_VALUE_AUTO: - case NS_STYLE_POSITION_VALUE_INHERIT: - case NS_STYLE_POSITION_VALUE_PROPORTIONAL: - result = PR_TRUE; - break; - } - } - return result; -} - -/** - */ -NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - NS_ASSERTION(nsnull != aCX, "bad arg"); - if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - - // mFirstPassValid needs to be set somewhere in response to change notifications. - - aDesiredSize.width = mRect.width; - aDesiredSize.height = mRect.height; - aStatus = frComplete; - return NS_OK; -} - -void nsTableFrame::VerticallyAlignChildren(nsIPresContext* aPresContext, - nscoord* aAscents, - nscoord aMaxAscent, - nscoord aMaxHeight) -{ -} - -nsVoidArray * nsTableFrame::GetColumnLayoutData() -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - NS_ASSERTION(nsnull!=firstInFlow->mColumnLayoutData, "illegal state -- no column layout data"); - return firstInFlow->mColumnLayoutData; -} - -/** Associate aData with the cell at (aRow,aCol) - * @return PR_TRUE if the data was successfully associated with a Cell - * PR_FALSE if there was an error, such as aRow or aCol being invalid - */ -PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aCell) -{ - NS_ASSERTION(nsnull != aData, "bad arg"); - NS_ASSERTION(nsnull != aCell, "bad arg"); - - PRBool result = PR_TRUE; - - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - if (this!=firstInFlow) - result = firstInFlow->SetCellLayoutData(aData, aCell); - else - { - if (kPASS_FIRST==GetReflowPass()) - { - if (nsnull==mColumnLayoutData) - { - mColumnLayoutData = new nsVoidArray(); - NS_ASSERTION(nsnull != mColumnLayoutData, "bad alloc"); - nsTablePart * tablePart = (nsTablePart *)mContent; - PRInt32 cols = tablePart->GetMaxColumns(); - PRInt32 tableKidCount = tablePart->ChildCount(); - for (PRInt32 i=0; iChildAt(i); - NS_ASSERTION(tableKid.IsNotNull(), "bad kid"); - const int contentType = tableKid->GetType(); - if (contentType == nsITableContent::kTableColGroupType) - { - PRInt32 colsInGroup = tableKid->ChildCount(); - for (PRInt32 j=0; jChildAt(j); - NS_ASSERTION(col.IsNotNull(), "bad content"); - nsColLayoutData *colData = new nsColLayoutData(col); - mColumnLayoutData->AppendElement((void *)colData); - } - } - // can't have col groups after row groups, so stop if you find a row group - else if (contentType == nsITableContent::kTableRowGroupType) - { - break; - } - } - } - - // create cell layout data objects for the passed in data, one per column spanned - // for now, divide width equally between spanned columns - - PRInt32 firstColIndex = aCell->GetColIndex(); - nsTableRow *row = aCell->GetRow(); // row: ADDREF++ - PRInt32 rowIndex = row->GetRowIndex(); - NS_RELEASE(row); // row: ADDREF-- - PRInt32 colSpan = aCell->GetColSpan(); - nsColLayoutData * colData = (nsColLayoutData *)(mColumnLayoutData->ElementAt(firstColIndex)); - nsVoidArray *col = colData->GetCells(); - if (gsDebugCLD) printf (" ~ SetCellLayoutData with row = %d, firstCol = %d, colSpan = %d, colData = %ld, col=%ld\n", - rowIndex, firstColIndex, colSpan, colData, col); - for (PRInt32 i=0; iGetMaxElementSize(); - nsSize partialCellSize(*cellSize); - partialCellSize.width = (cellSize->width)/colSpan; - // This method will copy the nsReflowMetrics pointed at by aData->GetDesiredSize() - nsCellLayoutData * kidLayoutData = new nsCellLayoutData(aData->GetCellFrame(), - aData->GetDesiredSize(), - &partialCellSize); - PRInt32 numCells = col->Count(); - if (gsDebugCLD) printf (" ~ before setting data, number of cells in this column = %d\n", numCells); - if ((numCells==0) || numCellsAppendElement((void *)kidLayoutData); - } - else - { - if (gsDebugCLD) printf (" ~ replacing %d + rowIndex = %d\n", i, i+rowIndex); - nsCellLayoutData* data = (nsCellLayoutData*)col->ElementAt(i+rowIndex); - col->ReplaceElementAt((void *)kidLayoutData, i+rowIndex); - if (data != nsnull) - delete data; - } - if (gsDebugCLD) printf (" ~ after setting data, number of cells in this column = %d\n", col->Count()); - } - } - else - result = PR_FALSE; - } - - return result; -} - -/** Get the layout data associated with the cell at (aRow,aCol) - * @return nsnull if there was an error, such as aRow or aCol being invalid - * otherwise, the data is returned. - */ -nsCellLayoutData * nsTableFrame::GetCellLayoutData(nsTableCell *aCell) -{ - NS_ASSERTION(nsnull != aCell, "bad arg"); - - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - nsCellLayoutData *result = nsnull; - if (this!=firstInFlow) - result = firstInFlow->GetCellLayoutData(aCell); - else - { - if (nsnull!=mColumnLayoutData) - { - PRInt32 firstColIndex = aCell->GetColIndex(); - nsColLayoutData * colData = (nsColLayoutData *)(mColumnLayoutData->ElementAt(firstColIndex)); - nsVoidArray *cells = colData->GetCells(); - PRInt32 count = cells->Count(); - for (PRInt32 i=0; iElementAt(i)); - nsTableCellPtr cell; - - data->GetCellFrame()->GetContent((nsIContent*&)(cell.AssignRef())); // cell: REFCNT++ - if (cell == aCell) - { - result = data; - break; - } - } - } - } - return result; -} - - - -PRInt32 nsTableFrame::GetReflowPass() const -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - return firstInFlow->mPass; -} - -void nsTableFrame::SetReflowPass(PRInt32 aReflowPass) -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - firstInFlow->mPass = aReflowPass; -} - -PRBool nsTableFrame::IsFirstPassValid() const -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - return firstInFlow->mFirstPassValid; -} - -//ZZZ TOTAL HACK -PRBool isTableAutoWidth = PR_TRUE; -PRBool isAutoColumnWidths = PR_TRUE; - -PRBool nsTableFrame::TableIsAutoWidth() -{ // ZZZ: TOTAL HACK - return isTableAutoWidth; -} - -PRBool nsTableFrame::AutoColumnWidths() -{ // ZZZ: TOTAL HACK - return isAutoColumnWidths; -} - -NS_METHOD nsTableFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableFrame* cf = new nsTableFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); - // set my width, because all frames in a table flow are the same width - // code in nsTableOuterFrame depends on this being set - cf->SetRect(nsRect(0, 0, mRect.width, 0)); - // add headers and footers to cf - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - nsIFrame * rg = nsnull; - firstInFlow->ChildAt(0, rg); - NS_ASSERTION (nsnull!=rg, "previous frame has no children"); - nsIAtom * tHeadTag = NS_NewAtom(nsTablePart::kRowGroupHeadTagString); // tHeadTag: REFCNT++ - nsIAtom * tFootTag = NS_NewAtom(nsTablePart::kRowGroupFootTagString); // tFootTag: REFCNT++ - PRInt32 index = 0; - nsIFrame * bodyRowGroupFromOverflow = mOverflowList; - nsIFrame * lastSib = nsnull; - for ( ; nsnull!=rg; index++) - { - nsIContent *content = nsnull; - rg->GetContent(content); // content: REFCNT++ - NS_ASSERTION(nsnull!=content, "bad frame, returned null content."); - nsIAtom * rgTag = content->GetTag(); - // if we've found a header or a footer, replicate it - if (tHeadTag==rgTag || tFootTag==rgTag) - { - printf("found a head or foot in continuing frame\n"); - // Resolve style for the child - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(content, cf); // kidStyleContext: REFCNT++ - nsIContentDelegate* kidDel = nsnull; - kidDel = content->GetDelegate(aPresContext); // kidDel: REFCNT++ - nsIFrame * duplicateFrame = kidDel->CreateFrame(aPresContext, content, index, cf); - NS_RELEASE(kidDel); // kidDel: REFCNT-- - duplicateFrame->SetStyleContext(kidStyleContext); - NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT-- - - if (nsnull==lastSib) - { - mOverflowList = duplicateFrame; - } - else - { - lastSib->SetNextSibling(duplicateFrame); - } - duplicateFrame->SetNextSibling(bodyRowGroupFromOverflow); - lastSib = duplicateFrame; - } - NS_RELEASE(content); // content: REFCNT-- - // get the next row group - rg->GetNextSibling(rg); - } - NS_RELEASE(tFootTag); // tHeadTag: REFCNT -- - NS_RELEASE(tHeadTag); // tFootTag: REFCNT -- - aContinuingFrame = cf; - return NS_OK; -} - -PRInt32 nsTableFrame::GetColumnWidth(PRInt32 aColIndex) -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - PRInt32 result = 0; - if (this!=firstInFlow) - result = firstInFlow->GetColumnWidth(aColIndex); - else - { - NS_ASSERTION(nsnull!=mColumnWidths, "illegal state"); -#ifdef DEBUG - nsVoidArray *cld = GetColumnLayoutData(); - NS_ASSERTION(nsnull!=cld, "no column layout data"); - PRInt32 numCols = cld->Count(); - NS_ASSERTION (numCols > aColIndex, "bad arg, col index out of bounds"); -#endif - if (nsnull!=mColumnWidths) - result = mColumnWidths[aColIndex]; - } - - //printf("GET_COL_WIDTH: %p, FIF=%p getting col %d and returning %d\n", this, firstInFlow, aColIndex, result); - - // XXX hack -#if 0 - if (result <= 0) { - result = 100; - } -#endif - return result; -} - -void nsTableFrame::SetColumnWidth(PRInt32 aColIndex, PRInt32 aWidth) -{ - nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); - NS_ASSERTION(nsnull!=firstInFlow, "illegal state -- no first in flow"); - //printf("SET_COL_WIDTH: %p, FIF=%p setting col %d to %d\n", this, firstInFlow, aColIndex, aWidth); - if (this!=firstInFlow) - firstInFlow->SetColumnWidth(aColIndex, aWidth); - else - { - NS_ASSERTION(nsnull!=mColumnWidths, "illegal state"); - if (nsnull!=mColumnWidths) - mColumnWidths[aColIndex] = aWidth; - } -} - - -/* ---------- static methods ---------- */ - -nsresult nsTableFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - -/* valuable code not yet used anywhere - - // since the table is a specified width, we need to expand the columns to fill the table - nsVoidArray *columnLayoutData = GetColumnLayoutData(); - PRInt32 numCols = columnLayoutData->Count(); - PRInt32 spaceUsed = 0; - for (PRInt32 colIndex = 0; colIndexElementAt(colIndex)); - nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - nsStyleMolecule* colStyle = - (nsStyleMolecule*)mStyleContext->GetData(kStyleMoleculeSID); - if (PR_TRUE==IsProportionalWidth(colStyle)) - { - PRInt32 percentage = (100*mColumnWidths[colIndex]) / aMaxWidth; - PRInt32 additionalSpace = (spaceRemaining*percentage)/100; - mColumnWidths[colIndex] += additionalSpace; - additionalSpaceAdded += additionalSpace; - } - } - if (spaceUsed+additionalSpaceAdded < aMaxTableWidth) - mColumnWidths[numCols-1] += (aMaxTableWidth - (spaceUsed+additionalSpaceAdded)); - } -*/ - - - - diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h deleted file mode 100644 index 43859f8ead8..00000000000 --- a/mozilla/layout/tables/nsTableFrame.h +++ /dev/null @@ -1,439 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableFrame_h__ -#define nsTableFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - -class nsCellLayoutData; -class nsTableCell; -class nsVoidArray; -class nsTableCellFrame; -class CellData; -struct InnerTableReflowState; -struct nsStylePosition; -struct nsStyleSpacing; - -/** nsTableFrame maps the inner portion of a table (everything except captions.) - * Used as a pseudo-frame within nsTableOuterFrame, - * it may also be used stand-alone as the top-level frame. - * The meaningful child frames of nsTableFrame map rowgroups. - * - * @author sclark - * - * TODO: make methods virtual so nsTableFrame can be used as a base class in the future. - */ -class nsTableFrame : public nsContainerFrame -{ -public: - - /** nsTableOuterFrame has intimate knowledge of the inner table frame */ - friend class nsTableOuterFrame; - - /** instantiate a new instance of nsTableFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** inner tables are reflowed in two steps. - *
    -    * if mFirstPassValid is false, this is our first time through since content was last changed
    -    *   set pass to 1
    -    *   do pass 1
    -    *     get min/max info for all cells in an infinite space
    -    *   do column balancing
    -    *   set mFirstPassValid to true
    -    *   do pass 2
    -    *     use column widths to ResizeReflow cells
    -    *     shrinkWrap Cells in each row to tallest, realigning contents within the cell
    -    * 
    - * - * @see ResizeReflowPass1 - * @see ResizeReflowPass2 - * @see BalanceColumnWidths - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame::CreateContinuingFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** resize myself and my children according to the arcane rules of cell height magic. - * By default, the height of a cell is the max (height of cells in its row) - * In the case of a cell with rowspan>1 (lets call this C), - * if the sum of the height of the rows spanned (excluding C in the calculation) - * is greater than or equal to the height of C, - * the cells in the rows are sized normally and - * the height of C is set to the sum of the heights (taking into account borders, padding, and margins) - * else - * the height of each row is expanded by a percentage of the difference between - * the row's desired height and the height of C - */ - virtual void ShrinkWrapChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsSize* aMaxElementSize); - - /** return the column layout data for this inner table frame. - * if this is a continuing frame, return the first-in-flow's column layout data. - */ - virtual nsVoidArray *GetColumnLayoutData(); - - /** Associate aData with the cell at (aRow,aCol) - * @return PR_TRUE if the data was successfully associated with a Cell - * PR_FALSE if there was an error, such as aRow or aCol being invalid - */ - virtual PRBool SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aCell); - - /** Get the layout data associated with the cell at (aRow,aCol) - * @return PR_NULL if there was an error, such as aRow or aCol being invalid - * otherwise, the data is returned. - */ - virtual nsCellLayoutData * GetCellLayoutData(nsTableCell *aCell); - - /** returns PR_TRUE if this table has proportional width - */ - PRBool IsProportionalWidth(nsStylePosition* aStylePosition); - - - - /** - * DEBUG METHOD - * - */ - void ListColumnLayoutData(FILE* out = stdout, PRInt32 aIndent = 0) const; - - - /** return the width of the column at aColIndex */ - PRInt32 GetColumnWidth(PRInt32 aColIndex); - - /** set the width of the column at aColIndex to aWidth */ - void SetColumnWidth(PRInt32 aColIndex, PRInt32 aWidth); - - - - /** - * Calculate Layout Information - * - */ - nsCellLayoutData* FindCellLayoutData(nsTableCell* aCell); - void AppendLayoutData(nsVoidArray* aList, nsTableCell* aTableCell); - void RecalcLayoutData(); - void ResetCellLayoutData( nsTableCell* aCell, - nsTableCell* aAbove, - nsTableCell* aBelow, - nsTableCell* aLeft, - nsTableCell* aRight); - - - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** destructor, responsible for mColumnLayoutData and mColumnWidths */ - virtual ~nsTableFrame(); - - /** helper method to delete contents of mColumnLayoutData - * should be called with care (ie, only by destructor) - */ - virtual void DeleteColumnLayoutData(); - - /** first pass of ResizeReflow. - * lays out all table content with aMaxSize(NS_UNCONSTRAINEDSIZE,NS_UNCONSTRAINEDSIZE) and - * a non-null aMaxElementSize so we get all the metrics we need to do column balancing. - * Pass 1 only needs to be executed once no matter how many times the table is resized, - * as long as content and style don't change. This is managed in the member variable mFirstPassIsValid. - * The layout information for each cell is cached in mColumLayoutData. - * - * @see ResizeReflow - */ - virtual ReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** second pass of ResizeReflow. - * lays out all table content with aMaxSize(computed_table_width, given_table_height) - * Pass 2 is executed every time the table needs to resize. An optimization is included - * so that if the table doesn't need to actually be resized, no work is done (see NeedsReflow). - * - * @param aMinCaptionWidth - the max of all the minimum caption widths. 0 if no captions. - * @param aMaxCaptionWidth - the max of all the desired caption widths. 0 if no captions. - * - * @see ResizeReflow - * @see NeedsReflow - */ - virtual ReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - InnerTableReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); - - - /** assign widths for each column, taking into account the table content, the effective style, - * the layout constraints, and the compatibility mode. Sets mColumnWidths as a side effect. - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aMaxSize the height and width constraints - * @param aMaxElementSize the min size of the largest indivisible object - */ - virtual void BalanceColumnWidths(nsIPresContext* aPresContext, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** assign widths for each column that has fixed width. - * Computes the minimum and maximum table widths. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aMaxWidth the maximum width of the table - * @param aNumCols the total number of columns in the table - * @param aTableStyle the resolved style for the table - * @param aTotalFixedWidth out param, the sum of the fixed width columns - * @param aMinTableWidth out param, the min possible table width - * @param aMaxTableWidth out param, the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: should be renamed to "AssignKnownWidthInformation - */ - virtual PRBool AssignFixedColumnWidths(nsIPresContext* aPresContext, - PRInt32 aMaxWidth, - PRInt32 aNumCols, - PRInt32 & aTotalFixedWidth, - PRInt32 & aMinTableWidth, - PRInt32 & aMaxTableWidth); - - /** assign widths for each column that has proportional width inside a table that - * has a fixed width. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * @param aMaxWidth the total amount of horizontal space available - * @param aMinTableWidth the min possible table width - * @param aMaxTableWidth the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: rename this method to reflect that it is a Nav4 compatibility method - */ - virtual PRBool BalanceProportionalColumnsForSpecifiedWidthTable(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth); - - /** assign widths for each column that has proportional width inside a table that - * has auto width (width set by the content and available space.) - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * @param aMaxWidth the total amount of horizontal space available - * @param aMinTableWidth the min possible table width - * @param aMaxTableWidth the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: rename this method to reflect that it is a Nav4 compatibility method - */ - virtual PRBool BalanceProportionalColumnsForAutoWidthTable(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth); - - /** assign the minimum allowed width for each column that has proportional width. - * Typically called when the min table width doesn't fit in the available space. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - */ - virtual PRBool SetColumnsToMinWidth(nsIPresContext* aPresContext); - - /** assign the maximum allowed width for each column that has proportional width. - * Typically called when the desired max table width fits in the available space. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - */ - virtual PRBool BalanceColumnsTableFits(nsIPresContext* aPresContext, - PRInt32 aAvailWidth); - - /** assign widths for each column that has proportional width inside a table that - * has auto width (width set by the content and available space) according to the - * HTML 4 specification. - * Sets mColumnWidths as a side effect. - * - * @param aPresContext the presentation context - * @param aTableStyle the resolved style for the table - * @param aAvailWidth the remaining amount of horizontal space available - * @param aMaxWidth the total amount of horizontal space available - * @param aMinTableWidth the min possible table width - * @param aMaxTableWidth the max table width - * - * @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error - * - * TODO: rename this method to reflect that it is a Nav4 compatibility method - */ - virtual PRBool BalanceColumnsHTML4Constrained(nsIPresContext* aPresContext, - PRInt32 aAvailWidth, - PRInt32 aMaxWidth, - PRInt32 aMinTableWidth, - PRInt32 aMaxTableWidth); - - /** sets the width of the table according to the computed widths of each column. */ - virtual void SetTableWidth(nsIPresContext* aPresContext); - - /** - */ - virtual void VerticallyAlignChildren(nsIPresContext* aPresContext, - nscoord* aAscents, - nscoord aMaxAscent, - nscoord aMaxHeight); - - /** support routine returns PR_TRUE if the table should be sized "automatically" - * according to its content. - * In NAV4, this is the default (no WIDTH, no COLS). - */ - virtual PRBool TableIsAutoWidth(); - - /** support routine returns PR_TRUE if the table columns should be sized "automatically" - * according to its content. - * In NAV4, this is when there is a COLS attribute on the table. - */ - virtual PRBool AutoColumnWidths(); - - /** given the new parent size, do I really need to do a reflow? */ - virtual PRBool NeedsReflow(const nsSize& aMaxSize); - - /** what stage of reflow is currently in process? */ - virtual PRInt32 GetReflowPass() const; - - /** sets the reflow pass flag. use with caution! */ - virtual void SetReflowPass(PRInt32 aReflowPass); - - /** returns PR_TRUE if the cached pass 1 data is still valid */ - virtual PRBool IsFirstPassValid() const; - -private: - void nsTableFrame::DebugPrintCount() const; // Debugging routine - - - /** table reflow is a multi-pass operation. Use these constants to keep track of - * which pass is currently being executed. - */ - enum {kPASS_UNDEFINED=0, kPASS_FIRST=1, kPASS_SECOND=2, kPASS_THIRD=3}; - - nsVoidArray *mColumnLayoutData; // array of array of cellLayoutData's - PRInt32 *mColumnWidths; // widths of each column - PRBool mFirstPassValid; // PR_TRUE if first pass data is still legit - PRInt32 mPass; // which Reflow pass are we currently in? - PRBool mIsInvariantWidth; // PR_TRUE if table width cannot change - -}; - -#endif diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp deleted file mode 100644 index ce00afbce76..00000000000 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ /dev/null @@ -1,1402 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableOuterFrame.h" -#include "nsTableFrame.h" -#include "nsTableCaptionFrame.h" -#include "nsITableContent.h" -#include "nsTableContent.h" -#include "nsBodyFrame.h" -#include "nsReflowCommand.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIPresContext.h" -#include "nsIRenderingContext.h" -#include "nsCSSRendering.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsCSSLayout.h" -#include "nsVoidArray.h" -#include "nsReflowCommand.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -//#define NOISY_MARGINS -#else -static const PRBool gsDebug = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID); -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); -static NS_DEFINE_IID(kITableContentIID, NS_ITABLECONTENT_IID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -struct OuterTableReflowState { - - // The presentation context - nsIPresContext *pc; - - // The total available size (computed from the parent) - nsSize availSize; - // The available size for the inner table frame - nsSize innerTableMaxSize; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Running y-offset - nscoord y; - - // Flags for where we are in the content - PRBool firstRowGroup; - PRBool processingCaption; - - OuterTableReflowState(nsIPresContext* aPresContext, - const nsSize& aMaxSize) - { - pc = aPresContext; - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - y=0; // border/padding/margin??? - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - firstRowGroup = PR_TRUE; - processingCaption = PR_FALSE; - } - - ~OuterTableReflowState() { - } -}; - - - -/* ----------- nsTableOuterFrame ---------- */ - - -/** - */ -nsTableOuterFrame::nsTableOuterFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mInnerTableFrame(nsnull), - mCaptionFrames(nsnull), - mBottomCaptions(nsnull), - mMinCaptionWidth(0), - mMaxCaptionWidth(0), - mFirstPassValid(PR_FALSE) -{ -} - -nsTableOuterFrame::~nsTableOuterFrame() -{ - if (nsnull!=mCaptionFrames) - delete mCaptionFrames; - if (nsnull!=mBottomCaptions) - delete mBottomCaptions; -} - -NS_METHOD nsTableOuterFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - // for debug... - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -PRBool nsTableOuterFrame::NeedsReflow(const nsSize& aMaxSize) -{ - PRBool result=PR_TRUE; - if (nsnull!=mInnerTableFrame) - result = mInnerTableFrame->NeedsReflow(aMaxSize); - return result; -} - -PRBool nsTableOuterFrame::IsFirstPassValid() -{ - return mFirstPassValid; -} - -void nsTableOuterFrame::SetFirstPassValid(PRBool aValidState) -{ - mFirstPassValid = aValidState; -} - -/** - * ResizeReflow is a 2-step process. - * In the first step, we lay out all of the captions and the inner table in NS_UNCONSTRAINEDSIZE space. - * This gives us absolute minimum and maximum widths. - * In the second step, we force all the captions and the table to the width of the widest component, - * given the table's width constraints. - * With the widths known, we reflow the captions and table. - * NOTE: for breaking across pages, this method has to account for table content that is not laid out - * linearly vis a vis the frames. That is, content hierarchy and the frame hierarchy do not match. - */ -NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - if (PR_TRUE==gsDebug) - printf ("***table outer frame reflow \t\t%p\n", this); - if (PR_TRUE==gsDebug) - printf("nsTableOuterFrame::ResizeReflow : maxSize=%d,%d\n", - aMaxSize.width, aMaxSize.height); - -#ifdef NS_DEBUG - // replace with a check that does not assume linear placement of children - // PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; - nsSize innerTableMaxElementSize(0,0); - - // Set up our kids. They're already present, on an overflow list, - // or there are none so we'll create them now - MoveOverflowToChildList(); - if (nsnull==mFirstChild) - CreateChildFrames(aPresContext); - if (nsnull!=mPrevInFlow && nsnull==mInnerTableFrame) - { // if I am a continuing frame, my inner table is my prev-in-flow's mInnerTableFrame's next-in-flow - CreateInnerTableFrame(aPresContext); - } - // at this point, we must have at least one child frame, and we must have an inner table frame - NS_ASSERTION(nsnull!=mFirstChild, "no children"); - NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame"); - if (nsnull==mFirstChild || nsnull==mInnerTableFrame) { - //ERROR! - aStatus = frComplete; - return NS_OK; - } - - OuterTableReflowState state(aPresContext, aMaxSize); - - // lay out captions pass 1, if necessary - if (PR_FALSE==IsFirstPassValid()) - { - mFirstPassValid = PR_TRUE; - aStatus = ResizeReflowCaptionsPass1(aPresContext); - - } - - // lay out inner table, if required - if (PR_FALSE==mInnerTableFrame->IsFirstPassValid()) - { // we treat the table as if we've never seen the layout data before - mInnerTableFrame->SetReflowPass(nsTableFrame::kPASS_FIRST); - aStatus = mInnerTableFrame->ResizeReflowPass1(aPresContext, aDesiredSize, aMaxSize, - &innerTableMaxElementSize); - -#ifdef NOISY_MARGINS - nsIContent* content = nsnull; - mInnerTableFrame->GetContent(content); - nsTablePart *table = (nsTablePart*)content; - if (table != nsnull) - table->DumpCellMap(); - mInnerTableFrame->RecalcLayoutData(); - mInnerTableFrame->ListColumnLayoutData(stdout,1); -#endif - - } - mInnerTableFrame->SetReflowPass(nsTableFrame::kPASS_SECOND); - // assign table width info only if the inner table frame is a first-in-flow - nsIFrame* prevInFlow; - - mInnerTableFrame->GetPrevInFlow(prevInFlow); - if (nsnull==prevInFlow) - { - // assign column widths, and assign aMaxElementSize->width - mInnerTableFrame->BalanceColumnWidths(aPresContext, aMaxSize, aMaxElementSize); - // assign table width - mInnerTableFrame->SetTableWidth(aPresContext); - } - // inner table max is now the computed width and assigned height - nsSize innerTableSize; - - mInnerTableFrame->GetSize(innerTableSize); - state.innerTableMaxSize.width = innerTableSize.width; - state.innerTableMaxSize.height = aMaxSize.height; - - // Reflow the child frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - NS_ABORT(); // huge error for tables! - } else { - // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; - } - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - //NS_ASSERTION(0width, aMaxElementSize->height); - else - printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n", - aStatus==frComplete ? "Complete" : "Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - -#ifdef NS_DEBUG - // replace with a check that does not assume linear placement of children - // PostReflowCheck(status); -#endif - // REMOVE ME! - /* - nsIFrame *next = this; - nsIFrame *root=nsnull; - while (nsnull!=next) - { - root = next; - next = next->GetGeometricParent(); - } - root->List(); - */ - // end REMOVE ME! - - return NS_OK; - -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableOuterFrame::GetTopMarginFor(nsIPresContext* aCX, - OuterTableReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableOuterFrame::PlaceChild( OuterTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug) - printf ("outer table place child: %p with aKidRect %d %d %d %d\n", - aKidFrame, aKidRect.x, aKidRect.y, - aKidRect.width, aKidRect.height); - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - /* Update the maximum element size, which is the sum of: - * the maxElementSize of our first row - * plus the maxElementSize of the top caption if we include it - * plus the maxElementSize of the bottom caption if we include it - */ - if (PR_TRUE==aState.processingCaption || PR_TRUE==aState.firstRowGroup) - { - if (PR_FALSE==aState.processingCaption) - aState.firstRowGroup = PR_FALSE; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aKidMaxElementSize.width; - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool originalLastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - aState.availSize.width = aState.innerTableMaxSize.width; - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsReflowMetrics kidSize; - nsIFrame::ReflowStatus status; - - SetReflowState(aState, kidFrame); - - if (PR_TRUE==gsDebug) printf ("ReflowMappedChildren: %p with state = %s\n", - kidFrame, aState.processingCaption?"caption":"inner"); - - // Get top margin for this kid - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = - (nsStyleSpacing*)kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - aState.availSize.width -= kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Only skip the reflow if this is not our first child and we are - // out of space. - if ((kidFrame == mFirstChild) || (aState.availSize.height > 0)) { - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, kidSize, - aState.availSize, pKidMaxElementSize, - aState); - } - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (kidFrame != mFirstChild)) { - // The child is too tall to fit in the available space, and it's - // not our first child - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aState, kidFrame, kidRect, aMaxElementSize, kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - if (frNotComplete == status) { - // No, the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a continuing - // frame. This hooks the child into the flow - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to the sibling list - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - /* debug */ - /* - printf ("having just pushed children, here is the frame hierarchy.\n"); - nsIFrame *p; - GetGeometricParent(p); - nsIFrame *root; - while (nsnull!=p) - { - root = p; - p->GetGeometricParent(p); - } - root->List(); - fflush(stdout); - */ - /* end debug */ - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - // XXX talk with troy about checking for available space here - } - - // Update the child count - mChildCount = childCount; - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - // Set the last content offset based on the last child we mapped. - NS_ASSERTION(IsLastChild(prevKidFrame), "unexpected last child"); - SetLastContentOffset(prevKidFrame); - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableOuterFrame* nextInFlow = (nsTableOuterFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list - //NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - - if ((kidFrameSize.width > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize, aState); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Place the child after taking into account it's margin -// aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); -// kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableOuterFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableOuterFrame* flow = (nsTableOuterFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableOuterFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** set the OuterTableReflowState based on the child frame we are currently processing. - * must be called before ReflowChild, at a minimum. - */ -void nsTableOuterFrame::SetReflowState(OuterTableReflowState& aState, nsIFrame* aKidFrame) -{ - nsIContentPtr kid; - - aKidFrame->GetContent(kid.AssignRef()); // kid: REFCNT++ - nsITableContent *tableContentInterface = nsnull; - kid->QueryInterface(kITableContentIID, (void**)&tableContentInterface);// tableContentInterface: REFCNT++ - if (nsnull!=tableContentInterface) - { - aState.processingCaption = PR_TRUE; - NS_RELEASE(tableContentInterface); // tableContentInterface: REFCNT-- - } - else - aState.processingCaption = PR_FALSE; -} - -/** - * Reflow a child frame and return the status of the reflow. If the - * child is complete and it has next-in-flows (it was a splittable child) - * then delete the next-in-flows. - */ -nsIFrame::ReflowStatus -nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - OuterTableReflowState& aState) -{ - ReflowStatus status; - - /* call the appropriate reflow method based on the type and position of the child */ - if (PR_TRUE==aState.processingCaption) - { // it's a caption, find out if it's top or bottom - // Resolve style - nsIStyleContextPtr captionStyleContext; - - aKidFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); - nsStyleText* captionStyle = - (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); - NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); - if ((eStyleUnit_Enumerated == captionStyle->mVerticalAlign.GetUnit()) && - (NS_STYLE_VERTICAL_ALIGN_BOTTOM==captionStyle->mVerticalAlign.GetIntValue())) - { - if (PR_TRUE==gsDebug) printf("reflowChild called with a bottom caption\n"); - status = ResizeReflowBottomCaptionsPass2(aPresContext, aDesiredSize, - aMaxSize, aMaxElementSize, - aState.y); - } - else - { - if (PR_TRUE==gsDebug) printf("reflowChild called with a top caption\n"); - status = ResizeReflowTopCaptionsPass2(aPresContext, aDesiredSize, - aMaxSize, aMaxElementSize); - } - } - else - { - if (PR_TRUE==gsDebug) printf("reflowChild called with a table body\n"); - status = ((nsTableFrame*)aKidFrame)->ResizeReflowPass2(aPresContext, aDesiredSize, aState.innerTableMaxSize, - aMaxElementSize, - mMinCaptionWidth, mMaxCaptionWidth); - } - if (PR_TRUE==gsDebug) - { - } - - if (frComplete == status) { - nsIFrame* kidNextInFlow; - - aKidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull != kidNextInFlow) { - // Remove all of the childs next-in-flows. Make sure that we ask - // the right parent to do the removal (it's possible that the - // parent is not this because we are executing pullup code) - nsTableOuterFrame* parent; - - aKidFrame->GetGeometricParent((nsIFrame*&)parent); - parent->DeleteChildsNextInFlow(aKidFrame); - } - } - return status; -} - -void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) -{ - nsIFrame *prevKidFrame = nsnull; - nsresult frameCreated = nsTableFrame::NewFrame((nsIFrame **)(&mInnerTableFrame), mContent, 0, this); - if (NS_OK!=frameCreated) - return; // SEC: an error!!!! - // Resolve style - nsIStyleContextPtr kidStyleContext = - aPresContext->ResolveStyleContextFor(mContent, this); - NS_ASSERTION(kidStyleContext.IsNotNull(), "bad style context for kid."); - mInnerTableFrame->SetStyleContext(kidStyleContext); - mChildCount++; - // Link child frame into the list of children - mFirstChild = mInnerTableFrame; - prevKidFrame = mInnerTableFrame; - - // now create the caption frames, prepending top captions and - // appending bottom captions - mCaptionFrames = new nsVoidArray(); - // create caption frames as needed - nsIFrame *lastTopCaption = nsnull; - for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) { - nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++ - if (caption.IsNull()) { - break; - } - const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType(); - if (contentType==nsITableContent::kTableCaptionType) - { - nsIFrame *captionFrame=nsnull; - frameCreated = nsTableCaptionFrame::NewFrame(&captionFrame, caption, 0, this); - if (NS_OK!=frameCreated) - return; // SEC: an error!!!! - // Resolve style - nsIStyleContextPtr captionStyleContext = - aPresContext->ResolveStyleContextFor(caption, this); - NS_ASSERTION(captionStyleContext.IsNotNull(), "bad style context for caption."); - nsStyleText* captionStyle = - (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); - captionFrame->SetStyleContext(captionStyleContext); - mChildCount++; - // Link child frame into the list of children - if ((eStyleUnit_Enumerated == captionStyle->mVerticalAlign.GetUnit()) && - (NS_STYLE_VERTICAL_ALIGN_BOTTOM==captionStyle->mVerticalAlign.GetIntValue())) - { // bottom captions get added to the end of the outer frame child list - prevKidFrame->SetNextSibling(captionFrame); - prevKidFrame = captionFrame; - // bottom captions get remembered in an instance variable for easy access later - if (nsnull==mBottomCaptions) - { - mBottomCaptions = new nsVoidArray(); - } - mBottomCaptions->AppendElement(captionFrame); - } - else - { // top captions get prepended to the outer frame child list - if (nsnull == lastTopCaption) - { // our first top caption, therefore our first child - mFirstChild = captionFrame; - mFirstChild->SetNextSibling(mInnerTableFrame); - } - else - { // just another grub in the brood of top captions - lastTopCaption->SetNextSibling(captionFrame); - lastTopCaption = captionFrame; - } - lastTopCaption = captionFrame; - } - mCaptionFrames->AppendElement(captionFrame); - } - else - { - break; - } - } -} - - -nsIFrame::ReflowStatus -nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext) -{ - if (nsnull!=mCaptionFrames) - { - PRInt32 numCaptions = mCaptionFrames->Count(); - for (PRInt32 captionIndex = 0; captionIndex < numCaptions; captionIndex++) - { - nsSize maxElementSize(0,0); - nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); - nsReflowMetrics desiredSize; - nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex); - ReflowStatus status; - captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status); - if (mMinCaptionWidthVerticallyAlignChild(aPresContext); - - } - } - return frComplete; -} - -nsIFrame::ReflowStatus -nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) -{ - ReflowStatus result = frComplete; - nscoord topCaptionY = 0; - if (nsnull!=mCaptionFrames) - { - PRInt32 numCaptions = mCaptionFrames->Count(); - for (PRInt32 captionIndex = 0; captionIndex < numCaptions; captionIndex++) - { - // get the caption - nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex); - - // Resolve style - nsIStyleContextPtr captionStyleContext; - - captionFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); - nsStyleText* captionStyle = - (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); - NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); - - if ((eStyleUnit_Enumerated == captionStyle->mVerticalAlign.GetUnit()) && - (NS_STYLE_VERTICAL_ALIGN_BOTTOM==captionStyle->mVerticalAlign.GetIntValue())) - { - } - else - { // top-align captions, the default - // reflow the caption, skipping top captions after the first that doesn't fit - if (frComplete==result) - { - nsReflowMetrics desiredSize; - result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull); - // place the caption - captionFrame->SetRect(nsRect(0, topCaptionY, desiredSize.width, desiredSize.height)); - if (NS_UNCONSTRAINEDSIZE!=desiredSize.height) - topCaptionY += desiredSize.height; - else - topCaptionY = NS_UNCONSTRAINEDSIZE; - mInnerTableFrame->MoveTo(0, topCaptionY); - PRInt32 captionIndexInParent; - - captionFrame->GetIndexInParent(captionIndexInParent); - if (0==captionIndexInParent) - { - SetFirstContentOffset(captionFrame); - if (gsDebug) printf("OUTER: set first content offset to %d\n", GetFirstContentOffset()); //@@@ - } - } - // else continue on, so we can build the mBottomCaptions list - } - } - } - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = topCaptionY; - if (nsnull!=aMaxElementSize) - { // SEC: this isn't right - aMaxElementSize->width = aMaxSize.width; - aMaxElementSize->height = topCaptionY; - } - return result; -} - -nsIFrame::ReflowStatus -nsTableOuterFrame::ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nscoord aYOffset) -{ - ReflowStatus result = frComplete; - nscoord bottomCaptionY = aYOffset; - // for now, assume all captions are stacked vertically - if (nsnull!=mBottomCaptions) - { - PRInt32 numCaptions = mBottomCaptions->Count(); - for (PRInt32 captionIndex = 0; captionIndex < numCaptions; captionIndex++) - { - // get the caption - nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mBottomCaptions->ElementAt(captionIndex); - - // Resolve style -/* - nsIStyleContextPtr captionStyleContext = captionFrame->GetStyleContext(aPresContext); - NS_ASSERTION(nsnull != captionStyleContext, "null style context for caption"); - nsStyleMolecule* captionStyle = - (nsStyleMolecule*)captionStyleContext->GetData(kStyleMoleculeSID); - NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); -*/ - // reflow the caption - nsReflowMetrics desiredSize; - result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull); - - // place the caption - nsRect rect; - - captionFrame->GetRect(rect); - rect.y = bottomCaptionY; - rect.width=desiredSize.width; - rect.height=desiredSize.height; - captionFrame->SetRect(rect); - if (NS_UNCONSTRAINEDSIZE!=desiredSize.height) - bottomCaptionY += desiredSize.height; - else - bottomCaptionY = NS_UNCONSTRAINEDSIZE; - } - } - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = bottomCaptionY-aYOffset; - if (nsnull!=aMaxElementSize) - { // SEC: not right - aMaxElementSize->width = aMaxSize.width; - aMaxElementSize->height = bottomCaptionY-aYOffset; - } - return result; -} - -/** - * Sets the last content offset based on the last child frame. If the last - * child is a pseudo frame then it sets mLastContentIsComplete to be the same - * as the last child's mLastContentIsComplete - */ -/* -void nsTableOuterFrame::SetLastContentOffset(const nsIFrame* aLastChild) -{ - NS_PRECONDITION(nsnull != aLastChild, "bad argument"); - NS_PRECONDITION(aLastChild->GetGeometricParent() == this, "bad geometric parent"); - - if (ChildIsPseudoFrame(aLastChild)) { - nsContainerFrame* pseudoFrame = (nsContainerFrame*)aLastChild; - mLastContentOffset = pseudoFrame->GetLastContentOffset(); - mLastContentIsComplete = pseudoFrame->GetLastContentIsComplete(); - } else { - mLastContentOffset = aLastChild->GetIndexInParent(); - } -#ifdef NS_DEBUG - if (mLastContentOffset < mFirstContentOffset) { - nsIFrame* top = this; - while (top->GetGeometricParent() != nsnull) { - top = top->GetGeometricParent(); - } - top->List(); - } -#endif - // it is this next line that forces us to re-implement this method here - //NS_ASSERTION(mLastContentOffset >= mFirstContentOffset, "unexpected content mapping"); -} -*/ - -NS_METHOD -nsTableOuterFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::IncrementalReflow\n"); - // total hack for now, just some hard-coded values - ResizeReflow(aPresContext, aDesiredSize, aMaxSize, nsnull, aStatus); - return NS_OK; -} - -NS_METHOD nsTableOuterFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableOuterFrame* cf = new nsTableOuterFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - cf->SetFirstPassValid(PR_TRUE); - if (PR_TRUE==gsDebug) - printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); - aContinuingFrame = cf; - return NS_OK; -} - -void nsTableOuterFrame::PrepareContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsTableOuterFrame* aContFrame) -{ - // Append the continuing frame to the flow - aContFrame->AppendToFlow(this); - - // Initialize it's content offsets. Note that we assume for now that - // the continuingFrame will map the remainder of the content and - // that therefore mLastContentIsComplete will be true. - PRInt32 nextOffset; - if (mChildCount > 0) { - nextOffset = mLastContentOffset; - if (mLastContentIsComplete) { - nextOffset++; - } - } else { - nextOffset = mFirstContentOffset; - } - - aContFrame->SetFirstContentOffset(nextOffset); - aContFrame->SetLastContentOffset(nextOffset); - aContFrame->SetLastContentIsComplete(PR_TRUE); - - // Resolve style for the continuing frame and set its style context. - // XXX presumptive - nsIStyleContextPtr styleContext = - aPresContext->ResolveStyleContextFor(mContent, aParent); - aContFrame->SetStyleContext(styleContext); -} - -NS_METHOD nsTableOuterFrame::VerifyTree() const -{ -#ifdef NS_DEBUG - -#endif - return NS_OK; -} - -/** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow - * pointers. - * - * Updates the child count and content offsets of all containers that are - * affected - * - * Overloaded here because nsContainerFrame makes assumptions about pseudo-frames - * that are not true for tables. - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise - */ -PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild) -{ - NS_PRECONDITION(IsChild(aChild), "bad geometric parent"); - - nsIFrame* nextInFlow; - - aChild->GetNextInFlow(nextInFlow); - - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nsTableOuterFrame* parent; - - nextInFlow->GetGeometricParent((nsIFrame*&)parent); - - // If the next-in-flow has a next-in-flow then delete it too (and - // delete it first). - nsIFrame* nextNextInFlow; - - nextInFlow->GetNextInFlow(nextNextInFlow); - if (nsnull != nextNextInFlow) { - parent->DeleteChildsNextInFlow(nextInFlow); - } - -#ifdef NS_DEBUG - PRInt32 childCount; - nsIFrame* firstChild; - - nextInFlow->ChildCount(childCount); - nextInFlow->FirstChild(firstChild); - - NS_ASSERTION(childCount == 0, "deleting !empty next-in-flow"); - - NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); -#endif - - // Disconnect the next-in-flow from the flow list - nextInFlow->BreakFromPrevFlow(); - - // Take the next-in-flow out of the parent's child list - if (parent->mFirstChild == nextInFlow) { - nextInFlow->GetNextSibling(parent->mFirstChild); - if (nsnull != parent->mFirstChild) { - parent->SetFirstContentOffset(parent->mFirstChild); - if (parent->IsPseudoFrame()) { - parent->PropagateContentOffsets(); - } - } - - // When a parent loses it's last child and that last child is a - // pseudo-frame then the parent's content offsets are now wrong. - // However, we know that the parent will eventually be reflowed - // in one of two ways: it will either get a chance to pullup - // children or it will be deleted because it's prev-in-flow - // (e.g. this) is complete. In either case, the content offsets - // will be repaired. - - } else { - nsIFrame* nextSibling; - - // Because the next-in-flow is not the first child of the parent - // we know that it shares a parent with aChild. Therefore, we need - // to capture the next-in-flow's next sibling (in case the - // next-in-flow is the last next-in-flow for aChild AND the - // next-in-flow is not the last child in parent) - NS_ASSERTION(parent->IsChild(aChild), "screwy flow"); - aChild->GetNextSibling(nextSibling); - NS_ASSERTION(nextSibling == nextInFlow, "unexpected sibling"); - - nextInFlow->GetNextSibling(nextSibling); - aChild->SetNextSibling(nextSibling); - } - - // Delete the next-in-flow frame and adjust it's parent's child count - nextInFlow->DeleteFrame(); - parent->mChildCount--; - -#ifdef NS_DEBUG - aChild->GetNextInFlow(nextInFlow); - NS_POSTCONDITION(nsnull == nextInFlow, "non null next-in-flow"); -#endif - - return PR_TRUE; -} - - -void nsTableOuterFrame::CreateInnerTableFrame(nsIPresContext* aPresContext) -{ - // Do we have a prev-in-flow? - if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame - mInnerTableFrame = new nsTableFrame(mContent, mIndexInParent, this); - mChildCount++; - - // Resolve style and set the style context - nsIStyleContextPtr styleContext = - aPresContext->ResolveStyleContextFor(mContent, this); - mInnerTableFrame->SetStyleContext(styleContext); - } else { - nsTableOuterFrame* prevOuterTable = (nsTableOuterFrame*)mPrevInFlow; - - nsIFrame* prevInnerTable = prevOuterTable->mInnerTableFrame; - - // Create a continuing column - prevInnerTable->GetNextInFlow((nsIFrame*&)mInnerTableFrame); - if (nsnull==mInnerTableFrame) - { - nsIFrame* continuingFrame; - - prevInnerTable->CreateContinuingFrame(aPresContext, this, continuingFrame); - mInnerTableFrame = (nsTableFrame*)continuingFrame; - mChildCount++; - } - } -} - -/* ----- static methods ----- */ - -nsresult nsTableOuterFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableOuterFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} diff --git a/mozilla/layout/tables/nsTableOuterFrame.h b/mozilla/layout/tables/nsTableOuterFrame.h deleted file mode 100644 index b53523daabc..00000000000 --- a/mozilla/layout/tables/nsTableOuterFrame.h +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableOuterFrame_h__ -#define nsTableOuterFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - -class nsTableFrame; -class nsVoidArray; -class nsTableCaptionFrame; -struct OuterTableReflowState; -struct nsStyleSpacing; - -/** - * main frame for an nsTable content object, - * the nsTableOuterFrame contains 0 or more nsTableCaptionFrames, - * and a single nsTableFrame psuedo-frame, often referred to as the "inner frame'. - *

    Unlike other frames that handle continuing across breaks, nsTableOuterFrame - * has no notion of "unmapped" children. All children (captions and inner table) - * have frames created in Pass 1, so from the layout process' point of view, they - * are always mapped - * - * @author sclark - */ -class nsTableOuterFrame : public nsContainerFrame -{ -public: - - /** instantiate a new instance of nsTableFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** outer tables are reflowed in two steps. - * Step 1:, we lay out all of the captions and the inner table with - * height and width set to NS_UNCONSTRAINEDSIZE. - * This gives us absolute minimum and maximum widths for each component. - * In the second step, we set all the captions and the inner table to - * the width of the widest component, given the table's style, width constraints - * and compatibility mode.
    - * Step 2: With the widths now known, we reflow the captions and table.
    - * NOTE: for breaking across pages, this method has to account for table content - * that is not laid out linearly vis a vis the frames. - * That is, content hierarchy and the frame hierarchy do not match. - * - * @see NeedsReflow - * @see ResizeReflowCaptionsPass1 - * @see ResizeReflowTopCaptionsPass2 - * @see ResizeReflowBottomCaptionsPass2 - * @see PlaceChild - * @see ReflowMappedChildren - * @see PullUpChildren - * @see ReflowChild - * @see nsTableFrame::ResizeReflowPass1 - * @see nsTableFrame::ResizeReflowPass2 - * @see nsTableFrame::BalanceColumnWidths - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - /** destructor */ - virtual ~nsTableOuterFrame(); - -protected: - - /** protected constructor - * @see NewFrame - */ - nsTableOuterFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** return PR_TRUE if the table needs to be reflowed. - * the outer table needs to be reflowed if the table content has changed, - * or if the table style attributes or parent max height/width have - * changed. - */ - virtual PRBool NeedsReflow(const nsSize& aMaxSize); - - /** returns PR_TRUE if the data obtained from the first reflow pass - * is cached and still valid (ie, no content or style change notifications.) - */ - virtual PRBool IsFirstPassValid(); - - /** setter for mFirstPassValid. - * should be called with PR_FALSE when: - * content changes, style changes, or context changes - */ - virtual void SetFirstPassValid(PRBool aValidState); - - /** create all child frames for this table */ - virtual void CreateChildFrames(nsIPresContext* aPresContext); - - /** reflow the captions in an infinite space, caching the min/max sizes for each - */ - virtual ReflowStatus ResizeReflowCaptionsPass1(nsIPresContext* aPresContext); - - /** reflow the top captions in a space constrained by the computed table width - * and the heigth given to us by our parent. Top captions are laid down - * before the inner table. - */ - virtual ReflowStatus ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); - - /** reflow the bottom captions in a space constrained by the computed table width - * and the heigth given to us by our parent. Bottom captions are laid down - * after the inner table. - */ - virtual ReflowStatus ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nscoord aYOffset); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - OuterTableReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild( OuterTableReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - OuterTableReflowState& aState, - nsSize* aMaxElementSize); - - virtual void SetReflowState(OuterTableReflowState& aState, - nsIFrame* aKidFrame); - - virtual nsIFrame::ReflowStatus ReflowChild( nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - OuterTableReflowState& aState); - - /** overridden here to handle special caption-table relationship - * @see nsContainerFrame::VerifyTree - */ - NS_IMETHOD VerifyTree() const; - - /** overridden here to handle special caption-table relationship - * @see nsContainerFrame::PrepareContinuingFrame - */ - virtual void PrepareContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsTableOuterFrame* aContFrame); - - /** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow - * pointers. - * - * Updates the child count and content offsets of all containers that are - * affected - * - * Overloaded here because nsContainerFrame makes assumptions about pseudo-frames - * that are not true for tables. - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise - */ - PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild); - - /** create the inner table frame (nsTableFrame) - * handles initial creation as well as creation of continuing frames - */ - virtual void CreateInnerTableFrame(nsIPresContext* aPresContext); - - -private: - /** used to keep track of this frame's children */ - nsTableFrame *mInnerTableFrame; - nsVoidArray * mCaptionFrames; - nsVoidArray * mBottomCaptions; - - /** used to keep track of min/max caption requirements */ - PRInt32 mMinCaptionWidth; - PRInt32 mMaxCaptionWidth; - - /** used to cache reflow results so we can optimize out reflow in some circumstances */ - nsReflowMetrics mDesiredSize; - nsSize mMaxElementSize; - - /** we can skip the first pass on captions if mFirstPassValid is true */ - PRBool mFirstPassValid; - -}; - - - -#endif diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp deleted file mode 100644 index 9fc165ca65b..00000000000 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ /dev/null @@ -1,1061 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableRowFrame.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsTableFrame.h" -#include "nsTableCellFrame.h" -#include "nsTableCell.h" -#include "nsCellLayoutData.h" -#include "nsIView.h" - -#ifdef NS_DEBUG -static PRBool gsDebug1 = PR_FALSE; -static PRBool gsDebug2 = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -#else -static const PRBool gsDebug1 = PR_FALSE; -static const PRBool gsDebug2 = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -/* ----------- RowReflowState ---------- */ - -struct RowReflowState { - // The body's available size (computed from the body's parent) - nsSize availSize; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Running x-offset - nscoord x; - - // Height of tallest cell (excluding cells with rowspan>1) - nscoord maxCellHeight; - - nsTableFrame *tableFrame; - - - RowReflowState( nsIPresContext* aPresContext, - const nsSize& aMaxSize) - { - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - x=0; - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - maxCellHeight=0; - tableFrame = nsnull; - } - - ~RowReflowState() { - } -}; - - - - -/* ----------- nsTableRowpFrame ---------- */ - -nsTableRowFrame::nsTableRowFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame), - mTallestCell(0) -{ -} - -nsTableRowFrame::~nsTableRowFrame() -{ -} - -void nsTableRowFrame::ResetMaxChildHeight() -{ - mTallestCell=0; -} - -void nsTableRowFrame::SetMaxChildHeight(PRInt32 aChildHeight) -{ - if (mTallestCellGetView(pView); - if (nsnull == pView) { - nsRect kidRect; - kid->GetRect(kidRect); - nsRect damageArea(aDirtyRect); - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - aRenderingContext.PushState(); - aRenderingContext.Translate(kidRect.x, kidRect.y); - kid->Paint(aPresContext, aRenderingContext, kidDamageArea); - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, kidRect.width, kidRect.height); - } - aRenderingContext.PopState(); - } else { - NS_RELEASE(pView); - } - kid->GetNextSibling(kid); - } -} - - -/** returns the tallest child in this row (ignoring any cell with rowspans) */ -PRInt32 nsTableRowFrame::GetTallestChild() const -{ - return mTallestCell; -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableRowFrame::GetTopMarginFor( nsIPresContext* aCX, - RowReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableRowFrame::PlaceChild(nsIPresContext* aPresContext, - RowReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug1) - printf ("row: placing cell at %d, %d, %d, %d\n", - aKidRect.x, aKidRect.y, aKidRect.width, aKidRect.height); - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Update the maximum element size - PRInt32 rowSpan = ((nsTableCellFrame*)aKidFrame)->GetRowSpan(); - if (nsnull != aMaxElementSize) { - aMaxElementSize->width += aKidMaxElementSize.width; - if ((1==rowSpan) && (aKidMaxElementSize.height>aMaxElementSize->height)) - { - aMaxElementSize->height = aKidMaxElementSize.height; - } - } - if ((1==rowSpan) && (aState.maxCellHeightmFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool lastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsIContent* cell = nsnull; - kidFrame->GetContent(cell); // cell: REFCNT++ - nsSize kidAvailSize(aState.availSize); - if (0>=kidAvailSize.height) - kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIStyleContext* kidSC; - kidFrame->GetStyleContext(aPresContext, kidSC); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - NS_RELEASE(kidSC); - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width -= kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - if (NS_UNCONSTRAINEDSIZE == aState.availSize.width) - { - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - nsCellLayoutData kidLayoutData((nsTableCellFrame *)kidFrame, &desiredSize, pKidMaxElementSize); - aState.tableFrame->SetCellLayoutData(&kidLayoutData, (nsTableCell *)cell); - } - else - { // we're in a constrained situation, so get the avail width from the known column widths - nsCellLayoutData *cellData = aState.tableFrame->GetCellLayoutData((nsTableCell *)cell); - PRInt32 cellStartingCol = ((nsTableCell *)cell)->GetColIndex(); - PRInt32 cellColSpan = ((nsTableCell *)cell)->GetColSpan(); - nscoord availWidth = 0; - for (PRInt32 numColSpan=0; numColSpanGetColumnWidth(cellStartingCol+numColSpan); -// NS_ASSERTION(0width, pKidMaxElementSize->height); - else - printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", - desiredSize.width, desiredSize.height); - } - } - NS_RELEASE(cell); // cell: REFCNT-- - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (desiredSize.height > kidAvailSize.height))) - { - // The child's height is too big to fit at all in our remaining space, - // and it's not our first child. - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete, too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - // Our mLastContentIsComplete was already set by the last kid we - // reflowed reflow's status - result = PR_FALSE; - break; - } - - // Adjust the running x-offset, taking into account intruders (cells from prior rows with rowspans > 1) - aState.x = 0; - PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex(); - for (PRInt32 colIndex=0; colIndexGetColumnWidth(colIndex); - // Place the child after taking into account it's margin - nsRect kidRect (aState.x, topMargin, desiredSize.width, desiredSize.height); - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, - kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - /* Rows should not create continuing frames for cells - * unless they absolutely have to! - * check to see if this is absolutely necessary (with new params from troy) - * otherwise PushChildren and bail. - */ - // Special handling for incomplete children - if (frNotComplete == status) { - // XXX It's good to assume that we might still have room - // even if the child didn't complete (floaters will want this) - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // No the child isn't complete, and it doesn't have a next in flow so - // create a continuing frame. This hooks the child into the flow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Insert the frame. We'll reflow it next pass through the loop - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Add back in the left and right margins, because one row does not - // impact another row's width - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width += kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - } - - SetMaxChildHeight(aState.maxCellHeight); // remember height of tallest child who doesn't have a row span - - // Update the child count - mChildCount = childCount; - -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); -#endif - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowFrame* flow = (nsTableRowFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowFrame* flow = (nsTableRowFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableRowFrame* nextInFlow = (nsTableRowFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - nsSize kidAvailSize(aState.availSize); -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics desiredSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list -// NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - - if ((kidFrameSize.height > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - nsIContent *cell = nsnull; - kidFrame->GetContent(cell); // cell: REFNCT++ - // we're in a constrained situation, so get the avail width from the known column widths - nsCellLayoutData *cellData = aState.tableFrame->GetCellLayoutData((nsTableCell *)cell); - PRInt32 cellStartingCol = ((nsTableCell *)cell)->GetColIndex(); - PRInt32 cellColSpan = ((nsTableCell *)cell)->GetColSpan(); - nscoord availWidth = 0; - for (PRInt32 numColSpan=0; numColSpanGetColumnWidth(cellStartingCol+numColSpan); - NS_ASSERTION(0width, pKidMaxElementSize->height); - else - printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", - desiredSize.width, desiredSize.height); - } - } - NS_RELEASE(cell); // cell: REFCNT-- - - // Did the child fit? - if ((desiredSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too tall to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Adjust the running x-offset, taking into account intruders (cells from prior rows with rowspans > 1) - aState.x = 0; - PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex(); - for (PRInt32 colIndex=0; colIndexGetColumnWidth(colIndex); - // Place the child - //nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidMol); - nsRect kidRect (aState.x, 0, desiredSize.width, desiredSize.height); - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableRowFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowFrame* flow = (nsTableRowFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsTableRowFrame* prev = (nsTableRowFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time, until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - nsSize kidAvailSize(aState.availSize); - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); // XXX remember this... - - for (;;) { - // Get the next content object - nsIContent* cell = mContent->ChildAt(kidIndex); - if (nsnull == cell) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - NS_RELEASE(cell); // cell: REFCNT--(a) - break; - } - - // Resolve style - nsIStyleContext* kidStyleContext = - aPresContext->ResolveStyleContextFor(cell, this); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidStyleContext->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - nsIFrame* kidFrame; - - // Create a child frame - if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel = nsnull; - kidDel = cell->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, cell, kidIndex, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidStyleContext); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - NS_RELEASE(kidStyleContext); - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics desiredSize; - ReflowStatus status; - if (NS_UNCONSTRAINEDSIZE == aState.availSize.width) - { - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - nsCellLayoutData kidLayoutData((nsTableCellFrame *)kidFrame, &desiredSize, pKidMaxElementSize); - aState.tableFrame->SetCellLayoutData(&kidLayoutData, (nsTableCell *)cell); - } - else - { // we're in a constrained situation, so get the avail width from the known column widths - nsCellLayoutData *cellData = aState.tableFrame->GetCellLayoutData((nsTableCell *)cell); - PRInt32 cellStartingCol = ((nsTableCell *)cell)->GetColIndex(); - PRInt32 cellColSpan = ((nsTableCell *)cell)->GetColSpan(); - nscoord availWidth = 0; - for (PRInt32 numColSpan=0; numColSpanGetColumnWidth(cellStartingCol+numColSpan); - NS_ASSERTION(0width, pKidMaxElementSize->height); - else - printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", - desiredSize.width, desiredSize.height); - } - } - NS_RELEASE(cell); // cell: REFCNT-- - - // Did the child fit? - if ((desiredSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - aState.x = 0; - // if we're constrained, compute the x offset where the cell should be put - if (NS_UNCONSTRAINEDSIZE!=aState.availSize.width) - { - // Adjust the running x-offset, taking into account intruders (cells from prior rows with rowspans > 1) - PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex(); - for (PRInt32 colIndex=0; colIndexGetColumnWidth(colIndex); - } - // Place the child - nsRect kidRect (aState.x, topMargin, desiredSize.width, desiredSize.height); - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - } - - SetMaxChildHeight(aState.maxCellHeight); // remember height of tallest child who doesn't have a row span - - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - - -/** Layout the entire row. - * This method stacks rows horizontally according to HTML 4.0 rules. - * Rows are responsible for layout of their children (cells). - */ -NS_METHOD -nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) - printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n", - aMaxSize.width, aMaxSize.height); -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - // Initialize our internal data - ResetMaxChildHeight(); - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; - - // Check for an overflow list - MoveOverflowToChildList(); - - RowReflowState state(aPresContext, aMaxSize); - mContentParent->GetContentParent((nsIFrame*&)(state.tableFrame)); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - } - - // Return our desired rect - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = state.maxCellHeight; - -#ifdef NS_DEBUG - PostReflowCheck(aStatus); -#endif - - if (gsDebug1==PR_TRUE) - { - if (nsnull!=aMaxElementSize) - printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height, - aMaxElementSize->width, aMaxElementSize->height); - else - printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - - return NS_OK; - -} - -NS_METHOD -nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n"); - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsTableRowFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::CreateContinuingFrame\n"); - nsTableRowFrame* cf = new nsTableRowFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - aContinuingFrame = cf; - return NS_OK; -} - -nsresult nsTableRowFrame::NewFrame( nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableRowFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - diff --git a/mozilla/layout/tables/nsTableRowFrame.h b/mozilla/layout/tables/nsTableRowFrame.h deleted file mode 100644 index 141ef6a9a6d..00000000000 --- a/mozilla/layout/tables/nsTableRowFrame.h +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableRowFrame_h__ -#define nsTableRowFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" - -struct RowReflowState; -struct nsStyleSpacing; - -/** - * nsTableRowFrame is the frame that maps table rows - * (HTML tag TR). This class cannot be reused - * outside of an nsTableRowGroupFrame. It assumes that its parent is an nsTableRowGroupFrame, - * and its children are nsTableCellFrames. - * - * @see nsTableFrame - * @see nsTableRowGroupFrame - * @see nsTableCellFrame - * - * @author sclark - */ -class nsTableRowFrame : public nsContainerFrame -{ -public: - - /** instantiate a new instance of nsTableRowFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - - /** ask all children to paint themselves, without clipping (for cells with rowspan>1) - * @see nsIFrame::Paint - */ - virtual void PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** calls ResizeReflow for all of its child cells. - * Cells with rowspan=1 are all set to the same height and stacked horizontally. - *

    Cells are not split unless absolutely necessary. - *

    Cells are resized in nsTableFrame::BalanceColumnWidths - * and nsTableFrame::ShrinkWrapChildren - * - * @param aDesiredSize width set to width of the sum of the cells, height set to - * height of cells with rowspan=1. - * - * @see nsIFrame::ResizeReflow - * @see nsTableFrame::BalanceColumnWidths - * @see nsTableFrame::ShrinkWrapChildren - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame::CreateContinuingFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** set mTallestCell to 0 in anticipation of recalculating it */ - void ResetMaxChildHeight(); - - /** set mTallestCell to max(mTallestCell, aChildHeight) */ - void SetMaxChildHeight(PRInt32 aChildHeight); - - /** returns the tallest child in this row (ignoring any cell with rowspans) */ - PRInt32 GetTallestChild() const; - - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableRowFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** destructor */ - virtual ~nsTableRowFrame(); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - RowReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild( nsIPresContext* aPresContext, - RowReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); - - -private: - PRInt32 mTallestCell; // not my height, but the height of my tallest child - -}; - -#endif diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp deleted file mode 100644 index 3cbc1e206de..00000000000 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ /dev/null @@ -1,958 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTableRowGroupFrame.h" -#include "nsTableRowFrame.h" -#include "nsTableCellFrame.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsIStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIContent.h" -#include "nsIContentDelegate.h" -#include "nsIView.h" -#include "nsIPtr.h" - -#ifdef NS_DEBUG -static PRBool gsDebug1 = PR_FALSE; -static PRBool gsDebug2 = PR_FALSE; -//#define NOISY -//#define NOISY_FLOW -#else -static const PRBool gsDebug1 = PR_FALSE; -static const PRBool gsDebug2 = PR_FALSE; -#endif - -static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID); - -NS_DEF_PTR(nsIStyleContext); -NS_DEF_PTR(nsIContent); - -/* ----------- RowGroupReflowState ---------- */ - -struct RowGroupReflowState { - // The body's available size (computed from the body's parent) - nsSize availSize; - - // Margin tracking information - nscoord prevMaxPosBottomMargin; - nscoord prevMaxNegBottomMargin; - - // Flags for whether the max size is unconstrained - PRBool unconstrainedWidth; - PRBool unconstrainedHeight; - - // Running y-offset - nscoord y; - - // Flag used to set aMaxElementSize to my first row - PRBool firstRow; - - // Remember the height of the first row, because it's our maxElementHeight (plus header/footers) - nscoord firstRowHeight; - - RowGroupReflowState(nsIPresContext* aPresContext, - const nsSize& aMaxSize) - { - availSize.width = aMaxSize.width; - availSize.height = aMaxSize.height; - prevMaxPosBottomMargin = 0; - prevMaxNegBottomMargin = 0; - y=0; // border/padding/margin??? - unconstrainedWidth = PRBool(aMaxSize.width == NS_UNCONSTRAINEDSIZE); - unconstrainedHeight = PRBool(aMaxSize.height == NS_UNCONSTRAINEDSIZE); - firstRow = PR_TRUE; - firstRowHeight=0; - } - - ~RowGroupReflowState() { - } -}; - - - - -/* ----------- nsTableRowGroupFrame ---------- */ - -nsTableRowGroupFrame::nsTableRowGroupFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame) - : nsContainerFrame(aContent, aIndexInParent, aParentFrame) -{ - mType = aContent->GetTag(); // mType: REFCNT++ -} - -nsTableRowGroupFrame::~nsTableRowGroupFrame() -{ - if (nsnull!=mType) - NS_RELEASE(mType); // mType: REFCNT-- -} - -NS_METHOD nsTableRowGroupFrame::GetRowGroupType(nsIAtom *& aType) -{ - NS_ADDREF(mType); - aType=mType; - return NS_OK; -} - - -NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - - // for debug... - /* - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(128,0,0)); - aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); - } - */ - - PaintChildren(aPresContext, aRenderingContext, aDirtyRect); - return NS_OK; -} - -// aDirtyRect is in our coordinate system -// child rect's are also in our coordinate system -/** overloaded method from nsContainerFrame. The difference is that - * we don't want to clip our children, so a cell can do a rowspan - */ -void nsTableRowGroupFrame::PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect) -{ - nsIFrame* kid = mFirstChild; - while (nsnull != kid) { - nsIView *pView; - - kid->GetView(pView); - if (nsnull == pView) { - nsRect kidRect; - kid->GetRect(kidRect); - nsRect damageArea(aDirtyRect); - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - aRenderingContext.PushState(); - aRenderingContext.Translate(kidRect.x, kidRect.y); - kid->Paint(aPresContext, aRenderingContext, kidDamageArea); - if (nsIFrame::GetShowFrameBorders()) { - aRenderingContext.SetColor(NS_RGB(255,0,0)); - aRenderingContext.DrawRect(0, 0, kidRect.width, kidRect.height); - } - aRenderingContext.PopState(); - } - else - NS_RELEASE(pView); - kid->GetNextSibling(kid); - } -} - -// Collapse child's top margin with previous bottom margin -nscoord nsTableRowGroupFrame::GetTopMarginFor(nsIPresContext* aCX, - RowGroupReflowState& aState, - nsStyleSpacing* aKidSpacing) -{ - nscoord margin; - nscoord maxNegTopMargin = 0; - nscoord maxPosTopMargin = 0; - if ((margin = aKidSpacing->mMargin.top) < 0) { - maxNegTopMargin = -margin; - } else { - maxPosTopMargin = margin; - } - - nscoord maxPos = PR_MAX(aState.prevMaxPosBottomMargin, maxPosTopMargin); - nscoord maxNeg = PR_MAX(aState.prevMaxNegBottomMargin, maxNegTopMargin); - margin = maxPos - maxNeg; - - return margin; -} - -// Position and size aKidFrame and update our reflow state. The origin of -// aKidRect is relative to the upper-left origin of our frame, and includes -// any left/top margin. -void nsTableRowGroupFrame::PlaceChild( nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize) -{ - if (PR_TRUE==gsDebug1) - printf ("rowgroup: placing row at %d, %d, %d, %d\n", - aKidRect.x, aKidRect.y, aKidRect.width, aKidRect.height); - - // Place and size the child - aKidFrame->SetRect(aKidRect); - - // Adjust the running y-offset - aState.y += aKidRect.height; - - // If our height is constrained then update the available height - if (PR_FALSE == aState.unconstrainedHeight) { - aState.availSize.height -= aKidRect.height; - } - - // Update the maximum element size - if (PR_TRUE==aState.firstRow) - { - aState.firstRow = PR_FALSE; - aState.firstRowHeight = aKidRect.height; - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = aKidMaxElementSize.width; - aMaxElementSize->height = aKidMaxElementSize.height; - } - } -} - -/** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ -PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - NS_PRECONDITION(nsnull != mFirstChild, "no children"); - - PRInt32 childCount = 0; - nsIFrame* prevKidFrame = nsnull; - - // Remember our original mLastContentIsComplete so that if we end up - // having to push children, we have the correct value to hand to - // PushChildren. - PRBool lastContentIsComplete = mLastContentIsComplete; - - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRBool result = PR_TRUE; - - for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - if (0>=kidAvailSize.height) - kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; - - // Get top margin for this kid - nsIContentPtr kid; - - kidFrame->GetContent(kid.AssignRef()); - nsIStyleContextPtr kidSC; - - kidFrame->GetStyleContext(aPresContext, kidSC.AssignRef()); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - // Figure out the amount of available size for the child (subtract - // off the top margin we are going to apply to it) - if (PR_FALSE == aState.unconstrainedHeight) { - kidAvailSize.height -= topMargin; - } - // Subtract off for left and right margin - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width -= kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Reflow the child into the available space - status = ReflowChild(kidFrame, aPresContext, desiredSize, - kidAvailSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidFrame != mFirstChild) && - ((kidAvailSize.height <= 0) || - (desiredSize.height > kidAvailSize.height))) - { - // The child's height is too big to fit at all in our remaining space, - // and it's not our first child. - // - // Note that if the width is too big that's okay and we allow the - // child to extend horizontally outside of the reflow area - - // Since we are giving the next-in-flow our last child, we - // give it our original mLastContentIsComplete, too (in case we - // are pushing into an empty next-in-flow) - PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - - // Our mLastContentIsComplete was already set by the last kid we - // reflowed reflow's status - result = PR_FALSE; - break; - } - - // Place the child after taking into account it's margin - aState.y += topMargin; - nsRect kidRect (0, 0, desiredSize.width, desiredSize.height); - kidRect.x += kidSpacing->mMargin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, - kidMaxElementSize); - if (bottomMargin < 0) { - aState.prevMaxNegBottomMargin = -bottomMargin; - } else { - aState.prevMaxPosBottomMargin = bottomMargin; - } - childCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - - // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); - - /* Row groups should not create continuing frames for rows - * unless they absolutely have to! - * check to see if this is absolutely necessary (with new params from troy) - * otherwise PushChildren and bail. - */ - // Special handling for incomplete children - if (frNotComplete == status) { - // XXX It's good to assume that we might still have room - // even if the child didn't complete (floaters will want this) - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - PRBool lastContentIsComplete = mLastContentIsComplete; - if (nsnull == kidNextInFlow) { - // No the child isn't complete, and it doesn't have a next in flow so - // create a continuing frame. This hooks the child into the flow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - - // Insert the frame. We'll reflow it next pass through the loop - nsIFrame* nextSib; - - kidFrame->GetNextSibling(nextSib); - continuingFrame->SetNextSibling(nextSib); - kidFrame->SetNextSibling(continuingFrame); - if (nsnull == nextSib) { - // Assume that the continuation frame we just created is - // complete, for now. It will get reflowed by our - // next-in-flow (we are going to push it now) - lastContentIsComplete = PR_TRUE; - } - } - // We've used up all of our available space so push the remaining - // children to the next-in-flow - nsIFrame* nextSibling; - - kidFrame->GetNextSibling(nextSibling); - if (nsnull != nextSibling) { - PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); - } - result = PR_FALSE; - break; - } - - // Add back in the left and right margins, because one row does not - // impact another row's width - if (PR_FALSE == aState.unconstrainedWidth) { - kidAvailSize.width += kidSpacing->mMargin.left + kidSpacing->mMargin.right; - } - - // Get the next child - kidFrame->GetNextSibling(kidFrame); - - } - - // Update the child count - mChildCount = childCount; - -#ifdef NS_DEBUG - NS_POSTCONDITION(LengthOf(mFirstChild) == mChildCount, "bad child count"); - - nsIFrame* lastChild; - PRInt32 lastIndexInParent; - - LastChild(lastChild); - lastChild->GetIndexInParent(lastIndexInParent); - NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset"); -#endif - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": reflow mapped %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ -PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif -#ifdef NOISY - ListTag(stdout); - printf(": pullup (childCount=%d) [%d,%d,%c]\n", - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - nsTableRowGroupFrame* nextInFlow = (nsTableRowGroupFrame*)mNextInFlow; - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; -#ifdef NS_DEBUG - PRInt32 kidIndex = NextChildOffset(); -#endif - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); - - // This will hold the prevKidFrame's mLastContentIsComplete - // status. If we have to push the frame that follows prevKidFrame - // then this will become our mLastContentIsComplete state. Since - // prevKidFrame is initially our last frame, it's completion status - // is our mLastContentIsComplete value. - PRBool prevLastContentIsComplete = mLastContentIsComplete; - - PRBool result = PR_TRUE; - - while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; - - // Get the next child - nsIFrame* kidFrame = nextInFlow->mFirstChild; - - // Any more child frames? - if (nsnull == kidFrame) { - // No. Any frames on its overflow list? - if (nsnull != nextInFlow->mOverflowList) { - // Move the overflow list to become the child list -// NS_ABORT(); - nextInFlow->AppendChildren(nextInFlow->mOverflowList); - nextInFlow->mOverflowList = nsnull; - kidFrame = nextInFlow->mFirstChild; - } else { - // We've pulled up all the children, so move to the next-in-flow. - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - continue; - } - } - - // See if the child fits in the available space. If it fits or - // it's splittable then reflow it. The reason we can't just move - // it is that we still need ascent/descent information - nsSize kidFrameSize; - SplittableType kidIsSplittable; - - kidFrame->GetSize(kidFrameSize); - kidFrame->IsSplittable(kidIsSplittable); - if ((kidFrameSize.height > aState.availSize.height) && - (kidIsSplittable == frNotSplittable)) { - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, - pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child - result = PR_FALSE; - mLastContentIsComplete = prevLastContentIsComplete; - break; - } - - // Place the child - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - //kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Remove the frame from its current parent - kidFrame->GetNextSibling(nextInFlow->mFirstChild); - nextInFlow->mChildCount--; - // Update the next-in-flows first content offset - if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); - } - - // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; - - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } - if (nsnull == prevKidFrame) { - mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); - } else { - prevKidFrame->SetNextSibling(kidFrame); - } - kidFrame->SetNextSibling(nsnull); - mChildCount++; - - // Remember where we just were in case we end up pushing children - prevKidFrame = kidFrame; - prevLastContentIsComplete = mLastContentIsComplete; - - // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { - // No the child isn't complete - nsIFrame* kidNextInFlow; - - kidFrame->GetNextInFlow(kidNextInFlow); - if (nsnull == kidNextInFlow) { - // The child doesn't have a next-in-flow so create a - // continuing frame. The creation appends it to the flow and - // prepares it for reflow. - nsIFrame* continuingFrame; - - kidFrame->CreateContinuingFrame(aPresContext, this, continuingFrame); - NS_ASSERTION(nsnull != continuingFrame, "frame creation failed"); - - // Add the continuing frame to our sibling list and then push - // it to the next-in-flow. This ensures the next-in-flow's - // content offsets and child count are set properly. Note that - // we can safely assume that the continuation is complete so - // we pass PR_TRUE into PushChidren in case our next-in-flow - // was just drained and now needs to know it's - // mLastContentIsComplete state. - kidFrame->SetNextSibling(continuingFrame); - - PushChildren(continuingFrame, kidFrame, PR_TRUE); - - // After we push the continuation frame we don't need to fuss - // with mLastContentIsComplete beause the continuation frame - // is no longer on *our* list. - } - - // If the child isn't complete then it means that we've used up - // all of our available space. - result = PR_FALSE; - break; - } - } - - // Update our last content offset - if (nsnull != prevKidFrame) { - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); - } - - // We need to make sure the first content offset is correct for any empty - // next-in-flow frames (frames where we pulled up all the child frames) - nextInFlow = (nsTableRowGroupFrame*)mNextInFlow; - if ((nsnull != nextInFlow) && (nsnull == nextInFlow->mFirstChild)) { - // We have at least one empty frame. Did we succesfully pull up all the - // child frames? - if (PR_FALSE == result) { - // No, so we need to adjust the first content offset of all the empty - // frames - AdjustOffsetOfEmptyNextInFlows(); -#ifdef NS_DEBUG - } else { - // Yes, we successfully pulled up all the child frames which means all - // the next-in-flows must be empty. Do a sanity check - while (nsnull != nextInFlow) { - NS_ASSERTION(nsnull == nextInFlow->mFirstChild, "non-empty next-in-flow"); - nextInFlow->GetNextInFlow((nsIFrame*&)nextInFlow); - } -#endif - } - } - -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - -#ifdef NOISY - ListTag(stdout); - printf(": pullup %sok (childCount=%d) [%d,%d,%c]\n", - (result ? "" : "NOT "), - mChildCount, - mFirstContentOffset, mLastContentOffset, - (mLastContentIsComplete ? 'T' : 'F')); -#ifdef NOISY_FLOW - { - nsTableRowGroupFrame* flow = (nsTableRowGroupFrame*) mNextInFlow; - while (flow != 0) { - printf(" %p: [%d,%d,%c]\n", - flow, flow->mFirstContentOffset, flow->mLastContentOffset, - (flow->mLastContentIsComplete ? 'T' : 'F')); - flow = (nsTableRowGroupFrame*) flow->mNextInFlow; - } - } -#endif -#endif - return result; -} - -/** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ -nsIFrame::ReflowStatus -nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize) -{ -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; - - // If we have no children and we have a prev-in-flow then we need to pick - // up where it left off. If we have children, e.g. we're being resized, then - // our content offset should already be set correctly... - if ((nsnull == mFirstChild) && (nsnull != mPrevInFlow)) { - nsTableRowGroupFrame* prev = (nsTableRowGroupFrame*)mPrevInFlow; - NS_ASSERTION(prev->mLastContentOffset >= prev->mFirstContentOffset, "bad prevInFlow"); - - mFirstContentOffset = prev->NextChildOffset(); - if (!prev->mLastContentIsComplete) { - // Our prev-in-flow's last child is not complete - prev->LastChild(kidPrevInFlow); - } - } - - mLastContentIsComplete = PR_TRUE; - - // Place our children, one at a time, until we are out of children - nsSize kidMaxElementSize; - nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; - PRInt32 kidIndex = NextChildOffset(); - nsIFrame* prevKidFrame; - - LastChild(prevKidFrame); // XXX remember this... - - for (;;) { - // Get the next content object - nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (kid.IsNull()) { - result = frComplete; - break; - } - - // Make sure we still have room left - if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... - break; - } - - // Resolve style - nsIStyleContextPtr kidSC = - aPresContext->ResolveStyleContextFor(kid, this); - nsStyleSpacing* kidSpacing = (nsStyleSpacing*) - kidSC->GetData(kStyleSpacingSID); - nscoord topMargin = GetTopMarginFor(aPresContext, aState, kidSpacing); - nscoord bottomMargin = kidSpacing->mMargin.bottom; - - nsIFrame* kidFrame; - - // Create a child frame - if (nsnull == kidPrevInFlow) { - nsIContentDelegate* kidDel = nsnull; - kidDel = kid->GetDelegate(aPresContext); - kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this); - NS_RELEASE(kidDel); - kidFrame->SetStyleContext(kidSC); - } else { - kidPrevInFlow->CreateContinuingFrame(aPresContext, this, kidFrame); - } - - // Try to reflow the child into the available space. It might not - // fit or might need continuing. - nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); - - // Did the child fit? - if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { - // The child is too wide to fit in the available space, and it's - // not our first child. Add the frame to our overflow list - NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); - mOverflowList = kidFrame; - prevKidFrame->SetNextSibling(nsnull); - break; - } - - // Place the child - //aState.y += topMargin; - nsRect kidRect (0, 0, kidSize.width, kidSize.height); - //kidRect.x += kidMol->margin.left; - kidRect.y += aState.y; - PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize); - - // Link child frame into the list of children - if (nsnull != prevKidFrame) { - prevKidFrame->SetNextSibling(kidFrame); - } else { - mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); - } - prevKidFrame = kidFrame; - mChildCount++; - kidIndex++; - - // Did the child complete? - if (frNotComplete == status) { - // If the child isn't complete then it means that we've used up - // all of our available space - mLastContentIsComplete = PR_FALSE; - break; - } - kidPrevInFlow = nsnull; - } - - // Update the content mapping - NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); -#ifdef NS_DEBUG - PRInt32 len = LengthOf(mFirstChild); - NS_ASSERTION(len == mChildCount, "bad child count"); -#endif -#ifdef NS_DEBUG - VerifyLastIsComplete(); -#endif - return result; -} - - -/** Layout the entire row group. - * This method stacks rows vertically according to HTML 4.0 rules. - * Rows are responsible for layout of their children. - */ -NS_METHOD -nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) - printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n", - aMaxSize.width, aMaxSize.height); -#ifdef NS_DEBUG - PreReflowCheck(); -#endif - - // Initialize out parameter - if (nsnull != aMaxElementSize) { - aMaxElementSize->width = 0; - aMaxElementSize->height = 0; - } - - PRBool reflowMappedOK = PR_TRUE; - - aStatus = frComplete; - - // Check for an overflow list - MoveOverflowToChildList(); - - RowGroupReflowState state(aPresContext, aMaxSize); - - // Reflow the existing frames - if (nsnull != mFirstChild) { - reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); - if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; - } - } - - // Did we successfully relow our mapped children? - if (PR_TRUE == reflowMappedOK) { - // Any space left? - if (state.availSize.height <= 0) { - // No space left. Don't try to pull-up children or reflow unmapped - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; - } - } else if (NextChildOffset() < mContent->ChildCount()) { - // Try and pull-up some children from a next-in-flow - if (PullUpChildren(aPresContext, state, aMaxElementSize)) { - // If we still have unmapped children then create some new frames - if (NextChildOffset() < mContent->ChildCount()) { - aStatus = ReflowUnmappedChildren(aPresContext, state, aMaxElementSize); - } - } else { - // We were unable to pull-up all the existing frames from the - // next in flow - aStatus = frNotComplete; - } - } - } - - if (frComplete == aStatus) { - // Don't forget to add in the bottom margin from our last child. - // Only add it in if there's room for it. - nscoord margin = state.prevMaxPosBottomMargin - - state.prevMaxNegBottomMargin; - if (state.availSize.height >= margin) { - state.y += margin; - } - } - - // Return our desired rect - //NS_ASSERTION(0width, aMaxElementSize->height); - else - printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", - aDesiredSize.width, aDesiredSize.height); - } - - return NS_OK; - -} - -NS_METHOD -nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) -{ - if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n"); - - // total hack for now, just some hard-coded values - aDesiredSize.width = aMaxSize.width; - aDesiredSize.height = aMaxSize.height; - - aStatus = frComplete; - return NS_OK; -} - -NS_METHOD nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame) -{ - nsTableRowGroupFrame* cf = new nsTableRowGroupFrame(mContent, mIndexInParent, aParent); - PrepareContinuingFrame(aPresContext, aParent, cf); - if (PR_TRUE==gsDebug1) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); - aContinuingFrame = cf; - return NS_OK; -} - -/* ----- static methods ----- */ - -nsresult nsTableRowGroupFrame::NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIFrame* it = new nsTableRowGroupFrame(aContent, aIndexInParent, aParent); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - *aInstancePtrResult = it; - return NS_OK; -} - - - diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.h b/mozilla/layout/tables/nsTableRowGroupFrame.h deleted file mode 100644 index c341db18a06..00000000000 --- a/mozilla/layout/tables/nsTableRowGroupFrame.h +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTableRowGroupFrame_h__ -#define nsTableRowGroupFrame_h__ - -#include "nscore.h" -#include "nsContainerFrame.h" -#include "nsIAtom.h" - -struct RowGroupReflowState; -struct nsStyleSpacing; - -/** - * nsTableRowGroupFrame is the frame that maps row groups - * (HTML tags THEAD, TFOOT, and TBODY). This class cannot be reused - * outside of an nsTableFrame. It assumes that its parent is an nsTableFrame, and - * its children are nsTableRowFrames. - * - * @see nsTableFrame - * @see nsTableRowFrame - * - * @author sclark - */ -class nsTableRowGroupFrame : public nsContainerFrame -{ -public: - - /** instantiate a new instance of nsTableRowGroupFrame. - * @param aInstancePtrResult the new object is returned in this out-param - * @param aContent the table object to map - * @param aIndexInParent which child is the new frame? - * @param aParent the parent of the new frame - * - * @return NS_OK if the frame was properly allocated, otherwise an error code - */ - static nsresult NewFrame(nsIFrame** aInstancePtrResult, - nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParent); - - /** @see nsIFrame::Paint */ - NS_IMETHOD Paint(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** ask all children to paint themselves, without clipping (for cells with rowspan>1) - * @see nsIFrame::Paint - */ - virtual void PaintChildren(nsIPresContext& aPresContext, - nsIRenderingContext& aRenderingContext, - const nsRect& aDirtyRect); - - /** calls ResizeReflow for all of its child rows. - * Rows are all set to the same width and stacked vertically. - *

    rows are not split unless absolutely necessary. - * - * @param aDesiredSize width set to width of rows, height set to - * sum of height of rows that fit in aMaxSize.height. - * - * @see nsIFrame::ResizeReflow - */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - ReflowStatus& aStatus); - /** @see nsIFrame::IncrementalReflow */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); - - /** @see nsContainerFrame::CreateContinuingFrame */ - NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, - nsIFrame* aParent, - nsIFrame*& aContinuingFrame); - - /** returns the type of the mapped row group content in aType. - * caller MUST call release on the returned object if it is not null. - * - * @param aType out param filled with the type of the mapped content, or null if none. - * - * @return NS_OK - */ - NS_IMETHOD GetRowGroupType(nsIAtom *& aType); - -protected: - - /** protected constructor. - * @see NewFrame - */ - nsTableRowGroupFrame(nsIContent* aContent, - PRInt32 aIndexInParent, - nsIFrame* aParentFrame); - - /** protected destructor */ - ~nsTableRowGroupFrame(); - - nscoord GetTopMarginFor(nsIPresContext* aCX, - RowGroupReflowState& aState, - nsStyleSpacing* aKidSpacing); - - void PlaceChild( nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsIFrame* aKidFrame, - const nsRect& aKidRect, - nsSize* aMaxElementSize, - nsSize& aKidMaxElementSize); - - /** - * Reflow the frames we've already created - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully reflowed all the mapped children and false - * otherwise, e.g. we pushed children to the next in flow - */ - PRBool ReflowMappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Try and pull-up frames from our next-in-flow - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return true if we successfully pulled-up all the children and false - * otherwise, e.g. child didn't fit - */ - PRBool PullUpChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); - - /** - * Create new frames for content we haven't yet mapped - * - * @param aPresContext presentation context to use - * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued - */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); - -private: - nsIAtom *mType; - -}; - - -#endif diff --git a/mozilla/layout/tools/CSSKeywords.txt b/mozilla/layout/tools/CSSKeywords.txt deleted file mode 100644 index cb02da3707e..00000000000 --- a/mozilla/layout/tools/CSSKeywords.txt +++ /dev/null @@ -1,91 +0,0 @@ -absolute -arrow -auto -baseline -blink -block -bold -bolder -both -bottom -capitalize -center -circle -cm -dashed -decimal -disc -dotted -double -em -ex -fixed -groove -hand -hidden -ibeam -in -inherit -inline -inset -inside -italic -justify -large -larger -left -lighter -line-through -list-item -lower-alpha -lower-roman -lowercase -ltr -medium -middle -mm -no-repeat -none -normal -noshade -nowrap -oblique -outset -outside -overline -paragraph -pc -pre -pt -px -relative -repeat -repeat-x -repeat-y -ridge -right -rtl -scroll -small -small-caps -smaller -solid -square -static -sub -super -text-bottom -text-top -thick -thin -top -transparent -underline -upper-alpha -upper-roman -uppercase -visible -x-large -x-small -xx-large -xx-small diff --git a/mozilla/layout/tools/CSSProps.txt b/mozilla/layout/tools/CSSProps.txt deleted file mode 100644 index 46fb0b04097..00000000000 --- a/mozilla/layout/tools/CSSProps.txt +++ /dev/null @@ -1,79 +0,0 @@ -background -background-attachment -background-color -background-filter -background-image -background-position -background-x-position -background-y-position -background-repeat -border -border-bottom -border-bottom-color -border-bottom-style -border-bottom-width -border-color -border-left -border-left-color -border-left-style -border-left-width -border-right -border-right-color -border-right-style -border-right-width -border-style -border-top -border-top-color -border-top-style -border-top-width -border-width -clear -clip -clip-bottom -clip-left -clip-right -clip-top -color -cursor -cursor-image -direction -display -filter -float -font -font-family -font-size -font-style -font-variant -font-weight -height -left -letter-spacing -line-height -list-style -list-style-image -list-style-position -list-style-type -margin -margin-bottom -margin-left -margin-right -margin-top -overflow -padding -padding-bottom -padding-left -padding-right -padding-top -position -text-align -text-decoration -text-indent -text-transform -top -vertical-align -visibility -white-space -width -word-spacing -z-index diff --git a/mozilla/layout/tools/ColorNames.txt b/mozilla/layout/tools/ColorNames.txt deleted file mode 100644 index 47eeda2cc22..00000000000 --- a/mozilla/layout/tools/ColorNames.txt +++ /dev/null @@ -1,140 +0,0 @@ -aliceblue: NS_RGB(240, 248, 255) -antiquewhite: NS_RGB(250, 235, 215) -aqua: NS_RGB( 0, 255, 255) -aquamarine: NS_RGB(127, 255, 212) -azure: NS_RGB(240, 255, 255) -beige: NS_RGB(245, 245, 220) -bisque: NS_RGB(255, 228, 196) -black: NS_RGB( 0, 0, 0) -blanchedalmond: NS_RGB(255, 235, 205) -blue: NS_RGB( 0, 0, 255) -blueviolet: NS_RGB(138, 43, 226) -brown: NS_RGB(165, 42, 42) -burlywood: NS_RGB(222, 184, 135) -cadetblue: NS_RGB( 95, 158, 160) -chartreuse: NS_RGB(127, 255, 0) -chocolate: NS_RGB(210, 105, 30) -coral: NS_RGB(255, 127, 80) -cornflowerblue: NS_RGB(100, 149, 237) -cornsilk: NS_RGB(255, 248, 220) -crimson: NS_RGB(220, 20, 60) -cyan: NS_RGB( 0, 255, 255) -darkblue: NS_RGB( 0, 0, 139) -darkcyan: NS_RGB( 0, 139, 139) -darkgoldenrod: NS_RGB(184, 134, 11) -darkgray: NS_RGB(169, 169, 169) -darkgreen: NS_RGB( 0, 100, 0) -darkkhaki: NS_RGB(189, 183, 107) -darkmagenta: NS_RGB(139, 0, 139) -darkolivegreen: NS_RGB( 85, 107, 47) -darkorange: NS_RGB(255, 140, 0) -darkorchid: NS_RGB(153, 50, 204) -darkred: NS_RGB(139, 0, 0) -darksalmon: NS_RGB(233, 150, 122) -darkseagreen: NS_RGB(143, 188, 143) -darkslateblue: NS_RGB( 72, 61, 139) -darkslategray: NS_RGB( 47, 79, 79) -darkturquoise: NS_RGB( 0, 206, 209) -darkviolet: NS_RGB(148, 0, 211) -deeppink: NS_RGB(255, 20, 147) -deepskyblue: NS_RGB( 0, 191, 255) -dimgray: NS_RGB(105, 105, 105) -dodgerblue: NS_RGB( 30, 144, 255) -firebrick: NS_RGB(178, 34, 34) -floralwhite: NS_RGB(255, 250, 240) -forestgreen: NS_RGB( 34, 139, 34) -fuchsia: NS_RGB(255, 0, 255) -gainsboro: NS_RGB(220, 220, 220) -ghostwhite: NS_RGB(248, 248, 255) -gold: NS_RGB(255, 215, 0) -goldenrod: NS_RGB(218, 165, 32) -gray: NS_RGB(128, 128, 128) -green: NS_RGB( 0, 128, 0) -greenyellow: NS_RGB(173, 255, 47) -honeydew: NS_RGB(240, 255, 240) -hotpink: NS_RGB(255, 105, 180) -indianred: NS_RGB(205, 92, 92) -indigo: NS_RGB( 75, 0, 130) -ivory: NS_RGB(255, 255, 240) -khaki: NS_RGB(240, 230, 140) -lavender: NS_RGB(230, 230, 250) -lavenderblush: NS_RGB(255, 240, 245) -lawngreen: NS_RGB(124, 252, 0) -lemonchiffon: NS_RGB(255, 250, 205) -lightblue: NS_RGB(173, 216, 230) -lightcoral: NS_RGB(240, 128, 128) -lightcyan: NS_RGB(224, 255, 255) -lightgoldenrodyellow: NS_RGB(250, 250, 210) -lightgreen: NS_RGB(144, 238, 144) -lightgrey: NS_RGB(211, 211, 211) -lightpink: NS_RGB(255, 182, 193) -lightsalmon: NS_RGB(255, 160, 122) -lightseagreen: NS_RGB( 32, 178, 170) -lightskyblue: NS_RGB(135, 206, 250) -lightslategray: NS_RGB(119, 136, 153) -lightsteelblue: NS_RGB(176, 196, 222) -lightyellow: NS_RGB(255, 255, 224) -lime: NS_RGB( 0, 255, 0) -limegreen: NS_RGB( 50, 205, 50) -linen: NS_RGB(250, 240, 230) -magenta: NS_RGB(255, 0, 255) -maroon: NS_RGB(128, 0, 0) -mediumaquamarine: NS_RGB(102, 205, 170) -mediumblue: NS_RGB( 0, 0, 205) -mediumorchid: NS_RGB(186, 85, 211) -mediumpurple: NS_RGB(147, 112, 219) -mediumseagreen: NS_RGB( 60, 179, 113) -mediumslateblue: NS_RGB(123, 104, 238) -mediumspringgreen: NS_RGB( 0, 250, 154) -mediumturquoise: NS_RGB( 72, 209, 204) -mediumvioletred: NS_RGB(199, 21, 133) -midnightblue: NS_RGB( 25, 25, 112) -mintcream: NS_RGB(245, 255, 250) -mistyrose: NS_RGB(255, 228, 225) -moccasin: NS_RGB(255, 228, 181) -navajowhite: NS_RGB(255, 222, 173) -navy: NS_RGB( 0, 0, 128) -oldlace: NS_RGB(253, 245, 230) -olive: NS_RGB(128, 128, 0) -olivedrab: NS_RGB(107, 142, 35) -orange: NS_RGB(255, 165, 0) -orangered: NS_RGB(255, 69, 0) -orchid: NS_RGB(218, 112, 214) -palegoldenrod: NS_RGB(238, 232, 170) -palegreen: NS_RGB(152, 251, 152) -paleturquoise: NS_RGB(175, 238, 238) -palevioletred: NS_RGB(219, 112, 147) -papayawhip: NS_RGB(255, 239, 213) -peachpuff: NS_RGB(255, 218, 185) -peru: NS_RGB(205, 133, 63) -pink: NS_RGB(255, 192, 203) -plum: NS_RGB(221, 160, 221) -powderblue: NS_RGB(176, 224, 230) -purple: NS_RGB(128, 0, 128) -red: NS_RGB(255, 0, 0) -rosybrown: NS_RGB(188, 143, 143) -royalblue: NS_RGB( 65, 105, 225) -saddlebrown: NS_RGB(139, 69, 19) -salmon: NS_RGB(250, 128, 114) -sandybrown: NS_RGB(244, 164, 96) -seagreen: NS_RGB( 46, 139, 87) -seashell: NS_RGB(255, 245, 238) -sienna: NS_RGB(160, 82, 45) -silver: NS_RGB(192, 192, 192) -skyblue: NS_RGB(135, 206, 235) -slateblue: NS_RGB(106, 90, 205) -slategray: NS_RGB(112, 128, 144) -snow: NS_RGB(255, 250, 250) -springgreen: NS_RGB( 0, 255, 127) -steelblue: NS_RGB( 70, 130, 180) -tan: NS_RGB(210, 180, 140) -teal: NS_RGB( 0, 128, 128) -thistle: NS_RGB(216, 191, 216) -tomato: NS_RGB(255, 99, 71) -turquoise: NS_RGB( 64, 224, 208) -violet: NS_RGB(238, 130, 238) -wheat: NS_RGB(245, 222, 179) -white: NS_RGB(255, 255, 255) -whitesmoke: NS_RGB(245, 245, 245) -yellow: NS_RGB(255, 255, 0) -yellowgreen: NS_RGB(154, 205, 50) diff --git a/mozilla/layout/tools/HTMLTags.txt b/mozilla/layout/tools/HTMLTags.txt deleted file mode 100644 index 2fd7697f69e..00000000000 --- a/mozilla/layout/tools/HTMLTags.txt +++ /dev/null @@ -1,90 +0,0 @@ -a -address -applet -area -b -base -basefont -big -blink -blockquote -body -br -caption -center -certificate -cite -code -dd -dir -div -dl -dt -em -embed -font -form -frame -frameset -h1 -h2 -h3 -h4 -h5 -h6 -head -hr -html -i -iframe -ilayer -img -input -isindex -kbd -keygen -layer -li -link -listing -map -menu -meta -multicol -nobr -noembed -noframes -nolayer -noscript -object -ol -option -p -param -plaintext -pre -s -samp -script -select -server -small -spacer -span -strike -strong -style -sub -sup -table -td -textarea -th -title -tr -tt -u -ul -var -wbr -xmp diff --git a/mozilla/layout/tools/Makefile b/mozilla/layout/tools/Makefile deleted file mode 100644 index 477556a6455..00000000000 --- a/mozilla/layout/tools/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../.. - -include $(DEPTH)/config/config.mk - -TARGETS = generated - -include $(DEPTH)/config/rules.mk - -all:: nsHTMLTags.cpp nsCSSProps.cpp nsCSSKeywords.cpp nsColorNames.cpp - -# XXX copy this to a shared config file for raptor -PERL = /usr/sbin/perl -GENHASH_PL = genhash.pl -GENHASH_INC = genhash.inc -GENHASH = $(PERL) $(GENHASH_PL) - -nsCSSProps.cpp: $(GENHASH_PL) $(GENHASH_INC) CSSProps.txt Makefile - $(GENHASH) "1,2,6,12" "" nsCSSProps PROP_ CSSProps.txt nsCSSPropIDs.h > nsCSSProps.cpp - cp nsCSSProps.cpp nsCSSPropIDs.h ../html/style/src - -nsCSSKeywords.cpp: $(GENHASH_PL) $(GENHASH_INC) CSSKeywords.txt Makefile - $(GENHASH) "1,2,3,7" "" nsCSSKeywords KEYWORD_ CSSKeywords.txt nsCSSKeywordIDs.h > nsCSSKeywords.cpp - cp nsCSSKeywords.cpp nsCSSKeywordIDs.h ../html/style/src - -RGB = nsColorNamesRGB.cpp - -nsColorNames.cpp: $(GENHASH_PL) $(GENHASH_INC) ColorNames.txt Makefile - sed -e 's/:.*//' < ColorNames.txt > cnames - echo "/* Do not edit - generated by tools/Makefile */" > $(RGB) - echo "#include \"nsColorNames.h\"" >> $(RGB) - echo "nscolor nsColorNames::kColors[COLOR_MAX] = {" >> $(RGB) - sed -e 's/.*://' -e 's/$$/,/' < ColorNames.txt >> $(RGB) - echo "};" >> $(RGB) - $(GENHASH) "1,2,5,6,7,9,11" "-o" nsColorNames COLOR_ cnames nsColorNameIDs.h > nsColorNames.cpp - cp nsColorNames.cpp nsColorNameIDs.h nsColorNamesRGB.cpp ../../gfx/src - rm cnames diff --git a/mozilla/layout/tools/genhash.inc b/mozilla/layout/tools/genhash.inc deleted file mode 100644 index dab3ba0c4f2..00000000000 --- a/mozilla/layout/tools/genhash.inc +++ /dev/null @@ -1,119 +0,0 @@ -@! -@! The contents of this file are subject to the Netscape Public License -@! Version 1.0 (the "NPL"); you may not use this file except in -@! compliance with the NPL. You may obtain a copy of the NPL at -@! http://www.mozilla.org/NPL/ -@! -@! Software distributed under the NPL is distributed on an "AS IS" basis, -@! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -@! for the specific language governing rights and limitations under the -@! NPL. -@! -@! The Initial Developer of this code under the NPL is Netscape -@! Communications Corporation. Portions created by Netscape are -@! Copyright (C) 1998 Netscape Communications Corporation. All Rights -@! Reserved. - -@! This file is used to generate static hash table lookups. -@! A perl script merges this file with the output of gperf to produce -@! the hash functions. Lines starting with @! are comments. Lines which do -@! not being with @! are copied straight to the output file. "@begin NAME -@! /REGEX1/ /REGEX2/" means to skip lines in the input until REGEX1 is -@! matched, and then begin saving output under name NAME, and stop when -@! REGEX2 is matched. "@include NAME" inserts the data saved as "NAME". -@! "@SUB NAME SUBREGEX" performs a substitution on the data saved in NAME. -@! -@! The following goop extracts the parts we need from the generated output -@! of gperf. We later merge that goop with custom code to generate -@! the tag lookup function. -@! -@begin MACROS /#define/ /^$/ -@begin HASH_TABLE /static unsigned [a-z]+ (asso_values|hash_table)/ /};/ -@begin HASH_FUNC /register int hval = len;/ /return hval/ -@sub HASH_FUNC /return hval \+/hval +=/ -@sub HASH_FUNC /str\[/MYLOWER(str[/ -@sub HASH_FUNC /]]/])]/ -@begin LENGTH_TABLE /static unsigned char lengthtable/ /};/ -@begin TAG_TABLE /static struct StaticNameTable *wordlist/ /};/ -@! -/* -** This is a generated file, do not edit it. This file is created by -** genhash.pl -*/ - -#include "plstr.h" -@classincl -@include MACROS - -struct StaticNameTable { - char* tag; - PRInt32 id; -}; - -static const unsigned char kLowerLookup[256] = { - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64, - 97,98,99,100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -#define MYLOWER(x) kLowerLookup[((x) & 0x7f)] - -/** - * Map a name to an ID or -1 - */ -@classfunc -{ -@include HASH_TABLE -@include LENGTH_TABLE -@include TAG_TABLE - - if (str != NULL) { - int len = PL_strlen(str); - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { -@include HASH_FUNC -@! "hval" now contains hash value - if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) { - if (len == lengthtable[hval]) { - register const char *tag = wordlist[hval].tag; - - /* - ** While not at the end of the string, if they ever differ - ** they are not equal. We know "tag" is already lower case. - */ - while ((*tag != '\0')&&(*str != '\0')) { - if (*tag != (char) MYLOWER(*str)) { - return -1; - } - tag++; - str++; - } - - /* - ** One of the strings has ended, if they are both ended, then they - ** are equal, otherwise not. - */ - if ((*tag == '\0')&&(*str == '\0')) { - return wordlist[hval].id; - } - } - } - } - } - return -1; -} diff --git a/mozilla/layout/tools/genhash.pl b/mozilla/layout/tools/genhash.pl deleted file mode 100644 index 0f7d91c22c5..00000000000 --- a/mozilla/layout/tools/genhash.pl +++ /dev/null @@ -1,102 +0,0 @@ -#! /usr/local/bin/perl - -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -$klist = @ARGV[0]; -$gperfopts = @ARGV[1]; -$clazz = @ARGV[2]; -$prefix = @ARGV[3]; -$props = @ARGV[4]; -$ids = @ARGV[5]; - - -open(NAMES_FILE, "<$props"); -open(HASH, "|/tools/ns/bin/gperf -T -t -l $gperfopts -NHashFunc -p -k$klist,\$ > gperf.out.$$"); - -# NOTE: the decl here needs to match the TAG_TABLE rules in genhash.inc!!! -print HASH 'struct StaticNameTable { char *name; int id; }; -%% -'; - -open(ID_FILE, ">$ids"); - -# Load in tag names -$nextval = 0; -while () { - if (/(.*)/) { - $prop = $1; - $vals[$nextval] = $prop; - $nextval = $nextval + 1; - } -} - -# Output tag id's to ID_FILE and hash info to HASH -print ID_FILE "/* Do not edit - generated by $0 */\n"; -for ($i = 0; $i < $nextval; $i++) { - $val = $vals[$i]; - $newval = $val; - $newval =~ tr/a-z/A-Z/; - $newval =~ s/-/_/g; - print ID_FILE "#define $prefix$newval $i\n"; - print HASH $vals[$i] . ", $i\n"; -} -print ID_FILE "#define $prefix" . "MAX $i\n"; - -close(NAMES_FILE); -close(HASH); -open(C, ") { - if (/^@begin/) { - ($name, $start, $end) = - m#@begin[ ]*([A-Za-z0-9_]+)[ ]*/([^/]*)/[ ]*/([^/]*)/#; - $line = until (eof(C) || $line =~ /$start/); - if ($line =~ /$start/) { - $template{$name} .= $line; - do { - $line = ; - $template{$name} .= $line; - } until ($line =~ /$end/ || eof(C)); - } - } elsif (/^@include/) { - ($name) = /@include[ ]*(.*)$/; - print $template{$name}; - } elsif (/^@sub/) { - ($name, $old, $new) = - m#@sub[ ]*([A-Za-z0-9_]*)[ ]/([^/]*)/([^/]*)/#; - $template{$name} =~ s/$old/$new/g; - } elsif (/^@classfunc/) { - print "PRInt32 $clazz::LookupName(const char* str)\n"; - } elsif (/^@classincl/) { - print "#include \"$clazz.h\"\n"; - } elsif (/^@/) { - ; - } else { - print $_; - } -} - -# Print out tag name table at the end -print "\nconst $clazz::NameTableEntry $clazz::kNameTable[] = {\n"; -for ($i = 0; $i < $nextval; $i++) { - $val = $vals[$i]; - $newval = $val; - $newval =~ tr/a-z/A-Z/; - print " { \"$vals[$i]\", $i }, \n"; -} -print "};\n"; diff --git a/mozilla/parser/htmlparser/Makefile b/mozilla/parser/htmlparser/Makefile deleted file mode 100644 index 831fd742c9a..00000000000 --- a/mozilla/parser/htmlparser/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = .. - -# Don't try to build robot just yet -# DIRS = src robot - -DIRS = src - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/parser/htmlparser/makefile.win b/mozilla/parser/htmlparser/makefile.win deleted file mode 100644 index 78a595cef67..00000000000 --- a/mozilla/parser/htmlparser/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=.. -IGNORE_MANIFEST=1 - -DIRS = src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/parser/htmlparser/robot/Makefile b/mozilla/parser/htmlparser/robot/Makefile deleted file mode 100644 index c87a607607f..00000000000 --- a/mozilla/parser/htmlparser/robot/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../.. - -include $(DEPTH)/config/config.mk - -CPPSRCS = \ - RobotMain.cpp \ - nsRobotSink.cpp \ - $(NULL) - -REQUIRES=xpcom raptor - -OBJS = $(CPPSRCS:.cpp=.o) - -EX_LIBS = \ - $(DIST)/lib/libraptorbase.a \ - $(DIST)/lib/libraptorhtmlpars.a \ - $(DIST)/lib/libnetlib.a \ - $(DIST)/lib/libpref.a \ - $(DIST)/lib/libxp.a \ - $(DIST)/lib/libjs.a \ - $(DIST)/lib/libxpcom.a \ - $(DIST)/lib/libplc21.a \ - $(DIST)/lib/libplds21.a \ - $(DIST)/lib/libnspr21.a \ - -lXm \ - -lm \ - $(NULL) - -PROG = htmlrobot - -$(PROG):$(OBJS) - @$(MAKE_OBJDIR) - $(CCC) -o $@ $(OBJS) $(LDFLAGS) $(EX_LIBS) $(OS_LIBS) - -TARGETS = $(PROG) - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/parser/htmlparser/robot/RobotMain.cpp b/mozilla/parser/htmlparser/robot/RobotMain.cpp deleted file mode 100644 index db3237ae05e..00000000000 --- a/mozilla/parser/htmlparser/robot/RobotMain.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIRobotSink.h" -#include "nsIRobotSinkObserver.h" -#include "nsIParser.h" -#include "nsVoidArray.h" -#include "nsString.h" -#include "nsIURL.h" - -static nsVoidArray* gWorkList; - -static NS_DEFINE_IID(kIRobotSinkObserverIID, NS_IROBOTSINKOBSERVER_IID); - -class RobotSinkObserver : public nsIRobotSinkObserver { -public: - RobotSinkObserver() { - NS_INIT_REFCNT(); - } - - ~RobotSinkObserver() { - } - - NS_DECL_ISUPPORTS - - NS_IMETHOD ProcessLink(const nsString& aURLSpec); -}; - -NS_IMPL_ISUPPORTS(RobotSinkObserver, kIRobotSinkObserverIID); - -NS_IMETHODIMP RobotSinkObserver::ProcessLink(const nsString& aURLSpec) -{ - fputs(aURLSpec, stdout); - printf("\n"); - return NS_OK; -} - -//---------------------------------------------------------------------- - -int main(int argc, char **argv) -{ - gWorkList = new nsVoidArray(); - - int i; - for (i = 1; i < argc; i++) { - gWorkList->AppendElement(new nsString(argv[i])); - } - - RobotSinkObserver* myObserver = new RobotSinkObserver(); - NS_ADDREF(myObserver); - - for (;;) { - PRInt32 n = gWorkList->Count(); - if (0 == n) { - break; - } - nsString* urlName = (nsString*) gWorkList->ElementAt(n - 1); - gWorkList->RemoveElementAt(n - 1); - - // Create url - nsIURL* url; - nsresult rv = NS_NewURL(&url, *urlName); - if (NS_OK != rv) { - printf("invalid URL: '"); - fputs(*urlName, stdout); - printf("'\n"); - return -1; - } - delete urlName; - - nsIParser* parser; - rv = NS_NewHTMLParser(&parser); - if (NS_OK != rv) { - printf("can't make parser\n"); - return -1; - } - - nsIRobotSink* sink; - rv = NS_NewRobotSink(&sink); - if (NS_OK != rv) { - printf("can't make parser\n"); - return -1; - } - sink->Init(url); - sink->AddObserver(myObserver); - - parser->SetContentSink(sink); - parser->Parse(url); - NS_RELEASE(sink); - NS_RELEASE(parser); - NS_RELEASE(url); - } - - NS_RELEASE(myObserver); - - return 0; -} diff --git a/mozilla/parser/htmlparser/robot/makefile.win b/mozilla/parser/htmlparser/robot/makefile.win deleted file mode 100644 index c64ca35aaf8..00000000000 --- a/mozilla/parser/htmlparser/robot/makefile.win +++ /dev/null @@ -1,62 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = EXE -PROGRAM = .\$(OBJDIR)\htmlrobot.exe - -MISCDEP= \ - $(DIST)\lib\raptorhtmlpars.lib \ - $(DIST)\lib\xpcom32.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib \ - $(NULL) - -MYLIBS= \ - $(DIST)\lib\raptorhtmlpars.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\xpcom32.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib \ - $(NULL) - -LLIBS= $(MYLIBS) \ - shell32.lib \ - -SUBSYSTEM:CONSOLE - -DEFINES=-D_IMPL_NS_HTMLPARS - -CPPSRCS= \ - nsRobotSink.cpp \ - RobotMain.cpp \ - $(NULL) - -CPP_OBJS= \ - .\$(OBJDIR)\nsRobotSink.obj \ - .\$(OBJDIR)\RobotMain.obj - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor -I..\src - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAM) - $(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\htmlrobot.exe diff --git a/mozilla/parser/htmlparser/robot/nsIRobotSink.h b/mozilla/parser/htmlparser/robot/nsIRobotSink.h deleted file mode 100644 index 0b53655ef08..00000000000 --- a/mozilla/parser/htmlparser/robot/nsIRobotSink.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIRobotSink_h___ -#define nsIRobotSink_h___ - -#include "nsIHTMLContentSink.h" -class nsIURL; -class nsIRobotSinkObserver; - -/* 61256800-cfd8-11d1-9328-00805f8add32 */ -#define NS_IROBOTSINK_IID \ -{ 0x61256800, 0xcfd8, 0x11d1, \ - {0x93, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -class nsIRobotSink : public nsIHTMLContentSink { -public: - NS_IMETHOD Init(nsIURL* aDocumentURL) = 0; - NS_IMETHOD AddObserver(nsIRobotSinkObserver* aObserver) = 0; - NS_IMETHOD RemoveObserver(nsIRobotSinkObserver* aObserver) = 0; -}; - -extern nsresult NS_NewRobotSink(nsIRobotSink** aInstancePtrResult); - -#endif /* nsIRobotSink_h___ */ diff --git a/mozilla/parser/htmlparser/robot/nsIRobotSinkObserver.h b/mozilla/parser/htmlparser/robot/nsIRobotSinkObserver.h deleted file mode 100644 index da30b85edd6..00000000000 --- a/mozilla/parser/htmlparser/robot/nsIRobotSinkObserver.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIRobotSinkObserver_h___ -#define nsIRobotSinkObserver_h___ - -#include "nsISupports.h" -class nsString; - -/* fab1d970-cfda-11d1-9328-00805f8add32 */ -#define NS_IROBOTSINKOBSERVER_IID \ -{ 0xfab1d970, 0xcfda, 0x11d1, \ - {0x93, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -class nsIRobotSinkObserver : public nsISupports { -public: - NS_IMETHOD ProcessLink(const nsString& aURLSpec) = 0; -}; - -#endif /* nsIRobotSinkObserver_h___ */ diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp deleted file mode 100644 index e346c3d9bc0..00000000000 --- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIRobotSink.h" -#include "nsIRobotSinkObserver.h" -#include "nsIParserNode.h" -#include "nsString.h" -#include "nsIURL.h" -#include "nsCRT.h" -#include "nsVoidArray.h" -class nsIDocument; - -// TODO -// - add in base tag support -// - get links from other sources: -// - LINK tag -// - STYLE SRC -// - IMG SRC -// - LAYER SRC - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTMLCONTENTSINK_IID); -static NS_DEFINE_IID(kIRobotSinkIID, NS_IROBOTSINK_IID); - -class RobotSink : public nsIRobotSink { -public: - RobotSink(); - ~RobotSink(); - - void* operator new(size_t size) { - void* rv = ::operator new(size); - nsCRT::zero(rv, size); - return (void*) rv; - } - - // nsISupports - NS_DECL_ISUPPORTS - - // nsIHTMLContentSink - virtual PRBool SetTitle(const nsString& aValue); - virtual PRBool OpenHTML(const nsIParserNode& aNode); - virtual PRBool CloseHTML(const nsIParserNode& aNode); - virtual PRBool OpenHead(const nsIParserNode& aNode); - virtual PRBool CloseHead(const nsIParserNode& aNode); - virtual PRBool OpenBody(const nsIParserNode& aNode); - virtual PRBool CloseBody(const nsIParserNode& aNode); - virtual PRBool OpenForm(const nsIParserNode& aNode); - virtual PRBool CloseForm(const nsIParserNode& aNode); - virtual PRBool OpenFrameset(const nsIParserNode& aNode); - virtual PRBool CloseFrameset(const nsIParserNode& aNode); - virtual PRBool OpenContainer(const nsIParserNode& aNode); - virtual PRBool CloseContainer(const nsIParserNode& aNode); - virtual PRBool CloseTopmostContainer(); - virtual PRBool AddLeaf(const nsIParserNode& aNode); - - // nsIRobotSink - NS_IMETHOD Init(nsIURL* aDocumentURL); - NS_IMETHOD AddObserver(nsIRobotSinkObserver* aObserver); - NS_IMETHOD RemoveObserver(nsIRobotSinkObserver* aObserver); - - void ProcessLink(const nsString& aLink); - -protected: - nsIURL* mDocumentURL; - nsVoidArray mObservers; -}; - -nsresult NS_NewRobotSink(nsIRobotSink** aInstancePtrResult) -{ - RobotSink* it = new RobotSink(); - return it->QueryInterface(kIRobotSinkIID, (void**) aInstancePtrResult); -} - -RobotSink::RobotSink() -{ -} - -RobotSink::~RobotSink() -{ - NS_IF_RELEASE(mDocumentURL); - PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { - nsIRobotSinkObserver* cop = (nsIRobotSinkObserver*)mObservers.ElementAt(i); - NS_RELEASE(cop); - } -} - -NS_IMPL_ADDREF(RobotSink); - -NS_IMPL_RELEASE(RobotSink); - -NS_IMETHODIMP RobotSink::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - if (aIID.Equals(kIRobotSinkIID)) { - *aInstancePtr = (void*) this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIHTMLContentSinkIID)) { - *aInstancePtr = (void*) this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*) ((nsISupports*)this); - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -PRBool RobotSink::SetTitle(const nsString& aValue) -{ - return PR_TRUE; -} - -PRBool RobotSink::OpenHTML(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::CloseHTML(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::OpenHead(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::CloseHead(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::OpenBody(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::CloseBody(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::OpenForm(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::CloseForm(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::OpenFrameset(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::CloseFrameset(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::OpenContainer(const nsIParserNode& aNode) -{ - nsAutoString tmp(aNode.GetText()); - tmp.ToUpperCase(); - if (tmp.Equals("A")) { - nsAutoString k, v; - PRInt32 ac = aNode.GetAttributeCount(); - for (PRInt32 i = 0; i < ac; i++) { - // Get upper-cased key - const nsString& key = aNode.GetKeyAt(i); - k.Truncate(); - k.Append(key); - k.ToUpperCase(); - if (k.Equals("HREF")) { - // Get value and remove mandatory quotes - v.Truncate(); - v.Append(aNode.GetValueAt(i)); - PRUnichar first = v.First(); - if ((first == '"') || (first == '\'')) { - if (v.Last() == first) { - v.Cut(0, 1); - PRInt32 pos = v.Length() - 1; - if (pos >= 0) { - v.Cut(pos, 1); - } - } else { - // Mismatched quotes - leave them in - } - } - ProcessLink(v); - } - } - } - return PR_TRUE; -} - -PRBool RobotSink::CloseContainer(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -PRBool RobotSink::CloseTopmostContainer() -{ - return PR_TRUE; -} - -PRBool RobotSink::AddLeaf(const nsIParserNode& aNode) -{ - return PR_TRUE; -} - -NS_IMETHODIMP RobotSink::Init(nsIURL* aDocumentURL) -{ - NS_IF_RELEASE(mDocumentURL); - mDocumentURL = aDocumentURL; - NS_IF_ADDREF(aDocumentURL); - return NS_OK; -} - -NS_IMETHODIMP RobotSink::AddObserver(nsIRobotSinkObserver* aObserver) -{ - if (mObservers.AppendElement(aObserver)) { - NS_ADDREF(aObserver); - return NS_OK; - } - return NS_ERROR_OUT_OF_MEMORY; -} - -NS_IMETHODIMP RobotSink::RemoveObserver(nsIRobotSinkObserver* aObserver) -{ - if (mObservers.RemoveElement(aObserver)) { - NS_RELEASE(aObserver); - return NS_OK; - } - //XXX return NS_ERROR_NOT_FOUND; - return NS_OK; -} - -void RobotSink::ProcessLink(const nsString& aLink) -{ - nsAutoString absURLSpec(aLink); - - // Make link absolute - // XXX base tag handling - nsIURL* docURL = mDocumentURL; - if (nsnull != docURL) { - nsIURL* absurl; - nsresult rv = NS_NewURL(&absurl, docURL, aLink); - if (NS_OK == rv) { - absURLSpec.Truncate(); - absurl->ToString(absURLSpec); - NS_RELEASE(absurl); - } - } - - // Now give link to robot observers - PRInt32 i, n = mObservers.Count(); - for (i = 0; i < n; i++) { - nsIRobotSinkObserver* cop = (nsIRobotSinkObserver*)mObservers.ElementAt(i); - cop->ProcessLink(absURLSpec); - } -} diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp deleted file mode 100644 index 576358036f4..00000000000 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ /dev/null @@ -1,844 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/** - * MODULE NOTES: - * @update gess 4/8/98 - * - * - */ - -#include "CNavDTD.h" -#include "nsHTMLTokens.h" -#include "nsCRT.h" -#include "nsParserTypes.h" -#include "nsIParser.h" - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID); -static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID); - - -/** - * This method gets called as part of our COM-like interfaces. - * Its purpose is to create an interface to parser object - * of some type. - * - * @update gess 4/8/98 - * @param nsIID id of object to discover - * @param aInstancePtr ptr to newly discovered interface - * @return NS_xxx result code - */ -nsresult CNavDTD::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - - if(aIID.Equals(kISupportsIID)) { //do IUnknown... - *aInstancePtr = (nsIDTD*)(this); - } - else if(aIID.Equals(kIDTDIID)) { //do IParser base class... - *aInstancePtr = (nsIDTD*)(this); - } - else if(aIID.Equals(kClassIID)) { //do this class... - *aInstancePtr = (CNavDTD*)(this); - } - else { - *aInstancePtr=0; - return NS_NOINTERFACE; - } - ((nsISupports*) *aInstancePtr)->AddRef(); - return NS_OK; -} - -/** - * This method is defined in nsIParser. It is used to - * cause the COM-like construction of an nsHTMLParser. - * - * @update gess 4/8/98 - * @param nsIParser** ptr to newly instantiated parser - * @return NS_xxx error result - */ -NS_HTMLPARS nsresult NS_NewNavHTMLDTD(nsIDTD** aInstancePtrResult) -{ - CNavDTD* it = new CNavDTD(); - - if (it == 0) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return it->QueryInterface(kClassIID, (void **) aInstancePtrResult); -} - - -NS_IMPL_ADDREF(CNavDTD) -NS_IMPL_RELEASE(CNavDTD) - - -/** - * Default constructor - * - * @update gess 4/9/98 - * @param - * @return - */ -CNavDTD::CNavDTD() : nsIDTD() { - mParser=0; -} - -/** - * Default destructor - * - * @update gess 4/9/98 - * @param - * @return - */ -CNavDTD::~CNavDTD(){ -} - -/** - * - * - * @update gess 3/25/98 - * @param - * @return - */ -void CNavDTD::SetParser(nsIParser* aParser) { - mParser=aParser; -} - - -static char formElementTags[]= { - eHTMLTag_button, eHTMLTag_fieldset, eHTMLTag_input, - eHTMLTag_isindex, eHTMLTag_label, eHTMLTag_legend, - eHTMLTag_select, eHTMLTag_textarea,0}; - -/** - * This method is called to determine whether or not a tag - * of one type can contain a tag of another type. - * - * @update gess 4/8/98 - * @param aParent -- tag enum of parent container - * @param aChild -- tag enum of child container - * @return PR_TRUE if parent can contain child - */ -PRBool CNavDTD::CanContainFormElement(PRInt32 aParent,PRInt32 aChild) const { - PRBool result=(mParser) ? mParser->HasOpenForm() : PR_FALSE; - return result; -} - -/** - * This method is called to determine whether or not a tag - * of one type can contain a tag of another type. - * - * @update gess 4/8/98 - * @param aParent -- tag enum of parent container - * @param aChild -- tag enum of child container - * @return PR_TRUE if parent can contain child - */ -PRBool CNavDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const { - - PRBool result=PR_FALSE; - - //tagset1 has 64 members... - static char gTagSet1[]={ - eHTMLTag_a, eHTMLTag_acronym, eHTMLTag_address, eHTMLTag_applet, - eHTMLTag_bold, eHTMLTag_basefont, eHTMLTag_bdo, eHTMLTag_big, - eHTMLTag_blockquote,eHTMLTag_br, eHTMLTag_button, eHTMLTag_center, - eHTMLTag_cite, eHTMLTag_code, eHTMLTag_dfn, eHTMLTag_dir, - eHTMLTag_div, eHTMLTag_dl, eHTMLTag_em, eHTMLTag_fieldset, - eHTMLTag_font, eHTMLTag_form, eHTMLTag_h1, eHTMLTag_h2, - eHTMLTag_h3, eHTMLTag_h4, eHTMLTag_h5, eHTMLTag_h6, - eHTMLTag_hr, eHTMLTag_italic, eHTMLTag_iframe, eHTMLTag_img, - eHTMLTag_input, eHTMLTag_isindex, - - eHTMLTag_kbd, eHTMLTag_label, - eHTMLTag_map, eHTMLTag_menu, eHTMLTag_newline, //JUST ADDED! - eHTMLTag_noframes, eHTMLTag_noscript, - eHTMLTag_object, eHTMLTag_ol, eHTMLTag_paragraph, eHTMLTag_pre, - eHTMLTag_quotation, eHTMLTag_strike, eHTMLTag_samp, eHTMLTag_script, - eHTMLTag_select, eHTMLTag_small, eHTMLTag_span, eHTMLTag_strong, - eHTMLTag_sub, eHTMLTag_sup, eHTMLTag_table, eHTMLTag_text, - - eHTMLTag_textarea, eHTMLTag_tt, eHTMLTag_u, eHTMLTag_ul, - eHTMLTag_userdefined, eHTMLTag_var, - eHTMLTag_whitespace, //JUST ADDED! - 0}; - - //tagset2 has 43 members... - static char gTagSet2[]={ - eHTMLTag_a, eHTMLTag_acronym, eHTMLTag_applet, eHTMLTag_bold, - eHTMLTag_basefont, eHTMLTag_bdo, eHTMLTag_big, eHTMLTag_br, - eHTMLTag_button, eHTMLTag_cite, eHTMLTag_code, eHTMLTag_dfn, - eHTMLTag_em, eHTMLTag_font, eHTMLTag_hr, eHTMLTag_italic, - eHTMLTag_iframe, eHTMLTag_img, eHTMLTag_input, eHTMLTag_kbd, - - eHTMLTag_label, eHTMLTag_map, eHTMLTag_newline, //JUST ADDED! - eHTMLTag_object, eHTMLTag_paragraph, - eHTMLTag_quotation, eHTMLTag_strike, eHTMLTag_samp, eHTMLTag_script, - eHTMLTag_select, eHTMLTag_small, eHTMLTag_span, eHTMLTag_strong, - eHTMLTag_sub, eHTMLTag_sup, eHTMLTag_text, eHTMLTag_textarea, - eHTMLTag_tt, eHTMLTag_u, eHTMLTag_userdefined, eHTMLTag_var, - eHTMLTag_whitespace,//JUST ADDED! - 0}; - - //tagset3 has 57 members... - static char gTagSet3[]={ - eHTMLTag_a, eHTMLTag_acronym, eHTMLTag_applet, eHTMLTag_bold, - eHTMLTag_bdo, eHTMLTag_big, eHTMLTag_br, eHTMLTag_blockquote, - eHTMLTag_body, eHTMLTag_caption, eHTMLTag_center, eHTMLTag_cite, - eHTMLTag_code, eHTMLTag_dd, eHTMLTag_del, eHTMLTag_dfn, - eHTMLTag_div, eHTMLTag_dt, eHTMLTag_em, eHTMLTag_fieldset, - eHTMLTag_font, eHTMLTag_form, eHTMLTag_h1, eHTMLTag_h2, - eHTMLTag_h3, eHTMLTag_h4, eHTMLTag_h5, eHTMLTag_h6, - eHTMLTag_italic, eHTMLTag_iframe, eHTMLTag_ins, eHTMLTag_kbd, - - eHTMLTag_label, eHTMLTag_legend, - eHTMLTag_listitem, eHTMLTag_newline, //JUST ADDED! - - eHTMLTag_noframes, - eHTMLTag_noscript, eHTMLTag_object, eHTMLTag_paragraph, eHTMLTag_pre, - eHTMLTag_quotation, eHTMLTag_strike, eHTMLTag_samp, eHTMLTag_small, - eHTMLTag_span, eHTMLTag_strong, eHTMLTag_sub, eHTMLTag_sup, - eHTMLTag_td, eHTMLTag_text, - - eHTMLTag_th, eHTMLTag_tt, eHTMLTag_u, eHTMLTag_userdefined, - eHTMLTag_var, eHTMLTag_whitespace, //JUST ADDED! - 0}; - - //This hack code is here because we don't yet know what to do - //with userdefined tags... XXX Hack - if(eHTMLTag_userdefined==aChild) // XXX Hack: For now... - result=PR_TRUE; - - //handle form elements (this is very much a WIP!!!) - if(0!=strchr(formElementTags,aChild)){ - return CanContainFormElement(aParent,aChild); - } - - switch(aParent) { - case eHTMLTag_a: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_acronym: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_address: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_applet: - { - static char okTags[]={ - eHTMLTag_a, eHTMLTag_acronym, eHTMLTag_applet, eHTMLTag_bold, - eHTMLTag_basefont,eHTMLTag_bdo, eHTMLTag_big, eHTMLTag_br, - eHTMLTag_button, eHTMLTag_cite, eHTMLTag_code, eHTMLTag_dfn, - eHTMLTag_em, eHTMLTag_font, eHTMLTag_italic, eHTMLTag_iframe, - eHTMLTag_img, eHTMLTag_input, eHTMLTag_kbd, eHTMLTag_label, - eHTMLTag_map, eHTMLTag_object, eHTMLTag_param, eHTMLTag_quotation, - eHTMLTag_samp, eHTMLTag_script, eHTMLTag_select, eHTMLTag_small, - eHTMLTag_span, eHTMLTag_strike, eHTMLTag_strong, eHTMLTag_sub, - eHTMLTag_sup, eHTMLTag_textarea, eHTMLTag_tt, eHTMLTag_u, - eHTMLTag_var,0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - - - case eHTMLTag_area: - case eHTMLTag_base: - case eHTMLTag_basefont: - case eHTMLTag_br: - break; //singletons can't contain other tags - - case eHTMLTag_bdo: - case eHTMLTag_big: - case eHTMLTag_blink: - case eHTMLTag_bold: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_blockquote: - case eHTMLTag_body: - if(eHTMLTag_userdefined==aChild) - result=PR_TRUE; - else result=PRBool(0!=strchr(gTagSet1,aChild)); - break; - - case eHTMLTag_button: - result=PRBool(0!=strchr(gTagSet3,aChild)); break; - - case eHTMLTag_caption: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_center: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_cite: case eHTMLTag_code: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_col: - case eHTMLTag_colgroup: - break; //singletons can't contain anything... - - case eHTMLTag_dd: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_del: case eHTMLTag_dfn: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_div: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_dl: - { - char okTags[]={eHTMLTag_dd,eHTMLTag_dt,0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - break; - - case eHTMLTag_dt: - break; //singletons can't contain anything... - - case eHTMLTag_em: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_fieldset: - if(eHTMLTag_legend==aChild) - result=PR_TRUE; - else result=PRBool(0!=strchr(gTagSet1,aChild)); - break; - - case eHTMLTag_font: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_form: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_frame: - break; //singletons can't contain other tags - - case eHTMLTag_frameset: - { - static char okTags[]={eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes,0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - - case eHTMLTag_h1: case eHTMLTag_h2: - case eHTMLTag_h3: case eHTMLTag_h4: - case eHTMLTag_h5: case eHTMLTag_h6: - { - static char badTags[]={ - eHTMLTag_h1, eHTMLTag_h2, eHTMLTag_h3, - eHTMLTag_h4, eHTMLTag_h5, eHTMLTag_h6, 0}; - if(0!=strchr(badTags,aChild)) - result=PR_FALSE; - else result=PRBool(0!=strchr(gTagSet1,aChild)); - } - break; - - case eHTMLTag_head: - { - static char okTags[]={ - eHTMLTag_base, eHTMLTag_isindex, eHTMLTag_link, eHTMLTag_meta, - eHTMLTag_script,eHTMLTag_style, eHTMLTag_title, 0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - break; - - case eHTMLTag_hr: - break; //singletons can't contain anything... - - case eHTMLTag_html: - { - static char okTags[]={eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - break; - - case eHTMLTag_iframe: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_img: - case eHTMLTag_input: - case eHTMLTag_isindex: - case eHTMLTag_spacer: - case eHTMLTag_wbr: - break; //singletons can't contain anything... - - case eHTMLTag_italic: - case eHTMLTag_ins: - case eHTMLTag_kbd: - case eHTMLTag_label: - case eHTMLTag_legend: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_layer: - break; - - case eHTMLTag_link: - break; //singletons can't contain anything... - - // XXX hey rickg: listing is like xmp or plaintext and has - // NOTHING to do with html lists. - case eHTMLTag_listing: - result=PRBool(eHTMLTag_listitem==aChild); break; - - case eHTMLTag_map: - result=PRBool(eHTMLTag_area==aChild); break; - - case eHTMLTag_marquee: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_math: - break; //nothing but plain text... - - case eHTMLTag_meta: - break; //singletons can't contain other tags - - case eHTMLTag_noframes: - if(eHTMLTag_body==aChild) - result=PR_TRUE; - else result=PRBool(0!=strchr(gTagSet1,aChild)); - break; - - case eHTMLTag_noscript: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_note: - - case eHTMLTag_object: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_menu: - case eHTMLTag_dir: - case eHTMLTag_ol: - case eHTMLTag_ul: - // XXX kipp was here - result = PR_TRUE; - break; - - case eHTMLTag_listitem: - if (eHTMLTag_listitem == aChild) { - return PR_FALSE; - } - result = PR_TRUE; - break; - - case eHTMLTag_option: - break; //singletons can't contain other tags - - case eHTMLTag_paragraph: - if(eHTMLTag_paragraph==aChild) - result=PR_FALSE; - else result=PRBool(0!=strchr(gTagSet2,aChild)); - break; - - case eHTMLTag_param: - break; //singletons can't contain other tags - - case eHTMLTag_plaintext: - break; - - case eHTMLTag_pre: - case eHTMLTag_quotation: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_strike: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_script: - break; //unadorned script text... - - case eHTMLTag_select: - result=PR_TRUE; break; //for now, allow select to contain anything... - - case eHTMLTag_small: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_span: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_style: - break; //singletons can't contain other tags - - case eHTMLTag_strong: - case eHTMLTag_samp: - case eHTMLTag_sub: - case eHTMLTag_sup: - result=PRBool(0!=strchr(gTagSet1,aChild)); break; - - case eHTMLTag_table: - { - static char okTags[]={ - eHTMLTag_caption, eHTMLTag_col, eHTMLTag_colgroup,eHTMLTag_tbody, - eHTMLTag_tfoot, eHTMLTag_tr, eHTMLTag_thead, 0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - break; - - case eHTMLTag_tbody: - case eHTMLTag_tfoot: - case eHTMLTag_thead: - result=PRBool(eHTMLTag_tr==aChild); break; - - case eHTMLTag_th: - result=PRBool(0!=strchr(gTagSet1,aChild)); - break; - - case eHTMLTag_td: - { - static char extraTags[]={eHTMLTag_newline,0}; - result=PRBool(0!=strchr(extraTags,aChild)); - if(PR_FALSE==result) - result=PRBool(0!=strchr(gTagSet1,aChild)); - } - break; - - case eHTMLTag_textarea: - case eHTMLTag_title: - break; //nothing but plain text... - - case eHTMLTag_tr: - { - static char okTags[]={eHTMLTag_td,eHTMLTag_th,0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - break; - - case eHTMLTag_tt: - case eHTMLTag_u: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_var: - result=PRBool(0!=strchr(gTagSet2,aChild)); break; - - case eHTMLTag_userdefined: - result=PR_TRUE; break; //XXX for now... - - case eHTMLTag_xmp: - default: - break; - } //switch - return result; -} - - -/** - * This method is called to determine whether or not a tag - * of one type can contain a tag of another type. - * - * @update gess 4/8/98 - * @param aParent -- tag enum of parent container - * @param aChild -- tag enum of child container - * @return PR_TRUE if parent can contain child - */ -PRBool CNavDTD::CanContainIndirect(PRInt32 aParent,PRInt32 aChild) const { - PRBool result=PR_FALSE; - - switch(aParent) { - - case eHTMLTag_html: - { - static char okTags[]={ - eHTMLTag_head, eHTMLTag_body, - eHTMLTag_header, eHTMLTag_footer,0 - }; - result=PRBool(0!=strchr(okTags,aChild)); - } - - case eHTMLTag_body: - result=PR_TRUE; break; - - case eHTMLTag_table: - { - static char okTags[]={ - eHTMLTag_caption, eHTMLTag_colgroup, - eHTMLTag_tbody, eHTMLTag_tfoot, - eHTMLTag_thead, eHTMLTag_tr, - eHTMLTag_td, eHTMLTag_th, - eHTMLTag_col, 0}; - result=PRBool(0!=strchr(okTags,aChild)); - } - break; - - result=PR_TRUE; break; - - default: - break; - } - return result; -} - -/** - * This method gets called to determine whether a given - * tag can contain newlines. Most do not. - * - * @update gess 3/25/98 - * @param aTag -- tag to test for containership - * @return PR_TRUE if given tag can contain other tags - */ -PRBool CNavDTD::CanOmit(PRInt32 aParent,PRInt32 aChild) const { - PRBool result=PR_FALSE; - - //begin with some simple (and obvious) cases... - switch((eHTMLTags)aChild) { - - case eHTMLTag_userdefined: - case eHTMLTag_comment: - result=PR_TRUE; - break; - - case eHTMLTag_button: case eHTMLTag_fieldset: - case eHTMLTag_input: case eHTMLTag_isindex: - case eHTMLTag_label: case eHTMLTag_legend: - case eHTMLTag_select: case eHTMLTag_textarea: - if(PR_FALSE==mParser->HasOpenForm()) - result=PR_TRUE; - break; - - case eHTMLTag_newline: - case eHTMLTag_whitespace: - - switch((eHTMLTags)aParent) { - case eHTMLTag_html: case eHTMLTag_head: - case eHTMLTag_title: case eHTMLTag_map: - case eHTMLTag_tr: case eHTMLTag_table: - case eHTMLTag_thead: case eHTMLTag_tfoot: - case eHTMLTag_tbody: case eHTMLTag_col: - case eHTMLTag_colgroup: case eHTMLTag_unknown: - result=PR_TRUE; - default: - break; - } //switch - break; - - default: - if(eHTMLTag_unknown==aParent) - result=PRBool(eHTMLTag_html!=aChild); - break; - } //switch - return result; -} - -/** - * This method gets called to determine whether a given - * tag is itself a container - * - * @update gess 4/8/98 - * @param aTag -- tag to test for containership - * @return PR_TRUE if given tag can contain other tags - */ -PRBool CNavDTD::IsContainer(PRInt32 aTag) const { - PRBool result=PR_FALSE; - - switch(aTag){ - case eHTMLTag_area: case eHTMLTag_base: - case eHTMLTag_basefont: case eHTMLTag_br: - case eHTMLTag_col: case eHTMLTag_colgroup: - case eHTMLTag_frame: - case eHTMLTag_hr: case eHTMLTag_img: - case eHTMLTag_input: case eHTMLTag_isindex: - case eHTMLTag_link: - case eHTMLTag_math: case eHTMLTag_meta: - case eHTMLTag_option: case eHTMLTag_param: - case eHTMLTag_style: case eHTMLTag_spacer: - case eHTMLTag_wbr: - case eHTMLTag_form: - case eHTMLTag_newline: - case eHTMLTag_whitespace: - case eHTMLTag_text: - result=PR_FALSE; - break; - - default: - result=PR_TRUE; - } - return result; -} - -/** - * This method does two things: 1st, help construct - * our own internal model of the content-stack; and - * 2nd, pass this message on to the sink. - * @update gess4/6/98 - * @param aNode -- next node to be added to model - * @return TRUE if ok, FALSE if error - */ -PRInt32 CNavDTD::GetDefaultParentTagFor(PRInt32 aTag) const{ - eHTMLTags result=eHTMLTag_unknown; - switch(aTag) { - - case eHTMLTag_text: - result=eHTMLTag_paragraph; break; - - case eHTMLTag_html: - result=(eHTMLTags)kNotFound; break; - - case eHTMLTag_body: - case eHTMLTag_head: - case eHTMLTag_header: - case eHTMLTag_footer: - case eHTMLTag_frameset: - result=eHTMLTag_html; break; - - //These tags are head specific... - case eHTMLTag_style: - case eHTMLTag_meta: - case eHTMLTag_title: - case eHTMLTag_base: - case eHTMLTag_link: - result=eHTMLTag_head; break; - - //These tags are table specific... - case eHTMLTag_caption: - case eHTMLTag_colgroup: - case eHTMLTag_tbody: - case eHTMLTag_tfoot: - case eHTMLTag_thead: - result=eHTMLTag_table; break; - - case eHTMLTag_tr: - result=eHTMLTag_tbody; break; - - case eHTMLTag_td: - case eHTMLTag_th: - result=eHTMLTag_tr; break; - - case eHTMLTag_col: - result=eHTMLTag_colgroup; break; - - //These have to do with listings... - case eHTMLTag_listitem: - result=eHTMLTag_ul; break; - - case eHTMLTag_dd: - case eHTMLTag_dt: - result=eHTMLTag_dl; break; - - case eHTMLTag_option: - result=eHTMLTag_select; break; - - //These have to do with image maps... - case eHTMLTag_area: - result=eHTMLTag_map; break; - - //These have to do with applets... - case eHTMLTag_param: - result=eHTMLTag_applet; break; - - //These have to do with frames... - case eHTMLTag_frame: - result=eHTMLTag_frameset; break; - - default: - result=eHTMLTag_body; //XXX Hack! Just for now. - break; - } - return result; -} - - -/** - * This method gets called at various times by the parser - * whenever we want to verify a valid context stack. This - * method also gives us a hook to add debugging metrics. - * - * @update gess4/6/98 - * @param aStack[] array of ints (tokens) - * @param aCount number of elements in given array - * @return TRUE if stack is valid, else FALSE - */ -PRBool CNavDTD::VerifyContextVector(PRInt32* aVector,PRInt32 aCount) const { - PRBool result=PR_TRUE; - - if(aCount>0) { - - } - return result; -} - - -/** - * This method tries to design a context vector (without actually - * changing our parser state) from the parent down to the - * child. - * - * @update gess4/6/98 - * @param aVector is the string where we store our output vector - * in bottom-up order. - * @param aParent -- tag type of parent - * @param aChild -- tag type of child - * @return TRUE if propagation closes; false otherwise - */ -PRBool CNavDTD::ForwardPropagate(nsString& aVector,PRInt32 aParentTag,PRInt32 aChildTag) const { - PRBool result=PR_FALSE; - - switch(aParentTag) { - case eHTMLTag_table: - case eHTMLTag_tr: - if(PR_TRUE==CanContain(eHTMLTag_td,aChildTag)) { - aVector.Append((PRUnichar)eHTMLTag_td); - result=BackwardPropagate(aVector,aParentTag,eHTMLTag_td); -// result=PR_TRUE; - } - - break; - - case eHTMLTag_th: - break; - - default: - break; - }//switch - return result; -} - - -/** - * This method tries to design a context map (without actually - * changing our parser state) from the child up to the parent. - * - * @update gess4/6/98 - * @param aVector is the string where we store our output vector - * in bottom-up order. - * @param aParent -- tag type of parent - * @param aChild -- tag type of child - * @return TRUE if propagation closes; false otherwise - */ -PRBool CNavDTD::BackwardPropagate(nsString& aVector,PRInt32 aParentTag,PRInt32 aChildTag) const { - - PRBool result=PR_FALSE; - eHTMLTags theParentTag=(eHTMLTags)aChildTag; - -// aVector.Truncate(); - - //create the necessary stack of parent tags... - //continue your search until you run out of known parents, - //or you find the specific parent you were given (aParentTag). -// aVector.Append((PRUnichar)aChildTag); - do { - theParentTag=(eHTMLTags)GetDefaultParentTagFor(theParentTag); - if(theParentTag!=kNotFound) { - aVector.Append((PRUnichar)theParentTag); - } - } while((theParentTag!=kNotFound) && (theParentTag!=aParentTag)); - - return PRBool(aParentTag==theParentTag); -} - - - diff --git a/mozilla/parser/htmlparser/src/CNavDTD.h b/mozilla/parser/htmlparser/src/CNavDTD.h deleted file mode 100644 index 8fbe7cc51fe..00000000000 --- a/mozilla/parser/htmlparser/src/CNavDTD.h +++ /dev/null @@ -1,174 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/** - * MODULE NOTES: - * @update gess 4/8/98 - * - * - */ - -#ifndef NS_NAVHTMLDTD__ -#define NS_NAVHTMLDTD__ - -#include "nsIDTD.h" -#include "nsHTMLTokens.h" -#include "nshtmlpars.h" - - -#define NS_INAVHTML_DTD_IID \ - {0x5c5cce40, 0xcfd6, 0x11d1, \ - {0xaa, 0xda, 0x00, 0x80, 0x5f, 0x8a, 0x3e, 0x14}} - - -class nsIParser; - -class CNavDTD : public nsIDTD { - - public: - - NS_DECL_ISUPPORTS - - - /** - * - * - * @update gess 4/9/98 - * @param - * @return - */ - CNavDTD(); - - /** - * - * - * @update gess 4/9/98 - * @param - * @return - */ - virtual ~CNavDTD(); - - /** - * This method is called to determine whether or not a tag - * of one type can contain a tag of another type. - * - * @update gess 3/25/98 - * @param aParent -- tag enum of parent container - * @param aChild -- tag enum of child container - * @return PR_TRUE if parent can contain child - */ - virtual PRBool CanContain(PRInt32 aParent,PRInt32 aChild) const; - - /** - * - * - * @update gess 3/25/98 - * @param - * @return - */ - virtual void SetParser(nsIParser* aParser); - - /** - * This method is called to determine whether or not a tag - * of one type can contain a tag of another type. - * - * @update gess 3/25/98 - * @param aParent -- tag enum of parent container - * @param aChild -- tag enum of child container - * @return PR_TRUE if parent can contain child - */ - virtual PRBool CanContainIndirect(PRInt32 aParent,PRInt32 aChild) const; - - /** - * This method gets called to determine whether a given - * tag can contain newlines. Most do not. - * - * @update gess 3/25/98 - * @param aTag -- tag to test for containership - * @return PR_TRUE if given tag can contain other tags - */ - virtual PRBool CanOmit(PRInt32 aParent,PRInt32 aChild)const; - - /** - * This method gets called to determine whether a given - * tag is itself a container - * - * @update gess 3/25/98 - * @param aTag -- tag to test for containership - * @return PR_TRUE if given tag can contain other tags - */ - virtual PRBool IsContainer(PRInt32 aTags) const; - - /** - * This method does two things: 1st, help construct - * our own internal model of the content-stack; and - * 2nd, pass this message on to the sink. - * @update gess4/6/98 - * @param aNode -- next node to be added to model - * @return TRUE if ok, FALSE if error - */ - virtual PRInt32 GetDefaultParentTagFor(PRInt32 aTag) const; - - - /** - * This method gets called at various times by the parser - * whenever we want to verify a valid context stack. This - * method also gives us a hook to add debugging metrics. - * - * @update gess4/6/98 - * @param aStack[] array of ints (tokens) - * @param aCount number of elements in given array - * @return TRUE if stack is valid, else FALSE - */ - virtual PRBool VerifyContextVector(PRInt32* aVector,PRInt32 aCount) const; - - /** - * This method tries to design a context map (without actually - * changing our parser state) from the parent down to the - * child. - * - * @update gess4/6/98 - * @param aParent -- tag type of parent - * @param aChild -- tag type of child - * @return True if closure was achieved -- other false - */ - virtual PRBool ForwardPropagate(nsString& aVector,PRInt32 aParentTag,PRInt32 aChildTag) const; - - /** - * This method tries to design a context map (without actually - * changing our parser state) from the child up to the parent. - * - * @update gess4/6/98 - * @param aParent -- tag type of parent - * @param aChild -- tag type of child - * @return True if closure was achieved -- other false - */ - virtual PRBool BackwardPropagate(nsString& aVector,PRInt32 aParentTag,PRInt32 aChildTag) const; - -protected: - - PRBool CanContainFormElement(PRInt32 aParent,PRInt32 aChild) const; - - nsIParser* mParser; -}; - - -#endif - - - diff --git a/mozilla/parser/htmlparser/src/CNavDelegate.cpp b/mozilla/parser/htmlparser/src/CNavDelegate.cpp deleted file mode 100644 index 15c960407b7..00000000000 --- a/mozilla/parser/htmlparser/src/CNavDelegate.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include -#include "CNavDelegate.h" -#include "nsScanner.h" -#include "nsParserTypes.h" -#include "CNavDTD.h" - - -// Note: We already handle the following special case conditions: -// 1) If you see , simply treat it as a bad tag. -// 2) If you see , treat it like a comment. -// 3) If you see <> or <_ (< space) simply treat it as text. -// 4) If you see <~ (< followed by non-alpha), treat it as text. - -static char gIdentChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; - - -/** - * Default constructor - * - * @updated gess 3/25/98 - * @param - * @return - */ -CNavDelegate::CNavDelegate() : - ITokenizerDelegate(), mTokenDeque() { -} - -/** - * Default constructor - * - * @updated gess 3/25/98 - * @param - * @return - */ -CNavDelegate::CNavDelegate(CNavDelegate& aDelegate) : - ITokenizerDelegate(), mTokenDeque() { -} - - -/** - * - * @update gess4/11/98 - * @param - * @return - */ -eParseMode CNavDelegate::GetParseMode(void) const { - return eParseMode_unknown; -} - - -/** - * Cause delegate to create and return a new DTD. - * - * @update gess4/22/98 - * @return new DTD or null - */ -nsIDTD* CNavDelegate::GetDTD(void) const{ - return new CNavDTD(); -} - -/** - * This method is called just after a "<" has been consumed - * and we know we're at the start of some kind of tagged - * element. We don't know yet if it's a tag or a comment. - * - * @update gess 3/25/98 - * @param - * @return - */ -CToken* CNavDelegate::ConsumeTag(PRUnichar aChar,CScanner& aScanner,PRInt32& anErrorCode) { - CToken* result=0; - nsAutoString empty(""); - anErrorCode=anErrorCode=aScanner.GetChar(aChar); - - switch(aChar) { - case kForwardSlash: - PRUnichar ch; - anErrorCode=aScanner.Peek(ch); - if(nsString::IsAlpha(ch)) - result=new CEndToken(empty); - else result=new CCommentToken(empty); //Special case: is treated as a comment - break; - case kExclamation: - result=new CCommentToken(empty); - break; - default: - if(nsString::IsAlpha(aChar)) - return ConsumeStartTag(aChar,aScanner,anErrorCode); - else if(kEOF!=aChar) { - nsAutoString temp("<"); - return ConsumeText(temp,aScanner,anErrorCode); - } - } //switch - - if(result!=0) { - anErrorCode= result->Consume(aChar,aScanner); //tell new token to finish consuming text... - if(anErrorCode) { - result=0; - delete result; - } - } - return result; -} - -/** - * This method is called just after we've consumed a start - * tag, and we now have to consume its attributes. - * - * @update gess 3/25/98 - * @param aChar: last char read - * @param aScanner: see nsScanner.h - * @return - */ -void CNavDelegate::ConsumeAttributes(PRUnichar aChar,CScanner& aScanner,PRInt32& anErrorCode) { - PRBool done=PR_FALSE; - nsAutoString as(""); - anErrorCode=kNoError; - while((!done) && (anErrorCode==kNoError)) { - CToken* result = new CAttributeToken(as); - if(result){ - anErrorCode= result->Consume(aChar,aScanner); //tell new token to finish consuming text... - mTokenDeque.Push(result); - } - aScanner.Peek(aChar); - if(aChar==kGreaterThan) { //you just ate the '>' - aScanner.GetChar(aChar); //skip the '>' - done=PR_TRUE; - } - } - return; -} - -/** - * This is a special case method. It's job is to consume - * all of the given tag up to an including the end tag. - * - * @param aChar: last char read - * @param aScanner: see nsScanner.h - * @param anErrorCode: arg that will hold error condition - * @return new token or null - */ -CToken* CNavDelegate::ConsumeContentToEndTag(const nsString& aString,PRUnichar aChar,CScanner& aScanner,PRInt32& anErrorCode){ - - //In the case that we just read the given tag, we should go and - //consume all the input until we find a matching end tag. - - nsAutoString endTag(""); - CSkippedContentToken* sc=new CSkippedContentToken(endTag); - anErrorCode= sc->Consume(aChar,aScanner); //tell new token to finish consuming text... - return sc; -} - -/** - * This method is called just after a "<" has been consumed - * and we know we're at the start of a tag. - * - * @update gess 3/25/98 - * @param aChar: last char read - * @param aScanner: see nsScanner.h - * @param anErrorCode: arg that will hold error condition - * @return new token or null - */ -CToken* CNavDelegate::ConsumeStartTag(PRUnichar aChar,CScanner& aScanner,PRInt32& anErrorCode) { - CStartToken* result=new CStartToken(nsAutoString("")); - if(result) { - anErrorCode= result->Consume(aChar,aScanner); //tell new token to finish consuming text... - if(result->IsAttributed()) { - ConsumeAttributes(aChar,aScanner,anErrorCode); - } - //now that that's over with, we have one more problem to solve. - //In the case that we just read a - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Welcome to Netscape - Navigation Banner - - - - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - September 22, 1997 -
    - - - - - - - - -Publishing Suite Now Available - - - - - - - - -
      - - - - - - - Netscape Publishing Suite - the all-in-one solution for creating and publishing web sites - is now available in retail stores nationwide. - - -
    -
    - ABC News -
    - - - - - -Netscape delivers the new CommerceXpert family of Internet commerce products developed by Actra - including PublishingXpert 2.0, SellerXpert, and ECXpert. - - - -
    - - - - - - -Netscape launches a preview of Industry Watch by Individual, a personalized service providing in-depth business news and information. - - - - -
    - - - - - - - - - -Download Netscape French Communicator 4.03 for Windows 95 and NT - and take advantage of dynamic web content. - - - - -
    - - - - - - - - -Netscape works with leading sales force automation vendors to deliver next-generation tools that will automate and manage sales environments. - - -
    - - - - - More news... - - Go to a non-layers version of this page. - - - -
    -
    -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
      -
    - - -Jim Barksdale - -
    -
    Netscape
    Columns

    - -In this week's The Main Thing column, Jim Barksdale talks about directory services. Read all the Netscape Columns to keep up with Internet issues and trends.

    - -
    - - -

    -  - - -Tune Up to Communicator -
    -
    -Netscape
    Products

    - -Tune Up to Communicator
    -Get Any Netscape Product
    -For Subscribers Only

    -

    -And tune up your Internet connection with ISP Select. - -
    -

    -  - - -
    -
    Netscape
    Store Special

    - - - - -Looking for a rich Internet experience? Purchase Netscape Communicator Deluxe Edition and get a $30 rebate. Plus save $10 on the Official Netscape Communicator 4.0 Professional Edition book. - - - -

    -

    -  -
    - - - - - - - -
    -  - -

    - - - -
    - - - - -
    -
    Corporate Sales: 650/937-2555 Personal Sales: 650/937-3777
    -Government Sales: 650/937-3678
    If you have any questions please visit -Customer Service or contact your nearest -sales office. • Copyright © 1997 -Netscape Communications -Corporation. • This site powered by Netscape SuiteSpot servers.
    - -

    -
    -

    - - -
    - - - - - - - -New to the Web? - - - - - - - - - - - - -Turn Your In-Box Into a News Center - - -Netcenter - - - - - - - -In-Box Direct Delivers The New York Times - - - - -

    -Get the best information on the Web without searching. Netscape In-Box Direct offers rich HTML content from USA Today, the Wall Street Journal, Sports Illustrated, ELLE International, and dozens more delivered directly to your email in-box. Choose the publications you want, and Netscape In-Box Direct will take care of the rest. -

    - - - - -Win a BMW Z3 1.9 Roadster - -
    - -Sign up for Netcenter today and register to win a BMW Z3 1.9 Roadster, PC workstations from Hewlett-Packard, trips from Travelocity and Continental Airlines, and music from CDnow. -

    - - -Software Store - -
    - -Looking for new collaboration software? Web development tools? Netscape's Software Store has all your business solutions software. - -

    - -Netscape Guide by Yahoo! - -
    - -Want a hot stock tip? Head over to the finance section of Netscape Guide by Yahoo! for a rich assortment of money management and investment resources. - - - - - - - - - -Tune in to Netcenter, the Best of the Net for: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - Community - -
    - - - - - Virtual Office - -

    -

    - -
    - Software -
    -
    - - - - SmartUpdate - -
    - - - - Software Store -

    - -

    - -
    - Content -
    -
    - - - -Industry Watch - -
    - - - Channel Finder - -
    - - - In-Box Direct - -
    - - - - Internet Guide - -
    - - - - Net Search -

    - -

    - -
    - - Available Soon - -
    -
    - - - - Professional Community - -
    - -
    - - - - - -

    Netcenter
    - - - - - - - - - - - - - diff --git a/mozilla/parser/htmlparser/tests/html/html001.html b/mozilla/parser/htmlparser/tests/html/html001.html deleted file mode 100644 index db589d3920b..00000000000 --- a/mozilla/parser/htmlparser/tests/html/html001.html +++ /dev/null @@ -1,8 +0,0 @@ - - - HTML-html04 - - -html tag has attributes. - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/imgmap001.html b/mozilla/parser/htmlparser/tests/html/imgmap001.html deleted file mode 100644 index b826c9a4e96..00000000000 --- a/mozilla/parser/htmlparser/tests/html/imgmap001.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - -

    area element with attributes set for circular shape of 80,80,60.

    - image for imagemap - - imagemap - - - diff --git a/mozilla/parser/htmlparser/tests/html/ins001.html b/mozilla/parser/htmlparser/tests/html/ins001.html deleted file mode 100644 index b7be3a2edd3..00000000000 --- a/mozilla/parser/htmlparser/tests/html/ins001.html +++ /dev/null @@ -1,14 +0,0 @@ - - -test INS tag - - -test INS, bi directional override
    -1normal text in body line 1. - -A This text is in INS -
    B line 2 in INS -
    -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/ins002.html b/mozilla/parser/htmlparser/tests/html/ins002.html deleted file mode 100644 index c759228945c..00000000000 --- a/mozilla/parser/htmlparser/tests/html/ins002.html +++ /dev/null @@ -1,18 +0,0 @@ - - -test INS tag - - -test INS, bi directional override
    -1normal text in body line 1. - -A This text is in INS - - C This text is in INS2 -
    D line 2 in INS2 -
    -
    B line 2 in INS -
    -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/ins003.html b/mozilla/parser/htmlparser/tests/html/ins003.html deleted file mode 100644 index 8574eaef4b5..00000000000 --- a/mozilla/parser/htmlparser/tests/html/ins003.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - del strikeover text - - -Normal text1 -
    text with underline -
    Normal text2 - - diff --git a/mozilla/parser/htmlparser/tests/html/insdel01.html b/mozilla/parser/htmlparser/tests/html/insdel01.html deleted file mode 100644 index 9aa6ba964ea..00000000000 --- a/mozilla/parser/htmlparser/tests/html/insdel01.html +++ /dev/null @@ -1,16 +0,0 @@ - - -test INS tag - - -test INS
    -1normal text in body line 1. - -A This text is in INS - -
    B line 2 in INS -
    -
    -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/insdel02.html b/mozilla/parser/htmlparser/tests/html/insdel02.html deleted file mode 100644 index 4e21163812e..00000000000 --- a/mozilla/parser/htmlparser/tests/html/insdel02.html +++ /dev/null @@ -1,16 +0,0 @@ - - -INS DEL /INS /DEL crossing scope - - -test INS
    -1normal text in body line 1. - -A This text is in INS - -
    B line 2 in INS -
    -2normal text in body line 2. - - - diff --git a/mozilla/parser/htmlparser/tests/html/layer001.html b/mozilla/parser/htmlparser/tests/html/layer001.html deleted file mode 100644 index dc9790698fb..00000000000 --- a/mozilla/parser/htmlparser/tests/html/layer001.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -Test Layer - - - - -Layers do NOT imply new paragraph, nor line break. - - -Note, no line break here. Text-2 - - - -After layer, text-3 - - - diff --git a/mozilla/parser/htmlparser/tests/html/layer002.html b/mozilla/parser/htmlparser/tests/html/layer002.html deleted file mode 100644 index 012d84451a9..00000000000 --- a/mozilla/parser/htmlparser/tests/html/layer002.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Test Layer002 - - - - -In Vav4.0, SPAN tags go thour layers. -
    It remain in effect in its whole scope, including layer. - -Text in color=red SPAN. - - - -Text between 2 LAYERs. - - - - -

    -Text not in layer, but still in SPAN -

    -
    -Text after closing font tag. - - diff --git a/mozilla/parser/htmlparser/tests/html/layer003.html b/mozilla/parser/htmlparser/tests/html/layer003.html deleted file mode 100644 index 846a4def75e..00000000000 --- a/mozilla/parser/htmlparser/tests/html/layer003.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - -Test Layer003 - - - - -In Vav4.0, layers are in the same "span space" as their parents. -
    That means spans can be closed inside layer, and affect layers' parents. - - -Text in color=red SPAN. - - - -Text between 2 LAYERs. - - - - -

    -Text not in layer -

    - - - - diff --git a/mozilla/parser/htmlparser/tests/html/layer01.html b/mozilla/parser/htmlparser/tests/html/layer01.html deleted file mode 100644 index 0a503a7eb4c..00000000000 --- a/mozilla/parser/htmlparser/tests/html/layer01.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -Welcome to Netscape - - - - -Text-1 - - - -
    Text-2 - - - -

    -no-layer-text-3 - - - diff --git a/mozilla/parser/htmlparser/tests/html/list001.html b/mozilla/parser/htmlparser/tests/html/list001.html deleted file mode 100644 index e2d549c797a..00000000000 --- a/mozilla/parser/htmlparser/tests/html/list001.html +++ /dev/null @@ -1,33 +0,0 @@ - -Welcome to Hewlett-Packard - - - -This file was created on 9/16/97 for bug #85117, assert in parser -when closing dd tag. - -
    This is from the end of the page www.hp.com -
    Note, an optional closing dd tag is missing. - -

  • - -
    - -
    [Search HP] - -[Top] -[Contact HP] -[Copyright] - - -
    - -
    - - -Note: no line break here. - -
    Now wrapped with a PRE tag. -
    -first line
    -
    invalide tags are ignored by 4.0 -
    - - -Note: no line break here. - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/q001.html b/mozilla/parser/htmlparser/tests/html/q001.html deleted file mode 100644 index e7cd998188b..00000000000 --- a/mozilla/parser/htmlparser/tests/html/q001.html +++ /dev/null @@ -1,18 +0,0 @@ - - -test BLOCKQUOTE and Q tag - - -test BLOCKQUOTE and Q tag
    -1normal text in body line 1. -
    -A This text is in blockquote -
    B line 2 -
    -2normal text in body line 2. - -this text is in Q tag - -3normal text in body line 3. - - diff --git a/mozilla/parser/htmlparser/tests/html/quote001.html b/mozilla/parser/htmlparser/tests/html/quote001.html deleted file mode 100644 index 6b591b9193c..00000000000 --- a/mozilla/parser/htmlparser/tests/html/quote001.html +++ /dev/null @@ -1,51 +0,0 @@ - - - HTML test for quoted string - - - - This was created on 9/12/97, for Xena bug # 85121 -
    Testing the quoted value string. -
    tag A is used so you can check the string by moving mouse on the link. -
    use view source or text editor to compare with browser display. - -
    The goal is to be compatible with Navigator 4.0 -
    Test results are compared with Nav4.0 display. Relavent Nav4.0 source - files are ns\lib\libparse\pa_parse.c and others. -
    Differences between 4.0 and xena are indecated. Search for XENA60 - to find all the defferences. - -

    comments from ns\xena\lego\src\lego\html\scanner\HTMLScanner.java: -
    // For quoted value string : -
    // Double/single quote only take effect as the first char -
    // of the value string, -
    // Quoted string is terminated by the second double/single quote -
    // respectively. -
    // In other places, double/single quote is treated literally. -
    // Entity & quot; is always treated literally, enven it is the -
    // first char. -
    // -
    // Unquoted value string is terminated by while space, or '>' sign. -

    - - Test lines: - -
    10(quote / quote ) good syntax: both quotes striped from string -
    20( / ) value not quoted, not recommented, but still good syntax. -
    30 - Navigator 4.0 value string trunketed at 82 characters XENA60 limit is MAX_STRING_LENGTH = 2000. - -
    40 The following are illegal HTML, but handled by Nav4.0 in different ways. -
    50( / ) string not quoted, whight space terminates the value -
    60( / ) string not quoted, CR terminates the string -
    70(escaped-quote / quote ) both quotes remain in string -
    80(quote / ) - move mouse on this. If we didn't have a quote in the text, the value string would - run through the end of the A tag. -
    90(quote / escaped-quote ) same as above, escaped quote does NOT terminate quote -
    100( / quote) if no opening quote, quotes are included in string -
    110( / quote) no opening quote, value terminated at right brack - - - diff --git a/mozilla/parser/htmlparser/tests/html/quote002.html b/mozilla/parser/htmlparser/tests/html/quote002.html deleted file mode 100644 index 2873a8c8fe8..00000000000 --- a/mozilla/parser/htmlparser/tests/html/quote002.html +++ /dev/null @@ -1,33 +0,0 @@ - - - HTML test for quoted string - - - - This was created on 9/15/97, for Xena bug # 85121 -
    Testing the quoted value string. -
    tag A is used so you can check the string by moving mouse on the link. -
    use view source or text editor to compare with browser display. -
    10 2 quoted string stick together -
    20 2 quoted string seperated by space -
    30 Navigator doesn't support nested quote. -
    40 quoted string can have escaped quote. -
    50 unquoted string can have escaped quote. -
    60 unquoted string can have other entities. -
    70 entity missing ';', ended by > -
    80 entity missing ';', not treated as entity inside a value word. -
    90 ending entity with a space, missing ';', value terminated. -
    100 ending entity with a '=', missing ';', value not terminated. -
    110 unquoted script is treated as text. -
    120 Navigator 4.0 does not support script - entity in quoted string. - - -
    130 this is fisrt quote " and second quote " in text area. -
    140 this is fisrt escaped-quote " and second escaped-quote " in text area. - -
    -
    In the following test line, quote is the last char in the html file. -
    Navigator 4.0 displace the line as text. -
    XENA60 appends a closing quote and display it as link with empty href="". -
    150 - - - -Test SPAN001 - - - - -

    -In HTML standard, SPANs are not allowed to cross Paragraphs. -
    In Vav4.0, SPAN tags go thour paragraphs and other block-level elements, -except tbles. -
    It be compatable with Nav4.0 and HTML standard, HTMLParser -close all SPANs before open a new paragraph, and reopen SPANs -inside the new paragraph -
    - - - Text ater the color=red SPAN is opend. -

    - Text in a new paragraph. -

    -

    - Text after the new paragrapg is closed, still in color=red SPAN. - -
    -Text ater the color=red SPAN is closed. - - diff --git a/mozilla/parser/htmlparser/tests/html/span002.html b/mozilla/parser/htmlparser/tests/html/span002.html deleted file mode 100644 index 5f3c497ff84..00000000000 --- a/mozilla/parser/htmlparser/tests/html/span002.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Test SPAN001 - - - - -Normal text - -Text after the color=red SPAN is opend. -

    - Text in a new paragraph. -

    - Text after the new paragrapg is closed, still in color=red SPAN. - -Text ater the color=red SPAN is closed. -
    another line. - - diff --git a/mozilla/parser/htmlparser/tests/html/span003.html b/mozilla/parser/htmlparser/tests/html/span003.html deleted file mode 100644 index c4ea303d8c9..00000000000 --- a/mozilla/parser/htmlparser/tests/html/span003.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - -Test SPAN001 - - - - -

    - - bold - italic - B closed(but actualy it closed the last span tag, which is I tag. - I closed - - diff --git a/mozilla/parser/htmlparser/tests/html/strike002.html b/mozilla/parser/htmlparser/tests/html/strike002.html deleted file mode 100644 index 65d505d595a..00000000000 --- a/mozilla/parser/htmlparser/tests/html/strike002.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Nested STRIKE - - -nested STRIKE
    -1normal text in body line 1. - -A This text is in STRIKE - -
    B line 2 in STRIKE -
    -C line 3 in STRIKE -
    -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/strike005.html b/mozilla/parser/htmlparser/tests/html/strike005.html deleted file mode 100644 index 4040627aca8..00000000000 --- a/mozilla/parser/htmlparser/tests/html/strike005.html +++ /dev/null @@ -1,22 +0,0 @@ - - -strikeover a whole TABLE - - -strikeover a whole TABLE, no visual effect, no strikeover on text in table
    -1normal text in body line 1. - -text with strikeover -

    - - -
    This is the first cell in the table - This is the second cell in the table -
    This is the third cell in the table - This is the fourth cell in the table -
    -text still inside strikeover. - -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/strike006.html b/mozilla/parser/htmlparser/tests/html/strike006.html deleted file mode 100644 index 979198c12b3..00000000000 --- a/mozilla/parser/htmlparser/tests/html/strike006.html +++ /dev/null @@ -1,18 +0,0 @@ - - -strikeover in a table cell TD - - -strikeover in a table cell TD
    -1normal text in body line 1. - - - -
    This is the first cell in the table - This is strikeover -
    This is the third cell in the table - This is the fourth cell in the table -
    -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/strike007.html b/mozilla/parser/htmlparser/tests/html/strike007.html deleted file mode 100644 index eaa80db9961..00000000000 --- a/mozilla/parser/htmlparser/tests/html/strike007.html +++ /dev/null @@ -1,20 +0,0 @@ - - -strikeover a whole table cell TD - - -strikeover a whole table cell TD -1normal text in body line 1. - - - - - -
    This is the first cell in the table - - This cell is in strikeover
    This is the third cell in the table - This is the fourth cell in the table -
    -2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/strike008.html b/mozilla/parser/htmlparser/tests/html/strike008.html deleted file mode 100644 index cc95b6ebf47..00000000000 --- a/mozilla/parser/htmlparser/tests/html/strike008.html +++ /dev/null @@ -1,26 +0,0 @@ - - -strikeover cross scope with a table - - -

    strikeover cross scope with a table
    -It starts before table, but ends inside table. -
    It does not effect the table, but the strikeover is terminated after the table. -
    1normal text in body line 1. - -text in strikeover. - - - - - -
    This is the first cell in the table - This cell 2
    This is the third cell in the table - This is the fourth cell in the table -
    -

    -text not in strikeover - -
    2normal text in body line 2. - - diff --git a/mozilla/parser/htmlparser/tests/html/table05a.html b/mozilla/parser/htmlparser/tests/html/table05a.html deleted file mode 100644 index a6df8ca395e..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05a.html +++ /dev/null @@ -1,14 +0,0 @@ -Caption before end of table -
    Nav 4.0: caption is accepted. (terminate tr) -
    Xena6.0: ignore misplaced caption tag. - - - - - -
    cell 1-1 - cell 1-2 -
    cell 2-1 - cell 2-2
    caption1
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05b.html b/mozilla/parser/htmlparser/tests/html/table05b.html deleted file mode 100644 index e05836f3ee2..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05b.html +++ /dev/null @@ -1,14 +0,0 @@ -Caption after tr. -
    Nav 4.0: caption is accepted, terminate an empty tr, -
    Xena6.0: ignore misplaced caption tag. - - - taxeA - -
    caption1
    cell 1-1 - cell 1-2 -
    cell 2-1 - cell 2-2 -
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05c.html b/mozilla/parser/htmlparser/tests/html/table05c.html deleted file mode 100644 index 1b55afcc3a5..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05c.html +++ /dev/null @@ -1,14 +0,0 @@ -Caption between table cell -
    Nav 4.0: caption is accepted, terminate tr, -
    Xena6.0: ignore misplaced caption tag. - - - - textA - -
    cell 1-1
    caption1
    cell 1-2 -
    cell 2-1 - cell2-2 -
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05d.html b/mozilla/parser/htmlparser/tests/html/table05d.html deleted file mode 100644 index 3144e70f146..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05d.html +++ /dev/null @@ -1,13 +0,0 @@ -Caption inside cell -
    Nav 4.0: caption is accepted, terminates both td and tr. -
    Xena6.0: ignore misplaced caption tag. - - - textA - -
    cell 1-1
    caption1
    cell 1-2 -
    cell 2-1 - cell 2-2 -
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05k.html b/mozilla/parser/htmlparser/tests/html/table05k.html deleted file mode 100644 index d05228d0811..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05k.html +++ /dev/null @@ -1,19 +0,0 @@ -Table in caption works. - - - -
    caption1
    text1 text2 - - - -
    cell 1-1 - cell 1-2 -
    still in - caption -
    -
    cell 2-1-1 - cell 2-1-2 -
    cell 2-2-1 -
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05l.html b/mozilla/parser/htmlparser/tests/html/table05l.html deleted file mode 100644 index c7dbd30c4e9..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05l.html +++ /dev/null @@ -1,14 +0,0 @@ -Table in caption, and Nav4.0 show blank page if the window is wide. -Table in caption is part of the caption, leave the table body empty. - - - -
    caption1
    text1 text2 - - - -
    cell 1-1 - cell 1-2 -
    cell 2-1 - cell 2-2 -
    - -Nev. 4.0 ignore empty tables. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/table05m.html b/mozilla/parser/htmlparser/tests/html/table05m.html deleted file mode 100644 index 18c01e22dfa..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05m.html +++ /dev/null @@ -1,5 +0,0 @@ -Start table tag alone is ignored. - - - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05n.html b/mozilla/parser/htmlparser/tests/html/table05n.html deleted file mode 100644 index 83aede59060..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05n.html +++ /dev/null @@ -1,11 +0,0 @@ -End table tag terminates caption and table. -
    -
    caption1
    text1 text2 -
    -
    cell1 -
    cell2 -
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table05o.html b/mozilla/parser/htmlparser/tests/html/table05o.html deleted file mode 100644 index 34fa22e5fd1..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table05o.html +++ /dev/null @@ -1,6 +0,0 @@ -caption is not shown for empty table. - - -
    caption1
    text1 text2
    - -last text diff --git a/mozilla/parser/htmlparser/tests/html/table07.html b/mozilla/parser/htmlparser/tests/html/table07.html deleted file mode 100644 index 64a0edfbe9c..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table07.html +++ /dev/null @@ -1,13 +0,0 @@ -text1 - text2 - - - -
    cell 1-1 - cell 1-2 -
    still in - caption -
    -text3 -
    -last text diff --git a/mozilla/parser/htmlparser/tests/html/table200.html b/mozilla/parser/htmlparser/tests/html/table200.html deleted file mode 100644 index e43c788bf7b..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table200.html +++ /dev/null @@ -1,21 +0,0 @@ -Table in table, but not in tr-td. -
    the outter table is ignored. - - -
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    -

    This is the first cell in table2. -
    - -NOTE, even no line break here! -
    -Caption of outer table is ignored. -Data of outer table is treated as text. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/table201.html b/mozilla/parser/htmlparser/tests/html/table201.html deleted file mode 100644 index 62e9665d5e8..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table201.html +++ /dev/null @@ -1,22 +0,0 @@ -Table in table, but not in tr-td. -
    the outter table is ignored. - - - -
    caption of table2.
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -This is the first cell in table2. - - -NOTE, even no line break here! -
    -Caption of outer table is ignored. -Data of outer table is treated as text. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/table202.html b/mozilla/parser/htmlparser/tests/html/table202.html deleted file mode 100644 index 5f5c81afdcf..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table202.html +++ /dev/null @@ -1,23 +0,0 @@ -Table in table, after tr, but not td. -
    the outter table and tr are ignored. - - - - -
    caption of table2.
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -This is the first cell in table2. - - -NOTE, even no line break here! -
    -Caption of outer table is ignored. -Data of outer table is treated as text. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/table203.html b/mozilla/parser/htmlparser/tests/html/table203.html deleted file mode 100644 index 8d0075d53ef..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table203.html +++ /dev/null @@ -1,29 +0,0 @@ -Table nested 3 levels, table3 be the out most. -
    Table 1 is not in table2's tr-td. That makes table2 invalid. -
    Table3 is still valid, and table2's tr and td are used for -table3. - - - - - -
    caption of table3.
    - - - Text after table2, not in tr-td, but in table3's tr-td. -
    caption of table2.
    - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in the table1 - fourth cell in the table1 -
    -
    first cell in table2, but displayed in table 3. -
    - - second cell in table3. but table2's end tag closed table3. - So, this will be displayed out of table3. - - diff --git a/mozilla/parser/htmlparser/tests/html/table204.html b/mozilla/parser/htmlparser/tests/html/table204.html deleted file mode 100644 index 0842245cc02..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table204.html +++ /dev/null @@ -1,23 +0,0 @@ -nested table missing end td. -
    Nav. 4.0(bug): For inner table td does NOT terminate previous td. -
    Xena 6.0: end td is always optional. - - - - - -
    caption of table1.
    cell 1-1 - cell 1-2 -
    cell 1-3 - cell 1-4 - - - - -
    caption of table2.
    cell1 in table2 - cell2 in table2 -
    cell3 in table2 - cell4 in table2 -
    -
    -
    Last text. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/table205.html b/mozilla/parser/htmlparser/tests/html/table205.html deleted file mode 100644 index 905659196c3..00000000000 --- a/mozilla/parser/htmlparser/tests/html/table205.html +++ /dev/null @@ -1,28 +0,0 @@ -Table in table, but not in tr-td. -
    The only thing missing is the end tag of the -first table! -Nav. 4.0: the outter table is ignored. -Xena 6.0: second table start tag is ignored. Contents put in 1 table. - - - - - - - - -
    caption of table1.
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - - - -
    caption of table2.
    cell1 in table2 - cell2 in table2 -
    cell3 in table2 - cell4 in table2 -
    - -
    Last text. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/tableall.html b/mozilla/parser/htmlparser/tests/html/tableall.html deleted file mode 100644 index 0381ca289ca..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tableall.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    table test cases
    Test case description -
    good syntax
    -
    table01.html <table> <tr> <td> -
    table02.html <table> <tr> <td> <table> nested -
    table03.html <table border align=left> -
    table04.html <table> mixed with list. - -
    table05 The correct position for Caption is after table start tag. - - -
    bad syntax
    -
    *table05a Caption before </table>. 4.0: Accepted, 6.0: ignored. -
    *table05b Caption after tr. 4.0: Accepted, 6.0: ignored. -
    *table05c Caption between table cell. 4.0: Accepted, 6.0: ignored. -
    *table05d Caption inside cell. 4.0: terminates both td and tr. 6.0: Ignored. -
    table05e Multiple caption outside cells. 4.0 takes first as Caption, others as text. -
    *table05f Captions inside cells, 4.0 takes last one, terminate td tr, 6.0 Ignore misplaced tag. -
    table05g Captions outside of table are treated as text. -
    table05h tr terminates caption -
    table05i tr terminates Caption, and close open(font) tags in caption. -
    table05j TD does NOT terminate Caption. TD's contents are used in caption. -
    table05k Table in caption works. -
    table05l Table in caption, table empty. 4.0(bug): shows blank page. -
    table05m <table> alone is ignored. -
    table05n </table> terminates caption and table. -
    table05o caption is not shown for empty table.
    table110.htm <tr> <td> missing <table> -
    table115.htm <table> text1 <tr> test2 <td> test3 -
    table120.htm <table> </table> table totally empty . -
    table125.htm <table> text </table>, no tr, td -
    table130.htm <table> <td> , missing tr -
    table135.htm <table> <tr> <tr> <td> , empty tr. -
    table140.htm <table> <tr> text <tr> <td> , empty tr. -
    table150.htm <table> <tr> <td> <td> , empty td. - -
    table201.html <table> <table> -
    table202.html <table> <tr> <table> -
    table203.html Table nested 3 levels, T1 not in T2's td -
    *table204.htm nested table missing end td. 4.0(bug) inner table need </td> -
    *table205.htm table in table. 4.0: discard outer, 6.0: put into 1 table. -
    - - diff --git a/mozilla/parser/htmlparser/tests/html/tag001.html b/mozilla/parser/htmlparser/tests/html/tag001.html deleted file mode 100644 index dd2b5698dca..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag001.html +++ /dev/null @@ -1,3 +0,0 @@ -first line -second line -third line < \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/tag002.html b/mozilla/parser/htmlparser/tests/html/tag002.html deleted file mode 100644 index 5083bee2948..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag002.html +++ /dev/null @@ -1,23 +0,0 @@ -Broken tags are shown, only if no gt sign can be found. - - -aaaaaaaaaaaa - - -bbbbbbbb - -< - -open tag without name, stat with space, treated as text. -
    -KKKKKKKKKK - -< open tag has no tag name, stat with space, treated as text. -
    -ccccccc - -second line -

    Here is next paragraph. -
    -They ignored by 4,0. -Everything between the brakets is consummed. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/tag004.html b/mozilla/parser/htmlparser/tests/html/tag004.html deleted file mode 100644 index 00b6cc77073..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag004.html +++ /dev/null @@ -1,4 +0,0 @@ -first line -
    empty brakets are displayed as text -<> -more text. diff --git a/mozilla/parser/htmlparser/tests/html/tag005.html b/mozilla/parser/htmlparser/tests/html/tag005.html deleted file mode 100644 index cb46e427796..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag005.html +++ /dev/null @@ -1,7 +0,0 @@ -first line -
    empty brakets are displayed as text -This -and this eat next br tag. -and another one. -Last text. diff --git a/mozilla/parser/htmlparser/tests/html/tag006.html b/mozilla/parser/htmlparser/tests/html/tag006.html deleted file mode 100644 index 36d3dcc0d02..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag006.html +++ /dev/null @@ -1,6 +0,0 @@ -first line -
    invalide tags are ignored by 4.0 - - - -Note: no line break here. diff --git a/mozilla/parser/htmlparser/tests/html/tag007.html b/mozilla/parser/htmlparser/tests/html/tag007.html deleted file mode 100644 index 596b5484dc5..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag007.html +++ /dev/null @@ -1,5 +0,0 @@ -first line -
    Unmacthed opening tag in next line is ignored by 4.0 - -
    -Note: no line break inserted here. diff --git a/mozilla/parser/htmlparser/tests/html/tag008.html b/mozilla/parser/htmlparser/tests/html/tag008.html deleted file mode 100644 index 6b67931e732..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tag008.html +++ /dev/null @@ -1,4 +0,0 @@ -first line -
    Unmacthed end tag in next line is ignored by 4.0 -
    -Note: no line break inserted here. diff --git a/mozilla/parser/htmlparser/tests/html/target01.html b/mozilla/parser/htmlparser/tests/html/target01.html deleted file mode 100644 index 44c34fdbb29..00000000000 --- a/mozilla/parser/htmlparser/tests/html/target01.html +++ /dev/null @@ -1,7 +0,0 @@ - -Target outside of quoted HREF. -
    example: -
    -two days - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/tbody001.html b/mozilla/parser/htmlparser/tests/html/tbody001.html deleted file mode 100644 index d639a01c606..00000000000 --- a/mozilla/parser/htmlparser/tests/html/tbody001.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Welcome to Netscape - - -
    - - - - - -
    - table element with no attributes. The required embedded - elements are used - TBODY-TR-TD. -
    - - diff --git a/mozilla/parser/htmlparser/tests/html/text001.html b/mozilla/parser/htmlparser/tests/html/text001.html deleted file mode 100644 index 55c4e5ee38e..00000000000 --- a/mozilla/parser/htmlparser/tests/html/text001.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Welcome to Netscape - - -Text-001 - - diff --git a/mozilla/parser/htmlparser/tests/html/text002.html b/mozilla/parser/htmlparser/tests/html/text002.html deleted file mode 100644 index 68b070ca308..00000000000 --- a/mozilla/parser/htmlparser/tests/html/text002.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Welcome to Netscape - - -Text-002 - - diff --git a/mozilla/parser/htmlparser/tests/html/text003.html b/mozilla/parser/htmlparser/tests/html/text003.html deleted file mode 100644 index aa1f7ae9ccc..00000000000 --- a/mozilla/parser/htmlparser/tests/html/text003.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -Welcome to Netscape - - -Text-001 -
    -
    -Text after closing font tag. - - diff --git a/mozilla/parser/htmlparser/tests/html/thead001.html b/mozilla/parser/htmlparser/tests/html/thead001.html deleted file mode 100644 index b517ea769be..00000000000 --- a/mozilla/parser/htmlparser/tests/html/thead001.html +++ /dev/null @@ -1,25 +0,0 @@ -Normal case for thead, tfoot, tbody - - - - - - - - - - - - - - - - - -
    caption of table2.
    text in thead
    text in tfoot
    first cell in table1 - second cell in table1 -
    third cell in table1 - fourth cell in table1 -
    - -last text. \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/html/title01.html b/mozilla/parser/htmlparser/tests/html/title01.html deleted file mode 100644 index c6404098244..00000000000 --- a/mozilla/parser/htmlparser/tests/html/title01.html +++ /dev/null @@ -1,6 +0,0 @@ - - -<!-- still in comment --> - -some text - diff --git a/mozilla/parser/htmlparser/tests/html/usascii.html b/mozilla/parser/htmlparser/tests/html/usascii.html deleted file mode 100644 index 834856339d0..00000000000 --- a/mozilla/parser/htmlparser/tests/html/usascii.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Juan Gotoh's Visual Workshop - - - - - - - - - - - - -<BODY> - -<P>If your brouser can not display frame, please click -<A HREF="home_E.html">here.</A> it has same contents as frame -version.</P> - -</BODY> - - diff --git a/mozilla/parser/htmlparser/tests/html/utf8001.html b/mozilla/parser/htmlparser/tests/html/utf8001.html deleted file mode 100644 index 017a3d7c652..00000000000 --- a/mozilla/parser/htmlparser/tests/html/utf8001.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Welcome to Netscape - - -Text-001 - - diff --git a/mozilla/parser/htmlparser/tests/html/value001.html b/mozilla/parser/htmlparser/tests/html/value001.html deleted file mode 100644 index 55c926e7eb7..00000000000 --- a/mozilla/parser/htmlparser/tests/html/value001.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - -Welcome to Netscape - - - - - - - - - diff --git a/mozilla/parser/htmlparser/tests/html/xmp005.html b/mozilla/parser/htmlparser/tests/html/xmp005.html deleted file mode 100644 index ac952f5b849..00000000000 --- a/mozilla/parser/htmlparser/tests/html/xmp005.html +++ /dev/null @@ -1,48 +0,0 @@ - - -use a XMP tag for C or JAVA source code. -
    The lt and gt signes are problematic. - - - - cc = 123; - // test lt - if( cc < hhh ) { - if(cc<xxx || as > gh) { - //do womthing here; - } - } - if( cc <= iii ) { - if(cc<=yyy) { - //do womthing here; - } - } - // test gt - if( cc > rrr ) { - if(cc>eee) { - //do womthing here; - } - } - if( cc >= www ) { - if(cc>=qqq) { - //do womthing here; - } - } - // what if the variable name is a valid tag name. - if( cc < B && cc > kk ) { - if(cc<B && cc > gg) { - //do womthing here; - } - } - cc = aa<<I; - cc = B>>3; - gt = true; - for(a=0,gt=true; (a>0)&&gt; a++) { - } - a = 0x0004; - lt = 0x0002; - for(; a&lt; ) { - } - - - \ No newline at end of file diff --git a/mozilla/parser/htmlparser/tests/windows/Selftest.cpp b/mozilla/parser/htmlparser/tests/windows/Selftest.cpp deleted file mode 100644 index 0660fc576ba..00000000000 --- a/mozilla/parser/htmlparser/tests/windows/Selftest.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include -#include -#include -#include -#include -#include - -#include "nsScanner.h" -#include "nsTokenizer.h" -#include "nsHTMLDelegate.h" - - -bool compareFiles(const char* file1,const char* file2) { - bool result=true; - bool done=false; - char ch1,ch2; - int eof1,eof2; - - ifstream input1(file1,ios::in && ios::binary,filebuf::openprot); - ifstream input2(file2,ios::in && ios::binary,filebuf::openprot); - - while(!done) { - - while(!(eof1=input1.eof())) { - input1.read(&ch1,1); - if(('\n'!=ch1) && (' '!=ch1)) - break; - } - - while(!(eof2=input2.eof())) { - input2.read(&ch2,1); - if(('\n'!=ch2) && (' '!=ch2)) - break; - } - - if(eof1==eof2) { - if(eof1) - done=true; - else if(ch1!=ch2) { - done=true; - result=false; - } - } - else done=true; - } - return result; -} - -void parseFile (const char* aFilename,int size) -{ - //debug - aFilename="s:\\ns\\raptor\\parser\\tests\\html\\tag001.html"; - //aFilename="c:\\temp\\temp.html"; - - char filename[_MAX_PATH]; - strcpy(filename,aFilename); - strcat(filename,".tokens"); - { - ofstream out(filename); - ifstream input(aFilename); - CScanner scanner(input); - CHTMLTokenizerDelegate delegate; - CTokenizer tokenizer(scanner,delegate); - tokenizer.tokenize(); - tokenizer.debugDumpSource(out); - } - cout << aFilename; - if(compareFiles(aFilename,filename)) - cout << " PASS " << endl; - else cout << " FAIL" << endl; -} - -int walkDirectoryTree(char* aPath) { - int result=0; - char fullPath[_MAX_PATH]; - struct _finddata_t c_file; - long hFile; - - strcpy(fullPath,aPath); - strcat(fullPath,"\\*.*"); - /* Find first .c file in current directory */ - if((hFile = _findfirst( fullPath, &c_file )) == -1L ) - printf( "No matching files in current directory!\n" ); - else { - - bool done=false; - while(!done) { - if(c_file.attrib & _A_SUBDIR) { - if(strlen(c_file.name)>2){ - char newPath[_MAX_PATH]; - strcpy(newPath,aPath); - strcat(newPath,"\\"); - strcat(newPath,c_file.name); - walkDirectoryTree(newPath); - } - } - else { - int len=strlen(c_file.name); - if(len>5) { - if(0==strnicmp(&c_file.name[len-5],".HTML",5)) { - char filepath[_MAX_PATH]; - strcpy(filepath,aPath); - strcat(filepath,"\\"); - strcat(filepath,c_file.name); - parseFile(filepath,c_file.size); - } - } - } - if(_findnext( hFile, &c_file )!=0) - done=true; - } - _findclose( hFile ); - } - return 0; -} - -int main(int argc, char* argv []) -{ - int result=0; - char buffer[_MAX_PATH]; - - if(argc==2) - strcpy(buffer,argv[1]); - else _getcwd(buffer,_MAX_PATH); - walkDirectoryTree(buffer); - return 0; -} - - - diff --git a/mozilla/raptor.mak b/mozilla/raptor.mak deleted file mode 100644 index 3ae8364e0e9..00000000000 --- a/mozilla/raptor.mak +++ /dev/null @@ -1,361 +0,0 @@ -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=. -IGNORE_MANIFEST=1 -THIS_MAKEFILE=raptor.mak -THAT_MAKEFILE=makefile.win - -!if !defined(MOZ_TOP) -#enable builds from changed top level directories -MOZ_TOP=mozilla -!endif - -include <$(DEPTH)\config\config.mak> - -# This section is copied from rules.mak - -!if "$(WINOS)" == "WIN95" -W95MAKE=$(MOZ_SRC)\$(MOZ_TOP)\config\w95make.exe -W32OBJS = $(OBJS:.obj=.obj, ) -W32LOBJS = $(OBJS: .= +-.) -!endif - -###################################################################### - -# This makefile is designed to make building the raptor viewer -# application easy. - -# -# Command macro defines -# - -CVSCO = cvs -q co -P - -# Branch tags we use -IMGLIB_BRANCH = MODULAR_IMGLIB_BRANCH -NETLIB_BRANCH = MODULAR_NETLIB_BRANCH -XPCOM_BRANCH = XPCOM_BRANCH -RAPTOR_BRANCH = RAPTOR_BRANCH - -# CVS commands to pull the appropriate branch versions -CVSCO_XPCOM = $(CVSCO) -r $(XPCOM_BRANCH) -CVSCO_IMGLIB = $(CVSCO) -r $(IMGLIB_BRANCH) -CVSCO_NETLIB = $(CVSCO) -r $(NETLIB_BRANCH) -CVSCO_RAPTOR = $(CVSCO) -CVSCO_LIZARD = $(CVSCO) - -# The list of directories that need to be built to build the -# standalone raptor test program. The order is important. The -# DIST_DIRS need to be built before the RAPTOR_DIRS. - -DIST_DIRS = \ - nsprpub \ - include \ - jpeg \ - modules\libreg \ - xpcom \ - modules\zlib \ - modules\libutil \ - sun-java \ - nav-java \ - js \ - modules\security\freenav \ - modules\libpref \ - modules\libimg \ - lib\xp \ - lib\libnet \ - base - -# The list of directories to build the raptor layout engine and -# related libraries. - -RAPTOR_DIRS = \ - htmlparser \ - dom \ - gfx \ - view \ - widget \ - layout \ - webshell - -# Main rules - -all:: all_dist all_raptor - -export:: export_dist export_raptor - -libs:: libs_dist libs_raptor - -install:: install_dist install_raptor - -depend:: depend_dist depend_raptor - -clobber:: clobber_dist clobber_raptor - cd $(MOZ_SRC)\$(MOZ_TOP) - -rd /s /q dist - -clobber_all:: clobber_all_dist clobber_all_raptor - cd $(MOZ_SRC)\$(MOZ_TOP) - -rd /s /q dist - -###################################################################### - -# Rule to build subdirectories - -$(DIST_DIRS) $(RAPTOR_DIRS):: -!if "$(WINOS)" == "WIN95" - @echo +++ make: cannot recursively make on win95 using command.com, use w95make. -!else - @echo +++ make: %MAKE_ARGS% in $(MAKEDIR)\$@ - @cd $@ - @$(NMAKE) -f $(THAT_MAKEFILE) %%MAKE_ARGS%% - @cd $(MAKEDIR) -!endif - -###################################################################### - -# Rules for pulling the source from the cvs repository - -pull_all: pull_lizard pull_xpcom pull_imglib pull_netlib pull_raptor - -pull_lizard: - cd $(MOZ_SRC)\. - $(CVSCO_LIZARD) $(MOZ_TOP)/LICENSE - $(CVSCO_LIZARD) $(MOZ_TOP)/LEGAL - $(CVSCO_LIZARD) $(MOZ_TOP)/config - $(CVSCO_LIZARD) $(MOZ_TOP)/lib/liblayer - $(CVSCO_LIZARD) $(MOZ_TOP)/modules/zlib - $(CVSCO_LIZARD) $(MOZ_TOP)/modules/libutil - $(CVSCO_LIZARD) $(MOZ_TOP)/nsprpub - $(CVSCO_LIZARD) $(MOZ_TOP)/sun-java - $(CVSCO_LIZARD) $(MOZ_TOP)/nav-java - $(CVSCO_LIZARD) $(MOZ_TOP)/js - $(CVSCO_LIZARD) $(MOZ_TOP)/modules/security/freenav - $(CVSCO_XPCOM) $(MOZ_TOP)/modules/libpref - -pull_xpcom: - @cd $(MOZ_SRC)\. - $(CVSCO_XPCOM) $(MOZ_TOP)/modules/libreg - $(CVSCO_XPCOM) $(MOZ_TOP)/xpcom - -pull_imglib: - @cd $(MOZ_SRC)\. - $(CVSCO_IMGLIB) $(MOZ_TOP)/jpeg - $(CVSCO_IMGLIB) $(MOZ_TOP)/modules/libutil - $(CVSCO_IMGLIB) $(MOZ_TOP)/modules/libimg - -pull_netlib: - @cd $(MOZ_SRC)\. - $(CVSCO_NETLIB) $(MOZ_TOP)/lib/xp - $(CVSCO_NETLIB) $(MOZ_TOP)/lib/libnet - $(CVSCO_NETLIB) $(MOZ_TOP)/include - -pull_raptor: - @cd $(MOZ_SRC)\. - $(CVSCO_RAPTOR) $(MOZ_TOP)/base - $(CVSCO_RAPTOR) $(MOZ_TOP)/dom - $(CVSCO_RAPTOR) $(MOZ_TOP)/gfx - $(CVSCO_RAPTOR) $(MOZ_TOP)/htmlparser - $(CVSCO_RAPTOR) $(MOZ_TOP)/layout - $(CVSCO_RAPTOR) $(MOZ_TOP)/view - $(CVSCO_RAPTOR) $(MOZ_TOP)/webshell - $(CVSCO_RAPTOR) $(MOZ_TOP)/widget - -###################################################################### - -# Build rules for the "dist" portion. The "dist" contains those things -# which are imported by the raptor test programs. - -all_dist: - @cd $(MOZ_SRC)\$(MOZ_TOP) - $(NMAKE) -f $(THIS_MAKEFILE) export_dist - $(NMAKE) -f $(THIS_MAKEFILE) libs_dist - $(NMAKE) -f $(THIS_MAKEFILE) install_dist - -export_dist:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) export $(MAKEDIR) $(DIST_DIRS) -!else - @set MAKE_ARGS=export - -export_dist:: $(DIST_DIRS) -!endif - -libs_dist:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) libs $(MAKEDIR) $(DIST_DIRS) -!else - @set MAKE_ARGS=libs - -libs_dist:: $(DIST_DIRS) -!endif - -install_dist:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) install $(MAKEDIR) $(DIST_DIRS) -!else - @set MAKE_ARGS=install - -install_dist:: $(DIST_DIRS) -!endif - -depend_dist:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) depend $(MAKEDIR) $(DIST_DIRS) -!else - @set MAKE_ARGS=depend - -depend_dist:: $(DIST_DIRS) -!endif - -clobber_dist:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) clobber $(MAKEDIR) $(DIST_DIRS) -!else - @set MAKE_ARGS=clobber - -clobber_dist:: $(DIST_DIRS) -!endif - -clobber_all_dist:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) clobber_all $(MAKEDIR) $(DIST_DIRS) -!else - @set MAKE_ARGS=clobber_all - -clobber_all_dist:: $(DIST_DIRS) -!endif - -###################################################################### - -# Build rules for the "raptor" portion. This builds the raptor software -# including the sample webshell viewer application. - -all_raptor: - cd $(MOZ_SRC)\$(MOZ_TOP) - $(NMAKE) -f $(THIS_MAKEFILE) export_raptor - $(NMAKE) -f $(THIS_MAKEFILE) libs_raptor - $(NMAKE) -f $(THIS_MAKEFILE) install_raptor - -export_raptor:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) export $(MAKEDIR) $(RAPTOR_DIRS) -!else - @set MAKE_ARGS=export - -export_raptor:: $(RAPTOR_DIRS) -!endif - -libs_raptor:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) libs $(MAKEDIR) $(RAPTOR_DIRS) -!else - @set MAKE_ARGS=libs - -libs_raptor:: $(RAPTOR_DIRS) -!endif - -install_raptor:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) install $(MAKEDIR) $(RAPTOR_DIRS) -!else - @set MAKE_ARGS=install - -install_raptor:: $(RAPTOR_DIRS) -!endif - -depend_raptor:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) depend $(MAKEDIR) $(RAPTOR_DIRS) -!else - @set MAKE_ARGS=depend - -depend_raptor:: $(RAPTOR_DIRS) -!endif - -clobber_raptor:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) clobber $(MAKEDIR) $(RAPTOR_DIRS) -!else - @set MAKE_ARGS=clobber - -clobber_raptor:: $(RAPTOR_DIRS) -!endif - -clobber_all_raptor:: -!if "$(WINOS)" == "WIN95" - @$(W95MAKE) clobber_all $(MAKEDIR) $(RAPTOR_DIRS) -!else - @set MAKE_ARGS=clobber_all - -clobber_all_raptor:: $(RAPTOR_DIRS) -!endif - -###################################################################### - -# Build raptor Doc++ documentation -DOCXX = $(MOZ_TOOLS)\bin\docxx -DOCXX_RAPTOR = $(DOCXX) -H -A -p -f -B c:\fake_banner-file_name -j -a -DOCXX_DESTDIR = $(MOZ_SRC)\$(MOZ_TOP)\dist\documentation - -doc_raptor: - -rm -rf $(DOCXX_DESTDIR) - -@mkdir $(DOCXX_DESTDIR) - @for %d in (raptor xpcom img dom netlib) do \ - $(DOCXX_RAPTOR) -d $(DOCXX_DESTDIR)\%d $(MOZ_SRC)\$(MOZ_TOP)\dist\public\%d\*.h - @echo Documentation written to $(DOCXX_DESTDIR) - -###################################################################### - -# Build tarball - -DATE_CMD=unix_date -!if [$(DATE_CMD) +%Y%m%d > today.inc] -!endif -DATE=\ -!include "today.inc" -DATE=$(DATE: =)^ - -!if [del today.inc] -!endif - -TAR = tar -ZIP = $(MOZ_TOOLS)\bin\zip -GZIP = gzip - -TARBALL = $(MOZ_SRC)\win-$(DATE).tar -TARBALL_ZIP = $(MOZ_SRC)\win-$(DATE).zip - -TARFILES = mozilla README\\raptor - -tarballs: tarball_zip tarball_gz - -tarball_zip: prepare_for_tarballing - @echo Making $(TARBALL_ZIP) - cd $(MOZ_SRC)\. - rm -f $(TARBALL_ZIP) - $(ZIP) -9 -r -q $(TARBALL_ZIP) $(TARFILES) - -tarball_gz: prepare_for_tarballing - @echo Making $(TARBALL) - cd $(MOZ_SRC)\. - rm -f $(TARBALL) $(TARBALL).gz - $(TAR) cf $(TARBALL) $(TARFILES) - @echo Making gzip of $(TARBALL) - $(GZIP) -9 -q $(TARBALL) - -prepare_for_tarballing: - $(NMAKE) -f $(THIS_MAKEFILE) clobber clobber_all diff --git a/mozilla/raptor.mk b/mozilla/raptor.mk deleted file mode 100644 index d215737260d..00000000000 --- a/mozilla/raptor.mk +++ /dev/null @@ -1,177 +0,0 @@ -#!gmake -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=. - -# -# Command macro defines -# - -CVSCO = cvs -q co -P - -# Branch tags we use -IMGLIB_BRANCH = MODULAR_IMGLIB_BRANCH -NETLIB_BRANCH = MODULAR_NETLIB_BRANCH -XPCOM_BRANCH = XPCOM_BRANCH -RAPTOR_BRANCH = RAPTOR_BRANCH - -# CVS commands to pull the appropriate branch versions -CVSCO_XPCOM = $(CVSCO) -r $(XPCOM_BRANCH) -CVSCO_IMGLIB = $(CVSCO) -r $(IMGLIB_BRANCH) -CVSCO_NETLIB = $(CVSCO) -r $(NETLIB_BRANCH) -CVSCO_RAPTOR = $(CVSCO) -CVSCO_LIZARD = $(CVSCO) - -# The list of directories that need to be built to build the standalone -# raptor test program. The order is important. -ifndef RAPTOR_PASS2 -DIRS = \ - config \ - nsprpub \ - jpeg \ - modules/libreg \ - xpcom \ - modules/zlib \ - modules/libutil \ - sun-java \ - nav-java \ - js \ - modules/security/freenav \ - modules/libpref \ - modules/libimg \ - lib/xp \ - lib/libnet \ - lib/liblayer/include -else -DIRS = \ - base \ - htmlparser \ - dom \ - gfx \ - view \ - widget \ - layout \ - webshell -endif - -include $(DEPTH)/config/config.mk - -# -# NOTE: Don't use make all with this makefile; it won't work! -# NOTE: Don't use make export with this makefile; it won't work! -# NOTE: Don't use make libs with this makefile; it won't work! -# NOTE: Don't use make clobber with this makefile; it won't work! -# - -THIS_MAKEFILE = raptor.mk - -real_all: pass1_all pass2_all - -pass1_all: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) export - cd $(MOZ_SRC)/mozilla/base; \ - $(MAKE) export - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) libs; \ - $(MAKE) -f $(THIS_MAKEFILE) install - -pass2_all: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 export; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 libs; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 install - -real_export: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) export; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 export - -real_libs: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) libs; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 libs - -real_install: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) install; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 install - -real_clobber: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) clobber_all; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 clobber_all; \ - $(MAKE) -f $(THIS_MAKEFILE) final_clobber - -final_clobber: - cd $(MOZ_SRC)/mozilla; \ - $(RM) -r dist - -real_depend: - cd $(MOZ_SRC)/mozilla; \ - $(MAKE) -f $(THIS_MAKEFILE) depend; \ - $(MAKE) -f $(THIS_MAKEFILE) RAPTOR_PASS2=pass2 depend - -include $(DEPTH)/config/rules.mk - -# -# Rules for pulling the source from the cvs repository -# - -pull_all: pull_lizard pull_xpcom pull_imglib pull_netlib pull_raptor - -pull_lizard: - cd $(MOZ_SRC)/.; \ - $(CVSCO_LIZARD) mozilla/config; \ - $(CVSCO_LIZARD) mozilla/build/build_number; \ - $(CVSCO_LIZARD) mozilla/cmd/xfe/icons/icondata.h; \ - $(CVSCO_LIZARD) mozilla/lib/liblayer; \ - $(CVSCO_LIZARD) mozilla/modules/zlib; \ - $(CVSCO_LIZARD) mozilla/modules/libutil; \ - $(CVSCO_LIZARD) mozilla/nsprpub; \ - $(CVSCO_LIZARD) mozilla/sun-java; \ - $(CVSCO_LIZARD) mozilla/nav-java; \ - $(CVSCO_LIZARD) mozilla/js; \ - $(CVSCO_LIZARD) mozilla/modules/security/freenav; \ - -pull_xpcom: - cd $(MOZ_SRC)/.; \ - $(CVSCO_XPCOM) mozilla/modules/libreg; \ - $(CVSCO_XPCOM) mozilla/xpcom; \ - $(CVSCO_XPCOM) mozilla/modules/libpref - -pull_imglib: - cd $(MOZ_SRC)/.; \ - $(CVSCO_IMGLIB) mozilla/jpeg; \ - $(CVSCO_IMGLIB) mozilla/modules/libutil; \ - $(CVSCO_IMGLIB) mozilla/modules/libimg - -pull_netlib: - cd $(MOZ_SRC)/.; \ - $(CVSCO_NETLIB) mozilla/lib/xp; \ - $(CVSCO_NETLIB) mozilla/lib/libnet; \ - $(CVSCO_NETLIB) mozilla/include - -pull_raptor: - cd $(MOZ_SRC)/.; \ - $(CVSCO_RAPTOR) mozilla/base; \ - $(CVSCO_RAPTOR) mozilla/dom; \ - $(CVSCO_RAPTOR) mozilla/gfx; \ - $(CVSCO_RAPTOR) mozilla/htmlparser; \ - $(CVSCO_RAPTOR) mozilla/layout; \ - $(CVSCO_RAPTOR) mozilla/view; \ - $(CVSCO_RAPTOR) mozilla/webshell; \ - $(CVSCO_RAPTOR) mozilla/widget diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp deleted file mode 100644 index 559280b9c0c..00000000000 --- a/mozilla/string/obsolete/nsString.cpp +++ /dev/null @@ -1,2056 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include -#include -#include -#include "nsString.h" -#include "nsCRT.h" -#include "nsDebug.h" -#include "prprf.h" -#include "prdtoa.h" - - -const PRInt32 kGrowthDelta = 8; -const PRInt32 kNotFound = -1; -PRUnichar gBadChar = 0; -const char* kOutOfBoundsError = "Error: out of bounds"; -const char* kNullPointerError = "Error: unexpected null ptr"; - -//********************************************** -//NOTE: Our buffer always hold capacity+1 bytes. -//********************************************** - - -PRInt32 nsString::mInstanceCount=0; - -/**------------------------------------------------------- - * Default constructor - * - * @update gess 3/31/98 - * @param - * @return - *------------------------------------------------------*/ -nsString::nsString(const char* anISOLatin1/*=""*/) { - mLength=mCapacity=0; - mStr=0; - PRInt32 len=strlen(anISOLatin1); - EnsureCapacityFor(len); - this->SetString(anISOLatin1,len); - if(++mInstanceCount==1) - SelfTest(); -} - -/*------------------------------------------------------- - * constructor from string - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsString::nsString(const nsString &aString) { - mLength=mCapacity=0; - mStr=0; - EnsureCapacityFor(aString.mLength); - this->SetString(aString.mStr,aString.mLength); - if(++mInstanceCount==1) - SelfTest(); -} - -/*------------------------------------------------------- - * constructor from unicode string - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsString::nsString(const PRUnichar* aUnicodeStr){ - mLength=mCapacity=0; - mStr=0; - PRInt32 len=(aUnicodeStr) ? nsCRT::strlen(aUnicodeStr) : 0; - EnsureCapacityFor(len); - this->SetString(aUnicodeStr,len); - if(++mInstanceCount==1) - SelfTest(); -} - -/*------------------------------------------------------- - * special subclas constructor - * this will optionally not allocate a buffer - * but the subclass must - * @update psl 4/16/98 - * @param - * @return - *------------------------------------------------------*/ -nsString::nsString(PRBool aSubclassBuffer) -{ - mLength=mCapacity=0; - mStr=0; - if (PR_FALSE == aSubclassBuffer) { - EnsureCapacityFor(1); - this->SetString(""); - } - if(++mInstanceCount==1) - SelfTest(); -} - -/*------------------------------------------------------- - * standard destructor - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsString::~nsString() -{ - delete [] mStr; - mStr=0; - mCapacity=mLength=0; -} - -/*------------------------------------------------------- - * This method gets called when the internal buffer needs - * to grow to a given size. - * @update gess 3/30/98 - * @param aNewLength -- new capacity of string - * @return void - *------------------------------------------------------*/ -void nsString::EnsureCapacityFor(PRInt32 aNewLength) -{ - PRInt32 newCapacity; - - if (mCapacity > 64) { - // When the string starts getting large, double the capacity as we - // grow. - newCapacity = mCapacity * 2; - if (newCapacity < aNewLength) { - newCapacity = mCapacity + aNewLength; - } - } else { - // When the string is small, keep it's capacity a multiple of - // kGrowthDelta - PRInt32 size =aNewLength+kGrowthDelta; - newCapacity=size-(size % kGrowthDelta); - } - - if(mCapacity 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); - } - if(mStr) - delete [] mStr; - mStr = temp; - mStr[mLength]=0; - } -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -void nsString::SetLength(PRInt32 aLength) { -// NS_WARNING("Depricated method -- not longer required with dynamic strings. Use Truncate() instead."); - EnsureCapacityFor(aLength); - if (aLength > mLength) { - nsCRT::zero(mStr + mLength, (aLength - mLength) * sizeof(chartype)); - } - mLength=aLength; -} - -/*------------------------------------------------------- - * This method truncates this string to given length. - * - * @update gess 3/27/98 - * @param anIndex -- new length of string - * @return nada - *------------------------------------------------------*/ -void nsString::Truncate(PRInt32 anIndex) { - if((anIndex>-1) && (anIndex= 'A') && (ch <= 'Z')) { - *cp = 'a' + (ch - 'A'); - } - cp++; - } -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -void nsString::ToUpperCase() -{ - chartype* cp = mStr; - chartype* end = cp + mLength; - while (cp < end) { - chartype ch = *cp; - if ((ch >= 'a') && (ch <= 'z')) { - *cp = 'A' + (ch - 'a'); - } - cp++; - } -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -void nsString::ToLowerCase(nsString& aOut) const -{ - aOut.SetLength(mLength); - chartype* to = aOut.mStr; - chartype* from = mStr; - chartype* end = from + mLength; - while (from < end) { - chartype ch = *from++; - if ((ch >= 'A') && (ch <= 'Z')) { - ch = 'a' + (ch - 'A'); - } - *to++ = ch; - } - *to = 0; -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -void nsString::ToUpperCase(nsString& aOut) const -{ - aOut.SetLength(mLength); - chartype* to = aOut.mStr; - chartype* from = mStr; - chartype* end = from + mLength; - while (from < end) { - chartype ch = *from++; - if ((ch >= 'a') && (ch <= 'z')) { - ch = 'A' + (ch - 'a'); - } - *to++ = ch; - } - *to = 0; -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsString* nsString::ToNewString() const { - return new nsString(mStr); -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -char* nsString::ToNewCString() const -{ - char* rv = new char[mLength + 1]; - return ToCString(rv,mLength+1); -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRUnichar* nsString::ToNewUnicode() const -{ - PRInt32 len = mLength; - chartype* rv = new chartype[len + 1]; - chartype* to = rv; - chartype* from = mStr; - while (--len >= 0) { - *to++ = *from++; - } - *to++ = 0; - return rv; -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -void nsString::ToString(nsString& aString) const -{ - aString.SetLength(0); - aString.Append(mStr, mLength); -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const -{ - aBufLength--; // leave room for the \0 - PRInt32 len = mLength; - if (len > aBufLength) { - len = aBufLength; - } - char* to = aBuf; - chartype* from = mStr; - while (--len >= 0) { - *to++ = char(*from++); - } - *to++ = '\0'; - return aBuf; -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -float nsString::ToFloat(PRInt32* aErrorCode) const -{ - char buf[40]; - if (mLength > sizeof(buf)-1) { - *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; - return 0.0f; - } - char* cp = ToCString(buf, sizeof(buf)); - float f = (float) PR_strtod(cp, &cp); - if (*cp != 0) { - *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; - } - *aErrorCode = (PRInt32) NS_OK; - return f; -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const { - PRInt32 rv = 0; - PRUnichar* cp = mStr; - PRUnichar* end = mStr + mLength; - - // Skip leading whitespace - while (cp < end) { - PRUnichar ch = *cp; - if (!IsSpace(ch)) { - break; - } - cp++; - } - if (cp == end) { - *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; - return rv; - } - - // Check for sign - PRUnichar sign = '+'; - if ((*cp == '+') || (*cp == '-')) { - sign = *cp++; - } - if (cp == end) { - *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; - return rv; - } - - // Convert the number - while (cp < end) { - PRUnichar ch = *cp++; - if ((ch < '0') || (ch > '9')) { - *aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE; - break; - } - rv = rv * 10 + (ch - '0'); - } - - if (sign == '-') { - rv = -rv; - } - *aErrorCode = NS_OK; - return rv; -} - - -/*------------------------------------------------------- - * assign given string to this one - * @update gess 3/27/98 - * @param aString: string to be added to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator=(const nsString& aString) { - return this->SetString(aString.mStr,aString.mLength); -} - - -/*------------------------------------------------------- - * assign given char* to this string - * @update gess 3/27/98 - * @param anISOLatin1: buffer to be assigned to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator=(const char* anISOLatin1) { - return SetString(anISOLatin1); -} - - -/*------------------------------------------------------- - * assign given char to this string - * @update gess 3/27/98 - * @param aChar: char to be assignd to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator=(char aChar) { - return Append(PRUnichar(aChar)); -} - -/*------------------------------------------------------- - * assign given PRUnichar* to this string - * @update gess 3/27/98 - * @param anISOLatin1: buffer to be assigned to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::SetString(const PRUnichar* aStr,PRInt32 aLength) { - if(aStr!=0) { - PRInt32 len=(kNotFound==aLength) ? nsCRT::strlen(aStr) : aLength; - if(mCapacity< len ) - EnsureCapacityFor(len); - nsCRT::memcpy(mStr,aStr,len*sizeof(chartype)); - mLength=len; - mStr[mLength]=0; - } - else { - mLength=0; //This little bit of code handles the case - mStr[0]=0; //where some blockhead hands us a null string - } - return *this; -} - - -/*------------------------------------------------------- - * assign given char* to this string - * @update gess 3/27/98 - * @param anISOLatin1: buffer to be assigned to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::SetString(const char* anISOLatin1,PRInt32 aLength) { - if(anISOLatin1!=0) { - PRInt32 len=(kNotFound==aLength) ? nsCRT::strlen(anISOLatin1) : aLength; - if(mCapacitySetString(aStr); -} - - -/*------------------------------------------------------- - * assign given char to this string - * @update gess 3/27/98 - * @param aChar: char to be assignd to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator=(PRUnichar aChar) { - mLength=1; - if(mCapacity<1) - EnsureCapacityFor(kGrowthDelta); - mStr[0]=aChar; - mStr[1]=0; - return *this; -} - -/*------------------------------------------------------- - * append given string to this string - * @update gess 3/27/98 - * @param aString : string to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::Append(const nsString& aString,PRInt32 aLength) { - return Append(aString.mStr,aString.mLength); -} - -/*------------------------------------------------------- - * append given string to this string - * @update gess 3/27/98 - * @param aString : string to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::Append(const char* anISOLatin1,PRInt32 aLength) { - if(anISOLatin1!=0) { - PRInt32 len=(kNotFound==aLength) ? strlen(anISOLatin1) : aLength; - if(mLength+len > mCapacity) { - EnsureCapacityFor(mLength+len); - } - for(int i=0;i mCapacity) { - EnsureCapacityFor(mLength+len); - } - if(len>0) - nsCRT::memcpy(&mStr[mLength],aString,len*sizeof(chartype)); - mLength+=len; - mStr[mLength]=0; - } - return *this; -} - -/*------------------------------------------------------- - * append given string to this string - * @update gess 3/27/98 - * @param aString : string to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::Append(PRUnichar aChar) { - if(mLength < mCapacity) { - mStr[mLength++]=aChar; // the new string len < capacity, so just copy - mStr[mLength]=0; - } - else { // The new string exceeds our capacity - EnsureCapacityFor(mLength+1); - mStr[mLength++]=aChar; - mStr[mLength]=0; - } - return *this; -} - - -/*------------------------------------------------------- - * append given string to this string - * @update gess 3/27/98 - * @param aString : string to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator+=(const nsString &aString) { - return this->Append(aString.mStr,aString.mLength); -} - - -/*------------------------------------------------------- - * append given buffer to this string - * @update gess 3/27/98 - * @param anISOLatin1: buffer to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator+=(const char* anISOLatin1) { - return Append(anISOLatin1); -} - - -/*------------------------------------------------------- - * append given buffer to this string - * @update gess 3/27/98 - * @param aBuffer: buffer to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator+=(const PRUnichar* aBuffer) { - return Append(aBuffer); -} - - -/*------------------------------------------------------- - * append given char to this string - * @update gess 3/27/98 - * @param aChar: char to be appended to this - * @return this - *------------------------------------------------------*/ -nsString& nsString::operator+=(PRUnichar aChar) { - return Append(aChar); -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsString& nsString::Append(PRInt32 aInteger,PRInt32 aRadix) { - char* fmt = "%d"; - if (8 == aRadix) { - fmt = "%o"; - } else if (16 == aRadix) { - fmt = "%x"; - } - char buf[40]; - PR_snprintf(buf, sizeof(buf), fmt, aInteger); - Append(buf); - return *this; -} - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsString& nsString::Append(float aFloat){ - char buf[40]; - PR_snprintf(buf, sizeof(buf), "%g", aFloat); - Append(buf); - return *this; -} - - - -/**------------------------------------------------------- - * Copies n characters from this string to given string, - * starting at the leftmost offset. - * - * - * @update gess 4/1/98 - * @param aCopy -- Receiving string - * @param aCount -- number of chars to copy - * @return number of chars copied - *------------------------------------------------------*/ -PRInt32 nsString::Left(nsString& aCopy,PRInt32 aCount) { - return Mid(aCopy,0,aCount); -} - -/**------------------------------------------------------- - * Copies n characters from this string to given string, - * starting at the given offset. - * - * - * @update gess 4/1/98 - * @param aCopy -- Receiving string - * @param aCount -- number of chars to copy - * @param anOffset -- position where copying begins - * @return number of chars copied - *------------------------------------------------------*/ -PRInt32 nsString::Mid(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { - if(anOffsetaCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given - if(aCount>0) { - - //1st optimization: If you're inserting at end, then simply append! - if(anOffset>=mLength){ - Append(aCopy,aCopy.mLength); - return aCopy.mLength; - } - - if(mLength+aCount > mCapacity) { - EnsureCapacityFor(mLength+aCount); - } - - PRUnichar* last = mStr + mLength; - PRUnichar* first = mStr + anOffset-1; - PRUnichar* next = mStr + mLength + aCount; - - //Copy rightmost chars, up to offset+aCount... - while(first mCapacity) { - EnsureCapacityFor(mLength+1); - } - - PRUnichar* last = mStr + mLength; - PRUnichar* first = mStr + anOffset-1; - PRUnichar* next = mStr + mLength + 1; - - //Copy rightmost chars, up to offset+aCount... - while(first=0) && (anOffset= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'))) { - return PR_TRUE; - } - return PR_FALSE; -} - -/**------------------------------------------------------- - * - * - * @update gess 3/31/98 - * @param - * @return - *------------------------------------------------------*/ -PRBool nsString::IsSpace(PRUnichar ch) { - // XXX i18n - if ((ch == ' ') || (ch == '\r') || (ch == '\n') || (ch == '\t')) { - return PR_TRUE; - } - return PR_FALSE; -} - -/**------------------------------------------------------- - * This method trims characters found in aTrimSet from - * either end of the underlying string. - * - * @update gess 3/31/98 - * @param aTrimSet -- contains chars to be trimmed from - * both ends - * @return this - *------------------------------------------------------*/ -nsString& nsString::Trim(const char* aTrimSet, - PRBool aEliminateLeading, - PRBool aEliminateTrailing) -{ - PRUnichar* from = mStr; - PRUnichar* end = mStr + mLength-1; - PRUnichar* to = mStr; - - //begin by find the first char not in aTrimSet - if(aEliminateLeading) { - while (from < end) { - PRUnichar ch = *from; - if(!strchr(aTrimSet,char(ch))) { - break; - } - from++; - } - } - - //Now, find last char not in aTrimSet - if(aEliminateTrailing) { - while(end> from) { - PRUnichar ch = *end; - if(!strchr(aTrimSet,char(ch))) { - break; - } - end--; - } - } - - //now rewrite your string without unwanted - //leading or trailing characters. - while (from <= end) { - *to++ = *from++; - } - - *to = '\0'; - mLength = to - mStr; - return *this; -} - -/**------------------------------------------------------- - * - * - * @update gess 3/31/98 - * @param - * @return - *------------------------------------------------------*/ -nsString& nsString::CompressWhitespace( PRBool aEliminateLeading, - PRBool aEliminateTrailing) -{ - PRUnichar* from = mStr; - PRUnichar* end = mStr + mLength; - PRUnichar* to = from; - - Trim(" \r\n\t",aEliminateLeading,aEliminateTrailing); - - //this code converts /n, /t, /r into normal space ' '; - //it also eliminates runs of whitespace... - while (from < end) { - PRUnichar ch = *from++; - if (IsSpace(ch)) { - *to++ = ' '; - while (from < end) { - ch = *from++; - if (!IsSpace(ch)) { - *to++ = ch; - break; - } - } - } else { - *to++ = ch; - } - } - - *to = '\0'; - mLength = to - mStr; - return *this; -} - -/**------------------------------------------------------- - * XXX This is used by bina all over the place; not sure - * it belongs here though - * - * @update gess 3/31/98 - * @param - * @return - *------------------------------------------------------*/ -nsString& nsString::StripWhitespace() -{ - Trim(" \r\n\t"); - return StripChars("\r\t\n"); -} - - -/**------------------------------------------------------- - * Search for given buffer within this string - * - * @update gess 3/25/98 - * @param anISOLatin1Buf - charstr to be found - * @return offset in string, or -1 (kNotFound) - *------------------------------------------------------*/ -PRInt32 nsString::Find(const char* anISOLatin1Buf) const{ - NS_ASSERTION(0!=anISOLatin1Buf,kNullPointerError); - PRInt32 result=-1; - if(anISOLatin1Buf) { - PRInt32 len=strlen(anISOLatin1Buf); - if(len<=mLength) { //only enter if abuffer length is <= mStr length. - for(PRInt32 offset=0;offset0;i--){ - char* pos=strchr(anISOLatin1Set,char(mStr[i])); - if(pos) - return i; - } - } - return kNotFound; -} - -/**------------------------------------------------------- - * - * - * @update gess 3/25/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::FindLastCharInSet(nsString& aSet,PRInt32 anOffset) const{ - if(aSet.Length()) { - for(PRInt32 i=mLength-1;i>0;i--){ - PRInt32 pos=aSet.Find(mStr[i]); - if(kNotFound!=pos) - return i; - } - } - return kNotFound; -} - -/**------------------------------------------------------- - * - * - * @update gess 3/25/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::RFind(const PRUnichar* aString,PRBool aIgnoreCase) const{ - NS_ASSERTION(0!=aString,kNullPointerError); - - if(aString) { - PRInt32 len=nsCRT::strlen(aString); - if((len) && (len<=mLength)) { //only enter if abuffer length is <= mStr length. - for(PRInt32 offset=mLength-len;offset>=0;offset--) { - PRInt32 result=0; - if(aIgnoreCase) - result=nsCRT::strncasecmp(&mStr[offset],aString,len); - else result=nsCRT::strncmp(&mStr[offset],aString,len); - if(0==result) - return offset; //in this case, 0 means they match - } - } - } - return kNotFound; -} - -/**------------------------------------------------------- - * - * - * @update gess 3/25/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::RFind(const nsString& aString,PRBool aIgnoreCase) const{ - PRInt32 len=aString.mLength; - if((len) && (len<=mLength)) { //only enter if abuffer length is <= mStr length. - for(PRInt32 offset=mLength-len;offset>=0;offset--) { - PRInt32 result=0; - if(aIgnoreCase) - result=nsCRT::strncasecmp(&mStr[offset],aString.mStr,len); - else result=nsCRT::strncmp(&mStr[offset],aString.mStr,len); - if(0==result) - return offset; //in this case, 0 means they match - } - } - return kNotFound; -} - -/**------------------------------------------------------- - * - * - * @update gess 3/25/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::RFind(const char* anISOLatin1Set,PRBool aIgnoreCase) const{ - NS_ASSERTION(0!=anISOLatin1Set,kNullPointerError); - - if(anISOLatin1Set) { - PRInt32 len=strlen(anISOLatin1Set); - if((len) && (len<=mLength)) { //only enter if abuffer length is <= mStr length. - for(PRInt32 offset=mLength-len;offset>=0;offset--) { - PRInt32 result=0; - if(aIgnoreCase) - result=nsCRT::strncasecmp(&mStr[offset],anISOLatin1Set,len); - else result=nsCRT::strncmp(&mStr[offset],anISOLatin1Set,len); - if(0==result) - return offset; //in this case, 0 means they match - } - } - } - return kNotFound; -} - - -/**------------------------------------------------------- - * Scans this string backwards for first occurance of - * the given char. - * - * @update gess 3/25/98 - * @param - * @return offset of char in string, or -1 (kNotFound) - *------------------------------------------------------*/ -PRInt32 nsString::RFind(PRUnichar aChar,PRBool aIgnoreCase) const{ - chartype uc=nsCRT::ToUpper(aChar); - for(PRInt32 offset=mLength-1;offset>0;offset--) - if(aIgnoreCase) { - if(nsCRT::ToUpper(mStr[offset])==uc) - return offset; - } - else if(mStr[offset]==aChar) - return offset; //in this case, 0 means they match - return kNotFound; - -} - - //****** comparision methods... ******* - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::Compare(const char *anISOLatin1,PRBool aIgnoreCase) const { - if (aIgnoreCase) { - return nsCRT::strcasecmp(mStr,anISOLatin1); - } - return nsCRT::strcmp(mStr,anISOLatin1); -} - -/*------------------------------------------------------- - * LAST MODS: gess - * - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::Compare(const nsString &S,PRBool aIgnoreCase) const { - if (aIgnoreCase) { - return nsCRT::strcasecmp(mStr,S.mStr); - } - return nsCRT::strcmp(mStr,S.mStr); -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRInt32 nsString::Compare(const PRUnichar* aString,PRBool aIgnoreCase) const { - if (aIgnoreCase) { - return nsCRT::strcasecmp(mStr,aString); - } - return nsCRT::strcmp(mStr,aString); -} - - -PRInt32 nsString::operator==(const nsString &S) const {return Compare(S)==0;} -PRInt32 nsString::operator==(const char *s) const {return Compare(s)==0;} -PRInt32 nsString::operator==(const PRUnichar *s) const {return Compare(s)==0;} -PRInt32 nsString::operator!=(const nsString &S) const {return Compare(S)!=0;} -PRInt32 nsString::operator!=(const char *s ) const {return Compare(s)!=0;} -PRInt32 nsString::operator!=(const PRUnichar *s) const {return Compare(s)==0;} -PRInt32 nsString::operator<(const nsString &S) const {return Compare(S)<0;} -PRInt32 nsString::operator<(const char *s) const {return Compare(s)<0;} -PRInt32 nsString::operator<(const PRUnichar *s) const {return Compare(s)==0;} -PRInt32 nsString::operator>(const nsString &S) const {return Compare(S)>0;} -PRInt32 nsString::operator>(const char *s) const {return Compare(s)>0;} -PRInt32 nsString::operator>(const PRUnichar *s) const {return Compare(s)==0;} -PRInt32 nsString::operator<=(const nsString &S) const {return Compare(S)<=0;} -PRInt32 nsString::operator<=(const char *s) const {return Compare(s)<=0;} -PRInt32 nsString::operator<=(const PRUnichar *s) const {return Compare(s)==0;} -PRInt32 nsString::operator>=(const nsString &S) const {return Compare(S)>=0;} -PRInt32 nsString::operator>=(const char *s) const {return Compare(s)>=0;} -PRInt32 nsString::operator>=(const PRUnichar *s) const {return Compare(s)==0;} - - - -/*------------------------------------------------------- - * Compare this to given string - * @update gess 3/27/98 - * @param aString -- string to compare to this - * @return TRUE if equal - *------------------------------------------------------*/ -PRBool nsString::Equals(const nsString& aString) const { - PRInt32 result=nsCRT::strcmp(mStr,aString.mStr); - return PRBool(0==result); -} - - -/*------------------------------------------------------- - * Compare this to given string - * @update gess 3/27/98 - * @param aCString -- Cstr to compare to this - * @return TRUE if equal - *------------------------------------------------------*/ -PRBool nsString::Equals(const char* aCString) const{ - NS_ASSERTION(0!=aCString,kNullPointerError); - PRInt32 result=nsCRT::strcmp(mStr,aCString); - return PRBool(0==result); -} - - -/*------------------------------------------------------- - * Compare this to given atom - * @update gess 3/27/98 - * @param aAtom -- atom to compare to this - * @return TRUE if equal - *------------------------------------------------------*/ -PRBool nsString::Equals(const nsIAtom* aAtom) const -{ - NS_ASSERTION(0!=aAtom,kNullPointerError); - PRInt32 result=nsCRT::strcmp(mStr,aAtom->GetUnicode()); - return PRBool(0==result); -} - - -/*------------------------------------------------------- - * Compare given strings - * @update gess 3/27/98 - * @param s1 -- first string to be compared - * @param s2 -- second string to be compared - * @return TRUE if equal - *------------------------------------------------------*/ -PRBool nsString::Equals(const PRUnichar* s1, const PRUnichar* s2) const { - NS_ASSERTION(0!=s1,kNullPointerError); - NS_ASSERTION(0!=s2,kNullPointerError); - PRBool result=PR_FALSE; - if((s1) && (s2)){ - PRInt32 cmp=nsCRT::strcmp(s1,s2); - result=PRBool(0==cmp); - } - return result; -} - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRBool nsString::EqualsIgnoreCase(const nsString& aString) const{ - PRInt32 result=nsCRT::strcasecmp(mStr,aString.mStr); - return PRBool(0==result); -} - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRBool nsString::EqualsIgnoreCase(const nsIAtom *aAtom) const{ - NS_ASSERTION(0!=aAtom,kNullPointerError); - PRBool result=PR_FALSE; - if(aAtom){ - PRInt32 cmp=nsCRT::strcasecmp(mStr,aAtom->GetUnicode()); - result=PRBool(0==cmp); - } - return result; -} - - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRBool nsString::EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const { - NS_ASSERTION(0!=s1,kNullPointerError); - NS_ASSERTION(0!=s2,kNullPointerError); - PRBool result=PR_FALSE; - if((s1) && (s2)){ - PRInt32 cmp=nsCRT::strcasecmp(s1,s2); - result=PRBool(0==cmp); - } - return result; -} - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -PRBool nsString::EqualsIgnoreCase(const char* aCString) const { - NS_ASSERTION(0!=aCString,kNullPointerError); - PRBool result=PR_FALSE; - if(aCString){ - PRInt32 cmp=nsCRT::strcasecmp(mStr,aCString); - result=PRBool(0==cmp); - } - return result; -} - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -void nsString::DebugDump(ostream& aStream) const { - for(int i=0;itemp3.Length(),"constructor error!"); //should be char longer - - nsString* es1=temp2.ToNewString(); //this should make us a new string - char* es2=temp2.ToNewCString(); - for(i=0;itemp8,"Error: Comparision (>) routine"); - NS_ASSERTION(temp9>aaaa,"Error: Comparision (>) routine"); - - NS_ASSERTION(temp8<=temp8,"Error: Comparision (<=) routine"); - NS_ASSERTION(temp8<=temp9,"Error: Comparision (<=) routine"); - NS_ASSERTION(temp8<=bbbb,"Error: Comparision (<=) routine"); - - NS_ASSERTION(temp9>=temp9,"Error: Comparision (<=) routine"); - NS_ASSERTION(temp9>=temp8,"Error: Comparision (<=) routine"); - NS_ASSERTION(temp9>=aaaa,"Error: Comparision (<=) routine"); - - NS_ASSERTION(temp8.Equals(temp8),"Equals error"); - NS_ASSERTION(temp8.Equals(aaaa),"Equals error"); - - nsString temp10(temp8); - temp10.ToUpperCase(); - NS_ASSERTION(temp8.EqualsIgnoreCase(temp10),"Equals error"); - NS_ASSERTION(temp8.EqualsIgnoreCase("AAAA"),"Equals error"); - - - //********************************************** - //Now let's test a few string MANIPULATORS... - //********************************************** - - nsAutoString ab("ab"); - nsString abcde("cde"); - abcde.Insert(ab,0,2); - nsAutoString xxx("xxx"); - abcde.Insert(xxx,2,3); - - temp2.ToUpperCase(); - for(i=0;i mCapacity) { - PRInt32 size = mCapacity * 2; - if (size < aNewLength) { - size = mCapacity + aNewLength; - } - mCapacity=size; - chartype* temp = new chartype[mCapacity+1]; - if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); - } - if ((mStr != mBuf) && (0 != mStr)) { - delete [] mStr; - } - mStr = temp; - } -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsAutoString::nsAutoString(const PRUnichar* unicode, PRInt32 uslen) - : nsString(PR_TRUE) -{ - mStr = mBuf; - mCapacity = sizeof(mBuf) / sizeof(chartype); - if (0 == uslen) { - uslen = nsCRT::strlen(unicode); - } - Append(unicode, uslen); -} - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -nsAutoString::~nsAutoString() -{ - if (mStr == mBuf) { - // Force to null so that baseclass dtor doesn't do damage - mStr = nsnull; - } -} - - -/**------------------------------------------------------- - * - * - * @update gess 3/31/98 - * @param - * @return - *------------------------------------------------------*/ -void nsAutoString::SelfTest(){ - nsAutoString xas("Hello there"); - xas.Append("this string exceeds the max size"); - xas.DebugDump(cout); -} - - -/*------------------------------------------------------- - * - * @update gess 3/27/98 - * @param - * @return - *------------------------------------------------------*/ -NS_BASE int fputs(const nsString& aString, FILE* out) -{ - char buf[100]; - char* cp = buf; - PRInt32 len = aString.Length(); - if (len >= sizeof(buf)) { - cp = aString.ToNewCString(); - } else { - aString.ToCString(cp, len + 1); - } - ::fwrite(cp, 1, len, out); - if (cp != buf) { - delete cp; - } - return (int) len; -} - diff --git a/mozilla/string/obsolete/nsString.h b/mozilla/string/obsolete/nsString.h deleted file mode 100644 index 03501ed6fa9..00000000000 --- a/mozilla/string/obsolete/nsString.h +++ /dev/null @@ -1,237 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/** - * MODULE NOTES: - * LAST MODS: gess 28Feb98 - * - * This very simple string class that knows how to do - * efficient (dynamic) resizing. It offers almost no - * i18n support, and will undoubtedly have to be replaced. - * - */ - -#ifndef _NSSTRING -#define _NSSTRING - - -#include "prtypes.h" -#include "nscore.h" -#include "nsIAtom.h" -#include -#include - - -class NS_BASE nsString { - public: - - nsString(const char* anISOLatin1=""); - nsString(const nsString&); - nsString(const PRUnichar* aUnicode); - protected: - nsString(PRBool aSubclassBuffer); // special subclas constructor - public: - virtual ~nsString(); - - PRInt32 Length() const { return mLength; } - - void SetLength(PRInt32 aLength); - void Truncate(PRInt32 anIndex=0); - virtual void EnsureCapacityFor(PRInt32 aNewLength); - - ///accessor methods - //@{ - PRUnichar* GetUnicode(void) const; - operator PRUnichar*() const; - -#if 0 - // This is NOT allowed because it has to do a malloc to - // create the iso-latin-1 version of the unicode string - operator char*() const; -#endif - - PRUnichar* operator()() const; - PRUnichar operator()(PRInt32 i) const; - PRUnichar& operator[](PRInt32 i) const; - PRUnichar& CharAt(PRInt32 anIndex) const; - PRUnichar& First() const; - PRUnichar& Last() const; - - //string creation methods... - nsString operator+(const nsString& aString); - nsString operator+(const char* anISOLatin1); - nsString operator+(char aChar); - nsString operator+(const PRUnichar* aBuffer); - nsString operator+(PRUnichar aChar); - - void ToLowerCase(); - void ToLowerCase(nsString& aString) const; - void ToUpperCase(); - void ToUpperCase(nsString& aString) const; - - nsString* ToNewString() const; - char* ToNewCString() const; - - char* ToCString(char* aBuf,PRInt32 aBufLength) const; - void ToString(nsString& aString) const; - - PRUnichar* ToNewUnicode() const; - float ToFloat(PRInt32* aErrorCode) const; - PRInt32 ToInteger(PRInt32* aErrorCode) const; - //@} - - ///string manipulation methods... - //@{ - nsString& operator=(const nsString& aString); - nsString& operator=(const char* anISOLatin1); - nsString& operator=(char aChar); - nsString& operator=(const PRUnichar* aBuffer); - nsString& operator=(PRUnichar aChar); - nsString& SetString(const PRUnichar* aStr,PRInt32 aLength=-1); - nsString& SetString(const char* anISOLatin1,PRInt32 aLength=-1); - - nsString& operator+=(const nsString& aString); - nsString& operator+=(const char* anISOLatin1); - nsString& operator+=(const PRUnichar* aBuffer); - nsString& operator+=(PRUnichar aChar); - nsString& Append(const nsString& aString,PRInt32 aLength=-1); - nsString& Append(const char* anISOLatin1,PRInt32 aLength=-1); - nsString& Append(char aChar); - nsString& Append(const PRUnichar* aBuffer,PRInt32 aLength=-1); - nsString& Append(PRUnichar aChar); - nsString& Append(PRInt32 aInteger,PRInt32 aRadix); //radix=8,10 or 16 - nsString& Append(float aFloat); - - PRInt32 Left(nsString& aCopy,PRInt32 aCount); - PRInt32 Mid(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount); - PRInt32 Right(nsString& aCopy,PRInt32 aCount); - PRInt32 Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount=-1); - PRInt32 Insert(PRUnichar aChar,PRInt32 anOffset); - - nsString& Cut(PRInt32 anOffset,PRInt32 aCount); - nsString& StripChars(const char* aSet); - nsString& StripWhitespace(); - nsString& Trim( const char* aSet, - PRBool aEliminateLeading=PR_TRUE, - PRBool aEliminateTrailing=PR_TRUE); - nsString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE, - PRBool aEliminateTrailing=PR_TRUE); - static PRBool IsSpace(PRUnichar ch); - static PRBool IsAlpha(PRUnichar ch); - //@} - - ///searching methods... - //@{ - PRInt32 Find(const char* anISOLatin1) const; - PRInt32 Find(const PRUnichar* aString) const; - PRInt32 Find(PRUnichar aChar,PRInt32 offset=0) const; - PRInt32 Find(const nsString& aString) const; - PRInt32 FindFirstCharInSet(const char* anISOLatin1Set,PRInt32 offset=0) const; - PRInt32 FindFirstCharInSet(nsString& aString,PRInt32 offset=0) const; - PRInt32 FindLastCharInSet(const char* anISOLatin1Set,PRInt32 offset=0) const; - PRInt32 FindLastCharInSet(nsString& aString,PRInt32 offset=0) const; - PRInt32 RFind(const char* anISOLatin1,PRBool aIgnoreCase=PR_FALSE) const; - PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE) const; - PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE) const; - PRInt32 RFind(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE) const; - //@} - - ///comparision methods... - //@{ - virtual PRInt32 Compare(const nsString &S,PRBool aIgnoreCase=PR_FALSE) const; - virtual PRInt32 Compare(const char *anISOLatin1,PRBool aIgnoreCase=PR_FALSE) const; - virtual PRInt32 Compare(const PRUnichar *aString,PRBool aIgnoreCase=PR_FALSE) const; - - PRInt32 operator==(const nsString &S) const; - PRInt32 operator==(const char *anISOLatin1) const; - PRInt32 operator==(const PRUnichar* aString) const; - PRInt32 operator!=(const nsString &S) const; - PRInt32 operator!=(const char *anISOLatin1) const; - PRInt32 operator!=(const PRUnichar* aString) const; - PRInt32 operator<(const nsString &S) const; - PRInt32 operator<(const char *anISOLatin1) const; - PRInt32 operator<(const PRUnichar* aString) const; - PRInt32 operator>(const nsString &S) const; - PRInt32 operator>(const char *anISOLatin1) const; - PRInt32 operator>(const PRUnichar* aString) const; - PRInt32 operator<=(const nsString &S) const; - PRInt32 operator<=(const char *anISOLatin1) const; - PRInt32 operator<=(const PRUnichar* aString) const; - PRInt32 operator>=(const nsString &S) const; - PRInt32 operator>=(const char *anISOLatin1) const; - PRInt32 operator>=(const PRUnichar* aString) const; - - PRBool Equals(const nsString& aString) const; - PRBool Equals(const char* anISOLatin1) const; - PRBool Equals(const nsIAtom *aAtom) const; - PRBool Equals(const PRUnichar* s1, const PRUnichar* s2) const; - - PRBool EqualsIgnoreCase(const nsString& aString) const; - PRBool EqualsIgnoreCase(const char* anISOLatin1) const; - PRBool EqualsIgnoreCase(const nsIAtom *aAtom) const; - PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; - //@} - - static void SelfTest(); - virtual void DebugDump(ostream& aStream) const; - - protected: - -typedef PRUnichar chartype; - - chartype* mStr; - PRInt32 mLength; - PRInt32 mCapacity; - static PRInt32 mInstanceCount; -}; - -extern NS_BASE int fputs(const nsString& aString, FILE* out); - -//---------------------------------------------------------------------- - -/** - * A version of nsString which is designed to be used as an automatic - * variable. It attempts to operate out of a fixed size internal - * buffer until too much data is added; then a dynamic buffer is - * allocated and grown as necessary. - */ -// XXX template this with a parameter for the size of the buffer? -class NS_BASE nsAutoString : public nsString { -public: - nsAutoString(); - nsAutoString(const nsString& other); - nsAutoString(const nsAutoString& other); - nsAutoString(PRUnichar aChar); - nsAutoString(const char* isolatin1); - nsAutoString(const PRUnichar* us, PRInt32 uslen = -1); - virtual ~nsAutoString(); - - static void SelfTest(); - -protected: - virtual void EnsureCapacityFor(PRInt32 aNewLength); - - PRUnichar mBuf[32]; - -private: - // XXX these need writing I suppose - nsAutoString& operator=(const nsAutoString& other); -}; - -#endif - diff --git a/mozilla/view/Makefile b/mozilla/view/Makefile deleted file mode 100644 index 4d3b4d1d871..00000000000 --- a/mozilla/view/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = .. - -include $(DEPTH)/config/config.mk - -DIRS = public src - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/view/makefile.win b/mozilla/view/makefile.win deleted file mode 100644 index f1e7ad71a77..00000000000 --- a/mozilla/view/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=.. -IGNORE_MANIFEST=1 - -DIRS=public src - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/view/public/Makefile b/mozilla/view/public/Makefile deleted file mode 100644 index 1392e07964a..00000000000 --- a/mozilla/view/public/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../.. - -DEFINES = -D_IMPL_NS_UI - -EXPORTS = \ - nsIView.h \ - nsIViewManager.h \ - nsIScrollableView.h \ - nsViewsCID.h \ - $(NULL) - -MODULE = raptor - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/view/public/makefile.win b/mozilla/view/public/makefile.win deleted file mode 100644 index 0e95c6a478f..00000000000 --- a/mozilla/view/public/makefile.win +++ /dev/null @@ -1,26 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DEFINES=-D_IMPL_NS_UI -EXPORTS=nsIView.h nsIViewManager.h nsIScrollableView.h nsViewsCID.h -MODULE=raptor - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/view/public/nsIScrollableView.h b/mozilla/view/public/nsIScrollableView.h deleted file mode 100644 index d7ea8e9200e..00000000000 --- a/mozilla/view/public/nsIScrollableView.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIScrollableView_h___ -#define nsIScrollableView_h___ - -#include "nsISupports.h" - -// IID for the nsIView interface -#define NS_ISCROLLABLEVIEW_IID \ -{ 0xc95f1830, 0xc376, 0x11d1, \ -{ 0xb7, 0x21, 0x0, 0x60, 0x8, 0x91, 0xd8, 0xc9 } } - -class nsIScrollableView : public nsISupports -{ -public: - /** - * Compute the size of the scrolled contanier. - */ - virtual void ComputeContainerSize(void) = 0; - - /** - * Get the height of the container - * @result height of container - */ - virtual PRInt32 GetContainerSize(void) = 0; - - /** - * Set the offset into the container of the - * topmost visible coordinate - * @param aOffset offset in twips - */ - virtual void SetVisibleOffset(PRInt32 aOffset) = 0; - - /** - * Get the offset of the topmost visible coordinate - * @result coordinate in twips - */ - virtual PRInt32 GetVisibleOffset(void) = 0; - - /** - * Get the view that we are scrolling within the - * scrolling view. - * @result child view - */ - virtual nsIView * GetScrolledView(void) = 0; -}; - -#endif diff --git a/mozilla/view/public/nsIView.h b/mozilla/view/public/nsIView.h deleted file mode 100644 index a6aee15dcac..00000000000 --- a/mozilla/view/public/nsIView.h +++ /dev/null @@ -1,378 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIView_h___ -#define nsIView_h___ - -#include -#include "nsISupports.h" -#include "nsCoord.h" -#include "nsIWidget.h" -#include "nsGUIEvent.h" - -class nsIViewManager; -class nsRegion; -class nsIRenderingContext; -class nsTransform2D; -class nsIFrame; -struct nsRect; - -//this is used by the view clipping APIs since the description of -//a clip rect is different than a rect - -typedef struct -{ - nscoord mLeft; - nscoord mRight; - nscoord mTop; - nscoord mBottom; -} nsViewClip; - -// Enumerated type to indicate the visibility of a layer. -// hide - the layer is not shown. -// show - the layer is shown irrespective of the visibility of -// the layer's parent. -// inherit - the layer inherits its visibility from its parent. -typedef enum -{ - nsViewVisibility_kHide = 0, - nsViewVisibility_kShow = 1, - nsViewVisibility_kInherit = 2 -} nsViewVisibility; - -// IID for the nsIView interface -#define NS_IVIEW_IID \ -{ 0xf0a21c40, 0xa7e1, 0x11d1, \ -{ 0xa8, 0x24, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } } - -//---------------------------------------------------------------------- - -// View interface - -// Note that nsIView does not support reference counting; view object -// have their lifetime bound to the view manager that contains them. -class nsIView : public nsISupports -{ -public: - /** - * Initialize the view - * @param aManager view manager that "owns" the view - * @param aBounds initial bounds for view - * @param aParent parent view - * @param aWindowIID IID for Widget type that this view - * should have associated with it. if nsull, then no - * width will be created for this view - * @param aWidgetInitData data used to initialize this view's widget before - * its create is called. - * @param aNative native window that will be used as parent of - * aWindowIID. if nsnull, then parent will be derived from - * parent view and it's ancestors - * @param aZIndex initial z depth of view - * @param aCilpRect initial clip rect of view - * @param aOpacity initial opacity of view - * @param aVisibilityFlag initial visibility state of view - * @result The result of the initialization, NS_OK if no errors - */ - virtual nsresult Init(nsIViewManager* aManager, - const nsRect &aBounds, - nsIView *aParent, - const nsIID *aWindowIID = nsnull, - void *aWidgetInitData = nsnull, - nsNativeWindow aNative = nsnull, - PRInt32 aZIndex = 0, - const nsViewClip *aClip = nsnull, - float aOpacity = 1.0f, - nsViewVisibility aVisibilityFlag = nsViewVisibility_kShow) = 0; - - /** - * Destroy the view - */ - virtual void Destroy() = 0; - - /** - * Get the view manager the "owns" the view - * @result view manager - */ - virtual nsIViewManager * GetViewManager() = 0; - - /** - * In 4.0, the "cutout" nature of a view is queryable. - * If we believe that all cutout view have a native widget, this - * could be a replacement. - * @result widget that this view contains - */ - virtual nsIWidget * GetWidget() = 0; - - /** - * Called to indicate that the specified rect of the view - * needs to be drawn via the rendering context. The rect - * is specified in view coordinates. - * @param rc rendering context to paint into - * @param rect damage area - * @param aPaintFlags see nsIView.h for flag definitions - */ - virtual void Paint(nsIRenderingContext& rc, const nsRect& rect, PRUint32 aPaintFlags) = 0; - - /** - * Called to indicate that the specified region of the view - * needs to be drawn via the rendering context. The region - * is specified in view coordinates. - * @param rc rendering context to paint into - * @param region damage area - * @param aPaintFlags see nsIView.h for flag definitions - */ - virtual void Paint(nsIRenderingContext& rc, const nsRegion& region, PRUint32 aPaintFlags) = 0; - - /** - * Called to indicate that the specified event should be handled - * by the view. This method should return nsEventStatus_eConsumeDoDefault - * or nsEventStatus_eConsumeNoDefault if the event has been handled. - * @param event event to process - * @param aEventFlags see nsIView.h for flag definitions - * @result processing status - */ - virtual nsEventStatus HandleEvent(nsGUIEvent *event, PRUint32 aEventFlags) = 0; - - /** - * Called to indicate that the position of the view has been changed. - * The specified coordinates are in the parent view's coordinate space. - * @param x new x position - * @param y new y position - */ - virtual void SetPosition(nscoord x, nscoord y) = 0; - - /** - * Called to get the position of a view. - * The specified coordinates are in the parent view's coordinate space. - * @param x out parameter for x position - * @param y out parameter for y position - */ - virtual void GetPosition(nscoord *x, nscoord *y) = 0; - - /** - * Called to indicate that the dimensions of the view (actually the - * width and height of the clip) have been changed. - * @param width new width - * @param height new height - */ - virtual void SetDimensions(nscoord width, nscoord height) = 0; - virtual void GetDimensions(nscoord *width, nscoord *height) = 0; - - /** - * Called to indicate that the dimensions and position of the view have - * been changed. - * @param aBounds new bounds - */ - virtual void SetBounds(const nsRect &aBounds) = 0; - - /** - * Called to indicate that the dimensions and position of the view have - * been changed. - * @param aX new x position - * @param aY new y position - * @param aWidth new width - * @param aHeight new height - */ - virtual void SetBounds(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) = 0; - - /** - * Called to get the dimensions and position of the view. - * @param aBounds out parameter for bounds - */ - virtual void GetBounds(nsRect &aBounds) = 0; - - /** - * Called to indicate that the clip of the view has been changed. - * The clip is relative to the origin of the view. - * @param aLeft new left position - * @param aTop new top position - * @param aRight new right position - * @param aBottom new bottom position - */ - virtual void SetClip(nscoord aLeft, nscoord aTop, nscoord aRight, nscoord aBottom) = 0; - - /** - * Called to get the dimensions and position of the clip for the view. - * @param aLeft left position - * @param aTop top position - * @param aRight right position - * @param aBottom bottom position - * @result PR_TRUE of there actually is a clip for the view, else PR_FALSE - */ - virtual PRBool GetClip(nscoord *aLeft, nscoord *aTop, nscoord *aRight, nscoord *aBottom) = 0; - - /** - * Called to indicate that the visibility of a view has been - * changed. - * @param visibility new visibility state - */ - virtual void SetVisibility(nsViewVisibility visibility) = 0; - - /** - * Called to query the visibility state of a view. - * @result current visibility state - */ - virtual nsViewVisibility GetVisibility() = 0; - - /** - * Called to indicate that the z-index of a view has been changed. - * The z-index is relative to all siblings of the view. - * @param zindex new z depth - */ - virtual void SetZIndex(PRInt32 zindex) = 0; - - /** - * Called to query the z-index of a view. - * The z-index is relative to all siblings of the view. - * @result current z depth - */ - virtual PRInt32 GetZIndex() = 0; - - /** - * Called to set the parent of the view. - * @param aParent new parent - */ - virtual void SetParent(nsIView *aParent) = 0; - - /** - * Called to query the parent of the view. - * @result view's parent - */ - virtual nsIView *GetParent() = 0; - - /** - * Called to query the next sibling of the view. - * @result view's next sibling - */ - virtual nsIView* GetNextSibling() const = 0; - - /** - * Called to set the next sibling of the view. - * @param aNextSibling new next sibling - */ - virtual void SetNextSibling(nsIView* aNextSibling) = 0; - - /** - * Used to insert a child after the specified sibling. In general, - * child insertion will happen through the view manager and it - * will determine the ordering of children in the child list. - * @param child to insert in this view's child list - * @param sibling view to set as previous sibling of child - * if nsnull, then child is inserted at head of list - */ - virtual void InsertChild(nsIView *child, nsIView *sibling) = 0; - - /** - * Remove a child from the child list. The removal will be driven - * through the view manager. - * @param child to remove - */ - virtual void RemoveChild(nsIView *child) = 0; - - /** - * Get the number of children for this view. - * @result child count - */ - virtual PRInt32 GetChildCount() = 0; - - /** - * Get a child at a specific index. Could be replaced by some sort of - * enumeration API. - * @param index of desired child view - * @result the view at index or nsnull if there is no such child - */ - virtual nsIView * GetChild(PRInt32 index) = 0; - - /** - * Note: This didn't exist in 4.0. This transform might include scaling - * but probably not rotation for the first pass. - * @param transform new transformation of view - */ - virtual void SetTransform(nsTransform2D &aXForm) = 0; - - /** - * Note: This didn't exist in 4.0. This transform might include scaling - * but probably not rotation for the first pass. - * @result view's transformation - */ - virtual void GetTransform(nsTransform2D &aXForm) = 0; - - /** - * Note: This didn't exist in 4.0. Called to set the opacity of a view. - * A value of 0.0 means completely transparent. A value of 1.0 means - * completely opaque. - * @param opacity new opacity value - */ - virtual void SetOpacity(float opacity) = 0; - - /** - * Note: This didn't exist in 4.0. Called to set the opacity of a view. - * A value of 0.0 means completely transparent. A value of 1.0 means - * completely opaque. - * @result view's opacity value - */ - virtual float GetOpacity() = 0; - - /** - * Used to ask a view if it has any areas within its bounding box - * that are transparent. This is not the same as opacity - opacity can - * be set externally, transparency is a quality of the view itself. - * @result Returns PR_TRUE if there are transparent areas, PR_FALSE otherwise. - */ - virtual PRBool HasTransparency() = 0; - - /** - * Set the view's link to the nsIFrame part of the universe. - * @param aFrame frame to associate with view. nsnull to disassociate - */ - virtual void SetFrame(nsIFrame *aFrame) = 0; - - /** - * Query the view for it's link to the nsIFrame part of the universe. - * @result frame associated with view or nsnull if there is none. - */ - virtual nsIFrame * GetFrame() = 0; - - /** - * Move child widgets around by (dx, dy). deltas are in widget - * coordinate space. - * @param aDx x delta - * @param aDy y delta - */ - virtual void AdjustChildWidgets(nscoord aDx, nscoord aDy) = 0; - - /** - * Output debug info to FILE - * @param out output file handle - * @param aIndent indentation depth - */ - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; -}; - -//this is passed down to child views during painting and event handling -//so that a child can determine if it is hidden or shown when it's -//visibility state is set to inherit -#define NS_VIEW_FLAG_PARENT_HIDDEN 0x0001 - -//during event propagation, see if parent views can handle the event -#define NS_VIEW_FLAG_CHECK_PARENT 0x0002 - -//during event propagation, see if child views can handle the event -#define NS_VIEW_FLAG_CHECK_CHILDREN 0x0004 - -#endif diff --git a/mozilla/view/public/nsIViewManager.h b/mozilla/view/public/nsIViewManager.h deleted file mode 100644 index dd028cfacb0..00000000000 --- a/mozilla/view/public/nsIViewManager.h +++ /dev/null @@ -1,350 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIViewManager_h___ -#define nsIViewManager_h___ - -#include "nscore.h" -#include "nsISupports.h" -#include "nsCoord.h" -#include "nsIView.h" -class nsRegion; -class nsIEvent; -class nsIPresContext; -class nsIView; -class nsIWidget; -struct nsRect; - -#define NS_IVIEWMANAGER_IID \ -{ 0x3a8863d0, 0xa7f3, 0x11d1, \ - { 0xa8, 0x24, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } } - -class nsIViewManager : public nsISupports -{ -public: - /** - * Initialize the ViewManager - * Note: this instance does not hold a reference to the presentation - * context because it holds a reference to this instance. - * @param aPresContext the presentation context to use. - * @result The result of the initialization, NS_OK if no errors - */ - virtual nsresult Init(nsIPresContext* aPresContext) = 0; - - /** - * Set the window for which the manager is responsible. - * @param aRootWindow window to set as root - */ - virtual void SetRootWindow(nsIWidget *aRootWindow) = 0; - - /** - * Get the window for which the manager is responsible. - * @result the root window - */ - virtual nsIWidget *GetRootWindow() = 0; - - /** - * Get the root of the view tree. - * @result the root view - */ - virtual nsIView *GetRootView() = 0; - - /** - * Set the root of the view tree. - * @param aView view to set as root - */ - virtual void SetRootView(nsIView *aView) = 0; - - /** - * Get the current framerate i.e. the rate at which timed - * refreshes occur. A framerate of 0 indicates that timed refreshes - * should not occur. framerate is in terms of frames per second - * @result the update rate in terms of frames per second - */ - virtual PRUint32 GetFrameRate() = 0; - - /** - * Set the current framerate. - * @param frameRate new update rate. see GetFrameRate for more info - * @result the call may need to create a timer and the success - * status will be returned. NS_OK means all is well - */ - virtual nsresult SetFrameRate(PRUint32 frameRate) = 0; - - /** - * Get the dimensions of the root window. The dimensions are in - * twips - * @param width out parameter for width of window in twips - * @param height out parameter for height of window in twips - */ - virtual void GetWindowDimensions(nscoord *width, nscoord *height) = 0; - - /** - * Set the dimensions of the root window. - * Called if the root window is resized. The dimensions are in - * twips - * @param width of window in twips - * @param height of window in twips - */ - virtual void SetWindowDimensions(nscoord width, nscoord height) = 0; - - /** - * Get the position of the root window relative to the - * composited area. This indicates the scrolled position of the - * root window. - * @param xoffset out parameter for X scroll position of window in twips - * @param yoffset out parameter for Y scroll position of window in twips - */ - virtual void GetWindowOffsets(nscoord *xoffset, nscoord *yoffset) = 0; - - /** - * Set the position of the root window relative to the - * composited area. This indicates the scrolled position of the - * root window. Called when the root window is scrolled. - * @param xoffset X scroll position of window in twips - * @param yoffset Y scroll position of window in twips - */ - virtual void SetWindowOffsets(nscoord xoffset, nscoord yoffset) = 0; - - /** - * Called to refresh an area of the root window. Often called in - * response to a paint/redraw event from the native windowing system. - * @param aContext rendering context to draw into - * @param region nsIRegion to be updated - * @param aUpdateFlags see bottom of nsIViewManager.h for description - */ - virtual void Refresh(nsIRenderingContext *aContext, nsRegion *region, - PRUint32 aUpdateFlags) = 0; - - /** - * Called to refresh an area of the root window. Often called in - * response to a paint/redraw event from the native windowing system. - * @param aView view to paint. should be root view - * @param aContext rendering context to draw into - * @param rect nsRect to be updated - * @param aUpdateFlags see bottom of nsIViewManager.h for description - */ - virtual void Refresh(nsIView* aView, nsIRenderingContext *aContext, - nsRect *rect, PRUint32 aUpdateFlags) = 0; - - /** - * Called to force a redrawing of any dirty areas. - */ - virtual void Composite() = 0; - - /** - * Called to inform the view manager that some portion of a view - * is dirty and needs to be redrawn. The region passed in - * should be in the view's coordinate space. - * @param aView view to paint. should be root view - * @param region region to mark as damaged, if nsnull, then entire - * view is marked as damaged - * @param aUpdateFlags see bottom of nsIViewManager.h for description - */ - virtual void UpdateView(nsIView *aView, nsRegion *aRegion, - PRUint32 aUpdateFlags) = 0; - - /** - * Called to inform the view manager that some portion of a view - * is dirty and needs to be redrawn. The rect passed in - * should be in the view's coordinate space. - * @param aView view to paint. should be root view - * @param rect rect to mark as damaged - * @param aUpdateFlags see bottom of nsIViewManager.h for description - */ - virtual void UpdateView(nsIView *aView, nsRect &aRect, PRUint32 aUpdateFlags) = 0; - - /** - * Called to dispatch an event to the appropriate view. Often called - * as a result of receiving a mouse or keyboard event from the widget - * event system. - * @param event event to dispatch - * @result event handling status - */ - virtual PRBool DispatchEvent(nsIEvent *event) = 0; - - /** - * Used to grab/capture all mouse events for a specific view, - * irrespective of the cursor position at which the - * event occurred. - * @param aView view to capture mouse events - * @result event handling status - */ - virtual PRBool GrabMouseEvents(nsIView *aView) = 0; - - /** - * Used to grab/capture all keyboard events for a specific view, - * irrespective of the cursor position at which the - * event occurred. - * @param aView view to capture keyboard events - * @result event handling status - */ - virtual PRBool GrabKeyEvents(nsIView *aView) = 0; - - /** - * Get the current view, if any, that's capturing mouse events. - * @result view that is capturing mouse events or nsnull - */ - virtual nsIView* GetMouseEventGrabber() = 0; - - /** - * Get the current view, if any, that's capturing keyboard events. - * @result view that is capturing keyboard events or nsnull - */ - virtual nsIView* GetKeyEventGrabber() = 0; - - /** - * Given a parent view, insert another view as its child. If above - * is PR_TRUE, the view is inserted above (in z-order) the sibling. If - * it is PR_FALSE, the view is inserted below. - * The view manager generates the appopriate dirty regions. - * @param parent parent view - * @param child child view - * @param sibling sibling view - * @param above boolean above or below state - */ - virtual void InsertChild(nsIView *parent, nsIView *child, nsIView *sibling, - PRBool above) = 0; - - /** - * Given a parent view, insert another view as its child. The zindex - * indicates where the child should be inserted relative to other - * children of the parent. - * The view manager generates the appopriate dirty regions. - * @param parent parent view - * @param child child view - * @param zindex z depth of child - */ - virtual void InsertChild(nsIView *parent, nsIView *child, - PRInt32 zindex) = 0; - - /** - * Remove a specific child of a view. - * The view manager generates the appopriate dirty regions. - * @param parent parent view - * @param child child view - */ - virtual void RemoveChild(nsIView *parent, nsIView *child) = 0; - - /** - * Move a view's position by the specified amount. - * The view manager generates the appopriate dirty regions. - * @param aView view to move - * @param x x offset to add to current view position - * @param y y offset to add to current view position - */ - virtual void MoveViewBy(nsIView *aView, nscoord x, nscoord y) = 0; - - /** - * Move a view to the specified position, - * provided in parent coordinates. - * The view manager generates the appopriate dirty regions. - * @param aView view to move - * @param x x value for new view position - * @param y y value for new view position - */ - virtual void MoveViewTo(nsIView *aView, nscoord x, nscoord y) = 0; - - /** - * Resize a view to the specified width and height. - * The view manager generates the appopriate dirty regions. - * @param aView view to move - * @param width new view width - * @param height new view height - */ - virtual void ResizeView(nsIView *aView, nscoord width, nscoord height) = 0; - - /** - * Set the clip of a view. - * The view manager generates the appopriate dirty regions. - * @param aView view to to clip rect on - * @param rect new clipping rect for view - */ - virtual void SetViewClip(nsIView *aView, nsRect *rect) = 0; - - /** - * Set the visibility of a view. - * The view manager generates the appopriate dirty regions. - * @param aView view to change visibility state of - * @param visible new visibility state - */ - virtual void SetViewVisibility(nsIView *aView, nsViewVisibility visible) = 0; - - /** - * Set the z-index of a view. Positive z-indices mean that a view - * is above its parent in z-order. Negative z-indices mean that a - * view is below its parent. - * The view manager generates the appopriate dirty regions. - * @param aView view to change z depth of - * @param zindex new z depth - */ - virtual void SetViewZindex(nsIView *aView, PRInt32 zindex) = 0; - - /** - * Used to move a view above another in z-order. - * The view manager generates the appopriate dirty regions. - * @param aView view to change z depth of - * @param other view to move aView above - */ - virtual void MoveViewAbove(nsIView *aView, nsIView *other) = 0; - - /** - * Used to move a view below another in z-order. - * The view manager generates the appopriate dirty regions. - * @param aView view to change z depth of - * @param other view to move aView below - */ - virtual void MoveViewBelow(nsIView *aView, nsIView *other) = 0; - - /** - * Returns whether a view is actually shown (based on its visibility - * and that of its ancestors). - * @param aView view to query visibilty of - * @result PR_TRUE if visible, else PR_FALSE - */ - virtual PRBool IsViewShown(nsIView *aView) = 0; - - /** - * Returns the clipping area of a view in absolute coordinates. - * @param aView view to query clip rect of - * @param rect to set with view's clipping rect - * @result PR_TRUE if there is a clip rect, else PR_FALSE - */ - virtual PRBool GetViewClipAbsolute(nsIView *aView, nsRect *rect) = 0; - - /** - * Get the presentation context associated with this manager - * @result presentation context - */ - virtual nsIPresContext* GetPresContext() = 0; - - /** - * Set the area that the view manager considers to be "dirty" - * to an empty state - */ - virtual void ClearDirtyRegion() = 0; -}; - -//when the refresh happens, should it be double buffered? -#define NS_VMREFRESH_DOUBLE_BUFFER 0x0001 -//is the damagerect in top-level window space? -#define NS_VMREFRESH_SCREEN_RECT 0x0002 -//update view now? -#define NS_VMREFRESH_IMMEDIATE 0x0004 - -#endif // nsIViewManager_h___ diff --git a/mozilla/view/public/nsViewsCID.h b/mozilla/view/public/nsViewsCID.h deleted file mode 100644 index d557944b22b..00000000000 --- a/mozilla/view/public/nsViewsCID.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsViewsCID_h__ -#define nsViewsCID_h__ - -#include "nsISupports.h" -#include "nsIFactory.h" -#include "nsRepository.h" - -#define NS_VIEW_MANAGER_CID \ -{ 0xc95f1831, 0xc376, 0x11d1, \ - {0xb7, 0x21, 0x0, 0x60, 0x8, 0x91, 0xd8, 0xc9}} - -#define NS_VIEW_CID \ -{ 0xc95f1832, 0xc376, 0x11d1, \ - {0xb7, 0x21, 0x0, 0x60, 0x8, 0x91, 0xd8, 0xc9}} - -#define NS_SCROLLING_VIEW_CID \ -{ 0xc95f1833, 0xc376, 0x11d1, \ - {0xb7, 0x21, 0x0, 0x60, 0x8, 0x91, 0xd8, 0xc9}} - -#endif // nsViewsCID_h__ diff --git a/mozilla/view/src/Makefile b/mozilla/view/src/Makefile deleted file mode 100644 index 2fd4b5a8504..00000000000 --- a/mozilla/view/src/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -include $(DEPTH)/config/config.mk - -MODULE=raptor - -LIBRARY_NAME=raptorview - -CPPSRCS = \ - nsView.cpp \ - nsScrollingView.cpp \ - nsViewManager.cpp \ - nsViewFactory.cpp \ - $(NULL) - -REQUIRES = raptor xpcom - -LCFLAGS = -D_IMPL_NS_VIEW - -TARGETS = $(LIBRARY) - -include $(DEPTH)/config/rules.mk - - diff --git a/mozilla/view/src/makefile.win b/mozilla/view/src/makefile.win deleted file mode 100644 index 079b68da30b..00000000000 --- a/mozilla/view/src/makefile.win +++ /dev/null @@ -1,60 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = DLL -DLLNAME = raptorview -DLL=.\$(OBJDIR)\$(DLLNAME).dll -MISCDEP = $(LLIBS) - -MODULE=raptor - -DEFINES =-D_IMPL_NS_VIEW -DWIN32_LEAN_AND_MEAN - -OBJS = \ - .\$(OBJDIR)\nsView.obj \ - .\$(OBJDIR)\nsScrollingView.obj \ - .\$(OBJDIR)\nsViewManager.obj \ - .\$(OBJDIR)\nsViewFactory.obj \ - $(NULL) - -LINCS= \ - -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\xpcom \ - $(NULL) - - -LCFLAGS = \ - $(LCFLAGS) \ - -D_IMPL_NS_VIEW \ - $(NULL) - -LLIBS= \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(LIBNSPR) - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\$(DLLNAME).dll diff --git a/mozilla/view/src/nsScrollingView.cpp b/mozilla/view/src/nsScrollingView.cpp deleted file mode 100644 index 1858f229ac1..00000000000 --- a/mozilla/view/src/nsScrollingView.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsScrollingView.h" -#include "nsIWidget.h" -#include "nsUnitConversion.h" -#include "nsIViewManager.h" -#include "nsIPresContext.h" -#include "nsIScrollbar.h" -#include "nsIDeviceContext.h" -#include "nsGUIEvent.h" -#include "nsWidgetsCID.h" -#include "nsViewsCID.h" -#include "nsIScrollableView.h" - -class ScrollBarView : public nsView -{ -public: - ScrollBarView(); - ~ScrollBarView(); - void SetPosition(nscoord x, nscoord y); - void SetDimensions(nscoord width, nscoord height); -}; - -ScrollBarView :: ScrollBarView() -{ -} - -ScrollBarView :: ~ScrollBarView() -{ -} - -void ScrollBarView :: SetPosition(nscoord x, nscoord y) -{ - mBounds.MoveTo(x, y); - - if (nsnull != mWindow) - { - nsIPresContext *px = mViewManager->GetPresContext(); - float scale = px->GetTwipsToPixels(); - - mWindow->Move(NS_TO_INT_ROUND(x * scale), NS_TO_INT_ROUND(y * scale)); - - NS_RELEASE(px); - } -} - -void ScrollBarView :: SetDimensions(nscoord width, nscoord height) -{ - mBounds.SizeTo(width, height); - - if (nsnull != mWindow) - { - nsIPresContext *px = mViewManager->GetPresContext(); - float t2p = px->GetTwipsToPixels(); - - mWindow->Resize(NS_TO_INT_ROUND(t2p * width), NS_TO_INT_ROUND(t2p * height)); - - NS_RELEASE(px); - } -} - -static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - -nsScrollingView :: nsScrollingView() -{ -} - -nsScrollingView :: ~nsScrollingView() -{ -} - -nsresult nsScrollingView :: QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (nsnull == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - - static NS_DEFINE_IID(kClassIID, NS_ISCROLLABLEVIEW_IID); - - if (aIID.Equals(kClassIID)) { - *aInstancePtr = (void*)(nsIScrollableView*)this; - AddRef(); - return NS_OK; - } - - return nsView::QueryInterface(aIID, aInstancePtr); -} - -nsrefcnt nsScrollingView :: AddRef() -{ - return nsView::AddRef(); -} - -nsrefcnt nsScrollingView :: Release() -{ - return nsView::Release(); -} - -nsresult nsScrollingView :: Init(nsIViewManager* aManager, - const nsRect &aBounds, - nsIView *aParent, - const nsIID *aWindowIID, - void *aWidgetInitData, - nsNativeWindow aNative, - PRInt32 aZIndex, - const nsViewClip *aClip, - float aOpacity, - nsViewVisibility aVisibilityFlag) -{ - nsresult rv; - - rv = nsView :: Init(aManager, aBounds, aParent, aWindowIID, aWidgetInitData, aNative, aZIndex, aClip, aOpacity, aVisibilityFlag); - - if (rv == NS_OK) - { - nsIPresContext *cx = mViewManager->GetPresContext(); - nsIDeviceContext *dx = cx->GetDeviceContext(); - - // Create a view - - mScrollBarView = new ScrollBarView(); - - NS_IF_ADDREF(mScrollBarView); - - if (nsnull != mScrollBarView) - { - nsRect trect = aBounds; - - trect.width = NS_TO_INT_ROUND(dx->GetScrollBarWidth()); - trect.x = aBounds.XMost() - trect.width; - - static NS_DEFINE_IID(kCScrollbarIID, NS_VERTSCROLLBAR_CID); - - rv = mScrollBarView->Init(mViewManager, trect, this, &kCScrollbarIID); - - mViewManager->InsertChild(this, mScrollBarView, 0); - } - - NS_RELEASE(dx); - NS_RELEASE(cx); - } - - return rv; -} - -void nsScrollingView :: SetDimensions(nscoord width, nscoord height) -{ - nsRect trect; - nsIPresContext *cx; - nsIDeviceContext *dx; - - nsView :: SetDimensions(width, height); - - if (nsnull != mScrollBarView) - { - cx = mViewManager->GetPresContext(); - dx = cx->GetDeviceContext(); - - mScrollBarView->GetDimensions(&trect.width, &trect.height); - - trect.height = height; - trect.x = width - NS_TO_INT_ROUND(dx->GetScrollBarWidth()); - trect.y = 0; - - mScrollBarView->SetBounds(trect); - - //this will fix the size of the thumb when we resize the root window, - //but unfortunately it will also cause scrollbar flashing. so long as - //all resize operations happen through the viewmanager, this is not - //an issue. we'll see. MMP -// ComputeContainerSize(); - - NS_RELEASE(dx); - NS_RELEASE(cx); - } -} - -nsEventStatus nsScrollingView :: HandleEvent(nsGUIEvent *aEvent, PRUint32 aEventFlags) -{ - nsEventStatus retval = nsEventStatus_eIgnore; - - switch (aEvent->message) - { - case NS_SCROLLBAR_POS: - case NS_SCROLLBAR_PAGE_NEXT: - case NS_SCROLLBAR_PAGE_PREV: - case NS_SCROLLBAR_LINE_NEXT: - case NS_SCROLLBAR_LINE_PREV: - { - nscoord ox, oy, ny; - nsIPresContext *px = mViewManager->GetPresContext(); - nscoord dy; - float scale = px->GetTwipsToPixels(); - - mViewManager->GetWindowOffsets(&ox, &oy); - - //now, this horrible thing makes sure that as we scroll - //the document a pixel at a time, we keep the logical position of - //our scroll bar at the top edge of the same pixel that - //is displayed. - - ny = NS_TO_INT_ROUND(NS_TO_INT_ROUND(((nsScrollbarEvent *)aEvent)->position * scale) * px->GetPixelsToTwips()); - - mViewManager->SetWindowOffsets(ox, ny); - - dy = NS_TO_INT_ROUND(scale * (oy - ny)); - - if (dy != 0) - { - nsRect clip; - nscoord sx, sy; - - mScrollBarView->GetDimensions(&sx, &sy); - - clip.x = 0; - clip.y = 0; - clip.width = NS_TO_INT_ROUND(scale * (mBounds.width - sx)); - clip.height = NS_TO_INT_ROUND(scale * mBounds.height); - - mViewManager->ClearDirtyRegion(); - mWindow->Scroll(0, dy, &clip); - - //and now we make sure that the scrollbar thumb is in sync with the - //numbers we came up with here, but only if we actually moved at least - //a full pixel. if didn't adjust the thumb only if the delta is non-zero, - //very slow scrolling would never actually work. - - ((nsScrollbarEvent *)aEvent)->position = ny; - - AdjustChildWidgets(0, dy); - } - - retval = nsEventStatus_eConsumeNoDefault; - - NS_RELEASE(px); - - break; - } - - default: - retval = nsView::HandleEvent(aEvent, aEventFlags); - break; - } - - return retval; -} - -void nsScrollingView :: ComputeContainerSize() -{ - nsIView *scrollview = GetScrolledView(); - - if (nsnull != scrollview) - { - if (nsnull != mScrollBarView) - { - nsIPresContext *px = mViewManager->GetPresContext(); - nscoord width, height; - nsIScrollbar *scroll; - nsIWidget *win; - PRUint32 oldsize = mSize; - nsRect area(0, 0, 0, 0); - PRInt32 offx, offy, dy; - float scale = px->GetTwipsToPixels(); - - ComputeScrollArea(scrollview, area, 0, 0); - - mSize = area.YMost(); - - mScrollBarView->GetDimensions(&width, &height); - mViewManager->GetWindowOffsets(&offx, &offy); - - win = mScrollBarView->GetWidget(); - - static NS_DEFINE_IID(kscroller, NS_ISCROLLBAR_IID); - - if (NS_OK == win->QueryInterface(kscroller, (void **)&scroll)) - { - if (mSize > mBounds.height) - { - //we need to be able to scroll - - mScrollBarView->SetVisibility(nsViewVisibility_kShow); - - //now update the scroller position for the new size - - PRUint32 newpos, oldpos = scroll->GetPosition(); - - newpos = NS_TO_INT_ROUND(NS_TO_INT_ROUND((((float)oldpos * mSize) / oldsize) * scale) * px->GetPixelsToTwips()); - - mViewManager->SetWindowOffsets(offx, newpos); - - dy = NS_TO_INT_ROUND(scale * (offy - newpos)); - - scroll->SetParameters(mSize, mBounds.height, newpos, NS_POINTS_TO_TWIPS_INT(12)); - - NS_RELEASE(px); - } - else - { - mViewManager->SetWindowOffsets(offx, 0); - dy = NS_TO_INT_ROUND(scale * offy); - mScrollBarView->SetVisibility(nsViewVisibility_kHide); - } - - if (dy != 0) - AdjustChildWidgets(0, dy); - - scroll->Release(); - } - - NS_RELEASE(win); - } - - NS_RELEASE(scrollview); - } -} - -PRInt32 nsScrollingView :: GetContainerSize() -{ - return mSize; -} - -void nsScrollingView :: SetVisibleOffset(PRInt32 aOffset) -{ - mOffset = aOffset; -} - -PRInt32 nsScrollingView :: GetVisibleOffset() -{ - return mOffset; -} - -void nsScrollingView :: AdjustChildWidgets(nscoord aDx, nscoord aDy) -{ - PRInt32 numkids = GetChildCount(); - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - nsIView *kid = GetChild(cnt); - - if (kid != mScrollBarView) - { - nsIWidget *win = kid->GetWidget(); - - if (nsnull != win) - { - nsRect bounds; - - win->GetBounds(bounds); - win->Move(bounds.x + aDx, bounds.y + aDy); - - NS_RELEASE(win); - } - - kid->AdjustChildWidgets(aDx, aDy); - } - } -} - -nsIView * nsScrollingView :: GetScrolledView(void) -{ - PRInt32 numkids; - nsIView *retview = nsnull; - - numkids = GetChildCount(); - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - retview = GetChild(cnt); - - if (retview != mScrollBarView) - break; - else - retview = nsnull; - } - - NS_IF_ADDREF(retview); - - return retview; -} - -void nsScrollingView :: ComputeScrollArea(nsIView *aView, nsRect &aRect, - nscoord aOffX, nscoord aOffY) -{ - nsRect trect, vrect; - - aView->GetBounds(vrect); - - aOffX += vrect.x; - aOffY += vrect.y; - - trect.x = aOffX; - trect.y = aOffY; - trect.width = vrect.width; - trect.height = vrect.height; - - if (aRect.IsEmpty() == PR_TRUE) - aRect = trect; - else - aRect.UnionRect(aRect, trect); - - PRInt32 numkids = aView->GetChildCount(); - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - nsIView *view = aView->GetChild(cnt); - ComputeScrollArea(view, aRect, aOffX, aOffY); - } -} diff --git a/mozilla/view/src/nsScrollingView.h b/mozilla/view/src/nsScrollingView.h deleted file mode 100644 index 55897f667e4..00000000000 --- a/mozilla/view/src/nsScrollingView.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsScrollingView_h___ -#define nsScrollingView_h___ - -#include "nsView.h" -#include "nsIScrollableView.h" - -//this is a class that acts as a container for other views and provides -//automatic management of scrolling of the views it contains. - -class nsScrollingView : public nsView, public nsIScrollableView -{ -public: - nsScrollingView(); - ~nsScrollingView(); - - NS_IMETHOD QueryInterface(REFNSIID aIID, - void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - virtual nsresult Init(nsIViewManager* aManager, - const nsRect &aBounds, - nsIView *aParent, - const nsIID *aWindowIID = nsnull, - void *aWidgetInitData = nsnull, - nsNativeWindow aNative = nsnull, - PRInt32 aZIndex = 0, - const nsViewClip *aClip = nsnull, - float aOpacity = 1.0f, - nsViewVisibility aVisibilityFlag = nsViewVisibility_kShow); - - //overrides - virtual void SetDimensions(nscoord width, nscoord height); - virtual nsEventStatus HandleEvent(nsGUIEvent *aEvent, PRUint32 aEventFlags); - virtual void AdjustChildWidgets(nscoord aDx, nscoord aDy); - - //nsIScrollableView interface - virtual void ComputeContainerSize(); - virtual PRInt32 GetContainerSize(); - - virtual void SetVisibleOffset(PRInt32 aOffset); - virtual PRInt32 GetVisibleOffset(); - - virtual nsIView * GetScrolledView(void); - - //private - void ComputeScrollArea(nsIView *aView, nsRect &aRect, nscoord aOffX, nscoord aOffY); - -protected: - PRInt32 mSize; - PRInt32 mOffset; - nsIView *mScrollBarView; -}; - -#endif diff --git a/mozilla/view/src/nsView.cpp b/mozilla/view/src/nsView.cpp deleted file mode 100644 index f5745111126..00000000000 --- a/mozilla/view/src/nsView.cpp +++ /dev/null @@ -1,860 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file arhandlee subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsView.h" -#include "nsIWidget.h" -#include "nsIViewManager.h" -#include "nsIFrame.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsIWidget.h" -#include "nsIButton.h" -#include "nsIScrollbar.h" -#include "nsGUIEvent.h" -#include "nsIDeviceContext.h" -#include "nsRepository.h" -#include "nsIRenderingContext.h" -#include "nsTransform2D.h" -#include "nsIScrollableView.h" - -static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - -// -// Main events handler -// -nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent) -{ - nsIView *view; - nsEventStatus result = nsEventStatus_eIgnore; - - if (NS_OK == aEvent->widget->QueryInterface(kIViewIID, (void**)&view)) - { - switch(aEvent->message) - { - case NS_SIZE: - { - nscoord width = ((nsSizeEvent*)aEvent)->windowSize->width; - nscoord height = ((nsSizeEvent*)aEvent)->windowSize->height; - - // Inform the view manager that the root window has been resized - nsIViewManager* vm = view->GetViewManager(); - nsIPresContext* presContext = vm->GetPresContext(); - - // The root view may not be set if this is the resize associated with - // window creation - - nsIView* rootView = vm->GetRootView(); - - if (view == rootView) - { - // Convert from pixels to twips - float p2t = presContext->GetPixelsToTwips(); - vm->SetWindowDimensions(NS_TO_INT_ROUND(width * p2t), - NS_TO_INT_ROUND(height * p2t)); - result = nsEventStatus_eConsumeNoDefault; - } - - NS_RELEASE(rootView); - NS_RELEASE(presContext); - NS_RELEASE(vm); - - break; - } - - case NS_PAINT: - { - nsIViewManager *vm = view->GetViewManager(); - nsIPresContext *px = vm->GetPresContext(); - float convert = px->GetPixelsToTwips(); - nsRect vrect, trect = *((nsPaintEvent*)aEvent)->rect; - nsIDeviceContext *dx = px->GetDeviceContext(); - - trect.x = NS_TO_INT_ROUND(trect.x * convert); - trect.y = NS_TO_INT_ROUND(trect.y * convert); - trect.width = NS_TO_INT_ROUND(trect.width * convert); - trect.height = NS_TO_INT_ROUND(trect.height * convert); - - //see if the paint region is greater than .75 the area of our root view. - //if so, enable double buffered painting. - - view->GetBounds(vrect); - - PRBool db = PR_FALSE; - - if ((((float)trect.width * trect.height) / ((float)vrect.width * vrect.height)) > 0.75f) - db = PR_TRUE; - - vm->Refresh(view, ((nsPaintEvent *)aEvent)->renderingContext, &trect, - ((db == PR_TRUE) ? NS_VMREFRESH_DOUBLE_BUFFER : 0) | NS_VMREFRESH_SCREEN_RECT); - - NS_RELEASE(dx); - NS_RELEASE(px); - NS_RELEASE(vm); - - result = nsEventStatus_eConsumeNoDefault; - - break; - } - - case NS_DESTROY: - result = nsEventStatus_eConsumeNoDefault; - break; - - default: - nsIViewManager *vm = view->GetViewManager(); - nsIPresContext *cx = vm->GetPresContext(); - - // pass on to view somewhere else to deal with - - aEvent->point.x = NS_TO_INT_ROUND(aEvent->point.x * cx->GetPixelsToTwips()); - aEvent->point.y = NS_TO_INT_ROUND(aEvent->point.y * cx->GetPixelsToTwips()); - - result = view->HandleEvent(aEvent, NS_VIEW_FLAG_CHECK_CHILDREN | NS_VIEW_FLAG_CHECK_PARENT); - - aEvent->point.x = NS_TO_INT_ROUND(aEvent->point.x * cx->GetTwipsToPixels()); - aEvent->point.y = NS_TO_INT_ROUND(aEvent->point.y * cx->GetTwipsToPixels()); - - NS_RELEASE(cx); - NS_RELEASE(vm); - - break; - } - - NS_RELEASE(view); - } - - return result; -} - -nsView :: nsView() -{ - mVis = nsViewVisibility_kShow; - mXForm = nsnull; -} - -nsView :: ~nsView() -{ - if (GetChildCount() > 0) - { - nsIView *kid; - - //nuke the kids - - while (kid = GetChild(0)) - kid->Destroy(); - } - - if (mXForm != nsnull) - { - delete mXForm; - mXForm = nsnull; - } - - if (nsnull != mViewManager) - { - nsIView *rootView = mViewManager->GetRootView(); - if (rootView == this) { - //This code should never be reached since there is a circular ref between nsView and nsViewManager\n"); - mViewManager->SetRootView(nsnull); // this resets our ref count to 0 - } - else - { - if (nsnull != mParent) { - mViewManager->RemoveChild(mParent, this); - } - NS_RELEASE(rootView); - } - NS_RELEASE(mViewManager); - mViewManager = nsnull; - } - if (nsnull != mFrame) { - // Temporarily raise our refcnt because the frame is going to - // Release us. - mRefCnt = 99; - mFrame->SetView(nsnull); - mRefCnt = 0; - } - if (nsnull != mInnerWindow) { - //if (nsnull != mWindow) { - // mWindow->Destroy(); - // mWindow = nsnull; - //} - NS_RELEASE(mInnerWindow); // this should destroy the widget and its native windows - } -} - -nsresult nsView :: QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - if (nsnull == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kClassIID, kIViewIID); - - if (aIID.Equals(kClassIID) || (aIID.Equals(kISupportsIID))) { - *aInstancePtr = (void*)(nsIView*)this; - AddRef(); - return NS_OK; - } - - if (nsnull != mInnerWindow) - return mInnerWindow->QueryInterface(aIID, aInstancePtr); - - return NS_NOINTERFACE; -} - -// this should be added to nsView -nsIWidget* -GetWindowTemp(nsIView *aView) -{ - nsIWidget *window = nsnull; - - nsIView *ancestor = aView; - while (nsnull != ancestor) { - if (nsnull != (window = ancestor->GetWidget())) { - return window; - } - ancestor = ancestor->GetParent(); - } - return nsnull; -} - -nsrefcnt nsView::AddRef() -{ - return ++mRefCnt; -} - -nsrefcnt nsView::Release() -{ - if (--mRefCnt == 0) - { - delete this; - return 0; - } - return mRefCnt; -} - -nsresult nsView :: Init(nsIViewManager* aManager, - const nsRect &aBounds, - nsIView *aParent, - const nsCID *aWindowCIID, - void *aWidgetInitData, - nsNativeWindow aNative, - PRInt32 aZIndex, - const nsViewClip *aClip, - float aOpacity, - nsViewVisibility aVisibilityFlag) -{ - //printf(" \n callback=%d data=%d", aWidgetCreateCallback, aCallbackData); - NS_PRECONDITION(nsnull != aManager, "null ptr"); - if (nsnull == aManager) { - return NS_ERROR_NULL_POINTER; - } - if (nsnull != mViewManager) { - return NS_ERROR_ALREADY_INITIALIZED; - } - mViewManager = aManager; - - NS_ADDREF(aManager); - - mBounds = aBounds; - - if (aClip != nsnull) - mClip = *aClip; - else - { - mClip.mLeft = 0; - mClip.mRight = 0; - mClip.mTop = 0; - mClip.mBottom = 0; - } - - mOpacity = aOpacity; - mZindex = aZIndex; - - // assign the parent view - SetParent(aParent); - - // check if a real window has to be created - if (aWindowCIID) - { - nsIPresContext *cx = mViewManager->GetPresContext(); - nsIDeviceContext *dx = cx->GetDeviceContext(); - nsRect trect = aBounds; - - trect *= cx->GetTwipsToPixels(); - - static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); - if (NS_OK == LoadWidget(*aWindowCIID)) - { - if (aNative) - mWindow->Create(aNative, trect, ::HandleEvent, dx, nsnull, aWidgetInitData); - else - { - nsIWidget *parent = GetWindowTemp(aParent); - mWindow->Create(parent, trect, ::HandleEvent, dx, nsnull, aWidgetInitData); - NS_IF_RELEASE(parent); - } - } - - NS_RELEASE(dx); - NS_RELEASE(cx); - } - - SetVisibility(aVisibilityFlag); - - return NS_OK; -} - -void nsView :: Destroy() -{ - delete this; -} - -nsIViewManager * nsView :: GetViewManager() -{ - NS_IF_ADDREF(mViewManager); - return mViewManager; -} - -nsIWidget * nsView :: GetWidget() -{ - NS_IF_ADDREF(mWindow); - return mWindow; -} - -void nsView :: Paint(nsIRenderingContext& rc, const nsRect& rect, PRUint32 aPaintFlags) -{ - rc.PushState(); - - if ((mClip.mLeft != mClip.mRight) && (mClip.mTop != mClip.mBottom)) - { - rc.Translate(mBounds.x, mBounds.y); - - nsRect crect; - - crect.x = mClip.mLeft; - crect.y = mClip.mTop; - crect.width = mClip.mRight - mClip.mLeft; - crect.height = mClip.mBottom - mClip.mTop; - - rc.SetClipRect(crect, PR_TRUE); - } - else - { - nsIView *pRoot = mViewManager->GetRootView(); - - if (this != pRoot) - rc.SetClipRect(mBounds, PR_TRUE); - - NS_RELEASE(pRoot); - - rc.Translate(mBounds.x, mBounds.y); - } - - if (nsnull != mFrame) - { - nsIPresContext *cx = mViewManager->GetPresContext(); - mFrame->Paint(*cx, rc, rect); - NS_RELEASE(cx); - } - - //XXX maybe we should set this before we set the clip? MMP - - if (nsnull != mXForm) - { - nsTransform2D *pXForm = rc.GetCurrentTransform(); - pXForm->Concatenate(mXForm); - } - - PRInt32 numkids = GetChildCount(); - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - nsIView *kid = GetChild(cnt); - - if (nsnull != kid) - { - nsRect kidRect; - kid->GetBounds(kidRect); - nsRect damageArea; - PRBool overlap = damageArea.IntersectRect(rect, kidRect); - - if (overlap == PR_TRUE) - { - // Translate damage area into kid's coordinate system - nsRect kidDamageArea(damageArea.x - kidRect.x, damageArea.y - kidRect.y, - damageArea.width, damageArea.height); - kid->Paint(rc, kidDamageArea, aPaintFlags); - } - } - } - - rc.PopState(); -} - -void nsView :: Paint(nsIRenderingContext& rc, const nsRegion& region, PRUint32 aPaintFlags) -{ - // XXX apply region to rc - // XXX get bounding rect from region - //if (nsnull != mFrame) - // mFrame->Paint(rc, rect, aPaintFlags); -} - -nsEventStatus nsView :: HandleEvent(nsGUIEvent *event, PRUint32 aEventFlags) -{ - nsIScrollbar *scroll; - nsEventStatus retval = nsEventStatus_eIgnore; - - if (nsnull != mWindow) - { - //if this is a scrollbar window that sent - //us the event, do special processing - - static NS_DEFINE_IID(kscroller, NS_ISCROLLBAR_IID); - - if (NS_OK == mWindow->QueryInterface(kscroller, (void **)&scroll)) - { - if (nsnull != mParent) - retval = mParent->HandleEvent(event, 0); - - NS_RELEASE(scroll); - } - } - - if ((retval == nsEventStatus_eIgnore) && (nsnull != mFrame)) - { - nsIPresContext *cx = mViewManager->GetPresContext(); - nscoord xoff, yoff; - - mViewManager->GetWindowOffsets(&xoff, &yoff); - - event->point.x += xoff; - event->point.y += yoff; - - mFrame->HandleEvent(*cx, event, retval); - - event->point.x -= xoff; - event->point.y -= yoff; - - NS_RELEASE(cx); - } - - //see if any of this view's children can process the event - - if ((aEventFlags & NS_VIEW_FLAG_CHECK_CHILDREN) && - (retval == nsEventStatus_eIgnore)) - { - PRInt32 numkids = GetChildCount(); - nsRect trect; - nscoord x, y; - - x = event->point.x; - y = event->point.y; - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - nsIView *pKid = GetChild(cnt); - nscoord lx, ly; - - pKid->GetBounds(trect); - - lx = x - trect.x; - ly = y - trect.y; - - if (trect.Contains(lx, ly)) - { - //the x, y position of the event in question - //is inside this child view, so give it the - //opportunity to handle the event - - event->point.x -= trect.x; - event->point.y -= trect.y; - - retval = pKid->HandleEvent(event, NS_VIEW_FLAG_CHECK_CHILDREN); - - event->point.x += trect.x; - event->point.y += trect.y; - - if (retval != nsEventStatus_eIgnore) - break; - } - } - } - - //see if any of this views siblings can process this event - //we only go from the next sibling since this is a z-ordered - //list - - if (retval == nsEventStatus_eIgnore) - { - nsIView *pNext = GetNextSibling(); - - while (pNext) - { - retval = pNext->HandleEvent(event, NS_VIEW_FLAG_CHECK_CHILDREN); - - if (retval != PR_FALSE) - break; - - pNext = pNext->GetNextSibling(); - } - } - - //no-one has a clue what to do with this... so ask the - //parents. kind of mimics life, huh? - - if ((aEventFlags & NS_VIEW_FLAG_CHECK_PARENT) && (retval == PR_FALSE)) - { - nsIView *pParent = GetParent(); - - while (pParent) - { - retval = pParent->HandleEvent(event, 0); - - if (retval != PR_FALSE) - break; - - pParent = pParent->GetParent(); - } - } - - return retval; -} - -void nsView :: SetPosition(nscoord x, nscoord y) -{ - mBounds.MoveTo(x, y); - - if (nsnull != mWindow) - { - nsIPresContext *px = mViewManager->GetPresContext(); - nscoord offx, offy; - float scale = px->GetTwipsToPixels(); - - mViewManager->GetWindowOffsets(&offx, &offy); - - mWindow->Move(NS_TO_INT_ROUND((x + offx) * scale), NS_TO_INT_ROUND((y + offy) * scale)); - - NS_RELEASE(px); - } -} - -void nsView :: GetPosition(nscoord *x, nscoord *y) -{ - *x = mBounds.x; - *y = mBounds.y; -} - -void nsView :: SetDimensions(nscoord width, nscoord height) -{ - mBounds.SizeTo(width, height); - - if (nsnull != mParent) - { - nsIScrollableView *scroller; - - static NS_DEFINE_IID(kscroller, NS_ISCROLLABLEVIEW_IID); - - if (NS_OK == mParent->QueryInterface(kscroller, (void **)&scroller)) - { - scroller->ComputeContainerSize(); - NS_RELEASE(scroller); - } - } - - if (nsnull != mWindow) - { - nsIPresContext *px = mViewManager->GetPresContext(); - float t2p = px->GetTwipsToPixels(); - - mWindow->Resize(NS_TO_INT_ROUND(t2p * width), NS_TO_INT_ROUND(t2p * height)); - - NS_RELEASE(px); - } -} - -void nsView :: GetDimensions(nscoord *width, nscoord *height) -{ - *width = mBounds.width; - *height = mBounds.height; -} - -void nsView :: SetBounds(const nsRect &aBounds) -{ - SetPosition(aBounds.x, aBounds.y); - SetDimensions(aBounds.width, aBounds.height); -} - -void nsView :: SetBounds(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) -{ - SetPosition(aX, aY); - SetDimensions(aWidth, aHeight); -} - -void nsView :: GetBounds(nsRect &aBounds) -{ - aBounds = mBounds; -} - -void nsView :: SetClip(nscoord aLeft, nscoord aTop, nscoord aRight, nscoord aBottom) -{ - mClip.mLeft = aLeft; - mClip.mTop = aTop; - mClip.mRight = aRight; - mClip.mBottom = aBottom; -} - -PRBool nsView :: GetClip(nscoord *aLeft, nscoord *aTop, nscoord *aRight, nscoord *aBottom) -{ - if ((mClip.mLeft == mClip.mRight) || (mClip.mTop == mClip.mBottom)) - return PR_FALSE; - else - { - *aLeft = mClip.mLeft; - *aTop = mClip.mTop; - *aRight = mClip.mRight; - *aBottom = mClip.mBottom; - - return PR_TRUE; - } -} - -void nsView :: SetVisibility(nsViewVisibility aVisibility) -{ - mVis = aVisibility; - - if (nsnull != mWindow) - { - if (mVis == nsViewVisibility_kShow) - mWindow->Show(PR_TRUE); - else - mWindow->Show(PR_FALSE); - } -} - -nsViewVisibility nsView :: GetVisibility() -{ - return mVis; -} - -void nsView :: SetZIndex(PRInt32 zindex) -{ - mZindex = zindex; -} - -PRInt32 nsView :: GetZIndex() -{ - return mZindex; -} - -void nsView :: SetParent(nsIView *aParent) -{ - mParent = aParent; -} - -nsIView * nsView :: GetParent() -{ - return mParent; -} - -nsIView * nsView :: GetNextSibling() const -{ - return mNextSibling; -} - -void nsView::SetNextSibling(nsIView* aView) -{ - mNextSibling = aView; -} - -void nsView :: InsertChild(nsIView *child, nsIView *sibling) -{ - NS_PRECONDITION(nsnull != child, "null ptr"); - if (nsnull != child) - { - if (nsnull != sibling) - { - NS_ASSERTION(sibling->GetParent() != this, "tried to insert view with invalid sibling"); - //insert after sibling - child->SetNextSibling(sibling->GetNextSibling()); - sibling->SetNextSibling(child); - } - else - { - child->SetNextSibling(mFirstChild); - mFirstChild = child; - } - child->SetParent(this); - mNumKids++; - } -} - -void nsView :: RemoveChild(nsIView *child) -{ - NS_PRECONDITION(nsnull != child, "null ptr"); - - if (nsnull != child) - { - nsIView* prevKid = nsnull; - nsIView* kid = mFirstChild; - PRBool found = PR_FALSE; - while (nsnull != kid) { - if (kid == child) { - if (nsnull != prevKid) { - prevKid->SetNextSibling(kid->GetNextSibling()); - } else { - mFirstChild = kid->GetNextSibling(); - } - child->SetParent(nsnull); - mNumKids--; - found = PR_TRUE; - break; - } - kid = kid->GetNextSibling(); - } - NS_ASSERTION(found, "tried to remove non child"); - } -} - -PRInt32 nsView :: GetChildCount() -{ - return mNumKids; -} - -nsIView * nsView :: GetChild(PRInt32 index) -{ - NS_PRECONDITION(!(index > mNumKids), "bad index"); - - if (index < mNumKids) - { - nsIView *kid = mFirstChild; - for (PRInt32 cnt = 0; (cnt < index) && (nsnull != kid); cnt++) { - kid = kid->GetNextSibling(); - } - return kid; - } - return nsnull; -} - -void nsView :: SetTransform(nsTransform2D &aXForm) -{ - if (nsnull == mXForm) - mXForm = new nsTransform2D(&aXForm); - else - *mXForm = aXForm; -} - -void nsView :: GetTransform(nsTransform2D &aXForm) -{ - if (nsnull != mXForm) - aXForm = *mXForm; - else - aXForm.SetToIdentity(); -} - -void nsView :: SetOpacity(float opacity) -{ - mOpacity = opacity; -} - -float nsView :: GetOpacity() -{ - return mOpacity; -} - -PRBool nsView :: HasTransparency() -{ - return PR_FALSE; -} - -// Frames have a pointer to the view, so don't AddRef the frame. -void nsView :: SetFrame(nsIFrame *aFrame) -{ - mFrame = aFrame; -} - -nsIFrame * nsView :: GetFrame() -{ - return mFrame; -} - -// -// internal window creation functions -// -nsresult nsView :: LoadWidget(const nsCID &aClassIID) -{ - nsresult rv; - - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - rv = NSRepository::CreateInstance(aClassIID, this, kISupportsIID, (void**)&mInnerWindow); - - if (NS_OK == rv) { - // load the convenience nsIWidget pointer. - // NOTE: mWindow is released so not to create a circulare refcount - static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); - rv = mInnerWindow->QueryInterface(kIWidgetIID, (void**)&mWindow); - if (NS_OK != rv) { - mInnerWindow->Release(); - mInnerWindow = NULL; - } - else { - mWindow->Release(); - } - } - - return rv; -} - -void nsView :: List(FILE* out, PRInt32 aIndent) const -{ - for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); - fprintf(out, "%p win=%p ", this, mWindow); - out << mBounds; - fputs("<\n", out); - nsIView* kid = mFirstChild; - while (nsnull != kid) { - kid->List(out, aIndent + 1); - kid = kid->GetNextSibling(); - } - for (i = aIndent; --i >= 0; ) fputs(" ", out); - fputs(">\n", out); -} - -void nsView :: AdjustChildWidgets(nscoord aDx, nscoord aDy) -{ - PRInt32 numkids = GetChildCount(); - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - nsIView *kid = GetChild(cnt); - nsIWidget *win = kid->GetWidget(); - - if (nsnull != win) - { - nsRect bounds; - - win->GetBounds(bounds); - win->Move(bounds.x + aDx, bounds.y + aDy); - - NS_RELEASE(win); - } - - kid->AdjustChildWidgets(aDx, aDy); - } -} diff --git a/mozilla/view/src/nsView.h b/mozilla/view/src/nsView.h deleted file mode 100644 index d85d736fb09..00000000000 --- a/mozilla/view/src/nsView.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsView_h___ -#define nsView_h___ - -#include "nsViewManager.h" -#include "nsIView.h" -#include "nsRect.h" -#include "nsCRT.h" -#include "nsIWidget.h" -#include "nsIFactory.h" - -class nsIPresContext; - -class nsView : public nsIView -{ -public: - nsView(); - ~nsView(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - virtual nsresult Init(nsIViewManager* aManager, - const nsRect &aBounds, - nsIView *aParent, - const nsCID *aWindowIID = nsnull, - void *aWidgetInitData = nsnull, - nsNativeWindow aNative = nsnull, - PRInt32 aZIndex = 0, - const nsViewClip *aClip = nsnull, - float aOpacity = 1.0f, - nsViewVisibility aVisibilityFlag = nsViewVisibility_kShow); - - virtual void Destroy(); - virtual nsIViewManager * GetViewManager(); - virtual nsIWidget * GetWidget(); - virtual void Paint(nsIRenderingContext& rc, const nsRect& rect, PRUint32 aPaintFlags); - virtual void Paint(nsIRenderingContext& rc, const nsRegion& region, PRUint32 aPaintFlags); - virtual nsEventStatus HandleEvent(nsGUIEvent *event, PRUint32 aEventFlags); - virtual void SetPosition(nscoord x, nscoord y); - virtual void GetPosition(nscoord *x, nscoord *y); - virtual void SetDimensions(nscoord width, nscoord height); - virtual void GetDimensions(nscoord *width, nscoord *height); - virtual void SetBounds(const nsRect &aBounds); - virtual void SetBounds(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); - virtual void GetBounds(nsRect &aBounds); - virtual void SetClip(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); - virtual PRBool GetClip(nscoord *aLeft, nscoord *aTop, nscoord *aRight, nscoord *aBottom); - virtual void SetVisibility(nsViewVisibility visibility); - virtual nsViewVisibility GetVisibility(); - virtual void SetZIndex(PRInt32 zindex); - virtual PRInt32 GetZIndex(); - virtual void SetParent(nsIView *aParent); - virtual nsIView *GetParent(); - virtual nsIView* GetNextSibling() const; - virtual void SetNextSibling(nsIView* aNextSibling); - virtual void InsertChild(nsIView *child, nsIView *sibling); - virtual void RemoveChild(nsIView *child); - virtual PRInt32 GetChildCount(); - virtual nsIView * GetChild(PRInt32 index); - virtual void SetTransform(nsTransform2D &aXForm); - virtual void GetTransform(nsTransform2D &aXForm); - virtual void SetOpacity(float opacity); - virtual float GetOpacity(); - virtual PRBool HasTransparency(); - virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - virtual void SetFrame(nsIFrame *aFrame); - virtual nsIFrame * GetFrame(); - virtual void AdjustChildWidgets(nscoord aDx, nscoord aDy); - -protected: - // - virtual nsresult LoadWidget(const nsCID &aClassIID); - -protected: - nsIViewManager *mViewManager; - nsIView *mParent; - - // a View aggregates an nsIWidget, if any. - // mInnerWindow is the pointer to the widget real nsISupports. QueryInterace - // should be called on mInnerWindow if any of the widget interface wants to - // be exposed, - // mWindow is a convenience pointer to the widget functionalities. - // mWindow is not AddRef'ed or Released otherwise we'll create a circulare - // refcount and the view will never go away - nsISupports *mInnerWindow; - nsIWidget *mWindow; - - //XXX should there be pointers to last child so backward walking is fast? - nsIView *mNextSibling; - nsIView *mFirstChild; - nsIFrame *mFrame; - PRInt32 mZindex; - nsViewVisibility mVis; - PRInt32 mNumKids; - nsRect mBounds; - nsViewClip mClip; - nsTransform2D *mXForm; - float mOpacity; -}; - -#endif diff --git a/mozilla/view/src/nsViewFactory.cpp b/mozilla/view/src/nsViewFactory.cpp deleted file mode 100644 index 9abfb03596f..00000000000 --- a/mozilla/view/src/nsViewFactory.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nscore.h" -#include "nsIFactory.h" -#include "nsISupports.h" - -#include "nsViewsCID.h" -#include "nsView.h" -#include "nsViewManager.h" -#include "nsScrollingView.h" - -static NS_DEFINE_IID(kCViewManager, NS_VIEW_MANAGER_CID); -static NS_DEFINE_IID(kCView, NS_VIEW_CID); -static NS_DEFINE_IID(kCScrollingView, NS_SCROLLING_VIEW_CID); - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); - -class nsViewFactory : public nsIFactory -{ - public: - // nsISupports methods - NS_IMETHOD QueryInterface(const nsIID &aIID, - void **aResult); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - // nsIFactory methods - NS_IMETHOD CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult); - - NS_IMETHOD LockFactory(PRBool aLock); - - nsViewFactory(const nsCID &aClass); - ~nsViewFactory(); - - private: - nsrefcnt mRefCnt; - nsCID mClassID; -}; - -nsViewFactory::nsViewFactory(const nsCID &aClass) -{ - mRefCnt = 0; - mClassID = aClass; -} - -nsViewFactory::~nsViewFactory() -{ - NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction"); -} - -nsresult nsViewFactory::QueryInterface(const nsIID &aIID, - void **aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - // Always NULL result, in case of failure - *aResult = NULL; - - if (aIID.Equals(kISupportsIID)) { - *aResult = (void *)(nsISupports*)this; - } else if (aIID.Equals(kIFactoryIID)) { - *aResult = (void *)(nsIFactory*)this; - } - - if (*aResult == NULL) { - return NS_NOINTERFACE; - } - - AddRef(); // Increase reference count for caller - return NS_OK; -} - -nsrefcnt nsViewFactory::AddRef() -{ - return ++mRefCnt; -} - -nsrefcnt nsViewFactory::Release() -{ - if (--mRefCnt == 0) { - delete this; - return 0; // Don't access mRefCnt after deleting! - } - return mRefCnt; -} - -nsresult nsViewFactory::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = NULL; - - nsISupports *inst = nsnull; - - if (mClassID.Equals(kCViewManager)) { - inst = (nsISupports *)new nsViewManager(); - } - else if (mClassID.Equals(kCView)) { - inst = (nsISupports *)new nsView(); - } - else if (mClassID.Equals(kCScrollingView)) { - inst = (nsISupports *)(nsView*)new nsScrollingView(); - } - - if (inst == NULL) { - return NS_ERROR_OUT_OF_MEMORY; - } - - nsresult res = inst->QueryInterface(aIID, aResult); - - if (res != NS_OK) { - // We didn't get the right interface, so clean up - delete inst; - } - - return res; -} - -nsresult nsViewFactory::LockFactory(PRBool aLock) -{ - // Not implemented in simplest case. - return NS_OK; -} - -// return the proper factory to the caller -extern "C" NS_VIEW nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -{ - if (nsnull == aFactory) { - return NS_ERROR_NULL_POINTER; - } - - *aFactory = new nsViewFactory(aClass); - - if (nsnull == aFactory) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory); -} diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp deleted file mode 100644 index 3eca983c0b9..00000000000 --- a/mozilla/view/src/nsViewManager.cpp +++ /dev/null @@ -1,577 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsViewManager.h" -#include "nsUnitConversion.h" -#include "nsIPresShell.h" -#include "nsIPresShell.h" -#include "nsIRenderingContext.h" -#include "nsIDeviceContext.h" -#include "nsGfxCIID.h" - -static const PRBool gsDebug = PR_FALSE; - -#define UPDATE_QUANTUM 1000 / 40 - -static void vm_timer_callback(nsITimer *aTimer, void *aClosure) -{ - nsViewManager *vm = (nsViewManager *)aClosure; - - //restart the timer - - PRInt32 fr = vm->GetFrameRate(); - - vm->mFrameRate = 0; - - vm->SetFrameRate(fr); - - if (vm->mDirtyRect.IsEmpty() == PR_FALSE) - { - nsIRenderingContext *cx; - nsIPresContext *px = vm->GetPresContext(); - nsIDeviceContext *dx = px->GetDeviceContext(); - - cx = dx->CreateRenderingContext(vm->mRootView); - - if (nsnull != cx) - { - vm->Refresh(vm->mRootView, cx, &vm->mDirtyRect, NS_VMREFRESH_DOUBLE_BUFFER); - NS_RELEASE(cx); - } - - NS_RELEASE(dx); - NS_RELEASE(px); - } -} - -static NS_DEFINE_IID(knsViewManagerIID, NS_IVIEWMANAGER_IID); - -nsViewManager :: nsViewManager() -{ -} - -nsViewManager :: ~nsViewManager() -{ - NS_IF_RELEASE(mTimer); - NS_IF_RELEASE(mRootWindow); - NS_IF_RELEASE(mRootView); - - if (nsnull != mDrawingSurface) - { - nsIRenderingContext *rc; - - //interesting way of killing things - - static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kIRenderingContextIID, NS_IRENDERING_CONTEXT_IID); - - nsresult rv = NSRepository::CreateInstance(kRenderingContextCID, - nsnull, - kIRenderingContextIID, - (void **)&rc); - - if (NS_OK == rv) - { - rc->DestroyDrawingSurface(mDrawingSurface); - rc->Release(); - } - - mDrawingSurface = nsnull; - } -} - -NS_IMPL_QUERY_INTERFACE(nsViewManager, knsViewManagerIID) - -nsrefcnt nsViewManager::AddRef(void) -{ - return ++mRefCnt; -} - -nsrefcnt nsViewManager::Release(void) -{ - if (--mRefCnt == 0) { - delete this; - return 0; - } - return mRefCnt; -} - -// We don't hold a reference to the presentation context because it -// holds a reference to us. -nsresult nsViewManager::Init(nsIPresContext* aPresContext) -{ - nsresult rv; - - NS_PRECONDITION(nsnull != aPresContext, "null ptr"); - if (nsnull == aPresContext) { - return NS_ERROR_NULL_POINTER; - } - if (nsnull != mContext) { - return NS_ERROR_ALREADY_INITIALIZED; - } - mContext = aPresContext; - - mOffset.x = mOffset.y = 0; - - mDSBounds.Empty(); - mDrawingSurface = nsnull; - mTimer = nsnull; - mFrameRate = 0; - - rv = SetFrameRate(UPDATE_QUANTUM); - - return rv; -} - -nsIWidget * nsViewManager :: GetRootWindow() -{ - NS_IF_ADDREF(mRootWindow); - return mRootWindow; -} - -void nsViewManager :: SetRootWindow(nsIWidget *aRootWindow) -{ - NS_IF_RELEASE(mRootWindow); - mRootWindow = aRootWindow; - NS_IF_ADDREF(mRootWindow); -} - -nsIView * nsViewManager :: GetRootView() -{ - NS_IF_ADDREF(mRootView); - return mRootView; -} - -void nsViewManager :: SetRootView(nsIView *aView) -{ - NS_IF_RELEASE(mRootView); - mRootView = aView; - NS_IF_ADDREF(mRootView); -} - -PRUint32 nsViewManager :: GetFrameRate() -{ - return mFrameRate; -} - -nsresult nsViewManager :: SetFrameRate(PRUint32 aFrameRate) -{ - nsresult rv; - - if (aFrameRate != mFrameRate) - { - NS_IF_RELEASE(mTimer); - - mFrameRate = aFrameRate; - - if (mFrameRate != 0) - { - rv = NS_NewTimer(&mTimer); - - if (NS_OK == rv) - mTimer->Init(vm_timer_callback, this, 1000 / mFrameRate); - } - else - rv = NS_OK; - } - else - rv = NS_OK; - - return rv; -} - -void nsViewManager :: GetWindowDimensions(nscoord *width, nscoord *height) -{ - *width = 0; - *height = 0; -} - -void nsViewManager :: SetWindowDimensions(nscoord width, nscoord height) -{ - nsIPresShell* presShell = mContext->GetShell(); - - // Resize the root view - mRootView->SetDimensions(width, height); - - // Inform the presentation shell that we've been resized - if (nsnull != presShell) { - presShell->ResizeReflow(width, height); - NS_RELEASE(presShell); - } -} - -void nsViewManager :: GetWindowOffsets(nscoord *xoffset, nscoord *yoffset) -{ - *xoffset = mOffset.x; - *yoffset = mOffset.y; -} - -void nsViewManager :: SetWindowOffsets(nscoord xoffset, nscoord yoffset) -{ - mOffset.x = xoffset; - mOffset.y = yoffset; -} - -void nsViewManager :: Refresh(nsIRenderingContext *aContext, nsRegion *region, PRUint32 aUpdateFlags) -{ -} - -void nsViewManager :: Refresh(nsIView *aView, nsIRenderingContext *aContext, nsRect *rect, PRUint32 aUpdateFlags) -{ - nsRect wrect; - nsIRenderingContext *localcx = nsnull; - - if (nsnull == aContext) - { - localcx = CreateRenderingContext(*aView); - - //couldn't get rendering context. ack. - - if (nsnull == localcx) - return; - } - else - localcx = aContext; - - if (aUpdateFlags & NS_VMREFRESH_DOUBLE_BUFFER) - { - mRootWindow->GetBounds(wrect); - nsDrawingSurface ds = GetDrawingSurface(*localcx, wrect); - localcx->SelectOffScreenDrawingSurface(ds); - } - - if (aUpdateFlags & NS_VMREFRESH_SCREEN_RECT) - localcx->SetClipRect(*rect, PR_FALSE); - - localcx->Translate(-mOffset.x, -mOffset.y); - - nsRect trect = *rect; - - if (aUpdateFlags & NS_VMREFRESH_SCREEN_RECT) - trect.MoveBy(mOffset.x, mOffset.y); - else - localcx->SetClipRect(trect, PR_FALSE); - - aView->Paint(*localcx, trect, 0); - - if (aUpdateFlags & NS_VMREFRESH_DOUBLE_BUFFER) - localcx->CopyOffScreenBits(wrect); - - if (localcx != aContext) - NS_RELEASE(localcx); - - nsRect updaterect = *rect; - - //does our dirty rect intersect the rect we just painted? - - if (updaterect.IntersectRect(updaterect, mDirtyRect)) - { - //does the update rect fully contain the dirty rect? - //if so, then clear the dirty rect. - - if (updaterect.Contains(mDirtyRect)) - ClearDirtyRegion(); - } -} - -void nsViewManager :: Composite() -{ -} - -void nsViewManager :: UpdateView(nsIView *aView, nsRegion *aRegion, PRUint32 aUpdateFlags) -{ - if (aRegion == nsnull) - { - nsRect trect; - - aView->GetBounds(trect); - UpdateView(aView, trect, aUpdateFlags); - } -} - -void nsViewManager :: UpdateView(nsIView *aView, nsRect &aRect, PRUint32 aUpdateFlags) -{ - nsRect trect = aRect; - nsIView *par = aView; - nscoord x, y; - - if (gsDebug) - { - printf("ViewManager::UpdateView: %x, rect ", aView); - stdout << trect; - printf("\n"); - } - - do - { - //get absolute coordinates of view - - par->GetPosition(&x, &y); - - trect.x += x; - trect.y += y; - } - while (par = par->GetParent()); - - if (mDirtyRect.IsEmpty()) - mDirtyRect = trect; - else - mDirtyRect.UnionRect(mDirtyRect, trect); - - if ((aUpdateFlags & NS_VMREFRESH_IMMEDIATE) && (nsnull != mContext)) - { - nsIRenderingContext *cx; - nsIDeviceContext *dx = mContext->GetDeviceContext(); - - cx = dx->CreateRenderingContext(mRootView); - - if (nsnull != cx) - { - Refresh(aView, cx, &mDirtyRect, aUpdateFlags & NS_VMREFRESH_DOUBLE_BUFFER); - NS_RELEASE(cx); - } - - NS_RELEASE(dx); - } -} - -PRBool nsViewManager :: DispatchEvent(nsIEvent *event) -{ - return PR_TRUE; -} - -PRBool nsViewManager :: GrabMouseEvents(nsIView *aView) -{ - return PR_TRUE; -} - -PRBool nsViewManager :: GrabKeyEvents(nsIView *aView) -{ - return PR_TRUE; -} - -nsIView * nsViewManager :: GetMouseEventGrabber() -{ - return nsnull; -} - -nsIView * nsViewManager :: GetKeyEventGrabber() -{ - return nsnull; -} - -void nsViewManager :: InsertChild(nsIView *parent, nsIView *child, nsIView *sibling, - PRBool above) -{ - NS_PRECONDITION(nsnull != parent, "null ptr"); - NS_PRECONDITION(nsnull != child, "null ptr"); - - if ((nsnull != parent) && (nsnull != child)) - { - PRInt32 numkids = parent->GetChildCount(); - nsIView *kid = nsnull, *prev = nsnull; - - //verify that the sibling exists... - - for (PRInt32 cnt = 0; cnt < numkids; cnt++) - { - kid = parent->GetChild(cnt); - - if (kid == sibling) - break; - - prev = kid; - } - - if (nsnull != kid) - { - //it's there, so do the insertion - - if (PR_TRUE == above) - parent->InsertChild(child, prev); - else - parent->InsertChild(child, sibling); - } - - //and mark this area as dirty if the view is visible... - - if (child->GetVisibility() != nsViewVisibility_kHide) - UpdateView(child, nsnull, 0); - } -} - -void nsViewManager :: InsertChild(nsIView *parent, nsIView *child, PRInt32 zindex) -{ - NS_PRECONDITION(nsnull != parent, "null ptr"); - NS_PRECONDITION(nsnull != child, "null ptr"); - - if ((nsnull != parent) && (nsnull != child)) - { - //XXX this is really dumb but it will at least do something - - parent->InsertChild(child, nsnull); - } -} - -void nsViewManager :: RemoveChild(nsIView *parent, nsIView *child) -{ - parent->RemoveChild(child); -} - -void nsViewManager :: MoveViewBy(nsIView *aView, nscoord aX, nscoord aY) -{ - nscoord x, y; - - aView->GetPosition(&x, &y); - MoveViewTo(aView, aX + x, aY + y); -} - -void nsViewManager :: MoveViewTo(nsIView *aView, nscoord aX, nscoord aY) -{ - nscoord oldX; - nscoord oldY; - - aView->GetPosition(&oldX, &oldY); - aView->SetPosition(aX, aY); - - // only do damage control if the view is visible - - if (nsViewVisibility_kHide != aView->GetVisibility()) - { - nsRect bounds; - aView->GetBounds(bounds); - nsRect oldArea(oldX, oldY, bounds.width, bounds.height); - nsIView* parent = aView->GetParent(); // no addref - UpdateView(parent, oldArea, 0); - nsRect newArea(aX, aY, bounds.width, bounds.height); - UpdateView(parent, newArea, 0); - } -} - -void nsViewManager :: ResizeView(nsIView *aView, nscoord width, nscoord height) -{ -} - -void nsViewManager :: SetViewClip(nsIView *aView, nsRect *rect) -{ -} - -void nsViewManager :: SetViewVisibility(nsIView *aView, nsViewVisibility visible) -{ -} - -void nsViewManager :: SetViewZindex(nsIView *aView, PRInt32 zindex) -{ -} - -void nsViewManager :: MoveViewAbove(nsIView *aView, nsIView *other) -{ -} - -void nsViewManager :: MoveViewBelow(nsIView *aView, nsIView *other) -{ -} - -PRBool nsViewManager :: IsViewShown(nsIView *aView) -{ - return PR_TRUE; -} - -PRBool nsViewManager :: GetViewClipAbsolute(nsIView *aView, nsRect *rect) -{ - return PR_TRUE; -} - -nsIPresContext * nsViewManager :: GetPresContext() -{ - NS_IF_ADDREF(mContext); - return mContext; -} - -nsDrawingSurface nsViewManager :: GetDrawingSurface(nsIRenderingContext &aContext, nsRect& aBounds) -{ - - //if ((nsnull == mDrawingSurface) || (mDSBounds != aBounds)) - if((nsnull==mDrawingSurface) || ((mDSBounds.width < aBounds.width)||(mDSBounds.heightGetWidget(); - - if (nsnull != win) - break; - - //get absolute coordinates of view, but don't - //add in view pos since the first thing you ever - //need to do when painting a view is to translate - //the rendering context by the views pos and other parts - //of the code do this for us... - - if (par != &aView) - { - par->GetPosition(&x, &y); - - ax += x; - ay += y; - } - } - while (par = par->GetParent()); - - if (nsnull != win) - { - dx = mContext->GetDeviceContext(); - - cx = dx->CreateRenderingContext(&aView); - - cx->Translate(ax, ay); - - NS_RELEASE(dx); - NS_RELEASE(win); - } - - return cx; -} diff --git a/mozilla/view/src/nsViewManager.h b/mozilla/view/src/nsViewManager.h deleted file mode 100644 index 952b6588d8c..00000000000 --- a/mozilla/view/src/nsViewManager.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsViewManager_h___ -#define nsViewManager_h___ - -#include "nsIViewManager.h" -#include "nsCRT.h" -#include "nsIPresContext.h" -#include "nsIWidget.h" -#include "nsITimer.h" - -class nsViewManager : public nsIViewManager -{ -public: - nsViewManager(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - virtual nsresult Init(nsIPresContext* aPresContext); - - // Get the window for which the manager is responsible. - virtual void SetRootWindow(nsIWidget *aRootWindow); - virtual nsIWidget *GetRootWindow(); - - // Get and set the root of the layer tree. - virtual nsIView *GetRootView(); - virtual void SetRootView(nsIView *aView); - - // Get and set the current framerate i.e. the rate at which timed - // refreshes occur. A framerate of 0 indicates that timed refreshes - // should not occur. - virtual PRUint32 GetFrameRate(); - virtual nsresult SetFrameRate(PRUint32 frameRate); - - // Get and set the dimensions of the root window. The latter should - // be called if the root window is resized.. The dimensions are in - // twips - virtual void GetWindowDimensions(nscoord *width, nscoord *height); - virtual void SetWindowDimensions(nscoord width, nscoord height); - - // Get and set the position of the root window relative to the - // composited area. The latter should be called if the root window - // is scrolled. - virtual void GetWindowOffsets(nscoord *xoffset, nscoord *yoffset); - virtual void SetWindowOffsets(nscoord xoffset, nscoord yoffset); - - // Called to refresh an area of the root window. The coordinates of - // the region or rectangle passed in should be in the window's - // coordinate space. Often called in response to a paint/redraw event - // from the native windowing system. - virtual void Refresh(nsIRenderingContext *aContext, nsRegion *region, - PRUint32 aUpdateFlags); - virtual void Refresh(nsIView* aView, nsIRenderingContext *aContext, - nsRect *rect, PRUint32 aUpdateFlags); - - // Called to force a redrawing of any dirty areas. - virtual void Composite(); - - // Called to inform the layer manager that some portion of a layer - // is dirty and needs to be redrawn. The region or rect passed in - // should be in the layer's coordinate space. - virtual void UpdateView(nsIView *aView, nsRegion *aRegion, - PRUint32 aUpdateFlags); - virtual void UpdateView(nsIView *aView, nsRect &aRect, PRUint32 aUpdateFlags); - - // Called to dispatch an event to the appropriate layer. Often called - // as a result of receiving a mouse or keyboard event from the native - // event system. - virtual PRBool DispatchEvent(nsIEvent *event); - - // Used to grab/capture all events of the type (mouse or keyboard) for - // a specific layer, irrespective of the cursor position at which the - // event occurred. - virtual PRBool GrabMouseEvents(nsIView *aView); - virtual PRBool GrabKeyEvents(nsIView *aView); - - // Get the current layer, if any, that's capturing a specific type of - // event. - virtual nsIView* GetMouseEventGrabber(); - virtual nsIView* GetKeyEventGrabber(); - - // Given a parent layer, insert another layer as its child. If above - // is PR_TRUE, the layer is inserted above (in z-order) the sibling. If - // it is nsfalse, the layer is inserted below. - // The layer manager generates the appopriate dirty regions. - virtual void InsertChild(nsIView *parent, nsIView *child, nsIView *sibling, - PRBool above); - - // Given a parent layer, insert another layer as its child. The zindex - // indicates where the child should be inserted relative to other - // children of the parent. - // The layer manager generates the appopriate dirty regions. - virtual void InsertChild(nsIView *parent, nsIView *child, - PRInt32 zindex); - - // Remove a specific child of a layer. - // The layer manager generates the appopriate dirty regions. - virtual void RemoveChild(nsIView *parent, nsIView *child); - - // Move a layer's position by the specified amount. - // The layer manager generates the appopriate dirty regions. - virtual void MoveViewBy(nsIView *aView, nscoord x, nscoord y); - - // Move a layer to the specified position, provided in parent coordinates. - // The layer manager generates the appopriate dirty regions. - virtual void MoveViewTo(nsIView *aView, nscoord x, nscoord y); - - // Resize a layer to the specified width and height. - // The layer manager generates the appopriate dirty regions. - virtual void ResizeView(nsIView *aView, nscoord width, nscoord height); - - // Set the clip of a layer. - // The layer manager generates the appopriate dirty regions. - virtual void SetViewClip(nsIView *aView, nsRect *rect); - - // Set the visibility of a layer. - // The layer manager generates the appopriate dirty regions. - virtual void SetViewVisibility(nsIView *aView, nsViewVisibility visible); - - // Set the z-index of a layer. Positive z-indices mean that a layer - // is above its parent in z-order. Negative z-indices mean that a - // layer is below its parent. - // The layer manager generates the appopriate dirty regions. - virtual void SetViewZindex(nsIView *aView, PRInt32 zindex); - - // Used to move a layer above or below another in z-order. - // The layer manager generates the appopriate dirty regions. - virtual void MoveViewAbove(nsIView *aView, nsIView *other); - virtual void MoveViewBelow(nsIView *aView, nsIView *other); - - // Returns whether a layer is actually shown (based on its visibility - // and that of its ancestors). - virtual PRBool IsViewShown(nsIView *aView); - - // Returns the clipping area of layer in absolute coordinates. - virtual PRBool GetViewClipAbsolute(nsIView *aView, nsRect *rect); - - // Get the presentation context associated with this manager - virtual nsIPresContext* GetPresContext(); - - virtual void ClearDirtyRegion(); - - nsDrawingSurface GetDrawingSurface(nsIRenderingContext &aContext, nsRect& aBounds); - -private: - ~nsViewManager(); - nsIRenderingContext *CreateRenderingContext(nsIView &aView); - - nsIPresContext *mContext; - nsIWidget *mRootWindow; - nsPoint mOffset; - nsRect mDSBounds; - nsDrawingSurface mDrawingSurface; - -public: - //these are public so that our timer callback can poke them. - nsITimer *mTimer; - nsRect mDirtyRect; - nsIView *mRootView; - PRUint32 mFrameRate; -}; - -#endif - diff --git a/mozilla/webshell/Makefile b/mozilla/webshell/Makefile deleted file mode 100644 index def05c31f80..00000000000 --- a/mozilla/webshell/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = .. - -DIRS = public src tests - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/webshell/makefile.win b/mozilla/webshell/makefile.win deleted file mode 100644 index 9b672228e7d..00000000000 --- a/mozilla/webshell/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=.. -IGNORE_MANIFEST=1 - -DIRS=public src tests - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/webshell/public/Makefile b/mozilla/webshell/public/Makefile deleted file mode 100644 index 2c3a02e4c95..00000000000 --- a/mozilla/webshell/public/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -MODULE = raptor - -EXPORTS = \ - nsIApplicationShell.h \ - nsIDocumentWidget.h \ - nsILinkHandler.h \ - nsIWebWidget.h \ - nsIShellInstance.h \ - nsweb.h \ - $(NULL) - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/webshell/public/makefile.win b/mozilla/webshell/public/makefile.win deleted file mode 100644 index 9a24e51fc77..00000000000 --- a/mozilla/webshell/public/makefile.win +++ /dev/null @@ -1,34 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. - -IGNORE_MANIFEST=1 - -MODULE=raptor - -EXPORTS = \ - nsIDocumentWidget.h \ - nsIApplicationShell.h \ - nsILinkHandler.h \ - nsIShellInstance.h \ - nsIWebWidget.h \ - nsweb.h \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/webshell/public/nsIApplicationShell.h b/mozilla/webshell/public/nsIApplicationShell.h deleted file mode 100644 index 311aaf565b8..00000000000 --- a/mozilla/webshell/public/nsIApplicationShell.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIApplicationShell_h___ -#define nsIApplicationShell_h___ - -#include "nsISupports.h" -#include "nsweb.h" -#include "nscore.h" - -#define NS_IAPPLICATIONSHELL_IID \ - { 0xaf9a93e0, 0xdebc, 0x11d1, \ - {0x92, 0x44, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } - -//2293d960-deff-11d1-9244-00805f8a7ab6 -#define NS_IAPPLICATIONSHELL_CID \ - { 0x2293d960, 0xdeff, 0x11d1, \ - {0x92, 0x44, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } - - -// All Applications must implement this C interface -extern "C" nsresult NS_RegisterApplicationShellFactory(); - -// Interface to the application shell. -class nsIApplicationShell : public nsISupports { -public: - // Create a native window for this web widget; may be called once - NS_IMETHOD Init() = 0; - - NS_IMETHOD Run() = 0; - -}; - -extern NS_WEB nsresult NS_NewApplicationShell(nsIApplicationShell** aInstancePtrResult); - -#endif /* nsIApplicationShell_h___ */ diff --git a/mozilla/webshell/public/nsIDocumentWidget.h b/mozilla/webshell/public/nsIDocumentWidget.h deleted file mode 100644 index e581cf903b1..00000000000 --- a/mozilla/webshell/public/nsIDocumentWidget.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIDocumentWidget_h___ -#define nsIDocumentWidget_h___ - -#include "nsIWidget.h" -#include "nsRect.h" -class nsIDocument; -class nsString; -class nsIScriptContext; - -// Interface to the web widget. The web widget is a container for web -// content. -class nsIDocumentWidget : public nsISupports { -public: - // Create a native window for this web widget; may be called once - virtual nsresult Init(nsNativeWindow aNativeParent, - const nsRect& aBounds) = 0; - - virtual nsRect GetBounds() = 0; - - virtual void SetBounds(const nsRect& aBounds) = 0; - - virtual void Show() = 0; - - virtual void Hide() = 0; - - NS_IMETHOD LoadURL(const nsString& aURLSpec) = 0; - - virtual nsIWidget* GetWWWindow() = 0; - -}; - -#endif /* nsIDocumentWidget_h___ */ diff --git a/mozilla/webshell/public/nsILinkHandler.h b/mozilla/webshell/public/nsILinkHandler.h deleted file mode 100644 index 8163ef04eed..00000000000 --- a/mozilla/webshell/public/nsILinkHandler.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsILinkHandler_h___ -#define nsILinkHandler_h___ - -#include "nsweb.h" -#include "nsIWebWidget.h" -class nsIFrame; -class nsString; -struct nsGUIEvent; - -/* 52bd1e30-ce3f-11d1-9328-00805f8add32 */ -#define NS_ILINKHANDLER_IID \ -{ 0x52bd1e30, 0xce3f, 0x11d1, \ - {0x93, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -/** - * Interface used for handling clicks on links - */ -class nsILinkHandler : public nsISupports { -public: - NS_IMETHOD Init(nsIWebWidget* aWidget) = 0; - - NS_IMETHOD GetWebWidget(nsIWebWidget** aResult) = 0; - - /** - * Process a click on a link. aFrame is the frame that contains the - * linked content. aURLSpec is an absolute url spec that defines the - * destination for the link. aTargetSpec indicates where the link is - * targeted (it may be an empty string). - */ - NS_IMETHOD OnLinkClick(nsIFrame* aFrame, const nsString& aURLSpec, - const nsString& aTargetSpec) = 0; -}; - -// Standard link handler that does what you would expect (XXX doc...) -extern NS_WEB nsresult NS_NewLinkHandler(nsILinkHandler** aInstancePtrResult); - -#endif /* nsILinkHandler_h___ */ diff --git a/mozilla/webshell/public/nsIShellInstance.h b/mozilla/webshell/public/nsIShellInstance.h deleted file mode 100644 index 9ae53031ec0..00000000000 --- a/mozilla/webshell/public/nsIShellInstance.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIShellInstance_h___ -#define nsIShellInstance_h___ - -#include "nsISupports.h" -#include "nsIApplicationShell.h" -#include "nsweb.h" -#include "nscore.h" - -// bf88e640-df99-11d1-9244-00805f8a7ab6 -#define NS_ISHELLINSTANCE_IID \ - { 0xbf88e640, 0xdf99, 0x11d1, \ - {0x92, 0x44, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } - -//c6efb6c0-df99-11d1-9244-00805f8a7ab6 -#define NS_ISHELLINSTANCE_CID \ - { 0xc6efb6c0, 0xdf99, 0x11d1, \ - {0x92, 0x44, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } - - -// Interface to the application shell. -class nsIShellInstance : public nsISupports { -public: - // Create a native window for this web widget; may be called once - NS_IMETHOD Init() = 0; - - NS_IMETHOD Run() = 0; - - NS_IMETHOD_(void *) GetNativeInstance() = 0; - NS_IMETHOD_(void) SetNativeInstance(void * aNativeInstance) = 0; - - NS_IMETHOD_(nsIApplicationShell *) GetApplicationShell() = 0; - NS_IMETHOD_(void) SetApplicationShell(nsIApplicationShell * aApplicationShell) = 0; - -}; - -#endif /* nsIShellInstance_h___ */ diff --git a/mozilla/webshell/public/nsIWebWidget.h b/mozilla/webshell/public/nsIWebWidget.h deleted file mode 100644 index c6bd68abca4..00000000000 --- a/mozilla/webshell/public/nsIWebWidget.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIWebWidget_h___ -#define nsIWebWidget_h___ - -#include "nsweb.h" -#include "nsIDocumentWidget.h" -class nsILinkHandler; -class nsIPresContext; -class nsIStyleSet; -class nsIScriptContext; - -// IID for the nsWebWidget interface -#define NS_IWEBWIDGET_IID \ - { 0x02606880, 0x94e1, 0x11d1, \ - {0x89, 0x5c, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} } - -// Interface to the web widget. The web widget is a container for web -// content. -class nsIWebWidget : public nsIDocumentWidget { -public: - - // Create a native window for this web widget; may be called once - virtual nsresult Init(nsNativeWindow aNativeParent, - const nsRect& aBounds) = 0; - - // Create a native window for this web widget; may be called once. - // Use the given presentation context and document for the widget - // (this widget becomes a second view on the document using the - // context for presentation). - virtual nsresult Init(nsNativeWindow aNativeParent, - const nsRect& aBounds, - nsIDocument* aDocument, - nsIPresContext* aPresContext) = 0; - - NS_IMETHOD SetContainer(nsISupports* aContainer) = 0; - - NS_IMETHOD GetContainer(nsISupports** aResult) = 0; - - NS_IMETHOD SetLinkHandler(nsILinkHandler* aHandler) = 0; - - NS_IMETHOD GetLinkHandler(nsILinkHandler** aResult) = 0; - - virtual nsIDocument* GetDocument() = 0; - - virtual void DumpContent(FILE* out = nsnull) = 0; - - virtual void DumpFrames(FILE* out = nsnull) = 0; - - virtual void DumpStyle(FILE* out = nsnull) = 0; - - virtual void DumpViews(FILE* out = nsnull) = 0; - - virtual void ShowFrameBorders(PRBool aEnable) = 0; - - virtual PRBool GetShowFrameBorders() = 0; - - virtual nsresult GetScriptContext(nsIScriptContext **aContext) = 0; - virtual nsresult ReleaseScriptContext() = 0; - -}; - -// Create a new web widget that uses the default (galley) presentation -// context. -extern NS_WEB nsresult NS_NewWebWidget(nsIWebWidget** aInstancePtrResult); - -#endif /* nsWebWidget_h___ */ diff --git a/mozilla/webshell/public/nsweb.h b/mozilla/webshell/public/nsweb.h deleted file mode 100644 index 56701ef2c6b..00000000000 --- a/mozilla/webshell/public/nsweb.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsweb_h___ -#define nsweb_h___ - -#ifdef _IMPL_NS_WEB -#define NS_WEB NS_EXPORT -#else -#define NS_WEB NS_IMPORT -#endif - -#endif /* nsweb_h___ */ diff --git a/mozilla/webshell/src/Makefile b/mozilla/webshell/src/Makefile deleted file mode 100644 index 66bab8f9a76..00000000000 --- a/mozilla/webshell/src/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -MODULE=raptor - -DEFINES = -D_IMPL_NS_WEB - -CPPSRCS= \ - nsLinkHandler.cpp \ - nsShellInstance.cpp \ - nsApplicationManager.cpp \ - nsWebWidget.cpp \ - $(NULL) - -CPP_OBJS= \ - ./$(OBJDIR)/nsLinkHandler.o \ - ./$(OBJDIR)/nsShellInstance.o \ - ./$(OBJDIR)/nsApplicationManager.o \ - ./$(OBJDIR)/nsWebWidget.o \ - $(NULL) - -include $(DEPTH)/config/config.mk - -TARGETS = $(LIBRARY) - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/webshell/src/makefile.win b/mozilla/webshell/src/makefile.win deleted file mode 100644 index abf3f8e83df..00000000000 --- a/mozilla/webshell/src/makefile.win +++ /dev/null @@ -1,76 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS = windows - -DEFINES=-D_IMPL_NS_WEB -DWIN32_LEAN_AND_MEAN -MODULE=raptor - -EXPORTS = \ - nsShellInstance.h \ - nsApplicationManager.h \ - $(NULL) - -CPPSRCS= \ - nsLinkHandler.cpp \ - nsShellInstance.cpp \ - nsApplicationManager.cpp \ - nsWebWidget.cpp \ - $(NULL) - -CPP_OBJS= \ - .\$(OBJDIR)\nsLinkHandler.obj \ - .\$(OBJDIR)\nsShellInstance.obj \ - .\$(OBJDIR)\nsApplicationManager.obj \ - .\$(OBJDIR)\nsWebWidget.obj \ - $(NULL) - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor -I$(XPDIST)\public\dom -I$(XPDIST)\public\js - -MAKE_OBJ_TYPE = DLL -DLLNAME = raptorweb -DLL=.\$(OBJDIR)\$(DLLNAME).dll - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -# These are the libraries we need to link with to create the dll -LLIBS= \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorhtml.lib \ - $(DIST)\lib\img3240.lib \ - $(DIST)\lib\util.lib \ - $(DIST)\lib\libplc21.lib \ - $(DIST)\lib\jsdom.lib \ - $(LIBNSPR) - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib - -clobber:: - rm -f $(DIST)\bin\$(DLLNAME).dll - rm -f $(DIST)\lib\$(DLLNAME).lib diff --git a/mozilla/webshell/src/nsApplicationManager.cpp b/mozilla/webshell/src/nsApplicationManager.cpp deleted file mode 100644 index 5359c17f40c..00000000000 --- a/mozilla/webshell/src/nsApplicationManager.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "NSApplicationManager.h" - -nsHashtable * NSApplicationManager::applications = NULL; -PRMonitor *NSApplicationManager::monitor = NULL; - -class ApplicationEntry { -public: - nsIApplicationShell * applicationshell; - nsIShellInstance * shellinstance; - - ApplicationEntry(nsIApplicationShell * aApplicationShell, - nsIShellInstance * aShellInstance) { - applicationshell = aApplicationShell; - shellinstance = aShellInstance; - } - ~ApplicationEntry() { - } -}; - -class AppKey: public nsHashKey { -private: - nsIApplicationShell * applicationshell; - -public: - AppKey(nsIApplicationShell * aApplicationShell) { - applicationshell = aApplicationShell; - } - - PRUint32 HashValue(void) const { - return ((PRUint32) (applicationshell)); - } - - PRBool Equals(const nsHashKey *aKey) const { - return ((PRBool)(applicationshell == ((AppKey *)aKey)->applicationshell)); - } - - nsHashKey *Clone(void) const { - return new AppKey(applicationshell); - } -}; - - - -nsresult NSApplicationManager::GetShellInstance(nsIApplicationShell * aApplicationShell, - nsIShellInstance **aShellInstance) -{ - checkInitialized(); - - if (aShellInstance == NULL) { - return NS_ERROR_NULL_POINTER; - } - - PR_EnterMonitor(monitor); - - AppKey key(aApplicationShell); - ApplicationEntry *entry = (ApplicationEntry*) applications->Get(&key); - - nsresult res = NS_ERROR_FAILURE; - - PR_ExitMonitor(monitor); - - if (entry != NULL) { - *aShellInstance = entry->shellinstance; - (*aShellInstance)->AddRef(); - res = NS_OK; - } - - return res; -} - -nsresult NSApplicationManager::checkInitialized() -{ - nsresult res = NS_OK; - if (applications == NULL) { - res = Initialize(); - } - return res; -} - -nsresult NSApplicationManager::Initialize() -{ - if (applications == NULL) { - applications = new nsHashtable(); - } - if (monitor == NULL) { - monitor = PR_NewMonitor(); - } - - return NS_OK; -} - - -nsresult NSApplicationManager::SetShellAssociation(nsIApplicationShell * aApplicationShell, - nsIShellInstance *aShellInstance) -{ - checkInitialized(); - - nsIShellInstance *old = NULL; - GetShellInstance(aApplicationShell, &old); - - if (old != NULL) { - old->Release(); - return NS_ERROR_FAILURE; - } - - PR_EnterMonitor(monitor); - - AppKey key(aApplicationShell); - applications->Put(&key, new ApplicationEntry(aApplicationShell, aShellInstance)); - - PR_ExitMonitor(monitor); - - return NS_OK; -} - -nsresult NSApplicationManager::DeleteShellAssociation(nsIApplicationShell * aApplicationShell, - nsIShellInstance *aShellInstance) -{ - checkInitialized(); - - nsIShellInstance *old = NULL; - GetShellInstance(aApplicationShell, &old); - - nsresult res = NS_ERROR_FACTORY_NOT_REGISTERED; - if (old != NULL) { - if (old == aShellInstance) { - PR_EnterMonitor(monitor); - - AppKey key(aApplicationShell); - ApplicationEntry *entry = (ApplicationEntry *) applications->Remove(&key); - delete entry; - - PR_ExitMonitor(monitor); - - res = NS_OK; - } - old->Release(); - } - - return res; -} - diff --git a/mozilla/webshell/src/nsApplicationManager.h b/mozilla/webshell/src/nsApplicationManager.h deleted file mode 100644 index 1274e3e1a44..00000000000 --- a/mozilla/webshell/src/nsApplicationManager.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef __nsApplicationManager_h -#define __nsApplicationManager_h - - -#include "nscore.h" -#include "plstr.h" -#include "prtypes.h" -#include "prmon.h" -#include "plstr.h" -#include "nsCom.h" -#include "nsweb.h" -#include "nsHashtable.h" -#include "nsIShellInstance.h" -#include "nsIApplicationShell.h" - - -class NS_WEB NSApplicationManager { -private: - static PRMonitor *monitor; - static nsHashtable * applications; - - static nsresult checkInitialized(); - -public: - static nsresult Initialize(); - - static nsresult GetShellInstance(nsIApplicationShell * aApplicationShell, - nsIShellInstance **aShellInstance); - - static nsresult SetShellAssociation(nsIApplicationShell * aApplicationShell, - nsIShellInstance *aShellInstance); - - static nsresult DeleteShellAssociation(nsIApplicationShell * aApplicationShell, - nsIShellInstance *aShellInstance); - -}; - -#endif diff --git a/mozilla/webshell/src/nsLinkHandler.cpp b/mozilla/webshell/src/nsLinkHandler.cpp deleted file mode 100644 index a540ee16af9..00000000000 --- a/mozilla/webshell/src/nsLinkHandler.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsILinkHandler.h" -#include "nsString.h" -#include "nsCRT.h" -#include "prthread.h" -#include "plevent.h" - -static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID); - -class LinkHandlerImpl : public nsILinkHandler { -public: - LinkHandlerImpl(); - ~LinkHandlerImpl(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - // nsISupports - NS_DECL_ISUPPORTS; - - // nsILinkHandler - NS_IMETHOD Init(nsIWebWidget* aWidget); - NS_IMETHOD GetWebWidget(nsIWebWidget** aResult); - NS_IMETHOD OnLinkClick(nsIFrame* aFrame, const nsString& aURLSpec, - const nsString& aTargetSpec); - - void HandleLinkClickEvent(const nsString& aURLSpec, - const nsString& aTargetSpec); - - nsIWebWidget* mWidget; -}; - -//---------------------------------------------------------------------- - -struct OnLinkClickEvent : public PLEvent { - OnLinkClickEvent(LinkHandlerImpl* aHandler, const nsString& aURLSpec, - const nsString& aTargetSpec); - ~OnLinkClickEvent(); - - void HandleEvent(); - - LinkHandlerImpl* mHandler; - nsString* mURLSpec; - nsString* mTargetSpec; -}; - -static void PR_CALLBACK HandleEvent(OnLinkClickEvent* aEvent) -{ - aEvent->HandleEvent(); -} - -static void PR_CALLBACK DestroyEvent(OnLinkClickEvent* aEvent) -{ - delete aEvent; -} - -OnLinkClickEvent::OnLinkClickEvent(LinkHandlerImpl* aHandler, - const nsString& aURLSpec, - const nsString& aTargetSpec) -{ - mHandler = aHandler; - NS_ADDREF(aHandler); - mURLSpec = new nsString(aURLSpec); - mTargetSpec = new nsString(aTargetSpec); - - PL_InitEvent(this, nsnull, - (PLHandleEventProc) ::HandleEvent, - (PLDestroyEventProc) ::DestroyEvent); - -#ifdef XP_PC - PLEventQueue* eventQueue = PL_GetMainEventQueue(); -#endif - PL_PostEvent(eventQueue, this); -} - -OnLinkClickEvent::~OnLinkClickEvent() -{ - NS_IF_RELEASE(mHandler); - if (nsnull != mURLSpec) delete mURLSpec; - if (nsnull != mTargetSpec) delete mTargetSpec; -} - -void OnLinkClickEvent::HandleEvent() -{ - mHandler->HandleLinkClickEvent(*mURLSpec, *mTargetSpec); -} - -//---------------------------------------------------------------------- - -LinkHandlerImpl::LinkHandlerImpl() -{ -} - -LinkHandlerImpl::~LinkHandlerImpl() -{ -} - -NS_IMPL_ISUPPORTS(LinkHandlerImpl, kILinkHandlerIID); - -// this Init method assumes that the nsIWebWidget passed in owns this -// LinkHandlerImpl also, so it wont refcount the aWidget. -NS_IMETHODIMP LinkHandlerImpl::Init(nsIWebWidget* aWidget) -{ - NS_PRECONDITION(nsnull != aWidget, "null ptr"); - NS_PRECONDITION(nsnull == mWidget, "init twice"); - if (nsnull == aWidget) { - return NS_ERROR_NULL_POINTER; - } - if (nsnull != mWidget) { - return NS_ERROR_ALREADY_INITIALIZED; - } - mWidget = aWidget; - //NS_ADDREF(mWidget); // this widget is owned by the same owner of the LinkHandler, no circular ref. - return NS_OK; -} - -NS_IMETHODIMP LinkHandlerImpl::GetWebWidget(nsIWebWidget** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mWidget; - NS_IF_ADDREF(mWidget); - return NS_OK; -} - -NS_IMETHODIMP LinkHandlerImpl::OnLinkClick(nsIFrame* aFrame, - const nsString& aURLSpec, - const nsString& aTargetSpec) - -{ - new OnLinkClickEvent(this, aURLSpec, aTargetSpec); - return NS_OK; -} - -void LinkHandlerImpl::HandleLinkClickEvent(const nsString& aURLSpec, - const nsString& aTargetSpec) -{ - if (nsnull != mWidget) { - mWidget->LoadURL(aURLSpec); - } -} - -NS_WEB nsresult NS_NewLinkHandler(nsILinkHandler** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - LinkHandlerImpl* it = new LinkHandlerImpl(); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kILinkHandlerIID, (void**) aInstancePtrResult); -} diff --git a/mozilla/webshell/src/nsShellInstance.cpp b/mozilla/webshell/src/nsShellInstance.cpp deleted file mode 100644 index c5ec0a85ca4..00000000000 --- a/mozilla/webshell/src/nsShellInstance.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include - -#ifdef _WIN32 -#include "windows.h" -#endif - -#include "nscore.h" -#include "nsISupports.h" -#include "nsIShellInstance.h" -#include "nsShellInstance.h" - -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); -static NS_DEFINE_IID(kIShellInstanceIID, NS_ISHELLINSTANCE_IID); -static NS_DEFINE_CID(kIShellInstanceCID, NS_ISHELLINSTANCE_CID); -static NS_DEFINE_CID(kCShellInstanceIID, NS_ISHELLINSTANCE_CID); - -class nsShellInstanceFactory : public nsIFactory { - -public: - nsShellInstanceFactory(); - ~nsShellInstanceFactory(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD CreateInstance(nsISupports * aOuter, - const nsIID &aIID, - void ** aResult); - - NS_IMETHOD LockFactory(PRBool aLock); - -}; - -nsShellInstance::nsShellInstance() -{ -} - -nsShellInstance::~nsShellInstance() -{ -} - -NS_IMPL_ADDREF(nsShellInstance) -NS_IMPL_RELEASE(nsShellInstance) -NS_IMPL_QUERY_INTERFACE(nsShellInstance,NS_ISHELLINSTANCE_CID); - -nsresult nsShellInstance::Init() -{ - nsresult res = NS_OK; - - RegisterFactories() ; - - return res; -} - -nsresult nsShellInstance::Run() -{ -#ifdef _WIN32 - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return ((nsresult)msg.wParam); -#else - return NS_OK; -#endif -} - -void * nsShellInstance::GetNativeInstance() -{ - return mNativeInstance ; -} - -void nsShellInstance::SetNativeInstance(void * aNativeInstance) -{ - mNativeInstance = aNativeInstance; - return ; -} - -nsIApplicationShell * nsShellInstance::GetApplicationShell() -{ - return mApplicationShell ; -} - -void nsShellInstance::SetApplicationShell(nsIApplicationShell * aApplicationShell) -{ - mApplicationShell = aApplicationShell; - return ; -} - -// XXX We really need a standard way to enumerate -// a set of libraries and call their self -// registration routines... when that code is -// XP of course. -nsresult nsShellInstance::RegisterFactories() -{ - #define WIDGET_DLL "raptorwidget.dll" - #define GFXWIN_DLL "raptorgfxwin.dll" - - static NS_DEFINE_IID(kCWindowIID, NS_WINDOW_CID); - static NS_DEFINE_IID(kCChildWindowIID, NS_CHILD_CID); - static NS_DEFINE_IID(kCScrollbarIID, NS_VERTSCROLLBAR_CID); - - NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCChildWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - - static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID); - - NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - - return NS_OK; -} - -nsShellInstanceFactory::nsShellInstanceFactory() -{ -} - -nsShellInstanceFactory::~nsShellInstanceFactory() -{ -} - -nsresult nsShellInstanceFactory::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - - if (aIID.Equals(kIFactoryIID)) { - *aInstancePtr = (void*)(nsShellInstanceFactory*)this; - AddRef(); - return NS_OK; - } - - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*)(nsISupports*)(nsShellInstanceFactory*)this; - AddRef(); - return NS_OK; - } - - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(nsShellInstanceFactory) -NS_IMPL_RELEASE(nsShellInstanceFactory) - -nsresult nsShellInstanceFactory::CreateInstance(nsISupports * aOuter, - const nsIID &aIID, - void ** aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = NULL ; - - nsISupports * inst = new nsShellInstance() ; - - if (inst == NULL) { - return NS_ERROR_OUT_OF_MEMORY; - } - - nsresult res = inst->QueryInterface(aIID, aResult); - - if (res != NS_OK) { - delete inst ; - } - - return res; - -} - -nsresult nsShellInstanceFactory::LockFactory(PRBool aLock) -{ - return NS_OK; -} - -// return the proper factory to the caller -extern "C" NS_WEB nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -{ - if (nsnull == aFactory) { - return NS_ERROR_NULL_POINTER; - } - - *aFactory = new nsShellInstanceFactory(); - - if (nsnull == aFactory) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory); -} - - -NS_WEB nsresult NS_NewShellInstance(nsIShellInstance** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsShellInstance* it = new nsShellInstance(); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIShellInstanceIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/webshell/src/nsShellInstance.h b/mozilla/webshell/src/nsShellInstance.h deleted file mode 100644 index ba9da49faad..00000000000 --- a/mozilla/webshell/src/nsShellInstance.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nsIApplicationShell.h" -#include "nsIFactory.h" -#include "nscore.h" -#include "nsweb.h" -#include "nsCRT.h" -#include "nsIShellInstance.h" - -// platform independent native handle to application instance -typedef void * nsNativeApplicationInstance ; - -class nsShellInstance : public nsIShellInstance { -public: - nsShellInstance(); - ~nsShellInstance(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - NS_IMETHOD Init(); - - NS_IMETHOD Run(); - - NS_METHOD RegisterFactories(); - - NS_METHOD_(void *) GetNativeInstance(); - NS_METHOD_(void) SetNativeInstance(void * aNativeInstance); - - NS_METHOD_(nsIApplicationShell *) GetApplicationShell(); - NS_METHOD_(void) SetApplicationShell(nsIApplicationShell * aApplicationShell); - - -private: - nsNativeApplicationInstance mNativeInstance ; - nsIApplicationShell * mApplicationShell ; -}; - - diff --git a/mozilla/webshell/src/nsWebWidget.cpp b/mozilla/webshell/src/nsWebWidget.cpp deleted file mode 100644 index b0e9c071623..00000000000 --- a/mozilla/webshell/src/nsWebWidget.cpp +++ /dev/null @@ -1,683 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nsIWebWidget.h" -#include "nsILinkHandler.h" -#include "nsIURL.h" -#include "nsIPresContext.h" -#include "nsIPresShell.h" -#include "nsIContent.h" -#include "nsIDocument.h" -#include "nsIFrame.h" -#include "nsIWidget.h" -#include "nsIScrollbar.h" -#include "nsUnitConversion.h" -#include "nsViewsCID.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsCRT.h" -#include "nsIStyleSet.h" -#include "nsIStyleSheet.h" -#include "nsWidgetsCID.h" -#include "nsString.h" -#include "nsIScriptContext.h" -#include "nsIScriptObjectOwner.h" - -#include "nsICSSParser.h" - -#define UA_CSS_URL "resource:/res/ua.css" - -#define GET_OUTER() \ - ((nsWebWidget*) ((char*)this - nsWebWidget::GetOuterOffset())) - -// Machine independent implementation portion of the web widget -class WebWidgetImpl : public nsIWebWidget, public nsIScriptObjectOwner { -public: - WebWidgetImpl(); - ~WebWidgetImpl(); - - void* operator new(size_t sz) { - void* rv = new char[sz]; - nsCRT::zero(rv, sz); - return rv; - } - - NS_DECL_ISUPPORTS - - virtual nsresult Init(nsNativeWindow aParent, - const nsRect& aBounds); - virtual nsresult Init(nsNativeWindow aParent, - const nsRect& aBounds, - nsIDocument* aDocument, - nsIPresContext* aPresContext); - - virtual nsRect GetBounds(); - virtual void SetBounds(const nsRect& aBounds); - virtual void Show(); - virtual void Hide(); - - NS_IMETHOD SetContainer(nsISupports* aContainer); - - NS_IMETHOD GetContainer(nsISupports** aResult); - - NS_IMETHOD SetLinkHandler(nsILinkHandler* aHandler); - - NS_IMETHOD GetLinkHandler(nsILinkHandler** aResult); - - NS_IMETHOD LoadURL(const nsString& aURL); - - virtual nsIDocument* GetDocument(); - - virtual void DumpContent(FILE* out); - virtual void DumpFrames(FILE* out); - virtual void DumpStyle(FILE* out); - virtual void DumpViews(FILE* out); - virtual void ShowFrameBorders(PRBool aEnable); - virtual PRBool GetShowFrameBorders(); - virtual nsIWidget* GetWWWindow(); - virtual nsresult GetScriptContext(nsIScriptContext **aContext); - virtual nsresult ReleaseScriptContext(); - - virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject); - virtual nsresult ResetScriptObject(); - -private: - nsresult ProvideDefaultHandlers(); - void ForceRefresh(); - nsresult MakeWindow(nsNativeWindow aParent, const nsRect& aBounds); - nsresult InitUAStyleSheet(void); - nsresult CreateStyleSet(nsIDocument* aDocument, nsIStyleSet** aStyleSet); - - nsIWidget* mWindow; - nsIView *mView; - nsIViewManager *mViewManager; - nsIPresContext* mPresContext; - nsIPresShell* mPresShell; - nsIStyleSheet* mUAStyleSheet; - nsILinkHandler* mLinkHandler; - nsISupports* mContainer; - nsIScriptContext* mScriptContext; - void* mScriptObject; -}; - -//---------------------------------------------------------------------- - -static NS_DEFINE_IID(kIWebWidgetIID, NS_IWEBWIDGET_IID); - -// Note: operator new zeros our memory -WebWidgetImpl::WebWidgetImpl() -{ -} - -nsresult WebWidgetImpl::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID); - if (aIID.Equals(kIWebWidgetIID)) { - *aInstancePtr = (void*)(nsIWebWidget*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kIScriptObjectOwnerIID)) { - *aInstancePtr = (void*)(nsIScriptObjectOwner*)this; - AddRef(); - return NS_OK; - } - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*)(nsISupports*)(nsIWebWidget*)this; - AddRef(); - return NS_OK; - } - return NS_NOINTERFACE; -} - -NS_IMPL_ADDREF(WebWidgetImpl) -NS_IMPL_RELEASE(WebWidgetImpl) - -WebWidgetImpl::~WebWidgetImpl() -{ - // Release windows and views - NS_IF_RELEASE(mViewManager); - NS_IF_RELEASE(mWindow); - NS_IF_RELEASE(mView); - - NS_IF_RELEASE(mContainer); - NS_IF_RELEASE(mLinkHandler); - - // Note: release context then shell - NS_IF_RELEASE(mPresContext); - NS_IF_RELEASE(mPresShell); - NS_IF_RELEASE(mUAStyleSheet); - - NS_IF_RELEASE(mScriptContext); -} - -nsresult WebWidgetImpl::MakeWindow(nsNativeWindow aNativeParent, - const nsRect& aBounds) -{ - nsresult rv; - static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID); - static NS_DEFINE_IID(kIViewManagerIID, NS_IVIEWMANAGER_IID); - - rv = NSRepository::CreateInstance(kViewManagerCID, - nsnull, - kIViewManagerIID, - (void **)&mViewManager); - - if ((NS_OK != rv) || (NS_OK != mViewManager->Init(mPresContext))) { - return rv; - } - - nsRect tbounds = aBounds; - tbounds *= mPresContext->GetPixelsToTwips(); - - // Create a child window of the parent that is our "root view/window" - // Create a view - static NS_DEFINE_IID(kScrollingViewCID, NS_SCROLLING_VIEW_CID); - static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); - - rv = NSRepository::CreateInstance(kScrollingViewCID, - nsnull, - kIViewIID, - (void **)&mView); - - static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID); - if ((NS_OK != rv) || (NS_OK != mView->Init(mViewManager, - tbounds, - nsnull, - &kWidgetCID, - nsnull, - aNativeParent))) { - return rv; - } - - // Setup hierarchical relationship in view manager - mViewManager->SetRootView(mView); - mWindow = mView->GetWidget(); - if (mWindow) { - mViewManager->SetRootWindow(mWindow); - } - - return rv; -} - -nsresult WebWidgetImpl::Init(nsNativeWindow aNativeParent, - const nsRect& aBounds) -{ - // Create presentation context - nsresult rv = NS_NewGalleyContext(&mPresContext); - if (NS_OK != rv) { - return rv; - } - return MakeWindow(aNativeParent, aBounds); -} - -nsresult WebWidgetImpl::InitUAStyleSheet(void) -{ - nsresult rv = NS_OK; - - if (nsnull == mUAStyleSheet) { // snarf one - nsIURL* uaURL; - rv = NS_NewURL(&uaURL, nsnull, UA_CSS_URL); // XXX this bites, fix it - if (NS_OK == rv) { - // Get an input stream from the url - PRInt32 ec; - nsIInputStream* in = uaURL->Open(&ec); - if (nsnull != in) { - // Translate the input using the argument character set id into unicode - nsIUnicharInputStream* uin; - rv = NS_NewConverterStream(&uin, nsnull, in); - if (NS_OK == rv) { - // Create parser and set it up to process the input file - nsICSSParser* css; - rv = NS_NewCSSParser(&css); - if (NS_OK == rv) { - // Parse the input and produce a style set - mUAStyleSheet = css->Parse(&ec, uin, uaURL); - - NS_RELEASE(css); - } - NS_RELEASE(uin); - } - NS_RELEASE(in); - } - else { -// printf("open of %s failed: error=%x\n", UA_CSS_URL, ec); - rv = NS_ERROR_ILLEGAL_VALUE; // XXX need a better error code here - } - - NS_RELEASE(uaURL); - } - } - return rv; -} - -nsresult WebWidgetImpl::Init(nsNativeWindow aNativeParent, - const nsRect& aBounds, - nsIDocument* aDocument, - nsIPresContext* aPresContext) -{ - NS_PRECONDITION(nsnull != aPresContext, "null ptr"); - NS_PRECONDITION(nsnull != aDocument, "null ptr"); - if ((nsnull == aPresContext) || (nsnull == aDocument)) { - return NS_ERROR_NULL_POINTER; - } - - mPresContext = aPresContext; - NS_ADDREF(aPresContext); - - nsresult rv = MakeWindow(aNativeParent, aBounds); - if (NS_OK != rv) { - return rv; - } - - nsIStyleSet* styleSet; - rv = CreateStyleSet(aDocument, &styleSet); - if (NS_OK != rv) { - return rv; - } - - // Now make the shell for the document - rv = aDocument->CreateShell(mPresContext, mViewManager, styleSet, - &mPresShell); - NS_RELEASE(styleSet); - if (NS_OK != rv) { - return rv; - } - - // Now that we have a presentation shell trigger a reflow so we - // create a frame model - nsRect bounds; - mWindow->GetBounds(bounds); - if (nsnull != mPresShell) { - nscoord width = bounds.width; - nscoord height = bounds.height; - width = NS_TO_INT_ROUND(width * mPresContext->GetPixelsToTwips()); - height = NS_TO_INT_ROUND(height * mPresContext->GetPixelsToTwips()); - mViewManager->SetWindowDimensions(width, height); - } - ForceRefresh(); - return rv; -} - -nsRect WebWidgetImpl::GetBounds() -{ - NS_PRECONDITION(nsnull != mWindow, "null window"); - nsRect zr(0, 0, 0, 0); - if (nsnull != mWindow) { - mWindow->GetBounds(zr); - } - return zr; -} - -void WebWidgetImpl::SetBounds(const nsRect& aBounds) -{ - NS_PRECONDITION(nsnull != mWindow, "null window"); - if (nsnull != mWindow) { - mWindow->Resize(aBounds.x, aBounds.y, aBounds.width, aBounds.height); - } -} - -void WebWidgetImpl::Show() -{ - NS_PRECONDITION(nsnull != mWindow, "null window"); - if (nsnull != mWindow) { - mWindow->Show(PR_TRUE); - } -} - -void WebWidgetImpl::Hide() -{ - NS_PRECONDITION(nsnull != mWindow, "null window"); - if (nsnull != mWindow) { - mWindow->Show(PR_FALSE); - } -} - -nsresult WebWidgetImpl::ProvideDefaultHandlers() -{ - // Provide a default link handler if needed - if (nsnull == mLinkHandler) { - nsresult rv = NS_NewLinkHandler(&mLinkHandler); - if (NS_OK != rv) { - return rv; - } - if (NS_OK != mLinkHandler->Init(this)) { - NS_RELEASE(mLinkHandler); - return rv; - } - if (nsnull != mPresContext) { - mPresContext->SetLinkHandler(mLinkHandler); - } - } - return NS_OK; -} - -// XXX need to save old document in case of failure? Does caller do that? - -NS_IMETHODIMP WebWidgetImpl::LoadURL(const nsString& aURLSpec) -{ -#ifdef NS_DEBUG - printf("WebWidgetImpl::LoadURL: loadURL("); - fputs(aURLSpec, stdout); - printf(")\n"); -#endif - - nsresult rv = ProvideDefaultHandlers(); - if (NS_OK != rv) { - return rv; - } - - nsIURL* url; - rv = NS_NewURL(&url, aURLSpec); - if (NS_OK != rv) { - return rv; - } - - - if (nsnull != mPresShell) { - // Break circular reference first - mPresShell->EndObservingDocument(); - - // Then release the shell - NS_RELEASE(mPresShell); - mPresShell = nsnull; - } - - // Create document - nsIDocument* doc; - rv = NS_NewHTMLDocument(&doc); - - // Create style set - nsIStyleSet* styleSet = nsnull; - rv = CreateStyleSet(doc, &styleSet); - if (NS_OK != rv) { - NS_RELEASE(doc); - return rv; - } - - // Create presentation shell - rv = doc->CreateShell(mPresContext, mViewManager, styleSet, &mPresShell); - NS_RELEASE(styleSet); - if (NS_OK != rv) { - NS_RELEASE(doc); - return rv; - } - - // Setup view manager's window - nsRect bounds; - mWindow->GetBounds(bounds); - if (nsnull != mPresShell) { - float p2t = mPresContext->GetPixelsToTwips(); - nscoord width = NS_TO_INT_ROUND(bounds.width * p2t); - nscoord height = NS_TO_INT_ROUND(bounds.height * p2t); - mViewManager->SetWindowDimensions(width, height); - } - - // Now load the document - doc->LoadURL(url); - - NS_RELEASE(doc); - - ForceRefresh();/* XXX temporary */ - - return NS_OK; -} - -nsIDocument* WebWidgetImpl::GetDocument() -{ - if (nsnull != mPresShell) { - return mPresShell->GetDocument(); - } - return nsnull; -} - -NS_IMETHODIMP WebWidgetImpl::SetLinkHandler(nsILinkHandler* aHandler) -{ // XXX this should probably be a WEAK reference - NS_IF_RELEASE(mLinkHandler); - mLinkHandler = aHandler; - NS_IF_ADDREF(aHandler); - if (nsnull != mPresContext) { - mPresContext->SetLinkHandler(aHandler); - } - return NS_OK; -} - -NS_IMETHODIMP WebWidgetImpl::GetLinkHandler(nsILinkHandler** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mLinkHandler; - NS_IF_ADDREF(mLinkHandler); - return NS_OK; -} - -NS_IMETHODIMP WebWidgetImpl::SetContainer(nsISupports* aContainer) -{ // XXX this should most likely be a WEAK reference - NS_IF_RELEASE(mContainer); - mContainer = aContainer; - NS_IF_ADDREF(aContainer); - if (nsnull != mPresContext) { - mPresContext->SetContainer(aContainer); - } - return NS_OK; -} - -NS_IMETHODIMP WebWidgetImpl::GetContainer(nsISupports** aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = mContainer; - NS_IF_ADDREF(mContainer); - return NS_OK; -} - -//---------------------------------------------------------------------- -// Debugging methods - -void WebWidgetImpl::DumpContent(FILE* out) -{ - if (nsnull == out) { - out = stdout; - } - if (nsnull != mPresShell) { - nsIDocument* doc = mPresShell->GetDocument(); - if (nsnull != doc) { - nsIContent* root = doc->GetRootContent(); - if (nsnull == root) { - fputs("null root content\n", out); - } else { - root->List(out); - NS_RELEASE(root); - } - NS_RELEASE(doc); - } else { - fputs("null document\n", out); - } - } else { - fputs("null pres shell\n", out); - } -} - -void WebWidgetImpl::DumpFrames(FILE* out) -{ - if (nsnull == out) { - out = stdout; - } - if (nsnull != mPresShell) { - nsIFrame* root = mPresShell->GetRootFrame(); - if (nsnull == root) { - fputs("null root frame\n", out); - } else { - root->List(out); - } - } else { - fputs("null pres shell\n", out); - } -} - -void WebWidgetImpl::DumpStyle(FILE* out) -{ - if (nsnull == out) { - out = stdout; - } - if (nsnull != mPresShell) { - nsIStyleSet* styleSet = mPresShell->GetStyleSet(); - if (nsnull == styleSet) { - fputs("null style set\n", out); - } else { - styleSet->List(out); - NS_RELEASE(styleSet); - } - } else { - fputs("null pres shell\n", out); - } -} - -void WebWidgetImpl::DumpViews(FILE* out) -{ - if (nsnull == out) { - out = stdout; - } - if (nsnull != mView) { - mView->List(out); - } else { - fputs("null view\n", out); - } -} - -void WebWidgetImpl::ShowFrameBorders(PRBool aEnable) -{ - nsIFrame::ShowFrameBorders(aEnable); - ForceRefresh(); -} - -PRBool WebWidgetImpl::GetShowFrameBorders() -{ - return nsIFrame::GetShowFrameBorders(); -} - -void WebWidgetImpl::ForceRefresh() -{ - mWindow->Invalidate(PR_TRUE); -} - -NS_WEB nsresult -NS_NewWebWidget(nsIWebWidget** aInstancePtrResult) -{ - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - WebWidgetImpl* it = new WebWidgetImpl(); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIWebWidgetIID, (void **) aInstancePtrResult); -} - -//---------------------------------------------------------------------- -// XXX temporary code - -nsresult WebWidgetImpl::CreateStyleSet(nsIDocument* aDocument, nsIStyleSet** aStyleSet) -{ // this should eventually get expanded to allow for creating different sets for different media - nsresult rv = InitUAStyleSheet(); - - if (NS_OK != rv) { - NS_WARNING("unable to load UA style sheet"); -// return rv; - } - - rv = NS_NewStyleSet(aStyleSet); - if (NS_OK == rv) { - PRInt32 count = aDocument->GetNumberOfStyleSheets(); - for (PRInt32 index = 0; index < count; index++) { - nsIStyleSheet* sheet = aDocument->GetStyleSheetAt(index); - (*aStyleSet)->AppendDocStyleSheet(sheet); - NS_RELEASE(sheet); - } - if (nsnull != mUAStyleSheet) { - (*aStyleSet)->AppendBackstopStyleSheet(mUAStyleSheet); - } - } - return rv; -} - -nsIWidget* WebWidgetImpl::GetWWWindow() -{ - if (nsnull != mWindow) { - NS_ADDREF(mWindow); - } - return mWindow; -} - -nsresult WebWidgetImpl::GetScriptContext(nsIScriptContext **aContext) -{ - NS_PRECONDITION(nsnull != aContext, "null arg"); - nsresult res = NS_OK; - - if (nsnull == mScriptContext) { - res = NS_CreateContext(this, &mScriptContext); - } - - if (NS_OK == res) { - NS_ADDREF(mScriptContext); - *aContext = mScriptContext; - } - - return res; -} - -nsresult WebWidgetImpl::ResetScriptObject() -{ - mScriptObject = nsnull; - return NS_OK; -} - -nsresult WebWidgetImpl::ReleaseScriptContext() -{ - NS_IF_RELEASE(mScriptContext); - mScriptContext = nsnull; - - return NS_OK; -} - -nsresult WebWidgetImpl::GetScriptObject(JSContext *aContext, void** aScriptObject) -{ - NS_PRECONDITION(nsnull != aScriptObject, "null arg"); - nsresult res = NS_OK; - if (nsnull == mScriptObject) { - mScriptObject = mScriptContext->GetGlobalObject(); - if (nsnull == mScriptObject) { - res = NS_ERROR_FAILURE; - } - } - - *aScriptObject = (void*)mScriptObject; - return res; -} - - - diff --git a/mozilla/webshell/src/windows/makefile.win b/mozilla/webshell/src/windows/makefile.win deleted file mode 100644 index 320de021c83..00000000000 --- a/mozilla/webshell/src/windows/makefile.win +++ /dev/null @@ -1,63 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -DEFINES=-D_IMPL_NS_WEB -DWIN32_LEAN_AND_MEAN - -MODULE=raptor - -CPPSRCS= \ - winmain.cpp \ - $(NULL) - -CPP_OBJS= \ - .\$(OBJDIR)\winmain.obj \ - $(NULL) - -LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor -I$(XPDIST)\public\dom -I$(XPDIST)\public\js - -MAKE_OBJ_TYPE = LIB - -LIBRARY_NAME=raptorwebwin_s - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -# These are the libraries we need to link with to create the dll -LLIBS= \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorhtml.lib \ - $(DIST)\lib\raptorweb.lib \ - $(DIST)\lib\img3240.lib \ - $(DIST)\lib\util.lib \ - $(DIST)\lib\libplc21.lib \ - $(DIST)\lib\jsdom.lib \ - $(LIBNSPR) - -include <$(DEPTH)\config\rules.mak> - -install:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - -clobber:: - rm -f $(DIST)\lib\$(LIBNAME).lib diff --git a/mozilla/webshell/src/windows/winmain.cpp b/mozilla/webshell/src/windows/winmain.cpp deleted file mode 100644 index c9f2d097cc8..00000000000 --- a/mozilla/webshell/src/windows/winmain.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the Private language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif - -#include -#include "nsRepository.h" -#include "nsShellInstance.h" -#include "nsApplicationManager.h" - -#define WEB_DLL "raptorweb.dll" - -extern nsIID kIXPCOMApplicationShellCID ; - -static NS_DEFINE_IID(kIApplicationShellIID, NS_IAPPLICATIONSHELL_IID); -static NS_DEFINE_IID(kCApplicationShellIID, NS_IAPPLICATIONSHELL_CID); -static NS_DEFINE_IID(kCShellInstanceIID, NS_ISHELLINSTANCE_CID); - -int PASCAL WinMain(HANDLE instance, HANDLE prevInstance, LPSTR cmdParam, int nCmdShow) -{ - nsresult result = NS_OK ; - - nsIShellInstance * pShellInstance ; - nsIApplicationShell * pApplicationShell ; - - // Let get a ShellInstance for this Application instance - NSRepository::RegisterFactory(kCShellInstanceIID, WEB_DLL, PR_FALSE, PR_FALSE); - - result = NSRepository::CreateInstance(kCShellInstanceIID, - NULL, - kCShellInstanceIID, - (void **) &pShellInstance) ; - - if (result != NS_OK) - return result ; - - // Let's instantiate the Application's Shell - NS_RegisterApplicationShellFactory() ; - - result = NSRepository::CreateInstance(kIXPCOMApplicationShellCID, - NULL, - kIXPCOMApplicationShellCID, - (void **) &pApplicationShell) ; - - if (result != NS_OK) - return result ; - - // Let the the State know who it's Application Instance is - pShellInstance->SetNativeInstance((nsNativeApplicationInstance) instance); - pShellInstance->SetApplicationShell(pApplicationShell); - - // Tell the application manager to store away the association so the - // Application can look up its State - NSApplicationManager::SetShellAssociation(pApplicationShell, pShellInstance); - - // Initialize the system - pShellInstance->Init(); - pApplicationShell->Init(); - - // Now, let actually start dispatching events. - result = pApplicationShell->Run(); - - // We're done, clean up - NSApplicationManager::DeleteShellAssociation(pApplicationShell, pShellInstance); - - // book out of here - return result; -} - -void main(int argc, char **argv) -{ - WinMain(GetModuleHandle(NULL), NULL, 0, SW_SHOW); -} diff --git a/mozilla/webshell/tests/Makefile b/mozilla/webshell/tests/Makefile deleted file mode 100644 index 0725c58d807..00000000000 --- a/mozilla/webshell/tests/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/webshell/tests/imgtest/ImageTest.cpp b/mozilla/webshell/tests/imgtest/ImageTest.cpp deleted file mode 100644 index 6c64e7162cc..00000000000 --- a/mozilla/webshell/tests/imgtest/ImageTest.cpp +++ /dev/null @@ -1,403 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -//we need openfilename stuff... MMP -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif -#include - -#include "prtypes.h" -#include -#include "resources.h" -#include "nsIImageManager.h" -#include "nsIImageGroup.h" -#include "nsIImageRequest.h" -#include "nsIImageObserver.h" -#include "nsIRenderingContext.h" -#include "nsIImage.h" -#include "nsIWidget.h" -#include "nsGUIEvent.h" -#include "nsRect.h" -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" - -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kIImageObserverIID, NS_IIMAGEREQUESTOBSERVER_IID); - -static NS_DEFINE_IID(kCWindowIID, NS_WINDOW_CID); -static NS_DEFINE_IID(kCChildWindowIID, NS_CHILD_CID); -static NS_DEFINE_IID(kCScrollbarIID, NS_VERTSCROLLBAR_CID); - -static char* class1Name = "ImageTest"; - -static HANDLE gInstance, gPrevInstance; -static nsIImageManager *gImageManager = nsnull; -static nsIImageGroup *gImageGroup = nsnull; -static nsIImageRequest *gImageReq = nsnull; -static HWND gHwnd; -static nsIWidget *gWindow = nsnull; -static nsIImage *gImage = nsnull; -static PRBool gInstalledColorMap = PR_FALSE; - -class MyObserver : public nsIImageRequestObserver { -public: - MyObserver(); - ~MyObserver(); - - NS_DECL_ISUPPORTS - - virtual void Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3); - - virtual void NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType); -}; - -MyObserver::MyObserver() -{ -} - -MyObserver::~MyObserver() -{ -} - -NS_IMPL_ISUPPORTS(MyObserver, kIImageObserverIID) - -void -MyObserver::Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3) -{ - switch (aNotificationType) { - case nsImageNotification_kDimensions: - { - char buffer[40]; - sprintf(buffer, "Image:%d x %d", aParam1, aParam2); - ::SetWindowText(gHwnd, buffer); - } - break; - - case nsImageNotification_kPixmapUpdate: - case nsImageNotification_kImageComplete: - case nsImageNotification_kFrameComplete: - { - if (gImage == nsnull && aImage) { - gImage = aImage; - NS_ADDREF(aImage); - } - - if (!gInstalledColorMap && gImage) { - nsColorMap *cmap = gImage->GetColorMap(); - - if (cmap != nsnull && cmap->NumColors > 0) { - gWindow->SetColorMap(cmap); - } - gInstalledColorMap = PR_TRUE; - } - nsRect *rect = (nsRect *)aParam3; - nsIRenderingContext *drawCtx = gWindow->GetRenderingContext(); - - if (gImage) { - drawCtx->DrawImage(gImage, 0, 0, - gImage->GetWidth(), gImage->GetHeight()); - } - } - break; - } -} - -void -MyObserver::NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType) -{ - ::MessageBox(NULL, "Image loading error!", - class1Name, MB_OK); -} - -nsEventStatus PR_CALLBACK -MyHandleEvent(nsGUIEvent *aEvent) -{ - nsEventStatus result = nsEventStatus_eConsumeNoDefault; - switch(aEvent->message) { - case NS_PAINT: - { - // paint the background - nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext; - drawCtx->SetColor(aEvent->widget->GetBackgroundColor()); - drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect)); - - if (gImage) { - drawCtx->DrawImage(gImage, 0, 0, - gImage->GetWidth(), gImage->GetHeight()); - } - - return nsEventStatus_eConsumeNoDefault; - } - break; - } - - return nsEventStatus_eIgnore; -} - -void -MyReleaseImages() -{ - if (gImageReq) { - NS_RELEASE(gImageReq); - gImageReq = NULL; - } - if (gImage) { - NS_RELEASE(gImage); - gImage = NULL; - } - - gInstalledColorMap = PR_FALSE; -} - -void -MyInterrupt() -{ - if (gImageGroup) { - gImageGroup->Interrupt(); - } -} - -#define FILE_URL_PREFIX "file://" - - -void -MyLoadImage(char *aFileName) -{ - char fileURL[256]; - char *str; - - MyInterrupt(); - MyReleaseImages(); - - if (gImageGroup == NULL) { - nsIRenderingContext *drawCtx = gWindow->GetRenderingContext(); - if (NS_NewImageGroup(&gImageGroup) != NS_OK || - gImageGroup->Init(drawCtx) != NS_OK) { - ::MessageBox(NULL, "Couldn't create image group", - class1Name, MB_OK); - NS_RELEASE(drawCtx); - return; - } - NS_RELEASE(drawCtx); - } - - strcpy(fileURL, FILE_URL_PREFIX); - strcpy(fileURL + strlen(FILE_URL_PREFIX), aFileName); - - str = fileURL; - while ((str = strchr(str, '\\')) != NULL) - *str = '/'; - - nscolor white; - MyObserver *observer = new MyObserver(); - - NS_ColorNameToRGB("white", &white); - gImageReq = gImageGroup->GetImage(fileURL, - observer, - white, 0, 0, 0); - if (gImageReq == NULL) { - ::MessageBox(NULL, "Couldn't create image request", - class1Name, MB_OK); - } -} - -PRBool -OpenFileDialog(char *aBuffer, int32 aBufLen) -{ - BOOL result = FALSE; - OPENFILENAME ofn; - - // *.js is the standard File Name on the Save/Open Dialog - ::strcpy(aBuffer, "*.gif;*.png;*.jpg;*.jpeg"); - - // fill the OPENFILENAME sruct - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = gHwnd; - ofn.hInstance = gInstance; - ofn.lpstrFilter = "All Images (*.gif,*.png,*.jpg,*.jpeg)\0*.gif;*png;*.jpg;*.jpeg\0GIF Files (*.gif)\0*.gif\0PNG Files (*.png)\0*.png\0JPEG Files (*.jpg,*.jpeg)\0*.jpg;*.jpeg\0All Files\0*.*\0\0"; - ofn.lpstrCustomFilter = NULL; - ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 1; // the first one in lpstrFilter - ofn.lpstrFile = aBuffer; // contains the file path name on return - ofn.nMaxFile = aBufLen; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; // use default - ofn.lpstrTitle = NULL; // use default - ofn.Flags = OFN_CREATEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST; - ofn.nFileOffset = 0; - ofn.nFileExtension = 0; - ofn.lpstrDefExt = "gif"; // default extension is .js - ofn.lCustData = NULL; - ofn.lpfnHook = NULL; - ofn.lpTemplateName = NULL; - - // call the open file dialog or the save file dialog according to aIsOpenDialog - result = ::GetOpenFileName(&ofn); - - return (PRBool)result; -} - -long PASCAL -WndProc(HWND hWnd, UINT msg, WPARAM param, LPARAM lparam) -{ - HMENU hMenu; - - switch (msg) { - case WM_COMMAND: - hMenu = GetMenu(hWnd); - - switch (LOWORD(param)) { - case TIMER_OPEN: - { - char szFile[256]; - - if (!OpenFileDialog(szFile, 256)) - return 0L; - - MyLoadImage(szFile); - break; - } - case TIMER_EXIT: - ::DestroyWindow(hWnd); - exit(0); - default: - break; - } - break; - - case WM_CREATE: - // Initialize image library - if (NS_NewImageManager(&gImageManager) != NS_OK || - gImageManager->Init() != NS_OK) { - ::MessageBox(NULL, "Can't initialize the image library", - class1Name, MB_OK); - } - gImageManager->SetCacheSize(1024*1024); - break; - - case WM_DESTROY: - MyInterrupt(); - MyReleaseImages(); - if (gImageGroup != nsnull) { - NS_RELEASE(gImageGroup); - } - if (gImageManager != nsnull) { - NS_RELEASE(gImageManager); - } - PostQuitMessage(0); - break; - - default: - break; - } - - return DefWindowProc(hWnd, msg, param, lparam); -} - -static HWND CreateTopLevel(const char* clazz, const char* title, - int aWidth, int aHeight) -{ - // Create a simple top level window - HWND window = ::CreateWindowEx(WS_EX_CLIENTEDGE, - clazz, title, - WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, - CW_USEDEFAULT, CW_USEDEFAULT, - aWidth, aHeight, - HWND_DESKTOP, - NULL, - gInstance, - NULL); - - nsRect rect(0, 0, aWidth, aHeight); - - nsresult rv = NSRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow); - - if (NS_OK == rv) { - gWindow->Create((nsNativeWindow)window, rect, MyHandleEvent, NULL); - } - - ::ShowWindow(window, SW_SHOW); - ::UpdateWindow(window); - return window; -} - -#define WIDGET_DLL "raptorwidget.dll" -#define GFXWIN_DLL "raptorgfxwin.dll" - -int PASCAL -WinMain(HANDLE instance, HANDLE prevInstance, LPSTR cmdParam, int nCmdShow) -{ - gInstance = instance; - - NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCChildWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - - static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID); - - NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - - if (!prevInstance) { - WNDCLASS wndClass; - wndClass.style = 0; - wndClass.lpfnWndProc = WndProc; - wndClass.cbClsExtra = 0; - wndClass.cbWndExtra = 0; - wndClass.hInstance = gInstance; - wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); - wndClass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH); - wndClass.lpszMenuName = class1Name; - wndClass.lpszClassName = class1Name; - RegisterClass(&wndClass); - } - - // Create our first top level window - HWND gHwnd = CreateTopLevel(class1Name, "Raptor HTML Viewer", 620, 400); - - // Process messages - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return msg.wParam; -} - -void main(int argc, char **argv) -{ - WinMain(GetModuleHandle(NULL), NULL, 0, SW_SHOW); -} diff --git a/mozilla/webshell/tests/imgtest/ImageTestImpl.cpp b/mozilla/webshell/tests/imgtest/ImageTestImpl.cpp deleted file mode 100644 index 44a2d40b833..00000000000 --- a/mozilla/webshell/tests/imgtest/ImageTestImpl.cpp +++ /dev/null @@ -1,394 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -//we need openfilename stuff... MMP -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif - -#include "windows.h" -#include "prtypes.h" -#include -#include "resources.h" -#include "nsIImageManager.h" -#include "nsIImageGroup.h" -#include "nsIImageRequest.h" -#include "nsIImageObserver.h" -#include "nsIRenderingContext.h" -#include "nsIImage.h" -#include "nsIWidget.h" -#include "nsGUIEvent.h" -#include "nsRect.h" -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" -#include "nsApplicationManager.h" - -#include "nsImageTest.h" - -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kIImageObserverIID, NS_IIMAGEREQUESTOBSERVER_IID); - - -static char* class1Name = "ImageTest"; - -static HANDLE gInstance, gPrevInstance; -static nsIImageManager *gImageManager = nsnull; -static nsIImageGroup *gImageGroup = nsnull; -static nsIImageRequest *gImageReq = nsnull; -static HWND gHwnd; -static nsIWidget *gWindow = nsnull; -static nsIImage *gImage = nsnull; -static PRBool gInstalledColorMap = PR_FALSE; -static nsIShellInstance * shellInstance = NULL ; - -class MyObserver : public nsIImageRequestObserver { -public: - MyObserver(); - ~MyObserver(); - - NS_DECL_ISUPPORTS - - virtual void Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3); - - virtual void NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType); -}; - -MyObserver::MyObserver() -{ -} - -MyObserver::~MyObserver() -{ -} - -NS_IMPL_ISUPPORTS(MyObserver, kIImageObserverIID) - -void -MyObserver::Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3) -{ - switch (aNotificationType) { - case nsImageNotification_kDimensions: - { - char buffer[40]; - sprintf(buffer, "Image:%d x %d", aParam1, aParam2); - ::SetWindowText(gHwnd, buffer); - } - break; - - case nsImageNotification_kPixmapUpdate: - case nsImageNotification_kImageComplete: - case nsImageNotification_kFrameComplete: - { - if (gImage == nsnull && aImage) { - gImage = aImage; - NS_ADDREF(aImage); - } - - if (!gInstalledColorMap && gImage) { - nsColorMap *cmap = gImage->GetColorMap(); - - if (cmap != nsnull && cmap->NumColors > 0) { - gWindow->SetColorMap(cmap); - } - gInstalledColorMap = PR_TRUE; - } - nsRect *rect = (nsRect *)aParam3; - nsIRenderingContext *drawCtx = gWindow->GetRenderingContext(); - - if (gImage) { - drawCtx->DrawImage(gImage, 0, 0, - gImage->GetWidth(), gImage->GetHeight()); - } - } - break; - } -} - -void -MyObserver::NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType) -{ - ::MessageBox(NULL, "Image loading error!", - class1Name, MB_OK); -} - -nsEventStatus PR_CALLBACK -MyHandleEvent(nsGUIEvent *aEvent) -{ - nsEventStatus result = nsEventStatus_eConsumeNoDefault; - switch(aEvent->message) { - case NS_PAINT: - { - // paint the background - nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext; - drawCtx->SetColor(aEvent->widget->GetBackgroundColor()); - drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect)); - - if (gImage) { - drawCtx->DrawImage(gImage, 0, 0, - gImage->GetWidth(), gImage->GetHeight()); - } - - return nsEventStatus_eConsumeNoDefault; - } - break; - } - - return nsEventStatus_eIgnore; -} - -void -MyReleaseImages() -{ - if (gImageReq) { - NS_RELEASE(gImageReq); - gImageReq = NULL; - } - if (gImage) { - NS_RELEASE(gImage); - gImage = NULL; - } - - gInstalledColorMap = PR_FALSE; -} - -void -MyInterrupt() -{ - if (gImageGroup) { - gImageGroup->Interrupt(); - } -} - -#define FILE_URL_PREFIX "file://" - - -void -MyLoadImage(char *aFileName) -{ - char fileURL[256]; - char *str; - - MyInterrupt(); - MyReleaseImages(); - - if (gImageGroup == NULL) { - nsIRenderingContext *drawCtx = gWindow->GetRenderingContext(); - if (NS_NewImageGroup(&gImageGroup) != NS_OK || - gImageGroup->Init(drawCtx) != NS_OK) { - ::MessageBox(NULL, "Couldn't create image group", - class1Name, MB_OK); - NS_RELEASE(drawCtx); - return; - } - NS_RELEASE(drawCtx); - } - - strcpy(fileURL, FILE_URL_PREFIX); - strcpy(fileURL + strlen(FILE_URL_PREFIX), aFileName); - - str = fileURL; - while ((str = strchr(str, '\\')) != NULL) - *str = '/'; - - nscolor white; - MyObserver *observer = new MyObserver(); - - NS_ColorNameToRGB("white", &white); - gImageReq = gImageGroup->GetImage(fileURL, - observer, - white, 0, 0, 0); - if (gImageReq == NULL) { - ::MessageBox(NULL, "Couldn't create image request", - class1Name, MB_OK); - } -} - -PRBool -OpenFileDialog(char *aBuffer, int32 aBufLen) -{ - BOOL result = FALSE; - OPENFILENAME ofn; - - // *.js is the standard File Name on the Save/Open Dialog - ::strcpy(aBuffer, "*.gif;*.png;*.jpg;*.jpeg"); - - // fill the OPENFILENAME sruct - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = gHwnd; - ofn.hInstance = gInstance; - ofn.lpstrFilter = "All Images (*.gif,*.png,*.jpg,*.jpeg)\0*.gif;*png;*.jpg;*.jpeg\0GIF Files (*.gif)\0*.gif\0PNG Files (*.png)\0*.png\0JPEG Files (*.jpg,*.jpeg)\0*.jpg;*.jpeg\0All Files\0*.*\0\0"; - ofn.lpstrCustomFilter = NULL; - ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 1; // the first one in lpstrFilter - ofn.lpstrFile = aBuffer; // contains the file path name on return - ofn.nMaxFile = aBufLen; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; // use default - ofn.lpstrTitle = NULL; // use default - ofn.Flags = OFN_CREATEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST; - ofn.nFileOffset = 0; - ofn.nFileExtension = 0; - ofn.lpstrDefExt = "gif"; // default extension is .js - ofn.lCustData = NULL; - ofn.lpfnHook = NULL; - ofn.lpTemplateName = NULL; - - // call the open file dialog or the save file dialog according to aIsOpenDialog - result = ::GetOpenFileName(&ofn); - - return (PRBool)result; -} - -long PASCAL -WndProc(HWND hWnd, UINT msg, WPARAM param, LPARAM lparam) -{ - HMENU hMenu; - - switch (msg) { - case WM_COMMAND: - hMenu = GetMenu(hWnd); - - switch (LOWORD(param)) { - case TIMER_OPEN: - { - char szFile[256]; - - if (!OpenFileDialog(szFile, 256)) - return 0L; - - MyLoadImage(szFile); - break; - } - case TIMER_EXIT: - ::DestroyWindow(hWnd); - exit(0); - default: - break; - } - break; - - case WM_CREATE: - // Initialize image library - if (NS_NewImageManager(&gImageManager) != NS_OK || - gImageManager->Init() != NS_OK) { - ::MessageBox(NULL, "Can't initialize the image library", - class1Name, MB_OK); - } - gImageManager->SetCacheSize(1024*1024); - break; - - case WM_DESTROY: - MyInterrupt(); - MyReleaseImages(); - if (gImageGroup != nsnull) { - NS_RELEASE(gImageGroup); - } - if (gImageManager != nsnull) { - NS_RELEASE(gImageManager); - } - PostQuitMessage(0); - break; - - default: - break; - } - - return DefWindowProc(hWnd, msg, param, lparam); -} - -static HWND CreateTopLevel(const char* clazz, const char* title, - int aWidth, int aHeight) -{ - static NS_DEFINE_IID(kCChildWindowIID, NS_CHILD_CID); - // Create a simple top level window - HWND window = ::CreateWindowEx(WS_EX_CLIENTEDGE, - clazz, title, - WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, - CW_USEDEFAULT, CW_USEDEFAULT, - aWidth, aHeight, - HWND_DESKTOP, - NULL, - gInstance, - NULL); - - nsRect rect(0, 0, aWidth, aHeight); - - nsresult rv = NSRepository::CreateInstance(kCChildWindowIID, NULL, kIWidgetIID, (void**)&gWindow); - - if (NS_OK == rv) { - gWindow->Create((nsNativeWindow)window, rect, MyHandleEvent, NULL); - } - - ::ShowWindow(window, SW_SHOW); - ::UpdateWindow(window); - return window; -} - -nsresult RunImageTest(nsImageTest * aImageTest) -{ - return (shellInstance->Run()); - /* - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return ((nsresult)msg.wParam); - */ -} - -void InitImageTest(nsImageTest * aImageTest) -{ - nsresult res = NS_OK; - - res = NSApplicationManager::GetShellInstance(aImageTest, &shellInstance) ; - - if (res == NS_OK) - gInstance = (HINSTANCE) shellInstance->GetNativeInstance(); - -// if (!prevInstance) { - WNDCLASS wndClass; - wndClass.style = 0; - wndClass.lpfnWndProc = WndProc; - wndClass.cbClsExtra = 0; - wndClass.cbWndExtra = 0; - wndClass.hInstance = gInstance; - wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); - wndClass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH); - wndClass.lpszMenuName = class1Name; - wndClass.lpszClassName = class1Name; - RegisterClass(&wndClass); -// } - - // Create our first top level window - HWND gHwnd = CreateTopLevel(class1Name, "Raptor HTML Viewer", 620, 400); - -} - diff --git a/mozilla/webshell/tests/imgtest/ImageTestImpl.h b/mozilla/webshell/tests/imgtest/ImageTestImpl.h deleted file mode 100644 index cf34bcd1423..00000000000 --- a/mozilla/webshell/tests/imgtest/ImageTestImpl.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include "nsImageTest.h" - -void InitImageTest(nsImageTest * aImageTest); -nsresult RunImageTest(nsImageTest * aImageTest); - diff --git a/mozilla/webshell/tests/imgtest/image.rc b/mozilla/webshell/tests/imgtest/image.rc deleted file mode 100644 index 0f8e12b7798..00000000000 --- a/mozilla/webshell/tests/imgtest/image.rc +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "resources.h" - -IMAGETEST MENU DISCARDABLE -{ - POPUP "File" - { - MENUITEM "Open...", TIMER_OPEN - MENUITEM "Exit", TIMER_EXIT - } -} diff --git a/mozilla/webshell/tests/imgtest/makefile.win b/mozilla/webshell/tests/imgtest/makefile.win deleted file mode 100644 index 8d5129077df..00000000000 --- a/mozilla/webshell/tests/imgtest/makefile.win +++ /dev/null @@ -1,52 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. - -MAKE_OBJ_TYPE = EXE -PROGRAM = .\$(OBJDIR)\nsImageTest.exe -RESFILE = image.res -MAPFILE = image.map - -LINCS=-I$(XPDIST)\public\raptor -I$(XPDIST)\public\xpcom -I..\..\src - -LLFLAGS = $(LLFLAGS) /SUBSYSTEM:CONSOLE - -OBJS = \ - .\$(OBJDIR)\nsImageTest.obj \ - .\$(OBJDIR)\ImageTestImpl.obj \ - $(NULL) - -LLIBS= \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorweb.lib \ - $(DIST)\lib\raptorwebwin_s.lib \ - $(DIST)\lib\xpcom32.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib \ - $(DIST)\lib\img3240.lib \ - $(DIST)\lib\util.lib \ - comdlg32.lib - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAM) - $(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\nsImageTest.exe - diff --git a/mozilla/webshell/tests/imgtest/nsImageTest.cpp b/mozilla/webshell/tests/imgtest/nsImageTest.cpp deleted file mode 100644 index d4f6396e483..00000000000 --- a/mozilla/webshell/tests/imgtest/nsImageTest.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsImageTest.h" -#include "ImageTestImpl.h" - -// All Applications must specify this *special* application CID -// to their own unique IID. -nsIID kIXPCOMApplicationShellCID = NS_IIMAGETEST_IID ; - -// All Application Must implement this function -nsresult NS_RegisterApplicationShellFactory() -{ - nsresult res = NSRepository::RegisterFactory(kIXPCOMApplicationShellCID, - new nsImageTestFactory(), - PR_FALSE) ; - - return res; -} - -/* - * nsImageTest Definition - */ - -nsImageTest::nsImageTest() -{ - NS_INIT_REFCNT(); -} - -nsImageTest::~nsImageTest() -{ -} - -NS_IMPL_ADDREF(nsImageTest) -NS_IMPL_RELEASE(nsImageTest) -NS_IMPL_QUERY_INTERFACE(nsImageTest,NS_IIMAGETEST_IID); - -nsresult nsImageTest::Init() -{ - InitImageTest(this); - return NS_OK; -} - -nsresult nsImageTest::Run() -{ - RunImageTest(this); - return NS_OK; -} - -/* - * nsImageTestFactory Definition - */ - -nsImageTestFactory::nsImageTestFactory() -{ - NS_INIT_REFCNT(); -} - -nsImageTestFactory::~nsImageTestFactory() -{ -} - -NS_IMPL_ADDREF(nsImageTestFactory) -NS_IMPL_RELEASE(nsImageTestFactory) -NS_IMPL_QUERY_INTERFACE(nsImageTestFactory,NS_IFACTORY_IID); - -nsresult nsImageTestFactory::CreateInstance(nsISupports * aOuter, - const nsIID &aIID, - void ** aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = NULL ; - - nsISupports * inst = new nsImageTest() ; - - if (inst == NULL) { - return NS_ERROR_OUT_OF_MEMORY; - } - - nsresult res = inst->QueryInterface(aIID, aResult); - - if (res != NS_OK) { - delete inst ; - } - - return res; - -} - -nsresult nsImageTestFactory::LockFactory(PRBool aLock) -{ - return NS_OK; -} diff --git a/mozilla/webshell/tests/imgtest/nsImageTest.h b/mozilla/webshell/tests/imgtest/nsImageTest.h deleted file mode 100644 index 986b4c4f905..00000000000 --- a/mozilla/webshell/tests/imgtest/nsImageTest.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef _nsImageTest_h__ -#define _nsImageTest_h__ - -#include -#include "nsIApplicationShell.h" -#include "nsIFactory.h" -#include "nsRepository.h" -#include "nsShellInstance.h" - -#define NS_IIMAGETEST_IID \ - { 0x5040bd10, 0xdec5, 0x11d1, \ - {0x92, 0x44, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } - -/* - * ImageTest Class Declaration - */ - -class nsImageTest : public nsIApplicationShell { -public: - nsImageTest(); - ~nsImageTest(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD Init(); - NS_IMETHOD Run(); - -}; - -/* - * ImageTestFactory Class Declaration - */ - -class nsImageTestFactory : public nsIFactory { - -public: - nsImageTestFactory(); - ~nsImageTestFactory(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD CreateInstance(nsISupports * aOuter, - const nsIID &aIID, - void ** aResult); - - NS_IMETHOD LockFactory(PRBool aLock); - -}; - - -#endif diff --git a/mozilla/webshell/tests/imgtest/resources.h b/mozilla/webshell/tests/imgtest/resources.h deleted file mode 100644 index 3358b700284..00000000000 --- a/mozilla/webshell/tests/imgtest/resources.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef resources_h___ -#define resources_h___ - -#define TIMER_OPEN 40010 -#define TIMER_EXIT 40011 - -#endif /* resources_h___ */ diff --git a/mozilla/webshell/tests/makefile.win b/mozilla/webshell/tests/makefile.win deleted file mode 100644 index 4d659ba06a7..00000000000 --- a/mozilla/webshell/tests/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS= viewer imgtest nettest - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/webshell/tests/nettest/Makefile b/mozilla/webshell/tests/nettest/Makefile deleted file mode 100644 index 7122a6717e9..00000000000 --- a/mozilla/webshell/tests/nettest/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../../.. - -include $(DEPTH)/config/config.mk - -CPPSRCS = \ - nettest.cpp \ - $(NULL) - -INCLUDES+=-I../src -I$(DIST)/include - -REQUIRES = raptor netlib xpcom - -OBJS = $(CPPSRCS:.cpp=.o) - -EX_LIBS = \ - $(DIST)/bin/libnetlib.so \ - $(DIST)/bin/libreg.so \ - $(DIST)/bin/libxpcom.so \ - $(DIST)/bin/libxp.so \ - $(DIST)/bin/libpref.so \ - $(DIST)/bin/libjs.so \ - $(DIST)/lib/libplc21.a \ - $(DIST)/lib/libplds21.a \ - $(DIST)/lib/libnspr21.a \ - $(NULL) - -PROGS = $(addprefix $(OBJDIR)/, $(CPPSRCS:.cpp=)) - -NON_DIRS = $(PROGS) -TARGETS = $(NON_DIRS) - -include $(DEPTH)/config/rules.mk - -$(OBJDIR)/%.o: %.cpp - @$(MAKE_OBJDIR) - $(CCC) -o $@ $(CFLAGS) -DUSE_NSREG -c $*.cpp - -$(PROGS):$(OBJDIR)/%: $(OBJDIR)/%.o $(EX_LIBS) - @$(MAKE_OBJDIR) - $(CCC) -o $@ $@.o $(LDFLAGS) $(EX_LIBS) $(OS_LIBS) - -export:: - -install:: $(PROGS) - $(INSTALL) $(PROGS) $(DIST)/bin - diff --git a/mozilla/webshell/tests/nettest/makefile.win b/mozilla/webshell/tests/nettest/makefile.win deleted file mode 100644 index c2b368a1891..00000000000 --- a/mozilla/webshell/tests/nettest/makefile.win +++ /dev/null @@ -1,96 +0,0 @@ -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -NODEPEND=1 -IGNORE_MANIFEST = 1 - -#//------------------------------------------------------------------------ -#// -# New build system where zip dll is build indepenant of java stubs. -#// -#//------------------------------------------------------------------------ -MODULE = nettest -EXPORTS = \ - $(NULL) - - -#//------------------------------------------------------------------------ -#// -#// Specify the depth of the current directory relative to the -#// root of NS -#// -#//------------------------------------------------------------------------ -DEPTH= ..\..\.. - -MAKE_OBJ_TYPE=EXE -#//------------------------------------------------------------------------ -#// -#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) -#// -#//------------------------------------------------------------------------ -EXENAME=nettest -PDBFILE=nettest.pdb -MAPFILE=nettest.map - -#//------------------------------------------------------------------------ -#// -#// Define the files necessary to build the target (ie. OBJS) -#// -#//------------------------------------------------------------------------ -OBJS= \ - .\$(OBJDIR)\nettest.obj \ - $(NULL) -#//------------------------------------------------------------------------ -#// -#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) -#// (these must be defined before the common makefiles are included) -#// -#//------------------------------------------------------------------------ - -PROGRAM=.\$(OBJDIR)\$(EXENAME).EXE - - -#//------------------------------------------------------------------------ -#// -#// Define any local options for the make tools -#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) -#// -#//------------------------------------------------------------------------ -LCFLAGS=-DNETSCAPE -LLIBS=$(LLIBS) \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\netlib.lib \ - $(DIST)\lib\libplc21.lib - -LINCS=$(LINCS) -I. \ - -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\netlib \ - -I$(PUBLIC)\xpcom - -# clobber and clobber_all will remove the following garbage: -GARBAGE = $(GARBAGE) _gen - -#//------------------------------------------------------------------------ -#// -#// Include the common makefile rules -#// -#//------------------------------------------------------------------------ -include <$(DEPTH)/config/rules.mak> - -install:: $(PROGRAM) - $(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\$(EXENAME).exe diff --git a/mozilla/webshell/tests/nettest/nettest.cpp b/mozilla/webshell/tests/nettest/nettest.cpp deleted file mode 100644 index 26e8cdf1b3b..00000000000 --- a/mozilla/webshell/tests/nettest/nettest.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include -#include -#include - -#include "plstr.h" - -#include "nsIStreamNotification.h" -#include "nsIInputStream.h" -#include "nsINetService.h" - -int urlLoaded; -PRBool bTraceEnabled; - - -/* XXX: Don't include net.h... */ -extern "C" { -extern int NET_PollSockets(); -extern void NET_ToggleTrace(); -}; - -class TestConsumer : public nsIStreamNotification -{ - -public: - NS_DECL_ISUPPORTS - - TestConsumer(); - - NS_IMETHOD GetBindInfo(void); - NS_IMETHOD OnProgress(void); - NS_IMETHOD OnStartBinding(void); - NS_IMETHOD OnDataAvailable(nsIInputStream *pIStream); - NS_IMETHOD OnStopBinding(void); - -protected: - ~TestConsumer(); -}; - - -TestConsumer::TestConsumer() -{ - NS_INIT_REFCNT(); -} - - -NS_DEFINE_IID(kIStreamNotificationIID, NS_ISTREAMNOTIFICATION_IID); -NS_IMPL_ISUPPORTS(TestConsumer,kIStreamNotificationIID); - - -TestConsumer::~TestConsumer() -{ - if (bTraceEnabled) { - printf("TestConsumer is being deleted...\n"); - } -} - - -NS_IMETHODIMP TestConsumer::GetBindInfo(void) -{ - if (bTraceEnabled) { - printf("+++ TestConsumer::GetBindInfo\n"); - } - - return 0; -} - -NS_IMETHODIMP TestConsumer::OnProgress(void) -{ - printf("+++ TestConsumer::OnProgress\n"); - - return 0; -} - -NS_IMETHODIMP TestConsumer::OnStartBinding(void) -{ - if (bTraceEnabled) { - printf("+++ TestConsumer::OnStartBinding\n"); - } - - return 0; -} - - -NS_IMETHODIMP TestConsumer::OnDataAvailable(nsIInputStream *pIStream) -{ - PRInt32 len; - - if (bTraceEnabled) { - printf("+++ TestConsumer::OnDataAvailable\n"); - } - - do { - PRInt32 err; - char buffer[80]; - int i; - - len = pIStream->Read(&err, buffer, 0, 80); - for (i=0; i 0); - - return 0; -} - - -NS_IMETHODIMP TestConsumer::OnStopBinding(void) -{ - if (bTraceEnabled) { - printf("+++ TestConsumer::OnStopBinding\n"); - } - - /* The document has been loaded, so drop out of the message pump... */ - urlLoaded = 1; - return 0; -} - - - -int main(int argc, char **argv) -{ -#ifdef XP_PC - MSG msg; -#endif - char *url_address; - nsIStreamNotification *pConsumer; - nsINetService *pNetlib; - nsresult result; - - if (argc < 2) { - printf("test: -trace \n"); - return 0; - } - - urlLoaded = 0; - - /* Create an instance of the INetService... (aka Netlib) */ - if (NS_OK != NS_NewINetService(&pNetlib, NULL)) { - return 1; - } - - // Turn on netlib tracing... - if (PL_strcasecmp(argv[1], "-trace") == 0) { - NET_ToggleTrace(); - url_address = argv[2]; - bTraceEnabled = PR_TRUE; - } else { - url_address = argv[1]; - bTraceEnabled = PR_FALSE; - } - - if (bTraceEnabled) { - printf("loading URL: %s...\n", url_address); - } - - pConsumer = new TestConsumer; - pConsumer->AddRef(); - - // Start the URL load... - result = pNetlib->OpenStream(url_address, pConsumer); - - /* If the open failed, then do not drop into the message loop... */ - if (NS_OK != result) { - urlLoaded = 1; - } - - // Enter the message pump to allow the URL load to proceed. - while ( !urlLoaded ) { -#ifdef XP_PC - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -#endif - - if (NET_PollSockets() == PR_FALSE) urlLoaded = 1; - } - - pNetlib->Release(); - - return 0; - -} diff --git a/mozilla/webshell/tests/viewer/JSConsole.cpp b/mozilla/webshell/tests/viewer/JSConsole.cpp deleted file mode 100644 index 703e9a2ae2d..00000000000 --- a/mozilla/webshell/tests/viewer/JSConsole.cpp +++ /dev/null @@ -1,958 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -//is case this is defined from the outside... MMP -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif - -#include "JSConsole.h" -#include "jsconsres.h" -#include "nsIScriptContext.h" -#include -#include "jsapi.h" - -HINSTANCE JSConsole::sAppInstance = 0; -HACCEL JSConsole::sAccelTable = 0; -CHAR JSConsole::sDefaultCaption[] = "JavaScript Console"; -BOOL JSConsole::mRegistered = FALSE; - - -// display an error string along with the error returned from -// the GetLastError functions -#define MESSAGE_LENGTH 256 -void DisplayError(LPSTR lpMessage) -{ - CHAR lpMsgBuf[MESSAGE_LENGTH * 2]; - CHAR lpLastError[MESSAGE_LENGTH]; - - ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - 0, - (LPTSTR)&lpLastError, - MESSAGE_LENGTH, - NULL); - - strcpy(lpMsgBuf, lpMessage); - strcat(lpMsgBuf, "\nThe WWS (Worthless Windows System) reports:\n"); - strcat(lpMsgBuf, lpLastError); - - // Display the string. - ::MessageBox(NULL, lpMsgBuf, "JSConsole Error", MB_OK | MB_ICONSTOP); -} - -#if defined(_DEBUG) - #define VERIFY(value, errorCondition, message) \ - if((value) == (errorCondition)) DisplayError(message); -#else // !_DEBUG - #define VERIFY(value, errorCondition, message) (value) -#endif // _DEBUG - -// -// Register the window class -// -BOOL JSConsole::RegisterWidget() -{ - WNDCLASS wc; - - wc.style = 0; - wc.lpfnWndProc = JSConsole::WindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = JSConsole::sAppInstance; - wc.hIcon = NULL; - wc.hCursor = NULL; - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW); - wc.lpszMenuName = MAKEINTRESOURCE(JSCONSOLE_MENU); - wc.lpszClassName = "JavaScript Console"; - - return (BOOL)::RegisterClass(&wc); -} - -// -// Create the main application window -// -JSConsole* JSConsole::CreateConsole() -{ - if (!JSConsole::mRegistered){ - JSConsole::mRegistered = RegisterWidget(); - } - - HWND hWnd = ::CreateWindowEx(WS_EX_ACCEPTFILES | - WS_EX_CLIENTEDGE | - WS_EX_CONTROLPARENT, - "JavaScript Console", - JSConsole::sDefaultCaption, - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - 450, - 500, - NULL, - NULL, - JSConsole::sAppInstance, - NULL); - if (hWnd) { - ::ShowWindow(hWnd, SW_SHOW); - ::UpdateWindow(hWnd); - - JSConsole *console = (JSConsole*)::GetWindowLong(hWnd, GWL_USERDATA); - return console; - } - - return NULL; -} - -// -// Window Procedure -// -LRESULT CALLBACK JSConsole::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - JSConsole *console = (JSConsole*)::GetWindowLong(hWnd, GWL_USERDATA); - - // just ignore the message unless is WM_NCCREATE - if (!console) { - if (uMsg == WM_NCCREATE) { - HWND hWndEdit = ::CreateWindow("EDIT", - NULL, - WS_CHILDWINDOW | WS_VISIBLE | ES_MULTILINE | - ES_AUTOHSCROLL | ES_AUTOVSCROLL | - WS_HSCROLL | WS_VSCROLL, - 0, 0, 0, 0, - hWnd, - NULL, - JSConsole::sAppInstance, - NULL); - if (!hWndEdit) { - ::DisplayError("Cannot Create Edit Window"); - return FALSE; - } - ::SendMessage(hWndEdit, EM_SETLIMITTEXT, (WPARAM)0, (LPARAM)0); - - console = new JSConsole(hWnd, hWndEdit); - ::SetWindowLong(hWnd, GWL_USERDATA, (DWORD)console); - - ::SetFocus(hWndEdit); - } - - return ::CallWindowProc((FARPROC)::DefWindowProc, hWnd, uMsg, wParam, lParam); - } - - switch(uMsg) { - - // make sure the edit window covers the whole client area - case WM_SIZE: - return console->OnSize(wParam, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)); - - // exit the application - case WM_DESTROY: - console->OnDestroy(); - - return ::CallWindowProc((FARPROC)::DefWindowProc, hWnd, uMsg, wParam, lParam); - - // enable/disable menu items - case WM_INITMENUPOPUP: - return console->OnInitMenu((HMENU)wParam, (UINT)LOWORD(lParam), (BOOL)HIWORD(lParam)); - - case WM_COMMAND: - // menu or accelerator - if (HIWORD(wParam) == 0 || HIWORD(wParam) == 1) { - switch(LOWORD(wParam)) { - - case ID_FILENEW: - console->OnFileNew(); - break; - - case ID_FILEOPEN: - if (console->OpenFileDialog(OPEN_DIALOG)) { - console->LoadFile(); - } - - break; - - case ID_FILESAVE: - if (console->CanSave()) { - console->SaveFile(); - break; - } - // fall through so it can "Save As..." - - case ID_FILESAVEAS: - if (console->OpenFileDialog(SAVE_DIALOG)) { - console->SaveFile(); - } - break; - - case ID_FILEEXIT: - ::DestroyWindow(hWnd); - break; - - case ID_EDITUNDO: - console->OnEditUndo(); - break; - - case ID_EDITCUT: - console->OnEditCut(); - break; - - case ID_EDITCOPY: - console->OnEditCopy(); - break; - - case ID_EDITPASTE: - console->OnEditPaste(); - break; - - case ID_EDITDELETE: - console->OnEditDelete(); - break; - - case ID_EDITSELECTALL: - console->OnEditSelectAll(); - break; - - case ID_COMMANDSEVALALL: - console->OnCommandEvaluateAll(); - break; - - case ID_COMMANDSEVALSEL: - console->OnCommandEvaluateSelection(); - break; - - case ID_COMMANDSINSPECTOR: - console->OnCommandInspector(); - break; - - } - } - - break; - - case WM_DROPFILES: - { - HDROP hDropInfo = (HDROP)wParam; - if (::DragQueryFile(hDropInfo, (UINT)-1L, NULL, 0) != 1) { - ::MessageBox(hWnd, "Just One File Please...", "JSConsole Error", MB_OK | MB_ICONINFORMATION); - } - else { - CHAR fileName[MAX_PATH]; - ::DragQueryFile(hDropInfo, 0, fileName, MAX_PATH); - console->SetFileName(fileName); - console->LoadFile(); - } - break; - } - - case WM_SETFOCUS: - return console->OnSetFocus((HWND)wParam); - - default: - return ::CallWindowProc((FARPROC)::DefWindowProc, hWnd, uMsg, wParam, lParam); - } - - return 0; -} - -// -// Constructor -// The main window and the edit control must have been created already -// -JSConsole::JSConsole(HWND aMainWindow, HWND aEditControl) : - mMainWindow(aMainWindow), - mEditWindow(aEditControl), - mContext(NULL) -{ - mFileInfo.Init(); -} - -// -// Destructor -// -JSConsole::~JSConsole() -{ -} - -// -// Load a file into the edit field -// -BOOL JSConsole::LoadFile() -{ - BOOL result = FALSE; - - if (mMainWindow) { - // open the file - HANDLE file = ::CreateFile(mFileInfo.mCurrentFileName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, - NULL); - if (file != INVALID_HANDLE_VALUE) { - // check the file size. Max is 64k - DWORD sizeHiWord; - DWORD sizeLoWord = ::GetFileSize(file, &sizeHiWord); - if (sizeLoWord < 0x10000 && sizeHiWord == 0) { - // alloc a buffer big enough to contain the file (account for '\0' - CHAR *buffer = new CHAR[sizeLoWord + 1]; - if (buffer) { - // read the file in memory - if (::ReadFile(file, - buffer, - sizeLoWord, - &sizeHiWord, - NULL)) { - NS_ASSERTION(sizeLoWord == sizeHiWord, "ReadFile inconsistency"); - buffer[sizeLoWord] = '\0'; // terminate the buffer - // write the file to the edit field - ::SendMessage(mEditWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)buffer); - - // update the caption - CHAR caption[80]; - ::wsprintf(caption, - "%s - %s", - mFileInfo.mCurrentFileName + mFileInfo.mFileOffset, - sDefaultCaption); - ::SendMessage(mMainWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)caption); - - result = TRUE; - } - else { - ::DisplayError("Error Reading the File"); - } - - // free the allocated buffer - delete[] buffer; - } - else { - ::MessageBox(mMainWindow, - "Cannot Allocate Enough Memory to Copy the File in Memory", - "JSConsole Error", - MB_OK | MB_ICONSTOP); - } - } - else { - ::MessageBox(mMainWindow, - "File too big. Max is 64k", - "JSConsole Error", - MB_OK | MB_ICONSTOP); - } - - // close the file handle - ::CloseHandle(file); - } -#ifdef _DEBUG - else { - CHAR message[MAX_PATH + 20]; - wsprintf(message, "Cannot Open File: %s", mFileInfo.mCurrentFileName); - ::DisplayError(message); - } -#endif - } - - return result; -} - -// -// Save the current text into a file -// -BOOL JSConsole::SaveFile() -{ - BOOL result = FALSE; - - if (mMainWindow && mFileInfo.mCurrentFileName[0] != '\0') { - // create the new file - HANDLE file = ::CreateFile(mFileInfo.mCurrentFileName, - GENERIC_WRITE, - FILE_SHARE_READ, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, - NULL); - if (file != INVALID_HANDLE_VALUE) { - DWORD size; - // get the text size - size = ::SendMessage(mEditWindow, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0); - - // alloc a buffer big enough to contain the file - CHAR *buffer = new CHAR[++size]; - if (buffer) { - DWORD byteRead; - // read the text area content - ::SendMessage(mEditWindow, WM_GETTEXT, (WPARAM)size, (LPARAM)buffer); - - // write the buffer to disk - if (::WriteFile(file, - buffer, - size, - &byteRead, - NULL)) { - NS_ASSERTION(byteRead == size, "WriteFile inconsistency"); - // update the caption - CHAR caption[80]; - ::wsprintf(caption, - "%s - %s", - mFileInfo.mCurrentFileName + mFileInfo.mFileOffset, - sDefaultCaption); - ::SendMessage(mMainWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)caption); - - result = TRUE; - } - else { - ::DisplayError("Error Writing the File"); - } - - // free the allocated buffer - delete[] buffer; - } - else { - ::MessageBox(mMainWindow, - "Cannot Allocate Enough Memory to Copy the Edit Text in Memory", - "JSConsole Error", - MB_OK | MB_ICONSTOP); - } - - // close the file handle - ::CloseHandle(file); - } -#ifdef _DEBUG - else { - CHAR message[MAX_PATH + 20]; - wsprintf(message, "Cannot Open File: %s", mFileInfo.mCurrentFileName); - ::DisplayError(message); - } -#endif - } - - return result; -} - -// -// Open a FileOpen or FileSave dialog -// -BOOL JSConsole::OpenFileDialog(UINT aWhichDialog) -{ - BOOL result = FALSE; - OPENFILENAME ofn; - - if (mMainWindow) { - - // *.js is the standard File Name on the Save/Open Dialog - if (mFileInfo.mCurrentFileName[0] == '\0') - ::strcpy(mFileInfo.mCurrentFileName, "*.js"); - - // fill the OPENFILENAME sruct - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = mMainWindow; - ofn.hInstance = JSConsole::sAppInstance; - ofn.lpstrFilter = "JavaScript Files (*.js)\0*.js\0Text Files (*.txt)\0*.txt\0All Files\0*.*\0\0"; - ofn.lpstrCustomFilter = NULL; - ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 1; // the first one in lpstrFilter - ofn.lpstrFile = mFileInfo.mCurrentFileName; // contains the file path name on return - ofn.nMaxFile = sizeof(mFileInfo.mCurrentFileName); - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; // use default - ofn.lpstrTitle = NULL; // use default - ofn.Flags = OFN_CREATEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST; - ofn.nFileOffset = 0; - ofn.nFileExtension = 0; - ofn.lpstrDefExt = "js"; // default extension is .js - ofn.lCustData = NULL; - ofn.lpfnHook = NULL; - ofn.lpTemplateName = NULL; - - // call the open file dialog or the save file dialog according to aIsOpenDialog - if (aWhichDialog == OPEN_DIALOG) { - result = ::GetOpenFileName(&ofn); - } - else if (aWhichDialog == SAVE_DIALOG) { - result = ::GetSaveFileName(&ofn); - } - - if (!result) { - mFileInfo.mCurrentFileName[0] = '\0'; - ::CommDlgExtendedError(); - } - else { - mFileInfo.mFileOffset = ofn.nFileOffset; - mFileInfo.mFileExtension = ofn.nFileExtension; - } - } - - return result; -} - -// -// set the mFileInfo structure with the proper value given a generic path -// -void JSConsole::SetFileName(LPSTR aFileName) -{ - strcpy(mFileInfo.mCurrentFileName, aFileName); - for (int i = strlen(aFileName); i >= 0; i--) { - if (mFileInfo.mCurrentFileName[i] == '.') { - mFileInfo.mFileExtension = i; - } - - if (mFileInfo.mCurrentFileName[i] == '\\') { - mFileInfo.mFileOffset = i + 1; - break; - } - } -} - -// -// Move the edit window to cover the all client area -// -LRESULT JSConsole::OnSize(DWORD aResizeFlags, UINT aWidth, UINT aHeight) -{ - ::MoveWindow(mEditWindow, 0, 0, aWidth, aHeight, TRUE); - RECT textArea; - textArea.left = 3; - textArea.top = 1; - textArea.right = aWidth - 20; - textArea.bottom = aHeight - 17; - ::SendMessage(mEditWindow, EM_SETRECTNP, (WPARAM)0, (LPARAM)&textArea); - return 0L; -} - -// -// Initialize properly menu items -// -LRESULT JSConsole::OnInitMenu(HMENU aMenu, UINT aPos, BOOL aIsSystem) -{ - if (!aIsSystem) { - if (aPos == EDITMENUPOS) { - InitEditMenu(aMenu); - } - else if (aPos == COMMANDSMENUPOS) { - InitCommandMenu(aMenu); - } - } - - return 0L; -} - -// -// Pass the focus to the edit window -// -LRESULT JSConsole::OnSetFocus(HWND aWnd) -{ - ::SetFocus(mEditWindow); - return 0L; -} - -// -// Destroy message -// -void JSConsole::OnDestroy() -{ - if (mDestroyNotification) - (*mDestroyNotification)(); -} - -// -// File/New. Reset caption, text area and file info -// -void JSConsole::OnFileNew() -{ - SendMessage(mEditWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)0); - SendMessage(mMainWindow, WM_SETTEXT, (WPARAM)0, (LPARAM)JSConsole::sDefaultCaption); - mFileInfo.Init(); -} - -// -// Edit/Undo. Undo the last operation on the edit field -// -void JSConsole::OnEditUndo() -{ - SendMessage(mEditWindow, WM_UNDO, (WPARAM)0, (LPARAM)0); -} - -// -// Edit/Cut. Cut the current selection -// -void JSConsole::OnEditCut() -{ - SendMessage(mEditWindow, WM_CUT, (WPARAM)0, (LPARAM)0); -} - -// -// Edit/Copy. Copy the current selection -// -void JSConsole::OnEditCopy() -{ - SendMessage(mEditWindow, WM_COPY, (WPARAM)0, (LPARAM)0); -} - -// -// Edit/Paste. Paste from the clipboard -// -void JSConsole::OnEditPaste() -{ - SendMessage(mEditWindow, WM_PASTE, (WPARAM)0, (LPARAM)0); -} - -// -// Edit/Delete. Delete the current selection -// -void JSConsole::OnEditDelete() -{ - SendMessage(mEditWindow, WM_CLEAR, (WPARAM)0, (LPARAM)0); -} - -// -// Edit/Select All. Select the whole text in the text area -// -void JSConsole::OnEditSelectAll() -{ - SendMessage(mEditWindow, EM_SETSEL, (WPARAM)0, (LPARAM)-1); -} - -// -// Command/Evaluate All. Take the text area content and evaluate in the js context -// -void JSConsole::OnCommandEvaluateAll() -{ - EvaluateText(0, (UINT)-1); -} - -// -// Command/Evaluate Selection. Take the current text area selection and evaluate in the js context -// -void JSConsole::OnCommandEvaluateSelection() -{ - // - // get the selection and evaluate it - // - DWORD startSel, endSel; - - // get selection range - ::SendMessage(mEditWindow, EM_GETSEL, (WPARAM)&startSel, (LPARAM)&endSel); - - EvaluateText(startSel, endSel); -} - -// -// Command/Inspector. Run the js inspector on the global object -// -void JSConsole::OnCommandInspector() -{ - ::MessageBox(mMainWindow, "Inspector not yet available", "JSConsole Error", MB_OK | MB_ICONINFORMATION); -} - -// -// Help -// -void JSConsole::OnHelp() -{ -} - -// -// private method. Deal with the "Edit" menu -// -void JSConsole::InitEditMenu(HMENU aMenu) -{ - CHAR someText[2] = {'\0', '\0'}; // some buffer - - // set flags to "disable" - UINT undoFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - UINT cutFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - UINT copyFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - UINT pasteFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - UINT deleteFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - UINT selectAllFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - - // check if the edit area has any text - SendMessage(mEditWindow, WM_GETTEXT, (WPARAM)2, (LPARAM)someText); - if (someText[0] != '\0') { - // enable the "Select All" - selectAllFlags = MF_BYPOSITION | MF_ENABLED; - - // enable "Copy/Cut/Paste" if there is any selection - UINT startPos, endPos; - SendMessage(mEditWindow, EM_GETSEL, (WPARAM)&startPos, (LPARAM)&endPos); - if (startPos != endPos) { - cutFlags = MF_BYPOSITION | MF_ENABLED; - copyFlags = MF_BYPOSITION | MF_ENABLED; - deleteFlags = MF_BYPOSITION | MF_ENABLED; - } - } - - // undo is available if the edit control says so - if (SendMessage(mEditWindow, EM_CANUNDO, (WPARAM)0, (LPARAM)0)) { - undoFlags = MF_BYPOSITION | MF_ENABLED; - } - - // check whether or not the clipboard contains text data - if (IsClipboardFormatAvailable(CF_TEXT)) { - pasteFlags = MF_BYPOSITION | MF_ENABLED; - } - - // do enable/disable - VERIFY(EnableMenuItem(aMenu, - ID_EDITUNDO - ID_EDITMENU - 1, - undoFlags), - -1L, - "Disable/Enable \"Undo\" Failed"); - VERIFY(EnableMenuItem(aMenu, - ID_EDITCUT - ID_EDITMENU - 1, - cutFlags), - -1L, - "Disable/Enable \"Cut\" Failed"); - VERIFY(EnableMenuItem(aMenu, - ID_EDITCOPY - ID_EDITMENU - 1, - copyFlags), - -1L, - "Disable/Enable \"Copy\" Failed"); - VERIFY(EnableMenuItem(aMenu, - ID_EDITPASTE - ID_EDITMENU - 1, - pasteFlags), - -1L, - "Disable/Enable \"Paste\" Failed"); - VERIFY(EnableMenuItem(aMenu, - ID_EDITDELETE - ID_EDITMENU - 1, - deleteFlags), - -1L, - "Disable/Enable \"Delete\" Failed"); - VERIFY(EnableMenuItem(aMenu, - ID_EDITSELECTALL - ID_EDITMENU - 1, - selectAllFlags), - -1L, - "Disable/Enable \"Select All\" Failed"); -} - -// -// private method. Deal with the "Command" menu -// -void JSConsole::InitCommandMenu(HMENU aMenu) -{ - CHAR someText[2] = {'\0', '\0'}; // some buffer - - // set flags to "disable" - UINT evaluateAllFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - UINT evaluateSelectionFlags = MF_BYPOSITION | MF_DISABLED | MF_GRAYED; - - // check if the edit area has any text - SendMessage(mEditWindow, WM_GETTEXT, (WPARAM)2, (LPARAM)someText); - if (someText[0] != 0) { - // if there is some text enable "Evaluate All" - evaluateAllFlags = MF_BYPOSITION | MF_ENABLED; - - // enable "Evaluate Selection" if there is any selection - UINT startPos, endPos; - SendMessage(mEditWindow, EM_GETSEL, (WPARAM)&startPos, (LPARAM)&endPos); - if (startPos != endPos) { - evaluateSelectionFlags = MF_BYPOSITION | MF_ENABLED; - } - } - - // disable/enable commands - VERIFY(EnableMenuItem(aMenu, - ID_COMMANDSEVALALL - ID_COMMANDSMENU - 1, - evaluateAllFlags), - -1L, - "Disable/Enable \"Evaluate All\" Failed"); - VERIFY(EnableMenuItem(aMenu, - ID_COMMANDSEVALSEL - ID_COMMANDSMENU - 1, - evaluateSelectionFlags), - -1L, - "Disable/Enable \"Evaluate Selection\" Failed"); -} - -// -// normailize a buffer of char coming from a text area. -// Basically get rid of the 0x0D char -// -LPSTR NormalizeBuffer(LPSTR aBuffer) -{ - // trim all the 0x0D at the beginning (should be 1 at most, but hey...) - while (*aBuffer == 0x0D) { - aBuffer++; - } - - LPSTR readPointer = aBuffer; - LPSTR writePointer = aBuffer; - - do { - // compact the buffer if needed - *writePointer = *readPointer; - - // skip the 0x0D - if (*readPointer != 0x0D) { - writePointer++; - } - - } while (*readPointer++ != '\0'); - - return aBuffer; -} - -LPSTR PrepareForTextArea(LPSTR aBuffer, PRInt32 aSize) -{ - PRInt32 count = 0; - LPSTR newBuffer = aBuffer; - LPSTR readPointer = aBuffer; - - // count the '\n' - while (*readPointer != '\0' && (*readPointer++ != '\n' || ++count)); - - if (0 != count) { - readPointer = aBuffer; - newBuffer = new CHAR[aSize + count + 1]; - LPSTR writePointer = newBuffer; - while (*readPointer != '\0') { - if (*readPointer == '\n') { - *writePointer++ = 0x0D; - } - *writePointer++ = *readPointer++; - } - *writePointer = '\0'; - } - - return newBuffer; -} - -// -// Evaluate the text enclosed between startSel and endSel -// -void JSConsole::EvaluateText(UINT aStartSel, UINT aEndSel) -{ - if (mContext) { - // get the text size - UINT size = ::SendMessage(mEditWindow, WM_GETTEXTLENGTH, (WPARAM)0, (LPARAM)0); - - // alloc a buffer big enough to contain the file - CHAR *buffer = new CHAR[++size]; - if (buffer) { - - // get the whole text - ::SendMessage(mEditWindow, WM_GETTEXT, (WPARAM)size, (LPARAM)buffer); - - // get the portion of the text to be evaluated - if (aEndSel != (UINT)-1) { - size = aEndSel - aStartSel; - strncpy(buffer, buffer + aStartSel, size); - buffer[size] = '\0'; - } - else { - aEndSel = size; - } - - - // change the 0x0D0x0A couple in 0x0A ('\n') - // no new buffer allocation, the pointer may be in the middle - // of the old buffer though, so keep buffer to call delete - LPSTR cleanBuffer = ::NormalizeBuffer(buffer); - - // evaluate the string - jsval returnValue; - if (mContext->EvaluateString(cleanBuffer, - strlen(cleanBuffer), - &returnValue)) { - // output the result on the console and on the edit area - CHAR result[128]; - LPSTR res = result; - int bDelete = 0; - - ::printf("The return value is "); - if (JSVAL_IS_OBJECT(returnValue)) { - ::printf("an object\n"); - ::sprintf(result, " anObject [0x%X] ", JSVAL_TO_OBJECT(returnValue)); - } - else if (JSVAL_IS_INT(returnValue)) { - ::printf("an int [%d]\n", JSVAL_TO_INT(returnValue)); - ::sprintf(result, " %d ", JSVAL_TO_INT(returnValue)); - } - else if (JSVAL_IS_DOUBLE(returnValue)) { - ::printf("a double [%f]\n", *JSVAL_TO_DOUBLE(returnValue)); - ::sprintf(result, " %f ", *JSVAL_TO_DOUBLE(returnValue)); - } - else if (JSVAL_IS_STRING(returnValue)) { - ::printf("a string [%s]\n", JS_GetStringBytes(JSVAL_TO_STRING(returnValue))); - char *jsRes = JS_GetStringBytes(JSVAL_TO_STRING(returnValue)); - // make a string with 0xA changed to 0xD0xA - res = PrepareForTextArea(jsRes, JS_GetStringLength(JSVAL_TO_STRING(returnValue))); - if (res != jsRes) { - bDelete = 1; // if the buffer was new'ed - } - } - else if (JSVAL_IS_BOOLEAN(returnValue)) { - ::printf("a boolean [%d]\n", JSVAL_TO_BOOLEAN(returnValue)); - if (JSVAL_TO_BOOLEAN(returnValue)) { - ::strcpy(result, " true "); - } - else { - ::strcpy(result, " false "); - } - } - else if (JSVAL_IS_NULL(returnValue)) { - printf("null\n"); - ::strcpy(result, " null "); - } - else if (JSVAL_IS_VOID(returnValue)) { - printf("void\n"); - ::strcpy(result, " void "); - } - else { - printf("error: unknow return type!\n"); - ::strcpy(result, " error: unknow return type! "); - } - - // set the position at the end of the selection - ::SendMessage(mEditWindow, EM_SETSEL, (WPARAM)aEndSel, (LPARAM)aEndSel); - // write the result - ::SendMessage(mEditWindow, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)res); - // highlight the result - ::SendMessage(mEditWindow, EM_SETSEL, (WPARAM)aEndSel - 1, (LPARAM)(aEndSel + strlen(res))); - - // deal with the "big string" case - if (bDelete > 0) { - delete[] res; - } - - // clean up a bit - JS_GC(mContext->GetContext()); - } - else { - ::MessageBox(mMainWindow, - "Error evaluating the Script", - "JSConsole Error", - MB_OK | MB_ICONERROR); - } - - delete[] buffer; - } - else { - ::MessageBox(mMainWindow, - "Not Enough Memory to Allocate a Buffer to Evaluate the Script", - "JSConsole Error", - MB_OK | MB_ICONSTOP); - } - } - else { - ::MessageBox(mMainWindow, - "Java Script Context not initialized", - "JSConsole Error", - MB_OK | MB_ICONSTOP); - } -} - - diff --git a/mozilla/webshell/tests/viewer/JSConsole.h b/mozilla/webshell/tests/viewer/JSConsole.h deleted file mode 100644 index 21e8d29a554..00000000000 --- a/mozilla/webshell/tests/viewer/JSConsole.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef jsconsole_h__ -#define jsconsole_h__ - -#include - -class nsIScriptContext; - -#define OPEN_DIALOG 0 -#define SAVE_DIALOG 1 - -typedef void (*DESTROY_NOTIFICATION) (); - -class JSConsole { - -private: - HWND mMainWindow; - HWND mEditWindow; - - DESTROY_NOTIFICATION mDestroyNotification; - - // keep info from the OPENFILENAME struct - struct FileInfo { - CHAR mCurrentFileName[MAX_PATH]; - WORD mFileOffset; - WORD mFileExtension; - - void Init() {mCurrentFileName[0] = '\0'; mFileOffset = 0; mFileExtension = 0;} - } mFileInfo; - - // one context per window - nsIScriptContext *mContext; - -public: - static HINSTANCE sAppInstance; - static HACCEL sAccelTable; - static CHAR sDefaultCaption[]; - - static BOOL RegisterWidget(); - static JSConsole* CreateConsole(); - static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - -private: - static BOOL mRegistered; - -public: - JSConsole(HWND aMainWindow, HWND aEditControl); - ~JSConsole(); - - BOOL LoadFile(); - BOOL SaveFile(); - - BOOL OpenFileDialog(UINT aOpenOrSave); - inline BOOL CanSave() { return mFileInfo.mCurrentFileName[0] != '\0'; } - void SetFileName(LPSTR aFileName); - - HWND GetMainWindow() { return mMainWindow; } - void SetNotification(DESTROY_NOTIFICATION aNotification) { mDestroyNotification = aNotification; } - void SetContext(nsIScriptContext *aContext) { mContext = aContext; } - - void EvaluateText(UINT aStartSel, UINT aEndSel); - - // windows messages - LRESULT OnSize(DWORD aResizeFlags, UINT aWidth, UINT aHeight); - LRESULT OnInitMenu(HMENU aMenu, UINT aPos, BOOL aIsSystem); - LRESULT OnSetFocus(HWND aWnd); - - void OnDestroy(); - - // menu items - void OnFileNew(); - void OnEditUndo(); - void OnEditCut(); - void OnEditCopy(); - void OnEditPaste(); - void OnEditDelete(); - void OnEditSelectAll(); - void OnCommandEvaluateAll(); - void OnCommandEvaluateSelection(); - void OnCommandInspector(); - void OnHelp(); - -private: - void InitEditMenu(HMENU aMenu); - void InitCommandMenu(HMENU aMenu); -}; - -#endif // jsconsole_h__ - diff --git a/mozilla/webshell/tests/viewer/jsconsres.h b/mozilla/webshell/tests/viewer/jsconsres.h deleted file mode 100644 index ba69fac3538..00000000000 --- a/mozilla/webshell/tests/viewer/jsconsres.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef jsconsres_h___ -#define jsconsres_h___ - - -// Main menu id -#define JSCONSOLE_MENU 20100 - -#define FILEMENUPOS 0 -#define ID_FILEMENU 20200 -// File menu items ids -#define ID_FILENEW 20201 -#define ID_FILEOPEN 20202 -#define ID_FILESAVE 20203 -#define ID_FILESAVEAS 20204 -// separator -#define ID_FILEEXIT 20206 - -#define EDITMENUPOS 1 -#define ID_EDITMENU 20300 -// Edit menu items ids -#define ID_EDITUNDO 20301 -// separator -#define ID_EDITCUT 20303 -#define ID_EDITCOPY 20304 -#define ID_EDITPASTE 20305 -#define ID_EDITDELETE 20306 -// separator -#define ID_EDITSELECTALL 20308 - -#define COMMANDSMENUPOS 2 -#define ID_COMMANDSMENU 20400 -// Commands menu items ids -#define ID_COMMANDSEVALALL 20401 -#define ID_COMMANDSEVALSEL 20402 -// separator -#define ID_COMMANDSINSPECTOR 20404 - -#define HELPMENUPOS 3 -#define ID_HELPMENU 20500 -// Help menu items -#define ID_NOHELP 20501 - -// -// Accelerators table ids -// -#define ACCELERATOR_TABLE 1000 - -#endif // jsconsres_h___ - diff --git a/mozilla/webshell/tests/viewer/makefile.win b/mozilla/webshell/tests/viewer/makefile.win deleted file mode 100644 index 118452d1ad8..00000000000 --- a/mozilla/webshell/tests/viewer/makefile.win +++ /dev/null @@ -1,90 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = EXE -PROGRAM = .\$(OBJDIR)\viewer.exe -RESFILE = viewer.res - -MISCDEP= \ - $(DIST)\lib\raptorweb.lib \ - $(DIST)\lib\xpcom32.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib - - -OBJS = \ - .\$(OBJDIR)\winmain.obj \ - .\$(OBJDIR)\JSConsole.obj \ - .\$(OBJDIR)\nsDocLoader.obj \ - $(NULL) - -LINCS=-I$(PUBLIC)\raptor -I$(PUBLIC)\xpcom -I$(PUBLIC)\dom -I$(PUBLIC)\js -MYLIBS= \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorhtml.lib \ - $(DIST)\lib\raptorweb.lib \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\js3240.lib \ - $(LIBNSPR) \ - $(DIST)\lib\libplc21.lib \ - $(DIST)\lib\netlib.lib \ - comdlg32.lib \ - $(NULL) - -LLIBS= $(MYLIBS) \ - shell32.lib \ - -SUBSYSTEM:CONSOLE - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAM) - $(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin - $(MAKE_INSTALL) samples\test0.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test1.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test2.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test3.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test4.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test5.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test6.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test7.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\test8.html $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\raptor.jpg $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\Anieyes.gif $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\gear1.gif $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\rock_gra.gif $(DIST)\bin\res\samples - $(MAKE_INSTALL) samples\bg.jpg $(DIST)\bin\res\samples - -clobber:: - rm -f $(DIST)\bin\viewer.exe - rm -f $(DIST)\bin\res\samples\test0.html - rm -f $(DIST)\bin\res\samples\test1.html - rm -f $(DIST)\bin\res\samples\test2.html - rm -f $(DIST)\bin\res\samples\test3.html - rm -f $(DIST)\bin\res\samples\test4.html - rm -f $(DIST)\bin\res\samples\test5.html - rm -f $(DIST)\bin\res\samples\test6.html - rm -f $(DIST)\bin\res\samples\test7.html - rm -f $(DIST)\bin\res\samples\test8.html - rm -f $(DIST)\bin\res\samples\raptor.jpg - rm -f $(DIST)\bin\res\samples\Anieyes.gif - rm -f $(DIST)\bin\res\samples\gear1.gif - rm -f $(DIST)\bin\res\samples\rock_gra.gif - rm -f $(DIST)\bin\res\samples\bg.jpg diff --git a/mozilla/webshell/tests/viewer/nsDocLoader.cpp b/mozilla/webshell/tests/viewer/nsDocLoader.cpp deleted file mode 100644 index 1fbc3026ec5..00000000000 --- a/mozilla/webshell/tests/viewer/nsDocLoader.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsDocLoader.h" -#include "nsITimer.h" -#include "nsITimerCallback.h" -#include "nsVoidArray.h" -#include "plstr.h" -#include "nsIWebWidget.h" -#include "resources.h" -#include "nsString.h" - -#include - -/* - This class loads creates and loads URLs until finished. - When the doc counter reaches zero, the DocLoader (optionally) - posts an exit application message - -*/ - -nsDocLoader::nsDocLoader(nsIWebWidget* aWebWidget, PRInt32 aSeconds, PRBool aPostExit) -{ - mStart = PR_FALSE; - mDelay = aSeconds; - mPostExit = aPostExit; - mDocNum = 0; - mWebWidget = aWebWidget; - - mTimers = new nsVoidArray(); - mURLList = new nsVoidArray(); -} - -nsDocLoader::~nsDocLoader() -{ - if (mURLList) - { - PRInt32 count = mURLList->Count(); - for (int i = 0; i < count; i++) - { - nsString* s = (nsString*)mURLList->ElementAt(i); - delete s; - } - delete mURLList; - mURLList = nsnull; - } - - if (mTimers) - { - delete mTimers; - mTimers = nsnull; - } - -} - -// Set the delay (by default, the timer is set to one second) -void nsDocLoader::SetDelay(PRInt32 aSeconds) -{ - mDelay = aSeconds; -} - - -// Add a URL to the doc loader -void nsDocLoader::AddURL(char* aURL) -{ - if (aURL) - { - if (mStart == PR_FALSE) - { - nsString* url; - - if (mURLList == nsnull) - mURLList = new nsVoidArray(); - - url = new nsString(aURL); - mURLList->AppendElement((void*)url); - } - } -} - -// Add a URL to the doc loader -void nsDocLoader::AddURL(nsString* aURL) -{ - if (aURL) - { - if (mStart == PR_FALSE) - { - nsString* url; - - if (mURLList == nsnull) - mURLList = new nsVoidArray(); - url = new nsString(*aURL); - mURLList->AppendElement((void*)url); - } - } -} - -void nsDocLoader::StartTimedLoading() -{ - // Only start once! - if (mStart == PR_FALSE) - { - mStart = PR_TRUE; - if (mURLList) - { - CreateRepeat(mDelay*1000); - } - } -} - - - - -/* -* -* BEGIN PURIFY METHODS -* -*/ - -nsDocLoader* gDocLoader = nsnull; -void MyCallback (nsITimer *aTimer, void *aClosure) -{ - - if (gDocLoader != nsnull) - { - nsVoidArray* timers = gDocLoader->GetTimers(); - printf("Timer executed with delay %d\n", (int)aClosure); - if (timers->RemoveElement(aTimer) == PR_TRUE) - { - NS_RELEASE(aTimer); - gDocLoader->CallTest(); - } - } -} - - -void nsDocLoader::CreateOneShot(PRUint32 aDelay) -{ - nsITimer *timer; - gDocLoader = this; - NS_NewTimer(&timer); - timer->Init(MyCallback, (void *)aDelay, aDelay); - mTimers->AppendElement(timer); -} - - -void MyRepeatCallback (nsITimer *aTimer, void *aClosure) -{ - if (gDocLoader != nsnull) - { - nsVoidArray* timers = gDocLoader->GetTimers(); - - printf("Timer executed with delay %d\n", (int)aClosure); - if (timers->RemoveElement(aTimer) == PR_TRUE) - { - NS_RELEASE(aTimer); - gDocLoader->CallTest(); - } - gDocLoader->CreateRepeat((PRUint32)aClosure); - } -} - -void nsDocLoader::CreateRepeat(PRUint32 aDelay) -{ - if (mTimers) - { - gDocLoader = this; - nsITimer *timer; - - NS_NewTimer(&timer); - timer->Init(MyRepeatCallback, (void *)aDelay, aDelay); - - mTimers->AppendElement(timer); - } -} - - -void nsDocLoader::DoAction(PRInt32 aDocNum) -{ - if (aDocNum >= 0 && aDocNum < mURLList->Count()) - { - nsString* url = (nsString*)mURLList->ElementAt(aDocNum); - if (url) - mWebWidget->LoadURL(*url); - } -} - - -void nsDocLoader::CallTest() -{ - if (mDocNum < mURLList->Count()) - { - DoAction(mDocNum++); - } - else - { - CancelAll(); - - printf("Finished Running Tests \n"); - if (mPostExit) - { - printf("QUITTING APPLICATION \n"); - PostMessage(HWND_BROADCAST,(UINT)WM_COMMAND,(WPARAM)VIEWER_EXIT,0); - } - } -} - - - - -void nsDocLoader::CancelAll() -{ - int i, count = mTimers->Count(); - - for (i=0; i < count; i++) - { - nsITimer *timer = (nsITimer *)mTimers->ElementAt(i); - - if (timer != NULL) - { - timer->Cancel(); - NS_RELEASE(timer); - } - } - mTimers->Clear(); - delete mTimers; - mTimers = nsnull; - - if (mURLList) - { - PRInt32 count = mURLList->Count(); - for (int i = 0; i < count; i++) - { - nsString* s = (nsString*)mURLList->ElementAt(i); - delete s; - } - delete mURLList; - mURLList = nsnull; - } - -} diff --git a/mozilla/webshell/tests/viewer/nsDocLoader.h b/mozilla/webshell/tests/viewer/nsDocLoader.h deleted file mode 100644 index 76b4b5f349d..00000000000 --- a/mozilla/webshell/tests/viewer/nsDocLoader.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsDocLoader_h___ -#define nsDocLoader_h___ - -#include "nscore.h" -#include "nsISupports.h" - - -class nsIWebWidget; -class nsITimer; -class nsVoidArray; -class nsString; - -/* - This class loads creates and loads URLs until finished. - When the doc counter reaches zero, the DocLoader (optionally) - posts an exit application message -*/ - -class nsDocLoader -{ - public: - nsDocLoader(nsIWebWidget* aWebWidget, PRInt32 aSeconds=1, PRBool aPostExit=PR_TRUE); - virtual ~nsDocLoader(); - - // Add a URL to the doc loader - void AddURL(char* aURL); - void AddURL(nsString* aURL); - - // Get the timer and the url list - // needed to be available for the call back methods - nsVoidArray* GetTimers() - { return mTimers; } - nsVoidArray* GetURLList() - { return mURLList; } - - - void CreateOneShot(PRUint32 aDelay); - void CreateRepeat(PRUint32 aDelay); - void CallTest(); - - // Set the delay (by default, the timer is set to one second) - void SetDelay(PRInt32 aSeconds); - - // If set to TRUE the loader will post an exit message on - // exit - void SetExitOnDone(PRBool aPostExit); - - // Start Loading the list of documents and executing the - // Do Action Method on the documents - void StartTimedLoading(); - - - // By default this method loads a document from - // the list of documents added to the loader - // Override in subclasses to get different behavior - virtual void DoAction(PRInt32 aDocNum); - - - private: - - void CancelAll(); - - - - PRInt32 mDocNum; - PRBool mStart; - PRInt32 mDelay; - PRBool mPostExit; - nsIWebWidget* mWebWidget; - - nsVoidArray* mURLList; - nsVoidArray* mTimers; -}; - - - -#endif \ No newline at end of file diff --git a/mozilla/webshell/tests/viewer/resources.h b/mozilla/webshell/tests/viewer/resources.h deleted file mode 100644 index 759e8d8987b..00000000000 --- a/mozilla/webshell/tests/viewer/resources.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef resources_h___ -#define resources_h___ - -#define VIEWER_OPEN 40000 -#define VIEWER_EXIT 40002 -#define PREVIEW_CLOSE 40003 - -#define VIEWER_FILE_OPEN 40010 - -// Note: must be in ascending sequential order -#define VIEWER_DEMO0 40011 -#define VIEWER_DEMO1 40012 -#define VIEWER_DEMO2 40013 -#define VIEWER_DEMO3 40014 -#define VIEWER_DEMO4 40015 -#define VIEWER_DEMO5 40016 -#define VIEWER_DEMO6 40017 -#define VIEWER_DEMO7 40018 -#define VIEWER_DEMO8 40019 - -#define VIEWER_VISUAL_DEBUGGING 40020 -#define VIEWER_REFLOW_TEST 40021 -#define VIEWER_DUMP_CONTENT 40022 -#define VIEWER_DUMP_FRAMES 40023 -#define VIEWER_DUMP_VIEWS 40024 -#define VIEWER_DUMP_STYLE 40025 - -// Note: must be in ascending sequential order -#define VIEWER_ONE_COLUMN 40031 -#define VIEWER_TWO_COLUMN 40032 -#define VIEWER_THREE_COLUMN 40033 - -#define JS_CONSOLE 40100 - -#endif /* resources_h___ */ diff --git a/mozilla/webshell/tests/viewer/samples/Anieyes.gif b/mozilla/webshell/tests/viewer/samples/Anieyes.gif deleted file mode 100644 index de488ba16c8e57f7f481df641e7b92ae1d143891..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13539 zcmeHt`8(U&*Y+opm?bg9JcLp;R8>&gCK7_6tr&}u>H;%JY#Xf@AA|A6;-uJ^s(AD-*#{%vKgeeZkSJK2_XEoT=e8{1Ga zU;umr0MX_Wh(sKbh$a$YMIvC+5(q>Bjz~Zg39upou<7IoL>!KYLlbeZA`Y+_OB0A_ z91)EsqG3feU~?;0Ai{D)Segin6=4AoNdyQ)07nGSL;zLv7mdTgayYFqQ+*H~^Ldfa!sHfHc9~pd4WSAPF!-kTnPfk_K6V zp&$?NU=SOG2C;xm4GdkCk?>T08mFzX;1)= z7Z?r-4Q2~U3F-mT1b2gSfSkaD!3;sxAQ(s*+zHYGd4LCl*dR2pc}1Jipc}No1%NjO z3JK;19t&DnVDrndsq3%%-gN%D!cCcf-O6U{FQGS8|E1mL)?adLUc#>oH<5mk-n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P_>vz}Qm6}BVUB2D@VSi1!);|mT3FVq z>AxexJoJ2rwy5v7ji4gQ!P-k?mv5~JIVY*M}<3?r|nw9YCXssMH@p9`tV>O z;aXv=be*Ur?C9BpT}5H=*Oojq;J!Cvpy6X{yR$OluCz-1a$*;;NsOJwr8Jn1xH3{S zC$1&61)t&&&8iYy5DSz~P*b2W)TuVmqw-wS#{0_+61Uybro$m{|td zbyc^t_=v6dU3uVJ;5YU)$)JV4RKuoB1q5Lm{yp_{^bn9&n{ZNx^to!{$~~LxV+C1q zR0F6)8nW}l6vMtVI$rNnl;SfzS`idAq#W;})}ViR;7i@RrTIV!KeC$C(N;d=ZK%>h=M!^$e;&pspl>vAtg%TDsudslkg17NV V6z}gT-rrNazo&Tr7ftc*`7ej#UPk}` diff --git a/mozilla/webshell/tests/viewer/samples/bg.jpg b/mozilla/webshell/tests/viewer/samples/bg.jpg deleted file mode 100644 index 116ffd60ac8591e6817c75c7768f1f774917ea55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9407 zcmbVxeOQub|Mv-(f|`LQEi6<@C(^bi$vr_u(S9nTBH~`|pYwJmE~R@jkY3cLfmYki zL-+zMBSM-W+GcB;E!*aXm7*=hz}w2qNK8`GQXx~b9`?K*$Me_oJSWHX7uRte=jS}X z=lA@)yuS0=3VfJJDMosq+$|Hns(krejlnIC1I@b%A zd;lB&5pf8gfpzF{jV9^sd{8@Ww@*(t6&=MkLnL)S*mt!E(-`6X4J zUTr)MkbmKV z!4J6}$k)w%D+#e7J`=fH;J0n3*aMSLckYKS&)^8ovyJ&Bx4hm6AwPU`{x4|%4cY%4 zu&VzrWd94;|Hd@}ydl>X`a-@S4$KI@o~qHs?Z&NHD~M71XBZ)Qr7^==uNQd8fcZDp zE-B?-LtTmerq(E5_<=Gj0SPQxQ4g^05otNL-#s*l1xlzCXRo=cEm&8DNDTh8p%y&X zAoeI!s~qXUpcBM(>heK2U>4#ETXk0Hpzv~Wl6$DfbQo+)Bb)de7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+FdwSU>{O^%u&TicB$PD>^I1mA<+i>O+Xdy;>wR ze8NcS2AB?4w+~s;z4Bpz&0uGAW&2nKk@a-nUQ}{cnp;2=$9mvtyj__PUZw$yL-Wjz z;40#GrBmIZ89DRx4ZDADKbFx<+}N4;?zk&2j*H5{9dLyr<=$qyOu#@arZ&2|0M2V4 z%at18>}th{nsa);>9CQEI30+D@SDqJJClksO);FO0T_4~SSKI!O2V0+62!HoITyQ2KZMEPdvVTXQ>6OLrk5lN33(8!q~r*8SZ1=Q0vLcEIyon0MQRit#2PB%={ zSGIRnJO+edNm`z8IqP3WU1ZFn=~6hx(UTrp^p;D)rlH2#f!~Z-)I=rJl&ATifZm;! z(hqiwE+%=*MWj?^xUO0f!wnh0gZ1@q4V;wX%DwW4-~gr}p!Hfv9;eQ_tdjSM;K3^UZIJBlKZ~faAIGXBWLVaA*RLZX^ltSfgZneqQrbOccQ+D3{j?2YY zRSZa~OtYCqo7%zxUubm-*og~UViltJVOcds1(V*orwhm6B#{TT!4O8|6HzCoqe4C( zZ}>Q%LoYkMJ85G>As)>HX@OVPh{-?bD{P`t2l=ztU|X$cpLH`ZX)wPYMkz$X>Y+jS z0{WAy^6&S41aJkFnEO|ry8MVibKwD*ivUY(h4s&-280m>?{x4e@O_wzq^y|C-6=ZCxCjbBd diff --git a/mozilla/webshell/tests/viewer/samples/gear1.gif b/mozilla/webshell/tests/viewer/samples/gear1.gif deleted file mode 100644 index a694f2dfcdd2e12378f9d7df96d6cf79370a1e73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9492 zcmeI1c{G&$|NpOLHq0;>yBM;E#*z?qjonz9#uB2&nz0TuwshAuNUBMLAtLu6;*J`m zwB3ysY134aq*6&*?$W+ceSPoy{LcCP@%jG$`QyI+y3X}J*E!GgJn!c@kLT;<>+j?2 z63YZaf$aeB>(?(bf#70i`Ec|Mi(!`+4D#Ji}`cv%Y+J zJ32bt*ViQ$3kwT*Z{I#-u^7L8jlO+*CN-7y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|*{hoAiSnP+AOkDr|r&*x-jP(u>=)THdpbXSrhNs*owpPZOp zKn>z#B;;jgr}C)&8S%CxMW*d)TdGH9K6M$5MpE=hOyp-~SW{PL@ME(%nIy$PnlIIk zzHs7652kz37k(fq{;ecFGd(>qgHMf1%ZyK55RjHe&B)|aW4YYK*la2%<8PTfYJ7HL iEdT#0jHPBLZshRziP;NZauc(8|En@H=|3t5R{Ref@ha{B diff --git a/mozilla/webshell/tests/viewer/samples/raptor.jpg b/mozilla/webshell/tests/viewer/samples/raptor.jpg deleted file mode 100644 index 243ba9e2d43e0073bd2b8d35f570ea4522b4e408..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49629 zcmcG$30O~C*f+ek49QTa45>t)sWeEXxzJ35O3^^lF^`EzDoQlZ(m}9RJ*S?3}{k!kA_TK-_N1acZl(B)40Ta3i z%n<*v&W}qB%su^A`LFc!UolK$+ypjtwvnmWTSk9EnF9Xi=P}mhO&80~ADutMB)d2c z>(Xts*e^Oo@Dx1h*mqm6Bw-bs)GNs_gPAZv5NJ?Ek_q_lzxyLF_dfshOC@(<{r>*f ze2obcxC|e8hZIT4XZicc$G-D1@xL$OGIy2W|H9qq3>7K1>4Cq<1ApOvTQqUpfd6~HXM>o~`QIVp4^uJlTJA9{ zB+zTsDi6P5uB(U5a`$)j81@fNGKOgaD4m~JUp~OxF(D?aXPa1WadGjU;=OzJ?A@=I zM6Z4_lD&IN$_yGXKxV*zLH&C3KYt%Y|M>UcLZ4o}`t*!$7hdF zmRWegRYNmy!@W5@Mn+qHdG^(9rIzf`!i}Tm?z3{&zj$ob&WgTK#x&c7pow| zv4QUT){|FxJpV_8|91&g{!@g`I@Vi^-?JanV=cW89a?L=c%5lvTAKIk)93AK^%k!g zr5k*@y>-plhNi;U8-Gl~4QeVn*^P#*PPVIWWX+m$^RH#6YL)6FTsiP!YH>n+@r8Vk zsIhHTo$U6nmYdG2{PPAcFYTq0a$s_WlgC4e_x}DVm5VF?TpDBPx@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fA>IS{{v!3o7PWI z1wk75=9Augi`xnqQuCPd&Y0@5?7tuVNQp;5)1JKgmvXO!p$dpHKCvA7Pj>w=K=}-y z(rM%9xffoe5!f5#338{2EcKp*C~^23_D4RakBt4nC-ssQ?eFb|y#AU)S1tthzBF$W zE=&-oeomkcllpx5VgPR%a_|ZCSOjWyED(; z&~G@ZxY3%sZEzY(8uCaFJsy=DIN35$%@mSTzx3D~1Gt?(Yk%oT8vW}6TjCk7NUJkD g#em&+4#(1AM&RgPtYMtT0H!04yf+{~l1d1poj5 diff --git a/mozilla/webshell/tests/viewer/samples/test0.html b/mozilla/webshell/tests/viewer/samples/test0.html deleted file mode 100644 index d5e7e16ee54..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test0.html +++ /dev/null @@ -1,69 +0,0 @@ - - -Example 0 - - - -

    Example 0: Basic HTML Text Styles

    -


    -

    Formatted Text

    -

    This is a basic paragraph with bold, italic and bold-italic - text. It also includes red, green - and blue text. It has strikethru and underline. -

    -

    This is a paragraph with font variations: Arial, - Verdana, COURIER, - Times New Roman.

    -

    Font size=7, Font size=6, Font - size=5, Font size=4, Font size=3, Font - size=2, Font size=1, Font - point-size=24 font-weight=700

    -

    3D Text. 3D Text. 3D Text. 3D Text. 3D Text.
    -


    -

    -

    Listings

    -

    Bulleted List

    -
      -
    • One
    • -
    • Two -
        -
      • Apples
      • -
      • Oranges
      • -
      • Bananas
      • -
      -
    • -
    • Three
    • -
    -
    -

    Numbered List

    -
      -
    1. One
    2. -
    3. Two -
        -
      1. Apples
      2. -
      3. Oranges
      4. -
      5. Bananas
      6. -
      -
    4. -
    5. Three
    6. -
    -

    Justified Text

    -

    This paragraph is aligned left. This paragraph is aligned left. - This paragraph is aligned left. This paragraph is aligned left. - This paragraph is aligned left. This paragraph is aligned left. - This paragraph is aligned left.

    -

    This paragarph is aligned right. This paragarph is aligned - right. This paragarph is aligned right. This paragarph is aligned - right. This paragarph is aligned right. This paragarph is aligned - right. This paragarph is aligned right. This paragarph - is aligned right.

    -

    This paragraph is aligned center. This paragraph is aligned - center.This paragraph is aligned center.This paragraph is aligned - center.This paragraph is aligned center.This paragraph is aligned - center.This paragraph is aligned center.This paragraph is aligned - center.This paragraph is aligned center.This paragraph is aligned - center.

    -

    -

     

    - - diff --git a/mozilla/webshell/tests/viewer/samples/test1.html b/mozilla/webshell/tests/viewer/samples/test1.html deleted file mode 100644 index ece2a9deae6..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test1.html +++ /dev/null @@ -1,79 +0,0 @@ - - -Example 1 - - - - - - -

    Example 1: CSS HTML Text Styles

    -


    -

    Note -- This document contains the following CSS declarations:

    -
    H1     { color: rgb(128,0,128) }
    -PRE    { background-color: rgb(200,200,200); }
    -B      { background-color: rgb(128, 128, 255); 
    -         font-size: large; } 
    -I      { font-size: larger; } 
    -B I    { font-size: smaller; } 
    -LI B   { font-size: .25in; } 
    -UL LI  { color:    green; 
    -        list-style: square outside url(resource:/res/gear1.gif); 
    -        //none; } 
    -UL UL LI { color: red; } 
    -H4     { color: yellow;
    -      	  background-image: url(gear1.gif); 
    -         background-repeat: repeat; 
    -         font-size:    150%; } 
    -
    -


    -

    Here is an example of bold, italic and bold-italic

    -


    -

    Bulleted List

    -
      -
    • One
    • -
    • Two -
        -
      • Apples
      • -
      • Oranges
      • -
      • Bananas
      • -
      -
    • -
    • Three Bold Text
    • -
    -


    -

    H3 -- A headline style, with a background image repeated and a font size increase - by 150%. H3 -- A headline style, with a background image repeated and a font - size increase by 150%. H3 -- A headline style, with a background image repeated - and a font size increase by 150%.

    - - diff --git a/mozilla/webshell/tests/viewer/samples/test2.html b/mozilla/webshell/tests/viewer/samples/test2.html deleted file mode 100644 index 2acdb4d5db8..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test2.html +++ /dev/null @@ -1,41 +0,0 @@ - - -Example 2 - - - - - - - - -

    Example 2: HTML Images

    -

    Images

    -

    JPEGs:

    -

    This is some text to show how a paragraph - would flow around an image. This is some text to show how a paragraph would - flow around an image. This is some text to show how a paragraph would flow around - an image.

    -

    This is some text to show how a paragraph would flow around an image. This - is some text to show how a paragraph would flow around an image. This is some - text to show how a paragraph would flow around an image. This is some text to - show how a paragraph would flow around an image. This is some text to show how - a paragraph would flow around an image.

    -

    Animated GIFs:

    -

    -

    Background Images:

    -
    This is a preformatted paragraph with a animated background image. 
    -This is a preformatted paragraph with a animated background image. 
    -This is a preformatted paragraph with a animated background image. 
    -This is a preformatted paragraph with a animated background image. 
    -This is a preformatted paragraph with a animated background image. 
    -
    - - - diff --git a/mozilla/webshell/tests/viewer/samples/test3.html b/mozilla/webshell/tests/viewer/samples/test3.html deleted file mode 100644 index 468d08e40ce..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test3.html +++ /dev/null @@ -1,125 +0,0 @@ - - -Example 3 - - - -

    Example 3: Basic Tables

    -

    Simple

    - - - - - - - - - - - - - - - - -
    OneTwoThree
    FourFiveSix
    SevenEightNine
    -

    Row Span

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    c0r[0-1] Data 1 span=2 rowsc0r0c1r0
    c0r1c1r1
    c0r[2-6],Data 2 span=5 rowsc0r2c1r2
    c0r3c1r3
    c0r4c1r4
    c0r5c1r5
    c0r6c1r6
    c0r[7-9] span=3 rowsc0r7c1r7
    c0r8c1r8
    c0r9c1r9
    -

    Col Span

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    r0c[0-7], span=8r0col[8-17], span=10 cols
    r1c[0-2], span=3r1c[3-7], span=5r1c[8-14], span=7r1c[15-17], span=3
    r2c0r2c1r2c3r2c4r2c5r2c6r2c7r2c8r2c9r2c10r2c11r2c12r2c13r2c14r2c15r2c16r2c17r2c18
    -

    Row and Col Span

    - - - - - - - - - - - - - - - - -
    r[0-2]c[0-1]r0c2r0c3
    r1c2r1c3
    r2c0r2c1r2c2r2c3
    -

     

    - - diff --git a/mozilla/webshell/tests/viewer/samples/test4.html b/mozilla/webshell/tests/viewer/samples/test4.html deleted file mode 100644 index 18cfb0f0adf..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test4.html +++ /dev/null @@ -1,42 +0,0 @@ - -Example 4 - - - -

    Example 4: Some simple tables.

    - - - - - - -
    ColorMeaning
    lightgreenLight green is used on cells that have a colspan
    khakiKhaki is used on cells that have a rowspan
    lightgreyLight grey is used on cells that have a rowspan and a colspan
    - -Column span table: - - - - - -
    top caption
    Cell Stuff to test out table cell layout. This should be long enough.
    Cell Stuff to test out table cell layout. This should be long enough.
    Cell Stuff to test out table cell layout. This should be long enough.Cell
    -
    -Row span table, no caption: - - - - - -
    bottom caption
    Cell Stuff to test out table cell layout. This should be long enough.Cell
    CellCell
    Cell Stuff to test out table cell layout. This should be long enough.Cell
    -
    -Row and col span table: - - - - - -

    Caption Text

    Cell Stuff to test out table cell layout. This should be long enough.
    Cell
    Cell Stuff to test out table cell layout. This should be long enough.Cell
    - - - diff --git a/mozilla/webshell/tests/viewer/samples/test5.html b/mozilla/webshell/tests/viewer/samples/test5.html deleted file mode 100644 index 0a5c5e15c65..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test5.html +++ /dev/null @@ -1,38 +0,0 @@ - -Example 5 - - - - -

    Example 5: CSS with ID's

    -
    -This document contains the following CSS:
    -
    -P {
    -  color: black;
    -  background-color: yellow;
    -}
    -P#reverse {
    -  color: yellow;
    -  background-color: black;
    -}
    -
    -
    This following paragraph has no ID
    -

    This is a paragraph. We should be yellow because there is a style rule indicating - that all paragraphs have a background of yellow.

    -
    The following paragraph has ID="reverse"
    -

    This is a paragraph. We should be black with yellow text because - there is a style rule indicating that this paragraph should have a background - of black with yellow text.

    - - - diff --git a/mozilla/webshell/tests/viewer/samples/test6.html b/mozilla/webshell/tests/viewer/samples/test6.html deleted file mode 100644 index 17eb59e8ae1..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test6.html +++ /dev/null @@ -1,71 +0,0 @@ - - -Test 6 - - - - - -

    Example 6: Table Stress Test

    -
    Resize document for maximum effect
    - -

    Column span table:

    - - - - -
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    -

    Row span table

    - - - - -
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    CellCell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    -

    Row and col span table:

    - - - - -
    Cell - - - -
    Cell - - - -
    Cell - - - -
    Cell - - - -
    Cell - - - -
    Cell - - - -
    Cell - - - -
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    -
    Cell
    Cell Cell, and stuff to test out table cell layout. This should be long enough for testing.Cell
    - - - diff --git a/mozilla/webshell/tests/viewer/samples/test7.html b/mozilla/webshell/tests/viewer/samples/test7.html deleted file mode 100644 index 1f14e854bd7..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test7.html +++ /dev/null @@ -1,10 +0,0 @@ - - -Example 7 - - -

    Example 7: A scaled animated image

    - - - - diff --git a/mozilla/webshell/tests/viewer/samples/test8.html b/mozilla/webshell/tests/viewer/samples/test8.html deleted file mode 100644 index 425810a60b7..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test8.html +++ /dev/null @@ -1,34 +0,0 @@ - -Example 8 - - -

    Example 8: Forms

    - -
    -
    -

    hey yahoo

    - - - -   password:   -
    - -
    -
    - -   a checkbox: -   radio buttons: - radio1 - radio2 -
    -

    select/option hacks; why don't these line up

    -   -   - -
    - - - -
    - - diff --git a/mozilla/webshell/tests/viewer/samples/test_form.html b/mozilla/webshell/tests/viewer/samples/test_form.html deleted file mode 100644 index aa42c64240b..00000000000 --- a/mozilla/webshell/tests/viewer/samples/test_form.html +++ /dev/null @@ -1,34 +0,0 @@ - - -
    - -A checkbox:
    - -Another checkbox:
    - -Yet another checkbox:
    - -One last checkbox:
    - -

    This is a simple form

    -

    This is a simple form

    -

    This is a simple form

    -

    This is a simple form

    -

    This is a simple form

    -

    -

    enter some text

    -

    -

    -

    -

    " " - -

    -

    This is a simple form

    -

    This is a simple form

    -

    This is a simple form

    -

    This is a simple form

    -

    This is a simple form

    -
    - - - diff --git a/mozilla/webshell/tests/viewer/viewer.rc b/mozilla/webshell/tests/viewer/viewer.rc deleted file mode 100644 index 45a80afe85c..00000000000 --- a/mozilla/webshell/tests/viewer/viewer.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "resources.h" -#include "jsconsres.h" -#include - - -VIEWER MENU DISCARDABLE -{ - POPUP "&File" - { - MENUITEM "&Open...", VIEWER_FILE_OPEN - POPUP "&Samples" - { - MENUITEM "demo #0", VIEWER_DEMO0 - MENUITEM "demo #1", VIEWER_DEMO1 - MENUITEM "demo #2", VIEWER_DEMO2 - MENUITEM "demo #3", VIEWER_DEMO3 - MENUITEM "demo #4", VIEWER_DEMO4 - MENUITEM "demo #5", VIEWER_DEMO5 - MENUITEM "demo #6", VIEWER_DEMO6 - MENUITEM "demo #7", VIEWER_DEMO7 - MENUITEM "demo #8", VIEWER_DEMO8 - } - POPUP "Print &Preview" - { - MENUITEM "One Column", VIEWER_ONE_COLUMN - MENUITEM "Two Column", VIEWER_TWO_COLUMN - MENUITEM "Three Column", VIEWER_THREE_COLUMN - } - MENUITEM "&Exit", VIEWER_EXIT - } - POPUP "&Debug" - { - MENUITEM "&Visual Debugging", VIEWER_VISUAL_DEBUGGING - MENUITEM "&Reflow Test", VIEWER_REFLOW_TEST - MENUITEM SEPARATOR - MENUITEM "Dump &Content", VIEWER_DUMP_CONTENT - MENUITEM "Dump &Frames", VIEWER_DUMP_FRAMES - MENUITEM "Dump &Views", VIEWER_DUMP_VIEWS - MENUITEM "Dump &Style", VIEWER_DUMP_STYLE - } - POPUP "&Tools" - { - MENUITEM "&JavaScript Console", JS_CONSOLE - } -} - -PRINTPREVIEW MENU DISCARDABLE -{ - POPUP "&File" - { - MENUITEM "&Close", PREVIEW_CLOSE - } - POPUP "&Debug" - { - MENUITEM "&Visual Debugging", VIEWER_VISUAL_DEBUGGING - MENUITEM SEPARATOR - MENUITEM "Dump &Content", VIEWER_DUMP_CONTENT - MENUITEM "Dump &Frames", VIEWER_DUMP_FRAMES - MENUITEM "Dump &Views", VIEWER_DUMP_VIEWS - MENUITEM "Dump &Style", VIEWER_DUMP_STYLE - } -} - -JSCONSOLE_MENU MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New", ID_FILENEW - MENUITEM "&Open...", ID_FILEOPEN - MENUITEM "&Save", ID_FILESAVE - MENUITEM "Save &As...", ID_FILESAVEAS - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_FILEEXIT - END - POPUP "&Edit" - BEGIN - MENUITEM "&Undo", ID_EDITUNDO - MENUITEM SEPARATOR - MENUITEM "Cu&t", ID_EDITCUT - MENUITEM "&Copy", ID_EDITCOPY - MENUITEM "&Paste", ID_EDITPASTE - MENUITEM "De&lete", ID_EDITDELETE - MENUITEM SEPARATOR - MENUITEM "Select &All", ID_EDITSELECTALL - END - POPUP "&Commands" - BEGIN - MENUITEM "&Evaluate All\tF5", ID_COMMANDSEVALALL - MENUITEM "Evaluate &Selection\tF10", ID_COMMANDSEVALSEL - MENUITEM SEPARATOR - MENUITEM "&Inspector", ID_COMMANDSINSPECTOR - END - POPUP "&Help" - BEGIN - MENUITEM "No Help Available", ID_NOHELP - END -END - -ACCELERATOR_TABLE ACCELERATORS -BEGIN - VK_F5, ID_COMMANDSEVALALL, VIRTKEY - VK_F10, ID_COMMANDSEVALSEL, VIRTKEY -END diff --git a/mozilla/webshell/tests/viewer/winmain.cpp b/mozilla/webshell/tests/viewer/winmain.cpp deleted file mode 100644 index 7746b266c0f..00000000000 --- a/mozilla/webshell/tests/viewer/winmain.cpp +++ /dev/null @@ -1,626 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - - -//we need openfilename stuff... MMP -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif - -#include -#include - -#include "resources.h" -#include "jsconsres.h" -#include "JSConsole.h" - -#include "nsGlobalVariables.h" -#include "nsIWebWidget.h" -#include "nsIPresContext.h" -#include "nsIDocument.h" -#include "nsIDocumentObserver.h" -#include "nsUnitConversion.h" -#include "nsVoidArray.h" -#include "nsCRT.h" -#include "prthread.h" -#include "prprf.h" -#include "nsRepository.h" -#include "nsWidgetsCID.h" -#include "nsGfxCIID.h" -#include "nsViewsCID.h" -#include "nsString.h" -#include "plevent.h" -#include -#include "nsIScriptContext.h" -#include "nsDocLoader.h" - -// JSConsole window -JSConsole *gConsole = NULL; - -#define SAMPLES_BASE_URL "resource:/res/samples" -#define START_URL SAMPLES_BASE_URL "/test0.html" - -static char* class1Name = "Viewer"; -static char* class2Name = "PrintPreview"; - -static HANDLE gInstance, gPrevInstance; -static char* startURL; -static nsVoidArray* gWindows; - -// Temporary Netlib stuff... -/* XXX: Don't include net.h... */ -extern "C" { -extern int NET_PollSockets(); -}; - -//---------------------------------------------------------------------- - -class DocObserver : public nsIDocumentObserver { -public: - DocObserver(nsIWebWidget* aWebWidget) { - NS_INIT_REFCNT(); - mWebWidget = aWebWidget; - NS_ADDREF(aWebWidget); - } - - NS_DECL_ISUPPORTS; - - NS_IMETHOD SetTitle(const nsString& aTitle); - - virtual void BeginUpdate() { } - virtual void EndUpdate() { } - virtual void ContentChanged(nsIContent* aContent, - nsISubContent* aSubContent, - PRInt32 aChangeType) { } - virtual void ContentAppended(nsIContent* aContainer) { } - virtual void ContentInserted(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) { } - virtual void ContentReplaced(nsIContent* aContainer, - nsIContent* aOldChild, - nsIContent* aNewChild, - PRInt32 aIndexInContainer) { } - virtual void ContentWillBeRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) { } - virtual void ContentHasBeenRemoved(nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInContainer) { } - virtual void StyleSheetAdded(nsIStyleSheet* aStyleSheet) { } - - -protected: - ~DocObserver() { - NS_RELEASE(mWebWidget); - } - - nsIWebWidget* mWebWidget; -}; - -struct WindowData { - HWND window; - nsIWebWidget* ww; - DocObserver* observer; - - WindowData() { - window = nsnull; - ww = nsnull; - } -}; - -static NS_DEFINE_IID(kIDocumentObserverIID, NS_IDOCUMENTOBSERVER_IID); - -NS_IMPL_ISUPPORTS(DocObserver, kIDocumentObserverIID); - -// Pass title information through to all of the web widgets that -// belong to this document. -NS_IMETHODIMP DocObserver::SetTitle(const nsString& aTitle) -{ - PRInt32 i, n = gWindows->Count(); - for (i = 0; i < n; i++) { - WindowData* wd = (WindowData*) gWindows->ElementAt(i); - if (wd->ww == mWebWidget) { - char* cp = aTitle.ToNewCString(); - ::SetWindowText(wd->window, cp); - delete cp; - } - } - return NS_OK; -} - -static DocObserver* NewObserver(nsIWebWidget* ww) -{ - nsISupports* oldContainer; - nsresult rv = ww->GetContainer(&oldContainer); - if (NS_OK == rv) { - if (nsnull == oldContainer) { - DocObserver* it = new DocObserver(ww); - NS_ADDREF(it); - ww->SetContainer(it); - return it; - } - else { - NS_RELEASE(oldContainer); - } - } - return nsnull; -} - -//---------------------------------------------------------------------- - - - -/* -* -* BEGIN PURIFY METHODS -* -*/ - - - -PRBool DoPurifyTest() -{ -#ifdef NS_WIN32 - char* name = "MOZ_PURIFY_TEST"; - char buffer[256]; - int result; - - result = GetEnvironmentVariable(name, buffer, 256); - return PRBool(result != 0); -#endif - return PR_FALSE; -} - - -void AddTestDocs(nsDocLoader* aDocLoader) -{ - char url[500]; - for (int docnum = 0; docnum < 9; docnum++) - { - PR_snprintf(url, 500, "%s/test%d.html", SAMPLES_BASE_URL, docnum); - aDocLoader->AddURL(url); - } -} - -/* -* -* END PURIFY METHODS -* -*/ - - - - - -static nsresult ShowPrintPreview(nsIWebWidget* ww, PRIntn aColumns); - -void DestroyConsole() -{ - if (gConsole) { - gConsole->SetNotification(NULL); - delete gConsole; - gConsole = NULL; - } -} - -static void Destroy(WindowData* wd) -{ - DestroyConsole(); - if (nsnull != wd) { - if (nsnull != wd->ww) { - wd->ww->SetContainer(nsnull); // release the doc observer - NS_RELEASE(wd->ww); - } - if (nsnull != wd->observer) { - NS_RELEASE(wd->observer); - } - gWindows->RemoveElement(wd); - delete wd; - } -} - -static void DestroyAllWindows() -{ - if (nsnull != gWindows) { - PRInt32 n = gWindows->Count(); - for (PRInt32 i = 0; i < n; i++) { - WindowData* wd = (WindowData*) gWindows->ElementAt(i); - ::DestroyWindow(wd->window); - } - gWindows->Clear(); - } -} - -#define FILE_PROTOCOL "file://" - -// Displays the Open common dialog box and lets the user specify an HTML file -// to open. Then passes the filename along to the Web widget. -static void -OpenHTMLFile(WindowData* wd) -{ - char szFile[_MAX_PATH]; - OPENFILENAME ofn; - - // Prompt the user for a filename - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = wd->window; - ofn.hInstance = gInstance; - ofn.lpstrFilter = "HTML Files\0*.html;*.htm\0All Files\0*.*\0\0"; - ofn.lpstrCustomFilter = NULL; - ofn.nFilterIndex = 1; - szFile[0] = '\0'; - ofn.lpstrFile = szFile; - ofn.nMaxFile = sizeof(szFile); - ofn.lpstrFileTitle = NULL; - ofn.lpstrInitialDir = NULL; // use current directory as initial directory - ofn.lpstrTitle = NULL; - ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NONETWORKBUTTON; - ofn.lpstrDefExt = NULL; - ofn.lpTemplateName = NULL; - - if (GetOpenFileName(&ofn)) { - PRInt32 len = strlen(szFile); - char* lpszFileURL = (char*)malloc(len + sizeof(FILE_PROTOCOL)); - - // Translate '\' to '/' - for (PRInt32 i = 0; i < len; i++) { - if (szFile[i] == '\\') { - szFile[i] = '/'; - } - } - - // Build the file URL - wsprintf(lpszFileURL, "%s%s", FILE_PROTOCOL, szFile); - - // Ask the Web widget to load the file URL - wd->ww->LoadURL(lpszFileURL); - free(lpszFileURL); - } -} - -long PASCAL -WndProc(HWND hWnd, UINT msg, WPARAM param, LPARAM lparam) -{ - HMENU hMenu; - - if (msg == WM_CREATE) { - LPCREATESTRUCT lpcs = (LPCREATESTRUCT) lparam; - WindowData* w = (WindowData*) lpcs->lpCreateParams; - SetWindowLong(hWnd, GWL_USERDATA, (LONG) w); - } - - WindowData* wd = (WindowData*) GetWindowLong(hWnd, GWL_USERDATA); - switch (msg) { - case WM_COMMAND: - hMenu = GetMenu(hWnd); - switch (LOWORD(param)) { - case VIEWER_EXIT: - DestroyAllWindows(); - return 0; - case PREVIEW_CLOSE: - ::DestroyWindow(hWnd); - return 0; - - case VIEWER_FILE_OPEN: - OpenHTMLFile(wd); - break; - - case VIEWER_DEMO0: - case VIEWER_DEMO1: - case VIEWER_DEMO2: - case VIEWER_DEMO3: - case VIEWER_DEMO4: - case VIEWER_DEMO5: - case VIEWER_DEMO6: - case VIEWER_DEMO7: - case VIEWER_DEMO8: - if ((nsnull != wd) && (nsnull != wd->ww)) { - PRIntn ix = LOWORD(param) - VIEWER_DEMO0; - char* url = new char[500]; - PR_snprintf(url, 500, "%s/test%d.html", SAMPLES_BASE_URL, ix); - wd->ww->LoadURL(url); - delete url; - } - break; - - case VIEWER_VISUAL_DEBUGGING: - if ((nsnull != wd) && (nsnull != wd->ww)) { - wd->ww->ShowFrameBorders(PRBool(!wd->ww->GetShowFrameBorders())); - } - break; - case VIEWER_DUMP_CONTENT: - if ((nsnull != wd) && (nsnull != wd->ww)) { - wd->ww->DumpContent(); - } - break; - case VIEWER_DUMP_FRAMES: - if ((nsnull != wd) && (nsnull != wd->ww)) { - wd->ww->DumpFrames(); - } - break; - case VIEWER_DUMP_VIEWS: - if ((nsnull != wd) && (nsnull != wd->ww)) { - wd->ww->DumpViews(); - } - break; - case VIEWER_DUMP_STYLE: - if ((nsnull != wd) && (nsnull != wd->ww)) { - wd->ww->DumpStyle(); - } - break; - - case VIEWER_ONE_COLUMN: - case VIEWER_TWO_COLUMN: - case VIEWER_THREE_COLUMN: - if ((nsnull != wd) && (nsnull != wd->ww)) { - ShowPrintPreview(wd->ww, LOWORD(param) - VIEWER_ONE_COLUMN + 1); - } - break; - case JS_CONSOLE: - if (!gConsole) { - - // load the accelerator table for the console - if (!JSConsole::sAccelTable) { - JSConsole::sAccelTable = LoadAccelerators(gInstance, - MAKEINTRESOURCE(ACCELERATOR_TABLE)); - } - - nsIScriptContext *context = nsnull; - if (NS_OK == wd->ww->GetScriptContext(&context)) { - // create the console - gConsole = JSConsole::CreateConsole(); - gConsole->SetContext(context); - // lifetime of the context is still unclear at this point. - // Anyway, as long as the web widget is alive the context is alive. - // Maybe the context shouldn't even be RefCounted - context->Release(); - gConsole->SetNotification(DestroyConsole); - } - else { - MessageBox(hWnd, "Unable to load JavaScript", "Viewer Error", MB_ICONSTOP); - } - } - break; - - default: - break; - } - break; - - case WM_SIZE: - if ((nsnull != wd) && (nsnull != wd->ww)) { - RECT r; - ::GetClientRect(hWnd, &r); - nsRect rr(0, 0, PRInt32(r.right - r.left), PRInt32(r.bottom - r.top)); - wd->ww->SetBounds(rr); - } - return 0; - - case WM_DESTROY: - Destroy(wd); - if (gWindows->Count() == 0) { - PostQuitMessage(0); - } - return 0; - - case WM_CLOSE: - // Let windows destroy the window - break; - - default: - break; - } - return DefWindowProc(hWnd, msg, param, lparam); -} - -static WindowData* CreateTopLevel(const char* clazz, const char* title, - int aWidth, int aHeight) -{ - // Create a simple top level window - WindowData* wd = new WindowData(); - HWND window = ::CreateWindowEx(WS_EX_CLIENTEDGE, - clazz, title, - WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, - CW_USEDEFAULT, CW_USEDEFAULT, - aWidth, aHeight, - HWND_DESKTOP, - NULL, - gInstance, - wd); - wd->window = window; - gWindows->AppendElement(wd); - ::ShowWindow(window, SW_SHOW); - ::UpdateWindow(window); - return wd; -} - -static nsresult ShowPrintPreview(nsIWebWidget* web, PRIntn aColumns) -{ - if (nsnull != web) { - nsIDocument* doc = web->GetDocument(); - if (nsnull != doc) { - nsIPresContext* cx; - nsresult rv = NS_NewPrintPreviewContext(&cx); - if (NS_OK != rv) { - return rv; - } - - WindowData* wd = CreateTopLevel(class2Name, "Print Preview", 500, 300); - - RECT r; - ::GetClientRect(wd->window, &r); - nsRect rr(0, 0, PRInt32(r.right - r.left), PRInt32(r.bottom - r.top)); - rv = NS_NewWebWidget(&wd->ww); - rv = wd->ww->Init(wd->window, rr, doc, cx); - wd->ww->Show(); - wd->observer = NewObserver(wd->ww); - - NS_RELEASE(cx); - NS_RELEASE(doc); - } - } - return NS_OK; -} - -void ReleaseMemory() -{ - nsGlobalVariables::Release(); - delete gWindows; -} - -#define WIDGET_DLL "raptorwidget.dll" -#define GFXWIN_DLL "raptorgfxwin.dll" -#define VIEW_DLL "raptorview.dll" - -int PASCAL -WinMain(HANDLE instance, HANDLE prevInstance, LPSTR cmdParam, int nCmdShow) -{ - PL_InitializeEventsLib(""); - - gInstance = instance; - gPrevInstance = prevInstance; - gWindows = new nsVoidArray(); - - static NS_DEFINE_IID(kCWindowIID, NS_WINDOW_CID); - static NS_DEFINE_IID(kCScrollbarIID, NS_VERTSCROLLBAR_CID); - static NS_DEFINE_IID(kCButtonIID, NS_BUTTON_CID); - static NS_DEFINE_IID(kCComboBoxCID, NS_COMBOBOX_CID); - static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID); - static NS_DEFINE_IID(kCListBoxCID, NS_LISTBOX_CID); - static NS_DEFINE_IID(kCRadioButtonCID, NS_RADIOBUTTON_CID); - static NS_DEFINE_IID(kCTextAreaCID, NS_TEXTAREA_CID); - static NS_DEFINE_IID(kCTextFieldCID, NS_TEXTFIELD_CID); - static NS_DEFINE_IID(kCCheckButtonIID, NS_CHECKBUTTON_CID); - static NS_DEFINE_IID(kCChildIID, NS_CHILD_CID); - - NSRepository::RegisterFactory(kCWindowIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCScrollbarIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCCheckButtonIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCChildIID, WIDGET_DLL, PR_FALSE, PR_FALSE); - - static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID); - - NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - - static NS_DEFINE_IID(kCViewManagerCID, NS_VIEW_MANAGER_CID); - static NS_DEFINE_IID(kCViewCID, NS_VIEW_CID); - static NS_DEFINE_IID(kCScrollingViewCID, NS_SCROLLING_VIEW_CID); - - NSRepository::RegisterFactory(kCViewManagerCID, VIEW_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCViewCID, VIEW_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCScrollingViewCID, VIEW_DLL, PR_FALSE, PR_FALSE); - - // initialize the toolkit (widget library). - // This may look weak and in fact it is...but hey... - //XXX move it somewhere else please - //NS_InitToolkit(PR_GetCurrentThread()); - - if (!prevInstance) { - WNDCLASS wndClass; - wndClass.style = 0; - wndClass.lpfnWndProc = WndProc; - wndClass.cbClsExtra = 0; - wndClass.cbWndExtra = 0; - wndClass.hInstance = gInstance; - wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); - wndClass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH); - wndClass.lpszMenuName = class1Name; - wndClass.lpszClassName = class1Name; - RegisterClass(&wndClass); - - wndClass.lpszMenuName = class2Name; - wndClass.lpszClassName = class2Name; - RegisterClass(&wndClass); - } - - // Create our first top level window - WindowData* wd = CreateTopLevel(class1Name, "Raptor HTML Viewer", 620, 400); - - // Now embed the web widget in it - RECT r; - ::GetClientRect(wd->window, &r); - nsresult rv = NS_NewWebWidget(&wd->ww); - nsRect rr(0, 0, PRInt32(r.right - r.left), PRInt32(r.bottom - r.top)); - rv = wd->ww->Init(wd->window, rr); - wd->ww->Show(); - wd->observer = NewObserver(wd->ww); - - - // Determine if we should run the purify test - PRBool purify = DoPurifyTest(); - nsDocLoader* dl = nsnull; - if (purify) - { - dl = new nsDocLoader(wd->ww); - - // Add the documents to the loader - AddTestDocs(dl); - - // Start the timer - dl->StartTimedLoading(); - } - else - { - // Load the starting url if we have one - wd->ww->LoadURL(startURL ? startURL : START_URL); - } - - // Process messages - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - if (!JSConsole::sAccelTable || - !gConsole || - !gConsole->GetMainWindow() || - !TranslateAccelerator(gConsole->GetMainWindow(), JSConsole::sAccelTable, &msg)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - /* Pump Netlib... */ - NET_PollSockets(); - } - } - if (dl != nsnull) - delete dl; - ReleaseMemory(); - if (!prevInstance) { - UnregisterClass(class1Name, gInstance); - UnregisterClass(class2Name, gInstance); - } - return msg.wParam; -} - -void main(int argc, char **argv) -{ - if (argc > 1) { - startURL = argv[1]; - } - WinMain(GetModuleHandle(NULL), NULL, 0, SW_SHOW); -} diff --git a/mozilla/widget/Makefile b/mozilla/widget/Makefile deleted file mode 100644 index 646e5af8b7a..00000000000 --- a/mozilla/widget/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = .. - -DIRS= public src tests - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/widget/build.bat b/mozilla/widget/build.bat deleted file mode 100755 index 7dde3ca897a..00000000000 --- a/mozilla/widget/build.bat +++ /dev/null @@ -1,21 +0,0 @@ -rem -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -rem -rem The contents of this file are subject to the Netscape Public License -rem Version 1.0 (the "NPL"); you may not use this file except in -rem compliance with the NPL. You may obtain a copy of the NPL at -rem http://www.mozilla.org/NPL/ -rem -rem Software distributed under the NPL is distributed on an "AS IS" basis, -rem WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -rem for the specific language governing rights and limitations under the -rem NPL. -rem -rem The Initial Developer of this code under the NPL is Netscape -rem Communications Corporation. Portions created by Netscape are -rem Copyright (C) 1998 Netscape Communications Corporation. All Rights -rem Reserved. -rem - -del s:\ns\raptor\ui\src\windows\win32_d.obj\%1.obj -del s:\ns\raptor\ui\tests\windows\win32_d.obj\winmain.obj -nmake -f makefile.win diff --git a/mozilla/widget/makefile.win b/mozilla/widget/makefile.win deleted file mode 100644 index b7f84e8a5a2..00000000000 --- a/mozilla/widget/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=.. -IGNORE_MANIFEST=1 - -DIRS=public src tests - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/widget/public/Makefile b/mozilla/widget/public/Makefile deleted file mode 100644 index 7ab6900911f..00000000000 --- a/mozilla/widget/public/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../.. - -DEFINES = -D_IMPL_NS_UI - -EXPORTS = \ - nsui.h \ - nsITabWidget.h \ - nsIWidget.h \ - nsIButton.h \ - nsICheckButton.h\ - nsIListWidget.h \ - nsIComboBox.h \ - nsITextWidget.h \ - nsITextAreaWidget.h \ - nsIComboBox.h \ - nsIListBox.h \ - nsIFileWidget.h \ - nsIScrollbar.h \ - nsGUIEvent.h \ - nsIRadioButton.h\ - nsIRadioGroup.h \ - nsIMouseListener.h \ - nsIEventListener.h \ - nsIToolkit.h \ - nsWidgetsCID.h \ - $(NULL) - -MODULE = raptor - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/widget/public/makefile.win b/mozilla/widget/public/makefile.win deleted file mode 100644 index 24843a6592f..00000000000 --- a/mozilla/widget/public/makefile.win +++ /dev/null @@ -1,31 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DEFINES=-D_IMPL_NS_UI -MODULE=raptor - -EXPORTS=nsui.h nsIWidget.h nsIButton.h nsICheckButton.h nsIListWidget.h \ - nsIComboBox.h nsITextWidget.h nsITextAreaWidget.h nsIComboBox.h \ - nsIListBox.h nsIFileWidget.h nsIScrollbar.h nsGUIEvent.h \ - nsIRadioButton.h nsIRadioGroup.h nsIMouseListener.h \ - nsIEventListener.h nsIToolkit.h nsWidgetsCID.h nsITabWidget.h - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/widget/public/nsGUIEvent.h b/mozilla/widget/public/nsGUIEvent.h deleted file mode 100644 index 7fb16ba7464..00000000000 --- a/mozilla/widget/public/nsGUIEvent.h +++ /dev/null @@ -1,280 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsGUIEvent_h__ -#define nsGUIEvent_h__ - -#include "nsPoint.h" -#include "nsRect.h" - -class nsIRenderingContext; -class nsIWidget; - -/** - * Return status for event processors. - */ - -enum nsEventStatus { - /// The event is ignored, do default processing - nsEventStatus_eIgnore, - /// The event is consumed, don't do default processing - nsEventStatus_eConsumeNoDefault, - /// The event is consumed, but do default processing - nsEventStatus_eConsumeDoDefault -}; - -/** - * General graphic user interface event - */ - -struct nsGUIEvent { - /// See GUI MESSAGES, - PRUint32 message; - /// Originator of the event - nsIWidget* widget; - /// in widget relative coordinates - nsPoint point; - /// elapsed time, in milliseconds, from the time the system was started to the time the message was created - PRUint32 time; - /// Internal platform specific message. - void* nativeMsg; -}; - -/** - * Window resize event - */ - -struct nsSizeEvent : public nsGUIEvent { - /// x,y width, height in pixels - nsRect *windowSize; -}; - -/** - * Window repaint event - */ - -struct nsPaintEvent : public nsGUIEvent { - /// Context to paint in. - nsIRenderingContext *renderingContext; - /// x,y, width, height in pixels of area to paint - nsRect *rect; -}; - -/** - * Scrollbar event - */ - -struct nsScrollbarEvent : public nsGUIEvent { - /// ranges between scrollbar 0 and (maxRange - thumbSize). See nsIScrollbar - PRUint32 position; -}; - - -/** - * Keyboard event - */ - -struct nsKeyEvent : public nsGUIEvent { - /// see NS_VK codes - PRUint32 keyCode; - /// PR_TRUE indicates the shift key in down - PRBool isShift; - /// PR_TRUE indicates the control key in down - PRBool isControl; - /// PR_TRUE indicates the alt key in down - PRBool isAlt; -}; - -/** - * GUI MESSAGES - */ - //@{ - -#define NS_WINDOW_START 100 - -// Sent when window is created -#define NS_CREATE (NS_WINDOW_START) -// Sent when window is destroyed -#define NS_DESTROY (NS_WINDOW_START + 1) -// Sent when the window is resized -#define NS_SIZE (NS_WINDOW_START + 2) -// Sent when window gains focus -#define NS_GOTFOCUS (NS_WINDOW_START + 3) -// Sent when window loses focus -#define NS_LOSTFOCUS (NS_WINDOW_START + 4) -// Sent when the window needs to be repainted -#define NS_PAINT (NS_WINDOW_START + 30) -// Sent when a key is pressed down within a window -#define NS_KEY_UP (NS_WINDOW_START + 32) -// Sent when a key is released within a window -#define NS_KEY_DOWN (NS_WINDOW_START + 33) -// Sent when the window has been moved to a new location. -// The events point contains the x, y location in screen coordinates -#define NS_MOVE (NS_WINDOW_START + 34) - -// Sent when a tab control's selected tab has changed -#define NS_TABCHANGE (NS_WINDOW_START + 35) - -#define NS_MOUSE_MESSAGE_START 300 -#define NS_MOUSE_MOVE (NS_MOUSE_MESSAGE_START) -#define NS_MOUSE_LEFT_BUTTON_UP (NS_MOUSE_MESSAGE_START + 1) -#define NS_MOUSE_LEFT_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 2) -#define NS_MOUSE_MIDDLE_BUTTON_UP (NS_MOUSE_MESSAGE_START + 10) -#define NS_MOUSE_MIDDLE_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 11) -#define NS_MOUSE_RIGHT_BUTTON_UP (NS_MOUSE_MESSAGE_START + 20) -#define NS_MOUSE_RIGHT_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 21) -#define NS_MOUSE_ENTER (NS_MOUSE_MESSAGE_START + 22) -#define NS_MOUSE_EXIT (NS_MOUSE_MESSAGE_START + 23) -#define NS_MOUSE_LEFT_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 24) -#define NS_MOUSE_RIGHT_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 25) - -#define NS_SCROLLBAR_MESSAGE_START 1000 -#define NS_SCROLLBAR_POS (NS_SCROLLBAR_MESSAGE_START) -#define NS_SCROLLBAR_PAGE_NEXT (NS_SCROLLBAR_MESSAGE_START + 1) -#define NS_SCROLLBAR_PAGE_PREV (NS_SCROLLBAR_MESSAGE_START + 2) -#define NS_SCROLLBAR_LINE_NEXT (NS_SCROLLBAR_MESSAGE_START + 3) -#define NS_SCROLLBAR_LINE_PREV (NS_SCROLLBAR_MESSAGE_START + 4) -//@} - -/* - * Virtual key bindings for keyboard events - */ - -#define NS_VK_CANCEL 0x03 -#define NS_VK_BACK 0x08 -#define NS_VK_TAB 0x09 -#define NS_VK_CLEAR 0x0C -#define NS_VK_RETURN 0x0D -#define NS_VK_SHIFT 0x10 -#define NS_VK_CONTROL 0x11 -#define NS_VK_ALT 0x12 -#define NS_VK_PAUSE 0x13 -#define NS_VK_CAPS_LOCK 0x14 -#define NS_VK_ESCAPE 0x1B -#define NS_VK_SPACE 0x20 -#define NS_VK_PAGE_UP 0x21 -#define NS_VK_PAGE_DOWN 0x22 -#define NS_VK_END 0x23 -#define NS_VK_HOME 0x24 -#define NS_VK_LEFT 0x25 -#define NS_VK_UP 0x26 -#define NS_VK_RIGHT 0x27 -#define NS_VK_DOWN 0x28 -#define NS_VK_PRINTSCREEN 0x2C -#define NS_VK_INSERT 0x2D -#define NS_VK_DELETE 0x2E - -// NS_VK_0 - NS_VK_9 match their ascii values -#define NS_VK_0 0x30 -#define NS_VK_1 0x31 -#define NS_VK_2 0x32 -#define NS_VK_3 0x33 -#define NS_VK_4 0x34 -#define NS_VK_5 0x35 -#define NS_VK_6 0x36 -#define NS_VK_7 0x37 -#define NS_VK_8 0x38 -#define NS_VK_9 0x39 - -#define NS_VK_SEMICOLON 0x3B -#define NS_VK_EQUALS 0x3D - -// NS_VK_A - NS_VK_Z match their ascii values -#define NS_VK_A 0x41 -#define NS_VK_B 0x42 -#define NS_VK_C 0x43 -#define NS_VK_D 0x44 -#define NS_VK_E 0x45 -#define NS_VK_F 0x46 -#define NS_VK_G 0x47 -#define NS_VK_H 0x48 -#define NS_VK_I 0x49 -#define NS_VK_J 0x4A -#define NS_VK_K 0x4B -#define NS_VK_L 0x4C -#define NS_VK_M 0x4D -#define NS_VK_N 0x4E -#define NS_VK_O 0x4F -#define NS_VK_P 0x50 -#define NS_VK_Q 0x51 -#define NS_VK_R 0x52 -#define NS_VK_S 0x53 -#define NS_VK_T 0x54 -#define NS_VK_U 0x55 -#define NS_VK_V 0x56 -#define NS_VK_W 0x57 -#define NS_VK_X 0x58 -#define NS_VK_Y 0x59 -#define NS_VK_Z 0x5A - -#define NS_VK_NUMPAD0 0x60 -#define NS_VK_NUMPAD1 0x61 -#define NS_VK_NUMPAD2 0x62 -#define NS_VK_NUMPAD3 0x63 -#define NS_VK_NUMPAD4 0x64 -#define NS_VK_NUMPAD5 0x65 -#define NS_VK_NUMPAD6 0x66 -#define NS_VK_NUMPAD7 0x67 -#define NS_VK_NUMPAD8 0x68 -#define NS_VK_NUMPAD9 0x69 -#define NS_VK_MULTIPLY 0x6A -#define NS_VK_ADD 0x6B -#define NS_VK_SEPARATOR 0x6C -#define NS_VK_SUBTRACT 0x6D -#define NS_VK_DECIMAL 0x6E -#define NS_VK_DIVIDE 0x6F -#define NS_VK_F1 0x70 -#define NS_VK_F2 0x71 -#define NS_VK_F3 0x72 -#define NS_VK_F4 0x73 -#define NS_VK_F5 0x74 -#define NS_VK_F6 0x75 -#define NS_VK_F7 0x76 -#define NS_VK_F8 0x77 -#define NS_VK_F9 0x78 -#define NS_VK_F10 0x79 -#define NS_VK_F11 0x7A -#define NS_VK_F12 0x7B -#define NS_VK_F13 0x7C -#define NS_VK_F14 0x7D -#define NS_VK_F15 0x7E -#define NS_VK_F16 0x7F -#define NS_VK_F17 0x80 -#define NS_VK_F18 0x81 -#define NS_VK_F19 0x82 -#define NS_VK_F20 0x83 -#define NS_VK_F21 0x84 -#define NS_VK_F22 0x85 -#define NS_VK_F23 0x86 -#define NS_VK_F24 0x87 - -#define NS_VK_NUM_LOCK 0x90 -#define NS_VK_SCROLL_LOCK 0x91 - -#define NS_VK_COMMA 0xBC -#define NS_VK_PERIOD 0xBE -#define NS_VK_SLASH 0xBF -#define NS_VK_BACK_QUOTE 0xC0 -#define NS_VK_OPEN_BRACKET 0xDB -#define NS_VK_BACK_SLASH 0xDC -#define NS_VK_CLOSE_BRACKET 0xDD -#define NS_VK_QUOTE 0xDE - - -#endif // nsGUIEvent_h__ - diff --git a/mozilla/widget/public/nsIButton.h b/mozilla/widget/public/nsIButton.h deleted file mode 100644 index f7ec5cb650e..00000000000 --- a/mozilla/widget/public/nsIButton.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIButton_h__ -#define nsIButton_h__ - -#include "nsIWidget.h" -#include "nsString.h" - -// {18032AD0-B265-11d1-AA2A-000000000000} -#define NS_IBUTTON_IID \ -{ 0x18032ad0, 0xb265, 0x11d1, \ - { 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } - -/** - * Push button widget. - * Automatically shows itself as depressed when clicked on. - */ -class nsIButton : public nsIWidget { - - public: - - /** - * Set the button label - * - * @param aText button label - */ - - virtual void SetLabel(const nsString &aText) = 0; - - /** - * Get the button label - * - * @param aBuffer contains label upon return - */ - - virtual void GetLabel(nsString &aBuffer) = 0; - -}; - -#endif diff --git a/mozilla/widget/public/nsICheckButton.h b/mozilla/widget/public/nsICheckButton.h deleted file mode 100644 index b1177b966b3..00000000000 --- a/mozilla/widget/public/nsICheckButton.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsICheckButton_h__ -#define nsICheckButton_h__ - -#include "nsIButton.h" - -// {961085F5-BD28-11d1-97EF-00609703C14E} -#define NS_ICHECKBUTTON_IID \ -{ 0x961085f5, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - -/** - * Checkbox widget. - * Can show itself in a checked or unchecked state. - * The checkbox widget does not automatically show itself checked or unchecked when clicked on. - */ -class nsICheckButton : public nsIButton { - -public: - - /** - * Set the check state. - * @param aState PR_TRUE show as checked. PR_FALSE show unchecked. - */ - - virtual void SetState(PRBool aState) = 0; - - /** - * Get the check state. - * @return PR_TRUE if checked. PR_FALSE if unchecked. - */ - - virtual PRBool GetState() = 0; - -}; - -#endif // nsICheckButton_h__ - diff --git a/mozilla/widget/public/nsIComboBox.h b/mozilla/widget/public/nsIComboBox.h deleted file mode 100644 index d39dd1ab5fd..00000000000 --- a/mozilla/widget/public/nsIComboBox.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIComboBox_h__ -#define nsIComboBox_h__ - -#include "nsIListWidget.h" -#include "nsString.h" - -// {961085F6-BD28-11d1-97EF-00609703C14E} -#define NS_ICOMBOBOX_IID \ -{ 0x961085f6, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - -/** - * Single selection drop down list. See nsIListWidget for capabilities - */ - -class nsIComboBox : public nsIListWidget { -}; - -#endif // nsIComboBox_h__ - - - diff --git a/mozilla/widget/public/nsIEventListener.h b/mozilla/widget/public/nsIEventListener.h deleted file mode 100644 index e2546316db5..00000000000 --- a/mozilla/widget/public/nsIEventListener.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIEventListener_h__ -#define nsIEventListener_h__ - -#include "nsGUIEvent.h" - -/** - * Event listener interface. - * Alternative to a callback for recieving events. - */ - -class nsIEventListener { - -public: - - /** - * Processes all events. - * If a mouse listener is registered this method will not process mouse events. - * @param anEvent the event to process. See nsGUIEvent.h for event types. - */ - - virtual nsEventStatus ProcessEvent(const nsGUIEvent & anEvent) = 0; - -}; - -#endif // nsIEventListener_h__ diff --git a/mozilla/widget/public/nsIFileWidget.h b/mozilla/widget/public/nsIFileWidget.h deleted file mode 100644 index 37b1d01e75f..00000000000 --- a/mozilla/widget/public/nsIFileWidget.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIFileWidget_h__ -#define nsIFileWidget_h__ - -#include "nsString.h" - -// {F8030015-C342-11d1-97F0-00609703C14E} -#define NS_IFILEWIDGET_IID \ -{ 0xf8030015, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - - -/** - * File selector mode - */ - -enum nsMode { - /// Load a file or directory - eMode_load, - /// Save a file or directory - eMode_save }; - -/** - * File selector widget. - * Modally selects files for loading or saving from a list. - */ - -class nsIFileWidget : public nsISupports -{ - -public: - - /** - * Creates a file widget with the specified title and mode. - * @param aParent the owner of the widget - * @param aTitle the title of the widget - * @param aMode the mode of the widget - * @param aContext context for displaying widget - * @param aToolkit toolkit associated with file widget - * @param aInitData data that is used for widget initialization - */ - - virtual void Create( nsIWidget *aParent, - nsString& aTitle, - nsMode aMode, - nsIDeviceContext *aContext = nsnull, - nsIToolkit *aToolkit = nsnull, - void *aInitData = 0) = 0; - - /** - * Set the list of file filters - * - * @param aNumberOfFilter number of filters. - * @param aTitle array of filter titles - * @param aFilter array of filters to associate with titles - * @return void - * - */ - - virtual void SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[]) = 0; - - /** - * Show File Dialog. The dialog is displayed modally. - * - * @return PR_TRUE if user selects OK, PR_FALSE if user selects CANCEL - * - */ - - virtual PRBool Show() = 0; - - /** - * Get the file or directory including the full path. - * - * @param aFile on exit it contains the file or directory selected - */ - - virtual void GetFile(nsString& aFile) = 0; - -}; - -#endif // nsIFileWidget_h__ - diff --git a/mozilla/widget/public/nsIListBox.h b/mozilla/widget/public/nsIListBox.h deleted file mode 100644 index 39f83dde113..00000000000 --- a/mozilla/widget/public/nsIListBox.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIListBox_h__ -#define nsIListBox_h__ - -#include "nsIListWidget.h" -#include "nsString.h" - -// {F8030014-C342-11d1-97F0-00609703C14E} -#define NS_ILISTBOX_IID \ -{ 0xf8030014, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - -/** - * Single or multi selection list of items. - */ - -class nsIListBox : public nsIListWidget { - -public: - - /** - * Set the listbox to be multi-select. - * @param aMultiple PR_TRUE can have multiple selections. PR_FALSE single - * selections only. - * @return void - * - */ - - virtual void SetMultipleSelection(PRBool aMultipleSelections) = 0; - - /** - * Return the number of selected items. For single selection list box this - * @return the number of selected items - * can be 1 or 0. - * - */ - virtual PRInt32 GetSelectedCount() = 0; - - /** - * Retrieves the indices of the selected items. - * @param aIndices Array to hold the selected items. Use GetSelectedCount to - * determine how large the array needs to be. - * @param aSize Size of the aIndices array - * - */ - virtual void GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize) = 0; - -}; - -#endif // nsIListBox_h__ - - - diff --git a/mozilla/widget/public/nsIListWidget.h b/mozilla/widget/public/nsIListWidget.h deleted file mode 100644 index a2121bdd859..00000000000 --- a/mozilla/widget/public/nsIListWidget.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIListWidget_h__ -#define nsIListWidget_h__ - -#include "nsIWidget.h" -#include "nsString.h" - -// {F8030013-C342-11d1-97F0-00609703C14E} -#define NS_ILISTWIDGET_IID \ -{ 0xf8030013, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - -/** - * - * Base class for nsIListBox and nsIComboBox - * - */ - -class nsIListWidget : public nsIWidget { - -public: - - /** - * Set an item at the specific position - * - * @param aItem the item name. The item has to be null terminated - * @param aPosition the position the item should be inserted at - * 0 is at the top of the list - * -1 is at the end of the list - */ - virtual void AddItemAt(nsString &aItem, PRInt32 aPosition) = 0; - - /** - * Finds the first occurrence of the specified item - * - * @param aItem the string to be filled - * @param aStartPos the starting position (index) - * @return PR_TRUE if successful, PR_FALSE otherwise - * - */ - virtual PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos) = 0; - - /** - * Returns the number of items in the list - * - * @return the number of items - * - */ - virtual PRInt32 GetItemCount() = 0; - - /** - * Remove the first occurrence of the specified item - * - * @param aPosition the item position - * 0 is at the top of the list - * -1 is at the end of the list - * - * @return PR_TRUE if successful, PR_FALSE otherwise - * - */ - virtual PRBool RemoveItemAt(PRInt32 aPosition) = 0; - - /** - * Gets an item at a specific location - * - * @param anItem on return contains the string of the item at that position - * @param aPosition the Position of the item - * - */ - virtual PRBool GetItemAt(nsString& anItem, PRInt32 aPosition) = 0; - - /** - * Gets the selected item for a single selection list - * - * @param aItem on return contains the string of the selected item - * - */ - virtual void GetSelectedItem(nsString &aItem) = 0; - - /** - * Returns with the index of the selected item - * - * @return PRInt32, index of selected item - * - */ - virtual PRInt32 GetSelectedIndex() = 0; - - /** - * Select the item at the specified position - * - * @param PRInt32, the item position - * 0 is at the top of the list - * -1 is at the end of the list - * - */ - virtual void SelectItem(PRInt32 aPosition) = 0; - - /** - * Deselects all the items in the list - * - */ - virtual void Deselect() = 0; - -}; - -#endif // nsIListWidget_h__ - - - diff --git a/mozilla/widget/public/nsIMouseListener.h b/mozilla/widget/public/nsIMouseListener.h deleted file mode 100644 index 8a56f3c0ec6..00000000000 --- a/mozilla/widget/public/nsIMouseListener.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - - -#ifndef nsIMouseListener_h__ -#define nsIMouseListener_h__ - -#include "nsGUIEvent.h" - -/** - * - * Mouse up/down/move event listener - * - */ - -class nsIMouseListener { - - public: - - /** - * Processes a mouse pressed event - * @param aMouseEvent See nsGUIEvent.h - * @return whether the event was consumed or ignored. See nsEventStatus - */ - virtual nsEventStatus MousePressed(const nsGUIEvent & aMouseEvent) = 0; - - /** - * Processes a mouse release event - * @param aMouseEvent See nsGUIEvent.h - * @return whether the event was consumed or ignored. See nsEventStatus - */ - virtual nsEventStatus MouseReleased(const nsGUIEvent & aMouseEvent) = 0; - - /** - * Processes a mouse clicked event - * @param aMouseEvent See nsGUIEvent.h - * @return whether the event was consumed or ignored. See nsEventStatus - * - */ - virtual nsEventStatus MouseClicked(const nsGUIEvent & aMouseEvent) = 0; - - /** - * Processes a mouse moved event - * @param aMouseEvent See nsGUIEvent.h - * @return whether the event was consumed or ignored. See nsEventStatus - */ - virtual nsEventStatus MouseMoved(const nsGUIEvent & aMouseEvent) = 0; - -}; - -#endif // nsIMouseListener_h__ diff --git a/mozilla/widget/public/nsIRadioButton.h b/mozilla/widget/public/nsIRadioButton.h deleted file mode 100644 index c026f5414a1..00000000000 --- a/mozilla/widget/public/nsIRadioButton.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIRadioButton_h__ -#define nsIRadioButton_h__ - -#include "nsIButton.h" - -#define NS_IRADIOBUTTON_IID \ -{ 0x18032ad4, 0xb265, 0x11d2, \ -{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } - -class nsIRadioGroup; - -/** - * RadioButton widget. Can show itself in a checked or unchecked state. - * The RadioButton widget automatically shows itself checked or unchecked when clicked on. - */ - -class nsIRadioButton : public nsIButton { - - public: - - /** - * Set the radio state. - * @param aState PR_TRUE sets the RadioButton and unsets all siblings, PR_FALSE unsets it - * - */ - virtual void SetState(PRBool aState) = 0; - - /** - * Tells the RadioButton NOT to notify the RadioGroup that it value has been changed - * - * @param aState PR_TRUE sets the RadioButton and unsets all siblings, PR_FALSE unsets it - * - */ - virtual void SetStateNoNotify(PRBool aState) = 0; - - /** - * Gets the state the RadioButton - * - * @return PR_TRUE if set, PR_FALSE if unset - * - */ - virtual PRBool GetState() = 0; - - /** - * Gets the RadioGroup associated with this radio button - * - * @return The Radio Group - * - */ - virtual nsIRadioGroup* GetRadioGroup() = 0; - - /** - * Sets the RadioGroup associated with this radio button - * - * @param aGroup the new RadioGroup - * - */ - virtual void SetRadioGroup(nsIRadioGroup* aGroup) = 0; - -}; - -#endif // nsIRadioButton_h__ - - diff --git a/mozilla/widget/public/nsIRadioGroup.h b/mozilla/widget/public/nsIRadioGroup.h deleted file mode 100644 index b7b41dfcccb..00000000000 --- a/mozilla/widget/public/nsIRadioGroup.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsIRadioGroup_h__ -#define nsIRadioGroup_h__ - -#include "nsString.h" - -#define NS_IRADIOGROUP_IID \ -{ 0x961085f1, 0xbd28, 0x11d1, \ -{ 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } } - - -class nsIRadioGroup; -class nsIRadioButton; -class nsIEnumerator; - -/** - * Helper class for implementing a "group" of radio buttons - * - */ -class nsIRadioGroup : public nsISupports -{ - -public: - - /** - * Adds a RadioButton to the group - * @param aRadioBtn the radio button to be added - * - */ - virtual void Add(nsIRadioButton * aRadioBtn) = 0; - - /** - * Removes a RadioButton from the group - * @param aRadioBtn the radio button to be removed - * - */ - virtual void Remove(nsIRadioButton * aRadioBtn) = 0; - - /** - * Sets the name of the RadioGroup - * @param aName The new name of the radio group - * - */ - virtual void SetName(const nsString &aName) = 0; - - /** - * Tells the RadioGroup that a child RadioButton has been clicked and it should set - * the approproate state on the other buttons - * @param aChild The RadioButton that was clicked - * - */ - virtual void Clicked(nsIRadioButton * aChild) = 0; - - /** - * Gets the enumeration of children - * @return The enumeration of children (radio buttons) in the RadioGroup - * - */ - virtual nsIEnumerator* GetChildren() = 0; -}; - -#endif // nsIRadioGroup_h__ - diff --git a/mozilla/widget/public/nsIScrollbar.h b/mozilla/widget/public/nsIScrollbar.h deleted file mode 100644 index 9ce2308ca50..00000000000 --- a/mozilla/widget/public/nsIScrollbar.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIScrollbar_h__ -#define nsIScrollbar_h__ - -#include "nsIWidget.h" - -// {18032AD2-B265-11d1-AA2A-000000000000} -#define NS_ISCROLLBAR_IID \ -{ 0x18032ad2, 0xb265, 0x11d1, \ -{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } - - -/** - * - * Scrollbar, converts mouse input into values that can be used - * to shift the contents of a window. - * - */ - - -class nsIScrollbar : public nsIWidget -{ -public: - - /** - * Set the scrollbar range - * @param aEndRange set range for scrollbar from 0 to aEndRange - * - */ - virtual void SetMaxRange(PRUint32 aEndRange) = 0; - - /** - * Get the scrollbar range - * @return the upper end of the scrollbar range - */ - virtual PRUint32 GetMaxRange() = 0; - - /** - * Set the thumb position. - * @param aPos a value between (startRange) and (endRange - thumbSize) - * - */ - virtual void SetPosition(PRUint32 aPos) = 0; - - /** - * Get the thumb position. - * @return a value between (startRange) and (endRange - thumbSize) - * - */ - virtual PRUint32 GetPosition() = 0; - - /** - * Set the thumb size. - * @param aSize size of the thumb. Must be a value between - * startRange and endRange - */ - virtual void SetThumbSize(PRUint32 aSize) = 0; - - /** - * Get the thumb size. - * @return size of the thumb. The value is between - * startRange and endRange - */ - virtual PRUint32 GetThumbSize() = 0; - - /** - * Set the line increment. - * @param aSize size of the line increment. The value must - * be between startRange and endRange - */ - virtual void SetLineIncrement(PRUint32 aSize) = 0; - - /** - * Get the line increment. - * @return size of the line increment. The value is - * between startRange and endRange - */ - virtual PRUint32 GetLineIncrement() = 0; - - /** - * Set all scrollbar parameters at once - * @param aMaxRange set range for scrollbar from 0 to aMaxRange - * @param aThumbSize size of the thumb. Must be a value between - * startRange and endRange - * @param aPosition a value between (startRange) and (endRange - thumbSize) - * @param aLineIncrement size of the line increment. The value must - * be between startRange and endRange - */ - virtual void SetParameters(PRUint32 aMaxRange, PRUint32 aThumbSize, - PRUint32 aPosition, PRUint32 aLineIncrement) = 0; -}; - -#endif // nsIScrollbar_h__ diff --git a/mozilla/widget/public/nsITabWidget.h b/mozilla/widget/public/nsITabWidget.h deleted file mode 100644 index 3a48a15714f..00000000000 --- a/mozilla/widget/public/nsITabWidget.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsITabWidget_h__ -#define nsITabWidget_h__ - -#include "nsIWidget.h" -#include "nsString.h" - -#define NS_ITABWIDGET_IID \ -{ 0xf05ba6e0, 0xd4a7, 0x11d1, { 0x9e, 0xc0, 0x0, 0xaa, 0x0, 0x2f, 0xb8, 0x21 } }; - -/** - * Tab widget. - * Presents a lists of tabs to be clicked on. - */ -class nsITabWidget : public nsIWidget { - - public: - - /** - * Setup the tabs - * - * @param aNumberOfTabs The number of tabs in aTabLabels and aTabID - * @param aTabLabels title displayed in the tab - */ - - virtual void SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[]) = 0; - - /** - * Get selected tab - * - * @return the index of the selected tab. Index ranges between 0 and (NumberOfTabs - 1) - */ - - virtual PRUint32 GetSelectedTab() = 0; - -}; - -#endif diff --git a/mozilla/widget/public/nsITextAreaWidget.h b/mozilla/widget/public/nsITextAreaWidget.h deleted file mode 100644 index 7a80b75749b..00000000000 --- a/mozilla/widget/public/nsITextAreaWidget.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsITextAreaWidget_h__ -#define nsITextAreaWidget_h__ - -#include "nsIWidget.h" -#include "nsITextWidget.h" -#include "nsString.h" - -// {F8030012-C342-11d1-97F0-00609703C14E} -#define NS_ITEXTAREAWIDGET_IID \ -{ 0xf8030012, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - -/** - * Multi-line text editor. - * See nsITextWidget for capabilities. - * Displays a scrollbar when the text content exceeds the number of lines - * displayed. - */ - -class nsITextAreaWidget : public nsITextWidget -{ -}; - -#endif // nsITextAreaWidget_h__ - diff --git a/mozilla/widget/public/nsITextWidget.h b/mozilla/widget/public/nsITextWidget.h deleted file mode 100644 index 283dfcfeca2..00000000000 --- a/mozilla/widget/public/nsITextWidget.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsITextWidget_h__ -#define nsITextWidget_h__ - -#include "nsIWidget.h" -#include "nsString.h" - -// {F8030011-C342-11d1-97F0-00609703C14E} -#define NS_ITEXTWIDGET_IID \ -{ 0xf8030011, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }; - -/** - * - * Single line text editor. - * - */ - -class nsITextWidget : public nsIWidget -{ - - public: - - /** - * Get the text of this component. - * - * @param aTextBuffer on return contains the text of this component - * @param aBufferSize the size of the buffer passed in - * @return the number of char copied - * - */ - - virtual PRUint32 GetText(nsString &aTextBuffer, PRUint32 aBufferSize) = 0; - - /** - * Set the text of this component. - * - * @param aTextBuffer on return it contains the text contents. - * @return the number of chars in the text string - * - */ - - virtual PRUint32 SetText(const nsString &aText) = 0; - - /** - * Insert text into this component. - * When aStartPos and aEndPos are a valid range this function performs a replace. - * When aStartPos and aEndPos are equal this function performs an insert. - * When aStartPos and aEndPos are both -1 (0xFFFFFFFF) this function performs an append. - * If aStartPos and aEndPos are out of range they are rounded to the closest end. - * - * @param aText the text to set - * @param aStartPos starting position for inserting text - * @param aEndPos ending position for inserting text - */ - - virtual PRUint32 InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos) = 0; - - /** - * Remove any content from this text widget - */ - - virtual void RemoveText() = 0; - - /** - * Indicates a password will be entered. - * - * @param aIsPassword PR_TRUE shows contents as asterisks. PR_FALSE shows - * contents as normal text. - */ - - virtual void SetPassword(PRBool aIsPassword) = 0; - - /** - * Sets the maximum number of characters the widget can hold - * - * @param aChars maximum number of characters for this widget. if 0 then there isn't any limit - */ - - virtual void SetMaxTextLength(PRUint32 aChars) = 0; - - - /** - * Set the text widget to be read-only - * - * @param aReadOnlyFlag PR_TRUE the widget is read-only, - * PR_FALSE indicates the widget is writable. - * @return PR_TRUE if it was read only. PR_FALSE if it was writable - */ - - virtual PRBool SetReadOnly(PRBool aReadOnlyFlag) = 0; - - /** - * Select all of the contents - */ - - virtual void SelectAll() = 0; - - /** - * Set the selection in this text component - * @param aStartSel starting selection position in characters - * @param aEndSel ending selection position in characters - */ - - virtual void SetSelection(PRUint32 aStartSel, PRUint32 aEndSel) = 0; - - /** - * Get the selection in this text component - * @param aStartSel starting selection position in characters - * @param aEndSel ending selection position in characters - */ - - virtual void GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel) = 0; - - /** - * Set the caret position - * @param aPosition caret position in characters - */ - - virtual void SetCaretPosition(PRUint32 aPosition) = 0; - - /** - * Get the caret position - * @return caret position in characters - */ - - virtual PRUint32 GetCaretPosition() = 0; - -}; - -#endif // nsITextWidget_h__ - diff --git a/mozilla/widget/public/nsIToolkit.h b/mozilla/widget/public/nsIToolkit.h deleted file mode 100644 index 74c0a12d28a..00000000000 --- a/mozilla/widget/public/nsIToolkit.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIToolkit_h__ -#define nsIToolkit_h__ - -#include "nsISupports.h" -#include "prthread.h" - -// {18032BD0-B265-11d1-AA2A-000000000000} -#define NS_ITOOLKIT_IID \ -{ 0x18032bd0, 0xb265, 0x11d1, \ - { 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } - - -/** - * - * Toolkit to associate with widgets. - * Each widget that is created must belong to a specific toolkit - * The toolkit is used to switch to the appropriate thread when - * the message pump for the widget is processed. - */ - -class nsIToolkit : public nsISupports { - - public: - - /** - * Initialize this toolkit with aThread. - * @param aThread The thread passed in runs the message pump. - * NULL can be passed in, in which case a new thread gets created - * and a message pump will run in that thread - * - */ - virtual void Init(PRThread *aThread) = 0; - -}; - -#endif diff --git a/mozilla/widget/public/nsIWidget.h b/mozilla/widget/public/nsIWidget.h deleted file mode 100644 index 2a7fd7108bc..00000000000 --- a/mozilla/widget/public/nsIWidget.h +++ /dev/null @@ -1,389 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsIWidget_h__ -#define nsIWidget_h__ - -#include "nsISupports.h" -#include "nsColor.h" -#include "nsIMouseListener.h" -#include "nsIImage.h" - -#include "prthread.h" -#include "nsGUIEvent.h" - -// forward declarations -class nsIToolkit; -class nsIFontMetrics; -class nsIToolkit; -class nsIRenderingContext; -class nsIEnumerator; -class nsIDeviceContext; -class nsIPresContext; -struct nsRect; -struct nsFont; - -/** - * Callback function that processes events. - * The argument is actually a subtype (subclass) of nsEvent which carries - * platform specific information about the event. Platform specific code knows - * how to deal with it. - * The return value determines whether or not the default action should take place. - */ - -typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event); - -/** - * Flags for the getNativeData function. - * See getNativeData() - */ -#define NS_NATIVE_WINDOW 0 -#define NS_NATIVE_GRAPHIC 1 -#define NS_NATIVE_COLORMAP 2 - -// {18032AD5-B265-11d1-AA2A-000000000000} -#define NS_IWIDGET_IID \ -{ 0x18032ad5, 0xb265, 0x11d1, \ -{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } - - -// Hide the native window systems real window type so as to avoid -// including native window system types and api's. This is necessary -// to ensure cross-platform code. -typedef void* nsNativeWindow; - -/** - * Border styles - */ - -enum nsBorderStyle { - ///no border - eBorderStyle_none, - ///dialog box border + title area - eBorderStyle_dialog, - }; - -/** - * Cursor types. - */ - -enum nsCursor { ///(normal cursor, usually rendered as an arrow) - eCursor_standard, - ///(system is busy, usually rendered as a hourglass or watch) - eCursor_wait, - ///(Selecting something, usually rendered as an IBeam) - eCursor_select, - ///(can hyper-link, usually rendered as a human hand) - eCursor_hyperlink }; - -/** - * The base class for all the widgets. It provides the interface for - * all basic and necessary functionality. - */ -class nsIWidget : public nsISupports { - - public: - - /** - * Create and initialize a widget. - * - * The widget represents a window that can be drawn into. It also is the - * base class for user-interface widgets such as buttons and text boxes. - * - * All the arguments can be NULL in which case a top level window - * with size 0 is created. The event callback function has to be - * provided only if the caller wants to deal with the events this - * widget receives. The event callback is basically a preprocess - * hook called synchronously. The return value determines whether - * the event goes to the default window procedure or it is hidden - * to the os. The assumption is that if the event handler returns - * false the widget does not see the event. - * - * @param parent or null if it's a top level window - * @param aRect the widget dimension - * @param aHandleEventFunction the event handler callback function - * @param aInitData data that is used for widget initialization - * - */ - virtual void Create(nsIWidget *aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit = nsnull, - void *aInitData = nsnull) = 0; - - /** - * Create and initialize a widget with a native window parent - * - * The widget represents a window that can be drawn into. It also is the - * base class for user-interface widgets such as buttons and text boxes. - * - * All the arguments can be NULL in which case a top level window - * with size 0 is created. The event callback function has to be - * provided only if the caller wants to deal with the events this - * widget receives. The event callback is basically a preprocess - * hook called synchronously. The return value determines whether - * the event goes to the default window procedure or it is hidden - * to the os. The assumption is that if the event handler returns - * false the widget does not see the event. - * - * @param aParent native window. - * @param aRect the widget dimension - * @param aHandleEventFunction the event handler callback function - */ - virtual void Create(nsNativeWindow aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit = nsnull, - void *aInitData = nsnull) = 0; - - /** - * Close and destroy the internal native window. - * This method does not delete the widget. - */ - - virtual void Destroy(void) = 0; - - /** - * Return the parent Widget of this Widget or nsnull if this is a - * top level window - * - * @return the parent widget or nsnull if it does not have a parent - * - */ - virtual nsIWidget* GetParent(void) = 0; - - /** - * Return an nsEnumerator over the children of this widget. - * - * @return an enumerator over the list of children or nsnull if it does not - * have any children - * - */ - virtual nsIEnumerator* GetChildren(void) = 0; - - /** - * Show or hide this widget - * - * @param aState PR_TRUE to show the Widget, PR_FALSE to hide it - * - */ - virtual void Show(PRBool aState) = 0; - - /** - * Move this widget. - * - * @param aX the new x position expressed in the parent's coordinate system - * @param aY the new y position expressed in the parent's coordinate system - * - **/ - virtual void Move(PRUint32 aX, PRUint32 aY) = 0; - - /** - * Resize this widget. - * - * @param aWidth the new width expressed in the parent's coordinate system - * @param aHeight the new height expressed in the parent's coordinate system - * - */ - virtual void Resize(PRUint32 aWidth, - PRUint32 aHeight) = 0; - - /** - * Move or resize this widget. - * - * @param aX the new x position expressed in the parent's coordinate system - * @param aY the new y position expressed in the parent's coordinate system - * @param aWidth the new width expressed in the parent's coordinate system - * @param aHeight the new height expressed in the parent's coordinate system - * - */ - virtual void Resize(PRUint32 aX, - PRUint32 aY, - PRUint32 aWidth, - PRUint32 aHeight) = 0; - - /** - * Enable or disable this Widget - * - * @param aState PR_TRUE to enable the Widget, PR_FALSE to disable it. - * - */ - virtual void Enable(PRBool aState) = 0; - - /** - * Give focus to this widget. - */ - virtual void SetFocus(void) = 0; - - /** - * Get this widget's dimension - * - * @param aRect on return it holds the x. y, width and height of this widget - * - */ - virtual void GetBounds(nsRect &aRect) = 0; - - /** - * Get the foreground color for this widget - * - * @return this widget's foreground color - * - */ - virtual nscolor GetForegroundColor(void) = 0; - - /** - * Set the foreground color for this widget - * - * @param aColor the new foreground color - * - */ - - virtual void SetForegroundColor(const nscolor &aColor) = 0; - - /** - * Get the background color for this widget - * - * @return this widget's background color - * - */ - - virtual nscolor GetBackgroundColor(void) = 0; - - /** - * Set the background color for this widget - * - * @param aColor the new background color - * - */ - - virtual void SetBackgroundColor(const nscolor &aColor) = 0; - - /** - * Get the font for this widget - * - * @return the font metrics - */ - - virtual nsIFontMetrics* GetFont(void) = 0; - - /** - * Set the font for this widget - * - * @param aFont font to display. See nsFont for allowable fonts - */ - - virtual void SetFont(const nsFont &aFont) = 0; - - /** - * Get the cursor for this widget. - * - * @return this widget's cursor. - */ - - virtual nsCursor GetCursor(void) = 0; - - /** - * Set the cursor for this widget - * - * @param aCursor the new cursor for this widget - */ - - virtual void SetCursor(nsCursor aCursor) = 0; - - /** - * Invalidate the widget and repaint it. - * - * @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later. - * - */ - - virtual void Invalidate(PRBool aIsSynchronous) = 0; - - - /** - * Adds a mouse listener to this widget - * Any existing mouse listener is replaced - * - * @param aListener mouse listener to add to this widget. - */ - - virtual void AddMouseListener(nsIMouseListener * aListener) = 0; - - /** - * Return the widget's toolkit - * - * @return the toolkit this widget was created in. See nsToolkit. - */ - - virtual nsIToolkit* GetToolkit() = 0; - - /** - * Set the color map for this widget - * - * @param aColorMap color map for displaying this widget - * - */ - - virtual void SetColorMap(nsColorMap *aColorMap) = 0; - - /** - * Scroll this widget. - * - * @param aDx amount to scroll along the x-axis - * @param aDy amount to scroll along the y-axis. - * @param aClipRect clipping rectangle to limit the scroll to. - * - */ - - virtual void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) = 0; - - /** - * Internal methods - */ - - //@{ - virtual void AddChild(nsIWidget* aChild) = 0; - virtual void RemoveChild(nsIWidget* aChild) = 0; - virtual void* GetNativeData(PRUint32 aDataType) = 0; - virtual nsIRenderingContext* GetRenderingContext() = 0; - virtual nsIDeviceContext* GetDeviceContext() = 0; - //@} - - /** - * Set border style - * Must be called before Create. - * @param aBorderStyle @see nsBorderStyle - */ - - virtual void SetBorderStyle(nsBorderStyle aBorderStyle) = 0; - - /** - * Set the widget's title. - * Must be called after Create. - * - * @param aTitle string displayed as the title of the widget - */ - - virtual void SetTitle(const nsString& aTitle) = 0; - - -}; - -#endif // nsIWidget_h__ diff --git a/mozilla/widget/public/nsWidgetsCID.h b/mozilla/widget/public/nsWidgetsCID.h deleted file mode 100644 index db1ca47c145..00000000000 --- a/mozilla/widget/public/nsWidgetsCID.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* 2d96b3d0-c051-11d1-a827-0040959a28c9 */ -#define NS_WINDOW_CID \ -{ 0x2d96b3d0, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9}} - -/* 2d96b3d1-c051-11d1-a827-0040959a28c9 */ -#define NS_CHILD_CID \ -{ 0x2d96b3d1, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d2-c051-11d1-a827-0040959a28c9 */ -#define NS_BUTTON_CID \ -{ 0x2d96b3d2, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d3-c051-11d1-a827-0040959a28c9 */ -#define NS_CHECKBUTTON_CID \ -{ 0x2d96b3d3, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d4-c051-11d1-a827-0040959a28c9 */ -#define NS_COMBOBOX_CID \ -{ 0x2d96b3d4, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d5-c051-11d1-a827-0040959a28c9 */ -#define NS_FILEWIDGET_CID \ -{ 0x2d96b3d5, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d6-c051-11d1-a827-0040959a28c9 */ -#define NS_LISTBOX_CID \ -{ 0x2d96b3d6, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d7-c051-11d1-a827-0040959a28c9 */ -#define NS_RADIOBUTTON_CID \ -{ 0x2d96b3d7, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d8-c051-11d1-a827-0040959a28c9 */ -#define NS_RADIOGROUP_CID \ -{ 0x2d96b3d8, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3d9-c051-11d1-a827-0040959a28c9 */ -#define NS_HORZSCROLLBAR_CID \ -{ 0x2d96b3d9, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3da-c051-11d1-a827-0040959a28c9 */ -#define NS_VERTSCROLLBAR_CID \ -{ 0x2d96b3da, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3db-c051-11d1-a827-0040959a28c9 */ -#define NS_TEXTAREA_CID \ -{ 0x2d96b3db, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3dc-c051-11d1-a827-0040959a28c9 */ -#define NS_TEXTFIELD_CID \ -{ 0x2d96b3dc, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - -/* 2d96b3dc-c051-11d1-a827-0040959a28c9 */ -#define NS_TABWIDGET_CID \ -{ 0x2d96b3dd, 0xc051, 0x11d1, \ - {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} } - diff --git a/mozilla/widget/public/nsui.h b/mozilla/widget/public/nsui.h deleted file mode 100644 index 6fdc3cb089b..00000000000 --- a/mozilla/widget/public/nsui.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsui_h___ -#define nsui_h___ - -#ifdef _IMPL_NS_UI -#define NS_UI NS_EXPORT -#else -#define NS_UI NS_IMPORT -#endif - -#endif /* nsui_h___ */ diff --git a/mozilla/widget/src/Makefile b/mozilla/widget/src/Makefile deleted file mode 100644 index 86d0c812c5a..00000000000 --- a/mozilla/widget/src/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=../.. - -#DIRS = windows - -include $(DEPTH)/config/config.mk - -TARGET = $(LIBRARY) - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/widget/src/makefile.win b/mozilla/widget/src/makefile.win deleted file mode 100644 index f0f7579ab74..00000000000 --- a/mozilla/widget/src/makefile.win +++ /dev/null @@ -1,23 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS=windows - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/widget/src/windows/Makefile b/mozilla/widget/src/windows/Makefile deleted file mode 100644 index f516bfbbe18..00000000000 --- a/mozilla/widget/src/windows/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - - -include manifest.mn - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/widget/src/windows/makefile.win b/mozilla/widget/src/windows/makefile.win deleted file mode 100644 index 168e5f602a4..00000000000 --- a/mozilla/widget/src/windows/makefile.win +++ /dev/null @@ -1,79 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = DLL -DLLNAME = raptorwidget -DLL=.\$(OBJDIR)\$(DLLNAME).dll -RESFILE = widget.res - -MISCDEP = \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib - -MODULE=raptor - -DEFINES =-D_IMPL_NS_WIDGET - -OBJS = \ - .\$(OBJDIR)\nsWidgetFactory.obj \ - .\$(OBJDIR)\nsObject.obj \ - .\$(OBJDIR)\nsWindow.obj \ - .\$(OBJDIR)\nsToolkit.obj \ - .\$(OBJDIR)\nsButton.obj \ - .\$(OBJDIR)\nsCheckButton.obj \ - .\$(OBJDIR)\nsRadioGroup.obj \ - .\$(OBJDIR)\nsRadioButton.obj \ - .\$(OBJDIR)\nsListBox.obj \ - .\$(OBJDIR)\nsComboBox.obj \ - .\$(OBJDIR)\nsTextWidget.obj \ - .\$(OBJDIR)\nsTextHelper.obj \ - .\$(OBJDIR)\nsTextAreaWidget.obj \ - .\$(OBJDIR)\nsFileWidget.obj \ - .\$(OBJDIR)\nsScrollbar.obj \ - .\$(OBJDIR)\nsTabWidget.obj \ - $(NULL) - -LINCS= \ - -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\xpcom \ - $(NULL) - -LCFLAGS = \ - $(LCFLAGS) \ - -D_IMPL_NS_WIDGET \ - -DNS_DLLNAME=$(DLLNAME).dll \ - $(NULL) - -LLIBS= \ - comctl32.lib \ - comdlg32.lib \ - $(DIST)\lib\xpcom32.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(DIST)\lib\raptorbase.lib \ - $(LIBNSPR) - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\$(DLLNAME).dll diff --git a/mozilla/widget/src/windows/nsButton.cpp b/mozilla/widget/src/windows/nsButton.cpp deleted file mode 100644 index 8ffc20ee2a5..00000000000 --- a/mozilla/widget/src/windows/nsButton.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsButton.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" -#include - -//------------------------------------------------------------------------- -// -// nsButton constructor -// -//------------------------------------------------------------------------- -nsButton::nsButton(nsISupports *aOuter) : nsWindow(aOuter) -{ -} - -//------------------------------------------------------------------------- -// -// nsButton destructor -// -//------------------------------------------------------------------------- -nsButton::~nsButton() -{ -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsButton::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsButtonIID, NS_IBUTTON_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsButtonIID)) { - *aInstancePtr = (void*) ((nsIButton*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// Set this button label -// -//------------------------------------------------------------------------- -void nsButton::SetLabel(const nsString& aText) -{ - NS_ALLOC_STR_BUF(label, aText, 256); - VERIFY(::SetWindowText(mWnd, label)); - NS_FREE_STR_BUF(label); -} - -//------------------------------------------------------------------------- -// -// Get this button label -// -//------------------------------------------------------------------------- -void nsButton::GetLabel(nsString& aBuffer) -{ - int actualSize = ::GetWindowTextLength(mWnd)+1; - NS_ALLOC_CHAR_BUF(label, 256, actualSize); - ::GetWindowText(mWnd, label, actualSize); - aBuffer.SetLength(0); - aBuffer.Append(label); - NS_FREE_CHAR_BUF(label); -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsButton::OnPaint() -{ - //printf("** nsButton::OnPaint **\n"); - return PR_FALSE; -} - -PRBool nsButton::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsButton::WindowClass() -{ - return "BUTTON"; -} - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsButton::WindowStyle() -{ - return WS_CHILD | WS_CLIPSIBLINGS; -} - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsButton::WindowExStyle() -{ - return 0; -} - diff --git a/mozilla/widget/src/windows/nsButton.h b/mozilla/widget/src/windows/nsButton.h deleted file mode 100644 index 9dc436cf1d6..00000000000 --- a/mozilla/widget/src/windows/nsButton.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsButton_h__ -#define nsButton_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" - -#include "nsIButton.h" - -/** - * Native Win32 button wrapper - */ - -class nsButton : public nsWindow, - public nsIButton -{ - -public: - nsButton(nsISupports *aOuter); - virtual ~nsButton(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsIButton part - virtual void SetLabel(const nsString& aText); - virtual void GetLabel(nsString& aBuffer); - virtual PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - -protected: - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -}; - -#endif // nsButton_h__ diff --git a/mozilla/widget/src/windows/nsCList.h b/mozilla/widget/src/windows/nsCList.h deleted file mode 100644 index bf9f3939fe3..00000000000 --- a/mozilla/widget/src/windows/nsCList.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef CLIST_H -#define CLIST_H - -#include - -// ----------------------------------------------------------------------- -// -// Simple circular linked-list implementation... -// -// ----------------------------------------------------------------------- - -// Foreward declarations... -struct CList; - -#define OBJECT_PTR_FROM_CLIST(className, listElement) \ - ((char*)listElement - offsetof(className, m_link)) - - -struct CList { - CList *next; - CList *prev; - - CList() { - next = prev = this; - } - - ~CList() { - Remove(); - } - - // - // Append an element to the end of this list - // - void Append(CList &element) { - element.next = this; - element.prev = prev; - prev->next = &element; - prev = &element; - } - - // - // Add an element to the beginning of this list - // - void Add(CList &element) { - element.next = next; - element.prev = this; - next->prev = &element; - next = &element; - } - - // - // Append this element to the end of a list - // - void AppendToList(CList &list) { - list.Append(*this); - } - - // - // Add this element to the beginning of a list - // - void AddToList(CList &list) { - list.Add(*this); - } - - // - // Remove this element from the list and re-initialize - // - void Remove(void) { - prev->next = next; - next->prev = prev; - - next = prev = this; - } - - // - // Is this list empty ? - // - BOOL IsEmpty(void) { - return (next == this); - } -}; - -#endif // CLIST_H - diff --git a/mozilla/widget/src/windows/nsCheckButton.cpp b/mozilla/widget/src/windows/nsCheckButton.cpp deleted file mode 100644 index 5109d36d98c..00000000000 --- a/mozilla/widget/src/windows/nsCheckButton.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsCheckButton.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" -#include - -//------------------------------------------------------------------------- -// -// nsCheckButton constructor -// -//------------------------------------------------------------------------- -nsCheckButton::nsCheckButton(nsISupports *aOuter) : nsWindow(aOuter) -{ -} - - -//------------------------------------------------------------------------- -// -// nsCheckButton destructor -// -//------------------------------------------------------------------------- -nsCheckButton::~nsCheckButton() -{ -} - - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsCheckButton::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsCheckButtonIID, NS_ICHECKBUTTON_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsCheckButtonIID)) { - *aInstancePtr = (void*) ((nsICheckButton*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// Set this button label -// -//------------------------------------------------------------------------- -void nsCheckButton::SetState(PRBool aState) -{ - BOOL state; - if (aState) - state = BST_CHECKED; - else - state = BST_UNCHECKED; - ::SendMessage(mWnd, BM_SETCHECK, (WPARAM)state, (LPARAM)0); -} - -//------------------------------------------------------------------------- -// -// Set this button label -// -//------------------------------------------------------------------------- -PRBool nsCheckButton::GetState() -{ - if (::SendMessage(mWnd, BM_GETCHECK, (WPARAM)0, (LPARAM)0) == BST_CHECKED) - return PR_TRUE; - else - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// Set this button label -// -//------------------------------------------------------------------------- -void nsCheckButton::SetLabel(const nsString& aText) -{ - char label[256]; - aText.ToCString(label, 256); - label[255] = '\0'; - VERIFY(::SetWindowText(mWnd, label)); -} - - -//------------------------------------------------------------------------- -// -// Get this button label -// -//------------------------------------------------------------------------- -void nsCheckButton::GetLabel(nsString& aBuffer) -{ - int actualSize = ::GetWindowTextLength(mWnd)+1; - NS_ALLOC_CHAR_BUF(label, 256, actualSize); - ::GetWindowText(mWnd, label, actualSize); - aBuffer.SetLength(0); - aBuffer.Append(label); - NS_FREE_CHAR_BUF(label); -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsCheckButton::OnPaint() -{ - return PR_FALSE; -} - -PRBool nsCheckButton::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsCheckButton::WindowClass() -{ - return "BUTTON"; -} - - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsCheckButton::WindowStyle() -{ - return BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS; -} - - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsCheckButton::WindowExStyle() -{ - return 0; -} - - diff --git a/mozilla/widget/src/windows/nsCheckButton.h b/mozilla/widget/src/windows/nsCheckButton.h deleted file mode 100644 index 8e2febce59a..00000000000 --- a/mozilla/widget/src/windows/nsCheckButton.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsCheckButton_h__ -#define nsCheckButton_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" - -#include "nsICheckButton.h" - -/** - * Native Win32 Checkbox wrapper - */ - -class nsCheckButton : public nsWindow, - public nsICheckButton -{ - -public: - nsCheckButton(nsISupports *aOuter); - virtual ~nsCheckButton(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsICheckButton part - virtual void SetLabel(const nsString& aText); - virtual void GetLabel(nsString& aBuffer); - - virtual PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - - virtual void SetState(PRBool aState); - virtual PRBool GetState(); - - -protected: - - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -}; - -#endif // nsCheckButton_h__ diff --git a/mozilla/widget/src/windows/nsComboBox.cpp b/mozilla/widget/src/windows/nsComboBox.cpp deleted file mode 100644 index 7bc1fbcf6ca..00000000000 --- a/mozilla/widget/src/windows/nsComboBox.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsComboBox.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" -#include - -//------------------------------------------------------------------------- -// -// destructor -// -//------------------------------------------------------------------------- -void nsComboBox::AddItemAt(nsString &aItem, PRInt32 aPosition) -{ - NS_ALLOC_STR_BUF(val, aItem, 256); - ::SendMessage(mWnd, CB_ADDSTRING, (int)aPosition, (LPARAM)(LPCTSTR)val); - NS_FREE_STR_BUF(val); -} - -//------------------------------------------------------------------------- -// -// Finds an item at a postion -// -//------------------------------------------------------------------------- -PRInt32 nsComboBox::FindItem(nsString &aItem, PRInt32 aStartPos) -{ - NS_ALLOC_STR_BUF(val, aItem, 256); - int index = ::SendMessage(mWnd, CB_FINDSTRINGEXACT, (int)aStartPos, (LPARAM)(LPCTSTR)val); - NS_FREE_STR_BUF(val); - - return index; -} - -//------------------------------------------------------------------------- -// -// CountItems - Get Item Count -// -//------------------------------------------------------------------------- -PRInt32 nsComboBox::GetItemCount() -{ - return (PRInt32)::SendMessage(mWnd, CB_GETCOUNT, (int)0, (LPARAM)0); -} - -//------------------------------------------------------------------------- -// -// Removes an Item at a specified location -// -//------------------------------------------------------------------------- -PRBool nsComboBox::RemoveItemAt(PRInt32 aPosition) -{ - int status = ::SendMessage(mWnd, CB_DELETESTRING, (int)aPosition, (LPARAM)(LPCTSTR)0); - return (status != CB_ERR?PR_TRUE:PR_FALSE); -} - -//------------------------------------------------------------------------- -// -// Removes an Item at a specified location -// -//------------------------------------------------------------------------- -PRBool nsComboBox::GetItemAt(nsString& anItem, PRInt32 aPosition) -{ - PRBool result = PR_FALSE; - int len = ::SendMessage(mWnd, CB_GETLBTEXTLEN, (int)aPosition, (LPARAM)0); - if (len != CB_ERR) { - char * str = new char[len+1]; - anItem.SetLength(0); - int status = ::SendMessage(mWnd, CB_GETLBTEXT, (int)aPosition, (LPARAM)(LPCTSTR)str); - if (status != CB_ERR) { - anItem.Append(str); - result = PR_TRUE; - } - delete str; - } - return result; -} - -//------------------------------------------------------------------------- -// -// Gets the selected of selected item -// -//------------------------------------------------------------------------- -void nsComboBox::GetSelectedItem(nsString& aItem) -{ - - int index = ::SendMessage(mWnd, CB_GETCURSEL, (int)0, (LPARAM)0); - GetItemAt(aItem, index); -} - -//------------------------------------------------------------------------- -// -// Gets the list of selected otems -// -//------------------------------------------------------------------------- -PRInt32 nsComboBox::GetSelectedIndex() -{ - return ::SendMessage(mWnd, CB_GETCURSEL, (int)0, (LPARAM)0); -} - -//------------------------------------------------------------------------- -// -// SelectItem -// -//------------------------------------------------------------------------- -void nsComboBox::SelectItem(PRInt32 aPosition) -{ - ::SendMessage(mWnd, CB_SETCURSEL, (int)aPosition, (LPARAM)0); -} - -//------------------------------------------------------------------------- -// -// Deselect -// -//------------------------------------------------------------------------- -void nsComboBox::Deselect() -{ - ::SendMessage(mWnd, CB_SETCURSEL, (WPARAM)-1, (LPARAM)0); -} - -//------------------------------------------------------------------------- -// -// nsComboBox constructor -// -//------------------------------------------------------------------------- -nsComboBox::nsComboBox(nsISupports *aOuter) : nsWindow(aOuter) -{ - mBackground = NS_RGB(124, 124, 124); -} - -//------------------------------------------------------------------------- -// -// destructor -// -//------------------------------------------------------------------------- -nsComboBox::~nsComboBox() -{ -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsComboBox::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsComboBoxIID, NS_ICOMBOBOX_IID); - static NS_DEFINE_IID(kInsListWidgetIID, NS_ILISTWIDGET_IID); - if (result == NS_NOINTERFACE) { - if (aIID.Equals(kInsComboBoxIID)) { - *aInstancePtr = (void*) ((nsIComboBox*)this); - AddRef(); - result = NS_OK; - } - else if (aIID.Equals(kInsListWidgetIID)) { - *aInstancePtr = (void*) ((nsIListWidget*)this); - AddRef(); - result = NS_OK; - } - } - - return result; -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsComboBox::OnPaint() -{ - return PR_FALSE; -} - -PRBool nsComboBox::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsComboBox::WindowClass() -{ - return("COMBOBOX"); -} - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsComboBox::WindowStyle() -{ - return (CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS); -} - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsComboBox::WindowExStyle() -{ - return WS_EX_CLIENTEDGE; -} - - diff --git a/mozilla/widget/src/windows/nsComboBox.h b/mozilla/widget/src/windows/nsComboBox.h deleted file mode 100644 index fde425c7c96..00000000000 --- a/mozilla/widget/src/windows/nsComboBox.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsComboBox_h__ -#define nsComboBox_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" -#include "nsIComboBox.h" - -/** - * Native Win32 Combobox wrapper - */ - -class nsComboBox : public nsWindow, - public nsIComboBox -{ - -public: - nsComboBox(nsISupports *aOuter); - ~nsComboBox(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - PRBool nsComboBox::OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsIComboBox part - - void AddItemAt(nsString &aItem, PRInt32 aPosition); - PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos); - PRInt32 GetItemCount(); - PRBool RemoveItemAt(PRInt32 aPosition); - PRBool GetItemAt(nsString& anItem, PRInt32 aPosition); - void GetSelectedItem(nsString& aItem); - PRInt32 GetSelectedIndex(); - void SelectItem(PRInt32 aPosition); - void Deselect() ; - -protected: - - LPCTSTR WindowClass(); - DWORD WindowStyle(); - DWORD WindowExStyle(); - -}; - -#endif // nsComboBox_h__ diff --git a/mozilla/widget/src/windows/nsFileWidget.cpp b/mozilla/widget/src/windows/nsFileWidget.cpp deleted file mode 100644 index faf27f15d2c..00000000000 --- a/mozilla/widget/src/windows/nsFileWidget.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -// Define so header files for openfilename are included -#ifdef WIN32_LEAN_AND_MEAN -#undef WIN32_LEAN_AND_MEAN -#endif - -#include "nsFileWidget.h" -#include - -//------------------------------------------------------------------------- -// -// Show - Display the file dialog -// -//------------------------------------------------------------------------- - -PRBool nsFileWidget::Show() -{ - char fileBuffer[MAX_PATH]; - fileBuffer[0] = '\0'; - OPENFILENAME ofn; - memset(&ofn, 0, sizeof(ofn)); - - ofn.lStructSize = sizeof(ofn); - - nsString filterList; - GetFilterListArray(filterList); - char *filterBuffer = filterList.ToNewCString(); - char *title = mTitle.ToNewCString(); - ofn.lpstrTitle = title; - ofn.lpstrFilter = filterBuffer; - ofn.nFilterIndex = 1; - ofn.hwndOwner = mWnd; - ofn.lpstrFile = fileBuffer; - ofn.nMaxFile = MAX_PATH; - ofn.Flags = OFN_SHAREAWARE | OFN_NOCHANGEDIR | OFN_LONGNAMES | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; - - BOOL result; - - // Save current directory, so we can reset if it changes. - char* currentDirectory = new char[MAX_PATH+1]; - VERIFY(::GetCurrentDirectory(MAX_PATH, currentDirectory) > 0); - - if (mMode == eMode_load) { - result = GetOpenFileName(&ofn); - } - else if (mMode == eMode_save) { - result = GetSaveFileName(&ofn); - } - else { - NS_ASSERTION(0, "Only load and save are supported modes"); - } - - VERIFY(::SetCurrentDirectory(currentDirectory)); - - // Clean up filter buffers - delete filterBuffer; - delete title; - - // Set user-selected location of file or directory - mFile.SetLength(0); - if (result==PR_TRUE) { - mFile.Append(fileBuffer); - } - - return((PRBool)result); -} - -//------------------------------------------------------------------------- -// -// Convert filter titles + filters into a Windows filter string -// -//------------------------------------------------------------------------- - -void nsFileWidget::GetFilterListArray(nsString& aFilterList) -{ - aFilterList.SetLength(0); - for (PRUint32 i = 0; i < mNumberOfFilters; i++) { - const nsString& title = mTitles[i]; - const nsString& filter = mFilters[i]; - - aFilterList.Append(title); - aFilterList.Append('\0'); - aFilterList.Append(filter); - aFilterList.Append('\0'); - } - aFilterList.Append('\0'); -} - -//------------------------------------------------------------------------- -// -// Set the list of filters -// -//------------------------------------------------------------------------- - -void nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[]) -{ - mNumberOfFilters = aNumberOfFilters; - mTitles = aTitles; - mFilters = aFilters; -} - -//------------------------------------------------------------------------- -// -// Get the file + path -// -//------------------------------------------------------------------------- - -void nsFileWidget::GetFile(nsString& aFile) -{ - aFile.SetLength(0); - aFile.Append(mFile); -} - -//------------------------------------------------------------------------- -// -// nsFileWidget constructor -// -//------------------------------------------------------------------------- -nsFileWidget::nsFileWidget(nsISupports *aOuter) : nsObject(aOuter) -{ - mWnd = NULL; - mNumberOfFilters = 0; -} - - -void nsFileWidget:: Create(nsIWidget *aParent, - nsString& aTitle, - nsMode aMode, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit, - void *aInitData) -{ - mWnd = aParent; - mTitle.SetLength(0); - mTitle.Append(aTitle); - mMode = aMode; -} - - -//------------------------------------------------------------------------- -// -// nsFileWidget destructor -// -//------------------------------------------------------------------------- -nsFileWidget::~nsFileWidget() -{ -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsFileWidget::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - // nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - nsresult result = NS_NOINTERFACE; - static NS_DEFINE_IID(kInsFileWidgetIID, NS_IFILEWIDGET_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsFileWidgetIID)) { - *aInstancePtr = (void*) ((nsIFileWidget*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - - - diff --git a/mozilla/widget/src/windows/nsFileWidget.h b/mozilla/widget/src/windows/nsFileWidget.h deleted file mode 100644 index 09dcfe535bd..00000000000 --- a/mozilla/widget/src/windows/nsFileWidget.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsFileWidget_h__ -#define nsFileWidget_h__ - -#include "nsObject.h" -#include "nsToolkit.h" -#include "nsIWidget.h" -#include "nsIFileWidget.h" - -/** - * Native Win32 FileSelector wrapper - */ - -class nsFileWidget : public nsIFileWidget, public nsObject -{ - public: - nsFileWidget(nsISupports *aOuter); - virtual ~nsFileWidget(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - PRBool OnPaint(); - - // nsIWidget interface - - virtual void Create( nsIWidget *aParent, - nsString& aTitle, - nsMode aMode, - nsIDeviceContext *aContext = nsnull, - nsIToolkit *aToolkit = nsnull, - void *aInitData = nsnull); - - // nsIFileWidget part - virtual PRBool Show(); - virtual void GetFile(nsString& aFile); - virtual void SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[]); - - protected: - - HWND mWnd; - nsString mTitle; - nsMode mMode; - nsString mFile; - PRUint32 mNumberOfFilters; - const nsString* mTitles; - const nsString* mFilters; - - void GetFilterListArray(nsString& aFilterList); -}; - -#endif // nsFileWidget_h__ diff --git a/mozilla/widget/src/windows/nsListBox.cpp b/mozilla/widget/src/windows/nsListBox.cpp deleted file mode 100644 index ac82f13afba..00000000000 --- a/mozilla/widget/src/windows/nsListBox.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsListBox.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" -#include - -//------------------------------------------------------------------------- -// -// initializer -// -//------------------------------------------------------------------------- - -void nsListBox::SetMultipleSelection(PRBool aMultipleSelections) -{ - mMultiSelect = aMultipleSelections; -} - -void nsListBox::PreCreateWidget(void *aInitData) -{ - if (nsnull != aInitData) { - nsWidgetInitData* data = (nsWidgetInitData *) aInitData; - mMultiSelect = (0 == data->arg1) ? PR_FALSE : PR_TRUE; - } -} - -//------------------------------------------------------------------------- -// -// destructor -// -//------------------------------------------------------------------------- - -void nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition) -{ - NS_ALLOC_STR_BUF(val, aItem, 256); - SendMessage(mWnd, LB_INSERTSTRING, (int)aPosition, (LPARAM)(LPCTSTR)val); - NS_FREE_STR_BUF(val); -} - -//------------------------------------------------------------------------- -// -// Finds an item at a postion -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::FindItem(nsString &aItem, PRInt32 aStartPos) -{ - NS_ALLOC_STR_BUF(val, aItem, 256); - int index = ::SendMessage(mWnd, LB_FINDSTRINGEXACT, (int)aStartPos, (LPARAM)(LPCTSTR)val); - NS_FREE_STR_BUF(val); - - return index; -} - -//------------------------------------------------------------------------- -// -// CountItems - Get Item Count -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::GetItemCount() -{ - return (PRInt32)::SendMessage(mWnd, LB_GETCOUNT, (int)0, (LPARAM)0); -} - -//------------------------------------------------------------------------- -// -// Removes an Item at a specified location -// -//------------------------------------------------------------------------- -PRBool nsListBox::RemoveItemAt(PRInt32 aPosition) -{ - int status = ::SendMessage(mWnd, LB_DELETESTRING, (int)aPosition, (LPARAM)(LPCTSTR)0); - return (status != LB_ERR?PR_TRUE:PR_FALSE); -} - -//------------------------------------------------------------------------- -// -// Removes an Item at a specified location -// -//------------------------------------------------------------------------- -PRBool nsListBox::GetItemAt(nsString& anItem, PRInt32 aPosition) -{ - PRBool result = PR_FALSE; - int len = ::SendMessage(mWnd, LB_GETTEXTLEN, (int)aPosition, (LPARAM)0); - if (len != LB_ERR) { - char * str = new char[len+1]; - anItem.SetLength(0); - int status = ::SendMessage(mWnd, LB_GETTEXT, (int)aPosition, (LPARAM)(LPCTSTR)str); - if (status != LB_ERR) { - anItem.Append(str); - result = PR_TRUE; - } - delete str; - } - return result; -} - -//------------------------------------------------------------------------- -// -// Gets the selected of selected item -// -//------------------------------------------------------------------------- -void nsListBox::GetSelectedItem(nsString& aItem) -{ - int index = ::SendMessage(mWnd, LB_GETCURSEL, (int)0, (LPARAM)0); - GetItemAt(aItem, index); -} - -//------------------------------------------------------------------------- -// -// Gets the list of selected otems -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::GetSelectedIndex() -{ - if (!mMultiSelect) { - return ::SendMessage(mWnd, LB_GETCURSEL, (int)0, (LPARAM)0); - } else { - NS_ASSERTION(0, "Multi selection list box does not support GetSlectedIndex()"); - } - return 0; -} - -//------------------------------------------------------------------------- -// -// SelectItem -// -//------------------------------------------------------------------------- -void nsListBox::SelectItem(PRInt32 aPosition) -{ - if (!mMultiSelect) { - ::SendMessage(mWnd, LB_SETCURSEL, (int)aPosition, (LPARAM)0); - } else { - ::SendMessage(mWnd, LB_SETSEL, (WPARAM) (BOOL)PR_TRUE, (LPARAM)(UINT)aPosition); - } -} - -//------------------------------------------------------------------------- -// -// GetSelectedCount -// -//------------------------------------------------------------------------- -PRInt32 nsListBox::GetSelectedCount() -{ - if (!mMultiSelect) { - PRInt32 inx = GetSelectedIndex(); - return (inx == -1? 0 : 1); - } else { - return ::SendMessage(mWnd, LB_GETSELCOUNT, (int)0, (LPARAM)0); - } -} - -//------------------------------------------------------------------------- -// -// GetSelectedIndices -// -//------------------------------------------------------------------------- -void nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize) -{ - ::SendMessage(mWnd, LB_GETSELITEMS, (int)aSize, (LPARAM)aIndices); -} - -//------------------------------------------------------------------------- -// -// Deselect -// -//------------------------------------------------------------------------- -void nsListBox::Deselect() -{ - if (!mMultiSelect) { - ::SendMessage(mWnd, LB_SETCURSEL, (WPARAM)-1, (LPARAM)0); - } else { - ::SendMessage(mWnd, LB_SETSEL, (WPARAM) (BOOL)PR_FALSE, (LPARAM)(UINT)-1); - } - -} - - -//------------------------------------------------------------------------- -// -// nsListBox constructor -// -//------------------------------------------------------------------------- -nsListBox::nsListBox(nsISupports *aOuter) : nsWindow(aOuter) -{ - mMultiSelect = PR_FALSE; - mBackground = NS_RGB(124, 124, 124); -} - -//------------------------------------------------------------------------- -// -// nsListBox:: destructor -// -//------------------------------------------------------------------------- -nsListBox::~nsListBox() -{ -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsListBox::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsListBoxIID, NS_ILISTBOX_IID); - static NS_DEFINE_IID(kInsListWidgetIID, NS_ILISTWIDGET_IID); - if (result == NS_NOINTERFACE) { - if (aIID.Equals(kInsListBoxIID)) { - *aInstancePtr = (void*) ((nsIListBox*)this); - AddRef(); - result = NS_OK; - } - else if (aIID.Equals(kInsListWidgetIID)) { - *aInstancePtr = (void*) ((nsIListWidget*)this); - AddRef(); - result = NS_OK; - } - } - - return result; -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsListBox::OnPaint() -{ - return PR_FALSE; -} - -PRBool nsListBox::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsListBox::WindowClass() -{ - return("LISTBOX"); -} - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsListBox::WindowStyle() -{ - DWORD style = (WS_BORDER | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_VSCROLL); - if (mMultiSelect) - style = LBS_MULTIPLESEL | style; - - return style; -} - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsListBox::WindowExStyle() -{ - return 0; -} - -//------------------------------------------------------------------------- -// -// Clear window before paint -// -//------------------------------------------------------------------------- - -PRBool nsListBox::AutoErase() -{ - return(PR_TRUE); -} - - diff --git a/mozilla/widget/src/windows/nsListBox.h b/mozilla/widget/src/windows/nsListBox.h deleted file mode 100644 index 308d01a0956..00000000000 --- a/mozilla/widget/src/windows/nsListBox.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsListBox_h__ -#define nsListBox_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" -#include "nsIListBox.h" - -/** - * Native Win32 Listbox wrapper - */ - -class nsListBox : public nsWindow, - public nsIListBox -{ - -public: - nsListBox(nsISupports *aOuter); - virtual ~nsListBox(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsIListBox interface - void SetMultipleSelection(PRBool aMultipleSelections); - void AddItemAt(nsString &aItem, PRInt32 aPosition); - PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos); - PRInt32 GetItemCount(); - PRBool RemoveItemAt(PRInt32 aPosition); - PRBool GetItemAt(nsString& anItem, PRInt32 aPosition); - void GetSelectedItem(nsString& aItem); - PRInt32 GetSelectedIndex(); - void AllowMultipleSelections(PRBool aMultiple); - PRInt32 GetSelectedCount(); - void GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize); - void SelectItem(PRInt32 aPosition); - void Deselect() ; - virtual void PreCreateWidget(void *aInitData); - - // nsWindow interface - virtual PRBool AutoErase(); -protected: - PRBool mMultiSelect; - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -}; - -#endif // nsListBox_h__ diff --git a/mozilla/widget/src/windows/nsObject.cpp b/mozilla/widget/src/windows/nsObject.cpp deleted file mode 100644 index 7797ce92ddb..00000000000 --- a/mozilla/widget/src/windows/nsObject.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - - -#include "nsObject.h" - -CList nsObject::s_liveChain; -PRMonitor *nsObject::s_liveChainMutex = PR_NewMonitor(); - -#ifdef _DEBUG -int32 nsObject::s_nObjects = 0; -#endif - -/** - * constructor - */ -nsObject::nsObject(nsISupports *aOuter) -{ - // ref count init - mRefCnt = 1; - // assign outer - if (aOuter) - mOuter = aOuter; - else - mOuter = (nsISupports*)&mInner; - - // - // Add the new object the chain of allocated nsObjects - // - PR_EnterMonitor(s_liveChainMutex); - s_liveChain.Append(m_link); - PR_ExitMonitor(s_liveChainMutex); -#ifdef _DEBUG - s_nObjects++; -#endif -} - - -/** - * destructor - */ -nsObject::~nsObject() -{ -#ifdef _DEBUG - s_nObjects--; -#endif - // - // Remove from the chain of allocated nsObjects - // - PR_EnterMonitor(s_liveChainMutex); - m_link.Remove(); - PR_ExitMonitor(s_liveChainMutex); -} - -/** - * nsISupports methods - */ -nsresult nsObject::QueryInterface(const nsIID& aIID, void** aInstancePtr) -{ - return mOuter->QueryInterface(aIID, aInstancePtr); -} - -/** - * - */ -nsrefcnt nsObject::AddRef(void) -{ - return mOuter->AddRef(); -} - -/** - * - */ -nsrefcnt nsObject::Release(void) -{ - return NS_RELEASE(mOuter); -} - -/** - * - */ -inline nsrefcnt nsObject::AddRefObject(void) { - return ++mRefCnt; -} - -/** - * - */ -inline nsrefcnt nsObject::ReleaseObject(void) { - return (--mRefCnt) ? mRefCnt : (delete this, 0); -} - -/** - * - */ -nsresult nsObject::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*) ((nsISupports*)&mInner); - AddRef(); - return NS_OK; - } - - return NS_NOINTERFACE; -} - - -/** - * static utility. Delete all live objects - */ - -void nsObject::DeleteAllObjects(void) -{ - PR_EnterMonitor(s_liveChainMutex); - - while (!s_liveChain.IsEmpty()) { - nsObject *pnsObject; - - pnsObject = (nsObject*)OBJECT_PTR_FROM_CLIST(nsObject, s_liveChain.next); - - // Remove the event from the chain... - pnsObject->m_link.Remove(); - delete pnsObject; - } - - PR_ExitMonitor(s_liveChainMutex); -} - diff --git a/mozilla/widget/src/windows/nsObject.h b/mozilla/widget/src/windows/nsObject.h deleted file mode 100644 index 4552079b198..00000000000 --- a/mozilla/widget/src/windows/nsObject.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef OBJECT_H -#define OBJECT_H - -#include "nsdefs.h" -#include "nsCList.h" -#include "nsISupports.h" -#include "prmon.h" - -/** - * nsObject is the base class for all native widgets - */ - -class nsObject : public nsISupports -{ - -public: - nsObject(nsISupports *aOuter); - virtual ~nsObject(); - - // Implementation of those, always forward to the outer object. - NS_IMETHOD QueryInterface(const nsIID& aIID, - void** aInstancePtr); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - // - // Derived classes have to implement this one - // - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - -protected: - // - // Data members: - // - CList m_link; - -private: - nsISupports *mOuter; - - class InnerSupport : public nsISupports { - public: - InnerSupport() {} - -#define INNER_OUTER \ - ((nsObject*)((char*)this - offsetof(nsObject, mInner))) - - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr) - { return INNER_OUTER->QueryObject(aIID, aInstancePtr); } - NS_IMETHOD_(nsrefcnt) AddRef(void) - { return INNER_OUTER->AddRefObject(); } - NS_IMETHOD_(nsrefcnt) Release(void) - { return INNER_OUTER->ReleaseObject(); } - } mInner; - friend InnerSupport; - - nsrefcnt mRefCnt; - nsrefcnt AddRefObject(void); - nsrefcnt ReleaseObject(void); - -public: - - // - // The following data members are used to maintain a chain of all - // allocated nsObject instances. This chain is traversed at - // shutdown to clean up any dangling instances... - // - static CList s_liveChain; - static PRMonitor *s_liveChainMutex; - -#ifdef _DEBUG - static int32 s_nObjects; -#endif - - static void DeleteAllObjects(void); - -}; - -#define BASE_SUPPORT \ - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr) \ - { return nsObject::QueryInterface(aIID, aInstancePtr); } \ - NS_IMETHOD_(nsrefcnt) AddRef(void) \ - { return nsObject::AddRef(); } \ - NS_IMETHOD_(nsrefcnt) Release(void) \ - { return nsObject::Release(); } - - -#endif // OBJECT_H - diff --git a/mozilla/widget/src/windows/nsRadioButton.cpp b/mozilla/widget/src/windows/nsRadioButton.cpp deleted file mode 100644 index 9c2d038efff..00000000000 --- a/mozilla/widget/src/windows/nsRadioButton.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsRadioButton.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsStringUtil.h" - -#include - -//------------------------------------------------------------------------- -// -// nsRadioButton constructor -// -//------------------------------------------------------------------------- -nsRadioButton::nsRadioButton(nsISupports *aOuter) : nsWindow(aOuter) -{ - fRadioGroup = NULL; -} - - -//------------------------------------------------------------------------- -// -// nsRadioButton destructor -// -//------------------------------------------------------------------------- -nsRadioButton::~nsRadioButton() -{ -} - - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsRadioButton::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsRadioButtonIID, NS_IRADIOBUTTON_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsRadioButtonIID)) { - *aInstancePtr = (void*) ((nsIRadioButton*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// Sets the state of the nsRadioButton but it DOES notify its nsRadioGroup. -// -//------------------------------------------------------------------------- -void nsRadioButton::SetState(PRBool aState) -{ - fState = aState; - - ::SendMessage(GetWindowHandle(), BM_SETCHECK, (WPARAM)(fState), 0L); - if (nsnull != fRadioGroup) - fRadioGroup->Clicked(this); -} - -//------------------------------------------------------------------------- -// -// Sets the state of the nsRadioButton but it does not notify -// its nsRadioGroup. -// -//------------------------------------------------------------------------- -void nsRadioButton::SetStateNoNotify(PRBool aState) -{ - fState = aState; - ::SendMessage(GetWindowHandle(), BM_SETCHECK, (WPARAM)(fState), 0L); -} - -//------------------------------------------------------------------------- -// -// Set this button label -// -//------------------------------------------------------------------------- -PRBool nsRadioButton::GetState() -{ - return fState; -} - -//------------------------------------------------------------------------- -// -// Return the radio group this radio button belongs to -// -//------------------------------------------------------------------------- -nsIRadioGroup* nsRadioButton::GetRadioGroup() -{ - if (fRadioGroup) - fRadioGroup->AddRef(); - return fRadioGroup; -} - - -//------------------------------------------------------------------------- -// -// Set the radio button group -// -//------------------------------------------------------------------------- -void nsRadioButton::SetRadioGroup(nsIRadioGroup* aGroup) -{ - if (aGroup) - aGroup->AddRef(); - - if (fRadioGroup) - NS_RELEASE(fRadioGroup); - - fRadioGroup = aGroup; - fRadioGroup->Add(this); -} - -//------------------------------------------------------------------------- -// -// Set this button label -// -//------------------------------------------------------------------------- -void nsRadioButton::SetLabel(const nsString& aText) -{ - char label[256]; - aText.ToCString(label, 256); - label[255] = '\0'; - VERIFY(::SetWindowText(mWnd, label)); -} - - -//------------------------------------------------------------------------- -// -// Get this button label -// -//------------------------------------------------------------------------- -void nsRadioButton::GetLabel(nsString& aBuffer) -{ - int actualSize = ::GetWindowTextLength(mWnd)+1; - NS_ALLOC_CHAR_BUF(label, 256, actualSize); - ::GetWindowText(mWnd, label, actualSize); - aBuffer.SetLength(0); - aBuffer.Append(label); - NS_FREE_CHAR_BUF(label); -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsRadioButton::OnPaint() -{ - return PR_FALSE; -} - -PRBool nsRadioButton::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsRadioButton::WindowClass() -{ - return "BUTTON"; -} - - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsRadioButton::WindowStyle() -{ - return BS_RADIOBUTTON | WS_CHILD | WS_CLIPSIBLINGS; -} - - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsRadioButton::WindowExStyle() -{ - return 0; -} - - diff --git a/mozilla/widget/src/windows/nsRadioButton.h b/mozilla/widget/src/windows/nsRadioButton.h deleted file mode 100644 index 610975f353d..00000000000 --- a/mozilla/widget/src/windows/nsRadioButton.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsRadioButton_h__ -#define nsRadioButton_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" -#include "nsString.h" - -#include "nsIRadioButton.h" -#include "nsIRadioGroup.h" - - -/** - * Native Win32 Radio button wrapper - */ - -class nsRadioButton : public nsWindow, - public nsIRadioButton -{ - -public: - nsRadioButton(nsISupports *aOuter); - virtual ~nsRadioButton(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsIRadioButton part - virtual void SetLabel(const nsString& aText); - virtual void GetLabel(nsString& aBuffer); - - virtual PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - - virtual void SetState(PRBool aState); - virtual void SetStateNoNotify(PRBool aState); - virtual PRBool GetState(); - - virtual nsIRadioGroup* GetRadioGroup(); - virtual void SetRadioGroup(nsIRadioGroup* aGroup); - -protected: - PRBool fState; - nsIRadioGroup* fRadioGroup; - - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -}; - -#endif // nsRadioButton_h__ diff --git a/mozilla/widget/src/windows/nsRadioGroup.cpp b/mozilla/widget/src/windows/nsRadioGroup.cpp deleted file mode 100644 index 9b5b59c0da2..00000000000 --- a/mozilla/widget/src/windows/nsRadioGroup.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsRadioGroup.h" -#include "nsToolkit.h" -#include "nsStringUtil.h" - - -class nsStringHashKey : public nsHashKey { -public: - nsStringHashKey(const nsString & aKey); - ~nsStringHashKey(); - - PRBool operator==(const nsStringHashKey& aOther) const; - PRBool Equals(const nsHashKey* aOther) const; - PRUint32 HashValue(void) const; - nsHashKey* Clone(void) const; - -private: - nsStringHashKey(); - nsStringHashKey(const nsStringHashKey& aCopy); - nsStringHashKey& operator=(const nsStringHashKey& aCopy); - -protected: - nsString mKey; - PRUint32 mHashValid; - PRUint32 mHashValue; - -}; - -nsStringHashKey::nsStringHashKey(const nsString & aKey) -{ - mKey.SetLength(0); - mKey.Append(aKey); - mHashValid = 0; -} - -nsStringHashKey::nsStringHashKey(const nsStringHashKey& aCopy) -{ - mKey.SetLength(0); - mKey.Append(aCopy.mKey); - mHashValid = aCopy.mHashValid; - mHashValue = aCopy.mHashValue; -} - -nsStringHashKey::~nsStringHashKey() -{ -} - -PRBool nsStringHashKey::operator==(const nsStringHashKey& aOther) const -{ - return Equals(&aOther); -} - -PRBool nsStringHashKey::Equals(const nsHashKey* aOther) const -{ - PRBool result = PR_TRUE; - - const nsStringHashKey* other = (nsStringHashKey*)aOther; - - if (nsnull != other && other != this) { - result = mKey.Equals(other->mKey); - } - return result; -} - -nsHashKey* nsStringHashKey::Clone(void) const -{ - return new nsStringHashKey(*this); -} - -PRUint32 nsStringHashKey::HashValue(void) const -{ - if (0 == mHashValid) { - ((nsStringHashKey*)this)->mHashValue = 0; - - NS_ALLOC_STR_BUF(val, mKey, 256) - PRUint32 hash = 0; - PRUint32 off = 0; - PRUint32 len = mKey.Length(); - - if (len < 16) { - for (PRUint32 i = len ; i > 0; i--) { - hash = (hash * 37) + val[off++]; - } - } else { // only sample some characters - PRUint32 skip = len / 8; - for (PRUint32 i = len ; i > 0; i -= skip, off += skip) { - hash = (hash * 39) + val[off]; - } - } - NS_FREE_STR_BUF(val) - ((nsStringHashKey*)this)->mHashValue = hash;//^= (hash & 0x7FFFFFFF); - ((nsStringHashKey*)this)->mHashValid = 1; - } - return mHashValue; -} - - - -nsHashtable * nsRadioGroup::mRadioGroupHashtable = new nsHashtable(8); - -PRBool HashtableEnum(nsHashKey *aKey, void *aData) { - printf("HashtableEnum %s\n", aKey); - return PR_TRUE; -} - -//------------------------------------------------------------------------- -// -// nsRadioGroup static methods -// -//------------------------------------------------------------------------- -nsRadioGroup * nsRadioGroup::getNamedRadioGroup(const nsString & aName) { - nsStringHashKey key(aName); - nsRadioGroup * group = (nsRadioGroup *)mRadioGroupHashtable->Get((nsHashKey *)&key); - return group; -} - -NS_EXPORT nsIRadioGroup * NS_GetRadioGroup(const nsString &aName) { - return nsRadioGroup::getNamedRadioGroup(aName); -} - - -//------------------------------------------------------------------------- -// -// nsRadioGroup constructor -// -//------------------------------------------------------------------------- -nsRadioGroup::nsRadioGroup(nsISupports *aOuter) : nsObject(aOuter) -{ - mChildren = NULL; -} - - -//------------------------------------------------------------------------- -// -// nsRadioGroup destructor -// -//------------------------------------------------------------------------- -nsRadioGroup::~nsRadioGroup() -{ - if (mChildren) { - mChildren = NULL; - } -} - - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsRadioGroup::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsObject::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsRadioGroupIID, NS_IRADIOGROUP_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsRadioGroupIID)) { - *aInstancePtr = (void*) ((nsIRadioGroup*)this); - AddRef(); - result = NS_OK; - } - - return result; - -} - - -//------------------------------------------------------------------------- -// -// Gives a name to this group of radio buttons -// -//------------------------------------------------------------------------- -void nsRadioGroup::SetName(const nsString &aName) -{ - mName.SetLength(0); - mName.Append(aName); - mRadioGroupHashtable->Put(new nsStringHashKey(aName), this); -} - - -//------------------------------------------------------------------------- -// -// Adds a nsRadioButton to this group -// -//------------------------------------------------------------------------- -void nsRadioGroup::Clicked(nsIRadioButton * aChild) -{ - if (mChildren) { - nsIEnumerator * enumerator = GetChildren(); - nsIRadioButton * child = (nsIRadioButton*)enumerator->Next(); - while (child) { - child->SetStateNoNotify((PRBool)(child == aChild)); - NS_RELEASE(child); - child = (nsIRadioButton*)enumerator->Next(); - } - NS_RELEASE(enumerator); - } -} - -//------------------------------------------------------------------------- -// -// Adds a nsRadioButton to this group -// -//------------------------------------------------------------------------- -void nsRadioGroup::Add(nsIRadioButton * aChild) -{ - if (!mChildren) { - mChildren = new Enumerator(); - } - - mChildren->Append(aChild); - -} - -//------------------------------------------------------------------------- -// -// Removes a nsRadioButton from this group -// -//------------------------------------------------------------------------- -void nsRadioGroup::Remove(nsIRadioButton * aChild) -{ - if (mChildren) { - mChildren->Remove(aChild); - } - -} - -//------------------------------------------------------------------------- -// -// Get this window's list of children -// -//------------------------------------------------------------------------- -nsIEnumerator* nsRadioGroup::GetChildren() -{ - if (mChildren) { - mChildren->Reset(); - mChildren->AddRef(); - return mChildren; - } - - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Constructor -// -//------------------------------------------------------------------------- -#define INITIAL_SIZE 2 - -nsRadioGroup::Enumerator::Enumerator() -{ - mRefCnt = 1; - mArraySize = INITIAL_SIZE; - mChildrens = (nsIRadioButton**)new DWORD[mArraySize]; - memset(mChildrens, 0, sizeof(DWORD) * mArraySize); - mCurrentPosition = 0; -} - - -//------------------------------------------------------------------------- -// -// Destructor -// -//------------------------------------------------------------------------- -nsRadioGroup::Enumerator::~Enumerator() -{ - if (mChildrens) { - for (int i = 0; mChildrens[i] && i < mArraySize; i++) { - NS_RELEASE(mChildrens[i]); - } - - delete[] mChildrens; - } -} - -// -// nsISupports methods -// -NS_IMPL_ISUPPORTS(nsRadioGroup::Enumerator, NS_IENUMERATOR_IID); - -//------------------------------------------------------------------------- -// -// Get enumeration next element. Return null at the end -// -//------------------------------------------------------------------------- -nsISupports* nsRadioGroup::Enumerator::Next() -{ - if (mCurrentPosition < mArraySize && mChildrens[mCurrentPosition]) { - mChildrens[mCurrentPosition]->AddRef(); - return mChildrens[mCurrentPosition++]; - } - - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Reset enumerator internal pointer to the beginning -// -//------------------------------------------------------------------------- -void nsRadioGroup::Enumerator::Reset() -{ - mCurrentPosition = 0; -} - - -//------------------------------------------------------------------------- -// -// Append an element -// -//------------------------------------------------------------------------- -void nsRadioGroup::Enumerator::Append(nsIRadioButton* aRadioButton) -{ - NS_PRECONDITION(aRadioButton, "Adding a null radio button to a radio group"); - if (aRadioButton) { - int pos; - for (pos = 0; pos < mArraySize && mChildrens[pos]; pos++); - if (pos == mArraySize) { - GrowArray(); - } - mChildrens[pos] = aRadioButton; - aRadioButton->AddRef(); - } -} - - -//------------------------------------------------------------------------- -// -// Remove an element -// -//------------------------------------------------------------------------- -void nsRadioGroup::Enumerator::Remove(nsIRadioButton* aRadioButton) -{ - int pos; - for(pos = 0; mChildrens[pos] && (mChildrens[pos] != aRadioButton); pos++); - if (mChildrens[pos] == aRadioButton) { - NS_RELEASE(aRadioButton); - memcpy(mChildrens + pos, mChildrens + pos + 1, mArraySize - pos - 1); - } - -} - - -//------------------------------------------------------------------------- -// -// Grow the size of the children array -// -//------------------------------------------------------------------------- -void nsRadioGroup::Enumerator::GrowArray() -{ - mArraySize <<= 1; - nsIRadioButton **newArray = (nsIRadioButton**)new DWORD[mArraySize]; - memset(newArray, 0, sizeof(DWORD) * mArraySize); - memcpy(newArray, mChildrens, (mArraySize>>1) * sizeof(DWORD)); - mChildrens = newArray; -} - - diff --git a/mozilla/widget/src/windows/nsRadioGroup.h b/mozilla/widget/src/windows/nsRadioGroup.h deleted file mode 100644 index 3049b4293af..00000000000 --- a/mozilla/widget/src/windows/nsRadioGroup.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsRadioGroup_h__ -#define nsRadioGroup_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" - -#include "nsIRadioGroup.h" -#include "nsRadioButton.h" -#include "nsHashtable.h" - -/** - * Native radio button manager - */ - -class nsRadioGroup : public nsObject, - public nsIRadioGroup -{ - -public: - nsRadioGroup(nsISupports *aOuter); - virtual ~nsRadioGroup(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - // nsIRadioGroup part - virtual void Add(nsIRadioButton * aChild); - virtual void Remove(nsIRadioButton * aChild); - - virtual void SetName(const nsString &aName); - - virtual void Clicked(nsIRadioButton * aChild); - virtual nsIEnumerator* GetChildren(); - - static nsRadioGroup * getNamedRadioGroup(const nsString & aName); - -protected: - nsString mName; - - static nsHashtable * mRadioGroupHashtable; - //static PRBool HashtableEnum(nsHashKey *aKey, void *aData); - - - // keep the list of children - class Enumerator : public nsIEnumerator { - nsIRadioButton **mChildrens; - int mCurrentPosition; - int mArraySize; - - public: - NS_DECL_ISUPPORTS - - Enumerator(); - ~Enumerator(); - - NS_IMETHOD_(nsISupports*) Next(); - NS_IMETHOD_(void) Reset(); - - void Append(nsIRadioButton* aWidget); - void Remove(nsIRadioButton* aWidget); - - private: - void GrowArray(); - - } *mChildren; - -}; - -#endif // nsRadioGroup_h__ diff --git a/mozilla/widget/src/windows/nsScrollbar.cpp b/mozilla/widget/src/windows/nsScrollbar.cpp deleted file mode 100644 index 70fcd37b529..00000000000 --- a/mozilla/widget/src/windows/nsScrollbar.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsScrollbar.h" -#include "nsToolkit.h" -#include "nsGUIEvent.h" -#include -#include "nsUnitConversion.h" - -//------------------------------------------------------------------------- -// -// nsScrollbar constructor -// -//------------------------------------------------------------------------- -nsScrollbar::nsScrollbar(nsISupports *aOuter, PRBool aIsVertical) : nsWindow(aOuter) -{ - mPositionFlag = (aIsVertical) ? SBS_VERT : SBS_HORZ; - mScaleFactor = 1.0; - mLineIncrement = 0; - mBackground = ::GetSysColor(COLOR_SCROLLBAR); - mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground)); -} - - -//------------------------------------------------------------------------- -// -// nsScrollbar destructor -// -//------------------------------------------------------------------------- -nsScrollbar::~nsScrollbar() -{ -} - - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsScrollbar::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsScrollbarIID, NS_ISCROLLBAR_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsScrollbarIID)) { - *aInstancePtr = (void*) ((nsIScrollbar*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - - -//------------------------------------------------------------------------- -// -// Define the range settings -// -//------------------------------------------------------------------------- -void nsScrollbar::SetMaxRange(PRUint32 aEndRange) -{ - if (aEndRange > 32767) - mScaleFactor = aEndRange / 32767.0; - if (mWnd) { - VERIFY(::SetScrollRange(mWnd, SB_CTL, 0, NS_TO_INT_ROUND(aEndRange / mScaleFactor), TRUE)); - } -} - - -//------------------------------------------------------------------------- -// -// Return the range settings -// -//------------------------------------------------------------------------- -PRUint32 nsScrollbar::GetMaxRange() -{ - int startRange, endRange; - if (mWnd) { - VERIFY(::GetScrollRange(mWnd, SB_CTL, &startRange, &endRange)); - } - - return (PRUint32)NS_TO_INT_ROUND(endRange * mScaleFactor); -} - - -//------------------------------------------------------------------------- -// -// Set the thumb position -// -//------------------------------------------------------------------------- -void nsScrollbar::SetPosition(PRUint32 aPos) -{ - ::SetScrollPos(mWnd, SB_CTL, NS_TO_INT_ROUND(aPos / mScaleFactor), TRUE); -} - - -//------------------------------------------------------------------------- -// -// Get the current thumb position. -// -//------------------------------------------------------------------------- -PRUint32 nsScrollbar::GetPosition() -{ - return (PRUint32)NS_TO_INT_ROUND(::GetScrollPos(mWnd, SB_CTL) * mScaleFactor); -} - - -//------------------------------------------------------------------------- -// -// Set the thumb size -// -//------------------------------------------------------------------------- -void nsScrollbar::SetThumbSize(PRUint32 aSize) -{ - if (mWnd) { - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_PAGE; - si.nPage = NS_TO_INT_ROUND(aSize / mScaleFactor); - ::SetScrollInfo(mWnd, SB_CTL, &si, TRUE); - } -} - - -//------------------------------------------------------------------------- -// -// Get the thumb size -// -//------------------------------------------------------------------------- -PRUint32 nsScrollbar::GetThumbSize() -{ - if (mWnd) { - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_PAGE; - VERIFY(::GetScrollInfo(mWnd, SB_CTL, &si)); - return (PRUint32)NS_TO_INT_ROUND(si.nPage * mScaleFactor); - } - - return 0; -} - - -//------------------------------------------------------------------------- -// -// Set the line increment for this scrollbar -// -//------------------------------------------------------------------------- -void nsScrollbar::SetLineIncrement(PRUint32 aSize) -{ - mLineIncrement = NS_TO_INT_ROUND(aSize / mScaleFactor); -} - - -//------------------------------------------------------------------------- -// -// Get the line increment for this scrollbar -// -//------------------------------------------------------------------------- -PRUint32 nsScrollbar::GetLineIncrement() -{ - return (PRUint32)NS_TO_INT_ROUND(mLineIncrement * mScaleFactor); -} - - -//------------------------------------------------------------------------- -// -// Set all scrolling parameters -// -//------------------------------------------------------------------------- -void nsScrollbar::SetParameters(PRUint32 aMaxRange, PRUint32 aThumbSize, - PRUint32 aPosition, PRUint32 aLineIncrement) -{ - if (aMaxRange > 32767) - mScaleFactor = aMaxRange / 32767.0; - - if (mWnd) { - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE; - si.nPage = NS_TO_INT_ROUND(aThumbSize / mScaleFactor); - si.nPos = NS_TO_INT_ROUND(aPosition / mScaleFactor); - si.nMin = 0; - si.nMax = NS_TO_INT_ROUND(aMaxRange / mScaleFactor); - ::SetScrollInfo(mWnd, SB_CTL, &si, TRUE); - } - - mLineIncrement = NS_TO_INT_ROUND(aLineIncrement / mScaleFactor); -} - - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsScrollbar::OnPaint() -{ - return PR_FALSE; -} - - -PRBool nsScrollbar::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// Deal with scrollbar messages (actually implemented only in nsScrollbar) -// -//------------------------------------------------------------------------- -PRBool nsScrollbar::OnScroll(UINT scrollCode, int cPos) -{ - PRBool result = PR_TRUE; - int newPosition; - - switch (scrollCode) { - - // scroll one line right or down - // SB_LINERIGHT and SB_LINEDOWN are actually the same value - //case SB_LINERIGHT: - case SB_LINEDOWN: - { - newPosition = ::GetScrollPos(mWnd, SB_CTL) + mLineIncrement; - PRUint32 max = GetMaxRange() - GetThumbSize(); - if (newPosition > (int)max) - newPosition = (int)max; - - // if an event callback is registered, give it the chance - // to change the increment - if (mEventCallback) { - nsScrollbarEvent event; - event.message = NS_SCROLLBAR_LINE_NEXT; - event.widget = (nsWindow*)this; - DWORD pos = ::GetMessagePos(); - POINT cpos; - cpos.x = LOWORD(pos); - cpos.y = HIWORD(pos); - ::ScreenToClient(mWnd, &cpos); - event.point.x = cpos.x; - event.point.y = cpos.y; - event.time = ::GetMessageTime(); - event.position = (PRUint32)NS_TO_INT_ROUND(newPosition * mScaleFactor); - - result = ConvertStatus((*mEventCallback)(&event)); - newPosition = NS_TO_INT_ROUND(event.position / mScaleFactor); - } - - ::SetScrollPos(mWnd, SB_CTL, newPosition, TRUE); - - break; - } - - - // scroll one line left or up - //case SB_LINELEFT: - case SB_LINEUP: - { - newPosition = ::GetScrollPos(mWnd, SB_CTL) - mLineIncrement; - if (newPosition < 0) - newPosition = 0; - - // if an event callback is registered, give it the chance - // to change the decrement - if (mEventCallback) { - nsScrollbarEvent event; - event.message = NS_SCROLLBAR_LINE_PREV; - event.widget = (nsWindow*)this; - DWORD pos = ::GetMessagePos(); - POINT cpos; - cpos.x = LOWORD(pos); - cpos.y = HIWORD(pos); - ::ScreenToClient(mWnd, &cpos); - event.point.x = cpos.x; - event.point.y = cpos.y; - event.time = ::GetMessageTime(); - event.position = (PRUint32)NS_TO_INT_ROUND(newPosition * mScaleFactor); - - result = ConvertStatus((*mEventCallback)(&event)); - newPosition = NS_TO_INT_ROUND(event.position / mScaleFactor); - } - - ::SetScrollPos(mWnd, SB_CTL, newPosition, TRUE); - - break; - } - - // Scrolls one page right or down - // case SB_PAGERIGHT: - case SB_PAGEDOWN: - { - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_PAGE; - VERIFY(::GetScrollInfo(mWnd, SB_CTL, &si)); - - newPosition = ::GetScrollPos(mWnd, SB_CTL) + si.nPage; - PRUint32 max = GetMaxRange() - GetThumbSize(); - if (newPosition > (int)max) - newPosition = (int)max; - - // if an event callback is registered, give it the chance - // to change the increment - if (mEventCallback) { - nsScrollbarEvent event; - event.message = NS_SCROLLBAR_PAGE_NEXT; - event.widget = (nsWindow*)this; - DWORD pos = ::GetMessagePos(); - POINT cpos; - cpos.x = LOWORD(pos); - cpos.y = HIWORD(pos); - ::ScreenToClient(mWnd, &cpos); - event.point.x = cpos.x; - event.point.y = cpos.y; - event.time = ::GetMessageTime(); - event.position = (PRUint32)NS_TO_INT_ROUND(newPosition * mScaleFactor);; - - - result = ConvertStatus((*mEventCallback)(&event)); - newPosition = NS_TO_INT_ROUND(event.position / mScaleFactor); - } - - ::SetScrollPos(mWnd, SB_CTL, newPosition, TRUE); - - break; - } - - // Scrolls one page left or up. - //case SB_PAGELEFT: - case SB_PAGEUP: - { - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_PAGE; - VERIFY(::GetScrollInfo(mWnd, SB_CTL, &si)); - - newPosition = ::GetScrollPos(mWnd, SB_CTL) - si.nPage; - if (newPosition < 0) - newPosition = 0; - - // if an event callback is registered, give it the chance - // to change the increment - if (mEventCallback) { - nsScrollbarEvent event; - event.message = NS_SCROLLBAR_PAGE_PREV; - event.widget = (nsWindow*)this; - DWORD pos = ::GetMessagePos(); - POINT cpos; - cpos.x = LOWORD(pos); - cpos.y = HIWORD(pos); - ::ScreenToClient(mWnd, &cpos); - event.point.x = cpos.x; - event.point.y = cpos.y; - event.time = ::GetMessageTime(); - event.position = (PRUint32)NS_TO_INT_ROUND(newPosition * mScaleFactor); - - result = ConvertStatus((*mEventCallback)(&event)); - newPosition = NS_TO_INT_ROUND(event.position / mScaleFactor); - } - - ::SetScrollPos(mWnd, SB_CTL, newPosition - 10, TRUE); - - break; - } - - // Scrolls to the absolute position. The current position is specified by - // the cPos parameter. - case SB_THUMBPOSITION: - case SB_THUMBTRACK: - { - newPosition = cPos; - - // if an event callback is registered, give it the chance - // to change the increment - if (mEventCallback) { - nsScrollbarEvent event; - event.message = NS_SCROLLBAR_POS; - event.widget = (nsWindow*)this; - DWORD pos = ::GetMessagePos(); - POINT cpos; - cpos.x = LOWORD(pos); - cpos.y = HIWORD(pos); - ::ScreenToClient(mWnd, &cpos); - event.point.x = cpos.x; - event.point.y = cpos.y; - event.time = ::GetMessageTime(); - event.position = (PRUint32)NS_TO_INT_ROUND(newPosition * mScaleFactor); - - result = ConvertStatus((*mEventCallback)(&event)); - newPosition = NS_TO_INT_ROUND(event.position * mScaleFactor); - } - - ::SetScrollPos(mWnd, SB_CTL, newPosition, TRUE); - - break; - } - } - - return result; -} - - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsScrollbar::WindowClass() -{ - return "SCROLLBAR"; -} - - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsScrollbar::WindowStyle() -{ - return mPositionFlag | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS; -} - - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsScrollbar::WindowExStyle() -{ - return 0; -} - - diff --git a/mozilla/widget/src/windows/nsScrollbar.h b/mozilla/widget/src/windows/nsScrollbar.h deleted file mode 100644 index 82adbf9b847..00000000000 --- a/mozilla/widget/src/windows/nsScrollbar.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsScrollbar_h__ -#define nsScrollbar_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" - -#include "nsIScrollbar.h" - -/** - * Native WIN32 scrollbar wrapper. - */ - -class nsScrollbar : public nsWindow, - public nsIScrollbar -{ - -public: - nsScrollbar(nsISupports *aOuter, PRBool aIsVertical); - virtual ~nsScrollbar(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - - // nsIScrollbar part - virtual void SetMaxRange(PRUint32 aEndRange); - virtual PRUint32 GetMaxRange(); - virtual void SetPosition(PRUint32 aPos); - virtual PRUint32 GetPosition(); - virtual void SetThumbSize(PRUint32 aSize); - virtual PRUint32 GetThumbSize(); - virtual void SetLineIncrement(PRUint32 aSize); - virtual PRUint32 GetLineIncrement(); - virtual void SetParameters(PRUint32 aMaxRange, PRUint32 aThumbSize, - PRUint32 aPosition, PRUint32 aLineIncrement); - - virtual PRBool OnPaint(); - virtual PRBool OnScroll(UINT scrollCode, int cPos); - virtual PRBool OnResize(nsRect &aWindowRect); - -protected: - - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -private: - DWORD mPositionFlag; - int mLineIncrement; - double mScaleFactor; -}; - -#endif // nsButton_h__ diff --git a/mozilla/widget/src/windows/nsStringUtil.h b/mozilla/widget/src/windows/nsStringUtil.h deleted file mode 100644 index 4925500ba78..00000000000 --- a/mozilla/widget/src/windows/nsStringUtil.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -// Convience macros for converting nsString's to chars + -// creating temporary char[] bufs. - -#ifndef NS_STR_UTIL_H -#define NS_STR_UTIL_H - -// nsString to temporary char[] macro - -// Convience MACROS to convert an nsString to a char * which use a -// static char array if possible to reduce memory fragmentation, -// otherwise they allocate a char[] which must be freed. -// REMEMBER to always use the NS_FREE_STR_BUF after using the -// NS_ALLOC_STR_BUF. You can not nest NS_ALLOC_STR_BUF's. - -#define NS_ALLOC_STR_BUF(varName, strName, tempSize) \ - static const int _ns_kSmallBufferSize = tempSize; \ - char* varName = 0; \ - int _ns_smallBufUsed = 0; \ - char _ns_smallBuffer[_ns_kSmallBufferSize]; \ - if (strName.Length() < (_ns_kSmallBufferSize - 1)) { \ - strName.ToCString(_ns_smallBuffer, _ns_kSmallBufferSize); \ - _ns_smallBuffer[_ns_kSmallBufferSize - 1] = '\0'; \ - _ns_smallBufUsed = 1; \ - varName = _ns_smallBuffer; \ - } \ - else { \ - varName = strName.ToNewCString(); \ - } - -#define NS_FREE_STR_BUF(varName) \ - if (! _ns_smallBufUsed) \ - delete varName; - -// Create temporary char[] macro -// -// Create a temporary buffer for storing chars. -// If the actual size is > size then the buffer -// is allocated from the heap, otherwise the buffer -// is a stack variable. REMEMBER: use NS_FREE_BUF -// when finished with the buffer allocated, and do -// NOT nest INSERT_BUF'S. - -#define NS_ALLOC_CHAR_BUF(aBuf, aSize, aActualSize) \ - char *aBuf; \ - int _ns_smallBufUsed = 0; \ - static const int _ns_kSmallBufferSize = aSize; \ - if (aActualSize < _ns_kSmallBufferSize) { \ - char _ns_smallBuffer[_ns_kSmallBufferSize]; \ - aBuf = _ns_smallBuffer; \ - _ns_smallBufUsed = 1; \ - } \ - else { \ - aBuf = new char[aActualSize]; \ - } - -#define NS_FREE_CHAR_BUF(aBuf) \ -if (! _ns_smallBufUsed) \ - delete aBuf; - - -#endif // NSStringUtil \ No newline at end of file diff --git a/mozilla/widget/src/windows/nsSwitchToUIThread.h b/mozilla/widget/src/windows/nsSwitchToUIThread.h deleted file mode 100644 index 72be369c44c..00000000000 --- a/mozilla/widget/src/windows/nsSwitchToUIThread.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef SWITCHTOUITHREAD_H -#define SWITCHTOUITHREAD_H - - -// foreward declaration -struct MethodInfo; - -/** - * Switch thread to match the thread the widget was created in so messages will be dispatched. - */ - -class nsSwitchToUIThread { - -public: - virtual BOOL CallMethod(MethodInfo *info) = 0; - -}; - -// -// Structure used for passing the information necessary for synchronously -// invoking a method on the GUI thread... -// -struct MethodInfo { - nsSwitchToUIThread* target; - UINT methodId; - int nArgs; - DWORD* args; - - MethodInfo(nsSwitchToUIThread *obj, UINT id, int numArgs=0, DWORD *arguments = 0) { - target = obj; - methodId = id; - nArgs = numArgs; - args = arguments; - } - - BOOL Invoke() { return target->CallMethod(this); } -}; - -#endif // TOUITHRD_H - diff --git a/mozilla/widget/src/windows/nsTabWidget.cpp b/mozilla/widget/src/windows/nsTabWidget.cpp deleted file mode 100644 index 8e660c18c69..00000000000 --- a/mozilla/widget/src/windows/nsTabWidget.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsTabWidget.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" -#include -#include - -//------------------------------------------------------------------------- -// -// nsTabWidget constructor -// -//------------------------------------------------------------------------- -nsTabWidget::nsTabWidget(nsISupports *aOuter) : nsWindow(aOuter) -{ - // Ensure that common controls dll is loaded - InitCommonControls(); -} - -//------------------------------------------------------------------------- -// -// nsTabWidget destructor -// -//------------------------------------------------------------------------- -nsTabWidget::~nsTabWidget() -{ -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsTabWidget::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsTabWidgetIID, NS_ITABWIDGET_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsTabWidgetIID)) { - *aInstancePtr = (void*) ((nsITabWidget*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// Set the tab labels -// -//------------------------------------------------------------------------- - -void nsTabWidget::SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[]) -{ - TC_ITEM tie; - char labelTemp[256]; - - for (PRUint32 i = 0; i < aNumberOfTabs; i++) { - tie.mask = TCIF_TEXT; - aTabLabels[i].ToCString(labelTemp, 256); - tie.pszText = labelTemp; - TabCtrl_InsertItem(mWnd, i, &tie); - } -} - -//------------------------------------------------------------------------- -// -// Get the currently selected tab -// -//------------------------------------------------------------------------- - - -PRUint32 nsTabWidget::GetSelectedTab() -{ - return(TabCtrl_GetCurSel(mWnd)); -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsTabWidget::OnPaint() -{ - return PR_FALSE; -} - -PRBool nsTabWidget::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- - -LPCTSTR nsTabWidget::WindowClass() -{ - return WC_TABCONTROL; -} - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsTabWidget::WindowStyle() -{ - return WS_CHILD | WS_CLIPSIBLINGS; -} - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- -DWORD nsTabWidget::WindowExStyle() -{ - return 0; -} - diff --git a/mozilla/widget/src/windows/nsTabWidget.h b/mozilla/widget/src/windows/nsTabWidget.h deleted file mode 100644 index fd8c6199c82..00000000000 --- a/mozilla/widget/src/windows/nsTabWidget.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsTabWidget_h__ -#define nsTabWidget_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" - -#include "nsITabWidget.h" - -/** - * Native Win32 tab control wrapper - */ - -class nsTabWidget : public nsWindow, - public nsITabWidget -{ - -public: - nsTabWidget(nsISupports *aOuter); - virtual ~nsTabWidget(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsITabWidget part - virtual void SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[]); - virtual PRUint32 GetSelectedTab(); - virtual PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - -protected: - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -}; - -#endif // nsTabWidget_h__ diff --git a/mozilla/widget/src/windows/nsTextAreaWidget.cpp b/mozilla/widget/src/windows/nsTextAreaWidget.cpp deleted file mode 100644 index 1b3b11bb798..00000000000 --- a/mozilla/widget/src/windows/nsTextAreaWidget.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsTextAreaWidget.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include - -void nsTextAreaWidget::SelectAll() -{ - nsTextHelper::SelectAll(); -} - -void nsTextAreaWidget::SetMaxTextLength(PRUint32 aChars) -{ - nsTextHelper::SetMaxTextLength(aChars); -} - -PRUint32 nsTextAreaWidget::GetText(nsString& aTextBuffer, PRUint32 aBufferSize) -{ - return(nsTextHelper::GetText(aTextBuffer, aBufferSize)); -} - -PRUint32 nsTextAreaWidget::SetText(const nsString &aText) -{ - return(nsTextHelper::SetText(aText)); -} - -PRUint32 nsTextAreaWidget::InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos) -{ - return(nsTextHelper::InsertText(aText, aStartPos, aEndPos)); -} - -void nsTextAreaWidget::RemoveText() -{ - nsTextHelper::RemoveText(); -} - -void nsTextAreaWidget::SetPassword(PRBool aIsPassword) -{ - nsTextHelper::SetPassword(aIsPassword); -} - -PRBool nsTextAreaWidget::SetReadOnly(PRBool aReadOnlyFlag) -{ - return(nsTextHelper::SetReadOnly(aReadOnlyFlag)); -} - -void nsTextAreaWidget::SetSelection(PRUint32 aStartSel, PRUint32 aEndSel) -{ -} - -void nsTextAreaWidget::GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel) -{ -} - -void nsTextAreaWidget::SetCaretPosition(PRUint32 aPosition) -{ -} - -PRUint32 nsTextAreaWidget::GetCaretPosition() -{ - return(0); -} - -//------------------------------------------------------------------------- -// -// nsTextAreaWidget constructor -// -//------------------------------------------------------------------------- -nsTextAreaWidget::nsTextAreaWidget(nsISupports *aOuter) : nsTextHelper(aOuter) -{ - nsTextHelper::mBackground = NS_RGB(124, 124, 124); -} - -//------------------------------------------------------------------------- -// -// nsTextAreaWidget destructor -// -//------------------------------------------------------------------------- -nsTextAreaWidget::~nsTextAreaWidget() -{ -} - - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsTextAreaWidget::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsTextAreaWidgetIID, NS_ITEXTAREAWIDGET_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsTextAreaWidgetIID)) { - *aInstancePtr = (void*) ((nsITextAreaWidget*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsTextAreaWidget::OnPaint() -{ - return PR_FALSE; -} - -PRBool nsTextAreaWidget::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsTextAreaWidget::WindowClass() -{ - return(nsTextHelper::WindowClass()); -} - - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsTextAreaWidget::WindowStyle() -{ - DWORD style = nsTextHelper::WindowStyle(); - //style = style | ES_MULTILINE | ES_WANTRETURN | ES_AUTOVSCROLL; - style = style | ES_MULTILINE | ES_WANTRETURN | WS_HSCROLL | WS_VSCROLL; - return style; -} - - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- - -DWORD nsTextAreaWidget::WindowExStyle() -{ - return WS_EX_CLIENTEDGE; -} - - - diff --git a/mozilla/widget/src/windows/nsTextAreaWidget.h b/mozilla/widget/src/windows/nsTextAreaWidget.h deleted file mode 100644 index c76d263d9c1..00000000000 --- a/mozilla/widget/src/windows/nsTextAreaWidget.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsTextAreaWidget_h__ -#define nsTextAreaWidget_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" -#include "nsTextHelper.h" - -#include "nsITextAreaWidget.h" - -/** - * Native WIN32 multi-line edit control wrapper. - */ - -class nsTextAreaWidget : public nsTextHelper, - public nsITextAreaWidget -{ - -public: - nsTextAreaWidget(nsISupports *aOuter); - virtual ~nsTextAreaWidget(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - - // nsIWidget interface - BASE_IWIDGET_IMPL - - // nsITextWidget part - virtual void SelectAll(); - virtual void SetMaxTextLength(PRUint32 aChars); - virtual PRUint32 SetText(const nsString &aText); - virtual PRUint32 GetText(nsString& aTextBuffer, PRUint32 aBufferSize); - virtual PRUint32 InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos); - virtual void RemoveText(); - virtual void SetPassword(PRBool aIsPassword); - virtual PRBool SetReadOnly(PRBool aReadOnlyFlag); - virtual void SetSelection(PRUint32 aStartSel, PRUint32 aEndSel); - virtual void GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel); - virtual void SetCaretPosition(PRUint32 aPosition); - virtual PRUint32 GetCaretPosition(); - -protected: - - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - -}; - -#endif // nsTextAreaWidget_h__ diff --git a/mozilla/widget/src/windows/nsTextHelper.cpp b/mozilla/widget/src/windows/nsTextHelper.cpp deleted file mode 100644 index 0521e463993..00000000000 --- a/mozilla/widget/src/windows/nsTextHelper.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsTextHelper.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include "nsStringUtil.h" -#include - - -void nsTextHelper::PreCreateWidget(void *aInitData) -{ - if (nsnull != aInitData) { - nsWidgetInitData* data = (nsWidgetInitData *) aInitData; - mIsPassword = (0 == data->arg1) ? PR_FALSE : PR_TRUE; - } -} - -void nsTextHelper::SetMaxTextLength(PRUint32 aChars) -{ - ::SendMessage(mWnd, EM_SETLIMITTEXT, (WPARAM) (INT)aChars, 0); -} - -PRUint32 nsTextHelper::GetText(nsString& aTextBuffer, PRUint32 aBufferSize) { - - int length = GetWindowTextLength(mWnd); - int bufLength = length + 1; - NS_ALLOC_CHAR_BUF(buf, 512, bufLength); - int charsCopied = GetWindowText(mWnd, buf, bufLength); - aTextBuffer.SetLength(0); - aTextBuffer.Append(buf); - NS_FREE_CHAR_BUF(buf); - - return(0); -} - -PRUint32 nsTextHelper::SetText(const nsString &aText) -{ - NS_ALLOC_STR_BUF(buf, aText, 512); - SetWindowText(mWnd, buf); - NS_FREE_STR_BUF(buf); - return(aText.Length()); -} - -PRUint32 nsTextHelper::InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos) -{ - // NOT IMPLEMENTED - return(0); -} - -void nsTextHelper::RemoveText() -{ - SetWindowText(mWnd, ""); -} - -void nsTextHelper::SetPassword(PRBool aIsPassword) -{ - mIsPassword = aIsPassword; -} - -PRBool nsTextHelper::SetReadOnly(PRBool aReadOnlyFlag) -{ - PRBool oldSetting = mIsReadOnly; - mIsReadOnly = aReadOnlyFlag; - return(oldSetting); -} - - -void nsTextHelper::SelectAll() -{ - ::SendMessage(mWnd, EM_SETSEL, (WPARAM) 0, (LPARAM)-1); -} - - -void nsTextHelper::SetSelection(PRUint32 aStartSel, PRUint32 aEndSel) -{ - ::SendMessage(mWnd, EM_SETSEL, (WPARAM) (INT)aStartSel, (INT) (LPDWORD)aEndSel); -} - - -void nsTextHelper::GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel) -{ - ::SendMessage(mWnd, EM_GETSEL, (WPARAM) (LPDWORD)aStartSel, (LPARAM) (LPDWORD)aEndSel); -} - -void nsTextHelper::SetCaretPosition(PRUint32 aPosition) -{ -} - -PRUint32 nsTextHelper::GetCaretPosition() -{ - return(0); -} - -//------------------------------------------------------------------------- -// -// nsTextHelper constructor -// -//------------------------------------------------------------------------- - -nsTextHelper::nsTextHelper(nsISupports *aOuter) : nsWindow(aOuter) -{ - mIsReadOnly = PR_FALSE; - mIsPassword = PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// nsTextHelper destructor -// -//------------------------------------------------------------------------- -nsTextHelper::~nsTextHelper() -{ -} - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsTextHelper::WindowClass() -{ - return("EDIT"); -} - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsTextHelper::WindowStyle() -{ - DWORD style = ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | ES_NOHIDESEL; - if (mIsPassword) - style = style | ES_PASSWORD; - - if (mIsReadOnly) - style = style | ES_READONLY; - - return style; -} - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- - -DWORD nsTextHelper::WindowExStyle() -{ - return 0; -} - -//------------------------------------------------------------------------- -// -// Clear window before paint -// -//------------------------------------------------------------------------- - -PRBool nsTextHelper::AutoErase() -{ - return(PR_TRUE); -} - - diff --git a/mozilla/widget/src/windows/nsTextHelper.h b/mozilla/widget/src/windows/nsTextHelper.h deleted file mode 100644 index 6c5c687afeb..00000000000 --- a/mozilla/widget/src/windows/nsTextHelper.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsTextHelper_h__ -#define nsTextHelper_h__ - -#include "nsdefs.h" -#include "nsITextWidget.h" -#include "nsWindow.h" - -/** - * Base class for nsTextAreaWidget and nsTextWidget - */ - -class nsTextHelper : public nsWindow, public nsITextWidget -{ - -public: - nsTextHelper(nsISupports *aOuter); - virtual ~nsTextHelper(); - - virtual void SelectAll(); - virtual void SetMaxTextLength(PRUint32 aChars); - virtual PRUint32 GetText(nsString& aTextBuffer, PRUint32 aBufferSize); - virtual PRUint32 SetText(const nsString &aText); - virtual PRUint32 InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos); - virtual void RemoveText(); - virtual void SetPassword(PRBool aIsPassword); - virtual PRBool SetReadOnly(PRBool aReadOnlyFlag); - virtual void SetSelection(PRUint32 aStartSel, PRUint32 aEndSel); - virtual void GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel); - virtual void SetCaretPosition(PRUint32 aPosition); - virtual PRUint32 GetCaretPosition(); - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual void PreCreateWidget(void *aInitData); - virtual PRBool AutoErase(); - -protected: - - PRBool mIsPassword; - PRBool mIsReadOnly; - - virtual DWORD WindowExStyle(); - -}; - -#endif // nsTextHelper_h__ diff --git a/mozilla/widget/src/windows/nsTextWidget.cpp b/mozilla/widget/src/windows/nsTextWidget.cpp deleted file mode 100644 index 00565e326a9..00000000000 --- a/mozilla/widget/src/windows/nsTextWidget.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsTextWidget.h" -#include "nsToolkit.h" -#include "nsColor.h" -#include "nsGUIEvent.h" -#include "nsString.h" -#include - - -//------------------------------------------------------------------------- -// -// nsTextWidget constructor -// -//------------------------------------------------------------------------- -nsTextWidget::nsTextWidget(nsISupports *aOuter) : nsTextHelper(aOuter) -{ - mBackground = NS_RGB(124, 124, 124); -} - -//------------------------------------------------------------------------- -// -// nsTextWidget destructor -// -//------------------------------------------------------------------------- -nsTextWidget::~nsTextWidget() -{ -} - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsTextWidget::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsWindow::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kInsTextWidgetIID, NS_ITEXTWIDGET_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kInsTextWidgetIID)) { - *aInstancePtr = (void*) ((nsITextWidget*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - -//------------------------------------------------------------------------- -// -// paint message. Don't send the paint out -// -//------------------------------------------------------------------------- -PRBool nsTextWidget::OnPaint() -{ - return PR_FALSE; -} - - -PRBool nsTextWidget::OnResize(nsRect &aWindowRect) -{ - return PR_FALSE; -} - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsTextWidget::WindowClass() -{ - return(nsTextHelper::WindowClass()); -} - -//------------------------------------------------------------------------- -// -// return window styles -// -//------------------------------------------------------------------------- -DWORD nsTextWidget::WindowStyle() -{ - return(nsTextHelper::WindowStyle()); -} - - -//------------------------------------------------------------------------- -// -// return window extended styles -// -//------------------------------------------------------------------------- - -DWORD nsTextWidget::WindowExStyle() -{ - return WS_EX_CLIENTEDGE; -} - - diff --git a/mozilla/widget/src/windows/nsTextWidget.h b/mozilla/widget/src/windows/nsTextWidget.h deleted file mode 100644 index 6e9218fe0fa..00000000000 --- a/mozilla/widget/src/windows/nsTextWidget.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef nsTextWidget_h__ -#define nsTextWidget_h__ - -#include "nsdefs.h" -#include "nsWindow.h" -#include "nsSwitchToUIThread.h" -#include "nsTextHelper.h" - -#include "nsITextWidget.h" - -/** - * Native WIN32 single line edit control wrapper. - */ - -class nsTextWidget : public nsTextHelper -{ - -public: - nsTextWidget(nsISupports *aOuter); - virtual ~nsTextWidget(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - PRBool nsTextWidget::OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - - // nsIWidget interface - BASE_IWIDGET_IMPL - -protected: - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); -}; - -#endif // nsTextWidget_h__ diff --git a/mozilla/widget/src/windows/nsToolkit.cpp b/mozilla/widget/src/windows/nsToolkit.cpp deleted file mode 100644 index 84f05b94ead..00000000000 --- a/mozilla/widget/src/windows/nsToolkit.cpp +++ /dev/null @@ -1,359 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsToolkit.h" -#include "nsWindow.h" -#include "prmon.h" -#include "prtime.h" -#include "nsGUIEvent.h" - -HINSTANCE nsToolkit::mDllInstance = 0; - -nsWindow *MouseTrailer::mHoldMouse; -MouseTrailer *MouseTrailer::theMouseTrailer; - -// -// Dll entry point. Keep the dll instance -// -BOOL APIENTRY DllMain( HINSTANCE hModule, - DWORD reason, - LPVOID lpReserved ) -{ - switch( reason ) { - case DLL_PROCESS_ATTACH: - nsToolkit::mDllInstance = hModule; - - // - // register the internal window class - // - WNDCLASS wc; - - wc.style = CS_GLOBALCLASS; - wc.lpfnWndProc = nsToolkit::WindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = nsToolkit::mDllInstance; - wc.hIcon = NULL; - wc.hCursor = NULL; - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = "nsToolkitClass"; - - VERIFY(::RegisterClass(&wc)); - - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_THREAD_DETACH: - break; - - case DLL_PROCESS_DETACH: - //VERIFY(::UnregisterClass("nsToolkitClass", nsToolkit::mDllInstance)); - ::UnregisterClass("nsToolkitClass", nsToolkit::mDllInstance); - break; - - } - - return TRUE; -} - - -// -// main for the message pump thread -// -PRBool gThreadState = PR_FALSE; - -struct ThreadInitInfo { - PRMonitor *monitor; - nsToolkit *toolkit; -}; - -void RunPump(void* arg) -{ - ThreadInitInfo *info = (ThreadInitInfo*)arg; - ::PR_EnterMonitor(info->monitor); - - // do registration and creation in this thread - info->toolkit->CreateInternalWindow(PR_GetCurrentThread()); - - gThreadState = PR_TRUE; - - ::PR_Notify(info->monitor); - ::PR_ExitMonitor(info->monitor); - - delete info; - - // Process messages - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - -//------------------------------------------------------------------------- -// -// constructor -// -//------------------------------------------------------------------------- -nsToolkit::nsToolkit() -{ - mGuiThread = NULL; - mDispatchWnd = 0; - NS_INIT_REFCNT(); -} - - -//------------------------------------------------------------------------- -// -// destructor -// -//------------------------------------------------------------------------- -nsToolkit::~nsToolkit() -{ - NS_PRECONDITION(::IsWindow(mDispatchWnd), "Invalid window handle"); - - // Destroy the Dispatch Window - ::DestroyWindow(mDispatchWnd); - mDispatchWnd = NULL; -} - - -//------------------------------------------------------------------------- -// -// nsISupports implementation macro -// -//------------------------------------------------------------------------- -NS_IMPL_ISUPPORTS(nsToolkit, NS_ITOOLKIT_IID) - - -//------------------------------------------------------------------------- -// -// Register the window class for the internal window and create the window -// -//------------------------------------------------------------------------- -void nsToolkit::CreateInternalWindow(PRThread *aThread) -{ - - NS_PRECONDITION(aThread, "null thread"); - mGuiThread = aThread; - - // - // create the internal window - // - mDispatchWnd = ::CreateWindow("nsToolkitClass", - "NetscapeDispatchWnd", - WS_DISABLED, - -50, -50, - 10, 10, - NULL, - NULL, - nsToolkit::mDllInstance, - NULL); - VERIFY(mDispatchWnd); -} - - -//------------------------------------------------------------------------- -// -// Create a new thread and run the message pump in there -// -//------------------------------------------------------------------------- -void nsToolkit::CreateUIThread() -{ - PRMonitor *monitor = ::PR_NewMonitor(); - - ::PR_EnterMonitor(monitor); - - ThreadInitInfo *ti = new ThreadInitInfo(); - ti->monitor = monitor; - ti->toolkit = this; - - // create a gui thread - mGuiThread = ::PR_CreateThread(PR_SYSTEM_THREAD, - RunPump, - (void*)ti, - PR_PRIORITY_NORMAL, - PR_LOCAL_THREAD, - PR_UNJOINABLE_THREAD, - 0); - - // wait for the gui thread to start - while(gThreadState == PR_FALSE) { - ::PR_Wait(monitor, PR_INTERVAL_NO_TIMEOUT); - } - - // at this point the thread is running - ::PR_ExitMonitor(monitor); - ::PR_DestroyMonitor(monitor); -} - - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -void nsToolkit::Init(PRThread *aThread) -{ - // Store the thread ID of the thread containing the message pump. - // If no thread is provided create one - if (NULL != aThread) { - CreateInternalWindow(aThread); - } - else { - // create a thread where the message pump will run - CreateUIThread(); - } -} - - -//------------------------------------------------------------------------- -// -// nsToolkit WindowProc. Used to call methods on the "main GUI thread"... -// -//------------------------------------------------------------------------- -LRESULT CALLBACK nsToolkit::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, - LPARAM lParam) -{ - switch (msg) { - case WM_CALLMETHOD: - { - MethodInfo *info = (MethodInfo *)lParam; - return info->Invoke(); - } - } - - return ::DefWindowProc(hWnd, msg, wParam, lParam); -} - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -MouseTrailer * MouseTrailer::GetMouseTrailer(DWORD aThreadID) { - if (nsnull == MouseTrailer::theMouseTrailer) { - MouseTrailer::theMouseTrailer = new MouseTrailer(); - } - return MouseTrailer::theMouseTrailer; - -} - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -nsWindow * MouseTrailer::GetMouseTrailerWindow() { - return MouseTrailer::mHoldMouse; -} -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -void MouseTrailer::SetMouseTrailerWindow(nsWindow * aNSWin) { - MouseTrailer::mHoldMouse = aNSWin; -} - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -MouseTrailer::MouseTrailer() -{ - mTimerId = 0; - mHoldMouse = NULL; -} - - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -MouseTrailer::~MouseTrailer() -{ - DestroyTimer(); - if (mHoldMouse) { - NS_RELEASE(mHoldMouse); - } -} - - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -UINT MouseTrailer::CreateTimer() -{ - if (!mTimerId) { - mTimerId = ::SetTimer(NULL, 0, 200, (TIMERPROC)MouseTrailer::TimerProc); - } - - return mTimerId; -} - - -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -void MouseTrailer::DestroyTimer() -{ - if (mTimerId) { - ::KillTimer(NULL, mTimerId); - mTimerId = 0; - } - -} - -#define TIMER_DEBUG 1 -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- -void CALLBACK MouseTrailer::TimerProc(HWND hWnd, UINT msg, UINT event, DWORD time) -{ - if (MouseTrailer::mHoldMouse && ::IsWindow(MouseTrailer::mHoldMouse->GetWindowHandle())) { - - - POINT mp; - DWORD pos = ::GetMessagePos(); - mp.x = LOWORD(pos); - mp.y = HIWORD(pos); - - if (::WindowFromPoint(mp) != mHoldMouse->GetWindowHandle()) { - int64 time = PR_Now(); // time in milliseconds - ::ScreenToClient(mHoldMouse->GetWindowHandle(), &mp); - - //notify someone that a mouse exit happened - if (nsnull != MouseTrailer::mHoldMouse) { - MouseTrailer::mHoldMouse->DispatchMouseEvent(NS_MOUSE_EXIT); - } - - // we are out of this window and of any window, destroy timer - MouseTrailer::theMouseTrailer->DestroyTimer(); - MouseTrailer::mHoldMouse = NULL; - } - } else { - MouseTrailer::theMouseTrailer->DestroyTimer(); - MouseTrailer::mHoldMouse = NULL; - } - -} - - diff --git a/mozilla/widget/src/windows/nsToolkit.h b/mozilla/widget/src/windows/nsToolkit.h deleted file mode 100644 index 142ffaebab6..00000000000 --- a/mozilla/widget/src/windows/nsToolkit.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef TOOLKIT_H -#define TOOLKIT_H - -#include "nsdefs.h" -#include "nsIToolkit.h" - -struct MethodInfo; - -/** - * Wrapper around the thread running the message pump. - * The toolkit abstraction is necessary because the message pump must - * execute within the same thread that created the widget under Win32. - */ - -class nsToolkit : public nsIToolkit -{ - - public: - nsToolkit(); - - NS_DECL_ISUPPORTS - - virtual void Init(PRThread *aThread); - - - void CallMethod(MethodInfo *info); - - // Return whether the current thread is the application's Gui thread. - PRBool IsGuiThread(void) { return (PRBool)(mGuiThread == PR_GetCurrentThread());} - PRThread* GetGuiThread(void) { return mGuiThread; } - HWND GetDispatchWindow(void) { return mDispatchWnd; } - - void CreateInternalWindow(PRThread *aThread); - -private: - ~nsToolkit(); - - void CreateUIThread(void); - -public: - // Window procedure for the internal window - static LRESULT CALLBACK WindowProc(HWND hWnd, - UINT Msg, - WPARAM WParam, - LPARAM lParam); - -protected: - // Handle of the window used to receive dispatch messages. - HWND mDispatchWnd; - // Thread Id of the "main" Gui thread. - PRThread *mGuiThread; - -public: - static HINSTANCE mDllInstance; -}; - -#define WM_CALLMETHOD (WM_USER+1) - -inline void nsToolkit::CallMethod(MethodInfo *info) -{ - NS_PRECONDITION(::IsWindow(mDispatchWnd), "Invalid window handle"); - ::SendMessage(mDispatchWnd, WM_CALLMETHOD, (WPARAM)0, (LPARAM)info); -} - -class nsWindow; - -/** - * Makes sure exit/enter mouse messages are always dispatched. - * In the case where the mouse has exited the outer most window the - * only way to tell if it has exited is to set a timer and look at the - * mouse pointer to see if it is within the outer most window. - */ - -class MouseTrailer { - -public: - static MouseTrailer * GetMouseTrailer(DWORD aThreadID); - static nsWindow * GetMouseTrailerWindow(); - static void SetMouseTrailerWindow(nsWindow * aNSWin); - -private: - /// Global nsToolkit Instance - static MouseTrailer* theMouseTrailer; - -public: - ~MouseTrailer(); - - UINT CreateTimer(); - void DestroyTimer(); - -private: - /** - * Handle timer events - * @param hWnd handle to window - * @param msg Win32 message - * @param event Win32 event - * @param time time of the event - */ - static void CALLBACK TimerProc(HWND hWnd, - UINT msg, - UINT event, - DWORD time); - - MouseTrailer(); - -private: - /* global information for mouse enter/exit events - */ - //@{ - /// last window - static nsWindow* mHoldMouse; - /// timer ID - UINT mTimerId; - //@} - -}; - - -#endif // TOOLKIT_H diff --git a/mozilla/widget/src/windows/nsWidgetFactory.cpp b/mozilla/widget/src/windows/nsWidgetFactory.cpp deleted file mode 100644 index c47fedb7dcd..00000000000 --- a/mozilla/widget/src/windows/nsWidgetFactory.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsIFactory.h" -#include "nsISupports.h" -#include "nsdefs.h" -#include "nsWidgetsCID.h" - -#include "nsButton.h" -#include "nsCheckButton.h" -#include "nsComboBox.h" -#include "nsFileWidget.h" -#include "nsListBox.h" -#include "nsRadioButton.h" -#include "nsRadioGroup.h" -#include "nsScrollbar.h" -#include "nsTextAreaWidget.h" -#include "nsTextHelper.h" -#include "nsTextWidget.h" -#include "nsToolkit.h" -#include "nsTabWidget.h" -#include "nsWindow.h" - -static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); -static NS_DEFINE_IID(kCChild, NS_CHILD_CID); -static NS_DEFINE_IID(kCButton, NS_BUTTON_CID); -static NS_DEFINE_IID(kCCheckButton, NS_CHECKBUTTON_CID); -static NS_DEFINE_IID(kCCombobox, NS_COMBOBOX_CID); -static NS_DEFINE_IID(kCFileOpen, NS_FILEWIDGET_CID); -static NS_DEFINE_IID(kCListbox, NS_LISTBOX_CID); -static NS_DEFINE_IID(kCRadioButton, NS_RADIOBUTTON_CID); -static NS_DEFINE_IID(kCRadioGroup, NS_RADIOGROUP_CID); -static NS_DEFINE_IID(kCHorzScrollbar, NS_HORZSCROLLBAR_CID); -static NS_DEFINE_IID(kCVertScrollbar, NS_VERTSCROLLBAR_CID); -static NS_DEFINE_IID(kCTextArea, NS_TEXTAREA_CID); -static NS_DEFINE_IID(kCTextField, NS_TEXTFIELD_CID); -static NS_DEFINE_IID(kCTabWidget, NS_TABWIDGET_CID); - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); - -class nsWidgetFactory : public nsIFactory -{ -public: - // nsISupports methods - NS_IMETHOD QueryInterface(const nsIID &aIID, - void **aResult); - NS_IMETHOD_(nsrefcnt) AddRef(void); - NS_IMETHOD_(nsrefcnt) Release(void); - - // nsIFactory methods - NS_IMETHOD CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult); - - NS_IMETHOD LockFactory(PRBool aLock); - - nsWidgetFactory(const nsCID &aClass); - ~nsWidgetFactory(); - -private: - nsrefcnt mRefCnt; - nsCID mClassID; -}; - - - -nsWidgetFactory::nsWidgetFactory(const nsCID &aClass) -{ - mRefCnt = 0; - mClassID = aClass; -} - -nsWidgetFactory::~nsWidgetFactory() -{ - NS_ASSERTION(mRefCnt == 0, "Reference count not zero in destructor"); -} - -nsresult nsWidgetFactory::QueryInterface(const nsIID &aIID, - void **aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - // Always NULL result, in case of failure - *aResult = NULL; - - if (aIID.Equals(kISupportsIID)) { - *aResult = (void *)(nsISupports*)this; - } else if (aIID.Equals(kIFactoryIID)) { - *aResult = (void *)(nsIFactory*)this; - } - - if (*aResult == NULL) { - return NS_NOINTERFACE; - } - - AddRef(); // Increase reference count for caller - return NS_OK; -} - -nsrefcnt nsWidgetFactory::AddRef() -{ - return ++mRefCnt; -} - -nsrefcnt nsWidgetFactory::Release() -{ - if (--mRefCnt == 0) { - delete this; - return 0; // Don't access mRefCnt after deleting! - } - return mRefCnt; -} - -nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) -{ - if (aResult == NULL) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = NULL; - - if (nsnull != aOuter && !aIID.Equals(kISupportsIID)) { - // aggregation with IID != nsISupports - return NS_ERROR_ILLEGAL_VALUE; - } - - nsObject *inst = nsnull; - if (mClassID.Equals(kCWindow)) { - inst = (nsObject*)new nsWindow(aOuter); - } - else if (mClassID.Equals(kCChild)) { - inst = (nsObject*)new ChildWindow(aOuter); - } - else if (mClassID.Equals(kCButton)) { - inst = (nsObject*)new nsButton(aOuter); - } - else if (mClassID.Equals(kCCheckButton)) { - inst = (nsObject*)new nsCheckButton(aOuter); - } - else if (mClassID.Equals(kCCombobox)) { - inst = (nsObject*)new nsComboBox(aOuter); - } - else if (mClassID.Equals(kCRadioButton)) { - inst = (nsObject*)new nsRadioButton(aOuter); - } - else if (mClassID.Equals(kCRadioGroup)) { - inst = (nsObject*)new nsRadioGroup(aOuter); - } - else if (mClassID.Equals(kCFileOpen)) { - inst = (nsObject*)new nsFileWidget(aOuter); - } - else if (mClassID.Equals(kCListbox)) { - inst = (nsObject*)new nsListBox(aOuter); - } - else if (mClassID.Equals(kCHorzScrollbar)) { - inst = (nsObject*)new nsScrollbar(aOuter, PR_FALSE); - } - else if (mClassID.Equals(kCVertScrollbar)) { - inst = (nsObject*)new nsScrollbar(aOuter, PR_TRUE); - } - else if (mClassID.Equals(kCTextArea)) { - inst = (nsObject*)new nsTextAreaWidget(aOuter); - } - else if (mClassID.Equals(kCTextField)) { - inst = (nsObject*)new nsTextWidget(aOuter); - } - else if (mClassID.Equals(kCTabWidget)) { - inst = (nsObject*)new nsTabWidget(aOuter); - } - - if (inst == NULL) { - return NS_ERROR_OUT_OF_MEMORY; - } - - nsresult res = inst->QueryObject(aIID, aResult); - - if (res != NS_OK) { - // We didn't get the right interface, so clean up - delete inst; - } - else { - NS_RELEASE(inst); - } - - return res; -} - -nsresult nsWidgetFactory::LockFactory(PRBool aLock) -{ - // Not implemented in simplest case. - return NS_OK; -} - -// return the proper factory to the caller -extern "C" NS_WIDGET nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -{ - if (nsnull == aFactory) { - return NS_ERROR_NULL_POINTER; - } - - *aFactory = new nsWidgetFactory(aClass); - - if (nsnull == aFactory) { - return NS_ERROR_OUT_OF_MEMORY; - } - - return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory); -} - - diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp deleted file mode 100644 index fc6e39a613b..00000000000 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ /dev/null @@ -1,1701 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include "nsWindow.h" -#include "nsIFontMetrics.h" -#include "nsIFontCache.h" -#include "nsGUIEvent.h" -#include "nsIRenderingContext.h" -#include "nsIDeviceContext.h" -#include "nsRect.h" -#include "nsTransform2D.h" -#include "nsStringUtil.h" -#include -#include "nsGfxCIID.h" -#include "resource.h" -#include - -#include "prtime.h" - -BOOL nsWindow::sIsRegistered = FALSE; - -nsWindow * mCurrentWindow = NULL; - -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); - - -//------------------------------------------------------------------------- -// -// Convert nsEventStatus value to a windows boolean -// -//------------------------------------------------------------------------- - -PRBool nsWindow::ConvertStatus(nsEventStatus aStatus) -{ - switch(aStatus) { - case nsEventStatus_eIgnore: - return(PR_FALSE); - break; - case nsEventStatus_eConsumeNoDefault: - return(PR_TRUE); - break; - case nsEventStatus_eConsumeDoDefault: - return(PR_FALSE); - break; - default: - NS_ASSERTION(0, "Illegal nsEventStatus enumeration value"); - return(PR_FALSE); - break; - } -} - -//------------------------------------------------------------------------- -// -// Initialize an event to dispatch -// -//------------------------------------------------------------------------- - -void nsWindow::InitEvent(nsGUIEvent& event, PRUint32 aEventType) -{ - event.widget = this; - - // get the message position in client coordinates and in twips - DWORD pos = ::GetMessagePos(); - POINT cpos; - - cpos.x = LOWORD(pos); - cpos.y = HIWORD(pos); - - ::ScreenToClient(mWnd, &cpos); - - event.point.x = cpos.x; - event.point.y = cpos.y; - - event.time = ::GetMessageTime(); - event.message = aEventType; -} - -//------------------------------------------------------------------------- -// -// Invokes callback and ProcessEvent method on Event Listener object -// -//------------------------------------------------------------------------- - -PRBool nsWindow::DispatchEvent(nsGUIEvent* event) -{ - PRBool result = PR_FALSE; - - if (nsnull != mEventCallback) { - result = ConvertStatus((*mEventCallback)(event)); - } - - // Dispatch to event listener if event was not consumed - if ((result != PR_TRUE) && (nsnull != mEventListener)) { - return ConvertStatus(mEventListener->ProcessEvent(*event)); - } - else { - return(result); - } -} - - -//------------------------------------------------------------------------- -// -// the nsWindow procedure for all nsWindows in this toolkit -// -//------------------------------------------------------------------------- -LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - // Get the window which caused the event and ask it to process the message - nsWindow *someWindow = (nsWindow*)::GetWindowLong(hWnd, GWL_USERDATA); - - - // Re-direct a tab change message destined for it's parent window to the - // the actual window which generated the event. - if (msg == WM_NOTIFY) { - LPNMHDR pnmh = (LPNMHDR) lParam; - if (pnmh->code == TCN_SELCHANGE) { - someWindow = (nsWindow*)::GetWindowLong(pnmh->hwndFrom, GWL_USERDATA); - } - } - - - if (nsnull != someWindow) { - LRESULT retValue; - if (PR_TRUE == someWindow->ProcessMessage(msg, wParam, lParam, &retValue)) { - return retValue; - } - } - - return ::CallWindowProc((FARPROC)someWindow->GetPrevWindowProc(), hWnd, msg, wParam, lParam); -} - - -//------------------------------------------------------------------------- -// -// nsWindow constructor -// -//------------------------------------------------------------------------- -nsWindow::nsWindow(nsISupports *aOuter) : nsObject(aOuter) -{ - mWnd = 0; - mPrevWndProc = NULL; - mChildren = NULL; - mEventCallback = NULL; - mToolkit = NULL; - mMouseListener = NULL; - mEventListener = NULL; - mBackground = ::GetSysColor(COLOR_WINDOW); - mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground)); - mForeground = ::GetSysColor(COLOR_WINDOWTEXT); - mPalette = NULL; - mCursor = eCursor_standard; - mBorderStyle = eBorderStyle_none; - mIsShiftDown = PR_FALSE; - mIsControlDown = PR_FALSE; - mIsAltDown = PR_FALSE; - mIsDestroying = PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// nsWindow destructor -// -//------------------------------------------------------------------------- -nsWindow::~nsWindow() -{ - mIsDestroying = PR_TRUE; - Destroy(); -} - - -//------------------------------------------------------------------------- -// -// Query interface implementation -// -//------------------------------------------------------------------------- -nsresult nsWindow::QueryObject(const nsIID& aIID, void** aInstancePtr) -{ - nsresult result = nsObject::QueryObject(aIID, aInstancePtr); - - static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); - if (result == NS_NOINTERFACE && aIID.Equals(kIWidgetIID)) { - *aInstancePtr = (void*) ((nsIWidget*)this); - AddRef(); - result = NS_OK; - } - - return result; -} - - -//------------------------------------------------------------------------- -// -// Create the proper widget -// -//------------------------------------------------------------------------- -void nsWindow::Create(nsIWidget *aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit, - void *aInitData) -{ - if (NULL == mToolkit) { - if (NULL != aToolkit) { - mToolkit = (nsToolkit*)aToolkit; - mToolkit->AddRef(); - } - else { - if (NULL != aParent) { - mToolkit = (nsToolkit*)(aParent->GetToolkit()); // the call AddRef's, we don't have to - } - // it's some top level window with no toolkit passed in. - // Create a default toolkit with the current thread - else { - mToolkit = new nsToolkit(); - mToolkit->AddRef(); - mToolkit->Init(PR_GetCurrentThread()); - } - } - - } - - // - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - if (!mToolkit->IsGuiThread()) { - DWORD args[5]; - args[0] = (DWORD)aParent; - args[1] = (DWORD)&aRect; - args[2] = (DWORD)aHandleEventFunction; - args[3] = (DWORD)aContext; - args[4] = (DWORD)aToolkit; - args[5] = (DWORD)aInitData; - MethodInfo info(this, nsWindow::CREATE, 6, args); - mToolkit->CallMethod(&info); - return; - } - - // save the event callback function - mEventCallback = aHandleEventFunction; - - // keep a reference to the toolkit object - if (aContext) { - mContext = aContext; - mContext->AddRef(); - } - else { - nsresult res; - - static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID); - - res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mContext); - - if (NS_OK == res) - mContext->Init(); - } - - if (nsnull != aInitData) { - PreCreateWidget(aInitData); - } - - mWnd = ::CreateWindowEx(WindowExStyle(), - WindowClass(), - "", - WindowStyle(), - aRect.x, - aRect.y, - aRect.width, - aRect.height, - (aParent) ? (HWND)aParent->GetNativeData(NS_NATIVE_WINDOW): - (HWND)NULL, - NULL, - nsToolkit::mDllInstance, - NULL); - - VERIFY(mWnd); - if (aParent) { - aParent->AddChild(this); - } - - // Force cursor to default setting - mCursor = eCursor_select; - SetCursor(eCursor_standard); - - // call the event callback to notify about creation - - nsGUIEvent event; - InitEvent(event, NS_CREATE); - DispatchEvent(&event); - SubclassWindow(TRUE); -} - - -//------------------------------------------------------------------------- -// -// create with a native parent -// -//------------------------------------------------------------------------- -void nsWindow::Create(nsNativeWindow aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit, - void *aInitData) -{ - - if (NULL == mToolkit) { - if (NULL != aToolkit) { - mToolkit = (nsToolkit*)aToolkit; - mToolkit->AddRef(); - } - else { - mToolkit = new nsToolkit(); - mToolkit->AddRef(); - mToolkit->Init(PR_GetCurrentThread()); - } - - } - - // - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - if (!mToolkit->IsGuiThread()) { - DWORD args[5]; - args[0] = (DWORD)aParent; - args[1] = (DWORD)&aRect; - args[2] = (DWORD)aHandleEventFunction; - args[3] = (DWORD)aContext; - args[4] = (DWORD)aToolkit; - args[5] = (DWORD)aInitData; - MethodInfo info(this, nsWindow::CREATE_NATIVE, 5, args); - mToolkit->CallMethod(&info); - return; - } - - // save the event callback function - mEventCallback = aHandleEventFunction; - - // keep a reference to the toolkit object - if (aContext) { - mContext = aContext; - mContext->AddRef(); - } - else { - nsresult res; - - static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID); - - res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&mContext); - - if (NS_OK == res) - mContext->Init(); - } - - if (nsnull != aInitData) { - PreCreateWidget(aInitData); - } - - mWnd = ::CreateWindowEx(WindowExStyle(), - WindowClass(), - "", - WindowStyle(), - aRect.x, - aRect.y, - aRect.width, - aRect.height, - aParent, - NULL, - nsToolkit::mDllInstance, - NULL); - - VERIFY(mWnd); - - // call the event callback to notify about creation - nsGUIEvent event; - InitEvent(event, NS_CREATE); - DispatchEvent(&event); - SubclassWindow(TRUE); -} - - -//------------------------------------------------------------------------- -// -// Close this nsWindow -// -//------------------------------------------------------------------------- -void nsWindow::Destroy() -{ - // - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - if (!mToolkit->IsGuiThread()) { - MethodInfo info(this, nsWindow::DESTROY); - mToolkit->CallMethod(&info); - return; - } - - // destroy the nsWindow - if (mWnd) { - // destroy the nsWindow - mEventCallback = nsnull; // prevent the widget from causing additional events - VERIFY(::DestroyWindow(mWnd)); - } - - if (mPalette) { - VERIFY(::DeleteObject(mPalette)); - } -} - - -//------------------------------------------------------------------------- -// -// Get this nsWindow parent -// -//------------------------------------------------------------------------- -nsIWidget* nsWindow::GetParent(void) -{ - nsIWidget* widget = NULL; - if (mWnd) { - HWND parent = ::GetParent(mWnd); - if (parent) { - nsIWidget* widget = (nsIWidget*)::GetWindowLong(mWnd, GWL_USERDATA); - widget->AddRef(); - } - } - - return widget; -} - - -//------------------------------------------------------------------------- -// -// Get this nsWindow's list of children -// -//------------------------------------------------------------------------- -nsIEnumerator* nsWindow::GetChildren() -{ - if (mChildren) { - mChildren->Reset(); - //mChildren->AddRef(); - - Enumerator * children = new Enumerator(); - nsISupports * next = mChildren->Next(); - if (next) { - nsIWidget *widget; - if (NS_OK == next->QueryInterface(kIWidgetIID, (void**)&widget)) { - children->Append(widget); - //NS_RELEASE(widget); - } - } - - return (nsIEnumerator*)children; - } - - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Add a child to the list of children -// -//------------------------------------------------------------------------- -void nsWindow::AddChild(nsIWidget* aChild) -{ - if (!mChildren) { - mChildren = new Enumerator(); - } - - mChildren->Append(aChild); -} - - -//------------------------------------------------------------------------- -// -// Remove a child from the list of children -// -//------------------------------------------------------------------------- -void nsWindow::RemoveChild(nsIWidget* aChild) -{ - if (mChildren) { - mChildren->Remove(aChild); - } -} - - -//------------------------------------------------------------------------- -// -// Hide or show this component -// -//------------------------------------------------------------------------- -void nsWindow::Show(PRBool bState) -{ - if (mWnd) { - if (bState) { - ::SetWindowPos(mWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW); - } - else - ::ShowWindow(mWnd, SW_HIDE); - } -} - -//------------------------------------------------------------------------- -// -// Move this component -// -//------------------------------------------------------------------------- -void nsWindow::Move(PRUint32 aX, PRUint32 aY) -{ - if (mWnd) { - VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, 0, 0, - SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE)); - } -} - -//------------------------------------------------------------------------- -// -// Resize this component -// -//------------------------------------------------------------------------- -void nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight) -{ - if (mWnd) { - VERIFY(::SetWindowPos(mWnd, NULL, 0, 0, aWidth, aHeight, - SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE)); - } -} - - -//------------------------------------------------------------------------- -// -// Resize this component -// -//------------------------------------------------------------------------- -void nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeight) -{ - if (mWnd) { - VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, aWidth, aHeight, - SWP_NOZORDER | SWP_NOACTIVATE)); - } -} - - -//------------------------------------------------------------------------- -// -// Enable/disable this component -// -//------------------------------------------------------------------------- -void nsWindow::Enable(PRBool bState) -{ - if (mWnd) { - ::EnableWindow(mWnd, bState); - } -} - - -//------------------------------------------------------------------------- -// -// Give the focus to this component -// -//------------------------------------------------------------------------- -void nsWindow::SetFocus(void) -{ - // - // Switch to the "main gui thread" if necessary... This method must - // be executed on the "gui thread"... - // - if (!mToolkit->IsGuiThread()) { - MethodInfo info(this, nsWindow::SET_FOCUS); - mToolkit->CallMethod(&info); - return; - } - - if (mWnd) { - ::SetFocus(mWnd); - } -} - - -//------------------------------------------------------------------------- -// -// Get this component dimension -// -//------------------------------------------------------------------------- -void nsWindow::GetBounds(nsRect &aRect) -{ - if (mWnd) { - RECT r; - VERIFY(::GetWindowRect(mWnd, &r)); - - // assign size - aRect.width = r.right - r.left; - aRect.height = r.bottom - r.top; - - // convert coordinates if parent exists - HWND parent = ::GetParent(mWnd); - if (parent) { - ::ScreenToClient(parent, (LPPOINT)&r); - } - aRect.x = r.left; - aRect.y = r.top; - } -} - - -//------------------------------------------------------------------------- -// -// Get the foreground color -// -//------------------------------------------------------------------------- -nscolor nsWindow::GetForegroundColor(void) -{ - return mForeground; -} - - -//------------------------------------------------------------------------- -// -// Set the foreground color -// -//------------------------------------------------------------------------- -void nsWindow::SetForegroundColor(const nscolor &aColor) -{ - mForeground = aColor; -} - - -//------------------------------------------------------------------------- -// -// Get the background color -// -//------------------------------------------------------------------------- -nscolor nsWindow::GetBackgroundColor(void) -{ - return mBackground; -} - - -//------------------------------------------------------------------------- -// -// Set the background color -// -//------------------------------------------------------------------------- -void nsWindow::SetBackgroundColor(const nscolor &aColor) -{ - mBackground = aColor; - - ::DeleteObject(mBrush); - mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground)); - SetClassLong(mWnd, GCL_HBRBACKGROUND, (LONG)mBrush); -} - - -//------------------------------------------------------------------------- -// -// Get this component font -// -//------------------------------------------------------------------------- -nsIFontMetrics* nsWindow::GetFont(void) -{ - NS_NOTYETIMPLEMENTED("GetFont not yet implemented"); // to be implemented - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Set this component font -// -//------------------------------------------------------------------------- -void nsWindow::SetFont(const nsFont &aFont) -{ - nsIFontCache* fontCache = mContext->GetFontCache(); - nsIFontMetrics* metrics = fontCache->GetMetricsFor(aFont); - HFONT hfont = metrics->GetFontHandle(); - - // Draw in the new font - ::SendMessage(mWnd, WM_SETFONT, (WPARAM)hfont, (LPARAM)0); - NS_RELEASE(metrics); - NS_RELEASE(fontCache); -} - - -//------------------------------------------------------------------------- -// -// Get this component cursor -// -//------------------------------------------------------------------------- -nsCursor nsWindow::GetCursor() -{ - return mCursor; -} - - -//------------------------------------------------------------------------- -// -// Set this component cursor -// -//------------------------------------------------------------------------- - -#define DLLQUOTE(x) #x -#define DLLNAME(x) DLLQUOTE(x) - -void nsWindow::SetCursor(nsCursor aCursor) -{ - // Only change cursor if it's changing - if (aCursor != mCursor) { - HCURSOR newCursor = NULL; - - switch(aCursor) { - case eCursor_select: - newCursor = ::LoadCursor(NULL, IDC_IBEAM); - break; - - case eCursor_wait: - newCursor = ::LoadCursor(NULL, IDC_WAIT); - break; - - case eCursor_hyperlink: { - HMODULE hm = ::GetModuleHandle(DLLNAME(NS_DLLNAME)); - newCursor = ::LoadCursor(hm, MAKEINTRESOURCE(IDC_SELECTANCHOR)); - break; - } - - case eCursor_standard: - newCursor = ::LoadCursor(NULL, IDC_ARROW); - break; - - default: - NS_ASSERTION(0, "Invalid cursor type"); - break; - } - - if (NULL != newCursor) { - mCursor = aCursor; - HCURSOR oldCursor = ::SetCursor(newCursor); - } - } -} - -//------------------------------------------------------------------------- -// -// Invalidate this component visible area -// -//------------------------------------------------------------------------- -void nsWindow::Invalidate(PRBool aIsSynchronous) -{ - if (mWnd) { - VERIFY(::InvalidateRect(mWnd, NULL, TRUE)); - if (aIsSynchronous) { - VERIFY(::UpdateWindow(mWnd)); - } - } -} - - -//------------------------------------------------------------------------- -// -// Return some native data according to aDataType -// -//------------------------------------------------------------------------- -void* nsWindow::GetNativeData(PRUint32 aDataType) -{ - switch(aDataType) { - case NS_NATIVE_WINDOW: - return (void*)mWnd; - case NS_NATIVE_GRAPHIC: - return (void*)::GetDC(mWnd); - case NS_NATIVE_COLORMAP: - default: - break; - } - - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Create a rendering context from this nsWindow -// -//------------------------------------------------------------------------- -nsIRenderingContext* nsWindow::GetRenderingContext() -{ -nsRect bounds; - - nsIRenderingContext *renderingCtx = NULL; - if (mWnd) { - HDC aDC = ::GetDC(mWnd); - nsresult res; - - static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID); - - res = NSRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&renderingCtx); - - if (NS_OK == res) - renderingCtx->Init(mContext, (nsDrawingSurface)aDC); - - NS_ASSERTION(NULL != renderingCtx, "Null rendering context"); - } - - return renderingCtx; -} - -//------------------------------------------------------------------------- -// -// Return the toolkit this widget was created on -// -//------------------------------------------------------------------------- -nsIToolkit* nsWindow::GetToolkit() -{ - if (NULL != mToolkit) { - mToolkit->AddRef(); - } - - return mToolkit; -} - - -//------------------------------------------------------------------------- -// -// Set the colormap of the window -// -//------------------------------------------------------------------------- -void nsWindow::SetColorMap(nsColorMap *aColorMap) -{ - if (mPalette != NULL) { - ::DeleteObject(mPalette); - } - - PRUint8 *map = aColorMap->Index; - LPLOGPALETTE pLogPal = (LPLOGPALETTE) new char[2 * sizeof(WORD) + - aColorMap->NumColors * sizeof(PALETTEENTRY)]; - pLogPal->palVersion = 0x300; - pLogPal->palNumEntries = aColorMap->NumColors; - for(int i = 0; i < aColorMap->NumColors; i++) - { - pLogPal->palPalEntry[i].peRed = *map++; - pLogPal->palPalEntry[i].peGreen = *map++; - pLogPal->palPalEntry[i].peBlue = *map++; - pLogPal->palPalEntry[i].peFlags = 0; - } - mPalette = ::CreatePalette(pLogPal); - delete pLogPal; - - NS_ASSERTION(mPalette != NULL, "Null palette"); - if (mPalette != NULL) { - HDC hDC = ::GetDC(mWnd); - HPALETTE hOldPalette = ::SelectPalette(hDC, mPalette, TRUE); - ::RealizePalette(hDC); - ::SelectPalette(hDC, hOldPalette, TRUE); - ::ReleaseDC(mWnd, hDC); - } -} - -//------------------------------------------------------------------------- -// -// Return the used device context -// -//------------------------------------------------------------------------- -nsIDeviceContext* nsWindow::GetDeviceContext() -{ - if (mContext) { - mContext->AddRef(); - } - - return mContext; -} - - -//------------------------------------------------------------------------- -// -// Scroll the bits of a window -// -//------------------------------------------------------------------------- -void nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) -{ - RECT trect; - - if (nsnull != aClipRect) - { - trect.left = aClipRect->x; - trect.top = aClipRect->y; - trect.right = aClipRect->XMost(); - trect.bottom = aClipRect->YMost(); - } - - ::ScrollWindowEx(mWnd, aDx, aDy, (nsnull != aClipRect) ? &trect : NULL, NULL, - NULL, NULL, SW_INVALIDATE); - ::UpdateWindow(mWnd); -} - -//------------------------------------------------------------------------- -// -// Every function that needs a thread switch goes through this function -// by calling SendMessage (..WM_CALLMETHOD..) in nsToolkit::CallMethod. -// -//------------------------------------------------------------------------- -BOOL nsWindow::CallMethod(MethodInfo *info) -{ - BOOL bRet = TRUE; - - switch (info->methodId) { - case nsWindow::CREATE: - NS_ASSERTION(info->nArgs == 6, "Wrong number of arguments to CallMethod"); - Create((nsIWidget*)(info->args[0]), - (nsRect&)*(nsRect*)(info->args[1]), - (EVENT_CALLBACK)(info->args[2]), - (nsIDeviceContext*)(info->args[3]), - (nsIToolkit*)(info->args[4]), - (void*)(info->args[5])); - break; - - case nsWindow::CREATE_NATIVE: - NS_ASSERTION(info->nArgs == 6, "Wrong number of arguments to CallMethod"); - Create((nsNativeWindow)(info->args[0]), - (nsRect&)*(nsRect*)(info->args[1]), - (EVENT_CALLBACK)(info->args[2]), - (nsIDeviceContext*)(info->args[3]), - (nsIToolkit*)(info->args[4]), - (void*)(info->args[5])); - return TRUE; - - case nsWindow::DESTROY: - NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod"); - Destroy(); - break; - - case nsWindow::SET_FOCUS: - NS_ASSERTION(info->nArgs == 0, "Wrong number of arguments to CallMethod"); - SetFocus(); - break; - - default: - bRet = FALSE; - break; - } - - return bRet; -} - -//------------------------------------------------------------------------- -// -// OnKey -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnKey(PRUint32 aEventType, PRUint32 aKeyCode) -{ - nsKeyEvent event; - InitEvent(event, aEventType); - event.keyCode = aKeyCode; - event.isShift = mIsShiftDown; - event.isControl = mIsControlDown; - event.isAlt = mIsAltDown; - return(DispatchEvent(&event)); -} - - -//------------------------------------------------------------------------- -// -// Process all nsWindows messages -// -//------------------------------------------------------------------------- -PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue) -{ - PRBool result = PR_FALSE; // call the default nsWindow proc - - - *aRetValue = 0; - - switch (msg) { - - - case WM_NOTIFY: - // TAB change - { - LPNMHDR pnmh = (LPNMHDR) lParam; - - if (pnmh->code == TCN_SELCHANGE) { - nsGUIEvent event; - InitEvent(event, NS_TABCHANGE); - DispatchEvent(&event); - result = PR_TRUE; - } - } - break; - - case WM_MOVE: // Window moved - { - nsGUIEvent event; - InitEvent(event, NS_MOVE); - event.point.x = (int)LOWORD(lParam); // horizontal position in screen coordinates - event.point.y = (int)HIWORD(lParam); // vertical position in screen coordinates - result = DispatchEvent(&event); - } - break; - - case WM_DESTROY: - // clean up. - OnDestroy(); - result = PR_TRUE; - break; - - case WM_PAINT: - result = OnPaint(); - break; - - case WM_KEYUP: - if (wParam == NS_VK_SHIFT) { - mIsShiftDown = PR_FALSE; - } - if (wParam == NS_VK_CONTROL) { - mIsControlDown = PR_FALSE; - } - if (wParam == NS_VK_ALT) { - mIsAltDown = PR_FALSE; - } - result = OnKey(NS_KEY_UP, wParam); - break; - - case WM_KEYDOWN: - if (wParam == NS_VK_SHIFT) { - mIsShiftDown = PR_TRUE; - } - if (wParam == NS_VK_CONTROL) { - mIsControlDown = PR_TRUE; - } - if (wParam == NS_VK_ALT) { - mIsAltDown = PR_TRUE; - } - result = OnKey(NS_KEY_DOWN, wParam); - break; - - // say we've dealt with erase background if widget does - // not need auto-erasing - case WM_ERASEBKGND: - if (! AutoErase()) { - *aRetValue = 1; - result = PR_TRUE; - } - break; - - case WM_MOUSEMOVE: - result = DispatchMouseEvent(NS_MOUSE_MOVE); - break; - - case WM_LBUTTONDOWN: - result = DispatchMouseEvent(NS_MOUSE_LEFT_BUTTON_DOWN); - break; - - case WM_LBUTTONUP: - result = DispatchMouseEvent(NS_MOUSE_LEFT_BUTTON_UP); - break; - - case WM_LBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_LEFT_BUTTON_DOWN); - if (result == PR_FALSE) - result = DispatchMouseEvent(NS_MOUSE_LEFT_DOUBLECLICK); - break; - - case WM_MBUTTONDOWN: - result = DispatchMouseEvent(NS_MOUSE_MIDDLE_BUTTON_DOWN); - break; - - case WM_MBUTTONUP: - result = DispatchMouseEvent(NS_MOUSE_MIDDLE_BUTTON_UP); - break; - - case WM_MBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_MIDDLE_BUTTON_DOWN); - break; - - case WM_RBUTTONDOWN: - result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_DOWN); - break; - - case WM_RBUTTONUP: - result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_UP); - break; - - case WM_RBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_RIGHT_BUTTON_DOWN); - if (result == PR_FALSE) - result = DispatchMouseEvent(NS_MOUSE_RIGHT_DOUBLECLICK); - break; - - case WM_HSCROLL: - case WM_VSCROLL: - // check for the incoming nsWindow handle to be null in which case - // we assume the message is coming from a horizontal scrollbar inside - // a listbox and we don't bother processing it (well, we don't have to) - if (lParam) { - nsWindow* scrollbar = (nsWindow*)::GetWindowLong((HWND)lParam, GWL_USERDATA); - - if (scrollbar) { - result = scrollbar->OnScroll(LOWORD(wParam), (short)HIWORD(wParam)); - } - } - break; - - case WM_CTLCOLORBTN: - case WM_CTLCOLOREDIT: - case WM_CTLCOLORLISTBOX: - case WM_CTLCOLORSCROLLBAR: - case WM_CTLCOLORSTATIC: - if (lParam) { - nsWindow* control = (nsWindow*)::GetWindowLong((HWND)lParam, GWL_USERDATA); - if (control) { - HDC hDC = (HDC)wParam; - ::SetBkColor (hDC, mBackground); - ::SetTextColor(hDC, mForeground); - *aRetValue = (LPARAM)control->OnControlColor(); - } - } - - result = PR_TRUE; - break; - - case WM_SETFOCUS: - result = DispatchFocus(NS_GOTFOCUS); - break; - - case WM_KILLFOCUS: - result = DispatchFocus(NS_LOSTFOCUS); - break; - - case WM_WINDOWPOSCHANGED: - { - WINDOWPOS *wp = (LPWINDOWPOS)lParam; - nsRect rect(wp->x, wp->y, wp->cx, wp->cy); - result = OnResize(rect); - break; - } - case WM_QUERYNEWPALETTE: - if (mPalette) { - HDC hDC = ::GetDC(mWnd); - HPALETTE hOldPal = ::SelectPalette(hDC, mPalette, 0); - - int i = ::RealizePalette(hDC); - - ::SelectPalette(hDC, hOldPal, 0); - ::ReleaseDC(mWnd, hDC); - - if (i) { - ::InvalidateRect(mWnd, (LPRECT)(NULL), 1); - result = PR_TRUE; - } - else { - result = PR_FALSE; - } - } - else { - result = PR_FALSE; - } - break; - case WM_PALETTECHANGED: - if (mPalette && (HWND)wParam != mWnd) { - HDC hDC = ::GetDC(mWnd); - HPALETTE hOldPal = ::SelectPalette(hDC, mPalette, 0); - - int i = ::RealizePalette(hDC); - - if (i) { - ::InvalidateRect(mWnd, (LPRECT)(NULL), 1); - } - - ::SelectPalette(hDC, hOldPal, 0); - ::ReleaseDC(mWnd, hDC); - } - result = PR_TRUE; - break; - - } - - return result; -} - - - -//------------------------------------------------------------------------- -// -// return the window class name and initialize the class if needed -// -//------------------------------------------------------------------------- -LPCTSTR nsWindow::WindowClass() -{ - if (!nsWindow::sIsRegistered) { - WNDCLASS wc; - - wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - wc.lpfnWndProc = ::DefWindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = nsToolkit::mDllInstance; - wc.hIcon = ::LoadIcon(NULL, IDI_APPLICATION); - wc.hCursor = NULL; - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = "NetscapeWindowClass"; - - nsWindow::sIsRegistered = ::RegisterClass(&wc); - } - - return "NetscapeWindowClass"; -} - - -//------------------------------------------------------------------------- -// -// return nsWindow styles -// -//------------------------------------------------------------------------- -DWORD nsWindow::WindowStyle() -{ - return WS_OVERLAPPEDWINDOW; -} - - -//------------------------------------------------------------------------- -// -// return nsWindow extended styles -// -//------------------------------------------------------------------------- -DWORD nsWindow::WindowExStyle() -{ - return WS_EX_CLIENTEDGE; -} - - -// ----------------------------------------------------------------------- -// -// Subclass (or remove the subclass from) this component's nsWindow -// -// ----------------------------------------------------------------------- -void nsWindow::SubclassWindow(BOOL bState) -{ - NS_PRECONDITION(::IsWindow(mWnd), "Invalid window handle"); - - if (bState) { - // change the nsWindow proc - mPrevWndProc = (WNDPROC)::SetWindowLong(mWnd, GWL_WNDPROC, - (LONG)nsWindow::WindowProc); - NS_ASSERTION(mPrevWndProc, "Null standard window procedure"); - // connect the this pointer to the nsWindow handle - ::SetWindowLong(mWnd, GWL_USERDATA, (LONG)this); - } - else { - (void) ::SetWindowLong(mWnd, GWL_WNDPROC, (LONG)mPrevWndProc); - mPrevWndProc = NULL; - } -} - - -//------------------------------------------------------------------------- -// -// WM_DESTROY has been called -// -//------------------------------------------------------------------------- -void nsWindow::OnDestroy() -{ - SubclassWindow(FALSE); - - if (mBrush) - ::DeleteObject(mBrush); - - // disconnect from the parent - /* - nsIWidget *parent = GetParent(); - if (parent) { - parent->RemoveChild(this); - }*/ - - mWnd = 0; - - // release children (I don't think we need this but...) - if (mChildren) { - NS_RELEASE(mChildren); - mChildren = NULL; - } - - // get the pixels to twips info before the device context is released - if (mContext) { - NS_RELEASE(mContext); - mContext = 0; - } - - if (NULL != mToolkit) { - NS_RELEASE(mToolkit); - mToolkit = NULL; - } - - nsGUIEvent event; - InitEvent(event, NS_DESTROY); - DispatchEvent(&event); -} - - -//------------------------------------------------------------------------- -// -// Paint -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnPaint() -{ - nsRect bounds; - PRBool result = PR_TRUE; - PAINTSTRUCT ps; - HDC hDC = ::BeginPaint(mWnd, &ps); - - if (ps.rcPaint.left || ps.rcPaint.right || ps.rcPaint.top || ps.rcPaint.bottom) { - - // call the event callback - if (mEventCallback) { - nsPaintEvent event; - - InitEvent(event, NS_PAINT); - - nsRect rect(ps.rcPaint.left, - ps.rcPaint.top, - ps.rcPaint.right - ps.rcPaint.left, - ps.rcPaint.bottom - ps.rcPaint.top); - event.rect = ▭ - - static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID); - - if (NS_OK == NSRepository::CreateInstance(kRenderingContextCID, nsnull, kRenderingContextIID, (void **)&event.renderingContext)) - { - event.renderingContext->Init(mContext, (nsDrawingSurface)hDC); - result = DispatchEvent(&event); - NS_RELEASE(event.renderingContext); - } - else - result = PR_FALSE; - } - } - - ::EndPaint(mWnd, &ps); - - return result; -} - - -//------------------------------------------------------------------------- -// -// Send a resize message to the listener -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnResize(nsRect &aWindowRect) -{ - // call the event callback - if (mEventCallback) { - nsSizeEvent event; - InitEvent(event, NS_SIZE); - event.windowSize = &aWindowRect; - return(DispatchEvent(&event)); - } - - return PR_FALSE; -} - - - -//------------------------------------------------------------------------- -// -// Deal with all sort of mouse event -// -//------------------------------------------------------------------------- -PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType) -{ - PRBool result = PR_FALSE; - - if (nsnull == mEventCallback && nsnull == mMouseListener) { - return result; - } - - // nsMouseEvent event; - nsGUIEvent event; - InitEvent(event, aEventType); - - // call the event callback - if (nsnull != mEventCallback) { - - result = DispatchEvent(&event); - - //printf("**result=%d%\n",result); - if (aEventType == NS_MOUSE_MOVE) { - - MouseTrailer * mouseTrailer = MouseTrailer::GetMouseTrailer(0); - MouseTrailer::SetMouseTrailerWindow(this); - mouseTrailer->CreateTimer(); - - nsRect rect; - GetBounds(rect); - rect.x = 0; - rect.y = 0; - //printf("Rect[%d, %d, %d, %d] Point[%d,%d]\n", rect.x, rect.y, rect.width, rect.height, event.position.x, event.position.y); - //printf("mCurrentWindow 0x%X\n", mCurrentWindow); - - if (rect.Contains(event.point.x, event.point.y)) { - if (mCurrentWindow == NULL || mCurrentWindow != this) { - if ((nsnull != mCurrentWindow) && (!mCurrentWindow->mIsDestroying)) { - mCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT); - } - mCurrentWindow = this; - mCurrentWindow->DispatchMouseEvent(NS_MOUSE_ENTER); - } - } - } else if (aEventType == NS_MOUSE_EXIT) { - if (mCurrentWindow == this) { - mCurrentWindow = nsnull; - } - } - - return result; - } - - if (nsnull != mMouseListener) { - switch (aEventType) { - case NS_MOUSE_MOVE: { - result = ConvertStatus(mMouseListener->MouseMoved(event)); - nsRect rect; - GetBounds(rect); - if (rect.Contains(event.point.x, event.point.y)) { - if (mCurrentWindow == NULL || mCurrentWindow != this) { - printf("Mouse enter"); - mCurrentWindow = this; - } - } else { - printf("Mouse exit"); - } - - } break; - - case NS_MOUSE_LEFT_BUTTON_DOWN: - case NS_MOUSE_MIDDLE_BUTTON_DOWN: - case NS_MOUSE_RIGHT_BUTTON_DOWN: - result = ConvertStatus(mMouseListener->MousePressed(event)); - break; - - case NS_MOUSE_LEFT_BUTTON_UP: - case NS_MOUSE_MIDDLE_BUTTON_UP: - case NS_MOUSE_RIGHT_BUTTON_UP: - result = ConvertStatus(mMouseListener->MouseReleased(event)); - result = ConvertStatus(mMouseListener->MouseClicked(event)); - break; - } // switch - } - return result; -} - -//------------------------------------------------------------------------- -// -// Deal with focus messages -// -//------------------------------------------------------------------------- -PRBool nsWindow::DispatchFocus(PRUint32 aEventType) -{ - // call the event callback - if (mEventCallback) { - nsGUIEvent event; - InitEvent(event, aEventType); - return(DispatchEvent(&event)); - } - - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// Deal with scrollbar messages (actually implemented only in nsScrollbar) -// -//------------------------------------------------------------------------- -PRBool nsWindow::OnScroll(UINT scrollCode, int cPos) -{ - return PR_FALSE; -} - - -//------------------------------------------------------------------------- -// -// Return the brush used to paint the background of this control -// -//------------------------------------------------------------------------- -HBRUSH nsWindow::OnControlColor() -{ - return mBrush; -} - - -//------------------------------------------------------------------------- -// -// Constructor -// -//------------------------------------------------------------------------- -#define INITIAL_SIZE 2 - -nsWindow::Enumerator::Enumerator() -{ - mRefCnt = 1; - mArraySize = INITIAL_SIZE; - mChildrens = (nsIWidget**)new DWORD[mArraySize]; - memset(mChildrens, 0, sizeof(DWORD) * mArraySize); - mCurrentPosition = 0; -} - - -//------------------------------------------------------------------------- -// -// Destructor -// -//------------------------------------------------------------------------- -nsWindow::Enumerator::~Enumerator() -{ - if (mChildrens) { - //for (int i = 0; mChildrens[i] && i < mArraySize; i++) { - // NS_RELEASE(mChildrens[i]); - //} - - delete[] mChildrens; - } -} - -// -// nsISupports implementation macro -// -NS_IMPL_ISUPPORTS(nsWindow::Enumerator, NS_IENUMERATOR_IID); - -//------------------------------------------------------------------------- -// -// Get enumeration next element. Return null at the end -// -//------------------------------------------------------------------------- -nsISupports* nsWindow::Enumerator::Next() -{ - if (mCurrentPosition < mArraySize && mChildrens[mCurrentPosition]) { - mChildrens[mCurrentPosition]->AddRef(); - return mChildrens[mCurrentPosition++]; - } - - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Reset enumerator internal pointer to the beginning -// -//------------------------------------------------------------------------- -void nsWindow::Enumerator::Reset() -{ - mCurrentPosition = 0; -} - - -//------------------------------------------------------------------------- -// -// Append an element -// -//------------------------------------------------------------------------- -void nsWindow::Enumerator::Append(nsIWidget* aWidget) -{ - NS_PRECONDITION(aWidget, "Null widget"); - if (aWidget) { - int pos; - for (pos = 0; pos < mArraySize && mChildrens[pos]; pos++); - if (pos == mArraySize) { - GrowArray(); - } - mChildrens[pos] = aWidget; - aWidget->AddRef(); - } -} - - -//------------------------------------------------------------------------- -// -// Remove an element -// -//------------------------------------------------------------------------- -void nsWindow::Enumerator::Remove(nsIWidget* aWidget) -{ - int pos; - for(pos = 0; mChildrens[pos] && (mChildrens[pos] != aWidget); pos++); - if (mChildrens[pos] == aWidget) { - NS_RELEASE(aWidget); - memcpy(mChildrens + pos, mChildrens + pos + 1, mArraySize - pos - 1); - } - -} - - -//------------------------------------------------------------------------- -// -// Grow the size of the children array -// -//------------------------------------------------------------------------- -void nsWindow::Enumerator::GrowArray() -{ - mArraySize <<= 1; - nsIWidget **newArray = (nsIWidget**)new DWORD[mArraySize]; - memset(newArray, 0, sizeof(DWORD) * mArraySize); - memcpy(newArray, mChildrens, (mArraySize>>1) * sizeof(DWORD)); - mChildrens = newArray; -} - - -//------------------------------------------------------------------------- -// -// return the style for a child nsWindow -// -//------------------------------------------------------------------------- -DWORD ChildWindow::WindowStyle() -{ - return WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | GetBorderStyle(mBorderStyle); -} - - -DWORD nsWindow::GetBorderStyle(nsBorderStyle aBorderStyle) -{ - switch(aBorderStyle) - { - case eBorderStyle_none: - return(0); - break; - - case eBorderStyle_dialog: - return(WS_DLGFRAME | DS_3DLOOK); - break; - - default: - NS_ASSERTION(0, "unknown border style"); - return(WS_OVERLAPPEDWINDOW); - } -} - - -void nsWindow::SetBorderStyle(nsBorderStyle aBorderStyle) -{ - mBorderStyle = aBorderStyle; -} - -void nsWindow::SetTitle(const nsString& aTitle) -{ - NS_ALLOC_STR_BUF(buf, aTitle, 256); - ::SendMessage(mWnd, WM_SETTEXT, (WPARAM)0, (LPARAM)(LPCTSTR)buf); - NS_FREE_STR_BUF(buf); -} - - -/** - * Processes a mouse pressed event - * - **/ -void nsWindow::AddMouseListener(nsIMouseListener * aListener) -{ - NS_PRECONDITION(mMouseListener == nsnull, "Null mouse listener"); - mMouseListener = aListener; -} - -/** - * Processes a mouse pressed event - * - **/ -void nsWindow::AddEventListener(nsIEventListener * aListener) -{ - NS_PRECONDITION(mEventListener == nsnull, "Null mouse listener"); - mEventListener = aListener; -} - -PRBool nsWindow::AutoErase() -{ - return(PR_FALSE); -} - - - diff --git a/mozilla/widget/src/windows/nsWindow.h b/mozilla/widget/src/windows/nsWindow.h deleted file mode 100644 index 7fb5f99061d..00000000000 --- a/mozilla/widget/src/windows/nsWindow.h +++ /dev/null @@ -1,387 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef Window_h__ -#define Window_h__ - -#include "nsdefs.h" -#include "nsObject.h" -#include "nsSwitchToUIThread.h" -#include "nsToolkit.h" - -#include "nsIWidget.h" -#include "nsIEnumerator.h" - -#include "nsIMouseListener.h" -#include "nsIEventListener.h" -#include "nsStringUtil.h" -#include "nsString.h" - - -#define NSRGB_2_COLOREF(color) \ - RGB(NS_GET_R(color),NS_GET_G(color),NS_GET_B(color)) - - -// data passed in and used before the widget's create method is called -struct nsWidgetInitData { - DWORD arg1; - DWORD arg2; - DWORD arg3; - DWORD arg4; -}; - -/** - * Native WIN32 window wrapper. - */ - -class nsWindow : public nsObject, - public nsIWidget, - public nsSwitchToUIThread -{ - -public: - nsWindow(nsISupports *aOuter); - virtual ~nsWindow(); - - // nsISupports. Forward to the nsObject base class - BASE_SUPPORT - - virtual nsresult QueryObject(const nsIID& aIID, void** aInstancePtr); - - virtual void PreCreateWidget(void *aWidgetInitData) {} - // nsIWidget interface - virtual void Create(nsIWidget *aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit = nsnull, - void *aInitData = nsnull); - virtual void Create(nsNativeWindow aParent, - const nsRect &aRect, - EVENT_CALLBACK aHandleEventFunction, - nsIDeviceContext *aContext, - nsIToolkit *aToolkit = nsnull, - void *aInitData = nsnull); - virtual void Destroy(); - virtual nsIWidget* GetParent(void); - virtual nsIEnumerator* GetChildren(); - virtual void AddChild(nsIWidget* aChild); - virtual void RemoveChild(nsIWidget* aChild); - virtual void Show(PRBool bState); - virtual void Move(PRUint32 aX, PRUint32 aY); - virtual void Resize(PRUint32 aWidth, - PRUint32 aHeight); - virtual void Resize(PRUint32 aX, - PRUint32 aY, - PRUint32 aWidth, - PRUint32 aHeight); - virtual void Enable(PRBool bState); - virtual void SetFocus(void); - virtual void GetBounds(nsRect &aRect); - virtual nscolor GetForegroundColor(void); - virtual void SetForegroundColor(const nscolor &aColor); - virtual nscolor GetBackgroundColor(void); - virtual void SetBackgroundColor(const nscolor &aColor); - virtual nsIFontMetrics* GetFont(void); - virtual void SetFont(const nsFont &aFont); - virtual nsCursor GetCursor(); - virtual void SetCursor(nsCursor aCursor); - virtual void Invalidate(PRBool aIsSynchronous); - virtual void* GetNativeData(PRUint32 aDataType); - virtual nsIRenderingContext* GetRenderingContext(); - virtual void SetColorMap(nsColorMap *aColorMap); - virtual nsIDeviceContext* GetDeviceContext(); - virtual void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect); - virtual nsIToolkit* GetToolkit(); - virtual void SetBorderStyle(nsBorderStyle aBorderStyle); - virtual void SetTitle(const nsString& aTitle); - virtual void AddMouseListener(nsIMouseListener * aListener); - virtual void AddEventListener(nsIEventListener * aListener); - - // nsSwitchToUIThread interface - virtual BOOL CallMethod(MethodInfo *info); - - HWND GetWindowHandle() { return mWnd; } - WNDPROC GetPrevWindowProc() { return mPrevWndProc; } - - virtual PRBool DispatchMouseEvent(PRUint32 aEventType); - virtual PRBool AutoErase(); - -protected: - - virtual PRBool ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue); - - virtual LPCTSTR WindowClass(); - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle(); - - void SubclassWindow(BOOL bState); - - virtual void OnDestroy(); - virtual PRBool OnPaint(); - virtual PRBool OnResize(nsRect &aWindowRect); - virtual PRBool OnKey(PRUint32 aEventType, PRUint32 aKeyCode); - - virtual PRBool DispatchFocus(PRUint32 aEventType); - virtual PRBool OnScroll(UINT scrollCode, int cPos); - virtual HBRUSH OnControlColor(); - - static LRESULT CALLBACK WindowProc(HWND hWnd, - UINT msg, - WPARAM wParam, - LPARAM lParam); - - static PRBool ConvertStatus(nsEventStatus aStatus); - DWORD GetBorderStyle(nsBorderStyle aBorderStyle); - - void InitEvent(nsGUIEvent& event, PRUint32 aEventType); - PRBool DispatchEvent(nsGUIEvent* event); - -protected: - HWND mWnd; - HPALETTE mPalette; - WNDPROC mPrevWndProc; - EVENT_CALLBACK mEventCallback; - nsIDeviceContext *mContext; - nsIFontMetrics *mFontMetrics; - nsToolkit *mToolkit; - - nsIMouseListener * mMouseListener; - nsIEventListener * mEventListener; - - nscolor mBackground; - HBRUSH mBrush; - nscolor mForeground; - nsCursor mCursor; - nsBorderStyle mBorderStyle; - - PRBool mIsShiftDown; - PRBool mIsControlDown; - PRBool mIsAltDown; - PRBool mIsDestroying; - - // keep the list of children - class Enumerator : public nsIEnumerator { - nsIWidget **mChildrens; - int mCurrentPosition; - int mArraySize; - - public: - NS_DECL_ISUPPORTS - - Enumerator(); - ~Enumerator(); - - NS_IMETHOD_(nsISupports*) Next(); - NS_IMETHOD_(void) Reset(); - - void Append(nsIWidget* aWidget); - void Remove(nsIWidget* aWidget); - - private: - void GrowArray(); - - } *mChildren; - - // Enumeration of the methods which are accessable on the "main GUI thread" - // via the CallMethod(...) mechanism... - // see nsSwitchToUIThread - enum { - CREATE = 0x0101, - CREATE_NATIVE, - DESTROY, - SET_FOCUS, - SET_CURSOR, - CREATE_HACK - }; - - static BOOL sIsRegistered; -}; - -// -// A child window is a window with different style -// -class ChildWindow : public nsWindow { - -public: - ChildWindow(nsISupports *aOuter) : nsWindow(aOuter) {} - -protected: - virtual DWORD WindowStyle(); - virtual DWORD WindowExStyle() { return 0; } -}; - -#define BASE_IWIDGET_IMPL BASE_INITIALIZE_IMPL BASE_WINDOWS_METHODS - - -#define BASE_INITIALIZE_IMPL \ - void Create(nsIWidget *aParent, \ - const nsRect &aRect, \ - EVENT_CALLBACK aHandleEventFunction, \ - nsIDeviceContext *aContext, \ - nsIToolkit *aToolkit = nsnull, \ - void *aInitData = nsnull) \ - { \ - nsWindow::Create(aParent, aRect, aHandleEventFunction, aContext, aToolkit, aInitData); \ - } \ - -#define BASE_WINDOWS_METHODS \ - void Create(nsNativeWindow aParent, \ - const nsRect &aRect, \ - EVENT_CALLBACK aHandleEventFunction, \ - nsIDeviceContext *aContext, \ - nsIToolkit *aToolkit = nsnull, \ - void *aInitData = nsnull) \ - { \ - nsWindow::Create(aParent, aRect, aHandleEventFunction, aContext, aToolkit, aInitData); \ - } \ - void Destroy(void) \ - { \ - nsWindow::Destroy(); \ - } \ - nsIWidget* GetParent(void) \ - { \ - return nsWindow::GetParent(); \ - } \ - nsIEnumerator* GetChildren(void) \ - { \ - return nsWindow::GetChildren(); \ - } \ - void AddChild(nsIWidget* aChild) \ - { \ - nsWindow::AddChild(aChild); \ - } \ - void RemoveChild(nsIWidget* aChild) \ - { \ - nsWindow::RemoveChild(aChild); \ - } \ - void Show(PRBool bState) \ - { \ - nsWindow::Show(bState); \ - } \ - void Move(PRUint32 aX, PRUint32 aY) \ - { \ - nsWindow::Move(aX, aY); \ - } \ - void Resize(PRUint32 aWidth, \ - PRUint32 aHeight) \ - { \ - nsWindow::Resize(aWidth, aHeight); \ - } \ - void Resize(PRUint32 aX, \ - PRUint32 aY, \ - PRUint32 aWidth, \ - PRUint32 aHeight) \ - { \ - nsWindow::Resize(aX, aY, aWidth, aHeight); \ - } \ - void Enable(PRBool bState) \ - { \ - nsWindow::Enable(bState); \ - } \ - void SetFocus(void) \ - { \ - nsWindow::SetFocus(); \ - } \ - void GetBounds(nsRect &aRect) \ - { \ - nsWindow::GetBounds(aRect); \ - } \ - nscolor GetForegroundColor(void) \ - { \ - return nsWindow::GetForegroundColor(); \ - } \ - void SetForegroundColor(const nscolor &aColor) \ - { \ - nsWindow::SetForegroundColor(aColor); \ - } \ - nscolor GetBackgroundColor(void) \ - { \ - return nsWindow::GetBackgroundColor(); \ - } \ - void SetBackgroundColor(const nscolor &aColor) \ - { \ - nsWindow::SetBackgroundColor(aColor); \ - } \ - nsIFontMetrics* GetFont(void) \ - { \ - return nsWindow::GetFont(); \ - } \ - void SetFont(const nsFont &aFont) \ - { \ - nsWindow::SetFont(aFont); \ - } \ - nsCursor GetCursor() \ - { \ - return nsWindow::GetCursor(); \ - } \ - void SetCursor(nsCursor aCursor) \ - { \ - nsWindow::SetCursor(aCursor); \ - } \ - void Invalidate(PRBool aIsSynchronous) \ - { \ - nsWindow::Invalidate(aIsSynchronous); \ - } \ - void* GetNativeData(PRUint32 aDataType) \ - { \ - return nsWindow::GetNativeData(aDataType); \ - } \ - nsIRenderingContext* GetRenderingContext() \ - { \ - return nsWindow::GetRenderingContext(); \ - } \ - nsIDeviceContext* GetDeviceContext() \ - { \ - return nsWindow::GetDeviceContext(); \ - } \ - void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) \ - { \ - nsWindow::Scroll(aDx, aDy, aClipRect); \ - } \ - nsIToolkit* GetToolkit() \ - { \ - return nsWindow::GetToolkit(); \ - } \ - void SetColorMap(nsColorMap *aColorMap) \ - { \ - nsWindow::SetColorMap(aColorMap); \ - } \ - void AddMouseListener(nsIMouseListener * aListener) \ - { \ - nsWindow::AddMouseListener(aListener); \ - } \ - void AddEventListener(nsIEventListener * aListener) \ - { \ - nsWindow::AddEventListener(aListener); \ - } \ - PRBool OnKey(PRUint32 aEventType, PRUint32 aKeyCode) \ - { \ - return nsWindow::OnKey(aEventType, aKeyCode); \ - } \ - void SetBorderStyle(nsBorderStyle aBorderStyle) \ - { \ - nsWindow::SetBorderStyle(aBorderStyle); \ - } \ - void SetTitle(const nsString& aTitle) \ - { \ - nsWindow::SetTitle(aTitle); \ - } - - - -#endif // Window_h__ diff --git a/mozilla/widget/src/windows/nsdefs.h b/mozilla/widget/src/windows/nsdefs.h deleted file mode 100644 index 9ef00bb72b5..00000000000 --- a/mozilla/widget/src/windows/nsdefs.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef NSDEFS_H -#define NSDEFS_H - -#include - -#ifdef _DEBUG - #define BREAK_TO_DEBUGGER DebugBreak() -#else - #define BREAK_TO_DEBUGGER -#endif - -#ifdef _DEBUG - #define VERIFY(exp) ((exp) ? 0: (GetLastError(), BREAK_TO_DEBUGGER)) -#else // !_DEBUG - #define VERIFY(exp) (exp) -#endif // !_DEBUG - -#endif // NSDEFS_H - - diff --git a/mozilla/widget/src/windows/res/select.cur b/mozilla/widget/src/windows/res/select.cur deleted file mode 100644 index 5a88b3707eec9461f920e225a5091ff46a913737..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZ|JI}U>|5QO31>5xL37D~$8Aha9?}VU8#*cu#97bF-e3*5>M#jqtM1;_X_uv(z=Z`|;k@yj|`;99I{lKcvPu5%WH( Nq`_mhzQ?g=$q&;}dK3Tv diff --git a/mozilla/widget/src/windows/resource.h b/mozilla/widget/src/windows/resource.h deleted file mode 100644 index 0573a0dfe4b..00000000000 --- a/mozilla/widget/src/windows/resource.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#define IDC_SELECTANCHOR 4100 diff --git a/mozilla/widget/src/windows/widget.rc b/mozilla/widget/src/windows/widget.rc deleted file mode 100644 index 7273757ce1e..00000000000 --- a/mozilla/widget/src/windows/widget.rc +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "resource.h" - -IDC_SELECTANCHOR CURSOR DISCARDABLE "res\\select.cur" diff --git a/mozilla/widget/tests/Makefile b/mozilla/widget/tests/Makefile deleted file mode 100644 index 0725c58d807..00000000000 --- a/mozilla/widget/tests/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../.. - -include $(DEPTH)/config/config.mk - -include $(DEPTH)/config/rules.mk diff --git a/mozilla/widget/tests/Scribble.cpp b/mozilla/widget/tests/Scribble.cpp deleted file mode 100644 index 2e6bb914ae7..00000000000 --- a/mozilla/widget/tests/Scribble.cpp +++ /dev/null @@ -1,547 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#include -#include -#include - -#include "nsIButton.h" -#include "nsICheckButton.h" -#include "nsIRadioButton.h" -#include "nsIRadioGroup.h" -#include "nsITextWidget.h" -#include "nsIScrollbar.h" -#include "nsGUIEvent.h" -#include "nsIEnumerator.h" -#include "nsIRenderingContext.h" -#include "nsIPresContext.h" -#include "nsFont.h" -#include "nsUnitConversion.h" -#include "nsColor.h" -#include "nsString.h" -#include "Scribble.h" -#include "nsIDeviceContext.h" -#include "nsTransform2D.h" -#include "nsGfxCIID.h" -#include "nsWidgetsCID.h" - -ScribbleApp scribbleData; - - -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kIButtonIID, NS_IBUTTON_IID); -static NS_DEFINE_IID(kIScrollbarIID, NS_ISCROLLBAR_IID); -static NS_DEFINE_IID(kICheckButtonIID, NS_ICHECKBUTTON_IID); -static NS_DEFINE_IID(kITextWidgetIID, NS_ITEXTWIDGET_IID); -static NS_DEFINE_IID(kIRadioButtonIID, NS_IRADIOBUTTON_IID); -static NS_DEFINE_IID(kIRadioGroupIID, NS_IRADIOGROUP_IID); - - -// -// Main window events -// -nsEventStatus PR_CALLBACK HandleEventMain(nsGUIEvent *aEvent) -{ - - printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget); - - nsEventStatus result = nsEventStatus_eConsumeNoDefault; - switch(aEvent->message) { - - case NS_SIZE: - { - nsIEnumerator *enumer = aEvent->widget->GetChildren(); - if (enumer) { - nsISupports *next; - next = enumer->Next(); - if (next) { - nsIWidget *widget; - if (NS_OK == next->QueryInterface(kIWidgetIID, (void**)&widget)) { - widget->Resize(0, 0, 200, ((nsSizeEvent*)aEvent)->windowSize->height - 26); - NS_RELEASE(widget); - } - } - - NS_RELEASE(enumer); - delete enumer; - } - - scribbleData.drawPane->Resize(200, - 0, - ((nsSizeEvent*)aEvent)->windowSize->width - 206, - ((nsSizeEvent*)aEvent)->windowSize->height - 26); - - break; - } - - case NS_DESTROY: - printf("Destroy Window...Release window\n"); - NS_RELEASE(scribbleData.red); - NS_RELEASE(scribbleData.green); - NS_RELEASE(scribbleData.blue); - NS_RELEASE(scribbleData.scribble); - NS_RELEASE(scribbleData.lines); - NS_RELEASE(scribbleData.group); - // NS_RELEASE(scribbleData.drawPane); - // NS_RELEASE(scribbleData.mainWindow); - - exit(0); // for now - break; - - default: - result = nsEventStatus_eIgnore; - } - - return result; -} - - -// -// Control pane events -// -nsEventStatus PR_CALLBACK HandleEventControlPane(nsGUIEvent *aEvent) -{ - printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget); - - nsEventStatus result = nsEventStatus_eConsumeNoDefault; - switch(aEvent->message) { - case NS_PAINT: - { - // paint the background - nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext; - drawCtx->SetColor(aEvent->widget->GetBackgroundColor()); - drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect)); - - // draw the line separating the two panes - drawCtx->SetColor(aEvent->widget->GetForegroundColor()); - drawCtx->DrawLine(198, 0, 198, 800); - drawCtx->DrawLine(199, 0, 199, 800); - drawCtx->DrawLine(200, 0, 200, 800); - - // draw the colors text - nsFont font("Times", NS_FONT_STYLE_NORMAL, - NS_FONT_VARIANT_NORMAL, - NS_FONT_WEIGHT_BOLD, - 0, - 12); - drawCtx->SetFont(font); - - nsString red("Red"); - drawCtx->SetColor(NS_RGB(255, 0, 0)); - drawCtx->DrawString(red, 50, 351, 50); - - nsString green("Green"); - drawCtx->SetColor(NS_RGB(0, 255, 0)); - drawCtx->DrawString(green, 50, 372, 50); - - nsString blue("Blue"); - drawCtx->SetColor(NS_RGB(0, 0, 255)); - drawCtx->DrawString(blue, 50, 393, 50); - - return nsEventStatus_eConsumeNoDefault; - } - } - - return nsEventStatus_eIgnore; -} - - -// -// Graphic pane events -// -nsEventStatus PR_CALLBACK HandleEventGraphicPane(nsGUIEvent *aEvent) -{ - printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget); - - nsEventStatus result = nsEventStatus_eConsumeNoDefault; - switch(aEvent->message) { - - case NS_PAINT: - { - nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext; - drawCtx->SetColor(aEvent->widget->GetBackgroundColor()); - drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect)); - - return nsEventStatus_eConsumeNoDefault; - } - - case NS_MOUSE_LEFT_BUTTON_DOWN: - aEvent->widget->SetFocus(); - scribbleData.isDrawing = PR_TRUE; - scribbleData.mousePos = ((nsGUIEvent*)aEvent)->point; - return nsEventStatus_eConsumeNoDefault; - - case NS_MOUSE_LEFT_BUTTON_UP: - scribbleData.isDrawing = PR_FALSE; - return nsEventStatus_eConsumeNoDefault; - - case NS_MOUSE_MOVE: - { - if (scribbleData.isDrawing) { - nsIRenderingContext *drawCtx = aEvent->widget->GetRenderingContext(); - drawCtx->SetColor(aEvent->widget->GetForegroundColor()); - drawCtx->DrawLine(scribbleData.mousePos.x, - scribbleData.mousePos.y, - ((nsGUIEvent*)aEvent)->point.x, - ((nsGUIEvent*)aEvent)->point.y); - - if (scribbleData.scribble->GetState()) - scribbleData.mousePos = ((nsGUIEvent*)aEvent)->point; - - - NS_RELEASE(drawCtx); - } - - return nsEventStatus_eConsumeNoDefault; - } - - } - - return nsEventStatus_eIgnore; -} - - -// -// Buttons events -// -nsEventStatus PR_CALLBACK HandleEventButton(nsGUIEvent *aEvent) -{ - printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget); - - switch(aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_UP: - scribbleData.drawPane->Invalidate(PR_TRUE); - } - - return nsEventStatus_eIgnore; -} - - - -// -// Handle events for the auto-mode (rectangles/circles) -// -nsEventStatus PR_CALLBACK HandleEventCheck(nsGUIEvent *aEvent) -{ - printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget); - printf("aEvent->message %d == %d on 0x%X\n", aEvent->message, NS_MOUSE_LEFT_BUTTON_UP, aEvent->widget); - - switch(aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_UP: - { - nsICheckButton *option; - - if (NS_OK == aEvent->widget->QueryInterface(kICheckButtonIID, (void**)&option)) { - // invert the two checkboxes state - PRBool state = option->GetState(); - option->SetState((state) ? PR_FALSE : PR_TRUE); - - if (state == PR_FALSE) { - nsAutoString buf; - option->GetLabel(buf); - - nsIRenderingContext *drawCtx = scribbleData.drawPane->GetRenderingContext(); - - // - srand(aEvent->time); - if (drawCtx) { - - // a sort of random rect - nsRect rect; - scribbleData.drawPane->GetBounds(rect); - nscoord width = rect.width; - nscoord height = rect.height; - - nsString circles("Circles"); - nsString rects("Rectangles"); - if (buf.Equals(circles)) { - for (int i = 0; i < 100; i++) { - drawCtx->SetColor((nscolor)rand()); - - rect.MoveTo(rand() % width, rand() % height); - rect.SizeTo(rand() % (width - rect.x), - rand() % (height - rect.y)); - drawCtx->DrawEllipse(rect); - } - } - else if (buf.Equals(rects)) { - for (int i = 0; i < 100; i++) { - drawCtx->SetColor((nscolor)rand()); - - rect.MoveTo(rand() % width, rand() % height); - rect.SizeTo(rand() % (width - rect.x), - rand() % (height - rect.y)); - drawCtx->DrawRect(rect); - } - } - - NS_RELEASE(drawCtx); - } - } - } - - } - } - - return nsEventStatus_eIgnore; -} - - -// -// Handle events for the text fields -// -nsEventStatus PR_CALLBACK HandleEventText(nsGUIEvent *aEvent) -{ - printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget); - - switch(aEvent->message) { - case NS_LOSTFOCUS: - { - nscolor color = scribbleData.drawPane->GetForegroundColor(); - nsAutoString buf; - - nsITextWidget *text; - if (NS_OK == aEvent->widget->QueryInterface(kITextWidgetIID, (void**)&text)) { - if (text == scribbleData.red) { - scribbleData.red->GetText(buf, 0); - PRInt32 value, err; - value = buf.ToInteger(&err); - color = NS_RGB(value, NS_GET_G(color), NS_GET_B(color)); - } - else if (text == scribbleData.green) { - scribbleData.green->GetText(buf, 0); - PRInt32 value, err; - value = buf.ToInteger(&err); - color = NS_RGB(NS_GET_R(color), value, NS_GET_B(color)); - } - else if (text == scribbleData.blue) { - scribbleData.blue->GetText(buf, 0); - PRInt32 value, err; - value = buf.ToInteger(&err); - color = NS_RGB(NS_GET_R(color), NS_GET_G(color), value); - } - - NS_RELEASE(text); - } - - scribbleData.drawPane->SetForegroundColor(color); - - return nsEventStatus_eIgnore; - } - } - - return nsEventStatus_eIgnore; -} - -#define WIDGET_DLL "raptorwidget.dll" -#define GFXWIN_DLL "raptorgfxwin.dll" - -// -// Main application entry function -// -void CreateApplication() -{ - scribbleData.isDrawing = PR_FALSE; - - // register graphics classes - static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID); - - NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE); - - // register widget classes - static NS_DEFINE_IID(kCWindowCID, NS_WINDOW_CID); - static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID); - static NS_DEFINE_IID(kCButtonCID, NS_BUTTON_CID); - static NS_DEFINE_IID(kCCheckButtonCID, NS_CHECKBUTTON_CID); - static NS_DEFINE_IID(kCComboBoxCID, NS_COMBOBOX_CID); - static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID); - static NS_DEFINE_IID(kCListBoxCID, NS_LISTBOX_CID); - static NS_DEFINE_IID(kCRadioButtonCID, NS_RADIOBUTTON_CID); - static NS_DEFINE_IID(kCRadioGroupCID, NS_RADIOGROUP_CID); - static NS_DEFINE_IID(kCHorzScrollbarCID, NS_HORZSCROLLBAR_CID); - static NS_DEFINE_IID(kCVertScrollbarCID, NS_VERTSCROLLBAR_CID); - static NS_DEFINE_IID(kCTextAreaCID, NS_TEXTAREA_CID); - static NS_DEFINE_IID(kCTextFieldCID, NS_TEXTFIELD_CID); - - NSRepository::RegisterFactory(kCWindowCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCChildCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCCheckButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCComboBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFileWidgetCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCListBoxCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCRadioButtonCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCRadioGroupCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCHorzScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCVertScrollbarCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTextAreaCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTextFieldCID, WIDGET_DLL, PR_FALSE, PR_FALSE); - - //NS_InitToolkit(PR_GetCurrentThread()); - - nsresult res; - - static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID); - - res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&scribbleData.mContext); - - if (NS_OK == res) - scribbleData.mContext->Init(); - - // - // create the main window - // - NSRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (LPVOID*)&(scribbleData.mainWindow)); - nsRect rect(100, 100, 600, 600); - scribbleData.mainWindow->Create((nsIWidget*)NULL, rect, HandleEventMain, NULL); - - // - // create the control pane - // - nsIWidget *controlPane; - rect.SetRect(0, 0, 200, 580); - NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (LPVOID*)&controlPane); - controlPane->Create(scribbleData.mainWindow, rect, HandleEventControlPane, NULL); - - // - // Add the scribble/lines section - // - - // - // create a Radio Group - // - NSRepository::CreateInstance(kCRadioGroupCID, nsnull, kIRadioGroupIID, (LPVOID*)&(scribbleData.group)); - scribbleData.group->SetName(nsString("Group1")); - - // create the "Scribble" check button - rect.SetRect(50, 50, 100, 25); - - NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (LPVOID*)&(scribbleData.scribble)); - scribbleData.scribble->SetRadioGroup(scribbleData.group); - scribbleData.scribble->Create(controlPane, rect, NULL, NULL); - nsString cbLabel("Scribble"); - scribbleData.scribble->SetLabel(cbLabel); - scribbleData.scribble->SetState(PR_FALSE); - //scribbleData.scribble->SetBackgroundColor(NS_RGB(255, 255, 255)); - scribbleData.scribble->Show(PR_TRUE); - - // create the "Lines" check button - rect.SetRect(50, 75, 100, 25); - - NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (LPVOID*)&(scribbleData.lines)); - scribbleData.lines->SetRadioGroup(scribbleData.group); - scribbleData.lines->Create(controlPane, rect, NULL, NULL); - nsString cbLabel1("Lines"); - scribbleData.lines->SetLabel(cbLabel1); - scribbleData.lines->SetState(PR_TRUE); - //scribbleData.lines->SetBackgroundColor(NS_RGB(255, 255, 255)); - scribbleData.lines->Show(PR_TRUE); - // - // Add the circle/rectangle section - // - - // create the "Circles" check button - nsICheckButton * checkButton; - rect.SetRect(50, 200, 100, 25); - - NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (LPVOID*)&checkButton); - checkButton->Create(controlPane, rect, HandleEventCheck, NULL); - nsString cbLabel2("Circles"); - checkButton->SetLabel(cbLabel2); - checkButton->SetBackgroundColor(NS_RGB(255, 255, 255)); - checkButton->Show(PR_TRUE); - NS_RELEASE(checkButton); - - // create the "Rectangles" check button - rect.SetRect(50, 225, 100, 25); - - NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (LPVOID*)&checkButton); - checkButton->Create(controlPane, rect, HandleEventCheck, NULL); - nsString cbLabel3("Rectangles"); - checkButton->SetLabel(cbLabel3); - checkButton->SetBackgroundColor(NS_RGB(255, 255, 255)); - checkButton->Show(PR_TRUE); - NS_RELEASE(checkButton); - - // - // Add the color section - // - - // create the "red" text widget - rect.SetRect(100, 350, 50, 22); - - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&(scribbleData.red)); - scribbleData.red->Create(controlPane, rect, HandleEventText, NULL); - nsString initText("0"); - scribbleData.red->SetText(initText); - scribbleData.red->SetBackgroundColor(NS_RGB(0, 0, 255)); - scribbleData.red->Show(PR_TRUE); - - // create the "green" text widget - rect.SetRect(100, 371, 50, 22); - - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&(scribbleData.green)); - scribbleData.green->Create(controlPane, rect, HandleEventText, NULL); - scribbleData.green->SetText(initText); - scribbleData.green->SetBackgroundColor(NS_RGB(255, 0, 0)); - scribbleData.green->Show(PR_TRUE); - - // create the "blue" text widget - rect.SetRect(100, 392, 50, 22); - - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&(scribbleData.blue)); - scribbleData.blue->Create(controlPane, rect, HandleEventText, NULL); - scribbleData.blue->SetText(initText); - scribbleData.blue->SetBackgroundColor(NS_RGB(0, 255, 0)); - scribbleData.blue->Show(PR_TRUE); - - // - // create a button - // - nsIButton *button; - rect.SetRect(50, 500, 100, 25); - NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (LPVOID*)&button); - button->Create(controlPane, rect, HandleEventButton, NULL); - nsString label("Clear"); - button->SetLabel(label); - button->Show(PR_TRUE); - NS_RELEASE(button); - - NS_RELEASE(controlPane); // the parent keeps a reference on this child - - // - // create the draw pane - // - rect.SetRect(200, 0, 400, 580); - NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (LPVOID*)&scribbleData.drawPane); - scribbleData.drawPane->Create(scribbleData.mainWindow, rect, HandleEventGraphicPane, NULL); - - // - // show. We are in business... - // - scribbleData.mainWindow->Show(PR_TRUE); - -} - diff --git a/mozilla/widget/tests/Scribble.h b/mozilla/widget/tests/Scribble.h deleted file mode 100644 index 47cdf47768e..00000000000 --- a/mozilla/widget/tests/Scribble.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef Scribble_h__ -#define Scribble_h__ - -#include "nsIWidget.h" -#include "nsIRadioButton.h" -#include "nsIRadioGroup.h" -#include "nsITextWidget.h" -#include "nsPoint.h" -#include "nsIDeviceContext.h" - -struct ScribbleApp { - nsIWidget *mainWindow; - nsIWidget *drawPane; - - nsITextWidget *red; - nsITextWidget *green; - nsITextWidget *blue; - - nsIRadioGroup *group; - nsIRadioButton *scribble; - nsIRadioButton *lines; - - PRBool isDrawing; - - nsPoint mousePos; - - nsIDeviceContext *mContext; -}; - - -void CreateApplication(); - -#endif - - - diff --git a/mozilla/widget/tests/main.cpp b/mozilla/widget/tests/main.cpp deleted file mode 100644 index f9b02d732a9..00000000000 --- a/mozilla/widget/tests/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "Scribble.h" - -#ifdef XP_PC - -#include - -int WINAPI WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, - int nCmdShow) -{ - CreateApplication(); - - // Process messages - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return msg.wParam; -} - -void main(int argc, char **argv) -{ - WinMain(GetModuleHandle(NULL), NULL, 0, SW_SHOW); -} - -#endif - diff --git a/mozilla/widget/tests/makefile.win b/mozilla/widget/tests/makefile.win deleted file mode 100644 index fb157302d35..00000000000 --- a/mozilla/widget/tests/makefile.win +++ /dev/null @@ -1,52 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -DIRS = windows - -MAKE_OBJ_TYPE = EXE -PROGRAM = .\$(OBJDIR)\scribble.exe -#RESFILE = scribble.res - -OBJS = \ - .\$(OBJDIR)\main.obj \ - .\$(OBJDIR)\Scribble.obj \ - $(NULL) - -LINCS=-I$(PUBLIC)\raptor -I$(PUBLIC)\xpcom - -MYLIBS= \ - $(DIST)\lib\xpcom32.lib \ - $(LIBNSPR) \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(NULL) - -LLIBS= $(MYLIBS) \ - -SUBSYSTEM:CONSOLE - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAM) - $(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\scribble.exe - -$(PROGRAM):: $(OBJS) $(MYLIBS) diff --git a/mozilla/widget/tests/windows/makefile.win b/mozilla/widget/tests/windows/makefile.win deleted file mode 100644 index 41ffcdf4372..00000000000 --- a/mozilla/widget/tests/windows/makefile.win +++ /dev/null @@ -1,49 +0,0 @@ -#!nmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\.. - -MAKE_OBJ_TYPE = EXE -PROGRAM = .\$(OBJDIR)\widget.exe -#RESFILE = widget.res - -OBJS = \ - .\$(OBJDIR)\winmain.obj \ - $(NULL) - -LINCS=-I$(PUBLIC)\raptor \ - -I$(PUBLIC)\xpcom -I\ns\raptor\ui\src\windows - -MYLIBS= \ - $(DIST)\lib\xpcom32.lib \ - $(LIBNSPR) \ - $(DIST)\lib\raptorbase.lib \ - $(DIST)\lib\raptorgfx.lib \ - $(NULL) - -LLIBS= $(MYLIBS) \ - -SUBSYSTEM:CONSOLE - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAM) - $(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin - -clobber:: - rm -f $(DIST)\bin\widget.exe - -$(PROGRAM):: $(OBJS) $(MYLIBS) diff --git a/mozilla/widget/tests/windows/winmain.cpp b/mozilla/widget/tests/windows/winmain.cpp deleted file mode 100644 index 442e52dc11a..00000000000 --- a/mozilla/widget/tests/windows/winmain.cpp +++ /dev/null @@ -1,1262 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include -#include -#include - -//---- Factory Includes & Stuff -----// -#include "nsIFactory.h" -#include "nsRepository.h" -#include "nsGfxCIID.h" - -#include "nsWidgetsCID.h" - - -#include "nsIWidget.h" -#include "nsIButton.h" -#include "nsICheckButton.h" -#include "nsIRadioButton.h" -#include "nsIRadioGroup.h" -#include "nsIScrollbar.h" -#include "nsITextWidget.h" -#include "nsITextAreaWidget.h" -#include "nsGUIEvent.h" -#include "nsIEnumerator.h" -#include "nsString.h" -#include "nsRect.h" -#include "nsIRenderingContext.h" -#include "nsIListBox.h" -#include "nsIComboBox.h" -#include "nsIFileWidget.h" -#include "nsIDeviceContext.h" -#include "nsFont.h" -#include "nsRepository.h" -#include "nsWidgetsCID.h" -#include "nsITabWidget.h" - -#include - -char * gLogFileName = "selftest.txt"; -FILE * gFD = nsnull; -PRInt32 gOverallStatus = 0; -PRInt32 gNonVisualStatus = 0; - -nsIWidget *window = NULL; -nsITextWidget *statusText = NULL; -nsITextWidget *textWidgetInstance = NULL; -nsITextWidget *passwordText = NULL; - -nsIListWidget *comboBox = NULL; -nsIListWidget *listBox = NULL; -nsIListBox *gMultiListBox = NULL; - -nsIWidget *movingWidget = NULL; -nsIScrollbar *scrollbar = NULL; -nsITabWidget *tabWidget = NULL; - - -char * gFailedMsg = NULL; - - - -#define WIDGET_DLL "raptorwidget.dll" -#define GFXWIN_DLL "raptorgfxwin.dll" - -#define DEBUG_MOUSE 0 - -#define NUM_COMBOBOX_ITEMS 8 -#define kSetCaret "Set Caret" -#define kGetCaret "Get Caret" -#define kSetSelection "Set Selection" -#define kRemoveSelection "Remove Selection" -#define kSetText "Set Text" -#define kGetText "Get Text" -#define kHideBtn "Hide Btn" -#define kShowBtn "Show Btn" -#define kBrowseBtn "Browse..." - -// class ids -static NS_DEFINE_IID(kCWindowCID, NS_WINDOW_CID); -static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID); -static NS_DEFINE_IID(kCButtonCID, NS_BUTTON_CID); -static NS_DEFINE_IID(kCCheckButtonCID, NS_CHECKBUTTON_CID); -static NS_DEFINE_IID(kCComboBoxCID, NS_COMBOBOX_CID); -static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID); -static NS_DEFINE_IID(kCListBoxCID, NS_LISTBOX_CID); -static NS_DEFINE_IID(kCRadioButtonCID, NS_RADIOBUTTON_CID); -static NS_DEFINE_IID(kCRadioGroupCID, NS_RADIOGROUP_CID); -static NS_DEFINE_IID(kCHorzScrollbarCID, NS_HORZSCROLLBAR_CID); -static NS_DEFINE_IID(kCVertScrollbarCID, NS_VERTSCROLLBAR_CID); -static NS_DEFINE_IID(kCTextAreaCID, NS_TEXTAREA_CID); -static NS_DEFINE_IID(kCTextFieldCID, NS_TEXTFIELD_CID); - -static NS_DEFINE_IID(kCTabWidgetCID, NS_TABWIDGET_CID); - - -// interface ids -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kIButtonIID, NS_IBUTTON_IID); -static NS_DEFINE_IID(kIScrollbarIID, NS_ISCROLLBAR_IID); -static NS_DEFINE_IID(kICheckButtonIID, NS_ICHECKBUTTON_IID); -static NS_DEFINE_IID(kITextWidgetIID, NS_ITEXTWIDGET_IID); -static NS_DEFINE_IID(kITextAreaWidgetIID, NS_ITEXTAREAWIDGET_IID); -static NS_DEFINE_IID(kIRadioButtonIID, NS_IRADIOBUTTON_IID); -static NS_DEFINE_IID(kIRadioGroupIID, NS_IRADIOGROUP_IID); -static NS_DEFINE_IID(kIListBoxIID, NS_ILISTBOX_IID); -static NS_DEFINE_IID(kIComboBoxIID, NS_ICOMBOBOX_IID); -static NS_DEFINE_IID(kIFileWidgetIID, NS_IFILEWIDGET_IID); -static NS_DEFINE_IID(kITabWidgetIID, NS_ITABWIDGET_IID); - - -char * eval(PRInt32 aVal) { - if (!aVal) { - gOverallStatus++; - } - return aVal? "PASSED":"FAILED"; -} - -char * eval(PRUint32 aVal) { - if (!aVal) { - gOverallStatus++; - } - - return aVal ? "PASSED":"FAILED"; -} - -#if 0 -char * eval(PRBool aVal) { - if (!aVal) { - gOverallStatus++; - } - return aVal ? "PASSED":"FAILED"; -} -#endif - -/**-------------------------------------------------------------------------------- - * Generic ListWidget Box Non-Visual Test - *-------------------------------------------------------------------------------- - */ -void listSelfTest(FILE * fd, char * aTitle, nsIListWidget * listBox) { - fprintf(fd, "\n\n-----------------------------\n"); - fprintf(fd, "%s self test\n", aTitle); - fprintf(fd, "-----------------------------\n\n"); - - int inx = 4; - char * item4 = "List Item 4"; - - fprintf(fd, "\nTesting GetItemCount\n\tItem count should be [%d] is [%d] Test: [%s]\n", NUM_COMBOBOX_ITEMS, listBox->GetItemCount(), - (NUM_COMBOBOX_ITEMS == (int)listBox->GetItemCount()?"PASSED":"FAILED")); - - listBox->SelectItem(inx); - nsAutoString buf; - listBox->GetSelectedItem(buf); - char * selStr = buf.ToNewCString(); - int sel = listBox->GetSelectedIndex(); - fprintf(fd, "\nTesting GetSelectedItem\n\tSelection should be %d item[%s] index[%d] Test: [%s]\n", inx, selStr, sel, - eval(inx == (int)sel)); - if (nsnull != selStr) delete selStr; - - listBox->GetItemAt(buf, 4); - selStr = buf.ToNewCString(); - fprintf(fd, "\nTesting GetItemAt\n\tItem %d should be [%s] is [%s] Test: [%s]\n", inx, item4, selStr, eval(strcmp(selStr, item4) == 0)); - if (nsnull != selStr) delete selStr; - - listBox->SelectItem(2); - inx = listBox->GetSelectedIndex(); - fprintf(fd, "\nTesting SelectItem && GetSelectedIndex\n\t Selected Item should be [%d] is [%d] Test: [%s]\n", 2, inx, eval(inx == 2)); - - for (int i=0;i<(int)listBox->GetItemCount();i++) { - nsAutoString buf; - listBox->GetItemAt(buf, i); - char * str = buf.ToNewCString(); - - fprintf(fd, "Item %d [%s]\n", i, str); - - if (nsnull != str) delete str; - } - fprintf(fd, "Removing Item #4\n"); - listBox->RemoveItemAt(4); - fprintf(fd, "\nTesting RemoveItemAt\n\tTest: [%s]\n", eval(-1 == (int)listBox->FindItem(nsString(item4), 0))); - - for (i=0;i<(int)listBox->GetItemCount();i++) { - nsAutoString buf; - listBox->GetItemAt(buf, i); - char * str = buf.ToNewCString(); - - fprintf(fd, "Item %d [%s]\n", i, str); - - if (nsnull != str) delete str; - } - listBox->Deselect(); - fprintf(fd, "\nTesting Deselect\n\t Selected Item [%d] Test:[%s]\n", (int)listBox->GetSelectedIndex(), (-1 == (int)listBox->GetSelectedIndex()?"PASSED":"FAILED")); - -} - -/**-------------------------------------------------------------------------------- - * Generic ListWidget Box Non-Visual Test - *-------------------------------------------------------------------------------- - */ -void textShelfTest(FILE * fd, char * aTitle, nsITextWidget * aTextWidget) { - fprintf(fd, "\n\n-----------------------------\n"); - fprintf(fd, "%s self test\n", aTitle); - fprintf(fd, "-----------------------------\n\n"); - - aTextWidget->SetText(nsString("1234567890")); - PRUint32 start = 1; - PRUint32 end = 5; - aTextWidget->SetSelection(start, end); - - PRUint32 start2 = 0; - PRUint32 end2 = 0; - aTextWidget->GetSelection(&start2, &end2); - - fprintf(fd, "Tested SetSelection and GetSelection Test %s\n", eval(start == start2 && end == end2)); - - start = 5; - aTextWidget->SetCaretPosition(start); - - start2 = aTextWidget->GetCaretPosition(); - - fprintf(fd, "Tested SetCaretPosition and GetCaretPosition Test %s\n", eval(start == start2)); - aTextWidget->InsertText(nsString("xxx"),1,3); - nsString str; - aTextWidget->GetText(str,256); - //fprintf(fd, "Tested InsertText Test %s\n", eval(start == start2)); - char * s = str.ToNewCString(); - fprintf(fd, "Tested InsertText Test %s\n", s); - delete s; - -} - -/**-------------------------------------------------------------------------------- - * Generic MultiListWidget Box Non-Visual Test - *-------------------------------------------------------------------------------- - */ -void multiListSelfTest(FILE * fd, char * aTitle, nsIListWidget * listBox) { - fprintf(fd, "\n\n-----------------------------\n"); - fprintf(fd, "%s self test\n", aTitle); - fprintf(fd, "-----------------------------\n\n"); - - nsIListBox * multi = (nsIListBox*)listBox; - - int inx = 4; - char * item4 = "List Item 4"; - - nsAutoString buf; - char * selStr; - - multi->GetItemAt(buf, 4); - selStr = buf.ToNewCString(); - fprintf(fd, "\nTesting GetItemAt\n\tItem %d should be [%s] is [%s] Test: [%s]\n", inx, item4, selStr, - eval(strcmp(selStr, item4) == 0)); - if (nsnull != selStr) delete selStr; - - - multi->Deselect(); - int count = multi->GetSelectedCount(); - fprintf(fd, "\nTesting Deselect\n\tCount %d Test: [%s]\n", count, eval(0 == count)); - - PRInt32 inxs[] = {0,2,4}; - PRInt32 len = 3; - - for (int i=0;iSelectItem(inxs[i]); - } - - int status = 1; - count = multi->GetSelectedCount(); - fprintf(fd, "\nTesting GetSelectedCount\n\tCount [%d] should be [%d] Test: [%s]\n", count, len, - eval(len == count)); - - if (count == len) { - PRInt32 indices[256]; - multi->GetSelectedIndices(indices, 256); - for (i=0;iGetSelectedCount())); - } - - for (i=0;i<(int)multi->GetItemCount();i++) { - nsAutoString buf; - multi->GetItemAt(buf, i); - char * str = buf.ToNewCString(); - - fprintf(fd, "Item %d [%s]\n", i, str); - - if (nsnull != str) delete str; - } - fprintf(fd, "Removing Item #4\n"); - multi->RemoveItemAt(4); - fprintf(fd, "\nTesting RemoveItemAt\n\tTest: [%s]\n", eval(-1 == (int)multi->FindItem(nsString(item4), 0))); - - for (i=0;i<(int)multi->GetItemCount();i++) { - nsAutoString buf; - multi->GetItemAt(buf, i); - char * str = buf.ToNewCString(); - - fprintf(fd, "Item %d [%s]\n", i, str); - - if (nsnull != str) delete str; - } - -} - -/**-------------------------------------------------------------------------------- - * - */ -int createTestButton(nsIWidget * aWin, - char * aTitle, - int aX, - int aY, - int aWidth, - EVENT_CALLBACK aHandleEventFunction) { - nsIButton *button; - nsRect rect(aX, aY, aWidth, 25); - NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (LPVOID*)&button); - button->Create(window, rect, aHandleEventFunction, NULL); - nsString label(aTitle); - button->SetLabel(label); - button->Show(PR_TRUE); - NS_RELEASE(button); - return aX + aWidth; -} - -/**-------------------------------------------------------------------------------- - * List Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK GenericListHandleEvent(nsGUIEvent *aEvent, char * aTitle, nsIListWidget * aListWidget) -{ - - nsIButton * btn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - nsString str(aTitle); - fprintf(gFD, "\nVisually tested nsIListWidget\n"); - - if (NS_OK == aEvent->widget->QueryInterface(kIButtonIID, (void**)&btn)) { - nsAutoString strBuf; - btn->GetLabel(strBuf); - char * title = strBuf.ToNewCString(); - //fprintf(gFD, "Title is [%s]\n", title); - - if (!strcmp(title, kSetSelection)) { - aListWidget->SelectItem(2); - fprintf(gFD, "\tTested SelectItem(2)\n"); - str.Append(" should show 'List Item 2'"); - statusText->SetText(str); - gFailedMsg = "List::SelectItem"; - } else if (!strcmp(title, kRemoveSelection)) { - PRInt32 inx = aListWidget->FindItem(nsString("List Item 2"), 0); - - if (inx > -1) { - aListWidget->RemoveItemAt(inx); - } - fprintf(gFD, "\tTested FindItem(...)\n"); - str.Append(" should show empty"); - statusText->SetText(str); - gFailedMsg = "List::RemoveItemAt && FindItem"; - } - delete title; - NS_RELEASE(btn); - } - return nsEventStatus_eIgnore; -} - -/**-------------------------------------------------------------------------------- - * Combox Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK ComboTestHandleEvent(nsGUIEvent *aEvent) -{ - return GenericListHandleEvent(aEvent, "ComboBox", comboBox); -} - - -/**-------------------------------------------------------------------------------- - * ListBox Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK ListBoxTestHandleEvent(nsGUIEvent *aEvent) -{ - return GenericListHandleEvent(aEvent, "ListBox", listBox); -} - -/**-------------------------------------------------------------------------------- - * Multi-ListBox Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK MultiListBoxTestHandleEvent(nsGUIEvent *aEvent) -{ - nsIButton * btn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - nsString str("Multi-ListBox"); - fprintf(gFD, "\nVisually tested Multi-List Box\n"); - - if (NS_OK == aEvent->widget->QueryInterface(kIButtonIID, (void**)&btn)) { - nsAutoString strBuf; - btn->GetLabel(strBuf); - char * title = strBuf.ToNewCString(); - //fprintf(gFD, "Title is [%s]\n", title); - - if (!strcmp(title, kSetSelection)) { - gMultiListBox->Deselect(); - - PRInt32 inxs[] = {0,2,4}; - PRInt32 len = 3; - - for (int i=0;iSelectItem(inxs[i]); - } - fprintf(gFD, "\tTested SelectItem()\n"); - str.Append(" should show 'List Item 0,2,5'"); - statusText->SetText(str); - gFailedMsg = "Multi-List::SelectItem"; - } else if (!strcmp(title, kRemoveSelection)) { - PRInt32 inx = gMultiListBox->FindItem(nsString("List Item 2"), 0); - - if (inx > -1) { - gMultiListBox->RemoveItemAt(inx); - } - fprintf(gFD, "\tTested FindItem(...)\n"); - str.Append(" should show 0,5"); - statusText->SetText(str); - gFailedMsg = "Multi-List::FindItem && RemoveItemAt"; - } - delete title; - NS_RELEASE(btn); - } - return nsEventStatus_eIgnore; - -} - -/**-------------------------------------------------------------------------------- - * Checkbutton Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK CheckButtonTestHandleEvent(nsGUIEvent *aEvent) -{ - nsICheckButton * chkBtn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - fprintf(gFD, "\nVisually tested CheckBox\n"); - - if (NS_OK == aEvent->widget->QueryInterface(kICheckButtonIID, (void**)&chkBtn)) { - fprintf(gFD, "\tGetState and SetState tested.\n"); - chkBtn->SetState((PRBool)!chkBtn->GetState()); - NS_RELEASE(chkBtn); - gFailedMsg = "CheckButton::SetState & GetState"; - } - return nsEventStatus_eIgnore; -} - -/**-------------------------------------------------------------------------------- - * Failed Button Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK FailedButtonHandleEvent(nsGUIEvent *aEvent) -{ - nsIButton * btn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - //fprintf(gFD, "\nVisually tested CheckBox\n"); - - if (NS_OK == aEvent->widget->QueryInterface(kIButtonIID, (void**)&btn)) { - gOverallStatus++; - if (gFailedMsg == nsnull) { - fprintf(gFD, "\n*** Something failed but the msg wan't set correctly in the code!\n"); - } else { - fprintf(gFD, "Method [%s] FAILED!\n", gFailedMsg); - gFailedMsg = nsnull; - } - - } - return nsEventStatus_eIgnore; -} - -/**-------------------------------------------------------------------------------- - * Succeeded Button Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK SucceededButtonHandleEvent(nsGUIEvent *aEvent) -{ - nsIButton * btn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - //fprintf(gFD, "\nVisually tested CheckBox\n"); - - if (NS_OK == aEvent->widget->QueryInterface(kIButtonIID, (void**)&btn)) { - if (gFailedMsg == nsnull) { - fprintf(gFD, "\n*** Something Succeeded but the msg wan't set correctly in the code!\n"); - } else { - fprintf(gFD, "Method [%s] SUCCEEDED!\n", gFailedMsg); - gFailedMsg = nsnull; - } - - } - return nsEventStatus_eIgnore; -} - -/**-------------------------------------------------------------------------------- - * TextWidget Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK GenericTextTestHandleEvent(char *aTitle, - nsGUIEvent *aEvent, - nsITextWidget *aTextWidget, - const nsString &aTestStr, - const nsString &aStrToShow) -{ - nsIButton * btn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - - - if (NS_OK == aEvent->widget->QueryInterface(kIButtonIID, (void**)&btn)) { - nsAutoString strBuf; - nsString str; - btn->GetLabel(strBuf); - char * title = strBuf.ToNewCString(); - - if (!strcmp(title, kSetText)) { - aTextWidget->SetText(aTestStr); - - fprintf(gFD, "\nVisually Testing Text\n"); - - str.Append(" should show["); - str.Append(aStrToShow); - str.Append("]"); - - statusText->SetText(str); - gFailedMsg = "nsITextWidget::SetText"; - } else if (!strcmp(title, kGetText)) { - nsString getStr; - aTextWidget->GetText(getStr, 256); - - fprintf(gFD, "\tTested GetText(...) \n"); - - if (aTestStr.Equals(getStr)) { - str.Append(" Test PASSED"); - fprintf(gFD, "Test PASSED"); - } else { - str.Append(" Test FAILED"); - fprintf(gFD, "Test FAILED"); - } - statusText->SetText(str); - gFailedMsg = "nsITextWidget::GetText"; - } else if (!strcmp(title, kSetCaret)) { - nsString getStr; - aTextWidget->SetCaretPosition(1); - fprintf(gFD, "\tTested SetCaretPosition(1) \n"); - str.Append(" should show caret in position 1"); - statusText->SetText(str); - gFailedMsg = "nsITextWidget::SetCaretPosition"; - } else if (!strcmp(title, kGetCaret)) { - nsString getStr; - PRUint32 pos = aTextWidget->GetCaretPosition(); - - fprintf(gFD, "Visually tested GetCaretPosition(1) \n"); - - if (pos == 1) { - str.Append(" Test PASSED"); - fprintf(gFD, "Test PASSED\n"); - } else { - str.Append(" Test FAILED"); - fprintf(gFD, "Test FAILED\n"); - } - statusText->SetText(str); - gFailedMsg = "nsITextWidget::GetCaretPosition"; - } else if (!strcmp(title, kSetSelection)) { - nsString getStr; - aTextWidget->SetSelection(1,5); - - fprintf(gFD, "\tTested SetSelection(1,5) \n"); - - str.Append(" should show selection from 1 to 5"); - statusText->SetText(str); - gFailedMsg = "nsITextWidget::SetSelection"; - } - delete title; - NS_RELEASE(btn); - } - return nsEventStatus_eIgnore; -} - - -/**-------------------------------------------------------------------------------- - * Button Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK ButtonTestHandleEvent(nsGUIEvent *aEvent) -{ - - nsIButton * btn; - if (aEvent->message != NS_MOUSE_LEFT_BUTTON_UP) { - return nsEventStatus_eIgnore; - } - - if (NS_OK == aEvent->widget->QueryInterface(kIButtonIID, (void**)&btn)) { - nsAutoString strBuf; - nsString str("Tesing "); - btn->GetLabel(strBuf); - char * title = strBuf.ToNewCString(); - - if (!strcmp(title, kHideBtn)) { - movingWidget->Show(PR_FALSE); - str.Append("nsIWidget::Show(FALSE)"); - statusText->SetText(str); - gFailedMsg = "nsIWidget::Show(FALSE)"; - } else if (!strcmp(title, kShowBtn)) { - movingWidget->Show(PR_TRUE); - str.Append("nsIWidget::Show(TRUE)"); - statusText->SetText(str); - gFailedMsg = "nsIWidget::Show(TRUE)"; - } - - delete title; - NS_RELEASE(btn); - - } - return nsEventStatus_eIgnore; -} - -/**-------------------------------------------------------------------------------- - * TextWidget Test Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK PasswordTextTestHandleEvent(nsGUIEvent *aEvent) -{ - return GenericTextTestHandleEvent("Password", aEvent, passwordText, nsString("123"), nsString("***")); -} - -/**-------------------------------------------------------------------------------- - * Dumps the size of the main window and all child windows - *-------------------------------------------------------------------------------- - */ - -void DumpRects() -{ - nsRect rect; - // print the main window position - window->GetBounds(rect); - printf("Bounds(%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height); - - // print all children's position - nsIEnumerator *enumerator = window->GetChildren(); - nsISupports * widget; - while (widget = enumerator->Next()) { - nsIWidget *child; - if (NS_OK == widget->QueryInterface(kIWidgetIID, (void**)&child)) { - // - child->GetBounds(rect); - printf("Bounds(%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height); - NS_RELEASE(child); - } - NS_RELEASE(widget); - } - - NS_RELEASE(enumerator); - delete enumerator; -} - - -/**-------------------------------------------------------------------------------- - * Main Handler - *-------------------------------------------------------------------------------- - */ -nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent) -{ - // printf("aEvent->message %d\n", aEvent->message); - nsEventStatus result = nsEventStatus_eIgnore; - switch(aEvent->message) { - - case NS_MOVE: - char str[256]; - sprintf(str, "Moved window to %d,%d", aEvent->point.x, aEvent->point.y); - statusText->SetText(str); - break; - - case NS_MOUSE_LEFT_DOUBLECLICK: - statusText->SetText("Left button double click"); - break; - - case NS_MOUSE_RIGHT_DOUBLECLICK: - statusText->SetText("Right button double click"); - break; - - case NS_MOUSE_ENTER: - if (DEBUG_MOUSE) printf("NS_MOUSE_ENTER 0x%X\n", aEvent->widget); - break; - - case NS_MOUSE_EXIT: - if (DEBUG_MOUSE) printf("NS_MOUSE_EXIT 0x%X\n", aEvent->widget); - break; - - case NS_MOUSE_MOVE: - if (DEBUG_MOUSE) printf("NS_MOUSE_MOVE\n"); - break; - - case NS_MOUSE_LEFT_BUTTON_UP: - if (DEBUG_MOUSE) printf("NS_MOUSE_LEFT_BUTTON_UP\n"); - break; - - - case NS_MOUSE_LEFT_BUTTON_DOWN: - if (DEBUG_MOUSE) printf("NS_MOUSE_LEFT_BUTTON_DOWN\n"); - break; - - case NS_CREATE: - printf("Window Created\n"); - break; - - case NS_PAINT: - // paint the background - if (aEvent->widget == window) { - nsIRenderingContext *drawCtx = ((nsPaintEvent*)aEvent)->renderingContext; - drawCtx->SetColor(aEvent->widget->GetBackgroundColor()); - drawCtx->FillRect(*(((nsPaintEvent*)aEvent)->rect)); - - return nsEventStatus_eIgnore; - } - break; - - case NS_DESTROY: - printf("Destroy Window...Release window\n"); - fprintf(gFD, "\n\n--------------------------------------------------\n"); - fprintf(gFD, "Summary of non-visual tests, Number of Failures %d\n", gNonVisualStatus); - fprintf(gFD, "Summary of visual tests, Number of Failures %d\n", gOverallStatus-gNonVisualStatus); - fprintf(gFD, "Summary of all tests, Number of Failures %d\n", gOverallStatus); - fprintf(gFD, "--------------------------------------------------\n"); - fflush(gFD); - fclose(gFD); - - exit(0); // for now - - break; - - - case NS_SCROLLBAR_POS: - case NS_SCROLLBAR_PAGE_NEXT: - case NS_SCROLLBAR_PAGE_PREV: - case NS_SCROLLBAR_LINE_NEXT: - case NS_SCROLLBAR_LINE_PREV: - if (nsnull != movingWidget) { - PRUint32 pos = scrollbar->GetPosition(); - movingWidget->Move(10, pos); - } - break; - - case NS_KEY_UP: { - nsKeyEvent * ke = (nsKeyEvent*)aEvent; - char str[256]; - sprintf(str, "Key Event Key Code[%d] Key [%c] Shift [%s] Control [%s] Alt [%s]", - ke->keyCode, ke->keyCode, - (ke->isShift?"Pressed":"Released"), - (ke->isControl?"Pressed":"Released"), - (ke->isAlt?"Pressed":"Released")); - printf("%s\n", str); - statusText->SetText(nsString(str)); - } - break; - - - default: - result = nsEventStatus_eIgnore; - } - //printf("result: %d = %d\n", result, PR_FALSE); - - return result; -} - - - -nsEventStatus PR_CALLBACK HandleFileButtonEvent(nsGUIEvent *aEvent) -{ - switch(aEvent->message) { - - case NS_MOUSE_LEFT_BUTTON_UP: - // create a FileWidget - // - nsIFileWidget *fileWidget; - - nsString title("FileWidget Title mode = save"); - NSRepository::CreateInstance(kCFileWidgetCID, nsnull, kIFileWidgetIID, (LPVOID*)&fileWidget); - - nsString titles[] = {"all files","html","executables" }; - nsString filters[] = {"*.*", "*.html", "*.exe" }; - fileWidget->SetFilterList(3, titles, filters); - fileWidget->Create(nsnull, - title, - eMode_save, - nsnull, - nsnull); - - PRUint32 result = fileWidget->Show(); - if (result) { - nsString file; - fileWidget->GetFile(file); - printf("file widget contents %s\n", file.ToNewCString()); - statusText->SetText(file.ToNewCString()); - } - else - statusText->SetText("Cancel selected"); - - - NS_RELEASE(fileWidget); - break; - } - - return(nsEventStatus_eConsumeDoDefault); -} - -/*-------------------------------------------------------------------------------- - * Tab change handler - *-------------------------------------------------------------------------------- - */ - -nsEventStatus PR_CALLBACK HandleTabEvent(nsGUIEvent *aEvent) -{ - switch(aEvent->message) { - - case NS_TABCHANGE: - PRUint32 tab = tabWidget->GetSelectedTab(); - char buf[256]; - sprintf(buf, "Selected tab %d", tab); - statusText->SetText(buf); - break; - } - - return(nsEventStatus_eConsumeDoDefault); -} - - - - -/**-------------------------------------------------------------------------------- - * - */ -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, - int nCmdShow) -{ - // Open global test log file - gFD = fopen(gLogFileName, "w"); - if (gFD == nsnull) { - fprintf(stderr, "Couldn't open file[%s]\n", gLogFileName); - exit(1); - } - - // register widget classes - NSRepository::RegisterFactory(kCWindowCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCChildCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCButtonCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCCheckButtonCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCComboBoxCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFileWidgetCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCListBoxCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCRadioButtonCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCRadioGroupCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCHorzScrollbarCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCVertScrollbarCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTextAreaCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTextFieldCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCTabWidgetCID, "raptorwidget.dll", PR_FALSE, PR_FALSE); - - static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID); - - - NSRepository::RegisterFactory(kCRenderingContextIID, "raptorgfxwin.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCDeviceContextIID, "raptorgfxwin.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCFontMetricsIID, "raptorgfxwin.dll", PR_FALSE, PR_FALSE); - NSRepository::RegisterFactory(kCImageIID, "raptorgfxwin.dll", PR_FALSE, PR_FALSE); - - nsIDeviceContext* deviceContext = 0; - - // Create a device context for the widgets - nsresult res; - - static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID); - - res = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&deviceContext); - - if (NS_OK == res) - { - deviceContext->Init(); - NS_ADDREF(deviceContext); - } - - // - // create the main window - // - NSRepository::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (LPVOID*)&window); - nsRect rect(100, 100, 600, 700); - - window->Create((nsIWidget*)NULL, rect, HandleEvent, NULL); - window->SetTitle("TOP-LEVEL window"); - - // - // create a child - // - nsIWidget *child; - // - // create another child - // - - int x = 10; - int y = 10; - rect.SetRect(x, y, 200, 100); - NSRepository::CreateInstance(kCChildCID, nsnull, kIWidgetIID, (LPVOID*)&child); - - - child->SetBorderStyle(eBorderStyle_dialog); - child->Create(window, rect, HandleEvent, NULL); - //child->SetBackgroundColor(NS_RGB(255, 255, 0)); - child->SetForegroundColor(NS_RGB(255, 0, 0)); - NS_RELEASE(child); // the parent keeps a reference on this child - - y += rect.height + 5; - - - // - // create a button - // - nsIButton *button; - rect.SetRect(x, y, 60, 25); - NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (LPVOID*)&button); - button->Create(window, rect, HandleEvent, NULL); - nsString label("Slider"); - button->SetLabel(label); - - nsAutoString strBuf; - button->GetLabel(strBuf); - button->Show(PR_TRUE); - - movingWidget = button; - - x = createTestButton(window, kHideBtn, x+180, y, 75, ButtonTestHandleEvent); - x = createTestButton(window, kShowBtn, x+5, y, 75, ButtonTestHandleEvent); - x = 10; - y += rect.height + 5; - - // Create browse button - x = createTestButton(window, kBrowseBtn, x, y, 75, HandleFileButtonEvent); - x = 10; - y += rect.height + 5; - - // - // create a check button - // - nsICheckButton * checkButton; - rect.SetRect(x, y, 100, 25); - - NSRepository::CreateInstance(kCCheckButtonCID, nsnull, kICheckButtonIID, (LPVOID*)&checkButton); - checkButton->Create(window, rect, CheckButtonTestHandleEvent, NULL); - nsString cbLabel("CheckButton"); - checkButton->SetLabel(cbLabel); - NS_RELEASE(checkButton); - y += rect.height + 5; - - // - // create a text widget - // - - nsITextWidget * textWidget; - rect.SetRect(x, y, 100, 25); - - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&textWidget); - textWidget->Create(window, rect, HandleEvent, deviceContext); - - - nsFont font("Times", NS_FONT_STYLE_NORMAL, - NS_FONT_VARIANT_NORMAL, - NS_FONT_WEIGHT_BOLD, - 0, - 12); - - textWidget->SetFont(font); - nsString initialText("0123456789"); - textWidget->SetText(initialText); - textWidget->SetMaxTextLength(12); - textWidget->SelectAll(); - - NS_RELEASE(textWidget); - y += rect.height + 5; - - // - // create a text password widget - // - - nsITextWidget * ptextWidget; - rect.SetRect(x, y, 100, 25); - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&ptextWidget); - ptextWidget->SetPassword(PR_TRUE); - ptextWidget->Create(window, rect, HandleEvent, NULL); - nsString pinitialText("password text"); - ptextWidget->SetText(pinitialText); - passwordText = ptextWidget; - - textShelfTest(gFD, "Password Text", passwordText); - - x = createTestButton(window, kSetCaret, x+180, y, 75, PasswordTextTestHandleEvent); - x = createTestButton(window, kGetCaret, x+5, y, 75, PasswordTextTestHandleEvent); - x = createTestButton(window, kSetText, x+5, y, 75, PasswordTextTestHandleEvent); - x = createTestButton(window, kGetText, x+5, y, 75, PasswordTextTestHandleEvent); - x = createTestButton(window, kSetSelection, x+5, y, 100, PasswordTextTestHandleEvent); - x = 10; - y += rect.height + 5; - - // - // create a readonly text widget - // - - nsITextWidget * rtextWidget; - rect.SetRect(x, y, 100, 25); - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&rtextWidget); - rtextWidget->SetReadOnly(PR_TRUE); - rtextWidget->Create(window, rect, HandleEvent, NULL); - nsString rinitialText("This is readonly"); - rtextWidget->SetText(rinitialText); - NS_RELEASE(rtextWidget); - y += rect.height + 5; - - // - // create a text area widget - // - - nsITextAreaWidget * textAreaWidget; - rect.SetRect(x, y, 150, 100); - NSRepository::CreateInstance(kCTextAreaCID, nsnull, kITextAreaWidgetIID, (LPVOID*)&textAreaWidget); - textAreaWidget->Create(window, rect, HandleEvent, NULL); - nsString textAreaInitialText("Text Area Widget"); - textWidgetInstance = textAreaWidget; - textAreaWidget->SetText(textAreaInitialText); - NS_RELEASE(textAreaWidget); - y += rect.height + 5; - - x += rect.width + 5; - - // - // create a scrollbar - // - rect.SetRect(x, 10, 25, 300); - NSRepository::CreateInstance(kCVertScrollbarCID, nsnull, kIScrollbarIID, (LPVOID*)&scrollbar); - scrollbar->Create(window, rect, HandleEvent, NULL); - scrollbar->SetMaxRange(300); - scrollbar->SetThumbSize(50); - scrollbar->SetPosition(100); - - // - // create a Status Text - // - - rect.SetRect(x+25, 10, 350, 25); - NSRepository::CreateInstance(kCTextFieldCID, nsnull, kITextWidgetIID, (LPVOID*)&statusText); - statusText->Create(window, rect, HandleEvent, deviceContext); - - // - // create a Failed Button - // - rect.SetRect(x+25, 38, 60, 25); - NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (LPVOID*)&button); - button->Create(window, rect, FailedButtonHandleEvent, NULL); - nsString failedLabel("Failed"); - button->SetLabel(failedLabel); - button->Show(PR_TRUE); - NS_RELEASE(button); - y += rect.height + 5; - - // - // create a Succeeded Button - // - rect.SetRect(x+100, 38, 80, 25); - NSRepository::CreateInstance(kCButtonCID, nsnull, kIButtonIID, (LPVOID*)&button); - button->Create(window, rect, SucceededButtonHandleEvent, NULL); - nsString succeededLabel("Succeeded"); - button->SetLabel(succeededLabel); - button->Show(PR_TRUE); - NS_RELEASE(button); - y += rect.height + 5; - - x = 10; - - - // - // create a listbox widget - // - - rect.SetRect(x, y, 150, 100); - NSRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (LPVOID*)&listBox); - listBox->Create(window, rect, HandleEvent, NULL); - char str[256]; - for (int i=0;iAddItemAt(listStr1, i); - } - listSelfTest(gFD, "ListBox", listBox); - - x = createTestButton(window, kSetSelection, x+150, y, 125, ListBoxTestHandleEvent); - x = createTestButton(window, kRemoveSelection, x+5, y, 125, ListBoxTestHandleEvent); - x = 10; - y += rect.height + 5; - - - // - // create a multi-selection listbox widget - // - - rect.SetRect(x, y, 150, 100); - NSRepository::CreateInstance(kCListBoxCID, nsnull, kIListBoxIID, (LPVOID*)&gMultiListBox); - // Notice the extra agrument PR_TRUE below which indicates that - // the list widget is multi-select - gMultiListBox->SetMultipleSelection(PR_TRUE); - gMultiListBox->Create(window, rect, HandleEvent, NULL); - for (i=0;iAddItemAt(listStr1, i); - } - multiListSelfTest(gFD, "Multi-ListBox", gMultiListBox); - - x = createTestButton(window, kSetSelection, x+150, y, 125, MultiListBoxTestHandleEvent); - x = createTestButton(window, kRemoveSelection, x+5, y, 125, MultiListBoxTestHandleEvent); - - y += rect.height + 5; - x = 10; - - // - // create a tab widget - // - - rect.SetRect(x, y, 300, 50); - NSRepository::CreateInstance(kCTabWidgetCID, nsnull, kITabWidgetIID, (LPVOID*)&tabWidget); - tabWidget->Create(window, rect, HandleTabEvent, NULL); - nsString tabs[] = {"low", "medium", "high" }; - - tabWidget->SetTabs(3, tabs); - tabWidget->Show(PR_TRUE); - y += rect.height + 5; - x = 10; - - // - // create a Radio Group - // - nsIRadioGroup * radioGroup; - NSRepository::CreateInstance(kCRadioGroupCID, nsnull, kIRadioGroupIID, (LPVOID*)&radioGroup); - radioGroup->SetName(nsString("Group1")); - - // - // create a Radio button - // - nsIRadioButton * radioButton; - rect.SetRect(x, y, 120, 25); - - NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (LPVOID*)&radioButton); - radioButton->SetRadioGroup(radioGroup); - radioButton->Create(window, rect, HandleEvent, NULL); - nsString rbLabel("RadioButton1"); - radioButton->SetLabel(rbLabel); - radioButton->Show(PR_TRUE); - NS_RELEASE(radioButton); - y += rect.height + 5; - - // - // create a Radio button - // - rect.SetRect(x, y, 120, 25); - - NSRepository::CreateInstance(kCRadioButtonCID, nsnull, kIRadioButtonIID, (LPVOID*)&radioButton); - radioButton->SetRadioGroup(radioGroup); - radioButton->Create(window, rect, HandleEvent, NULL); - nsString rbLabel2("RadioButton2"); - radioButton->SetLabel(rbLabel2); - radioButton->Show(PR_TRUE); - NS_RELEASE(radioButton); - y += rect.height + 5; - - // [TODO] implement a test here to see if the radio group exists - // radioGroup = NULL; - - //window->SetBackgroundColor(NS_RGB(0,255,0)); - - // - // create a ComboBox - // - rect.SetRect(x, y, 120, 100); - - NSRepository::CreateInstance(kCComboBoxCID, nsnull, kIComboBoxIID, (LPVOID*)&comboBox); - comboBox->Create(window, rect, HandleEvent, NULL); - for (i=0;iAddItemAt(listStr1, i); - } - listSelfTest(gFD, "ComboBox", comboBox); - NS_RELEASE(comboBox); - - x = createTestButton(window, kSetSelection, x+125, y, 125, ComboTestHandleEvent); - x = createTestButton(window, kRemoveSelection, x+5, y, 125, ComboTestHandleEvent); - - x = 10; - y += 30; - - - nsString status("The non-visual tests: "); - status.Append(eval(gOverallStatus)); - gNonVisualStatus = gOverallStatus; - - statusText->SetText(status); - - // show - window->Show(PR_TRUE); - - window->SetCursor(eCursor_hyperlink); - - // Process messages - MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return msg.wParam; -} - -void main(int argc, char **argv) -{ - WinMain(GetModuleHandle(NULL), NULL, 0, SW_SHOW); -} - diff --git a/mozilla/xpcom/ds/nsArena.cpp b/mozilla/xpcom/ds/nsArena.cpp deleted file mode 100644 index a38ef687f58..00000000000 --- a/mozilla/xpcom/ds/nsArena.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIArena.h" -#include "nsCRT.h" - -#define PL_ARENA_CONST_ALIGN_MASK 7 -#include "plarena.h" - -static NS_DEFINE_IID(kArenaIID, NS_IARENA_IID); - -// Simple arena implementation layered on plarena -class ArenaImpl : public nsIArena { -public: - ArenaImpl(PRInt32 aBlockSize); - - NS_DECL_ISUPPORTS - - virtual void* Alloc(PRInt32 aSize); - -protected: - ~ArenaImpl(); - - PLArenaPool mPool; - PRInt32 mBlockSize; -}; - -ArenaImpl::ArenaImpl(PRInt32 aBlockSize) -{ - NS_INIT_REFCNT(); - if (aBlockSize < NS_MIN_ARENA_BLOCK_SIZE) { - aBlockSize = NS_DEFAULT_ARENA_BLOCK_SIZE; - } - PL_INIT_ARENA_POOL(&mPool, "nsIArena", aBlockSize); - mBlockSize = aBlockSize; -} - -NS_IMPL_ISUPPORTS(ArenaImpl,kArenaIID) - -ArenaImpl::~ArenaImpl() -{ - PL_FinishArenaPool(&mPool); -} - -void* ArenaImpl::Alloc(PRInt32 size) -{ - // Adjust size so that it's a multiple of sizeof(double) - PRInt32 align = size & (sizeof(double) - 1); - if (0 != align) { - size += sizeof(double) - align; - } - - void* p; - PL_ARENA_ALLOCATE(p, &mPool, size); - return p; -} - -NS_BASE nsresult NS_NewHeapArena(nsIArena** aInstancePtrResult, - PRInt32 aArenaBlockSize) -{ - ArenaImpl* it = new ArenaImpl(aArenaBlockSize); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kArenaIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/xpcom/ds/nsAtomTable.cpp b/mozilla/xpcom/ds/nsAtomTable.cpp deleted file mode 100644 index 75998008cb5..00000000000 --- a/mozilla/xpcom/ds/nsAtomTable.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIAtom.h" -#include "nsString.h" -#include "nsCRT.h" -#include "plhash.h" - -/** - * The shared hash table for atom lookups. - */ -static nsrefcnt gAtoms; -static struct PLHashTable* gAtomHashTable; - -class AtomImpl : public nsIAtom { -public: - AtomImpl(); - ~AtomImpl(); - - NS_DECL_ISUPPORTS - - void* operator new(size_t size, const PRUnichar* us, PRInt32 uslen); - - virtual void ToString(nsString& aBuf) const; - - virtual const PRUnichar* GetUnicode() const; - - // Actually more; 0 terminated. This slot is reserved for the - // terminating zero. - PRUnichar mString[1]; -}; - -AtomImpl::AtomImpl() -{ - NS_INIT_REFCNT(); - // Every live atom holds a reference on the atom hashtable - gAtoms++; -} - -AtomImpl::~AtomImpl() -{ - NS_PRECONDITION(nsnull != gAtomHashTable, "null atom hashtable"); - if (nsnull != gAtomHashTable) { - PL_HashTableRemove(gAtomHashTable, mString); - nsrefcnt cnt = --gAtoms; - if (0 == cnt) { - // When the last atom is destroyed, the atom arena is destroyed - NS_ASSERTION(0 == gAtomHashTable->nentries, "bad atom table"); - PL_HashTableDestroy(gAtomHashTable); - gAtomHashTable = nsnull; - } - } -} - -static NS_DEFINE_IID(kIAtomIID, NS_IATOM_IID); -NS_IMPL_ISUPPORTS(AtomImpl, kIAtomIID); - -void* AtomImpl::operator new(size_t size, const PRUnichar* us, PRInt32 uslen) -{ - size = size + uslen * sizeof(PRUnichar); - AtomImpl* ii = (AtomImpl*) new char[size]; - nsCRT::memcpy(ii->mString, us, uslen * sizeof(PRUnichar)); - ii->mString[uslen] = 0; - return ii; -} - -void AtomImpl::ToString(nsString& aBuf) const -{ - aBuf.SetLength(0); - aBuf.Append(mString, nsCRT::strlen(mString)); -} - -const PRUnichar* AtomImpl::GetUnicode() const -{ - return mString; -} - -//---------------------------------------------------------------------- - -static PLHashNumber HashKey(const PRUnichar* k) -{ - return (PLHashNumber) nsCRT::HashCode(k); -} - -static PRIntn CompareKeys(const PRUnichar* k1, const PRUnichar* k2) -{ - return nsCRT::strcmp(k1, k2) == 0; -} - -NS_BASE nsIAtom* NS_NewAtom(const char* isolatin1) -{ - nsAutoString tmp(isolatin1); - return NS_NewAtom(tmp.GetUnicode()); -} - -NS_BASE nsIAtom* NS_NewAtom(const nsString& aString) -{ - return NS_NewAtom(aString.GetUnicode()); -} - -NS_BASE nsIAtom* NS_NewAtom(const PRUnichar* us) -{ - if (nsnull == gAtomHashTable) { - gAtomHashTable = PL_NewHashTable(8, (PLHashFunction) HashKey, - (PLHashComparator) CompareKeys, - (PLHashComparator) nsnull, - nsnull, nsnull); - } - PRInt32 uslen; - PRInt32 hashCode = nsCRT::HashCode(us, &uslen); - PLHashEntry** hep = PL_HashTableRawLookup(gAtomHashTable, hashCode, us); - PLHashEntry* he = *hep; - if (nsnull != he) { - nsIAtom* id = (nsIAtom*) he->value; - NS_ADDREF(id); - return id; - } - AtomImpl* id = new(us, uslen) AtomImpl(); - PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id); - NS_ADDREF(id); - return id; -} - -NS_BASE nsrefcnt NS_GetNumberOfAtoms(void) -{ - if (nsnull != gAtomHashTable) { - NS_PRECONDITION(nsrefcnt(gAtomHashTable->nentries) == gAtoms, "bad atom table"); - } - return gAtoms; -} diff --git a/mozilla/xpcom/ds/nsBTree.cpp b/mozilla/xpcom/ds/nsBTree.cpp deleted file mode 100644 index a771d94aaac..00000000000 --- a/mozilla/xpcom/ds/nsBTree.cpp +++ /dev/null @@ -1,403 +0,0 @@ - -/** - * This file defines the binary tree class and it - * nsNode child class. - * - * This simple version stores nodes, and the - * nodes store void* ptrs. - * - * @update gess 4/11/98 - * @param - * @return - */ - -#include "nsBTree.h" - -/** - * default constructor - * - * @update gess 4/11/98 - */ -nsNode::nsNode(){ - mLeft=0; - mRight=0; - mParent=0; - mColor=eBlack; -} - - -/** - * Copy constructor - * - * @update gess 4/11/98 - * @param - * @return - */ -nsNode::nsNode(const nsNode& aNode){ - mLeft=aNode.mLeft; - mRight=aNode.mRight; - mParent=aNode.mParent; - mColor=aNode.mColor; -} - -/** - * destructor - * - * @update gess 4/11/98 - */ -nsNode::~nsNode(){ -} - -/** - * Retrive ptr to parent node - * - * @update gess 4/11/98 - * @return ptr to parent node - */ -nsNode* nsNode::GetParentNode(void) const{ - return mParent; -} - -/** - * Retrieve ptr to left (less) node - * - * @update gess 4/11/98 - * @return ptr to left (may be NULL) - */ -nsNode* nsNode::GetLeftNode(void) const{ - return mLeft; -} - -/** - * Retrieve ptr to right (more) node - * - * @update gess 4/11/98 - * @return ptr to right node (may be NULL) - */ -nsNode* nsNode::GetRightNode(void) const{ - return mRight; -} - - -/** - * - * - * @update gess 4/11/98 - * @param - * @return - */ -nsNode& nsNode::operator=(const nsNode& aNode){ - if(this!=&aNode){ - mLeft=aNode.mLeft; - mRight=aNode.mRight; - mParent=aNode.mParent; - mColor=aNode.mColor; - } - return *this; -} - -/******************************************************** - * Here comes the BTREE class... - ********************************************************/ - -/** - * nsBTree constructor - * - * @update gess 4/11/98 - */ -nsBTree::nsBTree(){ - mRoot=0; -} - - -/** - * destructor - * - * @update gess 4/11/98 - */ -nsBTree::~nsBTree(){ - if(mRoot){ - //walk the tree and destroy the children. - } -} - -/** - * Given a node, we're supposed to add it into - * our tree. - * - * @update gess 4/11/98 - * @param aNode to be added to tree - * @return ptr to added node or NULL - */ -nsNode* nsBTree::Add(nsNode& aNode){ - PRBool result=PR_TRUE; - - nsNode* node1=mRoot; //x - nsNode* node2=0; //y - while(node1) { - node2=node1; - if(aNode<*node1) - node1=node1->mLeft; - else node1=node1->mRight; - } - aNode.mParent=node2; - if(!node2){ - mRoot=&aNode; - } - else{ - if(aNode<*node2) - node2->mLeft=&aNode; - else node2->mRight=&aNode; - } - - return &aNode; -} - - -/** - * Removes given node from tree if present. - * - * @update gess 4/11/98 - * @param aNode to be found and removed - * @return ptr to remove node, or NULL - */ -nsNode* nsBTree::Remove(nsNode& aNode){ - nsNode* result=0; - nsNode* node3=Find(aNode); - - if(node3) { - nsNode* node1; - nsNode* node2; - - if((!node3->mLeft) || (!node3->mRight)) - node2=node3; - else node2=After(*node3); - - if(node2->mLeft) - node1=node2->mLeft; - else node1=node2->mRight; - - if(node1) - node1->mParent=node2->mParent; - - if(node2->mParent) { - if(node2==node2->mParent->mLeft) - node2->mParent->mLeft=node1; - else node2->mParent->mRight=node1; - } - else mRoot=node1; - - if(node2!=node3) - (*node3)==(*node2); - - if(node2->mColor == nsNode::eBlack) - ReBalance(*node1); - - delete node2; - result=&aNode; - } - return result; -} - -/** - * Clears the tree of any data. - * Be careful here if your objects are heap based! - * This method doesn't free the objects, so if you - * don't have your own pointers, they will become - * orphaned. - * - * @update gess 4/11/98 - * @param - * @return this - */ -nsBTree& nsBTree::Empty(nsNode* aNode) { - mRoot=0; - return *this; -} - -/** - * This method destroys all the objects in the tree. - * WARNING: Never call this method on stored objects - * that are stack-based! - * - * @update gess 4/11/98 - * @param - * @return this - */ -nsBTree& nsBTree::Erase(nsNode* aNode){ - nsNode* node1 =(aNode) ? aNode : mRoot; - - if(aNode) { - Erase(aNode->mLeft); //begin by walking left side - Erase(aNode->mRight); //then search right side - delete aNode; //until a leaf, then delete - } - return *this; -} - -/** - * Retrieve ptr to first node in tree - * - * @update gess 4/11/98 - * @return - */ -nsNode* nsBTree::First(void) const{ - if(mRoot) - return First(*mRoot); - return 0; -} - -/** - * Retrive ptr to first node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to first node from given node or NULL - */ -nsNode* nsBTree::First(const nsNode& aNode) const{ - nsNode* result=0; - - if(mRoot) { - result=mRoot; - while(result->GetLeftNode()) { - result=result->GetLeftNode(); - } - } - return result; -} - -/** - * Retrive ptr to last node - * - * @update gess 4/11/98 - * @return ptr to last node rel to root or NULL - */ -nsNode* nsBTree::Last(void) const{ - if(mRoot) - return Last(*mRoot); - return 0; -} - -/** - * Retrive ptr to last node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to first node from given node or NULL - */ -nsNode* nsBTree::Last(const nsNode& aNode) const{ - nsNode* result=0; - - if(mRoot) { - result=mRoot; - while(result->GetRightNode()) { - result=result->GetRightNode(); - } - } - return result; -} - - -/** - * Retrive ptr to prior node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to prior node from given node or NULL - */ -nsNode* nsBTree::Before(const nsNode& aNode) const{ - - if(aNode.GetLeftNode()) - return Last(*aNode.GetLeftNode()); - - //otherwise... - - nsNode* node1=(nsNode*)&aNode; - nsNode* node2=aNode.GetParentNode(); - - while((node2) && (node1==node2->GetLeftNode())) { - node1=node2; - node2=node2->GetParentNode(); - } - return node2; -} - - -/** - * Retrive ptr to next node rel to given node - * - * @update gess 4/11/98 - * @param node to begin scan from - * @return ptr to next node from given node or NULL - */ -nsNode* nsBTree::After(const nsNode& aNode) const{ - - if(aNode.GetRightNode()) - return First(*aNode.GetRightNode()); - - //otherwise... - - nsNode* node1=(nsNode*)&aNode; - nsNode* node2=aNode.GetParentNode(); - - while((node2) && (node1==node2->GetRightNode())) { - node1=node2; - node2=node2->GetParentNode(); - } - - return node2; -} - -/** - * Scan for given node - * - * @update gess 4/11/98 - * @param node to find - * @return ptr to given node, or NULL - */ -nsNode* nsBTree::Find(const nsNode& aNode) const{ - nsNode* result=mRoot; - - while((result) && (!(aNode==(*result)))) { - if(aNode<*result) - result=result->mLeft; - else result=result->mRight; - } - return (nsNode*)result; -} - -/** - * Rebalances tree around the given node. This only - * needs to be called after a node is deleted. - * This method does nothing for btrees, but is - * needed for RBTrees. - * - * @update gess 4/11/98 - * @param aNode -- node to balance around - * @return this - */ -nsBTree& nsBTree::ReBalance(nsNode& aNode){ - return *this; -} - - -/** - * - * - * @update gess 4/11/98 - * @param - * @return - */ -const nsBTree& nsBTree::ForEach(nsNodeFunctor& aFunctor,nsNode* aNode) const{ - nsNode* node1 =(aNode) ? aNode : mRoot; - - if(node1) { - if(node1->mLeft) - ForEach(aFunctor,node1->mLeft); //begin by walking left side - aFunctor(*node1); - if(node1->mRight) - ForEach(aFunctor,node1->mRight); //then search right side - } - return *this; -} - diff --git a/mozilla/xpcom/ds/nsBTree.h b/mozilla/xpcom/ds/nsBTree.h deleted file mode 100644 index 62b79b8b654..00000000000 --- a/mozilla/xpcom/ds/nsBTree.h +++ /dev/null @@ -1,283 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/** - * This file defines the binary tree class and it - * nsNode child class. Note that like all nsBTree - * containers, this one does not automatically balance. - * (Find for random data, bad for pre-ordered data). - * - * This simple version stores nodes, and the - * nodes store void* ptrs. - * - * @update gess 4/11/98 - */ - - -/** - * nsNode - * - * @update gess 4/11/98 - * @param - * @return - */ - -#ifndef _BTREE_H -#define _BTREE_H - -#include "nscore.h" - -struct NS_BASE nsNode { - - /** - * - * @update gess4/20/98 - * @param - * @return - */ - nsNode(); - - /** - * Copy constructor - * @update gess 4/11/98 - */ - nsNode(const nsNode& aNode); - - /** - * destructor - * @update gess 4/11/98 - */ - virtual ~nsNode(); - - /** - * Retrieve parent node - * - * @update gess 4/11/98 - * @return - */ - nsNode* GetParentNode(void) const; - - /** - * - * @update gess 4/11/98 - * @param - * @return - */ - nsNode* GetLeftNode() const; - - /** - * - * @update gess 4/11/98 - * @param - * @return - */ - nsNode* GetRightNode() const; - - /** - * - * @update gess 4/11/98 - * @param - * @return - */ - virtual nsNode& operator=(const nsNode& aNode); - - - /** - * This method gets called to determine which of - * two nodes is less. When you create your own - * subclass of nsNode, this is the most important - * method for you to overload. - * - * @update gess 4/11/98 - * @param - * @return - */ - virtual PRBool operator<(const nsNode& aNode) const=0; - - /** - * This method gets called to determine which of - * two nodes is less. When you create your own - * subclass of nsNode, this is the most important - * method for you to overload. - * - * @update gess 4/11/98 - * @param - * @return - */ - virtual PRBool operator==(const nsNode& aNode) const=0; - - enum eRBColor {eRed,eBlack}; - - nsNode* mParent; - nsNode* mLeft; - nsNode* mRight; - eRBColor mColor; -}; - -/** - * The Nodefunctor class is used when you want to create - * callbacks between the nsRBTree and your generic code. - * - * @update gess4/20/98 - */ -class NS_BASE nsNodeFunctor { -public: - virtual nsNodeFunctor& operator()(nsNode& aNode)=0; -}; - - -/**************************************************** - * Here comes the nsBTree class... - ****************************************************/ - -class NS_BASE nsBTree { -public: -friend class nsBTreeIterator; - - nsBTree(); - ~nsBTree(); - - /** - * Add given node reference into our tree. - * - * @update gess 4/11/98 - * @param aNode is a ref to a node to be added - * @return newly added node - */ - nsNode* Add(nsNode& aNode); - - /** - * Remove given node reference into our tree. - * - * @update gess 4/11/98 - * @param aNode is a ref to a node to be removed - * @return Ptr to node if found (and removed) or NULL - */ - nsNode* Remove(nsNode& aNode); - - /** - * Clears the tree of any data. - * Be careful here if your objects are heap based! - * This method doesn't free the objects, so if you - * don't have your own pointers, they will become - * orphaned. - * - * @update gess 4/11/98 - * @param - * @return this - */ - nsBTree& Empty(nsNode* aNode=0); - - /** - * This method destroys all the objects in the tree. - * WARNING: Never call this method on stored objects - * that are stack-based! - * - * @update gess 4/11/98 - * @param - * @return this - */ - nsBTree& Erase(nsNode* aNode=0); - - /** - * Retrieve ptr to 1st node in tree (starting at root) - * - * @update gess 4/11/98 - * @return ptr to 1st node, possible to be NULL - */ - nsNode* First(void) const; - - /** - * Find first node in tree starting at given node - * - * @update gess 4/11/98 - * @param aNode node to begin 1st search from - * @return ptr to 1st node below given node - */ - nsNode* First(const nsNode& aNode) const; - - /** - * Retrieve ptr to last node in tree relative to root. - * - * @update gess 4/11/98 - * @return ptr to last node or NULL - */ - nsNode* Last(void) const; - - /** - * Retrieve ptr to last node in tree relative to given node. - * - * @update gess 4/11/98 - * @param node to find last node from - * @return ptr to last node or NULL - */ - nsNode* Last(const nsNode& aNode) const; - - /** - * Retrieve a ptr to the node that preceeds given node - * - * @update gess 4/11/98 - * @param aNode used as reference to find prev. - * @return ptr to prev node or NULL - */ - nsNode* Before(const nsNode& aNode) const; - - /** - * Retrieve a ptr to the node after given node - * - * @update gess 4/11/98 - * @param aNode used as reference to find next. - * @return ptr to next node or NULL - */ - nsNode* After(const nsNode& aNode) const; - - /** - * Find given node in tree. - * (Why would you want to find a node you already have?) - * - * @update gess 4/11/98 - * @param aNode is the node you're searching for - * @return ptr to node if found, or NULL - */ - nsNode* Find(const nsNode& aNode) const; - - /** - * Walks the tree, starting with root. - * - * @update gess 4/11/98 - */ - virtual const nsBTree& ForEach(nsNodeFunctor& aFunctor,nsNode* aNode=0) const; - -protected: - - /** - * Rebalances tree around the given node. This only - * needs to be called after a node is deleted. - * - * @update gess 4/11/98 - * @param aNode -- node to balance around - * @return this - */ - virtual nsBTree& ReBalance(nsNode& aNode); - - - nsNode* mRoot; -}; - -#endif - diff --git a/mozilla/xpcom/ds/nsByteBuffer.cpp b/mozilla/xpcom/ds/nsByteBuffer.cpp deleted file mode 100644 index a27f8cbf2c9..00000000000 --- a/mozilla/xpcom/ds/nsByteBuffer.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsIByteBuffer.h" -#include "nsIInputStream.h" -#include "nsCRT.h" - -#define MIN_BUFFER_SIZE 32 - -class ByteBufferImpl : public nsIByteBuffer { -public: - ByteBufferImpl(PRInt32 aBufferSize); - ~ByteBufferImpl(); - - NS_DECL_ISUPPORTS - virtual PRInt32 GetLength() const; - virtual PRInt32 GetBufferSize() const; - virtual char* GetBuffer() const; - virtual PRBool Grow(PRInt32 aNewSize); - virtual PRInt32 Fill(PRInt32* aErrorCode, nsIInputStream* aStream, - PRInt32 aKeep); - - char* mBuffer; - PRInt32 mSpace; - PRInt32 mLength; -}; - -ByteBufferImpl::ByteBufferImpl(PRInt32 aBufferSize) -{ - if (PRUint32(aBufferSize) < MIN_BUFFER_SIZE) { - aBufferSize = MIN_BUFFER_SIZE; - } - mSpace = aBufferSize; - mBuffer = new char[aBufferSize]; - mLength = 0; - NS_INIT_REFCNT(); -} - -NS_DEFINE_IID(kByteBufferIID,NS_IBYTE_BUFFER_IID); -NS_IMPL_ISUPPORTS(ByteBufferImpl,kByteBufferIID) - -ByteBufferImpl::~ByteBufferImpl() -{ - if (nsnull != mBuffer) { - delete mBuffer; - mBuffer = nsnull; - } - mLength = 0; -} - -PRInt32 ByteBufferImpl::GetLength() const -{ - return mLength; -} - -PRInt32 ByteBufferImpl::GetBufferSize() const -{ - return mSpace; -} - -char* ByteBufferImpl::GetBuffer() const -{ - return mBuffer; -} - -PRBool ByteBufferImpl::Grow(PRInt32 aNewSize) -{ - if (PRUint32(aNewSize) < MIN_BUFFER_SIZE) { - aNewSize = MIN_BUFFER_SIZE; - } - char* newbuf = new char[aNewSize]; - if (nsnull != newbuf) { - if (0 != mLength) { - nsCRT::memcpy(newbuf, mBuffer, mLength); - } - delete mBuffer; - mBuffer = newbuf; - return PR_TRUE; - } - return PR_FALSE; -} - -PRInt32 ByteBufferImpl::Fill(PRInt32* aErrorCode, nsIInputStream* aStream, - PRInt32 aKeep) -{ - NS_PRECONDITION(nsnull != aStream, "null stream"); - NS_PRECONDITION(PRUint32(aKeep) <= PRUint32(mLength), "illegal keep count"); - if ((nsnull == aStream) || (PRUint32(aKeep) > PRUint32(mLength))) { - // whoops - *aErrorCode = NS_INPUTSTREAM_ILLEGAL_ARGS; - return -1; - } - - if (0 != aKeep) { - // Slide over kept data - nsCRT::memmove(mBuffer, mBuffer + (mLength - aKeep), aKeep); - } - - // Read in some new data - mLength = aKeep; - PRInt32 amount = mSpace - aKeep; - PRInt32 nb = aStream->Read(aErrorCode, mBuffer, aKeep, amount); - if (nb > 0) { - mLength += nb; - } - return nb; -} - -NS_BASE nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult, - nsISupports* aOuter, - PRInt32 aBufferSize) -{ - if (nsnull != aOuter) { - return NS_ERROR_NO_AGGREGATION; - } - ByteBufferImpl* it = new ByteBufferImpl(aBufferSize); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kByteBufferIID, (void **) aInstancePtrResult); -} diff --git a/mozilla/xpcom/ds/nsCRT.cpp b/mozilla/xpcom/ds/nsCRT.cpp deleted file mode 100644 index c4ac141a2ad..00000000000 --- a/mozilla/xpcom/ds/nsCRT.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#include "nsCRT.h" - -// XXX Bug: These tables don't lowercase the upper 128 characters properly - -// This table maps uppercase characters to lower case characters; -// characters that are neither upper nor lower case are unaffected. -static const unsigned char kUpper2Lower[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, - - // upper band mapped to lower [A-Z] => [a-z] - 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, - - 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static const unsigned char kLower2Upper[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, - - // lower band mapped to upper [a-z] => [A-Z] - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - - 123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static const PRUnichar kIsoLatin1ToUCS2[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -//---------------------------------------------------------------------- - -#define TOLOWER(_ucs2) \ - (((_ucs2) < 256) ? PRUnichar(kUpper2Lower[_ucs2]) : _ToLower(_ucs2)) - -#define TOUPPER(_ucs2) \ - (((_ucs2) < 256) ? PRUnichar(kLower2Upper[_ucs2]) : _ToUpper(_ucs2)) - -static PRUnichar _ToLower(PRUnichar aChar) -{ - // XXX need i18n code here - return aChar; -} - -static PRUnichar _ToUpper(PRUnichar aChar) -{ - // XXX need i18n code here - return aChar; -} - -//---------------------------------------------------------------------- - -PRUnichar nsCRT::ToUpper(PRUnichar aChar) -{ - return TOUPPER(aChar); -} - -PRUnichar nsCRT::ToLower(PRUnichar aChar) -{ - return TOLOWER(aChar); -} - -PRInt32 nsCRT::strlen(const PRUnichar* s) -{ - PRInt32 len = 0; - while (*s++ != 0) { - len++; - } - return len; -} - -PRInt32 nsCRT::strcmp(const PRUnichar* s1, const PRUnichar* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -// characters following a null character are not compared -PRInt32 nsCRT::strncmp(const PRUnichar* s1, const PRUnichar* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const PRUnichar* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const PRUnichar* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strcmp(const PRUnichar* s1, const char* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strncmp(const PRUnichar* s1, const char* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const char* s2) -{ - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const char* s2, PRInt32 n) -{ - while (--n >= 0) { - PRUnichar c1 = *s1++; - PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++]; - if (c1 != c2) { - c1 = TOLOWER(c1); - c2 = TOLOWER(c2); - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - } - if (c1 == 0) break; - } - return 0; -} - -PRInt32 nsCRT::HashCode(const PRUnichar* us) -{ - PRInt32 rv = 0; - PRUnichar ch; - while ((ch = *us++) != 0) { - // FYI: rv = rv*37 + ch - rv = ((rv << 5) + (rv << 2) + rv) + ch; - } - return rv; -} - -PRInt32 nsCRT::HashCode(const PRUnichar* us, PRInt32* uslenp) -{ - PRInt32 rv = 0; - PRInt32 len = 0; - PRUnichar ch; - while ((ch = *us++) != 0) { - // FYI: rv = rv*37 + ch - rv = ((rv << 5) + (rv << 2) + rv) + ch; - len++; - } - *uslenp = len; - return rv; -} - -PRInt32 nsCRT::atoi( const PRUnichar *string ) -{ - return atoi(string); -} - diff --git a/mozilla/xpcom/ds/nsCRT.h b/mozilla/xpcom/ds/nsCRT.h deleted file mode 100644 index a14ed2bbcb5..00000000000 --- a/mozilla/xpcom/ds/nsCRT.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ -#ifndef nsCRT_h___ -#define nsCRT_h___ - -#include -#include -#include "plstr.h" -#include "nscore.h" - -/// This is a wrapper class around all the C runtime functions. - -class NS_BASE nsCRT { -public: - /** Copy bytes from aSrc to aDest. - @param aDest the destination address - @param aSrc the source address - @param aCount the number of bytes to copy - */ - static void memcpy(void* aDest, const void* aSrc, PRInt32 aCount) { - ::memcpy(aDest, aSrc, (size_t)aCount); - } - - static void memmove(void* aDest, const void* aSrc, PRInt32 aCount) { - ::memmove(aDest, aSrc, (size_t)aCount); - } - - static void memset(void* aDest, PRUint8 aByte, PRInt32 aCount) { - ::memset(aDest, aByte, aCount); - } - - static void zero(void* aDest, PRInt32 aCount) { - ::memset(aDest, 0, (size_t)aCount); - } - - /** Compute the string length of s - @param s the string in question - @return the length of s - */ - static PRInt32 strlen(const char* s) { - return PRInt32(::strlen(s)); - } - - /// Compare s1 and s2. - static PRInt32 strcmp(const char* s1, const char* s2) { - return PRInt32(PL_strcmp(s1, s2)); - } - - /// Case-insensitive string comparison. - static PRInt32 strcasecmp(const char* s1, const char* s2) { - return PRInt32(PL_strcasecmp(s1, s2)); - } - - /// Like strlen except for ucs2 strings - static PRInt32 strlen(const PRUnichar* s); - - /// Like strcmp except for ucs2 strings - static PRInt32 strcmp(const PRUnichar* s1, const PRUnichar* s2); - /// Like strcmp except for ucs2 strings - static PRInt32 strncmp(const PRUnichar* s1, const PRUnichar* s2, - PRInt32 aMaxLen); - - /// Like strcasecmp except for ucs2 strings - static PRInt32 strcasecmp(const PRUnichar* s1, const PRUnichar* s2); - /// Like strncasecmp except for ucs2 strings - static PRInt32 strncasecmp(const PRUnichar* s1, const PRUnichar* s2, - PRInt32 aMaxLen); - - /// Like strcmp with a char* and a ucs2 string - static PRInt32 strcmp(const PRUnichar* s1, const char* s2); - /// Like strncmp with a char* and a ucs2 string - static PRInt32 strncmp(const PRUnichar* s1, const char* s2, - PRInt32 aMaxLen); - - /// Like strcasecmp with a char* and a ucs2 string - static PRInt32 strcasecmp(const PRUnichar* s1, const char* s2); - /// Like strncasecmp with a char* and a ucs2 string - static PRInt32 strncasecmp(const PRUnichar* s1, const char* s2, - PRInt32 aMaxLen); - - /// Compute a hashcode for a ucs2 string - static PRInt32 HashCode(const PRUnichar* s1); - - /// Same as above except that we return the length in s1len - static PRInt32 HashCode(const PRUnichar* s1, PRInt32* s1len); - - /// String to integer. - static PRInt32 atoi( const PRUnichar *string ); - - static PRUnichar ToUpper(PRUnichar aChar); - - static PRUnichar ToLower(PRUnichar aChar); -}; - -#endif /* nsCRT_h___ */ diff --git a/mozilla/xpcom/ds/nsDeque.cpp b/mozilla/xpcom/ds/nsDeque.cpp deleted file mode 100644 index aa7ca4e027c..00000000000 --- a/mozilla/xpcom/ds/nsDeque.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - - -#include "nsDeque.h" - -/** - * Standard constructor - * @update gess4/18/98 - * @return new deque - */ -nsDeque::nsDeque(PRBool aOwnsMemory) { - mOwnsMemory=aOwnsMemory; - mCapacity=eGrowthDelta; - mOrigin=mSize=0; - mData=new void*[mCapacity]; -} - - -/** - * Destructor - * @update gess4/18/98 - */ -nsDeque::~nsDeque() { - if(mOwnsMemory) - Erase(); - delete [] mData; - mData=0; - mOwnsMemory=PR_FALSE; -} - - -/** - * Returns the number of elements currently stored in - * this deque. - * - * @update gess4/18/98 - * @param - * @return int contains element count - */ -PRInt32 nsDeque::GetSize(void) const { - return mSize; -} - -/** - * Remove all items from container without destroying them. - * - * @update gess4/18/98 - * @param - * @return - */ -nsDeque& nsDeque::Empty() { - for(int i=0;i0) { - result=mData[mOrigin]; - mData[mOrigin++]=0; //zero it out for debugging purposes. - mSize--; - if(0==mSize) - mOrigin=0; - } - return result; -} - -/** - * Call this to retrieve the ith element from this container. - * Keep in mind that accessing the underlying elements is - * done in a relative fashion. Object 0 is not necessarily - * the first element (the first element is at mOrigin). - * - * @update gess4/18/98 - * @param anIndex : 0 relative offset of item you want - * @return void* or null - */ -void* nsDeque::ObjectAt(PRInt32 anIndex) const { - void* result=0; - - if((anIndex>=0) && (anIndexoperator==(anIter)); -} - - -/** - * Compare 2 iterators for equivalence. - * - * @update gess4/18/98 - * @param anIter is the other iterator to be compared to - * @return TRUE if EQUAL - */ -PRBool nsDequeIterator::operator<(nsDequeIterator& anIter) { - return PRBool(((mIndex=(nsDequeIterator& anIter) { - return PRBool(((mIndex>=anIter.mIndex) && (&mDeque==&anIter.mDeque))); -} - -/** - * Pre-increment operator - * - * @update gess4/18/98 - * @return object at preincremented index - */ -void* nsDequeIterator::operator++() { - return mDeque.ObjectAt(++mIndex); -} - -/** - * Post-increment operator - * - * @update gess4/18/98 - * @param param is ignored - * @return object at post-incremented index - */ -void* nsDequeIterator::operator++(int) { - return mDeque.ObjectAt(mIndex++); -} - -/** - * Pre-decrement operator - * - * @update gess4/18/98 - * @return object at pre-decremented index - */ -void* nsDequeIterator::operator--() { - return mDeque.ObjectAt(--mIndex); -} - -/** - * Post-decrement operator - * - * @update gess4/18/98 - * @param param is ignored - * @return object at post-decremented index - */ -void* nsDequeIterator::operator--(int) { - return mDeque.ObjectAt(mIndex--); -} - -/** - * Dereference operator - * - * @update gess4/18/98 - * @return object at ith index - */ -void* nsDequeIterator::GetCurrent(void) { - return mDeque.ObjectAt(mIndex); -} - -/** - * Call this method when you wanto to iterate all the - * members of the container, passing a functor along - * to call your code. - * - * @update gess4/20/98 - * @param aFunctor object to call for each member - * @return *this - */ -const nsDequeIterator& nsDequeIterator::ForEach(nsDequeFunctor& aFunctor) const{ - mDeque.ForEach(aFunctor); - return *this; -} - - -/** - * conduct automated self test for this class - * - * @update gess4/18/98 - * @param - * @return - */ -void nsDeque::SelfTest(void) { -#undef _SELFTEST_DEQUE -#ifdef _SELFTEST_DEQUE -#include - - { - nsDeque theDeque(PR_FALSE); //construct a simple one... - - int ints[10]={100,200,300,400,500,600,700,800,900,1000}; - int count=sizeof(ints)/sizeof(int); - - for(int i=0;i